Electricity spot sub-period price forecasting method based on times fm and similar day enhancement

CN122989190APending Publication Date: 2026-10-27SHANDONG YUEHANG ENERGY TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611470203.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-21
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

然而,电力现货价格在凌晨、平段、尖峰和谷段等不同时间区间往往具有不同的形成机理和波动特征,若采用单一整日模型统一处理,容易弱化不同时段之间的差异性表达,从而影响预测精度

Benefits of technology

[0062]本发明通过构建聚合相似日价格曲线和时滞相似日价格曲线两个相互独立的价格增强通道,其中,聚合相似日价格曲线由与目标日外生特征形态相匹配的历史日电价融合形成,时滞相似日价格曲线由目标日前近期历史日电价按照时间距离衰减加权形成,并将两类价格增强序列与目标日外生特征共同作为数值协变量输入时间序列预测模型,使模型能够同时利用历史结构相似信息和近期价格变化信息,在不使用目标日真实电价的条件下完成目标日电价预测。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122989190A_ABST
    Figure CN122989190A_ABST
Patent Text Reader

Abstract

The application discloses a power spot time-of-use price prediction method based on TimesFM and similar day enhancement. The method aligns the business day of the historical price and the external characteristics influencing the price, and screens complete historical days. The feature weight is determined according to the correlation degree of the external characteristics of the historical day and the price, and the external characteristics of the target day are matched with the historical days to generate an aggregated similar day price curve. Meanwhile, the time lag similar day price curve is generated according to the recent historical day price. The two types of price curves and the external characteristics of the target day are jointly input into a pre-trained time sequence prediction model, the target day complete price prediction result is obtained by time-of-use prediction and time sequence splicing, and the method is suitable for day-ahead price and real-time price prediction.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of electricity spot market price prediction, and particularly relates to a power spot sub-period electricity price prediction method based on TimesFM and similar day enhancement. BACKGROUND

[0002] Electricity price prediction is one of the key technologies in power market operation analysis and transaction auxiliary decision-making. With the continuous advancement of power market reform and large-scale grid connection of new energy, the electricity price formation process gradually presents the characteristics of the joint action of multiple factors, and the volatility, time-varying and complexity of price changes continue to increase. The day-ahead electricity price and the real-time electricity price in the electricity spot market have the characteristics of strong non-stationarity, obvious differences between sub-periods, multiple influencing factors and mutual coupling, and belong to the typical complex time series problem in the field of electricity market prediction. In actual business, the price sequence is usually influenced by multiple factors such as load level, weather conditions, new energy output, unit operation state, market transaction behavior and business day structure, so it often presents different price levels and fluctuation rules in different dates and different time periods.

[0003] The existing electricity price prediction method usually adopts a unified modeling method for the whole day, and predicts the 24 time points of the target day as a whole. However, the electricity spot price in the early morning, flat segment, peak and valley segment often has different formation mechanisms and fluctuation characteristics. If a single daily model is used for unified processing, the differences between different time periods are likely to be weakened, thereby affecting the prediction accuracy.

[0004] In addition, although the existing basic model or large model prediction scheme has strong time series modeling capability, it is still difficult to stably depict the structural fluctuations, sudden deviations and time period evolution characteristics in the electricity spot price if it lacks the support of dynamic numerical covariates closely related to the electricity price formation mechanism. Especially for the day-ahead electricity price and the real-time electricity price which are strongly driven by exogenous variables, it is often difficult to fully improve the prediction stability and business adaptability by relying only on general time series modeling capability.

[0005] Therefore, how to provide a power spot sub-period electricity price prediction method based on TimesFM and similar day enhancement is a problem that those skilled in the art need to solve. SUMMARY

[0006] One purpose of the present application is to propose a power spot sub-period price prediction method based on TimesFM and similar day enhancement, the present application realizes complete prediction of day-ahead price and real-time price by business day realignment, historical feature explanation weight calculation, aggregation of similar day price curve and time lag similar day price curve construction, and combining TimesFM time series model for target day sub-period prediction and result splicing, which has the advantages of strong pertinence of similar day screening, low dependence of target day real price, sufficient description of sub-period price characteristics and high prediction accuracy.

[0007] The power spot sub-period price prediction method based on TimesFM and similar day enhancement according to the embodiment of the present application comprises the following steps:

[0008] A business day realignment module acquires historical price, historical exogenous features and target day exogenous features, reverses the time index by one sampling step, and generates a unified business day sequence;

[0009] A historical sample module screens complete historical days according to the unified business day sequence, forms a historical day price tensor, a historical day exogenous feature tensor and a target day exogenous feature matrix;

[0010] An explanation weight module calculates the correlation of the exogenous feature curve and the day price curve in each historical day and normalizes it to generate a historical day feature explanation weight;

[0011] A dual-channel similar day module calculates the feature-by-feature similarity between the target day and each historical day in the historical days before the prediction reference day, aggregates the historical day similarity according to the corresponding feature explanation weight, selects the highest number of historical days with the highest similarity and weights the day price to form an aggregated similar day price curve, and at the same time, forms a time lag similar day price curve by weighting the historical day price of the target day according to the time distance decay;

[0012] A sub-period prediction module divides the target day according to the preset boundary, aligns the target day exogenous features, the aggregated similar day price curve and the time lag similar day price curve according to the period to form dynamic numerical covariates, and inputs them into TimesFM together with the historical price context to obtain a sub-period price prediction sequence;

[0013] A result splicing module splices the sub-period price prediction sequence according to the time sequence of the target day to generate a complete power spot price prediction sequence.

[0014] Optionally, the business day realignment module comprises:

[0015] The time stamps corresponding to the historical price, the historical exogenous features and the target day exogenous features are acquired, the original time index is established according to the same sampling frequency, and the time interval between adjacent two sampling times is determined as the sampling step;

[0016] The backtracking is performed on each sampling time in the original time index based on a sampling step length, to obtain a realignment time corresponding to each original sampling time, , represents the th original sampling time, represents the th realignment time, represents the sampling step length;

[0017] The natural date corresponding to each realignment time is extracted, and the natural date is configured as a business day identifier of the corresponding sampling data;

[0018] Based on the time position of each realignment time in the corresponding business day, an intra-day step sequence is generated, and the realignment times in the same business day are continuously ordered according to the sampling step length;

[0019] According to the business day identifier and the intra-day step sequence, the historical electricity price, the historical exogenous feature and the target day exogenous feature are respectively indexed and mapped to the corresponding realignment time, and are grouped according to the business day identifier and sorted within the group according to the intra-day step sequence;

[0020] The realignment time, the business day identifier, the intra-day step sequence and the corresponding historical electricity price, historical exogenous feature and target day exogenous feature after grouping and sorting are associated in time sequence, to generate a unified business day sequence.

[0021] Optionally, the historical sample module comprises:

[0022] The unified business day sequence is received, the historical electricity price and the historical exogenous feature are grouped according to the business day identifier, and the preset intra-day step number corresponding to each business day is determined according to the sampling frequency ;

[0023] For each historical business day, the number of sampling points and the number of intra-day step sequences are counted, and it is detected whether the historical electricity price and the historical exogenous feature participating in the prediction exist missing values, and the historical business day whose number of sampling points is equal to , the number of intra-day step sequences is equal to , and the corresponding historical electricity price and historical exogenous feature are complete, is retained to form a complete historical day set;

