Similar day based power load prediction prior feature generation method, system, device and medium

CN122844097APending Publication Date: 2026-09-29POWERCHINA ZHONGNAN ENG
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611278830.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-21
Publication Date
2026-09-29

AI Technical Summary

Technical Problem

气象特征利用不充分:多数方案仅采用气温、湿度等少量标量特征或单点观测值计算相似性,未能充分利用区域全图气象栅格的空间分布结构及其连续演变过程,导致对极端天气或局地气象过程的刻画能力不足

Benefits of technology

1、本发明通过构建包含气象过程窗口、时空自编码提取气象潜在向量、融合时间周期向量检索相似日、生成加权均值以及多原始曲线的先验特征张量整套完整流程,实现了气象演变过程与时间周期双重约束下的标准化相似日先验输出,进而解决了传统相似日技术无法利用完整气象栅格过程、缺少气象窗口编码、忽略时间周期约束、无结构化先验输出的四大核心缺陷,为各类负荷预测模型提供了统一可复用的外部先验输入,极大提高了工程适用性以及下游电力负荷预测的精准度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122844097A_ABST
    Figure CN122844097A_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on similar day electric power load prediction prior feature generation method, system, equipment and medium, it is related to electric power load prediction technical field, the present application is first according to time alignment rule intercepts meteorological process window;Extract meteorological latent vector by space-time self-encoding network, obtain time period vector by doing sine cosine mapping to periodic characteristic, generate query feature vector by weighted fusion of meteorological latent vector and time period vector;Rely on pre-constructed historical similar day search library to filter several historical load curves that meet time constraint, and obtain mean curve according to similarity score weighting, splice to form multi-channel prior feature tensor for use by downstream prediction model.The present application fully excavates meteorological space-time evolution information, considers meteorological similarity and time period matching degree and multi-time granularity data, outputs standardized reusable prior tensor, supports offline database construction, online fast reasoning, adapts to multiple load prediction models, and has strong engineering landing nature.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power load forecasting technology, specifically to a method, system, device, and medium for generating prior features for power load forecasting based on similar days. Background Technology

[0002] In the field of power load forecasting, the similar day method has long been used as an important prior construction method due to its clear physical meaning and strong industry interpretability. Traditional similar day prior construction usually involves retrieving several historical samples that are similar in terms of weather conditions, date type, or load pattern for the future period to be predicted, and using their load curves as a reference for forecasting. It is widely used in scenarios such as power grid dispatching and operation, power trading, and business analysis.

[0003] However, with the increasing proportion of new energy sources and the growing complexity of the impact of meteorological conditions on load, existing similar-day prior structure techniques have gradually revealed the following limitations: Insufficient utilization of meteorological features: Most schemes only use a few scalar features such as temperature and humidity or single-point observations to calculate similarity, failing to make full use of the spatial distribution structure of the meteorological grid in the whole map and its continuous evolution process, resulting in insufficient ability to depict extreme weather or local meteorological processes.

[0004] Lack of a complete meteorological process coding mechanism: Existing technologies mostly use single-moment meteorological values, daily averages, or simple statistics as retrieval basis, lacking a vectorized coding mechanism for "the complete meteorological process window corresponding to the future target prediction period", making it difficult to accurately capture the lag and cumulative effect of dynamic weather evolution on load changes.

[0005] Lack of time period constraints: Existing retrieval often overemphasizes weather similarity while failing to consider time period attributes such as weekdays or holidays, location within a week, and months. This can easily lead to the recall of historical samples with similar weather but completely different business semantics (such as electricity usage patterns), reducing prior reliability.

[0006] Limited prior output format: Existing technologies typically simplify retrieval results into a single average curve or a historical baseline, failing to form a structured prior tensor that includes uncertainty information and morphological differences. This limits the in-depth utilization of prior information by downstream deep learning models or probabilistic prediction models.

[0007] Alignment of multi-source data is difficult: There are time granularity differences between different meteorological data sources (such as 1-hour reanalysis data and 15-minute numerical forecasts) and load series. Existing methods lack a unified time alignment mechanism and have poor engineering adaptability. Summary of the Invention

[0008] To address one or more shortcomings of the existing technologies, this invention provides a method, system, device, and medium for generating prior features for power load forecasting based on similar days. By constructing a structured prior feature tensor for similar days, it provides interpretable and reusable external prior inputs for various downstream load forecasting models, thereby solving one or more of the aforementioned technical problems.

[0009] To achieve the above objectives, the present invention adopts one or more of the following technical solutions: Firstly, a method for generating prior features for electricity load forecasting based on similar days is provided, including the following steps: S1. Obtain historical power load sequences and historical meteorological grid sequences, and determine the future forecast period; using the future forecast period as the time reference, extract continuous meteorological data sequences from the historical meteorological grid sequences according to preset time alignment rules, and construct a meteorological process window using the meteorological data sequences; S2. Input the meteorological process window into the pre-trained spatiotemporal autoencoder network to extract the meteorological potential vector; obtain the time period vector of the future to be predicted period; fuse the meteorological potential vector with the time period vector to generate a query feature vector; the pre-trained spatiotemporal autoencoder network is obtained by self-supervised training of the original spatiotemporal autoencoder network, and the self-supervised training is based on the historical meteorological grid sequence. S3. Based on the query feature vector, perform similar day retrieval in the pre-constructed historical similar day retrieval database to obtain several historical similar day samples, and obtain the historical load curve and similarity score corresponding to each historical similar day sample; S4. Based on the historical load curves and similarity scores corresponding to the several historical similar day samples, a weighted mean curve is obtained; the weighted mean curve is combined in parallel with the historical load curves corresponding to the several historical similar day samples to generate a prior feature tensor with multiple channels for use by the downstream power load prediction model.

