Electricity price prediction method and device, storage medium and electronic equipment

By conducting frequency domain analysis and two-dimensional characteristic data conversion on the electricity price time series, the multi-level periodic characteristics of electricity price fluctuations are solved, and the existing electricity price prediction methods are insufficient in the power market, achieving more accurate electricity price prediction.

CN120087987APending Publication Date: 2025-06-03HUANENG CLEAN ENERGY RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510157400.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-12
Publication Date
2025-06-03

AI Technical Summary

Technical Problem

The existing electricity price prediction methods are relatively low in the face of multiple periodic changes in electricity price fluctuations in the power market and large-scale access to new energy, making it difficult to effectively capture the long-term and short-term changes of electricity prices and the coupling relationship of multiple characteristics.

Method used

By obtaining multi-dimensional feature data of electricity price time series, performing frequency domain analysis to identify periodic patterns, and converting them into two-dimensional feature data, using models such as convolutional neural networks to predict, and fusing the influence of multi-dimensional feature.

Benefits of technology

It improves the accuracy and reliability of electricity price prediction, and can provide more accurate and stable prediction results in the face of increasing electricity price uncertainty, and capture the changing patterns of electricity prices in different cycles.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120087987A_ABST
    Figure CN120087987A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an electricity price prediction method and device, a storage medium and electronic equipment, and the method comprises the steps: obtaining an electricity price time sequence of a preset historical time period; the electricity price time sequence comprises a plurality of time domain signals, and each time domain signal in the plurality of time domain signals comprises multi-dimensional feature data; the multi-dimensional feature data in each time domain signal comprises multi-dimensional feature data influencing the electricity price; performing frequency domain analysis on the electricity price time sequence to obtain a group of periodic modes; each periodic mode of the group of periodic modes refers to a mode in which the multi-dimensional characteristic data in the electricity price time sequence repeatedly fluctuates along with time according to different periods; and according to each periodic mode, converting the electricity price time sequence into two-dimensional feature data corresponding to each periodic mode, and according to the two-dimensional feature data corresponding to each periodic mode, predicting a target electricity price prediction value corresponding to the target date. According to the invention, the problem of low accuracy of electricity price prediction is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of power market analysis. Specifically, the present application relates to a method, device, storage medium, and electronic device for electricity price prediction. Background Art

[0002] In a power market environment, effective electricity price prediction can send a regulation signal of the power system to market players, effectively regulate the power system balance, and establish the stable and sustainable development of the power system. The day-ahead electricity price in the electricity spot market is affected by multiple factors, including market supply and demand, energy prices, weather factors, and the output of new energy. The superposition and coupling of these factors lead to drastic fluctuations in electricity prices, increasing the decision-making difficulty of power market participants.

[0003] Currently, the commonly used electricity price prediction methods mainly rely on technologies such as time series analysis and machine learning.

[0004] However, the fluctuations in electricity prices have periodic characteristics and are usually affected by factors such as supply and demand relationships, meteorological conditions, and policy changes. Existing electricity price prediction methods have deficiencies in capturing the long-term and short-term change patterns of electricity prices and the multi-feature coupling relationship, and it is difficult to effectively capture the multiple periodic changes in electricity prices. In particular, in the face of large-scale access of new energy and increasing electricity price uncertainty, the prediction accuracy of existing electricity price prediction methods is relatively low. Summary of the Invention

[0005] The embodiments of the present application provide a method, device, storage medium, and electronic device for electricity price prediction to at least solve the technical problem of relatively low prediction accuracy of electricity prices in related technologies.

[0006] According to one aspect of the embodiments of the present application, a method for electricity price prediction is provided, including: obtaining an electricity price time series for a preset historical time period; the electricity price time series includes multiple time-domain signals, and each time-domain signal in the multiple time-domain signals includes multi-dimensional feature data; the multi-dimensional feature data in each time-domain signal includes feature data of multiple dimensions affecting the electricity price; performing frequency-domain analysis on the electricity price time series to obtain a set of periodic patterns; each periodic pattern in the set of periodic patterns refers to a pattern in which the multi-dimensional feature data in the electricity price time series repeats and fluctuates over time according to different periods; converting the electricity price time series into two-dimensional feature data corresponding to each periodic pattern according to each periodic pattern, and predicting a target electricity price prediction value corresponding to a target date according to the two-dimensional feature data corresponding to each periodic pattern.

[0007] According to another aspect of the embodiments of the present application, there is also provided a device for predicting electricity price, including: a sequence acquisition module, which acquires an electricity price time series of a preset historical time period; the electricity price time series includes a plurality of time domain signals, and each time domain signal in the plurality of time domain signals includes multi-dimensional feature data; the multi-dimensional feature data in each time domain signal includes feature data of multiple dimensions that affect the electricity price; a period selection module, which is used to perform frequency domain analysis on the electricity price time series to obtain a set of periodic patterns; each periodic pattern in the set of periodic patterns refers to a pattern in which the multi-dimensional feature data in the electricity price time series fluctuates repeatedly over time according to different periods; an electricity price prediction module, which is used to convert the electricity price time series into two-dimensional feature data corresponding to each periodic pattern according to each periodic pattern, and predict a target electricity price prediction value corresponding to a target date according to the two-dimensional feature data corresponding to each periodic pattern.

[0008] According to yet another aspect of the embodiments of the present application, there is also provided a computer-readable storage medium, in which a computer program is stored, and wherein the computer program is configured to execute the steps in any one of the above method embodiments when running.

[0009] According to yet another aspect of the embodiments of the present application, there is provided a computer program product or a computer program, the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the steps in any one of the above method embodiments.

[0010] According to yet another aspect of the embodiments of the present application, there is also provided an electronic device, including a memory and a processor, a computer program is stored in the memory, and the processor is configured to execute the steps in any one of the above method embodiments through the computer program.

[0011] Through this application, the electricity price time series in the preset historical time period obtained not only includes the electricity price itself, but also feature data in multiple dimensions. By identifying the periodic patterns coupled with the feature data in multiple dimensions, the driving factors of electricity price fluctuations can be more comprehensively understood, thereby improving the accuracy and reliability of electricity price prediction. Further, the frequency domain analysis of the electricity price time series in the historical time period can automatically detect a set of periodic patterns hidden in the electricity price time series. These periodic patterns cover the multi-level periodic characteristics of electricity price fluctuations, including daily cycles, weekly cycles, and even longer-term seasonal cycles, which provides key periodic information for subsequent prediction. Further, converting the historical electricity price time series into two-dimensional feature data corresponding to the periodic patterns. This conversion process visually presents the complex periodic patterns in the one-dimensional time series data in the form of a two-dimensional matrix, facilitating the capture of the change rules of electricity prices in different cycles. Through the representation of two-dimensional feature data, the long-term and short-term patterns of electricity price fluctuations can be better captured, overcoming the deficiencies of traditional methods in dealing with multiple periodic changes. In summary, based on the above-mentioned periodic pattern recognition and two-dimensional feature data conversion, the embodiments of this application can predict the target electricity price prediction value for a specific future date. This method not only considers the periodic fluctuations of electricity prices, but also incorporates the influence of multi-dimensional features, so as to provide more accurate and stable prediction results in the face of increasing electricity price uncertainty (such as market fluctuations caused by large-scale access of new energy), and solves the problem of low accuracy of electricity price prediction in related technologies. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 FIG. is a schematic diagram of an application scenario of a method for predicting electricity price according to an embodiment of the present application;

[0013] Figure 2 FIG. is a schematic flowchart of an optional method for predicting electricity price according to an embodiment of the present application;

[0014] Figure 3 FIG. is a schematic diagram of two-dimensional feature data corresponding to different periodic patterns according to an embodiment of the present application;

[0015] Figure 4 FIG. is a schematic diagram of another optional method for determining the target electricity price prediction value according to an embodiment of the present application;

[0016] Figure 5 FIG. is a structural block diagram of an optional device for predicting electricity price according to an embodiment of the present application;

[0017] Figure 6 FIG. is a structural block diagram of a computer system of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0018] To enable those skilled in the art to better understand the solution of this application, the following will clearly and completely describe the technical solution in the embodiments of this application with reference to the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only a part of the embodiments of this application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of this application.