[0024] For each historical day in the complete historical day set, the corresponding sampling data is arranged according to the intra-day step sequence, the historical electricity price corresponding to each intra-day step sequence is sequentially combined into a historical day electricity price vector, and each historical exogenous feature under the same intra-day step sequence is arranged and combined into a historical day exogenous feature matrix according to a fixed feature order;

[0025] Each historical day electricity price vector and each historical day exogenous feature matrix is respectively stacked according to the business day time sequence, to form: , wherein For historical daily electricity price tensor, For historical exogenous feature tensor, For the complete historical number of days, The number of exogenous features;

[0026] Extract the target day's exogenous features from the unified business day sequence, arrange them according to the same feature order and intraday step order as the historical day's exogenous feature matrix to form the target day's exogenous feature matrix, and output the historical day's daily price tensor, the historical day's exogenous feature tensor, and the target day's exogenous feature matrix.

[0027] Optionally, the interpretation weight module includes:

[0028] Receive the historical daily price tensor and the historical daily exogenous feature tensor, extract the historical daily price vector from the historical daily price tensor day by day according to the complete historical day index, and extract the historical daily exogenous feature matrix that matches the corresponding historical day from the historical daily exogenous feature tensor;

[0029] For each historical business day Indexed by exogenous features Extract intraday curves corresponding to exogenous features from historical daily exogenous feature matrix. And vectorize the intraday curve with the historical daily price of the same historical business day. Follow the same intraday sequence;

[0030] The correlation between the intraday curves of each exogenous feature and the corresponding historical electricity price vector is calculated using the Pearson correlation coefficient, thus obtaining the feature-electricity price correlation:

[0031] ;

[0032] in, Indicates historical business days The Middle The correlation between exogenous characteristics and historical electricity prices This indicates the calculation of the Pearson correlation coefficient. Indicates historical business days The Middle An intraday curve with exogenous characteristics, Indicates historical business days Historical daily electricity price vector;

[0033] For each feature-electricity price correlation within the same historical business day, take the absolute value and perform Softmax normalization along the exogenous feature dimension to obtain the historical day feature explanation weights corresponding to each exogenous feature:

[0034] ;

[0035] wherein, represent historical business days in the first exogenous feature corresponding to the historical day feature interpretation weight;

[0036] According to the historical business day index and the exogenous feature index, each historical day feature interpretation weight is arranged to form a feature interpretation weight set corresponding to each historical business day, and the feature interpretation weight set is output.

[0037] Optionally, the double-channel similar day module comprises:

[0038] The target day exogenous feature matrix, the historical day exogenous feature tensor, the historical day price tensor and the historical day feature interpretation weight set are received, the historical business day strictly earlier than the historical boundary of the day before the benchmark day is filtered from the complete historical day set, and the candidate historical day set is established according to the business day time sequence;

[0039] For each historical business day in the candidate historical day set, the candidate historical day exogenous feature curve and the target day exogenous feature curve are extracted according to the exogenous feature index and the intra-day step sequence consistent with the target day exogenous feature matrix, and the Pearson correlation degree of the two is calculated feature by feature:

[0040] ;

[0041] wherein, and represent the intra-day curve of the first exogenous feature of the target day and the candidate historical day ;

[0042] The interpretation weight of the candidate historical day corresponding to each exogenous feature is read from the historical day feature interpretation weight set, the absolute value of each feature-wise correlation degree is taken, and then multiplied by the corresponding interpretation weight, and then summed along the exogenous feature dimension to obtain the aggregation similarity corresponding to the candidate historical day;

[0043] The candidate historical days are arranged in descending order of aggregation similarity, and the top candidate historical days are selected, the corresponding historical day price vectors are read, and the aggregation similarity of each candidate historical day is normalized to a day price fusion weight, and the top historical day price vectors are weighted and summed according to the day price fusion weight along the intra-day step sequence to form an aggregated similar day price curve consistent with the intra-day step sequence length of the target day.

[0044] The most recent a historical day price vector, determining time interval numbers in order from near to far to a target day, and generating exponential decay weights according to the time interval numbers and a time decay coefficient, normalizing each exponential decay weight, and performing weighted summation on the nearest a historical day price vector, determining time interval numbers in order from near to far to a target day, and generating exponential decay weights according to the time interval numbers and a time decay coefficient, normalizing each exponential decay weight, and performing weighted summation on the nearest

[0045] arranging the aggregated similar day price curve and the time lag similar day price curve according to the intra-day step sequence of the target day, respectively, to form two price enhancement sequences consistent with the time dimension of the target day exogenous feature matrix.

[0046] Optionally, the time-division prediction module comprises:

[0047] receiving a historical day price tensor, a target day exogenous feature matrix, an aggregated similar day price curve, and a time lag similar day price curve, determining a complete prediction interval according to the intra-day step sequence of the target day, and dividing the complete prediction interval into a plurality of prediction time periods that are continuous at the beginning and end and do not overlap each other according to preset time period boundaries, recording the starting intra-day step sequence, the ending intra-day step sequence, and the corresponding prediction step number for each prediction time period;

[0048] For each complete historical day in the historical sample, a corresponding historical aggregated similar day price curve and a historical time lag similar day price curve are generated in advance and are unfolded according to the intra-day step sequence in the unified business day sequence to form a historical dual-channel price enhancement sequence;

[0049] For any prediction time period, according to the starting intra-day step sequence and the ending intra-day step sequence of the prediction time period, historical price segments within the same intra-day step sequence range are intercepted from the historical price sequence for each historical business day, and each historical price segment is arranged in chronological order of the historical business day, and the arranged historical price segment is constructed into a historical price context window corresponding to the current prediction time period;

[0050] According to the intra-day step sequence range of the current prediction time period, data corresponding to the time position of the historical price context window are extracted from the historical exogenous feature, the historical aggregated similar day price curve, and the historical time lag similar day price curve, respectively, and the historical exogenous feature, the historical aggregated similar day price, and the historical time lag similar day price are aligned point by point according to the time index to form a historical covariate sequence corresponding to the historical price context window;

[0051] According to the same starting intraday step sequence and the ending intraday step sequence, data corresponding to the current prediction period is intercepted from the target extrinsic feature matrix, the aggregated similar day price curve and the time lag similar day price curve respectively, and the target extrinsic feature, the aggregated similar day price and the time lag similar day price are arranged in the same feature order as the historical covariate sequence, wherein the aggregated similar day price and the time lag similar day price occupy independent numerical covariate channels respectively, to form a target covariate sequence corresponding to the current prediction period;

[0052] According to the same feature channel and the same intraday step sequence organization rule of the historical covariate sequence and the target covariate sequence, the historical covariate sequence is configured in the context interval corresponding to the historical price context window, the target covariate sequence is configured in the prediction interval corresponding to the current prediction period, and the time period feature and the time interval feature are written in the context interval and the prediction interval respectively according to the corresponding time index, to form a continuous covariate input sequence covering the historical context and the target prediction period;

[0053] The historical price context window is taken as the target sequence context of TimesFM, the continuous covariate input sequence is input together with the target sequence context through the XReg covariate input mode of TimesFM, inference is performed according to the prediction step number corresponding to the current prediction period, and the prediction value output by TimesFM in the prediction step number range is extracted to form a current period price prediction sequence according to the intraday step sequence of the current prediction period;

[0054] According to the time sequence of each prediction period in the target day, the historical price context window interception, the historical covariate sequence construction, the target covariate sequence construction and the TimesFM inference process are repeated respectively, so that each prediction period forms a corresponding price prediction sequence, and all period price prediction sequences are output.

