Power load prediction method and device, storage medium and computer program product
By using multi-head attention module and feature encoding technology in the power load prediction model, the problem of inaccurate power load prediction in the prior art is solved, and more accurate and reliable power load prediction is achieved.
Patent Information
- Application Number
- CN202510000727.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-02
- Publication Date
- 2025-05-06
AI Technical Summary
The prior art is difficult to accurately predict power loads, especially in long-term predictions, and it is impossible to effectively capture trends and long-term changes in ultra-long time series.
The power load prediction model of the multi-head attention module is used to divide the power load data through the sliding window, and the attention weights between characteristic elements are extracted, and the power load prediction is carried out based on holiday information, coal price information and historical similar days.
It improves the accuracy and reliability of power load prediction, and can more effectively capture the complex dynamic changes and long-term trends of power load.
Smart Images

Figure BDA0005224995280000111 
Figure BDA0005224995280000171 
Figure BDA0005224995280000181
Abstract
Description
Technical Field
[0001] The present application relates to the field of electric power, and more specifically, to a method and device for predicting electric power load, a storage medium, and a computer program product. Background Art
[0002] With the development of current power technology, power load forecasting has become increasingly important in power dispatching and management. For participants on the power generation side of the power market, accurate load forecasting can help power generation companies to reasonably arrange power generation plans and optimize resource allocation. At the same time, power load forecasting is an important prerequisite for power market price forecasting. The level of power load directly participates in the formation of the supply-demand ratio, which directly determines the trend of electricity prices. In particular, accurate long-term power load forecasting results can guide electricity price forecasting, thereby improving the accuracy of electricity price forecasting, helping power generation companies to reasonably arrange market quotations, optimize resource allocation, and improve market profitability.
[0003] However, current power load forecasting faces multiple challenges. Power load has obvious nonlinear and seasonal characteristics, and traditional forecasting models often have difficulty capturing complex dynamic changes. In addition, in long-term forecasting, the long-term dependence of historical data will affect the forecast results. Current technology cannot effectively capture trends and long-term changes in ultra-long time series. In other words, there are technical problems in the existing technology of inaccurate power load forecasting.
[0004] Currently, no effective solution has been proposed for the above technical problems. Summary of the invention
[0005] The embodiments of the present application provide a method and device for predicting power load, a storage medium, and a computer program product to at least solve the technical problem of inaccurate power load prediction in the related art.
[0006] According to one aspect of an embodiment of the present application, a method for predicting electric load is provided, comprising: obtaining an electric load data set matching a first period, wherein the electric load data set includes at least one electric load slice data, and the electric load slice data is obtained by segmenting the electric load data sequence corresponding to the first period according to a sliding window; inputting electric load characteristics matching the electric load data set into an electric load prediction model, wherein the electric load prediction model includes a plurality of interconnected multi-head attention modules, and the multi-head attention modules are used to extract attention weights between characteristic elements in the electric load characteristics; obtaining an electric load prediction result matching a second period output by the electric load prediction model, wherein the electric load prediction result includes a sequence of electricity price mutation points, and the sequence of electricity price mutation points includes a plurality of time points within the second period and electricity price mutation points respectively matching the plurality of time points, and the second period is an electric system operation period after the first period.
[0007] In an exemplary embodiment, after the power load characteristics matching the power load data set are input into the power load prediction model, it also includes: receiving the N-1th intermediate feature output by the N-1th multi-head attention module through the Nth multi-head attention module in the power load prediction model, where N is an integer greater than or equal to 2; obtaining the query matrix, key matrix and value matrix matching the intermediate feature, and obtaining the Nth attention weight matrix based on the query matrix, key matrix and value matrix; determining the Nth intermediate feature output by the Nth multi-head attention module based on the Nth attention weight matrix.
[0008] In an exemplary embodiment, an Nth attention weight matrix is obtained according to a query matrix, a key matrix and a value matrix, including: performing a linear transformation operation on the query matrix, the key matrix and the value matrix to obtain query sub-matrices, key sub-matrices and value sub-matrices corresponding to each of the multiple feature subspaces; in the multiple feature subspaces, according to the respective corresponding query sub-matrices, key sub-matrices and value sub-matrices, determining the attention weight sub-matrices corresponding to each of the multiple feature subspaces; according to the attention weight sub-matrices corresponding to each of the multiple feature subspaces, determining the Nth attention weight matrix.
[0009] In an exemplary embodiment, before the power load characteristics matching the power load data set are input into the power load prediction model, at least one of the following is also included: determining a first load data sub-feature based on at least one power load slice data included in the power load data set, wherein the power load characteristics include the first load data sub-feature; determining position feature codes corresponding to the positions of the multiple feature elements respectively according to the positions of the multiple feature elements included in the power load characteristics; determining the multiple position feature codes as a second load data sub-feature, wherein the power load characteristics include the second load data sub-feature; obtaining holiday information matching the second cycle; determining the date feature code used to characterize the holiday information as a third load sub-feature; obtaining historical similar days matching each day in the second cycle; determining the date feature code of the coal price information corresponding to the historical similar days as a fourth load data sub-feature; obtaining historical similar days matching each day in the second cycle; determining the fifth load data sub-feature according to the power load characteristic code corresponding to the historical similar days.
[0010] In an exemplary embodiment, obtaining a power load forecast result output by a power load forecasting model that matches a second period includes: obtaining an intermediate feature output by a last multi-head attention module; inputting the intermediate feature into a feedforward neural network in the power load forecasting model to obtain a nonlinear transformation result of the last intermediate feature, wherein the feedforward neural network includes a first linear change layer and a second linear change layer, the first linear change layer is used to obtain a first linear change result of a feature element in the intermediate feature, and the second linear change layer is used to obtain a second linear change result of a reference element, the reference element being a larger element between the first linear change result and 0; performing normalization processing on the residual connection result of the nonlinear change result, and determining the power load forecast result based on the flattening result of the normalization processing result.
[0011] In an exemplary embodiment, before obtaining the power load data set matching the first cycle, it also includes: obtaining a historical load data set matching the third cycle, wherein the historical load data set includes at least one historical load slice data, and the historical load slice data is obtained by segmenting the power load data sequence corresponding to the third cycle according to a sliding window; obtaining a label load data set matching the fourth cycle, wherein the label load data set includes a historical electricity price mutation point sequence matching the fourth cycle, and the fourth cycle is the power system operation cycle after the third cycle; training the initial load prediction model in the training state according to the historical load data set and the label load data set to obtain the power load prediction model.
[0012] In an exemplary embodiment, an initial load prediction model in a training state is trained according to a historical load data set and a labeled load data set to obtain a power load prediction model, including: inputting historical load characteristics matching the historical load data set into the initial load prediction model, wherein the initial load prediction model includes a plurality of interconnected multi-head attention modules, and the multi-head attention modules are used to extract attention weights between feature elements in the historical load characteristics; obtaining a reference load prediction result output by the initial load prediction model that matches the fourth period; determining a current training loss according to the reference load prediction result and the labeled load data set; and determining the initial load prediction model as a power load prediction model when the current training loss meets a convergence condition.
[0013] According to another aspect of an embodiment of the present application, a power load prediction device is also provided, including: a first acquisition unit, used to acquire a power load data set matching a first period, wherein the power load data set includes at least one power load slice data, and the power load slice data is obtained by segmenting the power load data sequence corresponding to the first period according to a sliding window; an input unit, used to input the power load characteristics matching the power load data set into a power load prediction model, wherein the power load prediction model includes a plurality of interconnected multi-head attention modules, and the multi-head attention modules are used to extract the attention weights between the characteristic elements in the power load characteristics; a second acquisition unit, used to acquire the power load prediction result matching the second period output by the power load prediction model, wherein the power load prediction result includes a sequence of electricity price mutation points, the sequence of electricity price mutation points includes a plurality of time points within the second period and electricity price mutation points respectively matching the plurality of time points, and the second period is the power system operation period after the first period.
[0014] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned power load prediction method when running.
[0015] According to another aspect of an embodiment of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the power load prediction method through the computer program.
[0016] According to another aspect of the embodiments of the present application, a computer program product is provided, including a computer program, which implements the steps of the method in each embodiment of the present application when the computer program is executed by a processor.
[0017] Through the present application, a power load data set matching the first cycle can be first obtained, wherein the power load data set includes at least one power load slice data, and the power load slice data is obtained by segmenting the power load data sequence corresponding to the first cycle according to the sliding window; and then the power load characteristics matching the power load data set are input into the power load forecasting model, wherein the power load forecasting model includes a plurality of interconnected multi-head attention modules, and the multi-head attention modules are used to extract the attention weights between the characteristic elements in the power load characteristics; further, the power load forecasting result output by the power load forecasting model matching the second cycle is obtained, wherein the power load forecasting result includes a sequence of electricity price mutation points, and the sequence of electricity price mutation points includes a plurality of time points in the second cycle and electricity price mutation points respectively matching the plurality of time points, and the second cycle is the power system operation cycle after the first cycle. Thus, the technical problem of inaccurate power load forecasting in the prior art is solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0019] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0020] Figure 1 It is a hardware structure block diagram of a computer terminal of a power load prediction method according to an embodiment of the present application;
[0021] Figure 2 is a flow chart of a method for predicting power load according to an embodiment of the present application;
[0022] Figure 3 is a flow chart of another method for predicting power load according to an embodiment of the present application;
[0023] Figure 4 is a model structure diagram of a method for predicting power load according to an embodiment of the present application;
[0024] Figure 5 It is a structural block diagram of a power load prediction device according to an embodiment of the present application. DETAILED DESCRIPTION
[0025] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0027] The method embodiments provided in the embodiments of the present application can be executed in a computer terminal or a similar computing device. Taking running on a computer terminal as an example, Figure 1 1 is a hardware structure block diagram of a computer terminal of a method for predicting power load in an embodiment of the present application. Figure 1 As shown, the computer terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor (Central Processing Unit, MCU) or a programmable logic device (Field Programmable Gate Array, FPGA)) and a memory 104 for storing data, wherein the above-mentioned computer terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0028] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the power load prediction method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0029] A wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.
[0030] In this embodiment, a method for predicting power load is provided. Figure 2 is a flow chart of a method for predicting power load according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:
[0031] S202, obtaining a power load data set matching the first cycle, wherein the power load data set includes at least one power load slice data, and the power load slice data is obtained by segmenting the power load data sequence corresponding to the first cycle according to a sliding window;
[0032] S204, inputting the power load characteristics matched with the power load data set into the power load prediction model, wherein the power load prediction model includes a plurality of interconnected multi-head attention modules, and the multi-head attention modules are used to extract the attention weights between the characteristic elements in the power load characteristics;
[0033] S206, obtaining the power load forecast result output by the power load forecasting model and matching the second period, wherein the power load forecast result includes a sequence of electricity price mutation points, the sequence of electricity price mutation points includes multiple time points within the second period and electricity price mutation points that match the multiple time points respectively, and the second period is the power system operation period after the first period.
[0034] It should be noted that in the above step S202, the above data set is obtained by preprocessing the historical power load data, including interpolation processing of abnormal points and missing values, and data standardization, etc., which are not specifically limited here.
[0035] It is worth noting that the above data set contains at least one shard data of power load, which is obtained by segmenting the power load data sequence through a sliding window and is a sequence with a fixed length. It can be understood that after the data is segmented, the computational complexity and memory usage can be effectively reduced, and the model can better capture the local information of the time series.
[0036] Furthermore, after obtaining the power load data set matching the first cycle through the above step S202, the above step 204 is executed to input the power load characteristics matching the power load data set into the power load prediction model. Optionally, the above power prediction model includes a plurality of interconnected multi-head attention modules. It should be noted that the above multi-head attention module is used to extract the attention weights between the characteristic elements in the power load characteristics.
[0037] After being processed by the multi-head attention module, the power load model will output a power load forecast result that matches the second cycle. This result includes not only the predicted value of the power load, but also a sequence of electricity price mutation points. The sequence of electricity price mutation points includes multiple time points in the second cycle and electricity price mutation points that match these time points. It should be noted that the second cycle is the power system operation cycle after the first cycle.
[0038] Specifically, the above step S206, obtaining the power load forecast result output by the power load forecast model and matching the second cycle, specifically includes:
[0039] S206-1, obtain the intermediate features output by the last multi-head attention module;
[0040] S206-2, inputting the intermediate feature into the feedforward neural network in the power load forecasting model to obtain a nonlinear transformation result of the last intermediate feature, wherein the feedforward neural network includes a first linear change layer and a second linear change layer, the first linear change layer is used to obtain a first linear change result of a feature element in the intermediate feature, and the second linear change layer is used to obtain a second linear change result of a reference element, where the reference element is a larger element between the first linear change result and 0;
[0041] S206-3, performing normalization processing on the residual connection result of the nonlinear change result, and determining the power load prediction result based on the flattening result of the normalization processing result.
[0042] First, the intermediate features output from the last multi-head attention module are obtained through the above step S206-1, and then the intermediate features obtained in S206-1 are input into the feedforward neural network in the power load forecasting model. It should be noted that the above feedforward neural network includes two linear change layers (a first linear change layer and a second linear change layer), wherein the first linear change layer is used to perform a linear transformation on each feature element in the intermediate feature to obtain a first linear change result. The generation of the first change result can conform to the following formula: The second linear change layer is used to perform a second linear transformation with the larger value between the first linear change result and 0 as a reference element.
[0043] It can be understood that the generation process of the nonlinear transformation result of the last intermediate feature can conform to the following mathematical model:
[0044] E=max(0,xW1+b1)W2+b2
[0045] Among them, E is the nonlinear transformation result of the last intermediate feature, and xW1+b1 is the first linear change result.
[0046] Further, the nonlinear transformation result obtained in step S206-2 is residually connected, and the connected result is normalized. It can be understood that the residual connection can maintain the integrity of the information and prevent the gradient from disappearing or exploding. Normalization ensures that the data is within a suitable range for subsequent processing.
[0047] Then, flattening is performed according to the normalization result, that is, the multi-dimensional data is converted into one-dimensional data to match the format of the power load forecast result, so that the power load forecast result can be determined from the flattening result.
[0048] Through the above implementation, a power load data set matching the first cycle can be first obtained, wherein the power load data set includes at least one power load slice data, and the power load slice data is obtained by segmenting the power load data sequence corresponding to the first cycle according to the sliding window; and then the power load characteristics matching the power load data set are input into the power load forecasting model, wherein the power load forecasting model includes a plurality of interconnected multi-head attention modules, and the multi-head attention modules are used to extract the attention weights between the characteristic elements in the power load characteristics; further, the power load forecasting result output by the power load forecasting model matching the second cycle is obtained, wherein the power load forecasting result includes a sequence of electricity price mutation points, and the sequence of electricity price mutation points includes a plurality of time points in the second cycle and electricity price mutation points respectively matching the plurality of time points, and the second cycle is the power system operation cycle after the first cycle. Thus, the technical problem of inaccurate power load forecasting in the prior art is solved.
[0049] As an optional implementation mode, after the power load characteristics matching the power load data set are input into the power load prediction model, the method further includes:
[0050] S1, receiving the N-1th intermediate feature output by the N-1th multi-head attention module through the Nth multi-head attention module in the power load forecasting model, where N is an integer greater than or equal to 2;
[0051] S2, obtain the query matrix, key matrix and value matrix matching the intermediate features, and obtain the Nth attention weight matrix according to the query matrix, key matrix and value matrix;
[0052] S3, determine the Nth intermediate feature output by the Nth multi-head attention module according to the Nth attention weight matrix.
[0053] It should be noted that in the above step S1, the above power load forecasting model gradually processes the input data through a plurality of interconnected multi-head attention modules. Specifically, the above power load forecasting model includes a plurality of interconnected multi-head attention modules, and the above multi-head attention modules work in a chain manner. In other words, each multi-head attention module receives the output of the previous multi-head attention module and generates its own output as the input of the next multi-head attention module. It can be understood that the last multi-head attention module does not form a closed loop with the first multi-head attention module, and therefore, the output of the last multi-head attention module will no longer be used as the input of the next multi-head attention module.
[0054] Optionally, the above step S2, obtaining a query matrix, a key matrix and a value matrix matching the intermediate features, and obtaining an Nth attention weight matrix according to the query matrix, the key matrix and the value matrix, specifically includes:
[0055] S2-1, performing a linear transformation operation on the query matrix, the key matrix and the value matrix to obtain a query sub-matrix, a key sub-matrix and a value sub-matrix corresponding to each of the plurality of feature subspaces;
[0056] S2-2, in the multiple feature subspaces, according to the corresponding query submatrix, key submatrix and value submatrix, determine the attention weight submatrix corresponding to each of the multiple feature subspaces;
[0057] S2-3, determine the Nth attention weight matrix according to the attention weight sub-matrices corresponding to the multiple feature subspaces.
[0058] It can be understood that the above steps S2-1 to S2-3 are used to obtain the query matrix (Query Matrix), key matrix (Key Matrix) and value matrix (Value Matrix) matching the above intermediate features, and calculate the above Nth attention weight matrix (Attention Weight Matrix) based on the above matrices.
[0059] It should be noted that the query matrix is the representation of the words in the decoder, the key matrix is the representation output by the encoder, which is used to help match the query matrix, and the value matrix corresponds to the key matrix and is used to generate the output representation.
[0060] Specifically, firstly, the above step S2-1 is performed to convert the original query matrix, key matrix and value matrix into multiple feature subspaces through linear transformation operations. Specifically, firstly, a linear transformation is performed on the above query matrix, key matrix and value matrix, for example, by multiplying a weight matrix and adding a bias term to realize the linear transformation of the above matrix, thereby obtaining multiple query submatrices, key submatrices and value submatrices corresponding to different feature subspaces.
[0061] It is worth noting that the dimension of the above feature subspace is d k / h, where h is the number of attention heads.
[0062] Further, the above step S2-2 is performed, and in multiple feature subspaces, the attention weight submatrices corresponding to each of the multiple feature subspaces are determined according to the corresponding query submatrices, key submatrices and value submatrices. It should be noted that the above attention weight submatrices can be calculated by using dot products. Specifically, for each feature subspace, the dot product of the query submatrix and the key submatrix is calculated, and then the softmax function is applied to obtain the normalized attention weight submatrix. The above calculation process can conform to the following mathematical model:
[0063]
[0064] Among them, Q is the query submatrix, K is the key submatrix, and V is the value submatrix. The sizes of these matrices are (n, d k ), n is the length of the sequence, d k is the dimension of the key submatrix. It should be noted that the above calculation is performed once for the query submatrix, key submatrix and value submatrix corresponding to each feature subspace to obtain the attention weight submatrix corresponding to each of the multiple feature subspaces.
[0065] Furthermore, to obtain the final attention weight matrix, the above step S2-3 is performed to determine the Nth attention weight matrix according to the attention weight sub-matrices corresponding to each of the multiple feature subspaces. It can be understood that the above determination method can be in a variety of ways, such as adding all the attention weight sub-matrices or connecting them by average weighting, non-average weighting, splicing, etc., which is not specifically limited here.
[0066] Furthermore, after obtaining the Nth attention weight matrix through the above steps S2-1 to S2-3, the above step S3 is executed to determine the Nth intermediate feature output by the Nth multi-head attention module according to the Nth attention weight matrix. Specifically, after obtaining the above attention weight matrix, the above power load prediction model can perform element updates according to the obtained attention weight matrix to generate a new feature representation. Specifically, each value element is multiplied by its corresponding attention weight, and then these weighted value elements are added (or other forms of aggregation are performed) to generate a new representation (Nth intermediate feature) of each query matrix.
[0067] As an optional implementation, before inputting the power load characteristics matching the power load data set into the power load prediction model, at least one of the following is also included:
[0068] S1, determining a first load data sub-feature according to at least one power load slice data included in the power load data set, wherein the power load feature includes the first load data sub-feature;
[0069] S2, according to the respective positions of the plurality of characteristic elements included in the power load characteristic, determining the position characteristic codes corresponding to the respective positions of the plurality of characteristic elements; determining the plurality of position characteristic codes as second load data sub-characteristics, wherein the power load characteristic includes the second load data sub-characteristics;
[0070] S3, obtaining holiday information matching the second period; determining the date feature code used to characterize the holiday information as the third load sub-feature;
[0071] S4, obtaining coal price information matching the second period; determining the date feature code used to characterize the coal price information as the fourth load data sub-feature;
[0072] S5, obtaining a historical similar day that matches each day in the second cycle; and determining the fifth load data sub-feature according to the power load coding feature corresponding to the historical similar day.
[0073] It is understandable that before inputting the power load characteristics in the power load data set into the power load prediction model, at least one of the above steps S1 to S5 can be taken to enrich or adjust the power load characteristics to improve the accuracy and reliability of the power load prediction model.
[0074] Specifically, step S1, according to the power load data set including at least one power load slice data, determines the first load data sub-feature. It should be noted that, for the above step S1, the first load data sub-feature is determined based on at least one power load slice data in the power load data set. The power load slice data can be data that divides the overall power load data into smaller units according to time (such as hours, days, weeks, etc.) or specific conditions (such as different regions, different types of electricity consumption, etc.), which is not specifically limited here.
[0075] It can be understood that the above-mentioned first load data sub-feature is extracted from the sliced data and is used to represent a specific aspect or attribute of the power load, such as the average load, maximum load, load change trend, etc. in a certain period of time.
[0076] It should be noted that, for the above step S2, the position feature coding is determined according to the respective positions of the multiple feature elements in the power load feature, and these position feature codings are used as the second load data sub-features. It should be pointed out that the position of the feature elements can refer to their position in the time series, the order of arrangement in the data set, or the relative position with other feature elements. The position feature coding converts the above position information into a numerical form that can be understood by the model.
[0077] It should be noted that, for the above step S3, firstly, the holiday information matching the second cycle is obtained, and the date feature encoding used to characterize the holiday information is determined as the third load sub-feature. It should be pointed out that holidays usually have a significant impact on the power load, because people's electricity consumption behavior is usually different during holidays and on weekdays. Therefore, by introducing holiday information, the model can better capture the changes in power characteristics.
[0078] It is worth noting that step S4 is to obtain the coal price information of historical similar days that match each day in the second cycle, and the date feature encoding used to characterize the coal price information is determined as the fourth load sub-feature. It should be noted that historical similar days refer to past dates that are similar to the forecast target day in certain key features (such as holidays, seasonal conditions, large-scale events, etc.). As an important factor in energy costs, coal prices will affect the cost of electricity production and consumption, and thus affect the power load. By referring to the coal price information of these historical similar days, a more accurate load estimate can be provided for the forecast target day.
[0079] The above step S5 is to obtain the power load matching the above historical similar days. Similarly, the power load of historical similar days has important guiding help for the prediction of the power load of the second cycle. Therefore, it is necessary to provide more accurate load estimation for each predicted target day in the second cycle by referring to the power load of these historical similar days.
[0080] Through the above steps S1 to S5, by extracting and integrating a variety of characteristic information related to power load, more comprehensive and accurate input data is provided for the power load prediction model, which helps to improve the prediction performance and reliability of the model.
[0081] As an optional implementation manner, before obtaining the power load data set matching the first cycle, the method further includes:
[0082] S1, obtaining a historical load data set matching the third period, wherein the historical load data set includes at least one historical load slice data, and the historical load slice data is obtained by segmenting the power load data sequence corresponding to the third period according to a sliding window;
[0083] S2, obtaining a label load data set matching the fourth cycle, wherein the label load data set includes a sequence of historical electricity price mutation points matching the fourth cycle, and the fourth cycle is a power system operation cycle after the third cycle;
[0084] S3, training the initial load forecasting model in a training state according to the historical load data set and the label load data set to obtain a power load forecasting model.
[0085] It can be understood that the above steps S1 to S3 are a training process for the above power load prediction model.
[0086] Specifically, firstly, step S1 is executed to obtain a historical load data set matching the third period. Specifically, firstly, a historical load data set matching the third period needs to be collected. It should be noted that the third period is a specific time period selected for extracting historical load data. In order to obtain more comprehensive data, we can select a longer time period, such as a month or a quarter, as the third period, which is not specifically limited here.
[0087] It should be noted that in the above step S1, the above historical load data set contains at least one historical load shard data. The above shard data is obtained by dividing the power load data sequence corresponding to the third period according to the sliding window method. That is, multiple subsequences are generated from the time series data through a sliding window. Specifically, a fixed window size can be set, and then the window is slid along the time axis, and a new subsequence is generated each time it slides. Then, a historical load data set containing multiple subsequences can be obtained. These subsequences will be used as input data for subsequent model training.
[0088] Further, the above step S2 is performed to obtain a label load data set matching the fourth cycle. It is worth noting that in the process of training the model, in addition to the above historical load data set, a label load data set matching the fourth cycle is also required. The above fourth cycle refers to the power system operation cycle after the third cycle, which is used to extract label data.
[0089] It should be noted that the above-mentioned tag load data set contains a sequence of historical electricity price mutation points that matches the fourth cycle. The electricity price mutation point refers to the time point when the electricity price changes significantly. Specifically, the mutation points in the electricity price data within the fourth cycle are found and organized into a sequence, namely the above-mentioned historical electricity price mutation point sequence.
[0090] Furthermore, after the historical load data set and the label load data set are obtained through the above steps S1 and S2, the initial load forecasting model is trained. It can be understood that the above-mentioned collected historical load data set and label load data set will be used in the training process. Specifically, the subsequence in the historical load data set is used as input data, and the electricity price mutation point sequence in the label load data set is used as the target output to iteratively train the initial load forecasting model.
[0091] It should be noted that in the process of iterative training of the above-mentioned initial load forecasting model, the above-mentioned initial load forecasting model will continuously adjust the internal parameters to minimize the difference between the predicted output and the actual label. Specifically, various optimization algorithms can be used, such as gradient descent algorithm, stochastic gradient descent algorithm, Adam algorithm, etc. These algorithms will update the parameters of the model according to the gradient information of the loss function, thereby gradually reducing the value of the loss function to minimize the difference between the predicted output and the actual label. Furthermore, after multiple iterative training, we can obtain a trained power load forecasting model. In subsequent applications, the trained model can be used to predict new power load data to obtain future electricity price mutation point information.
[0092] As an optional implementation, the initial load forecasting model in a training state is trained according to the historical load data set and the label load data set to obtain a power load forecasting model, including:
[0093] S1, inputting historical load features matching the historical load data set into an initial load forecasting model, wherein the initial load forecasting model includes a plurality of interconnected multi-head attention modules, and the multi-head attention modules are used to extract attention weights between feature elements in the historical load features;
[0094] S2, obtaining a reference load forecast result output by the initial load forecast model that matches the fourth period;
[0095] S3, determining the current training loss based on the reference load prediction result and the label load data set;
[0096] S4, when the current training loss meets the convergence condition, the initial load forecasting model is determined as the power load forecasting model.
[0097] It can be understood that the above steps S1 to S4 are the specific process of training the initial load forecasting model. Specifically, the above step S1 is first executed to input the historical load characteristics matching the historical load data set into the initial load forecasting model. After the model receives the historical load characteristics, it will forward propagate the initial load forecasting model and output a reference load forecasting result matching the fourth period.
[0098] Next, we need to evaluate the accuracy of the output reference load prediction results matching the fourth period. This is achieved by calculating the difference between the prediction results and the actual load value of the corresponding period in the label load data set, that is, calculating the training loss, and updating the parameters in reverse according to the training loss. The specific algorithm is described above and will not be repeated here.
[0099] It should be noted that in the above step S3, the above training convergence condition is a preset threshold value. When the training loss is lower than the preset threshold value, it is considered that the convergence condition is met and the training can be stopped. At this time, the initial load forecasting model is determined as the final power load forecasting model.
[0100] Figure 3 is a flow chart of another method for predicting power load according to an embodiment of the present application, such as Figure 3 As shown, steps S302 to S306 describe a training method of a neural network for predicting power load.
[0101] S302: Preprocess the training data and combine them into an input data set. Preprocess the input data. Specifically, the training data is the power load data of the past five years, and the data granularity is 96 points / day (sampled once every fifteen minutes, 96 times a day). Interpolate the abnormal points and missing values, and standardize the data.
[0102] S304: Construct a Patch-Transformer model. The model architecture of the above Patch-Transformer model can be found in Figure 4 Specifically, the input data is first patched, and the historical power load data is divided into fixed-length sequences using the sliding window technology to form input features. It can be understood that data slicing can effectively reduce computational complexity and memory usage, and enable the model to better capture local information of the time series. The above fixed-length sequences can be in the following forms:
[0103] x p =[x t ,x t+1 ,x t+2 ,...,x t+L-1 ]
[0104] Among them, x p is a sequence, x i is the data element in the sequence. Then add the position code W to the fragmented sequence pos , to solve the problem that the self-attention does not contain the fragmentation order. And project the fragmentation to the input length d of the subsequent multi-head attention. This process can conform to the following mathematical model:
[0105]
[0106] Furthermore, the encoded data is input into the Transformer architecture. A multi-head attention model is used to calculate the correlation or weight of each input slice with other input slices. A query and a set of key-value pairs are mapped to an output. It should be noted that the query is usually the representation of a word in the current decoder; the key is the representation from the encoder output to help match the query; the value corresponds to the key and is used to generate the output representation.
[0107] It is worth noting that the result of the attention mechanism is a weighted sum of values, and the weights are calculated by a compatibility function between the query and the key. This compatibility function can be a dot product or other metric.
[0108] For example, the steps for single attention are:
[0109] Calculate the dot product of the query vector Q and the key vector K to measure the similarity between the query and each key. Specifically, for each query q and key k, calculate:
[0110]
[0111] Among them, Q is the query matrix, K is the key matrix, and V is the value matrix. The sizes of these matrices are (n, d k ), n is the length of the sequence, d k The dimension of the key.
[0112] At the same time, a multi-head attention mechanism is used. First, the query, key, and value are mapped to different subspaces through linear transformation, and the dimension of each subspace is d k / h, where h is the number of attention heads. Then, the above single attention step is performed for each subspace, and this process is performed in parallel on all attention heads. The results of each attention head are then concatenated, and finally a linear transformation is performed to obtain the final attention output. The formula for multi-head attention is:
[0113] MultiHead(Q,K,V)=Concat(head1,...,head h )W O
[0114]
[0115] in, W is the parameter matrix for linear projection. Each head has a separate projection matrix. O It is the weight matrix after connecting the outputs of all attention heads and then linearly transforming them.
[0116] Furthermore, the output after multi-head attention is connected through residuals and normalized to improve the stability of training and achieve accelerated convergence.
[0117] Subsequently, the data is further passed to the feedforward neural network for nonlinear transformation. The network consists of two layers of linear transformation, in which the Relu activation function can be used, or other activation functions such as Leaky-Relu, Randomized-Relu, sigmoid, etc., which are not specifically limited here. The specific feedforward neural network can be expressed as:
[0118] FFN(x)=max(0,xW1+b1)W2+b2
[0119] The output of the above feedforward neural network is connected again through residual connection and normalized, and then the matrix is flattened to obtain the output result, which is a long-period power load result.
[0120] S306, use the training data in S302 to train the network model in S304. Send the processed data to the model structure for training, calculate the loss function based on the training data, and optimize the network weights through back propagation. Evaluate the prediction performance, and adjust and optimize the model parameters according to the situation to ensure that the model has good prediction capabilities. After the training is completed, the model can automatically output the long-term sequence of power load and predict the trend of power load over a longer time range.
[0121] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.
[0122] In this embodiment, a power load prediction device is also provided, which is used to implement the above-mentioned embodiments and preferred embodiments, and will not be repeated hereafter. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0123] Figure 5 It is a structural block diagram of a power load prediction device according to an embodiment of the present application, the device comprising: a first acquisition unit 52, used to acquire a power load data set matching a first period, wherein the power load data set includes at least one power load slice data, and the power load slice data is obtained by segmenting the power load data sequence corresponding to the first period according to a sliding window; an input unit 54, used to input the power load characteristics matching the power load data set into a power load prediction model, wherein the power load prediction model includes a plurality of interconnected multi-head attention modules, and the multi-head attention modules are used to extract the attention weights between the characteristic elements in the power load characteristics; a second acquisition unit 56, used to acquire the power load prediction result output by the power load prediction model matching the second period, wherein the power load prediction result includes a sequence of electricity price mutation points, the sequence of electricity price mutation points includes a plurality of time points in the second period and electricity price mutation points respectively matching the plurality of time points, and the second period is the power system operation period after the first period.
[0124] Through the above device, a power load data set matching the first cycle can be first obtained, wherein the power load data set includes at least one power load slice data, and the power load slice data is obtained by segmenting the power load data sequence corresponding to the first cycle according to the sliding window; then the power load characteristics matching the power load data set are input into the power load prediction model, wherein the power load prediction model includes multiple interconnected multi-head attention modules, and the multi-head attention modules are used to extract the attention weights between the characteristic elements in the power load characteristics; further, the power load prediction result output by the power load prediction model matching the second cycle is obtained, wherein the power load prediction result includes a sequence of electricity price mutation points, and the sequence of electricity price mutation points includes multiple time points in the second cycle and electricity price mutation points respectively matching the multiple time points, and the second cycle is the power system operation cycle after the first cycle. Thus, the technical problem of inaccurate power load prediction in the prior art is solved.
[0125] In an exemplary embodiment, the above-mentioned device also includes an intermediate feature determination unit, which is used to receive the N-1th intermediate feature output by the N-1th multi-head attention module through the Nth multi-head attention module in the power load forecasting model, where N is an integer greater than or equal to 2; obtain the query matrix, key matrix and value matrix matching the intermediate feature, and obtain the Nth attention weight matrix based on the query matrix, key matrix and value matrix; determine the Nth intermediate feature output by the Nth multi-head attention module based on the Nth attention weight matrix.
[0126] In an exemplary embodiment, the above-mentioned intermediate feature determination unit is also used to perform linear transformation operations on the query matrix, key matrix and value matrix to obtain query sub-matrices, key sub-matrices and value sub-matrices corresponding to multiple feature subspaces respectively; in multiple feature subspaces, according to the corresponding query sub-matrices, key sub-matrices and value sub-matrices, determine the attention weight sub-matrices corresponding to the multiple feature subspaces respectively; according to the attention weight sub-matrices corresponding to the multiple feature subspaces respectively, determine the Nth attention weight matrix.
[0127] In an exemplary embodiment, the above-mentioned device also includes a sub-feature determination unit, which is further used to determine a first load data sub-feature based on at least one power load slice data included in the power load data set, wherein the power load feature includes the first load data sub-feature; determine the position feature codes corresponding to the respective positions of the multiple feature elements included in the power load feature according to the respective positions of the multiple feature elements; determine the multiple position feature codes as a second load data sub-feature, wherein the power load feature includes the second load data sub-feature; obtain holiday information matching the second period; determine the date feature code used to characterize the holiday information as a third load data sub-feature; obtain historical similar days matching each day in the second period; determine the date feature code of the coal price information corresponding to the historical similar day as a fourth load data sub-feature; obtain historical similar days matching each day in the second period; and determine the fifth load data sub-feature according to the power load feature code corresponding to the historical similar day.
[0128] In an exemplary embodiment, the second acquisition unit 56 includes an intermediate feature acquisition module for acquiring the intermediate features output by the last multi-head attention module; a nonlinear result generation module for inputting the intermediate features into the feedforward neural network in the power load forecasting model to obtain a nonlinear transformation result of the last intermediate feature, wherein the feedforward neural network includes a first linear change layer and a second linear change layer, the first linear change layer is used to acquire the first linear change result of the feature element in the intermediate feature, and the second linear change layer is used to acquire the second linear change result of the reference element, the reference element being a larger element between the first linear change result and 0; a post-processing module for performing normalization processing according to the residual connection result of the nonlinear change result, and determining the power load forecasting result according to the flattening result of the normalization processing result.
[0129] In an exemplary embodiment, the above-mentioned device also includes a training unit, which is used to obtain a historical load data set matching the third period, wherein the historical load data set includes at least one historical load slice data, and the historical load slice data is obtained by segmenting the power load data sequence corresponding to the third period according to a sliding window; obtain a label load data set matching the fourth period, wherein the label load data set includes a historical electricity price mutation point sequence matching the fourth period, and the fourth period is the power system operation period after the third period; train the initial load prediction model in the training state according to the historical load data set and the label load data set to obtain a power load prediction model.
[0130] In an exemplary embodiment, the above-mentioned training unit is also used to input historical load characteristics that match the historical load data set into the initial load prediction model, wherein the initial load prediction model includes multiple interconnected multi-head attention modules, and the multi-head attention modules are used to extract the attention weights between the characteristic elements in the historical load characteristics; obtain the reference load prediction result output by the initial load prediction model that matches the fourth period; determine the current training loss based on the reference load prediction result and the labeled load data set; when the current training loss meets the convergence condition, determine the initial load prediction model as the power load prediction model.
[0131] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0132] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:
[0133] S1, obtaining a power load data set matching a first cycle, wherein the power load data set includes at least one power load slice data, and the power load slice data is obtained by segmenting the power load data sequence corresponding to the first cycle according to a sliding window;
[0134] S2, inputting the power load characteristics matched with the power load data set into the power load prediction model, wherein the power load prediction model includes a plurality of interconnected multi-head attention modules, and the multi-head attention modules are used to extract the attention weights between the characteristic elements in the power load characteristics;
[0135] S3, obtaining the power load forecast result output by the power load forecasting model and matching the second period, wherein the power load forecast result includes a sequence of electricity price mutation points, the sequence of electricity price mutation points includes multiple time points within the second period and electricity price mutation points respectively matching the multiple time points, and the second period is the power system operation period after the first period.
[0136] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0137] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0138] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0139] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0140] S1, obtaining a power load data set matching a first cycle, wherein the power load data set includes at least one power load slice data, and the power load slice data is obtained by segmenting the power load data sequence corresponding to the first cycle according to a sliding window;
[0141] S2, inputting the power load characteristics matched with the power load data set into the power load prediction model, wherein the power load prediction model includes a plurality of interconnected multi-head attention modules, and the multi-head attention modules are used to extract the attention weights between the characteristic elements in the power load characteristics;
[0142] S3, obtaining the power load forecast result output by the power load forecasting model and matching the second period, wherein the power load forecast result includes a sequence of electricity price mutation points, the sequence of electricity price mutation points includes multiple time points within the second period and electricity price mutation points respectively matching the multiple time points, and the second period is the power system operation period after the first period.
[0143] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0144] An embodiment of the present application further provides a computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores the computer program product, and when the computer program is executed by a processor, the steps of the method in each embodiment of the present application are implemented.
[0145] Optionally, in this embodiment, the above computer program may be configured to implement the following steps when executed by a processor:
[0146] S1, obtaining a power load data set matching a first cycle, wherein the power load data set includes at least one power load slice data, and the power load slice data is obtained by segmenting the power load data sequence corresponding to the first cycle according to a sliding window;
[0147] S2, inputting the power load characteristics matched with the power load data set into the power load prediction model, wherein the power load prediction model includes a plurality of interconnected multi-head attention modules, and the multi-head attention modules are used to extract the attention weights between the characteristic elements in the power load characteristics;
[0148] S3, obtaining the power load forecast result output by the power load forecasting model and matching the second period, wherein the power load forecast result includes a sequence of electricity price mutation points, the sequence of electricity price mutation points includes multiple time points within the second period and electricity price mutation points respectively matching the multiple time points, and the second period is the power system operation period after the first period.
[0149] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0150] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general 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 a program code executable by a computing device, so that 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 that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0151] The above are only preferred implementations of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for predicting power load, characterized in that: include: Acquire a power load data set matching the first cycle, wherein the power load data set includes at least one power load slice data, and the power load slice data is obtained by segmenting the power load data sequence corresponding to the first cycle according to a sliding window; Inputting the power load characteristics matching the power load data set into a power load prediction model, wherein the power load prediction model includes a plurality of interconnected multi-head attention modules, and the multi-head attention modules are used to extract attention weights between feature elements in the power load characteristics; Obtain an electric load forecast result output by the electric load forecasting model that matches the second period, wherein the electric load forecast result includes a sequence of electricity price mutation points, the sequence of electricity price mutation points includes multiple time points within the second period and electricity price mutation points that respectively match the multiple time points, and the second period is the electric system operation period after the first period.
2. The method according to claim 1, characterized in that After the power load characteristics matching the power load data set are input into the power load prediction model, the method further includes: Receiving, through the Nth multi-head attention module in the power load forecasting model, the N-1th intermediate feature output by the N-1th multi-head attention module, wherein N is an integer greater than or equal to 2; Obtain a query matrix, a key matrix, and a value matrix that match the intermediate features, and obtain an Nth attention weight matrix according to the query matrix, the key matrix, and the value matrix; Determine the Nth intermediate feature output by the Nth multi-head attention module according to the Nth attention weight matrix.
3. The method according to claim 2, characterized in that The obtaining the Nth attention weight matrix according to the query matrix, the key matrix and the value matrix comprises: Performing a linear transformation operation on the query matrix, the key matrix and the value matrix to obtain a query submatrix, a key submatrix and a value submatrix corresponding to each of the plurality of feature subspaces; In the plurality of feature subspaces, determining the attention weight submatrices corresponding to the plurality of feature subspaces respectively according to the query submatrix, the key submatrix and the value submatrix respectively corresponding to the plurality of feature subspaces; According to the attention weight sub-matrices corresponding to each of the plurality of feature subspaces, the Nth attention weight matrix is determined.
4. The method according to claim 2, characterized in that: Before inputting the power load characteristics matching the power load data set into the power load prediction model, the method further includes at least one of the following: Determine a first load data sub-feature according to at least one of the power load slice data included in the power load data set, wherein the power load feature includes the first load data sub-feature; According to the respective positions of the plurality of characteristic elements included in the power load characteristic, determining the position characteristic codes corresponding to the respective positions of the plurality of characteristic elements; determining the plurality of position characteristic codes as second load data sub-characteristics, wherein the power load characteristic includes the second load data sub-characteristic; Acquire holiday information matching the second cycle; determine the date feature code used to characterize the holiday information as the third load data sub-feature; Acquire a historical similar day that matches every day in the second cycle; determine the date feature code of the coal price information corresponding to the historical similar day as the fourth load data sub-feature; Acquire a historical similar day that matches each day in the second cycle; and determine the fifth load data sub-feature according to the power load feature code corresponding to the historical similar day.
5. The method according to claim 2, characterized in that: The obtaining of the electric load forecast result output by the electric load forecast model and matching the second period includes: Obtain the intermediate features output by the last multi-head attention module; Input the intermediate feature into the feedforward neural network in the power load forecasting model to obtain a nonlinear transformation result of the last intermediate feature, wherein the feedforward neural network includes a first linear change layer and a second linear change layer, the first linear change layer is used to obtain a first linear change result of a feature element in the intermediate feature, and the second linear change layer is used to obtain a second linear change result of a reference element, wherein the reference element is a larger element between the first linear change result and 0; Normalization processing is performed according to the residual connection result of the nonlinear change result, and the power load prediction result is determined according to the flattening result of the normalization processing result.
6. The method according to any one of claims 1 to 5, characterized in that Before acquiring the power load data set matching the first cycle, the method further includes: Acquire a historical load data set matching the third period, wherein the historical load data set includes at least one historical load slice data, and the historical load slice data is obtained by segmenting the power load data sequence corresponding to the third period according to a sliding window; Acquire a label load data set matching the fourth cycle, wherein the label load data set includes a historical electricity price mutation point sequence matching the fourth cycle, and the fourth cycle is a power system operation cycle after the third cycle; The initial load prediction model in a training state is trained according to the historical load data set and the label load data set to obtain the power load prediction model.
7. The method according to claim 6, characterized in that The initial load prediction model in a training state is trained according to the historical load data set and the label load data set to obtain the power load prediction model, including: Inputting the historical load features matching the historical load data set into the initial load forecasting model, wherein the initial load forecasting model includes a plurality of the multi-head attention modules connected to each other, and the multi-head attention modules are used to extract the attention weights between the feature elements in the historical load features; Obtaining a reference load forecast result output by the initial load forecast model and matching the fourth period; Determine the current training loss according to the reference load prediction result and the label load data set; When the current training loss satisfies a convergence condition, the initial load prediction model is determined as the power load prediction model.
8. A device for predicting power load, characterized in that: include: A first acquisition unit is used to acquire a power load data set matching a first cycle, wherein the power load data set includes at least one power load slice data, and the power load slice data is obtained by segmenting the power load data sequence corresponding to the first cycle according to a sliding window; An input unit, used to input the power load characteristics matching the power load data set into the power load prediction model, wherein the power load prediction model includes a plurality of interconnected multi-head attention modules, and the multi-head attention modules are used to extract the attention weights between the characteristic elements in the power load characteristics; A second acquisition unit is used to obtain the power load forecast result output by the power load forecasting model and matching the second period, wherein the power load forecast result includes a sequence of electricity price mutation points, the sequence of electricity price mutation points includes multiple time points within the second period and electricity price mutation points that respectively match the multiple time points, and the second period is the power system operation period after the first period.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method according to any one of claims 1 to 7 when executed.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.