[0019] It should be noted that the terms "first", "second", etc. in the description and claims of this application and the above-mentioned accompanying drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such used data can be interchanged under appropriate circumstances so that the embodiments of this application described here can be implemented in an order different from those illustrated or described here. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units does not necessarily need to be limited to those clearly listed steps or units, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0020] According to one aspect of the embodiments of this application, a method for predicting electricity price is provided. Optionally, in this embodiment, the above-mentioned method for predicting electricity price can be but is not limited to being applied to a hardware environment such as Figure 1 shown in Figure 1, which includes a terminal device 102 and a server 104. The server 104 can be connected to the terminal device 102 through a network and can be used to provide services (such as application services, etc.) for the terminal device 102 or the client installed on the terminal device 102. A database can be set on the server 104 or independently of the server 104 to provide data storage services for the server 104.

[0021] The above-mentioned network can include but is not limited to at least one of the following: wired network, wireless network. The above-mentioned wired network can include but is not limited to at least one of the following: wide area network, metropolitan area network, local area network. The above-mentioned wireless network can include but is not limited to at least one of the following: WIFI (Wireless Fidelity), Bluetooth. The terminal device 102 can be but is not limited to a smart meter, a programmable logic controller, an electric vehicle charging station, a power generation monitoring device, a PC (Personal Computer), a mobile phone, a tablet computer, etc. The server 104 can be but is not limited to a cloud server, a server cluster or other server types.

[0022] The electricity price prediction method according to the embodiments of the present application can be executed by the server 104, or can be executed by the terminal device 102, or can be jointly executed by the server 104 and the terminal device 102. Among them, when the terminal device 102 executes the electricity price prediction method according to the embodiments of the present application, it can also be executed by the client installed thereon.

[0023] Taking the case where the server 104 executes the electricity price prediction method in this embodiment as an example, Figure 2 is a schematic flowchart of an optional electricity price prediction method according to the embodiments of the present application, as Figure 2 shown, the process of this method can include the following steps:

[0024] Step S202, obtaining an electricity price time series of a preset historical period; the electricity price time series includes a plurality of time-domain signals, and each time-domain signal in the plurality of time-domain signals includes multi-dimensional feature data; the multi-dimensional feature data in each time-domain signal includes feature data of multiple dimensions affecting the electricity price.

[0025] The electricity price prediction method in this embodiment can be applied to the field of electricity market analysis, and is applied to multiple scenarios such as electricity market operation, electricity trading strategy formulation, power system planning and scheduling, and energy asset management. Under the background of the electricity market reform, the electricity price fluctuations in the electricity spot market are affected by various factors such as supply and demand relationships, weather conditions, and policy changes. In order to accurately predict future electricity prices, the embodiments of the present application predict electricity prices based on the periodicity and other patterns reflected in the electricity price time series of a preset historical period. Among them, the preset historical period refers to a specific period used to predict electricity prices, and the data within this period is regarded as known or historical data. The selection of the preset historical period is usually based on the understanding of the electricity price fluctuation law and the availability of data, and may cover data of the past few months or years to ensure that the electricity price time series covers the periodic changes and long-term trends of electricity prices.

[0026] The electricity price time series of a preset historical time period is a dataset of electricity prices arranged in chronological order, recording the historical trajectory of the electricity price changes over time in the electricity spot market. The electricity price time series can be continuous or sampled at specific time intervals, such as recording the electricity price every 15 minutes or every hour. The electricity price time series includes multiple time-domain signals, where a time-domain signal refers to each specific electricity price data point in the electricity price time series. Each time-domain signal includes multi-dimensional feature data, and the multi-dimensional feature data in each time-domain signal includes feature data of multiple dimensions that affect the electricity price. For example, multiple dimensions include load data (reflecting electricity demand), new energy output data (reflecting the power generation of renewable energy), bidding space (reflecting the costs and bidding strategies of market participants), meteorological data (including temperature, humidity, wind speed, etc., which affect load and new energy output), etc. The feature data under this multi-dimension is usually collected and analyzed together with the electricity price time series to provide more comprehensive input information for the electricity price prediction model. An example of the electricity price time series of a preset historical time period is shown in Table 1, where the multi-dimension includes four dimensions: load data, new energy output data, bidding space, and meteorological data. Each row in Table 1 represents a time-domain signal, and the electricity price is recorded every 15 minutes for each time-domain signal.

[0027] Table 1

[0028]

[0029] It should be noted that: the values in Table 1 are an example of an electricity price time series, and the values in Table 1 are not real values.

[0030] Step S204, perform frequency-domain analysis on the electricity price time series to obtain a set of periodic patterns; each periodic pattern in the set of periodic patterns refers to the pattern in which the multi-dimensional feature data in the electricity price time series fluctuates repeatedly over time according to different periods.

[0031] Among them, in the field of electricity market analysis, the electricity price of a future day is usually predicted based on historical time series. However, the fluctuations of electricity prices have periodic characteristics and are usually affected by factors such as supply and demand relationships, meteorological conditions, and policy changes. Existing electricity price prediction methods have deficiencies in capturing the long-term and short-term change patterns and multi-feature coupling relationships of electricity prices, and it is difficult to effectively capture the multiple periodic changes in electricity prices. In particular, in the face of large-scale access of new energy and increased electricity price uncertainty, the prediction accuracy of existing electricity price prediction methods is relatively low. Therefore, to solve the above problems, the embodiments of this application can automatically detect a set of periodic patterns hidden in the electricity price time series through frequency-domain analysis of the electricity price time series of a historical time period. These periodic patterns cover the multi-level periodic characteristics of electricity price fluctuations, including daily cycles, weekly cycles, and even longer-term seasonal cycles, which provides key periodic information for subsequent predictions.

[0032] Frequency domain analysis is a key technical means for identifying the electricity price fluctuation patterns in the day-ahead electricity price prediction of the electricity spot market. Since electricity prices are affected by various factors such as market supply and demand, new energy output, and meteorological conditions, these influencing factors exhibit different fluctuation patterns in different time cycles (such as daily cycle, weekly cycle, seasonal cycle). Conducting analysis in the frequency domain can more intuitively identify these patterns, especially those periodic characteristics that are not obvious in the time series but have an important impact on prediction. Frequency domain analysis is usually based on methods such as the fast Fourier transform (FFT), which converts time series data into a spectrum, and by analyzing the peaks in the spectrum, the main periodic components of the signal are identified.

[0033] In the context of the electricity spot market, through the frequency domain analysis of historical electricity price time series, a set of periodic patterns can be identified. A set of periodic patterns includes at least one periodic pattern. A periodic pattern refers to a pattern in the electricity price time series where multi-dimensional characteristic data (such as electricity demand, new energy output, weather conditions, etc.) fluctuates repeatedly over time according to a fixed period. These patterns appear as peaks of specific frequency components in the frequency domain analysis. By analyzing these frequency components, the main periodic characteristics of electricity price fluctuations can be extracted. A set of periodic patterns represents the periodic law of electricity price fluctuations over time, specifically referring to the set of different patterns that reflect the periodic fluctuation law of electricity prices, which are extracted from the electricity price time series data through the frequency domain analysis method. In the day-ahead electricity price prediction of the electricity spot market, each periodic pattern corresponds to a specific period, such as 24 hours, 7 days, 30 days, etc., and these periods reflect the characteristics of daily cycle, weekly cycle, monthly cycle, etc. in electricity price fluctuations. Each periodic pattern represents a pattern in the electricity price time series where multi-dimensional characteristic data fluctuates repeatedly over time according to a specific period. For example, the daily cycle pattern will show how the electricity price fluctuates over a day, and this fluctuation may be related to the grid load, people's electricity consumption habits, and the periodicity of new energy generation. Identifying and understanding these periodic patterns is the key to predicting electricity prices and can reveal the deep laws of electricity price changes.

[0034] Optionally, the server performs data preprocessing on the collected electricity price time series of a preset historical period, including filling in missing values, removing outliers, and normalization processing. The preprocessed electricity price time series is denoted as X 1D =(x 1 , x 2 ,..., x T ) ∈ R T×C, where C represents the dimension (number of features) of the observed electricity price time series, and T represents the length of the electricity price time series. The server performs a Fourier transform (FFT) on the preprocessed electricity price time series, converts each time-domain signal in the electricity price time series into a corresponding frequency-domain signal, analyzes the frequency-domain signals corresponding to each time-domain signal, identifies multiple frequencies with significant amplitudes, and determines a periodic pattern corresponding to each frequency with a significant amplitude based on the frequencies with significant amplitudes, obtaining a set of periodic patterns.