[0055] Optionally, the result splicing module comprises:

[0056] Each period price prediction sequence is received, and the starting intraday step sequence, the ending intraday step sequence and the prediction step number corresponding to each period are received, each period price prediction sequence is sorted in ascending order of the starting intraday step sequence, and a corresponding relationship between each period price prediction sequence and the intraday step sequence interval of the target day is established;

[0057] For any sorted period price prediction sequence, the price prediction value is read point by point according to the starting intraday step sequence to the ending intraday step sequence of the period, and each price prediction value is written in the intraday step sequence position of the target day in turn, so that the arrangement order of each price prediction value in the same period is consistent with the intraday step sequence arrangement order of the period;

[0058] After the current period electricity price prediction value is written, the next period starting intra-day step sequence is read as a boundary, and the first electricity price prediction value of the next period is configured at the corresponding starting intra-day step sequence position, and the continuous splicing of the entire period electricity price prediction sequence is completed in sequence according to the time sequence of each period in the target day;

[0059] After the splicing of all periods is completed, the electricity price prediction values corresponding to each position are read in sequence according to the target day first intra-day step sequence to the last intra-day step sequence, and the target day electricity price prediction sequence corresponding to the complete intra-day step sequence of the target day is formed;

[0060] According to the time index corresponding to the target day in the unified business day sequence, the electricity price prediction values in the target day electricity price prediction sequence are associated with the corresponding time position, and are arranged according to the original business day time sequence to generate a complete electricity spot price prediction sequence.

[0061] The beneficial effects of the present application are:

[0062] The present application constructs two independent price enhancement channels of the aggregated similar day price curve and the time lag similar day price curve, wherein the aggregated similar day price curve is formed by fusing the historical day electricity price matching the exogenous feature form of the target day, the time lag similar day price curve is formed by the recent historical day electricity price of the target day according to the time distance decay weighting, and the two types of price enhancement sequences and the exogenous features of the target day are jointly used as numerical covariants to input the time sequence prediction model, so that the model can simultaneously use the historical structural similar information and the recent price change information to complete the target day electricity price prediction without using the real electricity price of the target day.

[0063] The present application divides the complete target day into multiple continuous prediction periods according to the preset boundary, constructs a historical electricity price context window for each period, organizes the exogenous features of the target day, the aggregated similar day price curve, the time lag similar day price curve and the corresponding time features as covariants to input the time sequence prediction model according to the same time position, obtains the electricity price prediction sequence of each period, and splices in sequence according to the target day time sequence, thereby avoiding the way of using a single whole day model to uniformly process the price formation rules of different periods, so that the early morning, flat segment, peak segment and other continuous periods can be predicted by using the historical data and enhancement features corresponding to their time positions, and finally a complete target day electricity spot price prediction sequence is formed. BRIEF DESCRIPTION OF DRAWINGS

[0064] The accompanying drawings are included to provide a further understanding of the present application, and constitute a part of the specification, together with the embodiments of the present application, to explain the present application, and do not constitute a limitation on the present application. In the drawings:

[0065] Figure 1 The overall prediction framework flowchart proposed by the present application;

[0066] Figure 2 A similar day construction flowchart is provided for the present application. DETAILED DESCRIPTION

[0067] The present application will now be further described in detail with reference to the drawings. These drawings are simplified schematic diagrams which only show the basic structure of the present application in a schematic manner, and thus only show the components relevant to the present application.

[0068] Reference Figures 1-2 The power spot time-of-use price prediction method based on TimesFM and similar day enhancement includes the following steps:

[0069] A business day realignment module obtains historical electricity prices, historical exogenous characteristics, and target day exogenous characteristics, reverses the time index by one sampling step, and generates a unified business day sequence.

[0070] A historical sample module filters complete historical days according to the unified business day sequence to form a historical day electricity price tensor, a historical day exogenous characteristic tensor, and a target day exogenous characteristic matrix.

[0071] An explanation weight module calculates the correlation between the exogenous characteristic curve and the day electricity price curve in each historical day and normalizes it to generate a historical day characteristic explanation weight.

[0072] A dual-channel similar day module calculates the feature-by-feature similarity between the target day and each historical day in the historical days before the prediction reference day, aggregates the historical day similarity according to the corresponding feature explanation weight, selects the highest number of preset historical days with the highest similarity, and forms an aggregated similar day price curve by weighting the day electricity price, and at the same time, forms a time-lag similar day price curve by weighting the electricity price of the preset number of consecutive historical days before the target day according to the time distance decay.

[0073] A time-of-use prediction module divides the target day according to the preset boundary, aligns the target day exogenous characteristics, the aggregated similar day price curve, and the time-lag similar day price curve according to the time period to form dynamic numerical covariates, and inputs them together with the historical electricity price context into TimesFM to obtain the electricity price prediction sequence of each time period.

[0074] A result splicing module is used to splice the electricity price prediction sequence of each time period in the target day time sequence to generate a complete electricity spot price prediction sequence.

[0075] In this embodiment, the business day realignment module includes:

[0076] The timestamps corresponding to the historical electricity prices, historical exogenous characteristics, and target day exogenous characteristics are obtained, the original time index is established according to the same sampling frequency, and the time interval between adjacent two sampling times is determined as the sampling step.

[0077] Based on the sampling step size, a rollback process is performed on each sampling moment in the original time index to obtain the realigned moments that correspond one-to-one with each original sampling moment. , Indicates the first Each original sampling time, Indicates the first Individual alignment moments, Indicates the sampling step size;

[0078] Extract the natural date corresponding to each realignment time, configure the natural date as the business day identifier of the corresponding sampled data, so that the sampled data corresponding to the first settlement time of the day to the last settlement time of the next day in the original time index are mapped to the same business day;

[0079] Based on the time position of each realignment moment in the corresponding business day, an intraday step sequence is generated, and the realignment moments within the same business day are continuously sorted according to the sampling step size, so that the first settlement moment of the day in the original time index is mapped to the first intraday step sequence of the business day, and the last settlement moment of the next day is mapped to the last intraday step sequence of the same business day.

[0080] Based on the business day identifier and intraday step sequence, establish index mappings between historical electricity prices, historical exogenous features, and target day exogenous features and their corresponding realignment times, and group them according to the business day identifier and sort them within the group according to the intraday step sequence;

[0081] The realignment time after grouping and sorting, business day identifier, intraday step sequence and corresponding historical electricity price, historical exogenous features and target day exogenous features are associated in chronological order to generate a unified business day sequence.

[0082] In this embodiment, the historical sample module includes:

[0083] The system receives a unified business day sequence, groups historical electricity prices and historical exogenous features according to the business day identifier, and determines the preset number of intraday steps for each business day based on the sampling frequency. ;

[0084] For each historical business day, the number of sampling points and the number of duplicate steps within the day are counted. The system also checks for missing values ​​in historical electricity prices and historical exogenous features used in the forecast. The number of retained sampling points is equal to... The number of duplicates removed in the daily step sequence equals Furthermore, the historical business days with complete historical electricity prices and historical exogenous characteristics form a complete set of historical days;

[0085] For each historical day in the complete set of historical days, the corresponding sampled data are arranged according to the intra-day step order. The historical electricity prices corresponding to each intra-day step order are combined into a historical electricity price vector. The historical exogenous features under the same intra-day step order are arranged and combined into a historical day exogenous feature matrix according to a fixed feature order.