[0010] Preferably, in step S1, the historical meteorological grid sequence includes at least one of temperature grid sequence, humidity grid sequence, air pressure grid sequence, and wind speed grid sequence; step S1 also includes preprocessing the constructed meteorological process window, the preprocessing including at least one of normalization processing, outlier removal, and spatial downsampling.

[0011] Preferably, the original spatiotemporal autoencoder network employs a convolutional recurrent autoencoder, which includes at least an encoding end and a decoding end; The pre-trained spatiotemporal autoencoder network is obtained by self-supervised training of the original spatiotemporal autoencoder network, specifically including the following steps: Using a historical meteorological process window as input, the spatiotemporal features of the historical meteorological process window are extracted and compressed into a latent vector through the encoding end. The input historical meteorological process window is reconstructed through the decoding end. The original spatiotemporal autoencoder network is trained with the goal of minimizing the reconstruction loss function to obtain the pre-trained spatiotemporal autoencoder network.

[0012] Preferably, in step S2, obtaining the time period vector of the future period to be predicted specifically includes: Extract periodic features from the start time of the future period to be predicted, wherein the periodic features include at least one of the following: day of the week, day of the month, or day of the year; The time period vector is obtained by performing a sine or cosine cyclic mapping on the periodic feature.

[0013] Preferably, in step S2, fusing the meteorological potential vector with the time period vector to generate a query feature vector specifically includes: Euclidean normalization is performed on the meteorological potential vector and the time period vector respectively. Apply a preset time weighting coefficient to the normalized time period vector to obtain a weighted time period vector. The meteorological potential vector is concatenated with the weighted time period vector, and then subjected to maximum and minimum value normalization again to obtain the query feature vector.

[0014] Preferably, the construction process of the historical similar day retrieval database is as follows: Historical load monitoring data of the target area is obtained, and the historical load monitoring data is extracted based on a preset sliding time window to obtain multiple historical load curves. Each historical load curve is used as a historical sample. Traverse all the historical samples, determine the corresponding time node for each historical sample and construct the historical meteorological process window corresponding to the time node, and use the pre-trained spatiotemporal autoencoder network to extract the spatiotemporal features of the historical meteorological process window to obtain the historical meteorological potential vector corresponding to each historical sample. Obtain the time period vector corresponding to each historical sample, and fuse the historical meteorological potential vector with the time period vector to obtain the historical fusion vector corresponding to each historical sample. Using the historical fusion vector as the search key and the historical load curve corresponding to the historical sample as the search value, a historical similar day search database is established.

[0015] Preferably, in step S3, based on the query feature vector, a similar day search is performed in a pre-built historical similar day retrieval database to obtain several historical similar day samples, and the historical load curve and similarity score corresponding to each historical similar day sample are obtained, specifically including: In the historical similar day retrieval database, historical candidate samples that meet preset retrieval constraints are selected; the preset retrieval constraints include: the timestamp of the historical candidate sample is earlier than the current query time, and the time slot identifier of the historical candidate sample is the same as the time slot identifier of the time period vector. Calculate the cosine similarity between the query feature vector and the fusion vector corresponding to each of the historical candidate samples; sort the historical candidate samples according to the cosine similarity from high to low. Based on the ranking results, the top K candidate historical samples are selected as the several historical similar day samples, and the historical load curves of the several historical similar day samples and their corresponding similarity scores are obtained; where K is a positive integer greater than or equal to 1.

[0016] Preferably, in step S4, a weighted mean curve is obtained by weighting the historical load curves and similarity scores corresponding to the plurality of historical similar day samples; the weighted mean curve is then combined in parallel with the historical load curves corresponding to the plurality of historical similar day samples to generate a prior feature tensor with multiple channels, specifically including: The similarity scores of the aforementioned historical similar day samples are subjected to exponential normalization to obtain the weight coefficients of each historical similar day sample. Based on the weighting coefficients, the weighted summation of the historical load curves corresponding to the several historical similar day samples is performed to obtain the weighted prior mean curve. The weighted prior mean curve is used as the first channel, and the historical load curves corresponding to the several historical similar day samples are used as subsequent channels. They are spliced ​​together according to time steps to form a multidimensional tensor, thus obtaining the prior feature tensor.

[0017] Preferably, the step of extracting continuous meteorological data sequences according to a preset time alignment rule specifically includes: Obtain the time granularity of meteorological sequences and load sequences; When the time granularity of the meteorological sequence is inconsistent with the time granularity of the load sequence, the starting time of the future period to be predicted shall be used as the reference, and the nearest time point on the meteorological time axis that is no later than the reference shall be selected as the starting point of the meteorological window. Starting from the aforementioned starting point, a continuous meteorological sequence covering the dates corresponding to the future period to be predicted is extracted.