[0035] Step S206: Convert the electricity price time series into two-dimensional feature data corresponding to each periodic pattern according to each periodic pattern, and predict the target electricity price prediction value corresponding to the target date based on the two-dimensional feature data corresponding to each periodic pattern.

[0036] Among them, after adaptive period selection, each periodic component in the original one-dimensional time series is selected to form features with multiple different periods. To better capture the complex long-term and short-term alternating patterns in the time series data, the present invention converts these periodic components into a two-dimensional form. Specifically: The electricity price data with different periods is constructed into a two-dimensional matrix, where the rows represent different periods and the columns represent the time points within that period. This conversion can effectively decompose the short-term fluctuations and long-term trends in the electricity price time series, and can simultaneously pay attention to local changes and global periodic patterns. The two-dimensional feature data refers to converting the electricity price time series into a matrix form, where the rows represent different periodic patterns and the columns represent different time points within a specific period. Represent the periodic changes in the one-dimensional time series data in a more intuitive two-dimensional form for subsequent feature extraction and prediction. By constructing the data into a two-dimensional matrix, image processing and computer vision techniques (such as convolutional neural network CNN) can be effectively used to capture the change patterns of electricity prices in different periods.

[0037] The target electricity price prediction value corresponding to the target date refers to the predicted electricity price on a certain future day.

[0038] Optionally, the server converts the original electricity price time series into corresponding two-dimensional feature data according to each identified periodic pattern. This conversion process reorganizes the one-dimensional electricity price sequence according to the length of the periodic pattern. Each row represents a periodic pattern, and each column represents a certain time point within that period, forming multiple "electricity price pictures". Then, the server uses a convolutional neural network (CNN) or other machine learning models suitable for image processing to extract features from these two-dimensional feature data and predict the electricity price prediction value for each periodic pattern within the target date. Finally, the server uses an attention mechanism or similar technology to weight and fuse the prediction values under different periodic patterns to obtain the final target electricity price prediction value corresponding to the target date.

[0039] Through the embodiments provided in this application, the electricity price time series in the preset historical time period obtained not only includes the electricity price itself, but also feature data in multiple dimensions. By identifying the periodic patterns coupled with the feature data in multiple dimensions, the driving factors of electricity price fluctuations can be understood more comprehensively, thereby improving the accuracy and reliability of electricity price prediction. Further, the frequency domain analysis of the electricity price time series in the historical time period can automatically detect a set of periodic patterns hidden in the electricity price time series. These periodic patterns cover the multi-level periodic characteristics of electricity price fluctuations, including daily cycles, weekly cycles, and even longer-term seasonal cycles, which provides key periodic information for subsequent prediction. Further, converting the historical electricity price time series into two-dimensional feature data corresponding to the periodic patterns. This conversion process visually presents the complex periodic patterns in the one-dimensional time series data in the form of a two-dimensional matrix, facilitating the capture of the variation law of electricity prices in different cycles. Through the representation of two-dimensional feature data, the short-term and long-term patterns of electricity price fluctuations can be better captured, overcoming the deficiencies of traditional methods in dealing with multiple periodic changes. In summary, based on the above periodic pattern recognition and two-dimensional feature data conversion, the embodiments of this application can predict the target electricity price prediction value for a specific future date. This method not only considers the periodic fluctuations of electricity prices, but also incorporates the influence of multi-dimensional features, so as to provide more accurate and stable prediction results in the face of increasing electricity price uncertainty (such as market fluctuations caused by large-scale access of new energy), and solves the problem of low accuracy of electricity price prediction in related technologies.

[0040] In an exemplary embodiment, a frequency domain analysis is performed on the electricity price time series to obtain a set of periodic patterns, including:

[0041] First, each dimension in multiple dimensions is used as the current dimension, and the following transformation and amplitude calculation are performed on the electricity price time series to obtain the frequency domain signal corresponding to each dimension of the electricity price time series: perform Fourier transform on the feature data of the current dimension in each time domain signal to obtain the frequency domain signal corresponding to the current dimension of the electricity price time series; the frequency domain signal corresponding to the current dimension of the electricity price time series includes multiple frequency components; each frequency component in the multiple frequency components corresponds to the feature data of the current dimension in each time domain signal.

[0042] Among them, in frequency-domain analysis, the characteristic data of each dimension in the electricity price time series are processed independently. After performing Fourier transform on the characteristic data of each dimension, a frequency-domain signal is obtained. Each point in the frequency-domain signal corresponds to a frequency component in the original time-domain signal, which represents the fluctuation intensity (amplitude) and phase information of a specific frequency. For example, if we consider the dimension of "load", performing Fourier transform on the characteristic data of this dimension (i.e., the daily electricity demand) will result in a frequency-domain signal. The frequency components in this frequency-domain signal will reveal the implicit periodic patterns in the electricity demand, such as the daily peak and trough demands, the demand differences between weekdays and weekends, etc. Similarly, performing Fourier transform on the "new energy output data" or other dimension data will also yield their respective frequency-domain signals, revealing the relevant periodic patterns in these dimension characteristics.

[0043] Second, taking each time-domain signal in the electricity price time series as the current time-domain signal, perform the following weighting operation to obtain the frequency amplitude corresponding to each time-domain signal: perform weighted averaging on the amplitude of the current time-domain signal and the amplitude of the frequency components corresponding to each dimension, and determine the amplitude obtained by weighted averaging as the frequency amplitude corresponding to the current time-domain signal.

[0044] Among them, the amplitude of the current time-domain signal and the amplitude of the frequency components corresponding to each dimension refer to the intensity values of the frequency components corresponding to each one-dimensional characteristic data in the multi-dimensional characteristic data obtained after performing Fourier transform on the multi-dimensional characteristic data of each time-domain signal in the electricity price time series when predicting the electricity price. In the electricity price prediction scenario with multiple characteristics, multi-dimensional time series data usually contains multiple related characteristics, such as supply and demand conditions, meteorological data (temperature, humidity, wind speed, etc.), new energy output, etc. Each characteristic (channel) has its unique periodic characteristics, but the periodicity of different characteristics may not be consistent. Therefore, in order to more accurately determine the main period, in this embodiment, weighted averaging is performed on the amplitudes of the frequency components of multiple dimensions of the same time-domain signal, and the weights are obtained by normalizing the importance of random forest features, avoiding the information loss that may be caused by simple averaging. The amplitude of each frequency component can be obtained by calculating the modulus length of the complex number of each frequency component.

[0045] For example, assume that the length of the feature data in the dimension of "load" is 8. Perform FFT transformation on the feature data in the dimension of "load" in Table 1 (i.e., the feature data in the "load" column of Table 1), and obtain a frequency-domain signal with a length of 8, which is expressed as: X1 = [36, -4 + 9.656j, -4 + 4j, -4 + 1.656j, -4, -4 - 1.656j, -4 - 4j, -4 - 9.656j] (an example, not real values). Among them, this frequency-domain signal includes 8 frequency-domain components, which respectively correspond to the 8 feature data in the dimension of "load" in the electricity price time series in Table 1. Calculate these 8 frequency components respectively, and the amplitude of the frequency-domain signal corresponding to the dimension of "load" is: X1 = [36, 10, 5.66, 4.27, 4, 4.27, 5.66, 10]. Perform the same operation on the feature data of the remaining 3 dimensions in Table 1, and frequency signals of X2, X3, and X4 as shown in Table 2 can be obtained. Among them, X1 - X4 are all sequences with a length of 8:

[0046] Table 2

[0047] X1 36 10 5.66 4.27 4 4.27 5.66 10 X2 12 14 45 78 2 33 22 77 X3 1 4 6 8 16 9 99 3 X4 9 7 4 0 4 77 32 56 Weighted average …… …… …… …… …… …… …… ……

[0048] It should be noted that: the values in Table 2 are examples of frequency signals, and the values in Table 2 are not real values.