[0086] Stack the historical daily price vectors and exogenous feature matrices for each historical day according to the business day time sequence to form: ,in, For historical daily electricity price tensor, For historical exogenous feature tensor, For the complete historical number of days, The number of exogenous features;

[0087] Extract the target day's exogenous features from the unified business day sequence, arrange them according to the same feature order and intraday step order as the historical day's exogenous feature matrix to form the target day's exogenous feature matrix, and output the historical day's daily price tensor, the historical day's exogenous feature tensor, and the target day's exogenous feature matrix.

[0088] In this embodiment, the interpretation weight module includes:

[0089] Receive the historical daily price tensor and the historical daily exogenous feature tensor, extract the historical daily price vector from the historical daily price tensor day by day according to the complete historical day index, and extract the historical daily exogenous feature matrix that matches the corresponding historical day from the historical daily exogenous feature tensor;

[0090] For each historical business day Indexed by exogenous features Extract intraday curves corresponding to exogenous features from historical daily exogenous feature matrix. And vectorize the intraday curve with the historical daily price of the same historical business day. Follow the same intraday sequence;

[0091] The correlation between the intraday curves of each exogenous feature and the corresponding historical electricity price vector is calculated using the Pearson correlation coefficient, thus obtaining the feature-electricity price correlation:

[0092] ;

[0093] in, Indicates historical business days The Middle The correlation between exogenous characteristics and historical electricity prices This indicates the calculation of the Pearson correlation coefficient. Indicates historical business days The Middle An intraday curve with exogenous characteristics, Indicates historical business days Historical daily electricity price vector;

[0094] For each feature-electricity price correlation within the same historical business day, take the absolute value and perform Softmax normalization along the exogenous feature dimension to obtain the historical day feature explanation weights corresponding to each exogenous feature:

[0095] ;

[0096] in, Indicates historical business days The Middle The historical daily feature explanatory weights corresponding to each exogenous feature;

[0097] The feature interpretation weights of each historical day are arranged according to the historical business day index and the exogenous feature index, forming a feature interpretation weight set that corresponds to each historical business day, and the feature interpretation weight set is output to the dual-channel similar day module.

[0098] In this embodiment, the dual-channel similar day module includes:

[0099] The system receives the target day exogenous feature matrix, historical day exogenous feature tensor, historical day price tensor and historical day feature interpretation weight set. Using the day before the prediction benchmark as the historical boundary, it filters historical business days that are strictly earlier than the historical boundary from the complete historical day set and establishes a candidate historical day set according to the business day time order.

[0100] For each historical business day in the candidate historical day set, exogenous feature curves for both the candidate historical day and the target day are extracted according to the exogenous feature index and intraday step order consistent with the exogenous feature matrix of the target day. The Pearson correlation between the two is then calculated for each feature.

[0101] ;

[0102] in, and They represent the target date. With candidate historical day The An exogenous characteristic intraday curve;

[0103] Candidate historical days are read from the set of historical day feature interpretation weights. The explanatory weights for each exogenous feature are used to calculate the aggregate similarity of each feature-wise relevance. The absolute value of each feature-wise relevance is multiplied by the corresponding explanatory weight, and then summed along the exogenous feature dimension to obtain the aggregate similarity of the candidate historical day.

[0104] Candidate historical days were sorted from highest to lowest based on aggregation similarity, and the previous ones were selected. For each candidate historical day, the corresponding historical daily electricity price vector is read, and the aggregation similarity of each candidate historical day is normalized into a daily electricity price fusion weight. The previous days are then ranked according to the daily electricity price fusion weight. The historical daily price vectors are weighted and summed sequentially over each day to form an aggregated similar daily price curve with the same length as the target day's intraday step sequence.

[0105] Extracting the target date from the historical electricity price tensor. The daily price vector for each historical business day is used to determine the time interval number in order of proximity to the target date. An exponential decay weight is then generated based on the time interval number and the time decay coefficient. After normalizing each exponential decay weight, the most recent... The historical daily price vectors are weighted and summed sequentially to form a price curve with similar time lags;

[0106] The aggregated similar day price curve and the time-lag similar day price curve are arranged according to the intraday step order of the target day to form two price enhancement sequences that are consistent with the time dimension of the exogenous feature matrix of the target day, and then output to the time-segmented prediction module.

[0107] In this embodiment, the time-segmented prediction module includes:

[0108] It receives historical daily price tensors, exogenous feature matrix of the target day, aggregated similar day price curves and time-lag similar day price curves, determines the complete prediction interval based on the intraday step sequence of the target day, and divides the complete prediction interval into multiple consecutive and non-overlapping prediction periods according to the preset time period boundaries. It records the starting intraday step sequence, ending intraday step sequence and corresponding prediction steps for each prediction period.

[0109] For each complete historical day in the historical sample, the corresponding historical aggregated similar day price curve and historical time-lag similar day price curve are generated in advance, and unfolded according to the intraday step sequence in the unified business day sequence, so that the historical aggregated similar day price, historical time-lag similar day price and the corresponding historical electricity price and historical exogenous features correspond point by point under the same time index, forming a historical dual-channel price enhancement sequence.

[0110] For any forecast period, based on the intra-day step sequence of the start day and the intra-day step sequence of the forecast period, extract historical electricity price segments from the historical electricity price sequence that fall within the same intra-day step sequence range for each historical business day, and arrange the historical electricity price segments in chronological order according to the historical business days. Construct the arranged historical electricity price segments into the historical electricity price context window corresponding to the current forecast period.

[0111] Based on the intraday step range of the current forecast period, data corresponding to the time position of the historical electricity price context window are extracted from historical exogenous features, historical aggregated similar day price curves, and historical time-lag similar day price curves. The historical exogenous features, historical aggregated similar day prices, and historical time-lag similar day prices are then aligned point by point according to the time index to form a historical covariate sequence corresponding to the historical electricity price context window.

[0112] Based on the same starting intraday step sequence and ending intraday step sequence, data corresponding to the current prediction period are extracted from the target day exogenous feature matrix, aggregated similar day price curve, and time-lag similar day price curve, respectively. The target day exogenous features, aggregated similar day prices, and time-lag similar day prices are arranged in the same feature order as the historical covariate sequence. Among them, the aggregated similar day prices and time-lag similar day prices occupy independent numerical covariate channels, thereby forming the target covariate sequence corresponding to the current prediction period.

[0113] According to the same feature channels and intraday step order organization rules for historical covariate sequences and target covariate sequences, the historical covariate sequence is configured in the context interval corresponding to the historical electricity price context window, and the target covariate sequence is configured in the prediction interval corresponding to the current prediction period. The time period feature and time interval feature are written into the context interval and prediction interval respectively according to the corresponding time index, forming a continuous covariate input sequence covering the historical context and the target prediction period.

[0114] The historical electricity price context window is used as the target sequence context of TimesFM. The continuous covariate input sequence is input together with the target sequence context through TimesFM's XReg covariate input method. Inference is performed according to the prediction steps corresponding to the current prediction period, and the predicted values ​​output by TimesFM within the prediction step range are extracted. The current electricity price prediction sequence is formed by arranging the intraday steps of the current prediction period.

[0115] Based on the chronological order of each forecast period within the target day, the processes of extracting historical electricity price context windows, constructing historical covariate sequences, constructing target covariate sequences, and performing TimesFM inference are repeated to generate corresponding electricity price forecast sequences for each forecast period. The electricity price forecast sequences for all periods are then output to the result splicing module.