[0018] Secondly, a priori feature generation system for electricity load forecasting based on similar days is provided, specifically including: The meteorological window construction module is used to acquire historical power load sequences and historical meteorological grid sequences, and determine the future forecast period; using the future forecast period as the time reference, it extracts continuous meteorological data sequences from the historical meteorological grid sequences according to preset time alignment rules, and uses the meteorological data sequences to construct a meteorological process window; The query feature vector generation module is used to input the meteorological process window into a pre-trained spatiotemporal autoencoder network to extract the meteorological potential vector; obtain the time period vector of the future to be predicted period; and fuse the meteorological potential vector with the time period vector to generate the query feature vector; the pre-trained spatiotemporal autoencoder network is obtained by self-supervised training of the original spatiotemporal autoencoder network, and the self-supervised training is based on the historical meteorological grid sequence; The similar day retrieval module is used to retrieve similar days in a pre-built historical similar day retrieval database based on the query feature vector, obtain several historical similar day samples, and obtain the historical load curve and similarity score corresponding to each historical similar day sample; The prior construction module is used to perform weighted calculations based on the historical load curves and similarity scores corresponding to the several historical similar day samples to obtain a weighted mean curve; the weighted mean curve is combined in parallel with the historical load curves corresponding to the several historical similar day samples to generate a prior feature tensor with multiple channels.

[0019] On the other hand, the present invention also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, it can implement the steps of the above-described method for generating prior features for power load forecasting based on similar days.

[0020] On the other hand, the present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, it can implement the steps of the method for generating prior features for power load forecasting based on similar days as described above.

[0021] By adopting the above technical solution, the beneficial effects of the present invention are as follows: 1. This invention constructs a complete process that includes meteorological process windows, spatiotemporal autoencoding to extract meteorological potential vectors, fusion of time period vectors to retrieve similar days, generation of weighted averages, and prior feature tensors of multiple original curves. This achieves standardized prior output of similar days under the dual constraints of meteorological evolution process and time period. It solves the four core defects of traditional similar day technology: inability to utilize complete meteorological grid processes, lack of meteorological window encoding, neglect of time period constraints, and lack of structured prior output. It provides a unified and reusable external prior input for various load forecasting models, greatly improving engineering applicability and the accuracy of downstream power load forecasting.

[0022] 2. This invention uses a pre-trained convolutional recurrent spatiotemporal autoencoder network to compress and extract meteorological latent vectors from the complete meteorological grid time-series window. This transforms high-dimensional spatiotemporal meteorological data into low-dimensional representations and fully preserves the continuous evolution characteristics of weather, significantly improving the accuracy of meteorological matching when searching for similar days.

[0023] 3. This invention extracts weekly / monthly / yearly periodic features and generates time period vectors through sine and cosine mapping. After weighted normalization, these vectors are concatenated and fused with meteorological vectors to generate retrieval features. This balances meteorological similarity with date periodic business similarity, thus optimizing the business rationality of similar day retrieval results.

[0024] 4. This invention constructs a meteorological process window by setting unified time alignment and interception rules at different time granularities for meteorological and load conditions, thereby achieving rapid compatibility with meteorological sources and load sequences with different time intervals and effectively expanding the application scenarios for the solution in engineering projects.

[0025] 5. This invention obtains the mean curve by exponentially weighting the similarity of the Top-K historical similar days, and then combines the weighted mean with multiple original similar day curves into a multi-channel prior feature tensor, which can simultaneously output the overall load trend and the morphological difference information of multiple historical samples, thereby improving the downstream prediction model's ability to utilize prior information. Attached Figure Description

[0026] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.

[0027] Figure 1 This is a schematic diagram of the process for generating prior features for power load forecasting based on similar days in one or more embodiments of the present invention. Figure 2 This is a schematic diagram of the ConvLSTM-AE autoencoder structure in one or more embodiments of the present invention; Figure 3This is a schematic diagram illustrating the process of constructing a historical similar day retrieval database in one or more embodiments of the present invention; Figure 4 This is a schematic diagram of the overall process of the offline and online stages in one or more embodiments of the present invention. Detailed Implementation

[0028] It should be noted that the following detailed description is illustrative and intended to provide further explanation of the invention. Unless otherwise specified, all technical and scientific terms used in this invention have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0029] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments of the present invention. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.

[0030] In one typical embodiment of this application, a method for generating prior features for electricity load forecasting based on similar days is provided, referring to... Figures 1-4 The specific steps are as follows: Step S1: Obtain historical power load sequences and historical meteorological grid sequences, and determine the future forecast period; using the future forecast period as the time reference, extract continuous meteorological data sequences from the historical meteorological grid sequences according to preset time alignment rules, and construct a meteorological process window using the meteorological data sequences.

[0031] Specifically, the steps include: S11. Collect and organize the basic dataset. The collection objects include four types of core data: historical power load sequence, historical load matching timestamp sequence, regional full map meteorological raster sequence, and target start time information corresponding to the future forecast period.

[0032] Among them, historical power load sequences and meteorological grid sequences are long-term time-series monitoring data, which can be exported in batches from the power grid dispatch database and regional meteorological numerical forecasting system.