[0049] Perform weighted averaging on X1 to X4. For example, perform weighted averaging on the first frequency components in X1 to X4, and the obtained weighted average result is (36×a1 + 12×a2 + 1×a3 + 9×a4) / 4, where a1 - a4 respectively represent different weights, and a1 - a4 are respectively determined according to the random forest. This weighted average result represents the frequency amplitude corresponding to the first time-domain signal in Table 1; the same applies to the second frequency components in X1 to X4, and calculate until the last frequency components in X1 to X4 to obtain the frequency amplitude corresponding to each time-domain signal in Table 1.

[0050] Optionally, the server takes each dimension among multiple dimensions as the current dimension, performs the following transformation and amplitude calculation on the electricity price time series, and obtains the frequency domain signals corresponding to each dimension of the electricity price time series: perform Fourier transform on the feature data of the current dimension in each time domain signal to obtain the frequency domain signal corresponding to the current dimension of the electricity price time series. The server takes each time domain signal in the electricity price time series as the current time domain signal, performs the following weighting operation to obtain the frequency amplitude corresponding to each time domain signal: use the random forest feature importance to determine the weights of the frequency components corresponding to the current time domain signal and each dimension, calculate the amplitudes of the frequency components corresponding to the current time domain signal and each dimension, perform weighted average on the amplitudes of the frequency components corresponding to the current time domain signal and each dimension, and determine the amplitude obtained by weighted average as the frequency amplitude corresponding to the current time domain signal. Among them, the frequency amplitude corresponding to the current time domain signal can be expressed as:

[0051] A = weighted_Avg(Amp(FFT(X 1D )))(1)

[0052] Among them, FFT(·) is the Fourier transform calculation, Amp(·) is the amplitude calculation, and weighted_Avg(·) is the weighted average.

[0053] III. Select a preset number of target frequency amplitudes in descending order of the frequency domain amplitudes corresponding to each time domain signal. According to the cycle frequency corresponding to each target frequency amplitude among the preset number of target frequency amplitudes and the sequence length of the electricity price time series, determine the cycle length corresponding to each target frequency amplitude; the cycle frequency corresponding to each target frequency amplitude refers to the frequency of periodic changes in the electricity price time series; the cycle length corresponding to each target frequency amplitude refers to the duration of periodic fluctuations in the electricity price time series.

[0054] Among them, by performing Fourier transform on the feature data of each dimension and calculating the amplitudes of its frequency components, the main periodic characteristics in the electricity price fluctuations can be identified. The cycle frequency is the manifestation of these main periodic characteristics in the frequency domain. Higher amplitudes usually mean that the corresponding cycles have a greater impact on the electricity price fluctuations. The cycle frequency is used to determine the frequency of periodic changes in the electricity price time series. For example, daily cycles, weekly cycles, seasonal cycles, etc. They can help the prediction model capture the rules of electricity price fluctuations. By finding the peaks in the amplitude spectrum, the dominant frequencies of the signal can be identified. Select the top k amplitude values to obtain the top k most significant frequencies and obtain their corresponding k cycle patterns. The cycle frequency corresponding to each cycle pattern can be expressed in the following form, where f k refers to the cycle frequency corresponding to the kth target frequency amplitude; T refers to the sequence length of the electricity price time series:

[0055]

[0056] The sequence length of the electricity price time series refers to the total time span of the electricity price data or the number of data points. It represents the number of observations included in the entire electricity price time series from start to end. For example, if the electricity price time series starts at 2023-01-01 00:15:00 and ends at a certain time period on 2023-01-01, and the electricity price is recorded every 15 minutes, then the sequence length is the total number of times the electricity price data is recorded during this time period. The sequence length of the electricity price time series is the basis for calculating the cycle length, and it is used to determine the cycle length corresponding to each cycle frequency.

[0057] The cycle length is calculated based on the cycle frequency and the sequence length of the electricity price time series, and it represents the number of observations or the time span of a complete cycle. The cycle length is used to determine the duration or observation period of the periodic fluctuations in the electricity price time series. It provides periodic information in terms of time for electricity price prediction, enabling the prediction model to identify and predict the short-term fluctuations and long-term trends of the electricity price. If the sequence length of the electricity price time series is N data points and the identified cycle frequency is a specific value, then the cycle length can be calculated using the following formula, where p i Refers to the cycle length corresponding to the i-th target frequency amplitude:

[0058]

[0059] It can be understood that: the cycle length is the quotient of the sequence length divided by the cycle frequency, rounded up to the nearest integer value.

[0060] Optionally, the server selects k target frequency amplitudes in descending order of the frequency domain amplitudes corresponding to each time domain signal, calculates the cycle frequency corresponding to each target frequency amplitude among the k target frequency amplitudes according to the above formula (2), and calculates the cycle length corresponding to each target frequency amplitude according to the above formula (3).

[0061] IV. According to the cycle frequency corresponding to each target frequency amplitude and the cycle length corresponding to each target frequency amplitude, determine a cycle pattern respectively, and obtain a set of cycle patterns.

[0062] Through this embodiment, by performing Fourier transform on each dimension in the electricity price time series respectively, and by analyzing the frequency components in the frequency-domain signal, short-term and long-term periodic patterns in the electricity price fluctuations can be identified. These periodic patterns may be composed of daily cycles, weekly cycles, seasonal cycles, etc., and are directly related to the supply and demand laws in the electricity market, changes in meteorological conditions, policy factors, etc. This analysis method helps the model to more comprehensively understand the volatility of electricity prices, thereby improving the prediction accuracy; through adaptive cycle selection, the main periodic characteristics of the electricity price data are accurately identified, and the complex time variations are decomposed into different cycles, which helps to more accurately capture the laws of electricity price fluctuations; by calculating the amplitude of the frequency components in different dimensions and performing weighted averaging on them, the characteristics that have the greatest impact on the electricity price fluctuations can be identified, ensuring that important periodic characteristics have a greater impact on the final prediction result, while the impact of smaller or insignificant periodic characteristics is weakened. This method avoids the drawback of treating all characteristics equally in traditional prediction methods, enabling the model to more effectively capture the complex change laws of electricity prices; by analyzing the magnitude of the frequency amplitudes and selecting the frequencies corresponding to the top k largest amplitudes, the most representative periodic frequencies in the electricity price time series can be automatically identified. These periodic frequencies correspond to the key cycles in the electricity price fluctuations. Then, through the sequence length of the electricity price time series and the selected periodic frequencies, the corresponding cycle lengths are calculated. This determination of the adaptive cycle length enables the model to perform more precise modeling for the specific periodic changes in electricity prices without relying on pre-set cycle parameters, improving the flexibility and prediction ability of the model.

[0063] In an exemplary embodiment, each periodic pattern corresponds to a periodic frequency and a cycle length. The periodic frequency corresponding to each periodic pattern refers to the frequency of the periodic change in the electricity price time series; the cycle length corresponding to each periodic pattern refers to the duration of the periodic fluctuation in the electricity price time series. The periodic frequency and the cycle length have been explained in the above embodiment and will not be elaborated here.

[0064] In the process of converting the electricity price time series into two-dimensional feature data corresponding to each periodic pattern according to each periodic pattern, each periodic pattern is respectively used as the current periodic pattern to perform the following conversion operations to obtain the two-dimensional feature data corresponding to each periodic pattern:

[0065] First, extract the feature data corresponding to each dimension of the electricity price time series to obtain multiple groups of feature data; the dimensions of the feature data in each group of the multiple groups of feature data are the same.

[0066] Optionally, the server extracts the feature data corresponding to each dimension of the electricity price time series. For example, for the multiple feature data corresponding to the "load" dimension in the electricity price time series in Table 1, a group of feature data corresponding to the "load" dimension is obtained.

[0067] Second, perform two-dimensional transformation on each group of feature data respectively to obtain two-dimensional feature data corresponding to each group of feature data; the number of rows of the two-dimensional feature data corresponding to each group of feature data is equal to the value of the period length of the current period pattern; the number of columns of the two-dimensional feature data corresponding to each group of feature data is equal to the value of the period frequency of the current period pattern.

[0068] Among them, the two-dimensional feature data corresponding to each group of feature data can be represented in the following form:

[0069] X 1D ∈R T×C (4)

[0070]

[0071] Among them, Padding(·) is to extend zeros along the time dimension of the time series to make it compatible, where p i and f i are respectively equal to the number of rows and columns of the transformed 2D tensor. represents the i-th two-dimensional time series based on the period frequency f i , and its columns and rows respectively represent the intra-period change and inter-period change within the period corresponding to the period length p i .