[0116] In this embodiment, TimesFM is the basic time series prediction model adopted by this technical solution. It is a decoder-only time series basic model open sourced by Google Research and pre-trained based on a large-scale real time series corpus. It is used as the basic prediction backbone in this system. Its construction and access method in this solution is as follows: First, historical aggregated similar day price curves and historical time-lag similar day price curves are generated for historical business days, and expanded according to the original time index to form a historical enhanced feature sequence, so that the historical stage and the target day stage use covariates with the same structure; then, for each prediction period obtained from the target day, the context window of the corresponding period is extracted from the historical target sequence, and the time period feature, time interval feature, exogenous variable, aggregated similar day price curve and time-lag similar day price curve are constructed into dynamic numerical covariates according to the corresponding time index; then, the historical electricity price context window and the dynamic numerical covariates are input into TimesFM for inference; the model outputs the corresponding time period electricity price prediction result for each prediction period, which is then spliced ​​together according to the business day time order to form a complete target day electricity price prediction sequence.

[0117] In this embodiment, the result fusion module includes:

[0118] Receive the electricity price forecast sequence for each time period, as well as the starting intraday step sequence, ending intraday step sequence, and forecast step number for each time period. Sort the electricity price forecast sequence for each time period in ascending order of the starting intraday step sequence and establish the correspondence between the electricity price forecast sequence for each time period and the intraday step sequence interval of the target day.

[0119] For any time period of the sorted electricity price forecast sequence, the electricity price forecast value is read point by point according to the intra-day step sequence from the start day to the end day of the time period, and each electricity price forecast value is written into the intra-day step sequence position corresponding to the target day in sequence, so that the arrangement order of each electricity price forecast value in the same time period is consistent with the intra-day step sequence arrangement order of the time period.

[0120] After writing the electricity price forecast value for the current period, the step sequence of the end day of the current period is used as the boundary to read the step sequence of the start day of the next period, and the first electricity price forecast value of the next period is configured in the corresponding step sequence position of the start day. The continuous splicing of the electricity price forecast sequence of all periods is completed in sequence according to the time sequence of each period within the target day.

[0121] After all time periods are spliced ​​together, the electricity price forecast values ​​corresponding to each position are read sequentially from the first intraday step sequence to the last intraday step sequence of the target day, forming a target daily electricity price forecast sequence that corresponds one-to-one with the complete intraday step sequence of the target day.

[0122] Based on the time index corresponding to the target day in the unified business day sequence, the predicted electricity prices in the target day electricity price forecast sequence are associated with their corresponding time positions and arranged in the original business day time order to generate a complete electricity spot price forecast sequence.

[0123] Example:

[0124] This embodiment uses day-ahead electricity price forecasting in the electricity spot market as an application scenario. The market trading system continuously generates historical electricity price data at a fixed sampling frequency and simultaneously saves load, renewable energy output, weather conditions, unit operating status, and time attribute data related to electricity price formation. Before the target business day arrives, the trading support system can obtain the load forecast, renewable energy output forecast, and other planned values ​​of exogenous characteristics corresponding to the target day, but it cannot obtain the actual electricity price that has not yet been formed on the target day. Therefore, under the condition that the actual electricity price on the target day is unavailable, this embodiment uses historical electricity prices, historical exogenous characteristics, and exogenous characteristics of the target day to construct price enhancement information that can be input into the time series forecasting model, and then performs forecasting for different consecutive periods of the target day.

[0125] Actual electricity trading data describes a complete business day from the first settlement time of the day to the last settlement time of the following day. If the data is directly segmented according to the natural date, the final settlement data belonging to the same business day will be carried over to the next natural day, resulting in misalignment of the historical daily electricity price curve, historical exogenous characteristic curve, and target day exogenous characteristic curve at the daily boundary. At the same time, the spot price of electricity has different fluctuation patterns in different time periods within the day. Especially during periods of concentrated output from new energy sources, rapid load increases, and evening peaks, electricity prices are prone to obvious local turning points or spikes. Using only a unified historical series for a single prediction throughout the day is insufficient to fully preserve the historical price structure corresponding to different time periods. Therefore, this embodiment first converts the original data into a unified business day structure, then establishes historical daily electricity price and exogenous characteristic data under this unified structure, and further forms a dual-channel similar day price feature for target day prediction.

[0126] The system reads the timestamps corresponding to historical electricity prices, historical exogenous features, and target day exogenous features, and establishes an original time index according to the same sampling frequency. Taking hourly sampling as an example, the sampling step size between two adjacent original sampling times is one hour. The system performs a rollback of one sampling step size for each original sampling time, uses the rolled-back time as the realignment time, and extracts the natural date of the realignment time as the business day identifier. According to this processing method, 01:00 of the current day in the original time index is mapped to 00:00 of the business day, and 00:00 of the original next day is mapped to 23:00 of the previous business day. The system then forms an intra-day step order based on the time position of each realignment time in the corresponding business day, and groups the historical electricity prices, historical exogenous features, and target day exogenous features according to the business day identifier, and then sorts them according to the intra-day step order, thus forming a unified business day sequence. The same business day in this sequence has continuous intra-day data positions, and the historical electricity prices and exogenous features maintain a corresponding relationship under the same intra-day step order.

[0127] After completing the business day realignment, the system traverses historical data according to the business day identifier. For each historical business day, the system counts the actual number of sampling points and the number of deduplicated intraday steps, and simultaneously checks for missing values ​​in historical electricity prices and exogenous feature fields participating in subsequent predictions. When using hourly sampling, the preset intraday step count is 24. Therefore, a historical business day is only retained in the complete historical day set if it contains 24 sampling points, has 24 different intraday step sequences, and has no missing historical electricity prices or exogenous features. If a historical day has a missing electricity price at a certain moment, a missing exogenous feature, or a duplicate time step, then that historical day will not participate in subsequent tensor construction.

[0128] For each historical day in the complete historical day set, the system sequentially reads historical electricity prices according to the intraday step order, forming a historical electricity price vector of length 24. Simultaneously, it reads the values ​​of each exogenous feature at its position within the 24 days according to a fixed exogenous feature order, forming a historical day exogenous feature matrix. The system stacks all historical electricity price vectors according to the chronological order of historical business days to obtain a historical electricity price tensor, and stacks all historical day exogenous feature matrices according to the same business day order to obtain a historical day exogenous feature tensor. The exogenous features of the target day are arranged using the same exogenous feature field order and intraday step order as the historical days, forming the target day exogenous feature matrix. Thus, a clear data correspondence is established between the historical electricity price tensor, the historical day exogenous feature tensor, and the target day exogenous feature matrix across the business day dimension, feature dimension, and intraday time dimension.

[0129] After obtaining the historical daily electricity price tensor and the historical daily exogenous feature tensor, the system calculates the explanatory relationship between exogenous features and daily electricity prices on a daily basis. For a complete historical day, the system reads the complete intraday curves from the historical day exogenous feature matrix according to the feature fields, and reads the corresponding daily electricity price vector from the historical daily electricity price tensor. Each exogenous feature curve and its corresponding daily electricity price vector are matched one-to-one according to the same intraday step sequence. Then, the Pearson correlation coefficient is calculated to form the feature-electricity price correlation between the corresponding exogenous feature and the daily electricity price on that historical day. The system takes the absolute value of the correlation coefficients of each exogenous feature within the same historical day and performs Softmax normalization to form the historical day feature explanatory weights for that historical day. Different historical business days store their own explanatory weights, so that exogenous features can have different weight combinations under different historical price states, rather than uniformly setting a fixed set of weights for all historical days.