[0033] S12. Define basic attributes for the collected data. The meteorological raster sequence includes at least one meteorological variable channel from temperature, humidity, air pressure, wind speed, precipitation, and irradiance. In a preferred embodiment, the meteorological raster sequence is a multidimensional variable. The meteorological sequence time granularity supports fixed step sizes such as 1 hour and 15 minutes, while the load sequence time granularity supports fixed step sizes such as 15 minutes, 30 minutes, and 1 hour, which can be flexibly switched according to short-term or ultra-short-term load forecasting needs of the power grid. The length of the future forecast period is denoted as pred_len. In this embodiment, pred_len is preferably 96, suitable for 24-hour load forecasting scenarios with a 15-minute granularity.

[0034] S13. Construct time alignment rules for meteorological windows, and determine the corresponding meteorological window time range for each historical sample and each future sample to be predicted, extract continuous meteorological data sequences, and output the raw data of standardized meteorological process windows.

[0035] Specifically, using the target start time of the future forecast period as the global alignment anchor point, and based on the time granularity of the meteorological sequence, a historical meteorological process window or a meteorological window of the forecast sample of a preset length is extracted. The extraction logic is a time alignment rule, which specifically includes: When the time granularity of the meteorological sequence is completely consistent with that of the load sequence, a precise alignment method is adopted, and the target start time is directly used as the starting point to synchronously extract continuous meteorological grids of equal duration. When the time granularity of the meteorological sequence is inconsistent with that of the load sequence, the starting time of the load window is used as the reference. The nearest meteorological sampling point on the meteorological time axis that is no later than the reference is selected as the starting point of the meteorological window. A continuous meteorological raster sequence that can completely cover the date to be predicted is extracted from the starting point to complete the time alignment between the meteorological window and the load prediction window.

[0036] The time granularity of the meteorological sequence is the data frequency, which is generally 15 min or 1 h.

[0037] Through the above steps, this embodiment can achieve compatible application of meteorological data sources with different time granularities and load data sources in a single load forecasting task, realize power load forecasting based on multi-source data, and improve the accuracy of forecasting.

[0038] In addition, the embodiments of this application also include a preprocessing step: S14. Perform differential preprocessing on the raw data of the standardized meteorological process window output in step S13 to improve the coding effect of the spatiotemporal meteorological process.

[0039] In this embodiment, the preprocessing step specifically includes: For non-negative skewed variables such as precipitation, a logarithmic transformation is performed. In this embodiment, the log(1+x) transformation is used.

[0040] Channel-level standardization will be implemented for each meteorological channel.

[0041] Standardized parameters were obtained through offline statistical analysis of historical meteorological frames. These standardized parameters include the mean and standard deviation of each channel.

[0042] In this embodiment, after processing in step S143, each meteorological window can be represented as follows:

[0043] in, The length of the weather window. For the number of meteorological variable channels, and These represent the height and width of the weather grid, respectively.

[0044] Step S2: Input the meteorological process window into the pre-trained spatiotemporal autoencoder network to extract the meteorological potential vector; obtain the time period vector of the future to be predicted period; fuse the meteorological potential vector and the time period vector to generate the query feature vector; the pre-trained spatiotemporal autoencoder network is obtained by self-supervised training of the original spatiotemporal autoencoder network, and the self-supervised training is based on historical meteorological grid sequences.

[0045] Specifically, this step is divided into three sub-processes: step S21, which is the extraction of meteorological potential vectors; step S22, which is the construction of time period vectors; and step S23, which is the fusion of two vectors to generate query feature vectors.

[0046] S21. Extract meteorological latent vectors based on pre-trained spatiotemporal autoencoder networks.

[0047] Specifically, the training process of the pre-trained spatiotemporal autoencoder network is obtained as follows: A convolutional recurrent autoencoder is selected as the original spatiotemporal autoencoder network. In this embodiment, a ConvLSTM-AE structure is preferred. It is divided into three parts: an encoder, a latent representation layer, and a decoder. The encoder is used to extract the spatiotemporal evolution features of the meteorological window, the latent representation layer is used to store and represent low-dimensional meteorological latent vectors, and the decoder is responsible for reconstructing the high-dimensional input meteorological window. The reconstruction loss is used to complete the unsupervised and self-supervised training.

[0048] Using historical meteorological process windows as input, the spatiotemporal features of the historical meteorological process windows are extracted and compressed into latent vectors through the encoding end. The input historical meteorological process windows are reconstructed through the decoding end. The initial autoencoder network is trained with the goal of minimizing the reconstruction loss function to obtain a pre-trained spatiotemporal autoencoder network.

[0049] In this embodiment, the complete window timing sequence after preprocessing in S13 is represented as follows:

[0050] in, Indicates the first A multi-channel meteorological raster frame at time t, where t is 1, 2, 3...T. Here, T is the time sequence length of the meteorological window, C is the number of meteorological variable channels, and H and W represent the height and width of the meteorological raster image, respectively.

[0051] In the encoding process, selective memorization and forgetting of the input features at each time step are achieved through forgetting, input, and output gates to extract the spatiotemporal features of the continuous meteorological sequence for the region. The unit state carries long-term memory information, the hidden state outputs the encoding result of the current time step, and the candidate state is the candidate value to be selected into the unit state after nonlinear transformation of the input at the current time step.