[0072] Optionally, the server performs two-dimensional transformation on each group of feature data respectively according to the period length and period frequency of the current period pattern, so that the number of rows of the two-dimensional feature data corresponding to the group of feature data is equal to the value of the period length of the current period pattern; the number of columns of the two-dimensional feature data corresponding to each group of feature data is equal to the value of the period frequency of the current period pattern.

[0073] Figure 3 is a schematic diagram of two-dimensional feature data corresponding to an optional different period pattern according to an embodiment of the present application. As Figure 3 shown, there are three period patterns. The period length and period frequency of the first period pattern are 6 and 20 respectively; the period length and period frequency of the second period pattern are 4 and 30 respectively; the period length and period frequency of the first period pattern are 3 and 40 respectively; for a one-dimensional electricity price time series with a length of 120, perform two-dimensional transformation on the electricity price time series respectively according to the period frequency and period length of each period pattern, and three two-dimensional data features as shown in Figure 3 can be obtained.

[0074] For example, assuming that the period length p i is 5, the period frequency f i is 4, and the number of features C is 4. After performing two-dimensional transformation on the electricity price time series in Table 1, the two-dimensional feature data corresponding to each group of feature data obtained is shown in Table 3:

[0075] Table 3

[0076]

[0077] III. Determine the two-dimensional feature data corresponding to each set of feature data as the two-dimensional feature data corresponding to the current cycle pattern.

[0078] Through this embodiment, each cycle pattern is respectively used as the current cycle pattern, and two-dimensional conversion is performed on multiple sets of feature data related thereto. This conversion transforms one-dimensional time series data into two-dimensional feature data, where each set of feature data (such as load, new energy output, meteorological conditions, etc.) is converted into a matrix. The number of rows of the matrix corresponds to the cycle length, and the number of columns corresponds to the cycle frequency. This conversion enables the model to simultaneously handle the short-term fluctuations and long-term trends of the electricity price series, presenting the multi-dimensional features of the electricity market in a more intuitive and easier-to-analyze form, facilitating the model to capture and learn; the feature data after two-dimensional conversion not only retains the information of the original time series but also provides a richer feature expression by increasing dimensions (rows and columns). This expression method draws on the feature extraction method in the field of computer vision, enabling the model to analyze the local changes (columns) and periodic trends (rows) in the electricity price data just like analyzing the local and global features in an image, thereby improving the model's ability to capture and understand the features of the electricity price data; by converting multiple sets of feature data into two-dimensional feature data, the model's adaptability to the multi-feature coupling relationship is improved. When predicting the electricity price, different features may affect the electricity price at different cycles and frequencies. Through two-dimensional conversion, the model can more flexibly process these features, adaptively adjust the attention to different cycle patterns, and thus maintain the accuracy and stability of the prediction in the face of a complex market environment.

[0079] In an exemplary embodiment, according to the two-dimensional feature data corresponding to each cycle pattern, predicting the target electricity price prediction value corresponding to the target date includes:

[0080] Input the two-dimensional feature data corresponding to each cycle pattern into a pre-trained electricity price prediction model to obtain the reference electricity price prediction value under each cycle pattern; the electricity price prediction model is used to predict the electricity value corresponding to the target date according to the input two-dimensional feature data; determine the target electricity price prediction value corresponding to the target date according to the reference electricity price prediction value under each cycle pattern.

[0081] Among them, after converting the original one-dimensional electricity price time series into a two-dimensional form, the ability of electricity price prediction models such as convolutional neural networks (CNNs) in computer vision to extract image features is used to extract features from the converted two-dimensional feature data. The electricity price prediction model in this embodiment is a pre-trained model for predicting future electricity prices. The electricity price prediction model can be a deep learning model, such as a convolutional neural network (CNN) or a residual network (ResNet). These models are good at processing image data and are therefore used in this embodiment to process the converted two-dimensional feature data. In this embodiment, a residual network (ResNet) is used as the electricity price prediction model. Among them, ResNet is a deep CNN model that solves the problems of gradient vanishing and gradient explosion in deep neural networks by introducing residual connections. The multi-layer structure of ResNet can automatically extract deep features in the data, especially those features that reflect complex long-term and short-term patterns in electricity price fluctuations. After the last convolutional layer of ResNet, multiple fully connected layers are connected. These fully connected layers are responsible for mapping the extracted features to the prediction results. The electricity price prediction model can predict the electricity price on a specific future date, that is, the electricity value corresponding to the target date, by learning and extracting features related to electricity price fluctuations from the two-dimensional feature data.

[0082] The reference electricity price prediction value is the result obtained by the electricity price prediction model predicting the target date under each identified periodic pattern. Since the electricity price is affected by various periodic factors, the electricity price prediction model will give prediction values for each periodic pattern respectively. These prediction values are called reference electricity price prediction values. The reference electricity price prediction value reflects the prediction of the electricity price fluctuation by a specific periodic pattern and can provide prediction information on different frequency components in the electricity price fluctuation. According to the reference electricity price prediction values under each periodic pattern, the electricity price prediction value finally determined through the multi-period adaptive fusion technology is the target electricity price prediction value. The target electricity price prediction value takes into account the influence of all periodic patterns and integrates the reference prediction values under each periodic pattern through weighted average, weighted median or weighted mode, Bayesian fusion, stacking generalization, dynamic gating mechanism, voting mechanism or other fusion mechanisms. This method ensures the comprehensiveness and accuracy of the prediction results, avoids the errors that may be brought by single-period prediction, and improves the overall performance of electricity price prediction.

[0083] For example, the cycle length p shown in Table 3 i is 5, and the cycle frequency f iThe two-dimensional feature data in the periodic pattern with a period number of 4 and a feature number C of 4 is input into a pre-trained electricity price prediction model to obtain the reference electricity price prediction value in this periodic pattern. The two-dimensional feature data in another periodic pattern is also input into the pre-trained electricity price prediction model to obtain the reference electricity price prediction value in this periodic pattern. The reference electricity price prediction values in these two periodic patterns are fused to obtain the target electricity price prediction value corresponding to the target date.

[0084] Through this embodiment, the main periods are automatically selected in the frequency domain, and the most representative periodic fluctuations are determined by weighted averaging the periodic information of different features, avoiding the deficiencies of traditional prediction methods in dealing with complex periodic changes. At the same time, by converting the selected periodic features from a one-dimensional sequence to a two-dimensional matrix to capture the short-term and long-term trends in electricity price fluctuations, the effective methods in the field of computer vision are migrated to the electricity price prediction scenario, enhancing the modeling ability for complex fluctuation patterns of electricity price prediction; the two-dimensional feature data in each periodic pattern is independently input into the electricity price prediction model, which enables the model to make predictions for different periodic patterns respectively and obtain the reference electricity price prediction values in each periodic pattern. This independent prediction strategy takes into account the influence of different periodic patterns in electricity price fluctuations, helps the model analyze and predict the short-term fluctuations and long-term trends of electricity prices more carefully, rather than mixing all periodic changes together, thereby improving the prediction accuracy; after obtaining the reference prediction values in each periodic pattern, the technical solution further determines the target electricity price prediction value corresponding to the target date through a multi-period adaptive fusion technology, comprehensively considering the prediction results of all periodic patterns. This fusion strategy assigns different weights to the prediction results of each periodic pattern through an attention mechanism and dynamically adjusts them according to the reliability of each periodic pattern (such as prediction error, historical performance, etc.), so as to ensure that the final prediction result not only reflects the combined effect of all periodic patterns, but also particularly strengthens the periodic pattern that has the greatest impact on electricity price changes. This method improves the adaptability and robustness of the model, making the final prediction result more accurate and stable, especially in a complex environment with significant periodic fluctuations and multi-factor influences in the electricity market.

[0085] In an exemplary embodiment, determining the target electricity price prediction value corresponding to the target date according to the reference electricity price prediction value in each periodic pattern includes:

[0086] Determine the weights of the reference electricity price prediction values in each periodic pattern; according to the weights of the reference electricity price prediction values in each periodic pattern, perform weighted summation on the reference electricity price prediction values in each periodic pattern, and determine the weighted summation result as the target electricity price prediction value corresponding to the target date.

[0087] Among them, methods such as the weight adjustment method based on prediction error, the dynamic weight method based on feature importance, and the weighted moving average method based on historical performance can be used to determine the weights of the reference electricity price prediction values under each periodic pattern.