[0130] Once in the target day forecasting phase, the system only uses historical data already generated before the forecast base date. Using the day before the forecast base date as the historical boundary, business days strictly earlier than this historical boundary are extracted from the complete historical day set to establish a candidate historical day set. This ensures that all price data participating in the construction of similar days for the target day comes from historical records already generated before the target day forecast. For each historical business day in the candidate historical day set, the system reads the exogenous feature curves of both the candidate historical day and the target day, following the same feature order as the exogenous feature matrix of the target day. For example, for load characteristics, the system reads the full-day load forecast curve for the target day and the corresponding historical load curve for the candidate historical day; for renewable energy output characteristics, the system reads the renewable energy output forecast curve for the target day and the historical renewable energy curve for the candidate historical day. Pearson correlation is calculated for each set of intraday curves with the same field, thus obtaining a set of feature-wise similarities between the target day and the candidate historical day.

[0131] The system then reads the feature interpretation weights formed during the historical period for the candidate historical day, takes the absolute value of each feature similarity, multiplies it by the interpretation weight corresponding to the same feature, and accumulates them along the exogenous feature dimension to generate the aggregated similarity of the candidate historical day relative to the target day. Thus, whether a candidate historical day enters the final set of similar days is not determined solely by a single load curve or meteorological variable, but rather by the feature-by-feature matching relationship between the target day and the candidate historical day, as well as the feature-electricity price correlation of the candidate historical day itself.

[0132] After calculating the aggregated similarity of all candidate historical days, the system ranks the candidate historical days from highest to lowest aggregated similarity and selects a preset number of highly similar historical days. For example, the top 5 historical business days with the highest similarity can be selected. The system extracts the historical daily electricity price vectors corresponding to these 5 historical business days from the historical daily electricity price tensor, and then normalizes the 5 aggregated similarities into a daily electricity price fusion weight. For each intraday step of the target day, the historical electricity prices of the 5 similar historical days at the same time sequence are read, and a weighted sum is performed according to the daily electricity price fusion weight. After all intraday steps have completed the same operation, the aggregated similarity day price curve for the target day is formed.

[0133] While constructing the aggregated similar day price curve, the system extracts the nearest preset number of historical business days to the target date from the historical daily electricity price tensor. This part is no longer sorted according to the degree of similarity of exogenous features, but directly arranged according to the time sequence from the target date. The system generates exponentially decaying weights based on the time interval between each historical business day and the target date, and then normalizes the exponentially decaying weights. At each step position within the same day, the electricity prices of multiple recent historical business days are weighted according to the normalized decaying weights, thus forming the time-lag similar day price curve for the target date. Therefore, the target date ultimately yields two price enhancement sequences from different sources: one formed by similar historical daily electricity prices jointly selected by the exogenous feature pattern and the historical feature explanation weights, and the other formed by fusing the recent historical daily electricity prices to the target date according to time distance.

[0134] To ensure that TimesFM receives structurally consistent covariates in both the historical context and the target day prediction interval, the system pre-generates historical aggregated similar day price curves and historical time-lag similar day price curves using the same processing logic for complete historical business days. The generated two types of historical price enhancement curves are expanded according to a unified business day sequence, ensuring that historical exogenous features, historical aggregated similar day prices, historical time-lag similar day prices, and historical actual electricity prices all correspond to the same time index. This forms a historical dual-channel price enhancement sequence. On the target day side, target day exogenous features, target day aggregated similar day prices, and target day time-lag similar day prices are arranged according to the same field order and intraday time structure, ensuring a consistent covariate structure between the historical interval and the prediction interval.

[0135] The system then proceeds to the time-segmented forecasting process. It divides the complete forecast range into multiple consecutive, non-overlapping time segments according to the intraday steps of the target day. In a 24-hour business day implementation, the complete target day can be divided into three consecutive time segments: 1:00-8:00, 9:00-16:00, and 17:00-24:00. For any given forecasting time segment, the system records the starting intraday steps, the ending intraday steps, and the number of forecast steps. It then extracts electricity price segments within the same intraday steps from the historical electricity price series, day by day. These historical electricity price segments are arranged consecutively in chronological order according to the business day, forming the historical electricity price context window for the current forecasting time segment.

[0136] Within the same prediction period, the system synchronously extracts data from historical exogenous features, historical aggregated similar day price curves, and historical time-lag similar day price curves, corresponding to the same time position in the historical electricity price context window, and arranges them point-by-point according to the time index to form a historical covariate sequence. Subsequently, it extracts the target data corresponding to the prediction period from the target day exogenous feature matrix, target day aggregated similar day price curve, and target day time-lag similar day price curve. The target day exogenous features, aggregated similar day prices, and time-lag similar day prices are arranged according to the same field position as the historical covariates, with aggregated similar day prices and time-lag similar day prices serving as two independent numerical covariate channels. Combining the corresponding time period features and time interval features, the covariate input data corresponding to the current target period is formed.

[0137] The system uses TimesFM as the backbone model for time series forecasting. The historical electricity price context window serves as the target sequence context for TimesFM. Historical covariates and target forecast period covariates are used to construct the model's numerical covariate inputs according to their corresponding time relationships, and these inputs participate in inference through the XReg method supported by the model. TimesFM generates continuous electricity price forecasts based on the number of forecast steps set for the current forecast period. The system then arranges the output results according to the intraday step sequence of that forecast period, forming the electricity price forecast sequence for the current period. The same historical context extraction, covariate construction, and model inference process is repeated for other forecast periods to generate their respective electricity price forecast sequences.

[0138] After completing all forecast periods, the system reads the start and end intraday step sequences for each period and arranges the electricity price forecast sequences for each period according to the time sequence of the target date. Within each period, the original forecast order is maintained according to its own intraday step sequence, with the end of the previous period connected to the beginning of the next period, until all intraday forecast positions are written, ultimately forming a complete electricity spot price forecast sequence that corresponds one-to-one with the unified business day sequence. During the result splicing process, the forecast results of each period are spliced ​​together according to the original business day order to form a complete 24-point price forecast result record.

[0139] To verify the effectiveness of the aforementioned complete technical feature combination in electricity spot price forecasting, an exemplary backtest was conducted over ninety consecutive full business days. Each business day was calculated based on 24 intraday positions, resulting in a total of 2160 forecast points. The control method used the same historical data and exogenous features for the target day, but directly performed a unified forecast based on full business days, without constructing historical feature explanation weights or implementing dual-channel price enhancement for aggregated similar days and time-lag similar days. This embodiment, however, fully executes business day realignment, full historical day filtering, historical tensor construction, historical day feature explanation weight calculation, candidate historical day feature matching, dual-channel similar day price construction, and time-segmented TimesFM inference.

[0140] Table 1. Backtesting results of electricity spot price forecast in this embodiment.

[0141] Number of full business days 90 days 90 days Number of forecasted price points 2160 2160 Mean absolute error 46.3 yuan / MWh 32.8 yuan / MWh Root mean square error 77.6 yuan / MWh 59.7 yuan / MWh Symmetric mean absolute percentage error 18.4% 13.3% High volatility period mean absolute error 55.9 yuan / MWh 37.2 yuan / MWh Single business day 24-point mean maximum absolute error 118.6 yuan / MWh 82.4 yuan / MWh