[0052] In this embodiment, ConvLSTM encoding units are defined step-by-step, and the convolution operation is denoted as... The sigmoid activation function is denoted as Element-wise multiplication is denoted as tanh is the hyperbolic tangent activation function, and we obtain the result at the th... Input gate, forget gate, output gate, and candidate states at each time step: Input Gate:

[0053] Forgotten Gate:

[0054] Output gate:

[0055] Candidate state:

[0056] in, The hidden state is the previous time step; W and b are the network convolution weights and bias parameters, respectively.

[0057] In the At each time step, the cell state is updated to:

[0058] The hidden state is updated to:

[0059] Subsequently, the global spatiotemporal meteorological representation is extracted: the encoder takes the hidden state at the end of the time series. As the spatiotemporal characteristics of the entire meteorological process, and after flattening and linear mapping, a fixed-dimensional meteorological latent vector is generated:

[0060] in, Indicates the flattening operation. , Let be the potential spatial dimension. In this embodiment, d=128 is preferred. Let the th... The meteorological window corresponding to each historical sample is The encoded meteorological potential vector is then represented as:

[0061] For the weather query window corresponding to the future forecast period Its meteorological potential vector is represented as:

[0062] During the self-supervised training phase of the network, all historical weather windows are used as the training set input to the encoder, and the decoder is trained based on the meteorological latent vectors. The original meteorological process window is reconstructed to obtain the reconstructed meteorological window:

[0063] The global reconstruction loss is calculated using the Frobenius norm to complete the iterative optimization of network parameters. The loss function expression is as follows:

[0064] in, This represents the total number of training samples. express Norm.

[0065] After the network training converges, the encoder Enc weights are fixed and solidified offline for fast inference in both library construction and online retrieval stages, eliminating the need for repeated training.

[0066] S22. Construct a time period vector to avoid recalling historical samples with obviously unreasonable time and location based solely on meteorological similarity.

[0067] Specifically, multi-dimensional periodic features are extracted from the start timestamps of the period to be predicted and historical samples. The selectable periodic features include: day of week, day of month, day of year, week of year, and month ID. Any one or more of these features can be selected individually or in combination.

[0068] The above numerical periodic features are normalized to their maximum and minimum values ​​and mapped to the standard interval [0,1]. Then, a periodic mapping function Cyc( ) is used, which includes both sine and cosine cyclic mapping. The scaled periodic features are periodically encoded to eliminate abrupt changes in time boundaries and generate a standardized time period vector, including the historical sample time period vector t. i With the query sample time period vector t q , respectively represented as:

[0069]

[0070] in, Represents a periodic mapping function. .

[0071] S23. The meteorological potential vector and the time period vector are weighted and fused to generate a query feature vector for similar day retrieval.

[0072] Specifically, it includes: S231, Regarding the meteorological potential vector z i z q Perform L2 normalization on the time period vector t i , t q Perform L2 normalization.

[0073] S232. A time weighting coefficient α is introduced to weight the normalized time period vector, which is used to control the contribution ratio of the time period in the similarity measurement. In this embodiment, α=1.22 is preferred to amplify the weight of time period similarity and avoid retrieving abnormal samples with similar weather but mismatched weekdays / seasons / weeks.

[0074] S233. The normalized meteorological potential vector and the weighted time period vector are concatenated by channels to obtain the concatenated fused vector, which is then L2 normalized again to obtain the final query feature vector used for similarity retrieval:

[0075]

[0076] in, This indicates the L2 normalization operation. This is the time weighting coefficient.

[0077] Step S3: Based on the query feature vector, perform a similar day search in the pre-built historical similar day retrieval database to obtain several historical similar day samples, and obtain the historical load curve and similarity score corresponding to each historical similar day sample. Specifically, this includes: S31. Offline construction of a historical similar day search database.

[0078] S311. Based on a sliding time window `build_stride`, extract all historical load monitoring data. In this embodiment, `build_stride` is preferably set to 12 (adapting to a 15-minute time granularity, with a step size corresponding to 3 hours). Each extracted segment is used as an independent historical sample, and each historical sample corresponds to a load process curve. The length is exactly equal to the downstream load forecast length pred_len.

[0079] S312. Traverse all historical samples and execute the complete process of S1~S2 for each historical sample to generate historical meteorological potential vector, time period vector and normalized historical fusion vector respectively.

[0080] S313, using the fusion vector of historical sample windows As a search key, the load process curve corresponding to the historical sample The data is used as the retrieval value and metadata is stored synchronously. The metadata includes the historical sample start timestamp, time slot identifier, meteorological source identifier, retrieval parameters, etc.

[0081] S314. An offline retrieval database is established using an inner product nearest neighbor search index or an equivalent similarity retrieval structure. In this embodiment, the IndexFlatIP inner product nearest neighbor index is preferably used to construct the historical similarity day retrieval database (DB). The database structure is defined as follows:

[0082] in, For the first The fusion vector of historical samples, Its corresponding load process curve, For the metadata of this sample, This represents the total number of historical samples.

