Power prediction method, device, equipment, storage medium and product
By extracting and encoding the timing information of historical power characteristic sequences, a correlation matrix is constructed to perform power prediction, solving the limitations of traditional Transformer in power prediction, and achieving high-precision and flexible power prediction.
Patent Information
- Application Number
- CN202510696496.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-28
- Publication Date
- 2025-06-27
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the power prediction scenario, traditional Transformers have problems such as insensitive time sequence, inability to characterize complex periodic characteristics, and fixed prediction lengths, resulting in limited prediction accuracy and practicality.
A power prediction method is proposed, by extracting the timing information of the historical power feature sequence, calculating the timing characteristics, and performing time encoding, and constructing a correlation matrix for power prediction. This method solves the limitations of traditional models through the synergy of time feature extraction, time encoding and fusion modules.
Accurate modeling of the time sequence and complex cycles of power data is realized, which significantly improves prediction accuracy and practicality, and can flexibly adapt to prediction needs of different lengths.
Smart Images

Figure CN120218685A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of data processing, and particularly to a power prediction method, device, equipment, storage medium, and product. Background Art
[0002] Power prediction is one of the core technologies in power system planning and operation. Its goal is to predict future power demand through historical power consumption data (such as features like peak value, mean value, variance, etc.). With the increasing dynamicity of energy supply and demand, high-precision prediction is crucial for optimizing power grid scheduling and reducing energy waste. However, power data is affected by multiple factors such as population, economy, and climate, showing complex periodicity (such as daily / monthly cycles) and non-stationarity (such as sudden changes during holidays), which poses significant challenges to traditional prediction methods.
[0003] Current power prediction mainly relies on two types of methods: traditional methods based on statistics (such as the autoregressive integrated moving average model) and models based on deep learning (such as Transformer). Among them, Transformer has gradually become the mainstream due to its long sequence modeling ability of the attention mechanism and the advantage of parallel computing. It represents the time order through position encoding and relies on a feed-forward neural network to generate the prediction sequence, showing outstanding performance in capturing long-distance dependencies.
[0004] However, traditional Transformer has fundamental limitations in the power prediction scenario: First, the attention mechanism is insensitive to the time step order and is difficult to model the strong periodic characteristics of power data; Second, the position encoding of trigonometric functions with a fixed frequency cannot represent complex periodic patterns (such as the superposition of cross-scale daily / monthly cycles), resulting in the loss of key timing features; Third, the parameter dimension of the feed-forward neural network is bound to the length of the prediction sequence and cannot adapt to the frequently changing prediction length requirements in the actual scenario, severely restricting the flexibility of the model. These problems directly limit the prediction accuracy and practicality and urgently need targeted improvement.
[0005] The above content is only used to assist in understanding the technical solution of this application and does not represent an admission that the above content is prior art. Summary of the Invention
[0006] The main purpose of this application is to provide a power prediction method, device, equipment, storage medium, and computer program product, aiming to improve the accuracy and practicality of power prediction.
[0007] To achieve the above purpose, this application proposes a power prediction method, and the method includes: Extract timing information from the pre-obtained historical power feature sequence to calculate the timing features of the historical power feature sequence according to the timing information; Perform time encoding based on the timing characteristics, the sampling dates of the historical power feature sequences, and the sampling dates of the preset prediction sequences to obtain the target time encoding of the input sequence and the target time encoding of the prediction sequence; Construct a correlation matrix based on the target time encoding of the input sequence and the target time encoding of the prediction sequence, and perform power prediction based on the correlation matrix to obtain a power prediction result.
[0008] In one embodiment, the step of extracting the timing information in the pre-acquired historical power feature sequence to calculate the timing characteristics of the historical power feature sequence according to the timing information includes: Extract the timing information in the historical power feature sequence; Perform reversible instance normalization processing on the timing information in the historical power feature sequence to obtain a stationary historical power feature sequence; Calculate the timing characteristics of the historical power feature sequence based on a preset weight matrix, bias matrix, and the stationary historical power feature sequence.
[0009] In one embodiment, the step of performing time encoding based on the timing characteristics, the sampling dates of the historical power feature sequence, and the sampling dates of the preset prediction sequence to obtain the target time encoding of the input sequence and the target time encoding of the prediction sequence includes: Map the timing characteristics of the historical power feature sequence into linear components and frequency components; Perform time encoding on the sampling dates of the historical power feature sequence based on the linear components and frequency components to obtain the time encoding of the input sequence, and perform time encoding on the sampling dates of the prediction sequence based on the linear components and frequency components to obtain the time encoding of the prediction sequence; Perform encoding aggregation according to the time encoding of the input sequence and the time encoding of the prediction sequence respectively to obtain the target time encoding of the input sequence and the target time encoding of the prediction sequence.
[0010] In one embodiment, the step of constructing a correlation matrix based on the target time encoding of the input sequence and the target time encoding of the prediction sequence, and performing power prediction based on the correlation matrix to obtain a power prediction result includes: Calculate a correlation matrix according to the target time encoding of the input sequence and the target time encoding of the prediction sequence; Calculate a power prediction sequence according to the correlation matrix and the timing characteristics of the historical power feature sequence; Map the feature dimension of the power prediction sequence to a preset task target feature dimension to obtain a power prediction result.
[0011] In one embodiment, the power prediction sequence is obtained by multiplying the correlation matrix by the transposed matrix of the temporal features of the historical power feature sequence. The step of mapping the feature dimension of the power prediction sequence to a preset task target feature dimension to obtain a power prediction result includes: Perform a linear transformation on the power prediction sequence according to a preset learnable weight parameter and a preset learnable bias parameter to map the feature dimension of the power prediction sequence to a preset task target feature dimension, thereby obtaining a power prediction result. The learnable weight parameter and the learnable bias parameter are independent of the task target feature dimension.
[0012] In one embodiment, after the step of constructing a correlation matrix based on the input sequence target time encoding and the prediction sequence target time encoding to perform power prediction based on the correlation matrix to obtain a power prediction result, the following steps are further included: Based on the mean and standard deviation of the historical power feature sequence, perform an inverse operation of the invertible instance normalization process on the power prediction result to obtain a completed power prediction result.
[0013] In addition, to achieve the above object, the present application further provides a power prediction device, which includes: An extraction module, configured to extract temporal information from a pre-acquired historical power feature sequence, and calculate the temporal features of the historical power feature sequence according to the temporal information; An encoding module, configured to perform time encoding according to the temporal features, the sampling date of the historical power feature sequence, and the sampling date of a preset prediction sequence to obtain an input sequence target time encoding and a prediction sequence target time encoding; A prediction module, configured to construct a correlation matrix based on the input sequence target time encoding and the prediction sequence target time encoding, and perform power prediction based on the correlation matrix to obtain a power prediction result.
[0014] In addition, to achieve the above object, the present application further provides a power prediction device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor. The computer program is configured to implement the steps of the power prediction method as described above.
[0015] In addition, to achieve the above object, the present application further provides a storage medium, which is a computer-readable storage medium. A computer program is stored on the storage medium, and when the computer program is executed by a processor, the steps of the power prediction method as described above are implemented.
[0016] In addition, to achieve the above object, the present application further provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the power prediction method described above.
[0017] One or more technical solutions proposed in the present application extract the timing information in the pre-acquired historical power feature sequence to calculate the timing features of the historical power feature sequence according to the timing information; perform time encoding according to the timing features, the sampling date of the historical power feature sequence, and the sampling date of the pre-set prediction sequence to obtain the input sequence target time encoding and the prediction sequence target time encoding; construct a correlation matrix based on the input sequence target time encoding and the prediction sequence target time encoding to perform power prediction based on the correlation matrix and obtain a power prediction result, solving the problems that traditional prediction models are insensitive to time order, position encoding cannot represent complex periodic characteristics, and the prediction length is fixed, and thus realizing accurate modeling of the time order and complex periods of power data, and significantly improving the prediction accuracy and practicality. Description of the Drawings
[0018] The drawings here are incorporated into the specification and constitute a part of this specification, showing the embodiments in line with the present application, and are used together with the specification to explain the principles of the present application.
[0019] To more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0020] Figure 1 It is a schematic flowchart provided for the first embodiment of the power prediction method of the present application; Figure 2 It is a schematic diagram of the network structure of the power prediction model in the embodiment of the present application; Figure 3 It is a schematic flowchart provided for the second embodiment of the power prediction method of the present application; Figure 4 It is a schematic diagram of the module structure of the power prediction device in the embodiment of the present application; Figure 5 It is a schematic diagram of the device structure of the hardware operating environment involved in the power prediction method in the embodiment of the present application.
[0021] The realization of the object, functional features and advantages of the present application will be further described with reference to the embodiments and the drawings. Detailed Embodiments
[0022] It should be understood that the specific embodiments described herein are merely used to explain the technical solutions of the present application and are not used to limit the present application.
[0023] To better understand the technical solutions of the present application, the following will be described in detail in conjunction with the accompanying drawings of the specification and specific implementation manners.
[0024] The main solution of the embodiments of the present application is: to propose a deep learning model, which is specifically designed for the power prediction scenario, aiming to solve the deficiencies of the traditional Transformer model in terms of time-order sensitivity, complex cycle representation ability, and variable-length prediction flexibility. The core solution is achieved through the coordination of three modules: Firstly, there is a time feature extraction module. This module first performs reversible instance normalization (RevIN) on the input historical power feature sequence to eliminate the non-stationarity of the sequence (such as seasonal fluctuations or trend changes), and converts the original data into a stationary sequence. Subsequently, it extracts temporal features through a linear transformation to capture the potential patterns of the sequence (such as local trends or periodic segments). The temporal features generated in this process are used as the input for the subsequent module, and at the same time, the inverse transformation parameters of RevIN are retained to restore the non-stationary information after the prediction is completed, ensuring that the output result conforms to the actual physical meaning.
[0025] Secondly, the time encoding module receives the temporal features and the sampling dates of the input / prediction sequences (such as information about the week, month, etc. of historical dates and future dates), and generates time encoding through two steps. First, the temporal features are decomposed into a linear component (representing the long-term trend) and a frequency component (representing the complex cycle), and are respectively subjected to a Kronecker product operation with the sampling dates to generate linear encoding and periodic encoding. Subsequently, the two types of encoding are fused through concatenation and aggregation operations to generate the final time encoding. The time encoding of the input sequence reflects the temporal relationship of historical time steps, and the time encoding of the prediction sequence is generated based on the user-specified future dates. The two jointly construct the correlation between time steps.
[0026] Finally, the fusion module constructs an attention correlation matrix between the input sequence and the prediction sequence based on their time encodings, representing the similarity between historical time steps and future time steps (such as the correlation strength between the historical Monday morning peak and the predicted Monday morning peak). By performing matrix multiplication on this matrix and the temporal features of the input sequence, an intermediate representation of the prediction sequence is generated, and then it is mapped to the target feature dimension through a linear layer to output the final prediction result. The key of this module lies in the decoupling of its parameter dimension from the prediction length, relying only on the fixed-dimension parameters of the linear layer, thereby supporting prediction requirements of any length without retraining or adjusting the model structure.
[0027] The model sequentially performs three steps: time feature extraction, time encoding generation, and fusion prediction, and optimizes the parameters through end-to-end training. The innovative design of the time encoding module enables the model to capture both linear trends (such as the annual increase in electricity consumption) and complex cycles (such as the superposition of cross-scale daily / monthly cycles) simultaneously, while the variable-length prediction mechanism of the fusion module solves the dependence of traditional models on fixed output lengths. This solution optimizes specifically for the characteristics of power data while maintaining the parallel computing advantages of Transformer, significantly improving the prediction accuracy and practical application flexibility.
[0028] Since existing power prediction technologies mainly rely on two types of methods: traditional methods based on statistics (such as autoregressive integrated moving average model) and deep learning-based models (such as Transformer). Among them, Transformer has gradually become the mainstream due to its long-sequence modeling ability and parallel computing advantages of the attention mechanism. It represents the time order through positional encoding and relies on a feed-forward neural network to generate the prediction sequence, showing outstanding performance in capturing long-range dependencies.
[0029] However, traditional Transformer has fundamental limitations in power prediction scenarios: First, the attention mechanism is insensitive to the order of time steps and is difficult to model the strong periodic characteristics of power data; Second, the positional encoding of trigonometric functions with a fixed frequency cannot represent complex periodic patterns (such as the superposition of cross-scale daily / monthly cycles), resulting in the loss of key time series features; Third, the parameter dimension of the feed-forward neural network is bound to the length of the prediction sequence and cannot adapt to the frequently changing prediction length requirements in actual scenarios, severely restricting the flexibility of the model. These problems directly limit the prediction accuracy and practicality and urgently require specific improvements.
[0030] This application provides a solution. By extracting the time series information from the pre-acquired historical power feature sequence, the time features of the historical power feature sequence are calculated according to the time series information; time encoding is performed based on the time features, the sampling dates of the historical power feature sequence, and the sampling dates of the pre-set prediction sequence to obtain the target time encoding of the input sequence and the target time encoding of the prediction sequence; a correlation matrix is constructed based on the target time encoding of the input sequence and the target time encoding of the prediction sequence, and power prediction is performed based on the correlation matrix to obtain the power prediction result, solving the problems that traditional prediction models are insensitive to time order, positional encoding cannot represent complex periodic characteristics, and the prediction length is fixed, thereby realizing accurate modeling of the time order and complex cycles of power data and significantly improving the prediction accuracy and practicality.
[0031] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication, and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device, a power prediction system, etc. that can implement the above functions. Hereinafter, a power prediction system will be taken as an example to illustrate this embodiment and the following embodiments.
[0032] Based on this, an embodiment of the present application provides a power prediction method. Referring to Figure 1 , Figure 1 is a schematic flowchart of the first embodiment of the power prediction method of the present application.
[0033] In this embodiment, the power prediction method includes steps S1000 to S3000: Step S1000: Extract temporal information from a pre-acquired historical power feature sequence to calculate the temporal features of the historical power feature sequence according to the temporal information; It should be noted that an embodiment of the present application proposes a deep learning model named D2Vformer, which is applied to the field of power prediction. The model introduces the sampling date of the time step and encodes the sampling date of the time step, enabling the attention mechanism to utilize the temporal order relationship of the time steps. Based on such an encoding method, D2Vformer enables the traditional attention mechanism to consider the temporal information of the time steps.
[0034] In addition, D2Vformer in the present application proposes a fusion module to replace the feed-forward neural network in the Transformer model. The parameter dimension of the fusion module is decoupled from the prediction sequence length, enabling D2Vformer to meet the requirements of variable-length prediction tasks and solving the problem of inflexible prediction existing in the existing Transformer model. Specifically, aiming at the problem that the attention mechanism in the Transformer model is insensitive to temporal information in the power prediction scenario, an embodiment of the present application proposes a new temporal encoding. This strategy encodes the date of the time step by introducing the sampling date of the time step, thereby effectively representing the temporal information of the time step. Through this encoding method, the attention mechanism can consider the temporal order relationship between them when mining the correlation of time steps.
[0035] Aiming at the problem that the position encoding in the Transformer model cannot represent the complex periodic characteristics of power data, the present application proposes a new temporal encoding method. By separately extracting and encoding the linear component and frequency component in the input sequence, the output temporal encoding can reflect the trend pattern and periodic pattern of power data.
[0036] Regarding the problem that the feed-forward neural network of the Transformer model cannot flexibly adjust the output length according to actual needs in prediction tasks, this application uses a fusion module to replace the feed-forward neural network. The parameter dimension of this module is decoupled from the length of the output time series, so that the model can meet the requirements of variable-length prediction tasks. Specifically, this module constructs a similarity matrix between the input sequence and the prediction sequence based on the time encoding method proposed by D2Vformer, and realizes the prediction output based on this matrix. Since the construction process of this matrix does not depend on the preset prediction length, the model has the ability of variable-length prediction, which is a very important ability for the real world and greatly promotes the application of real-world prediction tasks.
[0037] It should be noted that in the embodiments of this application, a given historical power feature sequence , where is the number of power features, is the historical time length. is the future data to be predicted, is the prediction time length. This invention completes the prediction of future data based on the given historical data . Assuming that the prediction result of the model is , the task of this invention can be expressed in the following form:
[0038] To significantly improve the accuracy of power prediction, the embodiments of this application introduce the sampling dates of the input and output sequences, and propose a time encoding module to encode them, so as to assist the prediction model to mine the time information of the power sequence. In addition, we design a fusion module, which constructs a similarity matrix between the input sequence and the prediction sequence using the attention mechanism, and predicts the power sequence based on this matrix. Since the parameter dimension of the fusion module is decoupled from the length of the prediction sequence, it can meet the requirements of variable-length power sequence prediction.
[0039] As Figure 2 shows, it is a schematic diagram of the network structure of the power prediction model in the embodiments of this application, including a temporal feature extraction module (Temporal Feature, TFE), a date encoding module (Date2Vec, D2V), and a fusion module (Fusion). Specifically, the temporal feature extraction module extracts the temporal information of the input information and mines the temporal features of the sequence. The date encoding module receives the temporal features and encodes the time steps in the input sequence in combination with the sampling dates of the time steps. The fusion module constructs a correlation matrix based on the date encodings of the input sequence and the prediction sequence, and realizes the prediction based on this matrix. Therefore, the framework of this invention can be expressed as:
[0040]
[0041]
[0042] wherein represents the temporal features of the extracted input sequence, which is the dimension of the preset hidden state. and are the sampling dates of the input sequence and the prediction sequence respectively, which represents the dimension of the sampling date. and represent the time encodings of the input sequence and the prediction sequence respectively, and
[0043] is the power prediction result. In addition, it should be noted that the "historical power feature sequence" refers to the multi-dimensional time series data obtained by extracting features from historical power data, and its dimensions include the number of power features (such as peak value, mean value, variance, etc.) and the historical time step length. Among them, the "temporal information" refers to the time-related patterns hidden in the power data, such as trendiness, periodicity, and non-stationarity.
[0044] In the embodiments of the present application, by extracting temporal information and calculating temporal features, it aims to eliminate the interference of non-stationarity of the original data and capture its deep temporal laws. Specifically, the system first performs instance-level mean and variance normalization on the input sequence through Reversible Instance Normalization (RevIN) to obtain a stationary historical power feature sequence, and then maps the stationary sequence to the hidden space through a linear transformation to obtain a low-dimensional dense temporal feature representation. In a possible implementation manner, the inverse operation of the reversible instance normalization process will restore the non-stationary information after the prediction is completed to ensure that the prediction result is consistent with the actual physical dimension. For example, in a specific implementation manner, the system independently normalizes each instance of the input sequence to a sequence with a mean of 0 and a variance of 1 through the RevIN module, and then maps it to a temporal feature with a hidden dimension of H through the linear layer weight matrix and bias matrix.
[0045] Step S2000: Perform time encoding according to the temporal features, the sampling date of the historical power feature sequence, and the preset sampling date of the prediction sequence to obtain the target time encoding of the input sequence and the target time encoding of the prediction sequence; It should be noted that in the embodiments of the present application, the sampling date refers to the time marker of the historical power feature sequence and the prediction sequence, which is used to identify the specific time point to which the data belongs. Time encoding is a process of converting time information into a numerical form that can be processed by the model, with the aim of enabling the model to better understand and utilize the patterns in the time dimension. In this step, by combining the time series features with the sampling date and introducing the sampling date of the prediction sequence, the time encoding of the input sequence and the prediction sequence is generated. This process can help the model better capture the linear patterns and complex periodic patterns between time steps, thereby improving the accuracy of power prediction.
[0046] In addition, it should be noted that in a possible implementation manner, time encoding can be achieved by mapping the time series features into linear components and frequency components, where the linear components are used to capture the trend information of the time series, and the frequency components are used to capture the periodic information. In this way, the model can better adapt to the complex characteristics of power data, such as daily periodicity and monthly periodicity. In this embodiment, the generation process of time encoding not only considers the time information of historical data, but also introduces the sampling date of the prediction sequence, enabling the model to more comprehensively utilize the patterns in the time dimension.
[0047] For example, in a specific implementation manner, assume that the sampling date of the historical power feature sequence is midnight every day, and the sampling date of the prediction sequence is midnight in the next few days. The system first maps the time series features into linear components and frequency components through linear transformation and Fourier transformation respectively. Then, in combination with the sampling date, the time encoding of the input sequence and the prediction sequence is performed respectively. Finally, the obtained time encoding of the input sequence and the time encoding of the prediction sequence will be used as the input for constructing the correlation matrix in the subsequent steps to achieve power prediction.
[0048] Step S3000: Construct a correlation matrix based on the time encoding of the input sequence and the time encoding of the prediction sequence, and perform power prediction based on the correlation matrix to obtain a power prediction result.
[0049] It should be noted that in the embodiments of the present application, the correlation matrix is a matrix used to represent the similarity or correlation between the input sequence and the prediction sequence, and its elements reflect the positional similarity between time steps. The purpose of this step is to predict the future power feature sequence by constructing a correlation matrix and utilizing the time information of the input sequence. In this way, the model can generate an estimated value of the future power demand, that is, the power prediction result, according to the time laws and patterns of historical data. This process can not only improve the prediction accuracy, but also flexibly support prediction sequences of different lengths.
[0050] In addition, it should be noted that in a possible implementation manner, the correlation matrix can be obtained by calculating the dot product or cosine similarity between the time encoding of the input sequence and the time encoding of the prediction sequence. In this way, the model can quantify the temporal correlation between the input sequence and the prediction sequence. In this embodiment, the process of power prediction based on the correlation matrix can be realized through matrix operations. For example, multiplying the correlation matrix by the transposed matrix of the temporal features of the input sequence to obtain the power prediction sequence. Finally, the feature dimension of the prediction sequence is mapped to the task target feature dimension through a linear transformation to obtain the power prediction result.
[0051] For example, in a specific implementation manner, assume that the time encoding of the input sequence and the time encoding of the prediction sequence are both two-dimensional matrices. The system first calculates the correlation matrix between them through a dot product operation. Then, multiply the correlation matrix by the transposed matrix of the temporal features of the input sequence to obtain the power prediction sequence. Finally, perform a linear transformation on the prediction sequence through preset learnable weight and bias parameters to adjust the feature dimension to be consistent with the task target dimension, thereby obtaining the final power prediction result. This process can not only achieve high-precision power prediction but also flexibly adapt to different prediction length requirements.
[0052] In a feasible implementation manner, step S1000 may include steps S1100 to S1300: Step S1100: Extract the temporal information in the historical power feature sequence; Step S1200: Perform reversible instance normalization processing on the temporal information in the historical power feature sequence to obtain a stationary historical power feature sequence; Step S1300: Calculate the temporal features of the historical power feature sequence based on a preset weight matrix, bias matrix, and the stationary historical power feature sequence.
[0053] It should be noted that in the embodiments of the present application, the "historical power feature sequence" refers to the multi-dimensional time series data obtained by extracting features from historical power data, and its dimensions include the number of power features (such as peak value, mean value, variance, etc.) and the length of historical time steps. The "temporal information" refers to the information related to time dynamics implicitly contained in power data, including trendiness, periodicity, and non-stationarity. The purpose of this step is to isolate the core patterns related to time evolution from the original data by extracting temporal information, providing a basis for subsequent processing. Specifically, the system extracts local temporal patterns from the original sequence through a sliding window or segmented processing. For example, the convolutional operation or self-attention mechanism is used to capture the dependencies between adjacent time steps. In a possible implementation, the extraction of temporal information can be combined with Fourier transform or wavelet transform to separate high-frequency (periodic) and low-frequency (trend) components. For example, in a specific implementation, the system divides the historical power feature sequence into multiple subsequences through a sliding window, and uses the self-attention mechanism to calculate the correlation weights between time steps, thereby extracting the hidden features representing temporal dynamics.
[0054] It should be noted that in the embodiments of the present application, the "invertible instance normalization processing" refers to performing a normalization operation on each independent historical power feature sequence instance to eliminate its non-stationarity (such as mean shift, variance fluctuation), and designing the processing process in a reversible form for subsequent recovery. The "stationary historical power feature sequence" refers to a sequence with stable statistical characteristics (mean and variance) after normalization. The purpose of this step is to solve the problem of distribution drift caused by factors such as seasons and holidays in power data, and improve the model's ability to model non-stationary time series. Specifically, the system calculates the mean and standard deviation of each input instance respectively, converts the original sequence into a sequence with a mean of 0 and a variance of 1, and at the same time retains the normalization parameters for the inverse transformation of the prediction result. In a possible implementation, the mathematical expression of invertible instance normalization is:
[0055] where μ and σ are the mean and standard deviation of the input sequence respectively. For example, in a specific implementation, the system independently calculates the mean and standard deviation of each instance of the historical power feature sequence, converts it into a stationary sequence and inputs it into the linear layer, and restores the non-stationary information after prediction.
[0056] It should be noted that in the embodiments of the present application, the "preset weight matrix and bias matrix" refers to the parameter matrix obtained through training and learning in the model, which is used to map the stationary sequence to the hidden space. The "temporal feature" refers to the low-dimensional dense vector obtained after linear transformation, which represents the deep temporal pattern of the power sequence. In this embodiment, the stationary sequence is mapped to the temporal feature space through linear transformation, aiming to compress the data dimension and extract the high-order temporal correlation. The time feature extraction module consists of an invertible instance normalization and a linear layer. The time feature extraction module first performs invertible instance normalization on the input sequence to alleviate the non-stationarity of the sequence. Then, the time features of the stationary sequence are mined through the linear layer. Specifically, the processing of the input sequence by the time feature extraction module can be expressed as:
[0057] Where , represents the weight matrix, represents the bias vector. It should be noted that since the time feature extraction module uses to remove the non-stationary information in the input sequence, after the model completes the prediction, it is necessary to restore the non-stationary information in the prediction sequence.
[0058] This embodiment provides a power prediction method. By extracting the temporal information in the pre-acquired historical power feature sequence, the temporal features of the historical power feature sequence are calculated according to the temporal information; time encoding is performed based on the temporal features, the sampling dates of the historical power feature sequence, and the sampling dates of the preset prediction sequence to obtain the input sequence time encoding and the prediction sequence time encoding; a correlation matrix is constructed based on the input sequence time encoding and the prediction sequence time encoding, and power prediction is performed based on the correlation matrix to obtain a power prediction result, which solves the problems that traditional prediction models are insensitive to the time order, position encoding cannot represent complex periodic characteristics, and the prediction length is fixed, thereby realizing accurate modeling of the time order and complex cycles of power data, and significantly improving the prediction accuracy and practicality.
[0059] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar content as in the above-mentioned embodiment 1 can be referred to the above introduction and will not be repeated hereinafter. On this basis, please refer to Figure 3 , and step S2000 of the power prediction method further includes steps S2100 to S2300: Step S2100: Map the temporal features of the historical power feature sequence into linear components and frequency components; It should be noted that in the embodiments of the present application, the temporal features refer to the feature vectors extracted from the historical power feature sequence that can reflect the laws of the time series. These feature vectors contain the trend and periodic information of the time series. The linear component refers to the part of the temporal features that is linearly related to time and is used to capture the trend changes of the time series; while the frequency component refers to the part related to the periodicity of time and is used to capture the periodic changes of the time series. The purpose of this step is to decompose the temporal features into linear components and frequency components so that the subsequent steps can process these two types of components separately, thereby making more effective use of time information for power prediction. Through this mapping method, the model can decompose complex temporal features into more easily processed linear components and frequency components, providing a basis for subsequent time encoding.
[0060] In this embodiment, by mapping the temporal features into linear components and frequency components, it aims to separate the trend patterns and periodic patterns in the power data, providing a multi-dimensional representation basis for subsequent time encoding. Specifically, the system extracts the linear component from the temporal features through linear transformation and the frequency component and the frequency component . In a possible implementation manner, the weight parameter of the linear component and the weight matrix of the frequency component are adaptively learned through model training to match the complex characteristics of the power data. For example, in a specific implementation manner, the temporal features generate the linear component through linear transformation , and generate the frequency component through frequency transformation , where k is the preset dimension of the frequency component.
[0061] For example, in a specific implementation manner, the time encoding module receives the time features extracted by the previous module, the sampling date of the input sequence, and the sampling date of the prediction sequence. The time encoding module first maps the time features into linear components and frequency components, and then uses them as parameters to encode the sampling dates of the input sequence and the prediction sequence respectively. The time encoding based on this module can not only learn the linear patterns of the time step positions, but also learn the complex periodic patterns in the feature sequence. Specifically, the calculation process of the time encoding module can be expressed as:
[0062]
[0063] where represents the weight vector, represents the bias vector, represents the weight matrix, represents the bias matrix. represents the sequence length, is the dimension of the preset frequency component, is expressed as the dimension of the preset hidden state.
[0064] Step S2200: Perform time encoding on the sampling dates of the historical power feature sequence based on the linear component and the frequency component to obtain the time encoding of the input sequence, and perform time encoding on the sampling dates of the prediction sequence based on the linear component and the frequency component to obtain the time encoding of the prediction sequence; It should be noted that in the embodiments of the present application, "time encoding" refers to an encoding vector generated by combining the sampling date of the time step (such as date, week, season, etc.) with the linear component and the frequency component, which is used to characterize the temporal attributes of the time step. The "time encoding of the input sequence" and the "time encoding of the prediction sequence" respectively correspond to the encoding results of the historical time step and the future time step. This step encodes the sampling date through the linear component and the frequency component, aiming to fuse the trend and periodic information of the power data and generate a feature representation containing complex time patterns. Specifically, the system performs the following operations on the sampling dates of the input sequence and the prediction sequence respectively: Linear encoding: Perform the Kronecker product operation ( ) on the linear component and the sampling date, and superimpose the bias or to generate the linear trend encoding; Periodic encoding: Perform the Kronecker product operation on the frequency component and the sampling date, and after non-linearization through the sine function, superimpose the bias or to generate the periodic fluctuation encoding; Merged encoding: Concatenate (Concat) the linear encoding and the periodic encoding into the complete time encoding. The formulas are respectively:
[0065]
[0066] Among them, represents the linear component, represents the frequency component. represents the Kronecker product, represents the concatenation operation. And represents the time encoding of the input sequence, represents the time encoding of the prediction sequence.
[0067] Step S2300: Perform encoding aggregation according to the time encoding of the input sequence and the time encoding of the prediction sequence respectively to obtain the target time encoding of the input sequence and the target time encoding of the prediction sequence.
[0068] It should be noted that in the embodiments of the present application, "encoding aggregation" refers to performing a dimensionality reduction operation on high-dimensional time encoding to generate a compact target time encoding. The "input sequence target time encoding" and the "prediction sequence target time encoding" are respectively the aggregated historical and future time step encodings, and their dimensions match the model calculation requirements. This embodiment reduces the encoding complexity through the aggregation operation, aiming to reduce the resource consumption of subsequent calculations while retaining key timing information. Specifically, the system performs the following operations on the time encoding and along the date feature dimension M to sum, and the formula is:
[0069]
[0070] and are respectively represented as the final time encoding of the input sequence and the final time encoding of the prediction sequence. i, j, k, and l represent different dimensions of the elements in the time encoding, and represent the sum of the original data along the last dimension of the time encoding respectively.
[0071] In a possible implementation manner, the Kronecker product is used to expand the dimension of the date feature to enable it to interact with the component features. For example, in a specific implementation manner, the input sequence time encoding and the prediction sequence time encoding , where M is the date feature dimension, L and O are the lengths of the input and prediction sequences respectively. The input sequence target time encoding and the prediction sequence target time encoding are obtained. In a possible implementation manner, the aggregation operation can be replaced by mean pooling or max pooling, but the summation operation can retain the contributions of all date features. For example, in a specific implementation manner, the system adds the elements of the date dimension (the 4th dimension) of and to generate a target encoding with reduced dimensions for subsequent correlation matrix calculation.
[0072] In a feasible implementation manner, step S3000 may include steps S3100 to S3300: Step S3100: Calculate a correlation matrix based on the input sequence target time encoding and the prediction sequence target time encoding; Step S3200: Calculate a power prediction sequence based on the correlation matrix and the temporal characteristics of the historical power feature sequence; Step S3300: Map the feature dimension of the power prediction sequence to a preset task target feature dimension to obtain a power prediction result.
[0073] In a feasible implementation manner, step S3300 may include step S3310: Perform a linear transformation on the power prediction sequence according to a preset learnable weight parameter and a preset learnable bias parameter to map the feature dimension of the power prediction sequence to a preset task target feature dimension, so as to obtain a power prediction result, where the learnable weight parameter and the learnable bias parameter are independent of the task target feature dimension.
[0074] It should be noted that in this embodiment, the correlation matrix refers to a matrix calculated through the target time encoding of the input sequence and the target time encoding of the prediction sequence, and is used to represent the similarity or correlation between the input sequence and the prediction sequence. Each element of this matrix reflects the position similarity between the input sequence and the prediction sequence at the time step, and is a key intermediate result in the power prediction process. The power prediction sequence refers to a future power feature sequence calculated based on the correlation matrix and the temporal characteristics of the historical power feature sequence. Its feature dimension is consistent with the historical data, but the length may vary according to the prediction requirements. The task target feature dimension refers to the feature dimension of the power prediction result preset according to the actual application scenario, and is used to ensure that the prediction result meets the requirements of the specific task.
[0075] In this embodiment, by constructing a correlation matrix and using the time characteristics and time encoding information of historical data, a power prediction result that meets the task requirements is generated. The construction of the correlation matrix is achieved by calculating the similarity between the target time encoding of the input sequence and the target time encoding of the prediction sequence. This similarity can be calculated in various ways, such as dot product or cosine similarity. Through the correlation matrix, the model can capture the time-dependent relationship between the input sequence and the prediction sequence, thus providing strong support for power prediction.
[0076] In a possible implementation manner, the calculation of the correlation matrix can be completed through the dot product of the target time encoding of the input sequence and the target time encoding of the prediction sequence, and the generated matrix can quantify the position similarity between the input sequence and the prediction sequence. In addition, it should be noted that the calculation of the power prediction sequence is based on the correlation matrix and the temporal characteristics of the historical power feature sequence. This process is achieved through matrix operations. Specifically, the correlation matrix is multiplied by the transposed matrix of the temporal characteristics of the historical power feature sequence to obtain the power prediction sequence. This method can make full use of the time characteristics and time encoding information of historical data to generate an estimated value of future power demand.
[0077] In a possible implementation, the power prediction sequence can be obtained through the matrix multiplication of the correlation matrix and the transposed matrix of the temporal features of the historical power feature sequence, so as to realize the prediction of future power features. In addition, in order to make the power prediction sequence meet the requirements of the actual application scenario, it is necessary to map its feature dimension to the preset task target feature dimension. This process is achieved through linear transformation, specifically by adjusting the power prediction sequence with preset learnable weight parameters and bias parameters. This method can ensure that the feature dimension of the prediction result is consistent with the task target, thereby improving the applicability and flexibility of the model. In a possible implementation, the mapping of the feature dimension can be realized through a linear layer, where the weight and bias parameters are independent of the task target feature dimension, so as to ensure that the model can flexibly adapt to different task requirements.
[0078] Specifically, the system first calculates the sum of the element-wise products based on the input sequence target time encoding and the prediction sequence target time encoding to generate the correlation matrix A , and the formula is:
[0079] Subsequently, the system multiplies the correlation matrix A with the transposed matrix of the temporal features of the historical power feature sequence to generate the hidden representation of the power prediction sequence, and the formula is:
[0080] Finally, the system maps to the task target feature dimension through the preset learnable weight matrix and the bias parameter to obtain the final power prediction result , and the formula is:
[0081] Among them, and are respectively the results after swapping the dimensions of and , that is, and . represents the attention scoring matrix between the input sequence and the prediction sequence time encodings, where each element represents the positional similarity between the input sequence and the prediction sequence time steps. Then, we multiply the scoring matrix A with the transposed temporal features to obtain . , are the weights and biases of the linear layer, aiming to make the feature dimension of the predicted sequence that meets the task requirements. It should be noted that the learnable parameters in the fusion module proposed in the present invention are only , and their dimensions are all independent of the length of the predicted sequence . Therefore, the model can flexibly adjust the length of the predicted sequence without the need for additional training and deployment.
[0082] In a feasible implementation manner, after step S3000, step S4000 may further be included: based on the mean and standard deviation of the historical power feature sequence, perform the inverse operation of the reversible instance normalization process on the power prediction result to obtain a completed power prediction result.
[0083] It should be noted that in the embodiments of the present application, the "mean and standard deviation of the historical power feature sequence" refer to the original mean and variance statistics of each independent instance (i.e., the historical power data of a single sample) before the reversible instance normalization (RevIN) process. The "power prediction result" refers to the predicted sequence generated by the fusion module, and its data distribution characteristics are consistent with the stationary sequence after RevIN processing. The "inverse operation of the reversible instance normalization process" refers to the process of restoring the prediction result from the standardized distribution to the original data distribution using the mean and standard deviation parameters retained in the RevIN stage. The "completed power prediction result" refers to the final predicted value that is consistent with the actual physical dimension after the inverse operation.
[0084]
[0085] where σ and μ are the mean and standard deviation of each power feature of the input sequence respectively, is the predicted result after completion. In a possible implementation manner, the calculation of the mean and standard deviation can be dynamically adjusted based on a sliding window. For example, calculate the statistics for the last N time steps of the input sequence to capture the recent data distribution characteristics.
[0086] For example, in a specific implementation manner, the system calculates the mean μ and standard deviation σ of each power feature dimension (such as peak value, mean value, variance, etc.) for the historical power feature sequence (historical 7-day data) to generate a statistical vector with dimension D. When the fusion module outputs the predicted result (3-day future prediction), through
[0087] restore the predicted value to the original dimension. For example, if the mean power consumption of the input sequence is 500 MW and the standard deviation is 100 MW, the predicted value 0.5 (after standardization) will be inverse-transformed to .
[0088] In this embodiment, the temporal features of the historical power feature sequence are mapped into linear components and frequency components; the sampling dates of the historical power feature sequence are time-coded based on the linear components and frequency components to obtain the time-coding of the input sequence, and the sampling dates of the prediction sequence are time-coded based on the linear components and frequency components to obtain the time-coding of the prediction sequence; the input sequence target time-coding and the prediction sequence target time-coding are respectively obtained through coding aggregation according to the time-coding of the input sequence and the time-coding of the prediction sequence, effectively solving the problems that the traditional Transformer model is insensitive to the time order and the position coding is difficult to represent the complex periodicity of power data. At the same time, by decoupling the association between the parameters and the length of the prediction sequence, flexible variable-length prediction is realized, significantly improving the modeling ability and prediction accuracy of the power temporal features.
[0089] It should be noted that the above examples are only for understanding the present application and do not constitute a limitation on the power prediction method of the present application. Based on this technical concept, more forms of simple transformations are within the protection scope of the present application.
[0090] Please refer to Figure 4 , the present application also provides a power prediction device, and the power prediction device includes: An extraction module 41, configured to extract the temporal information in the pre-obtained historical power feature sequence, so as to calculate the temporal features of the historical power feature sequence according to the temporal information; An encoding module 42, configured to perform time-coding according to the temporal features, the sampling date of the historical power feature sequence, and the sampling date of the pre-set prediction sequence to obtain the input sequence time-coding and the prediction sequence time-coding; A prediction module 43, configured to construct a correlation matrix based on the input sequence time-coding and the prediction sequence time-coding, so as to perform power prediction based on the correlation matrix to obtain a power prediction result.
[0091] The power prediction device provided by the present application adopts the power prediction method in the above embodiment and can solve the technical problems of power prediction. Compared with the prior art, the beneficial effects of the power prediction device provided by the present application are the same as those of the power prediction method provided by the above embodiment, and other technical features in the power prediction device are the same as the features disclosed in the method of the above embodiment, which will not be elaborated here.
[0092] The present application provides a power prediction device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the power prediction method in Embodiment 1 above.
[0093] Reference is made below to Figure 5 , which shows a schematic structural diagram of a power prediction device suitable for implementing the embodiments of the present application. The power prediction device in the embodiments of the present application may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistant), PADs (Portable Application Description: tablet computers), PMPs (Portable Media Player: portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The power prediction device shown is only an example and should not impose any limitations on the functions and usage scope of the embodiments of the present application.
[0094] As Figure 5 shown, the power prediction device may include a processing device 1001 (such as a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in the read-only memory 1002 or a program loaded from the storage device 1003 into the random access memory 1004. In the random access memory 1004, various programs and data required for the operation of the power prediction device are also stored. The processing device 1001, the read-only memory 1002, and the random access memory 1004 are connected to each other through a bus 1005. The input / output interface 1006 is also connected to the bus. Generally, the following systems may be connected to the input / output interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the power prediction device to communicate with other devices wirelessly or wiredly to exchange data. Although the figure shows a power prediction device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or provided alternatively.
[0095] In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product that includes a computer program carried on a computer-readable medium, and the computer program contains program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a read-only memory 1002. When the computer program is executed by a processing device 1001, the above-mentioned functions defined in the methods of the embodiments disclosed in the present application are executed.
[0096] The power prediction device provided by the present application adopts the power prediction method in the above embodiment. Compared with the prior art, the beneficial effects of the power prediction device provided by the present application are the same as those of the power prediction method provided by the above embodiment, and other technical features in the power prediction device are the same as the features disclosed in the method of the previous embodiment, which will not be elaborated here.
[0097] It should be understood that the various parts disclosed in the present application can be implemented by hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in a suitable manner in any one or more embodiments or examples.
[0098] As described above, only the specific embodiments of the present application are provided, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application, and all should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
[0099] The present application provides a computer-readable storage medium having computer-readable program instructions (i.e., computer programs) stored thereon, and the computer-readable program instructions are used to execute the power prediction method in the above embodiment.
[0100] The computer-readable storage medium provided by this application can be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or components, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM) or flash memory, optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In this embodiment, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. The program code contained on the computer-readable storage medium can be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0101] The above computer-readable storage medium can be included in the power prediction device; or can exist independently without being assembled into the power prediction device.
[0102] The computer program code for performing the operations of this application can be written in one or more programming languages or combinations thereof. The above programming languages include object-oriented programming languages - such as Java, Smalltalk, C++, and also include conventional procedural programming languages - such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network - including a local area network (LAN) or a wide area network (WAN) - or can be connected to an external computer (for example, by using an Internet service provider to connect through the Internet).
[0103] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram may represent a module, a segment of a program, or a part of code that contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the boxes may occur in a different order than that marked in the accompanying drawings. For example, two consecutive boxes shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combinations of boxes in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0104] The modules described in the embodiments of the present application can be implemented in software or in hardware. Among them, the name of the module does not constitute a limitation on the unit itself in some cases.
[0105] The readable storage medium provided by the present application is a computer-readable storage medium, and the computer-readable storage medium stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned power prediction method, which can solve the technical problems of power prediction. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as those of the power prediction method provided by the above embodiments, and will not be elaborated here.
[0106] The present application also provides a computer program product, including a computer program, and when the computer program is executed by a processor, it implements the steps of the power prediction method as described above.
[0107] The computer program product provided by the present application can solve the technical problems of power prediction. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as those of the power prediction method provided by the above embodiments, and will not be elaborated here.
[0108] The above are only some embodiments of the present application, and do not limit the patent scope of the present application. Any equivalent structural transformation made under the technical concept of the present application by using the content of the specification and drawings of the present application, or directly / indirectly applied in other related technical fields, is included in the patent protection scope of the present application.
Claims
1. A power prediction method, characterized in that, The method includes: Extracting the temporal information in a pre-acquired historical power feature sequence to calculate the temporal features of the historical power feature sequence according to the temporal information; Performing time encoding based on the temporal features, the sampling date of the historical power feature sequence, and the sampling date of a preset prediction sequence to obtain the target time encoding of the input sequence and the target time encoding of the prediction sequence; Constructing a correlation matrix based on the target time encoding of the input sequence and the target time encoding of the prediction sequence, and performing power prediction based on the correlation matrix to obtain a power prediction result.
2. The method according to claim 1, characterized in that, The step of extracting the temporal information in a pre-acquired historical power feature sequence to calculate the temporal features of the historical power feature sequence according to the temporal information includes: Extracting the temporal information in the historical power feature sequence; Performing reversible instance normalization processing on the temporal information in the historical power feature sequence to obtain a stationary historical power feature sequence; Calculating the temporal features of the historical power feature sequence based on a preset weight matrix, a bias matrix, and the stationary historical power feature sequence.
3. The method according to claim 1, characterized in that The step of performing time encoding based on the temporal features, the sampling date of the historical power feature sequence, and the sampling date of a preset prediction sequence to obtain the target time encoding of the input sequence and the target time encoding of the prediction sequence includes: Mapping the temporal features of the historical power feature sequence into a linear component and a frequency component; Performing time encoding on the sampling date of the historical power feature sequence based on the linear component and the frequency component to obtain the time encoding of the input sequence, and performing time encoding on the sampling date of the prediction sequence based on the linear component and the frequency component to obtain the time encoding of the prediction sequence; Performing encoding aggregation according to the time encoding of the input sequence and the time encoding of the prediction sequence respectively to obtain the target time encoding of the input sequence and the target time encoding of the prediction sequence.
4. The method according to claim 3, wherein The step of constructing a correlation matrix based on the target time encoding of the input sequence and the target time encoding of the prediction sequence, and performing power prediction based on the correlation matrix to obtain a power prediction result includes: Calculating a correlation matrix according to the target time encoding of the input sequence and the target time encoding of the prediction sequence; Calculating a power prediction sequence according to the correlation matrix and the transposed matrix of the temporal features of the historical power feature sequence; Mapping the feature dimension of the power prediction sequence to a preset task target feature dimension to obtain a power prediction result.
5. The method according to claim 4, wherein The power prediction sequence is obtained by multiplying the correlation matrix by the transposed matrix of the temporal features of the historical power feature sequence. The step of mapping the feature dimension of the power prediction sequence to a preset task target feature dimension to obtain a power prediction result includes: Performing a linear transformation on the power prediction sequence according to a preset learnable weight parameter and a preset learnable bias parameter to map the feature dimension of the power prediction sequence to a preset task target feature dimension to obtain a power prediction result, where the learnable weight parameter and the learnable bias parameter are independent of the task target feature dimension.
6. The method according to claim 2, characterized in that, After the step of constructing a correlation matrix based on the target time encoding of the input sequence and the target time encoding of the prediction sequence, and performing power prediction based on the correlation matrix to obtain a power prediction result, the following steps are further included: Based on the mean and standard deviation of the historical power feature sequence, perform the inverse operation of the invertible instance normalization process on the power prediction result to obtain a completed power prediction result.
7. A power prediction device, characterized in that, The device includes: An extraction module, configured to extract the temporal information in a pre-acquired historical power feature sequence, and calculate the temporal features of the historical power feature sequence according to the temporal information; An encoding module, configured to perform time encoding according to the temporal features, the sampling date of the historical power feature sequence, and the sampling date of a preset prediction sequence to obtain the target time encoding of the input sequence and the target time encoding of the prediction sequence; A prediction module, configured to construct a correlation matrix based on the target time encoding of the input sequence and the target time encoding of the prediction sequence, and perform power prediction based on the correlation matrix to obtain a power prediction result.
8. An electric power prediction device, characterized in that, The device includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, where the computer program is configured to implement the steps of the power prediction method according to any one of claims 1 to 6.
9. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium, and when the computer program is executed by a processor, it implements the steps of the power prediction method according to any one of claims 1 to 6.
10. A computer program product, characterized in that, The computer program product includes a computer program, and when the computer program is executed by a processor, it implements the steps of the power prediction method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Power load prediction method based on multivariate auto-encoder
CN117852686A