[0142] As can be seen from the exemplary results in the table, under the condition that the prediction object, historical data range and exogenous characteristics of the target day remain consistent, the average absolute error of this embodiment is reduced from 46.3 yuan / MWh to 32.8 yuan / MWh, the root mean square error is reduced from 77.6 yuan / MWh to 59.7 yuan / MWh, and the average absolute error during the high fluctuation period is reduced from 55.9 yuan / MWh to 37.2 yuan / MWh. The aforementioned differences are based on a complete technical processing chain. The original settlement data is first converted into a unified business day sequence. The complete historical days are further organized into historical daily electricity price tensors and historical exogenous feature tensors. Then, the correlation between historical exogenous features and real electricity prices is used to form historical day feature explanatory weights. Next, the exogenous features of the target day are matched with the exogenous features of candidate historical days, and the explanatory weights are used to form aggregated similarity. Aggregated similarity day price curves are generated based on aggregated similarity, and time-lag similarity day price curves are generated using recent historical daily electricity prices. The two price enhancement curves, together with the exogenous features of the target day and the historical electricity price context, are entered into TimesFM for time-segmented inference, and then spliced ​​together according to the time sequence of the target day to form a complete electricity price prediction sequence.

[0143] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A time-of-use electricity price forecasting method based on TimesFM and similar day enhancement, characterized in that, include: Obtain historical electricity prices, historical exogenous features, and target day exogenous features, and roll back the time index by one sampling step to generate a unified business day sequence; Based on a unified business day sequence, complete historical days are selected to form a historical daily price tensor, a historical day exogenous feature tensor, and a target day exogenous feature matrix. Calculate and normalize the correlation between the exogenous characteristic curve and the daily price curve for each historical day to generate the historical day characteristic explanatory weights; In the historical days before the forecast benchmark date, the feature-wise similarity between the target date and each historical day is calculated, and the historical day similarity is aggregated according to the corresponding feature interpretation weight. The preset number of historical days with the highest similarity is selected and the daily electricity price is weighted to form the aggregated similar day price curve. At the same time, the preset number of consecutive historical daily electricity prices before the target date are weighted according to the time distance decay to form the time-lag similar day price curve. The target day is divided according to the preset boundary. The exogenous characteristics of the target day, the price curves of the aggregated similar days, and the price curves of the time-lag similar days are aligned by time period to form a dynamic numerical covariate. This covariate is then input into TimesFM along with the historical electricity price context to obtain the electricity price prediction sequence for each time period. By assembling the electricity price forecast sequences for each time period in chronological order of the target date, a complete electricity spot price forecast sequence is generated.

2. A time-of-use electricity price forecasting system based on TimesFM and similar day enhancement, characterized in that, Includes the following modules: The business day realignment module obtains historical electricity prices, historical exogenous features, and target day exogenous features, rolls back the time index by one sampling step, and generates a unified business day sequence. The historical sample module filters complete historical days based on a unified business day sequence, forming a historical daily price tensor, a historical day exogenous feature tensor, and a target day exogenous feature matrix. The explanatory weight module calculates and normalizes the correlation between the exogenous characteristic curve and the daily price curve for each historical day, generating the explanatory weights for historical day features. The dual-channel similar day module calculates the feature-wise similarity between the target day and each historical day in the historical days before the prediction benchmark date, and aggregates the historical day similarity according to the corresponding feature interpretation weights. It selects a preset number of historical days with the highest similarity and weights them with the daily electricity prices to form an aggregated similar day price curve. At the same time, it weights the daily electricity prices of a preset number of consecutive historical days before the target date according to the time distance decay to form a time-lag similar day price curve. The time-segmented forecasting module divides the target day according to a preset boundary, aligns the exogenous features of the target day, the aggregated similar day price curves, and the time-lag similar day price curves according to the time period to form a dynamic numerical covariate, and inputs it together with the historical electricity price context into TimesFM to obtain the electricity price forecast sequence for each time period; The result splicing module splices the electricity price forecast series for each time period according to the target date time sequence to generate a complete electricity spot price forecast series.

3. The electricity spot market time-of-use price forecasting system based on TimesFM and similar day enhancement as described in claim 2, characterized in that, The business day re-alignment module includes: Obtain the timestamps corresponding to historical electricity prices, historical exogenous features, and exogenous features of the target day; establish an original time index according to the same sampling frequency; and determine the time interval between two adjacent sampling times as the sampling step size. Based on the sampling step size, a rollback process is performed on each sampling moment in the original time index to obtain the realigned moments that correspond one-to-one with each original sampling moment. , Indicates the first Each original sampling time, Indicates the first Individual alignment moments, Indicates the sampling step size; Extract the natural date corresponding to each realignment time and configure the natural date as the business day identifier of the corresponding sampled data; The intraday step sequence is generated based on the time position of each realignment moment in the corresponding business day, and the realignment moments within the same business day are continuously sorted according to the sampling step size. Based on the business day identifier and intraday step sequence, establish index mappings between historical electricity prices, historical exogenous features, and target day exogenous features and their corresponding realignment times, and group them according to the business day identifier and sort them within the group according to the intraday step sequence; The realignment time after grouping and sorting, business day identifier, intraday step sequence and corresponding historical electricity price, historical exogenous features and target day exogenous features are associated in chronological order to generate a unified business day sequence.

4. The time-of-use electricity price forecasting system based on TimesFM and similar day enhancement according to claim 2, characterized in that, The historical sample module includes: The system receives a unified business day sequence, groups historical electricity prices and historical exogenous features according to the business day identifier, and determines the preset number of intraday steps for each business day based on the sampling frequency. ; For each historical business day, the number of sampling points and the number of duplicate steps within the day are counted. The system also checks for missing values ​​in historical electricity prices and historical exogenous features used in the forecast. The number of retained sampling points is equal to... The number of duplicates removed in the daily step sequence equals Furthermore, the historical business days with complete historical electricity prices and historical exogenous characteristics form a complete set of historical days; For each historical day in the complete set of historical days, the corresponding sampled data are arranged according to the intra-day step order. The historical electricity prices corresponding to each intra-day step order are combined into a historical electricity price vector. The historical exogenous features under the same intra-day step order are arranged and combined into a historical day exogenous feature matrix according to a fixed feature order. Stack the historical daily price vectors and exogenous feature matrices for each historical day according to the business day time sequence to form: ,in For historical daily electricity price tensor, For historical exogenous feature tensor, For the complete historical number of days, The number of exogenous features; Extract the target day's exogenous features from the unified business day sequence, arrange them according to the same feature order and intraday step order as the historical day's exogenous feature matrix to form the target day's exogenous feature matrix, and output the historical day's daily price tensor, the historical day's exogenous feature tensor, and the target day's exogenous feature matrix.

5. The time-of-use electricity price forecasting system based on TimesFM and similar day enhancement according to claim 2, characterized in that, The interpretation weight module includes: Receive the historical daily price tensor and the historical daily exogenous feature tensor, extract the historical daily price vector from the historical daily price tensor day by day according to the complete historical day index, and extract the historical daily exogenous feature matrix that matches the corresponding historical day from the historical daily exogenous feature tensor; For each historical business day Indexed by exogenous features Extract intraday curves corresponding to exogenous features from historical daily exogenous feature matrix. And vectorize the intraday curve with the historical daily price of the same historical business day. Follow the same intraday sequence; The correlation between the intraday curves of each exogenous feature and the corresponding historical electricity price vector is calculated using the Pearson correlation coefficient, thus obtaining the feature-electricity price correlation: ; in, Indicates historical business days The Middle The correlation between exogenous characteristics and historical electricity prices This indicates the calculation of the Pearson correlation coefficient. Indicates historical business days The Middle An intraday curve with exogenous characteristics, Indicates historical business days Historical daily electricity price vector; For each feature-electricity price correlation within the same historical business day, take the absolute value and perform Softmax normalization along the exogenous feature dimension to obtain the historical day feature explanation weights corresponding to each exogenous feature: ; in, Indicates historical business days The Middle The historical daily feature explanatory weights corresponding to each exogenous feature; The feature interpretation weights for each historical day are arranged according to the historical business day index and the exogenous feature index, forming a set of feature interpretation weights that correspond one-to-one with each historical business day, and the set of feature interpretation weights is output.