[0088] Among them, the weight adjustment method based on prediction error means: calculating the error between the reference electricity price prediction value and the actual electricity price under each periodic pattern, such as using the mean square error (MSE), mean absolute error (MAE), or logarithmic absolute error (LAE). Taking the reciprocal of the error or the negative logarithm of the error as the weight, the smaller the error of the periodic pattern, the greater its weight, which means its prediction result is more reliable and should account for a larger proportion in the final prediction value.

[0089] The dynamic weight method based on feature importance means: using feature selection or feature importance evaluation methods (such as random forest, gradient boosting tree, etc.) to assign importance weights to the features within each period. Taking the average importance of the features within the periodic pattern as the weight of this periodic pattern, the higher the feature importance, the higher the weight of the corresponding periodic pattern prediction result. For example: if the importance evaluation of the new energy output and load features in period 1 is relatively high, while the importance of meteorological factors in period 2 is relatively low, then the weight of period 1 should be greater than that of period 2.

[0090] The weighted moving average method based on historical performance means: adopting the weighted moving average (WMA) method to adjust the weights according to the prediction accuracy of each periodic pattern in the recent period. Higher weights are given to more recent prediction accuracies to reflect the model's performance in the near term, which helps the model quickly adapt to market changes. For example: if the prediction accuracy of period 1 is higher than that of period 2 in the recent week, then the weight of period 1 should be heavier in the fusion process.

[0091] Through this embodiment, weights are determined based on the contribution degree of the periodic pattern to the electricity price prediction. Those periodic patterns with smaller prediction errors and better performance will obtain higher weights. By determining the weights of the reference prediction values under each periodic pattern, it is possible to identify and strengthen those periodic patterns that have a significant impact on electricity price fluctuations. In this way, the prediction model no longer treats all periods equally, but can more accurately capture the periodic factors that truly play a dominant role in the market; during the weighted summation process, the prediction results with smaller errors will account for a larger proportion, thereby helping to reduce the total error of the final prediction value. This weight-based fusion mechanism essentially realizes the minimization of prediction errors by dynamically adjusting the contributions of different period prediction results, and improves the prediction accuracy.

[0092] In an exemplary embodiment, determining the weights of the reference electricity price prediction values under each periodic pattern includes:

[0093] Input the predicted reference electricity price values in each cycle pattern into a pre-constructed regression model to obtain the weights of the predicted reference electricity price values in each cycle pattern; the regression model is used to assign weights to the input predicted reference electricity price values according to the self-attention mechanism.

[0094] Among them, after obtaining the predicted reference electricity price values corresponding to k cycle patterns, fuse the above k predicted reference electricity price values. Figure 4 It is a schematic diagram of an optional method for determining the predicted target electricity price according to an embodiment of the present application. As Figure 4 shown, in this embodiment, a regression model based on the self-attention mechanism is constructed. The model takes the predicted reference electricity price values A 1 -Ak in k cycle patterns as inputs, and assigns different weights B 1 -Bk to the predicted reference electricity price values A 1 -Ak through the attention mechanism, and performs weighted summation on the predicted reference electricity price values in each cycle pattern through a fully connected layer to obtain the final predicted target electricity price value.

[0095] Through this embodiment, the regression model uses the self-attention mechanism to assign weights to the reference prediction values in each cycle pattern, enabling the model to adaptively adjust the weights of different cycles, thereby improving the prediction accuracy. It also makes the weight assignment no longer static, but can be adaptively adjusted according to the dynamic characteristics of electricity price data and the contribution degree of different cycle patterns to electricity price fluctuations. The self-attention mechanism can learn which cycle patterns are more critical for electricity price prediction at a specific time point, and thus assign higher weights to these cycle patterns, while assigning lower weights to those cycle patterns that have less impact at the current time point. This dynamic weight assignment method comprehensively considers the reliability of the prediction results of each cycle, enhances the robustness and adaptability of the model, ensures the stability of the final predicted value, and helps the model to more accurately capture the complexity of electricity price fluctuations.

[0096] In an exemplary embodiment, the training process of the electricity price prediction model includes the following steps:

[0097] First, obtain a plurality of training samples; each training sample in the plurality of training samples includes a historical electricity price time series and a label for a specified historical time period; the historical electricity price time series includes a plurality of historical time domain signals, and each historical time domain signal in the plurality of historical time domain signals includes multi-dimensional historical feature data; the multi-dimensional historical feature data in each historical time domain signal includes historical feature data of multiple dimensions affecting the electricity price; the label corresponding to each training sample is used to label the historical electricity price value corresponding to each historical time domain signal.

[0098] Among them, the specified historical time period refers to a specific time period used for predicting electricity prices, and the data within this time period is regarded as known or historical data. The label corresponding to each training sample is used to label the historical electricity price value corresponding to each historical time-domain signal. The electricity price time series can be expressed as X 1D =(x 1 , x 2 ,..., x T ) ∈ R T×C , where C represents the dimension (number of features) of the observed electricity price time series, T represents the length of the electricity price time series, (y 1 , y 2 ,..., y T ) ∈ R T×1 is the label data (day-ahead electricity price data) corresponding to this electricity price time series. For example, taking the electricity price time series shown in Table 1 as an example, the electricity price in each time series signal is the label data corresponding to the electricity price time series.

[0099] The historical electricity price time series of the specified historical time period is a time-ordered electricity price data set that records the historical trajectory of the electricity price change over time in the electricity spot market. The historical electricity price time series of the specified historical time period has a similar meaning to the electricity price time series of the preset historical time period. The historical time-domain signal is similar to the time-domain signal in the above embodiment, and the multi-dimensional historical feature data is similar to the multi-dimensional feature data, which will not be elaborated here.

[0100] Second, perform frequency-domain analysis on the historical electricity price time series in each training sample to obtain a set of historical cycle patterns corresponding to each training sample; each historical cycle pattern in a set of historical cycle patterns corresponding to each training sample refers to the pattern in which the multi-dimensional historical feature data in the historical electricity price time series of each training sample fluctuates repeatedly over time according to different historical cycles.

[0101] Among them, the principle and process of frequency-domain analysis have been described in the above embodiment. A set of historical cycle patterns is similar to a set of cycle patterns in the above embodiment, which will not be elaborated here.

[0102] Third, according to each historical cycle pattern corresponding to each training sample, convert the historical electricity price time series into historical two-dimensional feature data corresponding to each historical cycle pattern corresponding to each training sample, and input the historical two-dimensional feature data corresponding to each historical cycle pattern corresponding to each training sample into the electricity price prediction model to be trained for model training to obtain a trained electricity price prediction model; among them, in the process of model training for the electricity price prediction model, the model parameters of the electricity price prediction model are adjusted according to the difference between the predicted electricity price value corresponding to each training sample output by the electricity price prediction model and the label corresponding to each training sample.

[0103] Among them, the process of converting the historical electricity price time series into historical two-dimensional feature data corresponding to each historical cycle pattern corresponding to each training sample is similar to the process of converting the electricity price time series into two-dimensional feature data corresponding to each cycle pattern, and will not be elaborated here.

[0104] In the process of training the electricity price prediction model, the mean square error (MSE) is selected as the loss function. Through the backpropagation algorithm and the gradient descent method, the parameters of the model can be optimized to minimize the loss function.

[0105] Through this embodiment, based on the difference between the predicted electricity price value corresponding to each training sample output by the electricity price prediction model and the label corresponding to each training sample, a trained electricity price prediction model can be obtained. The trained electricity price prediction model can predict the reference electricity price prediction value under each cycle pattern according to the input two-dimensional feature data under each cycle pattern, which helps the model to analyze and predict the short-term fluctuations and long-term trends of electricity prices more meticulously, rather than lumping all cycle changes together, thereby improving the prediction accuracy.

[0106] It should be noted that for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that this application is not limited by the described action sequence, because according to this application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0107] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM (Read-Only Memory), RAM (Random Access Memory), magnetic disk, optical disc), and includes several instructions to enable a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of this application.

[0108] According to another aspect of the embodiments of the present application, there is also provided an electricity price prediction device, which can be used to implement the electricity price prediction method provided in the above embodiments, and those that have been described will not be repeated. As used hereinafter, the term "module" can be a combination of software and / or hardware that can achieve a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.