[0083] Since all fused vectors are L2 normalized, the vector inner product is equivalent to cosine similarity, thus achieving similarity calculation and significantly reducing the cost of similarity computation. The retrieval library supports persistent offline storage, achieving decoupling between offline library construction and online querying.

[0084] S32. Based on the query feature vector of the future sample to be predicted. Perform a similar day search in the historical similar day retrieval database constructed in step S31.

[0085] Specifically, during the prediction phase, historical candidate samples that meet preset retrieval constraints are selected from the historical similar day retrieval database. In this embodiment, the preset retrieval constraints include: the timestamp of the historical candidate sample is earlier than the current query time, and the time slot identifier of the historical candidate sample is the same as the time slot identifier of the query sample.

[0086] For example: Suppose we know the meteorological process from 00:15:00 on October 1, 2026 to 00:00::00 on October 2, 2026. If we query the historical similar day retrieval database for the corresponding load curves under similar historical meteorological processes, and three curves are returned: The first load curve runs from 00:15:00 on November 1, 2026 to 00:00:00 on November 2, 2026; the second load curve runs from 00:15:00 on May 1, 2025 to 00:00:00 on May 2, 2025; and the third load curve runs from 05:45:00 on May 1, 2025 to 05:00:00 on May 2, 2025. Of these three curves, only the second one meets the preset search constraints. The timestamp of the first curve is later than the query time, meaning it's "future" rather than "historical" relative to the query point. The time slots for the third curve are different, so the starting time for the query point should be 00:15:00 instead of 05:45:00.

[0087] For all the obtained historical candidate samples, calculate the query feature vector. The cosine similarity is obtained by the inner product of the fusion vectors corresponding to each historical candidate sample; the historical candidate samples are sorted in descending order of cosine similarity scores. Based on the ranking results, select the top K candidate historical samples, i.e. the top-K historical similar day samples, and obtain the top-K historical load curves and their similarity scores corresponding to the top-K historical similar day samples; where K is a positive integer greater than or equal to 1.

[0088] In this embodiment, the retrieval process can be represented as follows:

[0089] in, This indicates a Top-K search operation based on FAISS. This represents the set of indexes of similar samples returned.

[0090] For the candidate set that satisfies the time constraint The similarity score can be expressed as:

[0091] in, This represents the dot product of vectors. Because... and All values ​​have been normalized, therefore the above inner product can be equivalently regarded as cosine similarity.

[0092] Let the top-K historical similar daily load curves obtained from the search be: Y1, Y2, ..., Y K .

[0093] The corresponding similarity scores are: s1, s2, ..., s K .

[0094] Step S4: Calculate the weighted mean curve by weighting the historical load curves and similarity scores corresponding to several historical similar day samples; combine the weighted mean curve with the historical load curves corresponding to several historical similar day samples in parallel to construct a prior feature tensor with multiple channels for use by the downstream load prediction model.

[0095] Specifically, the steps include: S41. Perform exponential normalization on the similarity scores of the Top-K historical similar daily load curves retrieved in step S3, and calculate the weight coefficient w corresponding to each similar daily load curve. k :

[0096] Exponential normalization can amplify the contribution weight of highly similar samples and weaken the interference of low-matching samples on the mean curve.

[0097] S42, Based on weighting coefficient w k The top-K original similar daily load process curves are weighted and summed step-by-step to generate a weighted prior mean curve. This represents the standardized load baseline trend across all similar days.

[0098]

[0099] S43, Weighted prior mean curve The prior feature tensor P is formed by stitching together the top-K original similar daily load process curves according to time steps.

[0100] The first channel is filled with the weighted prior mean curve, and the remaining second to (K+1) channels are filled with the original load process curves of the TOP-K similar days in sequence.

[0101] The prior feature tensor P obtained through the above steps contains (K+1) parallel channels. The first channel is the weighted loading process after filling the weighted prior mean curve, the second channel is the loading process with the highest similarity score, the third channel is the loading process with the second highest similarity score, and so on. In this embodiment, pred_len=96 and K=3, and the final output is a 96×4 dimensional prior feature tensor.

[0102] The prior feature tensor obtained in this step can be used by any downstream load forecasting model, including but not limited to: 1) This tensor has no model binding restrictions and can be directly input into a deep learning load prediction model as an external feature; 2) It serves as a priori mean baseline for subsequent error correction modules; 3) It can be used as a multi-channel empirical curve input for probability load forecasting models, interval forecasting models, or other fusion forecasting models to achieve cross-model universality.

[0103] Furthermore, in a preferred embodiment, the construction of the historical similar day retrieval database and the online predictive query stage can be decoupled and separated into two independent execution chains: an offline stage and an online stage. Offline Phase: Batch execution of historical data preprocessing, ConvLSTM-AE autoencoder inference, historical fusion vector generation, FAISS retrieval index construction, and historical load curve and metadata binding; upon completion, encoder weights, retrieval index arrays, and retrieval metadata are persisted to local disks or distributed storage for repeated use in different prediction tasks. In this embodiment, the preferred batch parameters for library construction are build_batch_size=384 and encoder_batch_size=64 for encoder inference.

[0104] In the online phase: only pre-stored encoders and retrieval libraries are read, and encoding, vector fusion, Top-K retrieval, and tensor construction are performed only on a single query meteorological window. Lightweight computation meets the low-latency requirements of real-time power forecasting.