6. The time-of-use electricity price forecasting system based on TimesFM and similar day enhancement according to claim 2, characterized in that, The dual-channel similarity date module includes: The system receives the target day exogenous feature matrix, historical day exogenous feature tensor, historical day price tensor and historical day feature interpretation weight set. Using the day before the prediction benchmark as the historical boundary, it filters historical business days that are strictly earlier than the historical boundary from the complete historical day set and establishes a candidate historical day set according to the business day time order. For each historical business day in the candidate historical day set, exogenous feature curves for both the candidate historical day and the target day are extracted according to the exogenous feature index and intraday step order consistent with the exogenous feature matrix of the target day. The Pearson correlation between the two is then calculated for each feature. ; in, and They represent the target date. With candidate historical day The An exogenous characteristic intraday curve; Candidate historical days are read from the set of historical day feature interpretation weights. The explanatory weights for each exogenous feature are used to calculate the aggregate similarity of each feature-wise relevance. The absolute value of each feature-wise relevance is multiplied by the corresponding explanatory weight, and then summed along the exogenous feature dimension to obtain the aggregate similarity of the candidate historical day. Candidate historical days were sorted from highest to lowest based on aggregation similarity, and the previous ones were selected. For each candidate historical day, the corresponding historical daily electricity price vector is read, and the aggregation similarity of each candidate historical day is normalized into a daily electricity price fusion weight. The previous days are then ranked according to the daily electricity price fusion weight. The historical daily price vectors are weighted and summed sequentially over each day to form an aggregated similar daily price curve with the same length as the target day's intraday step sequence. Extracting the target date from the historical electricity price tensor. The daily price vector for each historical business day is used to determine the time interval number in order of proximity to the target date. An exponential decay weight is then generated based on the time interval number and the time decay coefficient. After normalizing each exponential decay weight, the most recent... The historical daily price vectors are weighted and summed sequentially to form a price curve with similar time lags; The price curves of aggregated similar days and the price curves of time-lag similar days are arranged according to the intraday step order of the target day to form two price enhancement sequences that are consistent with the time dimension of the exogenous feature matrix of the target day.

7. The electricity spot market time-of-use price forecasting system based on TimesFM and similar day enhancement as described in claim 2, characterized in that, The time-segmented prediction module includes: It receives historical daily price tensors, exogenous feature matrix of the target day, aggregated similar day price curves and time-lag similar day price curves, determines the complete prediction interval based on the intraday step sequence of the target day, and divides the complete prediction interval into multiple consecutive and non-overlapping prediction periods according to the preset time period boundaries. It records the starting intraday step sequence, ending intraday step sequence and corresponding prediction steps for each prediction period. For each complete historical day in the historical sample, the corresponding historical aggregated similar day price curve and historical time lag similar day price curve are generated in advance, and unfolded according to the intraday step sequence in the unified business day sequence to form a historical dual-channel price enhancement sequence; For any forecast period, based on the intra-day step sequence of the start day and the intra-day step sequence of the forecast period, extract historical electricity price segments from the historical electricity price sequence that fall within the same intra-day step sequence range for each historical business day, and arrange the historical electricity price segments in chronological order according to the historical business days. Construct the arranged historical electricity price segments into the historical electricity price context window corresponding to the current forecast period. Based on the intraday step range of the current forecast period, data corresponding to the time position of the historical electricity price context window are extracted from historical exogenous features, historical aggregated similar day price curves, and historical time-lag similar day price curves. The historical exogenous features, historical aggregated similar day prices, and historical time-lag similar day prices are then aligned point by point according to the time index to form a historical covariate sequence corresponding to the historical electricity price context window. Based on the same starting intraday step sequence and ending intraday step sequence, data corresponding to the current prediction period are extracted from the target day exogenous feature matrix, aggregated similar day price curve, and time-lag similar day price curve, respectively. The target day exogenous features, aggregated similar day prices, and time-lag similar day prices are arranged in a feature order consistent with the historical covariate sequence. Among them, the aggregated similar day prices and time-lag similar day prices occupy independent numerical covariate channels to form the target covariate sequence corresponding to the current prediction period. According to the same feature channels and intraday step order organization rules for historical covariate sequences and target covariate sequences, the historical covariate sequence is configured in the context interval corresponding to the historical electricity price context window, and the target covariate sequence is configured in the prediction interval corresponding to the current prediction period. The time period feature and time interval feature are written into the context interval and prediction interval respectively according to the corresponding time index, forming a continuous covariate input sequence covering the historical context and the target prediction period. The historical electricity price context window is used as the target sequence context of TimesFM. The continuous covariate input sequence is input together with the target sequence context through TimesFM's XReg covariate input method. Inference is performed according to the prediction steps corresponding to the current prediction period, and the predicted values ​​output by TimesFM within the prediction step range are extracted. The current electricity price prediction sequence is formed by arranging the intraday steps of the current prediction period. Based on the chronological order of each forecast period within the target day, the processes of extracting historical electricity price context windows, constructing historical covariate sequences, constructing target covariate sequences, and performing TimesFM inference are repeated to generate corresponding electricity price forecast sequences for each forecast period. The electricity price forecast sequences for all periods are then output.

8. The electricity spot market time-of-use price forecasting system based on TimesFM and similar day enhancement according to claim 2, characterized in that, The result splicing module includes: Receive the electricity price forecast sequence for each time period, as well as the starting intraday step sequence, ending intraday step sequence, and forecast step number for each time period. Sort the electricity price forecast sequence for each time period in ascending order of the starting intraday step sequence and establish the correspondence between the electricity price forecast sequence for each time period and the intraday step sequence interval of the target day. For any time period of the sorted electricity price forecast sequence, the electricity price forecast value is read point by point according to the intra-day step sequence from the start day to the end day of the time period, and each electricity price forecast value is written into the intra-day step sequence position corresponding to the target day in sequence, so that the arrangement order of each electricity price forecast value in the same time period is consistent with the intra-day step sequence arrangement order of the time period. After writing the electricity price forecast value for the current period, the step sequence of the end day of the current period is used as the boundary to read the step sequence of the start day of the next period, and the first electricity price forecast value of the next period is configured in the corresponding step sequence position of the start day. The continuous splicing of the electricity price forecast sequence of all periods is completed in sequence according to the time sequence of each period within the target day. After all time periods are spliced ​​together, the electricity price forecast values ​​corresponding to each position are read sequentially from the first intraday step sequence to the last intraday step sequence of the target day, forming a target daily electricity price forecast sequence that corresponds one-to-one with the complete intraday step sequence of the target day. Based on the time index corresponding to the target day in the unified business day sequence, the predicted electricity prices in the target day electricity price forecast sequence are associated with their corresponding time positions and arranged in the original business day time order to generate a complete electricity spot price forecast sequence.