[0109] Figure 5 is a structural block diagram of an optional electricity price prediction device according to an embodiment of the present application. As shown in Figure 5 , the electricity price prediction device includes:

[0110] A sequence acquisition module 502, which acquires an electricity price time series for a preset historical time period; the electricity price time series includes a plurality of time domain signals, and each time domain signal in the plurality of time domain signals includes multi-dimensional feature data; the multi-dimensional feature data in each time domain signal includes feature data of multiple dimensions that affect the electricity price;

[0111] A period selection module 504, which is used to perform frequency domain analysis on the electricity price time series to obtain a set of periodic patterns; each periodic pattern in the set of periodic patterns refers to a pattern in which the multi-dimensional feature data in the electricity price time series repeats and fluctuates over time according to different periods;

[0112] An electricity price prediction module 506, which is used to convert the electricity price time series into two-dimensional feature data corresponding to each periodic pattern according to each periodic pattern, and predict the target electricity price prediction value corresponding to the target date according to the two-dimensional feature data corresponding to each periodic pattern.

[0113] It should be noted that the sequence acquisition module 502 in this embodiment can be used to execute the above step S202, the period selection module 504 in this embodiment can be used to execute the above step S204, and the electricity price prediction module 506 in this embodiment can be used to execute the above step S206.

[0114] In an exemplary embodiment, the period selection module 504 is further configured to use each dimension among a plurality of dimensions as the current dimension, and perform the following transformation and amplitude calculation on the electricity price time series to obtain a frequency domain signal corresponding to each dimension of the electricity price time series: perform Fourier transform on the feature data of the current dimension in each time domain signal to obtain a frequency domain signal corresponding to the current dimension of the electricity price time series; the frequency domain signal corresponding to the current dimension of the electricity price time series includes a plurality of frequency components; each frequency component among the plurality of frequency components corresponds to the feature data of the current dimension in each time domain signal; use each time domain signal in the electricity price time series as the current time domain signal, and perform the following weighting operation to obtain a frequency amplitude corresponding to each time domain signal: perform weighted average on the amplitudes of the current time domain signal and the frequency components corresponding to each dimension, and determine the amplitude obtained by the weighted average as the frequency amplitude corresponding to the current time domain signal; select a preset number of target frequency amplitudes in descending order of the frequency amplitudes corresponding to each time domain signal, and determine the period length corresponding to each target frequency amplitude according to the period frequency corresponding to each target frequency amplitude and the sequence length of the electricity price time series; the period frequency corresponding to each target frequency amplitude refers to the frequency of periodic change in the electricity price time series; the period length corresponding to each target frequency amplitude refers to the duration of periodic fluctuation in the electricity price time series; determine a period pattern respectively according to the period frequency and the period length corresponding to each target frequency amplitude to obtain a set of period patterns.

[0115] In an exemplary embodiment, each period pattern corresponds to a period frequency and a period length; the period frequency corresponding to each period pattern refers to the frequency of periodic change in the electricity price time series; the period length corresponding to each period pattern refers to the duration of periodic fluctuation in the electricity price time series; the electricity price prediction module 506 is further configured to use each period pattern as the current period pattern respectively and perform the following conversion operation to obtain two-dimensional feature data corresponding to each period pattern: extract the feature data corresponding to each dimension of the electricity price time series to obtain multiple sets of feature data; the dimensions of the feature data in each set of feature data among the multiple sets of feature data are the same; perform two-dimensional conversion on each set of feature data respectively to obtain two-dimensional feature data corresponding to each set of feature data; the number of rows of the two-dimensional feature data corresponding to each set of feature data is equal to the value of the period length of the current period pattern; the number of columns of the two-dimensional feature data corresponding to each set of feature data is equal to the value of the period frequency of the current period pattern; determine the two-dimensional feature data corresponding to each set of feature data as the two-dimensional feature data corresponding to the current period pattern.

[0116] In an exemplary embodiment, the electricity price prediction module 506 is further configured to input two-dimensional feature data corresponding to each cycle pattern into a pre-trained electricity price prediction model to obtain a reference electricity price prediction value for each cycle pattern; the electricity price prediction model is used to predict the electricity price value corresponding to the target date according to the input two-dimensional feature data; and determine the target electricity price prediction value corresponding to the target date according to the reference electricity price prediction value for each cycle pattern.

[0117] In an exemplary embodiment, the electricity price prediction module 506 is further configured to determine the weight of the reference electricity price prediction value for each cycle pattern; perform weighted summation on the reference electricity price prediction value for each cycle pattern according to the weight of the reference electricity price prediction value for each cycle pattern, and determine the weighted summation result as the target electricity price prediction value corresponding to the target date.

[0118] In an exemplary embodiment, the electricity price prediction module 506 is further configured to input the reference electricity price prediction value for each cycle pattern into a pre-constructed regression model to obtain the weight of the reference electricity price prediction value for each cycle pattern; the regression model is used to allocate weights to the input reference electricity price prediction values according to the self-attention mechanism.

[0119] In an exemplary embodiment, the electricity price prediction module 506 is further configured to obtain a plurality of training samples; each training sample in the plurality of training samples includes a historical electricity price time series and a label for a specified historical time period; the historical electricity price time series includes a plurality of historical time domain signals, and each historical time domain signal in the plurality of historical time domain signals includes multi-dimensional historical feature data; the multi-dimensional historical feature data in each historical time domain signal includes historical feature data of multiple dimensions affecting the electricity price; the label corresponding to each training sample is used to label the historical electricity price value corresponding to each historical time domain signal; perform frequency domain analysis on the historical electricity price time series in each training sample to obtain a set of historical cycle patterns corresponding to each training sample; each historical cycle pattern in the set of historical cycle patterns corresponding to each training sample refers to the pattern in which the multi-dimensional historical feature data in the historical electricity price time series in each training sample repeats and fluctuates over time according to different historical cycles; convert the historical electricity price time series into historical two-dimensional feature data corresponding to each historical cycle pattern corresponding to each training sample according to each historical cycle pattern corresponding to each training sample, and input the historical two-dimensional feature data corresponding to each historical cycle pattern corresponding to each training sample into the electricity price prediction model to be trained for model training to obtain a trained electricity price prediction model; wherein, in the process of model training for the electricity price prediction model, the model parameters of the electricity price prediction model are adjusted according to the difference between the predicted electricity price value corresponding to each training sample output by the electricity price prediction model and the label corresponding to each training sample.

[0120] It should be noted that the above-mentioned modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to this: the above-mentioned modules are all located in the same processor; or, the above-mentioned modules are respectively located in different processors in any combination form.

[0121] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided. The computer-readable storage medium includes a stored program, wherein when the program runs, it executes the steps in any one of the above method embodiments.

[0122] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: various media such as USB flash drives, ROMs, RAMs, mobile hard disks, magnetic disks, or optical discs that can store computer programs.

[0123] According to another aspect of the embodiments of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored on the memory and executable on the processor. The processor is configured to execute the steps in any one of the above method embodiments through the computer program. In an exemplary embodiment, the above electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the above processor, and the input / output device is connected to the above processor.

[0124] The specific examples in this embodiment may refer to the examples described in the above embodiments and exemplary embodiments, and will not be repeated here.

[0125] According to another aspect of the embodiments of the present application, a computer program product is further provided. The computer program product includes computer programs / instructions, and the computer programs / instructions include program codes for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the central processing unit 601, it executes various functions provided by the embodiments of the present application. The serial numbers of the above embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.

[0126] Figure 6 Schematically shows a block diagram of a computer system of an electronic device for implementing the embodiments of the present application. As Figure 6As shown, computer system 600 includes a CPU (Central Processing Unit) 601, which can perform various appropriate actions and processes according to programs stored in ROM 602 or programs loaded from storage section 608 into RAM 603. In random access memory 603, various programs and data required for system operation are also stored. The central processing unit 601, read-only memory 602, and random access memory 603 are connected to each other via bus 604. An I / O (Input / Output) interface 605 is also connected to bus 604.

[0127] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including, for example, a CRT (Cathode Ray Tube), an LCD (Liquid Crystal Display), etc. and a speaker; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the input / output interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed so that a computer program read from it can be installed into the storage section 608 as needed.