[0105] Therefore, the complete set of prior construction logic provided in this embodiment can be encapsulated as an independent microservice, with a standardized tensor output interface, without relying on any downstream load forecasting master model, adapting to multiple business scenarios such as power grid dispatching and power trading, and achieving engineering deployment.

[0106] In another typical embodiment of the present invention, a priori feature generation system for power load forecasting based on similar days is provided, for implementing the priori feature generation method for power load forecasting based on similar days in Embodiment 1, specifically including: The meteorological window construction module is used to acquire historical power load sequences and historical meteorological grid sequences, and determine the future forecast period. Using the future forecast period as the time reference, it extracts continuous meteorological data sequences from the historical meteorological grid sequences according to preset time alignment rules, and uses the meteorological data sequences to construct a meteorological process window. The query feature vector generation module is used to input the meteorological process window into a pre-trained spatiotemporal autoencoder network to extract the meteorological potential vector; obtain the time period vector of the future to be predicted period; and fuse the meteorological potential vector and the time period vector to generate the query feature vector. The pre-trained spatiotemporal autoencoder network is obtained by self-supervised training of the original spatiotemporal autoencoder network. The self-supervised training is based on historical meteorological grid sequences. The similar day retrieval module is used to retrieve similar days from a pre-built historical similar day retrieval database based on the query feature vector, obtain several historical similar day samples, and obtain the historical load curve and similarity score corresponding to each historical similar day sample. The prior construction module is used to perform weighted calculations based on the historical load curves and similarity scores corresponding to several historical similar day samples to obtain a weighted mean curve; the weighted mean curve is then combined in parallel with the historical load curves corresponding to several historical similar day samples to generate a prior feature tensor with multiple channels.

[0107] The present invention also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, it can implement any step of the prior feature generation method for power load prediction based on similar days in the embodiments.

[0108] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, can implement any step of the prior feature generation method for power load forecasting based on similar days in the embodiments.

[0109] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Those skilled in the art should understand that the present invention can have various modifications and variations. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for generating prior features for electricity load forecasting based on similar days, characterized in that, Includes the following steps: S1. Obtain historical power load sequences and historical meteorological grid sequences, and determine the future forecast period; using the future forecast period as the time reference, extract continuous meteorological data sequences from the historical meteorological grid sequences according to preset time alignment rules, and construct a meteorological process window using the meteorological data sequences; S2. Input the meteorological process window into a pre-trained spatiotemporal autoencoder network to extract the meteorological potential vector; obtain the time period vector of the future to be predicted period; fuse the meteorological potential vector with the time period vector to generate a query feature vector; the pre-trained spatiotemporal autoencoder network is obtained by self-supervised training of the original spatiotemporal autoencoder network, and the self-supervised training is based on the historical meteorological grid sequence. S3. Based on the query feature vector, perform similar day retrieval in the pre-constructed historical similar day retrieval database to obtain several historical similar day samples, and obtain the historical load curve and similarity score corresponding to each historical similar day sample; S4. Based on the historical load curves and similarity scores corresponding to the several historical similar day samples, a weighted mean curve is obtained; the weighted mean curve is combined in parallel with the historical load curves corresponding to the several historical similar day samples to generate a prior feature tensor with multiple channels.

2. The method for generating prior features for electricity load forecasting based on similar days as described in claim 1, characterized in that: The historical meteorological grid sequence includes at least one of temperature grid sequence, humidity grid sequence, air pressure grid sequence, and wind speed grid sequence; and / or Step S1 also includes preprocessing the constructed meteorological process window, the preprocessing including at least one of normalization, outlier removal and spatial downsampling.

3. The method for generating prior features for electricity load forecasting based on similar days as described in claim 1, characterized in that: The original spatiotemporal autoencoder network employs a convolutional recurrent autoencoder, which includes at least an encoding end and a decoding end. The pre-trained spatiotemporal autoencoder network is obtained by self-supervised training of the original spatiotemporal autoencoder network, specifically including the following steps: Using a historical meteorological process window as input, the spatiotemporal features of the historical meteorological process window are extracted and compressed into a latent vector through the encoding end. The input historical meteorological process window is reconstructed through the decoding end. The original spatiotemporal autoencoder network is trained with the goal of minimizing the reconstruction loss function to obtain the pre-trained spatiotemporal autoencoder network.

4. The method for generating prior features for electricity load forecasting based on similar days as described in claim 1, characterized in that, The process of obtaining the time period vector of the future period to be predicted specifically includes: Extract periodic features from the start time of the future period to be predicted, wherein the periodic features include at least one of the following: day of the week, day of the month, or day of the year; The time period vector is obtained by performing a sine or cosine cyclic mapping on the periodic feature.

5. The method for generating prior features for electricity load forecasting based on similar days as described in claim 1, characterized in that, The step of fusing the meteorological potential vector with the time period vector to generate a query feature vector specifically includes: Euclidean normalization is performed on the meteorological potential vector and the time period vector respectively. Apply a preset time weighting coefficient to the normalized time period vector to obtain a weighted time period vector. The meteorological potential vector is concatenated with the weighted time period vector, and then subjected to maximum and minimum value normalization again to obtain the query feature vector.