[0128] In particular, according to an embodiment of the present application, the processes described in each method flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program codes for performing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 609, and / or installed from the removable medium 611. When the computer program is executed by the central processing unit 601, various functions defined in the system of the present application are executed.

[0129] It should be noted that Figure 6 The computer system 600 of the electronic 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.

[0130] Obviously, those skilled in the art should understand that the above-mentioned modules or steps of the present application can be implemented by a general-purpose computing device. They can be concentrated on a single computing device or distributed on a network composed of multiple computing devices. They can be implemented by program codes executable by the computing device. Thus, they can be stored in a storage device and executed by the computing device. And in some cases, the steps shown or described can be executed in a different order from here, or they can be separately fabricated into individual integrated circuit modules, or multiple modules or steps among them can be fabricated into a single integrated circuit module for implementation. In this way, the present application is not limited to any specific combination of hardware and software.

[0131] The above are only the preferred embodiments of the present application and are not used to limit the present application. For those skilled in the art, the present application can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the principle of the present application shall be included within the protection scope of the present application.

Claims

1. A method for predicting electricity prices, characterized in that: include: Obtaining an electricity price time series for a preset historical time period; the electricity price time series includes a plurality of time domain signals, each of the plurality of time domain signals includes multi-dimensional feature data; the multi-dimensional feature data in each time domain signal includes feature data of multiple dimensions that affect the electricity price; Performing frequency domain analysis on the electricity price time series to obtain a set of periodic patterns; each periodic pattern of the set of periodic patterns refers to a pattern in which multi-dimensional feature data in the electricity price time series repeatedly fluctuates over time according to different periods; According to each cycle pattern, the electricity price time series is converted into two-dimensional feature data corresponding to each cycle pattern, and a target electricity price forecast value corresponding to a target date is forecasted based on the two-dimensional feature data corresponding to each cycle pattern.

2. The method according to claim 1, characterized in that The frequency domain analysis of the electricity price time series is performed to obtain a set of periodic patterns, including: Take each dimension of the multiple dimensions as the current dimension, perform the following transformation and amplitude calculation on the electricity price time series, and obtain the frequency domain signal corresponding to the electricity price time series and each dimension: perform Fourier transformation on the feature data of the current dimension in each time domain signal, and obtain the frequency domain signal corresponding to the electricity price time series and the current dimension; the frequency domain signal corresponding to the electricity price time series and the current dimension includes multiple frequency components; each frequency component of the multiple frequency components corresponds to the feature data of the current dimension in each time domain signal; Taking each time domain signal in the electricity price time series as the current time domain signal, performing the following weighted operation to obtain the frequency amplitude corresponding to each time domain signal: performing weighted averaging on the amplitudes of the frequency components corresponding to the current time domain signal and each dimension, and determining the amplitude obtained by the weighted averaging as the frequency amplitude corresponding to the current time domain signal; A preset number of target frequency amplitudes are selected in descending order of the frequency domain amplitudes corresponding to each time domain signal, and the period length corresponding to each target frequency amplitude is determined according to the period frequency corresponding to each target frequency amplitude in the preset number of target frequency amplitudes and the sequence length of the electricity price time series; the period frequency corresponding to each target frequency amplitude refers to the frequency of periodic changes in the electricity price time series; the period length corresponding to each target frequency amplitude refers to the duration of periodic fluctuations in the electricity price time series; According to the periodic frequency corresponding to each target frequency amplitude and the periodic length corresponding to each target frequency amplitude, a periodic pattern is determined respectively to obtain the group of periodic patterns.

3. The method according to claim 1, characterized in that Each of the periodic patterns corresponds to a periodic frequency and a periodic length; the periodic frequency corresponding to each of the periodic patterns refers to the frequency of periodic changes in the electricity price time series; the periodic length corresponding to each of the periodic patterns refers to the duration of periodic fluctuations in the electricity price time series; The step of converting the electricity price time series into two-dimensional feature data corresponding to each cycle mode according to each cycle mode includes: Each of the periodic patterns is used as the current periodic pattern to perform the following conversion operations to obtain two-dimensional feature data corresponding to each of the periodic patterns: Extracting feature data corresponding to each dimension of the electricity price time series to obtain multiple sets of feature data; the dimension of the feature data in each set of feature data in the multiple sets of feature data is the same; Performing two-dimensional conversion on each set of feature data respectively to obtain two-dimensional feature data corresponding to each set of feature data; the number of rows of the two-dimensional feature data corresponding to each set of feature data is equal to the value of the period length of the current periodic pattern; the number of columns of the two-dimensional feature data corresponding to each set of feature data is equal to the value of the period frequency of the current periodic pattern; The two-dimensional feature data corresponding to each group of feature data is determined as the two-dimensional feature data corresponding to the current periodic mode.

4. The method according to claim 1, characterized in that The method of predicting a target electricity price prediction value corresponding to a target date according to the two-dimensional feature data corresponding to each cycle mode includes: Inputting the two-dimensional feature data corresponding to each cycle mode into a pre-trained electricity price prediction model to obtain a reference electricity price prediction value under each cycle mode; the electricity price prediction model is used to predict the electricity value corresponding to the target date based on the input two-dimensional feature data; The target electricity price forecast value corresponding to the target date is determined according to the reference electricity price forecast value under each cycle mode.

5. The method according to claim 4, characterized in that The step of determining the target electricity price forecast value corresponding to the target date according to the reference electricity price forecast value in each cycle mode includes: Determining the weight of the reference electricity price forecast value under each cycle mode; According to the weight of the reference electricity price forecast value in each cycle mode, the reference electricity price forecast value in each cycle mode is weighted summed, and the weighted summation result is determined as the target electricity price forecast value corresponding to the target date.

6. The method according to claim 5, characterized in that The determining of the weight of the reference electricity price prediction value in each cycle mode includes: The reference electricity price prediction value under each cycle mode is input into a pre-built regression model to obtain the weight of the reference electricity price prediction value under each cycle mode; the regression model is used to assign weights to the input reference electricity price prediction values ​​according to the self-attention mechanism.

7. The method according to any one of claims 4 to 6, characterized in that The method further comprises: Acquire multiple training samples; each of the multiple training samples includes a historical electricity price time series and a label for a specified historical time period; the historical electricity price time series includes multiple historical time domain signals, each of the multiple historical time domain signals includes multi-dimensional historical feature data; the multi-dimensional historical feature data in each historical time domain signal includes historical feature data of multiple dimensions that affect the electricity price; the label corresponding to each training sample is used to mark the historical electricity value corresponding to each historical time domain signal; Performing frequency domain analysis on the historical electricity price time series in each training sample to obtain a group of historical periodic patterns corresponding to each training sample; each historical periodic pattern in the group of historical periodic patterns corresponding to each training sample refers to a pattern in which the multi-dimensional historical feature data in the historical electricity price time series in each training sample repeatedly fluctuates over time according to different historical periods; According to each historical cycle pattern corresponding to each training sample, the historical electricity price time series is converted into historical two-dimensional feature data corresponding to each historical cycle pattern corresponding to each training sample, and the historical two-dimensional feature data corresponding to each historical cycle pattern corresponding to each training sample is input into the electricity price prediction model to be trained for model training to obtain the trained electricity price prediction model; wherein, in the process of model training of the electricity price prediction model, the model parameters of the electricity price prediction model are adjusted according to the difference between the predicted electricity value corresponding to each training sample output by the electricity price prediction model and the label corresponding to each training sample.

8. An electricity price prediction device, characterized in that: include: A sequence acquisition module, which acquires a time series of electricity prices in a preset historical time period; the electricity price time series includes multiple time domain signals, each of the multiple time domain signals includes multi-dimensional feature data; the multi-dimensional feature data in each time domain signal includes feature data of multiple dimensions that affect the electricity price; A cycle selection module, used for performing frequency domain analysis on the electricity price time series to obtain a set of cycle patterns; each cycle pattern of the set of cycle patterns refers to a pattern in which the multi-dimensional feature data in the electricity price time series repeatedly fluctuates over time according to different cycles; The electricity price prediction module is used to convert the electricity price time series into two-dimensional feature data corresponding to each cycle mode according to each cycle mode, and predict the target electricity price prediction value corresponding to the target date based on the two-dimensional feature data corresponding to each cycle mode.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of any one of the methods of claims 1 to 7 when executed by a processor.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.