6. The method for generating prior features for electricity load forecasting based on similar days as described in claim 1, characterized in that, The construction process of the historical similar day retrieval database is as follows: Historical load monitoring data of the target area is obtained, and the historical load monitoring data is extracted based on a preset sliding time window to obtain multiple historical load curves. Each historical load curve is used as a historical sample. Traverse all the historical samples, determine the corresponding time node for each historical sample and construct the historical meteorological process window corresponding to the time node, and use the pre-trained spatiotemporal autoencoder network to extract the spatiotemporal features of the historical meteorological process window to obtain the historical meteorological potential vector corresponding to each historical sample. Obtain the time period vector corresponding to each historical sample, and fuse the historical meteorological potential vector with the time period vector to obtain the historical fusion vector corresponding to each historical sample. Using the historical fusion vector as the search key and the historical load curve corresponding to the historical sample as the search value, a historical similar day search database is established.

7. The method for generating prior features for electricity load forecasting based on similar days as described in claim 1, characterized in that, In step S3, based on the query feature vector, a similar day search is performed in the pre-built historical similar day retrieval database to obtain several historical similar day samples, and the historical load curve and similarity score corresponding to each historical similar day sample are obtained, specifically including: In the historical similar day retrieval database, historical candidate samples that meet preset retrieval constraints are selected; the preset retrieval constraints include: the timestamp of the historical candidate sample is earlier than the current query time, and the time slot identifier of the historical candidate sample is the same as the time slot identifier of the time period vector. Calculate the cosine similarity between the query feature vector and the fusion vector corresponding to each of the historical candidate samples; sort the historical candidate samples according to the cosine similarity from high to low. Based on the ranking results, the top K candidate historical samples are selected as the several historical similar day samples, and the historical load curves of the several historical similar day samples and their corresponding similarity scores are obtained; where K is a positive integer greater than or equal to 1.

8. The method for generating prior features for electricity load forecasting based on similar days as described in claim 1, characterized in that, In step S4, a weighted mean curve is obtained by weighting the historical load curves and similarity scores corresponding to the several historical similar day samples; the weighted mean curve is then combined in parallel with the historical load curves corresponding to the several historical similar day samples to generate a prior feature tensor with multiple channels, specifically including: The similarity scores of the aforementioned historical similar day samples are subjected to exponential normalization to obtain the weight coefficients of each historical similar day sample. Based on the weighting coefficients, the historical load curves corresponding to the several historical similar day samples are weighted and summed to obtain the weighted prior mean curve. The weighted prior mean curve is used as the first channel, and the historical load curves corresponding to the several historical similar day samples are used as subsequent channels in sequence. They are spliced ​​together according to time steps to form a multidimensional tensor, thus obtaining the prior feature tensor.

9. The method for generating prior features for electricity load forecasting based on similar days as described in claim 1, characterized in that, The step of extracting continuous meteorological data sequences according to a preset time alignment rule specifically includes: Obtain the time granularity of meteorological sequences and load sequences; If the time granularity of the meteorological sequence is inconsistent with the time granularity of the load sequence, then the start time of the future period to be predicted shall be used as the reference, and the nearest time point on the meteorological time axis that is no later than the reference shall be selected as the starting point of the meteorological window. Starting from the aforementioned starting point, a continuous meteorological sequence covering the dates corresponding to the future period to be predicted is extracted.

10. A priori feature generation system for power load forecasting based on similar days, used to implement the priori feature generation method for power load forecasting based on similar days as described in any one of claims 1-9, characterized in that, Specifically, it includes: The meteorological window construction module is used to acquire historical power load sequences and historical meteorological grid sequences, and determine the future forecast period; using the future forecast period as the time reference, it extracts continuous meteorological data sequences from the historical meteorological grid sequences according to preset time alignment rules, and uses the meteorological data sequences to construct a meteorological process window; The query feature vector generation module is used to input the meteorological process window into a pre-trained spatiotemporal autoencoder network to extract the meteorological potential vector; obtain the time period vector of the future to be predicted period; and fuse the meteorological potential vector with the time period vector to generate the query feature vector; the pre-trained spatiotemporal autoencoder network is obtained by self-supervised training of the original spatiotemporal autoencoder network, and the self-supervised training is based on the historical meteorological grid sequence; The similar day retrieval module is used to retrieve similar days in a pre-built historical similar day retrieval database based on the query feature vector, obtain several historical similar day samples, and obtain the historical load curve and similarity score corresponding to each historical similar day sample; The prior construction module is used to perform weighted calculations based on the historical load curves and similarity scores corresponding to the several historical similar day samples to obtain a weighted mean curve; the weighted mean curve is combined in parallel with the historical load curves corresponding to the several historical similar day samples to generate a prior feature tensor with multiple channels.

11. An electronic device, characterized in that, The system includes a memory and a processor. The memory stores a computer program, which, when executed by the processor, can implement the steps of the method for generating prior features for power load forecasting based on similar days as described in any one of claims 1-9.

12. A computer-readable storage medium, characterized in that, It stores a computer program, which, when executed by a processor, can implement the steps of the method for generating prior features for power load forecasting based on similar days as described in any one of claims 1-9.