Power load prediction method, model training method, electronic equipment and storage medium
By classifying and clustering the power load data of multiple sample station areas and adjusting the power load prediction model parameters, the problems of large consumption and low accuracy of power load prediction resources in the middle station areas in the existing technology are solved, and more efficient power is achieved Load forecast.
Patent Information
- Application Number
- CN202411160409.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-22
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2044-08-22
AI Technical Summary
In the prior art, the model and its parameters are individually trained for each station area to predict power load, resulting in huge hardware resource consumption, and using the same model for prediction of multiple similar station areas will reduce accuracy.
By obtaining sample power load data from multiple sample station areas, determining the preset sliding window and prediction step size, extracting spectrum characteristics and threshold curves, classifying and clustering, adjusting the power load prediction model parameters, reducing model training time and overhead, At the same time, improve prediction accuracy.
It effectively improves the accuracy and model performance of power load prediction, and reduces the prediction error of unpredicted power load data in the station area.
Smart Images

Figure CN119051005A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of power systems, and in particular to a power load forecasting method, a model training method, an electronic device and a storage medium. Background Art
[0002] The power supply range or area of a transformer in the power system is defined as a substation. Accurate prediction of the power load in the substation helps to predict the local operating status of the power grid in advance, so as to deal with possible regional power outages in advance. In recent years, the number of substations in the power grid has been huge. In related technologies, a model and its supporting parameters are usually trained separately for each substation to predict the power load of the substation, but this will consume huge hardware resources and limit the application value of substation load prediction. In actual scenarios, the power loads of many substations meet similar timing rules, so that substations with similar timing characteristics can use a common model to reduce hardware and time overhead. However, if there are multiple similar substations, the model and its parameters trained by the data set corresponding to one of the multiple similar substations are used to predict the power load of multiple other similar substations, which will reduce the accuracy of the substation power load prediction.
[0003] Application Contents
[0004] In view of this, the embodiments of the present application provide a power load prediction method, a model training method, an electronic device and a storage medium, which can improve the accuracy of power load prediction in a substation.
[0005] In a first aspect, an embodiment of the present application provides a method for predicting power load, comprising:
[0006] Obtaining sample power load data of multiple sample substations;
[0007] Determine a preset sliding window and a prediction step size, and obtain a plurality of sample training data and prediction label pairs corresponding to each of the sample training data according to the preset sliding window, the prediction step size and the sample power load data;
[0008] Obtaining frequency spectrum characteristics and a threshold curve of the sample training data based on the sample training data;
[0009] Obtaining a target feature sequence according to the frequency spectrum features and threshold curve of the sample training data;
[0010] Classifying each of the sample substations according to the sample power load data to obtain a plurality of first substation sets;
[0011] Clustering the sample stations in the first station area set according to the target feature sequence to obtain a plurality of second station area sets;
[0012] Determine the number of label pairs of the predicted label pairs corresponding to all the sample substations in the second substation set, and adjust the parameters of the power load prediction model according to the predicted label pairs corresponding to each of the sample substations in the second substation set and the number of label pairs;
[0013] The power load data to be predicted of the target substation is obtained, and the power load data to be predicted is input into the power load prediction model after adjusting the parameters to obtain the load prediction data of the target substation.
[0014] In an optional implementation, obtaining a target feature sequence according to the spectrum features and the threshold curve of the sample training data includes:
[0015] Screening the frequency spectrum characteristics of the sample training data based on the threshold curve to obtain a base frequency characteristic;
[0016] Perform an inverse Fourier transform on the base frequency features to obtain a target feature sequence.
[0017] In an optional implementation, obtaining the frequency spectrum characteristics and threshold curve of the sample training data based on the sample training data includes:
[0018] Performing discrete Fourier transform on each of the sample training data to obtain frequency spectrum features of each of the sample training data;
[0019] Calculating the maximum amplitude of each of the spectral features;
[0020] A threshold curve is generated based on all of the maximum amplitudes.
[0021] In an optional implementation, clustering the sample stations in the first station area set according to the target feature sequence to obtain a plurality of second station area sets includes:
[0022] According to the target feature sequences corresponding to the sample stations in the first station area set, similarities between different sample stations in the first station area set are calculated to obtain a similarity matrix;
[0023] Obtaining a Laplacian matrix according to the similarity matrix;
[0024] Performing eigendecomposition on the Laplace matrix to obtain a plurality of eigenvectors;
[0025] Obtaining a preset number of target eigenvectors from the multiple eigenvectors to obtain an eigenvector matrix;
[0026] The characteristic vector matrix is clustered based on the K-means algorithm to obtain multiple second station area sets.
[0027] In an optional implementation manner, the classifying each of the sample substations according to the sample power load data to obtain a plurality of first substation sets includes:
[0028] Calculate the load fluctuation range corresponding to the sample area according to the sample power load data;
[0029] The sample stations are classified according to the load fluctuation range to obtain a plurality of first station sets.
[0030] In an optional implementation, adjusting the parameters of the power load prediction model according to the prediction label pairs corresponding to each of the sample substations in the second substation set and the number of the label pairs includes:
[0031] Determine a first loss value of the power load prediction model according to the predicted label pairs corresponding to each of the sample substations in the second substation set and the number of the label pairs;
[0032] According to the first loss value, the parameters of the power load prediction model are adjusted.
[0033] In an optional embodiment, the method further includes:
[0034] Saving the parameters of the power load forecasting model after each adjustment;
[0035] Calculating a regularization term according to the previously adjusted parameters of the power load forecasting model and the currently adjusted parameters of the power load forecasting model;
[0036] Obtaining a second loss value according to the regularization term and the first loss value;
[0037] The parameters of the power load prediction model are adjusted according to the second loss value.
[0038] In a second aspect, an embodiment of the present application provides a model training method, comprising:
[0039] Obtaining sample power load data of multiple sample substations;
[0040] Determine a preset sliding window and a prediction step size, and obtain a plurality of sample training data and prediction label pairs corresponding to each of the sample training data according to the preset sliding window, the prediction step size and the sample power load data;
[0041] Obtaining frequency spectrum characteristics and a threshold curve of the sample training data based on the sample training data;
[0042] Obtaining a target feature sequence according to the frequency spectrum features and threshold curve of the sample training data;
[0043] Classifying each of the sample substations according to the sample power load data to obtain a plurality of first substation sets;
[0044] Clustering the sample stations in the first station area set according to the target feature sequence to obtain a plurality of second station area sets;
[0045] The number of label pairs of the predicted label pairs corresponding to all the sample substations in the second substation set is determined, and the parameters of the power load prediction model are adjusted according to the predicted label pairs corresponding to each of the sample substations in the second substation set and the number of label pairs.
[0046] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the power load prediction method or model training method as described above is implemented.
[0047] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the power load forecasting method or model training method as described above.
[0048] The embodiments of the present application include at least the following beneficial effects: by acquiring sample power load data of multiple sample substations, determining a preset sliding window and a prediction step size, and obtaining multiple sample training data and prediction label pairs corresponding to each sample training data according to the preset sliding window, the prediction step size and the sample power load data, it is possible to prepare for the subsequent adjustment of model parameters; then, based on the sample training data, the frequency spectrum characteristics and threshold curves of the sample training data are obtained, and according to the frequency spectrum characteristics and threshold curves of the sample training data, the target feature sequence is obtained, and the important frequency components of the power load data can be efficiently extracted; then, each sample substation is classified according to the sample power load data to obtain multiple first substations; Area set, and cluster the sample areas in the first area set according to the target feature sequence to obtain multiple second area sets, which can classify areas with similar load characteristics into the same category; then by determining the number of label pairs corresponding to all sample areas in the second area set, according to the predicted label pairs and the number of label pairs corresponding to each sample area in the second area set, the parameters of the power load prediction model are adjusted, and the parameters of the power load prediction model can be adjusted based on the areas of the same category, reducing the time and cost of model training, and at the same time, it can also improve the training effect of the power load prediction model, improve the effect of reinforcement learning, and further improve the model performance of the power load prediction model. When the power load prediction model is used to predict the load of the target area in the future, even the power load data of the area that has not been predicted can effectively improve the prediction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] The drawings constituting part of the present application are used to provide a further understanding of the present application. The exemplary embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0050] Figure 1 A flow chart of a method for predicting power load provided in one embodiment of the present application;
[0051] Figure 2 A flowchart of a power load forecasting method provided in another embodiment of the present application;
[0052] Figure 3 A flowchart of a power load forecasting method provided in another embodiment of the present application;
[0053] Figure 4 A flowchart of a power load forecasting method provided in another embodiment of the present application;
[0054] Figure 5 A flowchart of a power load forecasting method provided in another embodiment of the present application;
[0055] Figure 6 A flowchart of a power load forecasting method provided in another embodiment of the present application;
[0056] Figure 7 A target feature sequence diagram corresponding to sample power load data provided in one embodiment of the present application;
[0057] Figure 8 An original characteristic sequence diagram corresponding to the sample power load data provided in one embodiment of the present application;
[0058] Fig. 9 A residual sequence diagram corresponding to sample power load data provided in one embodiment of the present application;
[0059] Fig.10 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0060] The present application will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.
[0061] The following detailed descriptions are all exemplary descriptions, and are intended to provide further detailed descriptions of the present application. Unless otherwise specified, all technical terms used in the present application have the same meanings as those generally understood by those skilled in the art to which the present application belongs. The terms used in the present application are only for describing specific embodiments, and are not intended to limit the exemplary embodiments according to the present application.
[0062] It should be understood that in the description of the embodiments of the present application, if there is a description of "first", "second", etc., it is only used for the purpose of distinguishing technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features or implicitly indicating the order of the indicated technical features. "At least one" means one or more, "more than" means more than two, greater than, less than, exceeding, etc. are understood to not include the number itself, above, below, within, etc. are understood to include the number itself, and "several" means one or more, unless otherwise clearly and specifically limited. "And / or" describes the association relationship of associated objects, indicating that three relationships can exist. It can be understood that A and / or B can represent the situation where A exists alone, A and B exist at the same time, or B exists alone. Among them, A and B can be singular or plural.
[0063] It is worth noting that the transformer is responsible for realizing multiple tasks such as voltage conversion, power distribution, and electrical isolation in the power system, providing important guarantees for the safe operation of the power system. The power supply range or area of a transformer in the power system is defined as a substation. Accurate prediction of the power load in the substation helps to predict the local operation status of the power grid in advance, so as to deal with possible regional power outages in advance. In recent years, the number of substations in the power grid has been huge. In related technologies, a model and its supporting parameters are usually trained separately for each substation to predict the power load of the substation, but this will consume huge hardware resources and limit the application value of substation load prediction. In actual scenarios, the power loads of many substations meet similar time series rules, so that substations with similar time series characteristics can use a common model to reduce hardware and time overhead. However, if multiple similar substations use the model and its parameters trained by the data set corresponding to one of the multiple similar substations to predict the power load of multiple other similar substations, the accuracy of the power load prediction of the substation will be reduced.
[0064] Based on this, the present application provides a power load prediction method, a model training method, an electronic device and a storage medium, which obtains sample power load data of multiple sample substations, determines a preset sliding window and a prediction step, and obtains multiple sample training data and prediction label pairs corresponding to each sample training data based on the preset sliding window, the prediction step and the sample power load data, so as to prepare for the subsequent adjustment of the model parameters; then, based on the sample training data, the frequency spectrum characteristics and threshold curves of the sample training data are obtained, and according to the frequency spectrum characteristics and threshold curves of the sample training data, the target feature sequence is obtained, so that the important frequency components of the power load data can be efficiently extracted; then, each sample substation is trained according to the sample power load data. By performing row classification to obtain multiple first substation sets, and clustering the sample substations in the first substation set according to the target feature sequence to obtain multiple second substation sets, substations with similar load characteristics can be classified into the same category; then by determining the number of label pairs corresponding to all sample substations in the second substation set, the parameters of the power load prediction model are adjusted according to the predicted label pairs and the number of label pairs corresponding to each sample substation in the second substation set, and the parameters of the power load prediction model can be adjusted based on substations of the same category, reducing the time and cost of model training, and at the same time, it can also improve the training effect of the power load prediction model and the effect of reinforcement learning, thereby further improving the model performance of the power load prediction model. When the power load prediction model is used to predict the load of the target substation in the future, even the power load data of the substation that has not been predicted can effectively improve the prediction accuracy.
[0065] The embodiments of the present application are further described below in conjunction with the accompanying drawings.
[0066] like Figure 1 As shown, the embodiment of the present application provides a method for predicting power load, which includes but is not limited to steps S110 to S180:
[0067] Step S110: Obtain sample power load data of a plurality of sample substations.
[0068] The sample power load data may be obtained from power companies, energy management departments or existing open data sets, without any specific restrictions.
[0069] Step S120: determine a preset sliding window and a prediction step size, and obtain a plurality of sample training data and prediction label pairs corresponding to each sample training data according to the preset sliding window, the prediction step size and the sample power load data.
[0070] Among them, after obtaining the sample power load data, the sample power load data can be processed. Specifically, the sample power load data can be preprocessed, that is, to check whether there are missing values, outliers or noise in the sample power load data. If there are, the sample power load data can be cleaned and processed; then, the preprocessed sample power load data can be integrated, that is, the sample power load data of each sample area can be integrated into a unified data set. A table can be used, in which each column represents a sample area, each row represents a timestamp, and the sample power load data of each sample area at that time point is recorded; then, the integrated sample power load data is stored, that is, the integrated data set is saved in a suitable data storage medium, such as a CSV file, a database, etc., for subsequent analysis and processing; then, the integrated sample power load data can be verified, that is, the integrity and accuracy of the integrated data set can be verified, for example, visualization tools or statistical analysis can be used to check whether the data set meets the expected format and content; finally, the data is documented, that is, a document is written to record the source of the data set, the meaning of the field, the time range of data collection, and other information for subsequent use and sharing. Through the above steps, the sample power load data of each sample substation can be integrated into a unified data set to prepare for subsequent analysis and modeling work.
[0071] The size of the preset sliding window determines the number of data points contained in each preset sliding window. The selection of the preset sliding window size can be determined according to specific circumstances and requirements. Common choices include different time granularities such as hours, days, and weeks.
[0072] The preset step size is the number of data points that the preset sliding window moves forward each time. The choice of the preset step size can affect the number and overlap of the generated prediction label pairs, and needs to be adjusted according to the specific situation. Among them, the prediction label pair includes the sample training data and the prediction label corresponding to the sample training data.
[0073] According to the preset sliding window, prediction step and sample power load data, multiple sample training data and prediction label pairs corresponding to each sample training data are obtained. Specifically, for each sample power load data (or data set), the preset sliding window is slid from the starting position, and the data points of the preset step length are moved forward each time. In each preset sliding window, the continuous data points are a sample training data. For the data in each preset sliding window (i.e., sample training data), it is necessary to define a prediction label, which can be defined according to a specific task, such as predicting the power load in the next time period. In time series prediction, a common method is to use a lag value as a prediction label and generate a prediction label pair through sample training data and prediction labels. By analogy, the sample power load data is traversed through the preset sliding window and the preset step until the entire sample power load data is traversed, and multiple sample training data and prediction label pairs corresponding to each sample training data are obtained. Finally, the generated multiple sample training data and the prediction label pairs corresponding to each sample training data can be stored to form a training set. Through the above steps, a prediction label pair can be constructed for each data set according to the preset sliding window, so as to prepare for the subsequent time series prediction modeling work.
[0074] Step S130: obtaining the frequency spectrum characteristics and threshold curve of the sample training data based on the sample training data.
[0075] The spectrum characteristics and threshold curve of the sample training data are obtained based on the sample training data. Specifically, the spectrum characteristics of each sample training data are obtained by performing discrete Fourier transform on each sample training data, and then the maximum amplitude of each spectrum characteristic is calculated, and finally the threshold curve is generated according to all the maximum amplitudes. The discrete Fourier transform can be a fast Fourier transform. By performing fast Fourier transform on each sample training data, the complexity of calculation can be reduced.
[0076] Exemplarily, for sample training data (i.e., discrete sequence x(n)) within a given preset sliding window, its spectral features can be obtained by performing discrete Fourier transform (DFT) on each sample training data, wherein the discrete Fourier transform is defined as follows:
[0077]
[0078] Where N is the length of the sequence, x(n) is the value of the nth sampling point of the sequence in the time domain, k is the frequency index, and X(k) is the amplitude and phase of the kth frequency component in the frequency domain. In discrete Fourier transform, the spectral features mainly refer to the amplitude of the frequency components. After performing discrete Fourier transform on each sample training data, the amplitude of the frequency components is usually analyzed to determine which frequency components are the main features.
[0079] Next, for each spectral feature sequence X(k), determine the maximum amplitude value |X max |, that is, find the maximum amplitude in the spectrum and collect all the maximum amplitudes |X max |, the maximum amplitude corresponding to each sample training data |X max |Record it, and then construct the threshold curve. For example, you can take the average or median of all maximum amplitudes as the threshold curve∈, as shown in the following formula:
[0080] ∈=Mean(|X max |) or ∈=Median(|X max |)
[0081] Alternatively, a suitable threshold curve is determined based on the distribution characteristics of the maximum amplitude, which is not specifically limited here. It can be understood that the threshold curve is used as a reference for selecting a target feature sequence from the spectrum features, that is, it is used to determine which frequency components in the spectrum features are the main features. Generally, the frequency components exceeding the threshold are considered important and can be retained as the main features.
[0082] Step S140: Obtain a target feature sequence according to the frequency spectrum features and threshold curve of the sample training data.
[0083] The target feature sequence is the important frequency components retained in the spectral features of the sample training data.
[0084] Step S150: Classify each sample substation according to the sample power load data to obtain a plurality of first substation sets.
[0085] Among them, different first substation sets correspond to different classification categories. It can be understood that by classifying multiple sample substations, the parameters of the power load prediction model can be adjusted based on each first substation set, thereby reducing the number of samples for single training of the power load prediction model, improving the efficiency of model training, and reducing the cost of model training.
[0086] Step S160: clustering the sample stations in the first station area set according to the target feature sequence to obtain a plurality of second station area sets.
[0087] Exemplarily, it is assumed that there are two first station area sets, namely the first station area set A and the first station area set B, wherein the first station area set A includes sample station area a1, sample station area a2 and sample station area a3, and the first station area set B includes sample station area b1, sample station area b2 and sample station area b3. According to the target feature sequence corresponding to the sample stations in the first station area set A, the sample stations in the first station area set A are clustered to obtain the second station area set A1 and the second station area set A2, wherein the second station area set A1 includes the sample station area a1 and the sample station area a3, and the second station area set A2 includes the sample station area a2. Similarly, all the sample stations in the first station area set B are clustered to obtain the second station area set B1, wherein the second station area set B1 includes the sample station area b1, the sample station area b2 and the sample station area b3. By clustering the sample stations in the first station area set through the target feature sequence, stations with similar load characteristics can be classified into the same category, providing a basis for subsequent analysis and modeling work.
[0088] Step S170: Determine the number of predicted label pairs corresponding to all sample substations in the second substation set, and adjust the parameters of the power load prediction model according to the predicted label pairs and the number of label pairs corresponding to each sample substation in the second substation set.
[0089] Among them, the power load forecasting model can be a power load forecasting model based on a long short-term memory network (Long Short-Term Memory, LSTM). LSTM is a special recurrent neural network (Recurrent Neural Network, RNN), which is good at processing and predicting sequence data. It can capture dependencies in long time series and is suitable for predicting time series data such as power load. Specifically, the power load forecasting model may include an input layer, an LSTM layer and an output layer. The LSTM layer may include two LSTM layers to achieve effective processing and learning of sequence data, and the output layer is a fully connected layer.
[0090] Exemplarily, assuming that the second station area set includes sample station area a and sample station area b, where sample station area a corresponds to 4 predicted label pairs and sample station area b corresponds to 3 predicted label pairs, then the number of label pairs corresponding to the second station area set is 7.
[0091] Step S180: obtaining the power load data to be predicted of the target substation, inputting the power load data to be predicted into the power load prediction model after adjusting the parameters, and obtaining the load prediction data of the target substation.
[0092] After obtaining the power load data to be predicted, the power load data to be predicted may be processed. For details, reference may be made to the above-mentioned processing method of the sample power load data, which will not be described in detail here.
[0093] For example, the power load data to be predicted is the power load data of the past three time steps, and the output is the load prediction data for the next time step.
[0094] In an embodiment of the present application, by acquiring sample power load data of multiple sample substations, determining a preset sliding window and a prediction step size, and obtaining multiple sample training data and prediction label pairs corresponding to each sample training data based on the preset sliding window, the prediction step size, and the sample power load data, preparation can be made for subsequent adjustment of model parameters; then, based on the sample training data, the frequency spectrum characteristics and threshold curves of the sample training data are obtained, and based on the frequency spectrum characteristics and threshold curves of the sample training data, a target feature sequence is obtained, which can efficiently extract important frequency components of the power load data; then, each sample substation is classified according to the sample power load data to obtain multiple first substation sets, And clustering the sample substations in the first substation set according to the target feature sequence to obtain multiple second substation sets, which can classify substations with similar load characteristics into the same category; then by determining the number of label pairs corresponding to all sample substations in the second substation set, adjusting the parameters of the power load prediction model according to the predicted label pairs and the number of label pairs corresponding to each sample substation in the second substation set, the parameters of the power load prediction model can be adjusted based on the substations of the same category, reducing the time and cost of model training, and at the same time, it can also improve the training effect of the power load prediction model and the effect of reinforcement learning, thereby further improving the model performance of the power load prediction model. When the power load prediction model is used to predict the load of the target substation in the future, even the power load data of the substation that has not been predicted can effectively improve the prediction accuracy.
[0095] In one embodiment, Figure 2 As shown, step S140 is further described, and step S140 may include but is not limited to step S210 and step S220.
[0096] Step S210: Screening the frequency spectrum features of the sample training data based on the threshold curve to obtain the base frequency features.
[0097] Among them, the base frequency feature is the main feature that appears more than a preset number of times in the spectrum feature. The preset number can be set according to the actual situation. The main feature of the spectrum feature can refer to the amplitude of the frequency component. By analyzing the amplitude of the spectrum feature, it is determined which spectrum features are the main features. Specifically, the importance of the spectrum feature can be judged according to the amplitude of the spectrum feature. Generally speaking, the spectrum feature with a larger amplitude represents the main frequency component in the signal. Therefore, when analyzing the spectrum feature, the amplitude of the frequency component will be paid attention to, and the frequency components will be determined according to its size.
[0098] Specifically, the spectrum characteristics of the sample training data are screened based on the threshold curve to obtain the base frequency characteristics. Specifically, the amplitude of the spectrum characteristics of each sample training data is calculated, and the amplitude of the spectrum characteristics of each sample training data is compared with the threshold curve. If the amplitude of the spectrum characteristics of the sample training data exceeds the threshold curve, the corresponding spectrum characteristics are considered to be the main characteristics. On the contrary, if the amplitude of the spectrum characteristics of the sample training data is lower than the threshold curve, the corresponding spectrum characteristics can be regarded as noise or secondary characteristics. In this way, by comparing the threshold curve with the spectrum characteristics, it is possible to determine which spectrum characteristics are the main characteristics, thereby performing feature extraction and dimensionality reduction processing on each sample training data in the sample power load data. Next, the number of occurrences of each main feature is counted, and the main frequency whose number of occurrences is greater than or equal to the preset number is selected as the base frequency feature, and the remaining frequency features are removed, such as setting the remaining frequency features to zero.
[0099] Step S220: Perform inverse Fourier transform on the base frequency features to obtain a target feature sequence.
[0100] Among them, the base frequency feature is subjected to an inverse Fourier transform to obtain a target feature sequence, which can be specifically performed by performing an inverse discrete Fourier transform (IDFT) on the base frequency feature to obtain a target feature sequence. The target feature sequence is the important frequency component to be retained. Specifically, the target feature sequence can be calculated by the following formula, namely:
[0101] Target feature sequence = IDFT(threshold processing(X(k)))
[0102] Wherein, IDFT represents inverse discrete Fourier transform, X(k) represents the frequency spectrum characteristics of sample training data, and the threshold processing is specifically referred to step S210, which will not be described in detail here.
[0103] It is understandable that the Fourier transform provides a tool for converting a time domain signal into a frequency domain representation. In an embodiment of the present application, by applying a discrete Fourier transform within a preset sliding window, the spectral characteristics of the signal can be obtained. The method of decomposing these spectral feature sequences into a target feature sequence and a residual sequence (i.e., the remaining feature sequences except the target feature sequence) is implemented by threshold processing and inverse Fourier transform. This decomposition method can help extract important frequency components in the signal and provide information on the low-frequency and high-frequency parts of the signal.
[0104] In one embodiment, Figure 3 As shown, step S160 is further explained, and step S160 may include but is not limited to steps S310 to S350.
[0105] Step S310: Calculate similarities between different sample stations in the first station area set according to target feature sequences corresponding to the sample stations in the first station area set to obtain a similarity matrix.
[0106] The similarity matrix represents the similarity between the target feature sequences of each sample area in the first area set. The similarity measurement method may include Euclidean distance, Gaussian kernel function, etc., which are not specifically limited here. For example, taking Gaussian kernel function as an example, assuming that the target feature sequence of sample area i at time t is p i (t), the target feature sequence of sample station j at time t is p j (t), then the similarity W between sample area i and sample area j is ij The specific details are shown in the following formula:
[0107]
[0108] Among them, ||p i -p j || means p i (t) and p j (t), σ is the Euclidean distance between them.
[0109] Step S320: Obtain a Laplacian matrix according to the similarity matrix.
[0110] Specifically, the sum of similarities between each station area and other stations is calculated according to the similarity matrix to obtain a degree matrix, and then the adjacency matrix is obtained according to the similarity matrix, and the Laplace matrix is obtained by subtracting the adjacency matrix from the degree matrix. Among them, the degree matrix is a diagonal matrix formed by the sum of each row element of the similarity matrix.
[0111] For example, assuming that the similarity matrix is W, the adjacency matrix A can be obtained by the following formula, namely:
[0112]
[0113] Next, the sum of the similarities between each station area and other stations is calculated according to the similarity matrix to obtain the degree matrix D. Then the Laplace matrix L can be obtained by the following formula, namely:
[0114] L=DA
[0115] Among them, the Laplace matrix L is used for the graph representation of spectral clustering.
[0116] It can be understood that in step S310 and step S320, the features required for spectral clustering are constructed through the target feature sequence of each sample station area. These features include similarity matrix and Laplace matrix, which provide a basis for the subsequent spectral clustering algorithm.
[0117] Step S330: performing eigendecomposition on the Laplace matrix to obtain a plurality of eigenvectors.
[0118] Step S340: obtaining a preset number of target feature vectors from the multiple feature vectors to obtain a feature vector matrix.
[0119] The preset number may be 2, 4, 5 or more, which may be determined according to actual conditions. Assuming that the preset number is k, a preset number of target feature vectors are obtained from multiple feature vectors, specifically, the eigenvalues corresponding to the feature vectors are determined, and the feature vectors are sorted according to the values of the eigenvalues, and the eigenvectors corresponding to the first k smallest eigenvalues (i.e., target eigenvectors) are obtained from the multiple eigenvectors to obtain the eigenvector matrix.
[0120] Step S350: clustering the feature vector matrix based on the K-means algorithm to obtain multiple second station area sets.
[0121] Each first station area set corresponds to a number of second station area sets.
[0122] Specifically, the feature vector matrix can be used as input and clustered using a K-means algorithm to obtain multiple second station area sets.
[0123] Exemplarily, the Laplace matrix L is subjected to eigendecomposition to obtain the eigenvalue λ i and the corresponding eigenvector v i ,Right now:
[0124] Lv i =λ i v i
[0125] Next, select the eigenvectors corresponding to the first k smallest eigenvalues to form the eigenvector matrix U. Each row of the eigenvector matrix U represents a data point in the low-dimensional space as follows:
[0126] U=[v1,v2,...,v k ]
[0127] Then, each row of the eigenvector matrix U is regarded as a data point, and K-means clustering is performed in the k-dimensional space to obtain multiple second station area sets, where different second station area sets have different categories, and each second station area set can correspond to a cluster label for identifying the cluster category to which the second station area set belongs.
[0128] In an embodiment of the present application, a spectral clustering algorithm is used to cluster different sample substations in the first substation set according to a similarity matrix and a Laplace matrix, that is, clustering is performed through the decomposition of eigenvectors and the K-means algorithm, and ultimately substations with similar load characteristics are classified into the same category, providing a basis for subsequent analysis and modeling work.
[0129] In one embodiment, Figure 4 As shown, step S150 is further explained, and step S150 may include but is not limited to steps S410 to S420.
[0130] Step S410: Calculate the load fluctuation range corresponding to the sample substation according to the sample power load data.
[0131] The load fluctuation range can be expressed by statistics such as the standard deviation, variance, and the difference between the maximum and minimum values (i.e., the range) of the sample power load data.
[0132] For example, suppose the sample power load data of the sample area is Then the maximum sample power load data and the minimum sample power load data can be determined from all the sample power load data, and the load fluctuation range corresponding to the sample area can be obtained by subtracting the minimum sample power load data from the maximum sample power load data, that is:
[0133] Range=max(x t )-min(x t )
[0134] Among them, Range represents the load fluctuation range, max(x t ) represents the maximum sample power load data, min(x t ) represents the minimum sample power load data.
[0135] For another example, the load fluctuation range corresponding to the sample area can be obtained by calculating the standard deviation of the sample power load data of the sample area, that is:
[0136]
[0137] Where, σ is the load fluctuation range, is the average value of the sample power load data, T is the number of sample power load data, x t Represents the tth sample power load data.
[0138] Step S420: Classify each sample substation according to the load fluctuation range to obtain multiple first substation sets.
[0139] Specifically, the classification threshold can be determined according to the load fluctuation range of the sample area, and each sample area can be classified according to the classification threshold. The classification threshold can be set according to the distribution of the load fluctuation range, for example, multiple classification thresholds are set according to the quartile distribution to divide the sample area into different load fluctuation range categories.
[0140] It can be understood that different first station area sets represent different load fluctuation ranges.
[0141] For example, assuming that the load fluctuation range of the sample substation is expressed by the range or standard deviation, the sample substations with a range or standard deviation below the classification threshold can be classified as "low fluctuation", the sample substations with a range or standard deviation above the classification threshold can be classified as "high fluctuation", and so on.
[0142] In an embodiment of the present application, by calculating the load fluctuation range corresponding to the sample substation based on the sample power load data, each sample substation can be classified according to the load fluctuation range to obtain multiple first substation sets, thereby reducing the number of samples for a single training of the power load prediction model, improving the efficiency of model training, and reducing the cost of model training.
[0143] In one embodiment, Figure 5 As shown, step S170 is further explained, and step S170 may include but is not limited to steps S510 to S520.
[0144] Step S510: Determine a first loss value of the power load prediction model according to the prediction label pairs and the number of label pairs corresponding to each sample substation in the second substation set.
[0145] For example, assuming that D (t) represents the training data of the t-th task (i.e., the t-th adjustment of the power load forecasting model parameters), i.e., the predicted label pair corresponding to the sample area in the t-th second area set, D (t) Specifically, it can be expressed as:
[0146]
[0147] Among them, N t is the number of predicted label pairs corresponding to all sample areas in the t-th second area set, represents the i-th predicted label pair corresponding to the t-th second station set, represents the i-th sample training data corresponding to the t-th second station area set, Represents the i-th predicted label corresponding to the t-th second station area set.
[0148] Furthermore, if the current task is t, the corresponding power load forecasting model is f t, then the first loss value can be calculated by the following formula:
[0149]
[0150] Among them, L t (f t ;D (t) ) is the first loss value, N t is the total number of predicted label pairs corresponding to the t-th task, represents the i-th sample training data corresponding to the t-th task, represents the i-th predicted label corresponding to the t-th task. t (; ) can be the mean square error (MSE) or a loss function, which is not specifically limited here.
[0151] Step S520: adjusting the parameters of the power load prediction model according to the first loss value.
[0152] It can be understood that the second substation set in step S510 is the substation set used by the current training power load forecasting model. Since there are multiple second substation sets, each second substation set can train the power load forecasting model in turn, that is, each second substation set can repeat steps S510 and S520 to adjust the model parameters of the power load forecasting model.
[0153] In an embodiment of the present application, by adjusting the parameters of the power load prediction model according to the predicted label pairs and the number of label pairs corresponding to each sample substation in the second substation set, the parameters of the power load prediction model can be adjusted based on substations of the same category, thereby reducing the time and overhead of model training. At the same time, it can also improve the training effect of the power load prediction model and the effect of reinforcement learning, thereby further improving the accuracy of the power load prediction model in predicting power loads.
[0154] In one embodiment, the power load prediction method further includes steps S610 to S640.
[0155] Step S610: saving the parameters of the power load forecasting model after each adjustment.
[0156] Step S620: Calculate the regularization term according to the parameters of the previously adjusted power load forecasting model and the parameters of the currently adjusted power load forecasting model.
[0157] It should be noted that the parameters after the power load forecasting model is adjusted before are all the model parameters after the power load forecasting model is adjusted before.
[0158] In order to retain the knowledge of the previous task (i.e., the parameters of the power load forecasting model after the previous adjustment), a regularization term can be introduced to align the model parameters of the new task (i.e., the parameters of the current adjusted power load forecasting model) with the model parameters of the old task (i.e., the parameters of the power load forecasting model after the previous adjustment). The difference between the new and old model parameters is measured by the regularization term. The old task can use the power load data of the past year to train the power load forecasting model, and the new task can introduce new power load data every month to fine-tune the power load forecasting model. For example, the latest power load data is obtained every month to update the model. Specifically, the regularization term is usually expressed using the Euclidean distance, that is:
[0159]
[0160] Among them, R(f t , f k ) is the regularization term, f t is the currently adjusted power load forecasting model, f k is the previously adjusted power load forecasting model, θ t f t The parameter vector, θ k represents f k It can be understood that after the model training is completed, we will adjust the parameters f of the power load forecasting model before t The knowledge of is integrated into the knowledge base, which can be done by directly storing the model parameters θ t Or extract specific features or representations.
[0161] Step S630: Obtain a second loss value according to the regularization term and the first loss value.
[0162] In this step, by obtaining the second loss value based on the regularization term and the first loss value, it is possible to retain the knowledge of the previous task while minimizing the loss of the current task.
[0163] Specifically, assuming that the previously adjusted power load forecasting model is The second loss value can be calculated by the following formula:
[0164]
[0165] in, is the second loss value; λ is a hyperparameter that weighs the loss of the current adjustment of the power load forecasting model (i.e., the first loss value) and the knowledge retention (i.e., the parameters after the previous adjustment of the power load forecasting model); L t (f t ;D (t) ) is the first loss value; R(f t , fk ) is the regularization term; D (t) Represents the training data of the t-th task (i.e., the t-th adjustment of the power load forecasting model parameters), that is, the prediction label pairs corresponding to all sample substations in the t-th second substation set.
[0166] Step S640: adjusting the parameters of the power load prediction model according to the second loss value.
[0167] In an embodiment of the present application, the knowledge of the new task is integrated into the knowledge base by saving the parameters of the power load forecasting model after each adjustment, and then the regularization term is calculated based on the parameters of the power load forecasting model after the previous adjustment and the parameters of the current adjusted power load forecasting model to avoid catastrophic forgetting of the model; then the second loss value is obtained based on the regularization term and the first loss value, and the parameters of the power load forecasting model are adjusted according to the second loss value, which can not only maintain and utilize the previously learned knowledge, thereby maintaining the performance of the old tasks and thus maintaining the stability of the power load forecasting model, but also enable the power load forecasting model to continuously learn and adapt to new data, continuously optimize the performance of the power load forecasting model, and improve the training effect of the power load forecasting model.
[0168] like Figure 6 As shown, the embodiment of the present application provides a model training method, which includes but is not limited to steps S710 to S770:
[0169] Step S710: Acquire sample power load data of multiple sample areas;
[0170] Step S720: determining a preset sliding window and a prediction step size, and obtaining a plurality of sample training data and a prediction label pair corresponding to each sample training data according to the preset sliding window, the prediction step size and the sample power load data;
[0171] Step S730: obtaining the frequency spectrum characteristics and threshold curve of the sample training data based on the sample training data;
[0172] Step S740: Obtaining a target feature sequence according to the spectrum features and threshold curve of the sample training data;
[0173] Step S750: classifying each sample area according to the sample power load data to obtain a plurality of first area sets;
[0174] Step S760: clustering the sample stations in the first station area set according to the target feature sequence to obtain a plurality of second station area sets;
[0175] Step S770: Determine the number of predicted label pairs corresponding to all sample substations in the second substation set, and adjust the parameters of the power load prediction model according to the predicted label pairs and the number of label pairs corresponding to each sample substation in the second substation set.
[0176] The principles of step 710 to step 770 can be found in the previous explanation and will not be repeated here.
[0177] In an embodiment of the present application, by acquiring sample power load data of multiple sample substations, determining a preset sliding window and a prediction step size, and obtaining multiple sample training data and prediction label pairs corresponding to each sample training data based on the preset sliding window, the prediction step size, and the sample power load data, preparation can be made for subsequent adjustment of model parameters; then, based on the sample training data, the frequency spectrum characteristics and threshold curves of the sample training data are obtained, and based on the frequency spectrum characteristics and threshold curves of the sample training data, a target feature sequence is obtained, which can efficiently extract important frequency components of the power load data; then, each sample substation is classified according to the sample power load data to obtain multiple first substation sets, And clustering the sample substations in the first substation set according to the target feature sequence to obtain multiple second substation sets, which can classify substations with similar load characteristics into the same category; then by determining the number of label pairs of the predicted label pairs corresponding to all sample substations in the second substation set, adjusting the parameters of the power load prediction model according to the predicted label pairs and the number of label pairs corresponding to each sample substation in the second substation set, the parameters of the power load prediction model can be adjusted based on substations of the same category, reducing the time and cost of model training, and at the same time improving the training effect of the power load prediction model and the effect of reinforcement learning, thereby further improving the model performance of the power load prediction model.
[0178] The process of the model training method provided in the embodiment of the present application is described in detail below.
[0179] First, collect the sample power load data of each sample area and construct them into data sets. The data sets corresponding to the sample power load data are shown in Table 1. Table 1 constructs an Electricity data set, the first column is the timestamp data, the second column to the last column are the sample areas numbered from 1, and each column is the sample power load data of a sample area. It can be understood that there will be a lot of actual area power load data, and this is just an example.
[0180] Table 1
[0181] date Sample area 1 Sample area 2 Sample area 3 Sample area 4 ... 2016-07-01 02:00:00 14 89 78 74 ... 2016-07-01 03:00:00 25 78 85 10 ... 2016-07-01 04:00:00 45 13 52 52 ... ... ... ... ... ... ...
[0182] Then, a prediction label pair is constructed based on the data set using a preset sliding window and a preset step size. First, the time series data (i.e., sample power load data) is sliced into an input window (i.e., sample training data) and a corresponding output (i.e., prediction label). The function constructed in the actual operation includes two parameters, namely, a preset sliding window and a preset step size. Assuming that the value of the preset sliding window is set to 3, this means that 3 consecutive sample power load values are required to predict the next load value, and the preset step size is 1, then 7 sliding windows can be obtained. Taking the sample power compliance data of sample substation 1 as an example, assuming that the sample power compliance data of sample substation 1 is [100, 102, 101, 98, 100, 105, 110, 115, 120, 125], the sample training data (i.e., input (X)) and prediction label (i.e., output (Y)) in the sliding window corresponding to sample substation 1 are as follows:
[0183] Sliding window 1:
[0184] Input(X): [100, 102, 101], Output(Y): 98;
[0185] Sliding window 2:
[0186] Input(X): [102, 101, 98], Output(Y): 100;
[0187] Sliding window three:
[0188] Input(X): [101, 98, 100], Output(Y): 105; ......
[0190] By analogy, the predicted label pair corresponding to sample area 1 is finally obtained as shown in Table 2.
[0191] Table 2:
[0192] X Y [100,102,101] 98 [102,101,98] 100 [101,98,100] 105 [98,100,105] 110 [100,105,110] 115 [105,110,115] 120 [110,115,120] 125
[0193] The same steps can be followed for other sample areas such as sample area 2 and sample area 3 to obtain corresponding predicted label pairs, which will not be repeated here.
[0194] Next, the Fourier transform is used to obtain the spectral characteristics of the sample training data in each sliding window, and the target feature sequence is decomposed from the original sequence based on the spectral characteristics. That is, for the data set corresponding to each sample station area, the fast Fourier transform is used to obtain the spectral characteristics of each sample training data.
[0195] Table 3
[0196] Sliding Window 1 [303,3.5,3.50] Sliding Window 2 [301,3.87,3.87] Sliding Window Three [299,1.5,1.50] Sliding Window Four [303,3.5,3.50] Sliding Window Five [315,3.87,3.87] Sliding Window 6 [325,3.5,3.50] Sliding Window Seven [333,7.5,7.50]
[0197] Specifically, for each sliding window, the sample training data (i.e., sliding window) and the corresponding FFT (i.e., fast Fourier transform) results were obtained, i.e., sliding window one is [100, 102, 101], and the corresponding FFT result is [303, 3.5, 3.5]; sliding window two is [102, 101, 98], and the corresponding FFT result is [301, 3.87, 3.87]; sliding window three is [101, 98, 100], and the corresponding FFT result is [299, 1.5, 1.5], and so on. The final spectrum feature results are shown in Table 3.
[0198] These frequency spectrum features can be used to further analyze the periodicity and frequency components of the sample power load data of the sample substation 1.
[0199] Then, the maximum amplitude corresponding to the spectral features of all sample training data in the statistical data set is counted, and the threshold curve is constructed based on this. For example, the maximum amplitude of these spectral features is taken out and then used as the threshold curve, that is, the maximum amplitude of each spectral feature is calculated, and then the threshold curve is generated based on all the maximum amplitudes, where the threshold curve is the set of all the maximum amplitudes
[0200] In the spectrum feature matrix of Table 3, each column corresponds to a spectrum feature, and each element represents the amplitude of the spectrum feature in the frequency domain. Therefore, by taking the maximum value of each column (i.e., each spectrum feature), the maximum amplitude of the spectrum feature can be obtained, and finally the threshold curve [333, 7.5, 7.5] can be obtained.
[0201] Next, for each time point, the amplitude of the spectrum feature is compared with the threshold curve. If the amplitude of the spectrum feature of the sample training data exceeds the threshold curve, the corresponding spectrum feature is considered to be the main feature, and the number of occurrences of each main feature is counted. The main frequency with a number of occurrences greater than or equal to the preset number is selected as the base frequency feature, and the remaining frequency features (i.e., residual sequence) are removed, for example, the remaining frequency features are set to zero, and finally Table 4 is obtained.
[0202] Table 4
[0203] Sliding Window 1 [0,0,0] Sliding Window 2 [0,0,0] Sliding Window Three [0,0,0] Sliding Window Four [0,0,0] Sliding Window Five [0,0,0] Sliding Window 6 [0,0,0] Sliding Window Seven [333,7.5,7.5]
[0204] Then perform inverse Fourier transform on the base frequency characteristics to obtain the target feature sequence. Assuming that the result of the target feature sequence is [47.5, 32.5, 32.5, 32.5, 32.5, 32.5, 32.5, 32.5, 47.5], then subtract it from the original feature sequence (i.e., the feature sequence of the sample power load data) to obtain the residual sequence [52.5, 69.5, 68.5, 65.5, 67.5, 72.5, 77.5, 82.5, 87.5, 77.5], where the target feature sequence is as follows: Figure 7 As shown, the original feature sequence diagram is as follows Figure 8 As shown, the residual sequence diagram is as follows Fig. 9 shown.
[0205] Then, the load fluctuation range corresponding to the sample area is calculated based on the sample power load data. For example, the sample power load data of sample area 1 is [100, 102, 101, 98, 100, 105, 110, 115, 120, 125], and the fluctuation range is 125-98 = 27; the sample power load data of sample area 2 is [130, 128, 135, 132, 130, 137, 140, 145, 150, 155], and the fluctuation range is 155-128 = 27; the sample power load data of sample area 3 is [160, 158, 165, 162, 160, 167, 170, 175, 180, 185], and the fluctuation range is 185-158 = 27. Then, each sample area is classified according to the load fluctuation range to obtain multiple first area sets. Assuming that the fluctuation range is divided into three intervals, namely small fluctuation range (0-10), medium fluctuation range (10-20), and large fluctuation range (above 20), then since the fluctuation range of all sample areas is 27, they are all classified into the "large fluctuation range" category.
[0206] Furthermore, according to the target feature sequence corresponding to the sample stations in the first station set, the similarities between different sample stations in the first station set are calculated to obtain a similarity matrix. Assuming that the target feature sequence of sample station 1 is [47.5, 32.5, 32.5, 32.5, 32.5, 32.5, 32.5, 32.5, 47.5]; the target feature sequence of sample station 2 is [65.0, 45.0, 45.0, 45.0, 45.0, 45.0, 45.0, 45.0, 65.0]; the target feature sequence of sample station 3 is [82.5, 57.5, 57.5, 57.5, 57.5, 57.5, 57.5, 57.5, 82.5], the Euclidean distance can be used to calculate the similarity matrix. For example, the distance between sample station 1 and sample station 2 is:
[0207]
[0208] The final similarity matrix W may be as follows (assuming the calculated result):
[0209]
[0210] The Laplace matrix is obtained based on the similarity matrix. Specifically, the sum of the similarities between each station area and other stations is calculated based on the similarity matrix to obtain the degree matrix. Among them, the degree matrix is a diagonal matrix formed by the sum of the elements in each row of the similarity matrix. The degree matrix D is as follows:
[0211]
[0212] Then, the Laplace matrix L is obtained by subtracting the similarity matrix W from the degree matrix D, that is, L = DW. The Laplace matrix L is as follows:
[0213]
[0214] Next, the Laplace matrix is eigendecomposed to obtain multiple eigenvectors, and the eigenvectors corresponding to the first two smallest eigenvalues (ie, target eigenvectors) are obtained from the multiple eigenvectors to obtain the eigenvector matrix U.
[0215]
[0216] K-means is used to cluster the feature vector matrix in two-dimensional space. For example, K=2 is set to cluster the sample areas into two groups, and two sets of second area sets are obtained. For example, sample area 1 and sample area 2 are divided into the first set of second area sets, and sample area 3 is divided into the second set of second area sets.
[0217] The first group of second substation sets is used as a training set, and the second group of second substation sets is used as a training set. The number of label pairs of predicted label pairs corresponding to all sample substations in the first group of second substation sets is determined. According to the predicted label pairs and the number of label pairs corresponding to each sample substation in the first group of second substation sets, the parameters of the power load prediction model are adjusted. After the training model of the first group of second substation sets is completed, the number of label pairs of predicted label pairs corresponding to all sample substations in the second group of second substation sets is determined. According to the predicted label pairs and the number of label pairs corresponding to each sample substation in the second group of second substation sets, the parameters of the power load prediction model are adjusted. In this way, the model can be adapted to the parameters of multiple training sets at the same time to achieve the purpose of comprehensive optimization.
[0218] It can be seen from the above embodiments that power load forecasting is a key issue in power system planning and operation, and is of great significance for ensuring the stable operation and reasonable scheduling of the power system. In order to effectively meet this challenge, many data-driven forecasting methods have emerged in recent years. In the application embodiment, a comprehensive power load forecasting method is proposed, which combines multiple links such as data integration, feature engineering, clustering and model building, providing comprehensive and efficient support for power system management and planning.
[0219] First, this method demonstrates comprehensiveness and reliability in data preparation. By collecting power load data from each substation and preprocessing and cleaning the data, the integrity and quality of the data are ensured. Then, the power load data from each substation is integrated into a unified data set, and the data set is verified and documented to prepare for subsequent analysis and modeling. Secondly, in terms of feature engineering, this method uses technologies such as fast discrete Fourier transform and threshold curve construction to efficiently extract and reduce the spectral characteristics of power load data. By analyzing the spectral characteristics, it is determined which frequency components are the main features, which provides an important reference for subsequent model construction.
[0220] Next, in terms of clustering, this method uses initial classification based on fluctuation range and spectral clustering algorithm, which can flexibly identify substations with similar load characteristics. Through clustering, different substations can be divided into different categories, providing an important reference for power system management and planning. Finally, in terms of model construction, this method uses models such as LSTM suitable for sequence data, which can better capture the time series characteristics in power load data. Through lifelong learning technology, the model can continuously learn and adapt to new data, enhancing the robustness and adaptability of the model.
[0221] In summary, the power load forecasting method in the embodiment of the present application has demonstrated excellent performance and flexibility in many aspects, and provides important support and guidance for the management and planning of the power system. It comprehensively considers multiple links such as data preparation, feature engineering, clustering and model building, and constructs a comprehensive and efficient forecasting framework that can achieve accurate and reliable power load forecasting.
[0222] It is known from common technical knowledge that the present application can be implemented by other embodiments that do not deviate from its spirit or essential features. Therefore, the above disclosed embodiments are only illustrative in all respects and are not exclusive. All changes within the scope of the present application or within the scope equivalent to the present application are included in the present application.
[0223] In addition, refer to Fig.10An embodiment of the present application further provides an electronic device, the electronic device 200 including a memory 202, a processor 201, and a computer program stored in the memory 202 and executable on the processor 201.
[0224] The processor 201 and the memory 202 may be connected via a bus or other means.
[0225] The memory 202, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer executable programs. In addition, the memory 202 may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory 202 may optionally include a memory remotely arranged relative to the processor 201, and these remote memories may be connected to the processor 201 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.
[0226] The non-transient software program and instructions required to implement the power load forecasting method or model training method of the above embodiment are stored in the memory 202. When executed by the processor 201, the power load forecasting method or model training method in the above embodiment is executed. Therefore, the power load forecasting method or model training method in the above embodiment will not be described in detail here. In addition, the description of the beneficial effects of using the same method will not be described in detail.
[0227] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0228] In addition, an embodiment of the present application further provides a computer-readable storage medium, which stores computer-executable instructions, which are executed by a processor or controller, for example, by a processor in the above-mentioned device embodiment, so that the above-mentioned processor can execute the power load prediction method or model training method in the above-mentioned embodiment. The power load prediction method or model training method in the above-mentioned embodiment will not be described in detail here. In addition, the description of the beneficial effects of using the same method will not be described in detail.
[0229] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, devices, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0230] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (apparatus), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0231] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0232] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0233] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present application rather than to limit it. Although the present application has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present application can still be modified or replaced by equivalents, and any modifications or equivalent replacements that do not depart from the spirit and scope of the present application should be included in the scope of protection of the claims of the present application.
Claims
1. A method for predicting power load, characterized in that: include: Obtaining sample power load data of multiple sample substations; Determine a preset sliding window and a prediction step size, and obtain a plurality of sample training data and prediction label pairs corresponding to each of the sample training data according to the preset sliding window, the prediction step size and the sample power load data; Obtaining frequency spectrum characteristics and a threshold curve of the sample training data based on the sample training data; Obtaining a target feature sequence according to the frequency spectrum features and threshold curve of the sample training data; Classifying each of the sample substations according to the sample power load data to obtain a plurality of first substation sets; Clustering the sample stations in the first station area set according to the target feature sequence to obtain a plurality of second station area sets; Determine the number of label pairs of the predicted label pairs corresponding to all the sample substations in the second substation set, and adjust the parameters of the power load prediction model according to the predicted label pairs corresponding to each of the sample substations in the second substation set and the number of label pairs; The power load data to be predicted of the target substation is obtained, and the power load data to be predicted is input into the power load prediction model after adjusting the parameters to obtain the load prediction data of the target substation.
2. The power load forecasting method according to claim 1, characterized in that: The step of obtaining a target feature sequence according to the spectral features and the threshold curve of the sample training data comprises: Screening the frequency spectrum characteristics of the sample training data based on the threshold curve to obtain a base frequency characteristic; Perform an inverse Fourier transform on the base frequency features to obtain a target feature sequence.
3. The power load forecasting method according to claim 1, characterized in that: The obtaining the frequency spectrum characteristics and threshold curve of the sample training data based on the sample training data includes: Performing discrete Fourier transform on each of the sample training data to obtain frequency spectrum features of each of the sample training data; Calculating the maximum amplitude of each of the spectral features; A threshold curve is generated based on all of the maximum amplitudes.
4. The power load forecasting method according to claim 1, characterized in that: The clustering of the sample stations in the first station area set according to the target feature sequence to obtain a plurality of second station area sets includes: According to the target feature sequences corresponding to the sample stations in the first station area set, similarities between different sample stations in the first station area set are calculated to obtain a similarity matrix; Obtaining a Laplacian matrix according to the similarity matrix; Performing eigendecomposition on the Laplace matrix to obtain a plurality of eigenvectors; Obtaining a preset number of target eigenvectors from the multiple eigenvectors to obtain an eigenvector matrix; The characteristic vector matrix is clustered based on the K-means algorithm to obtain multiple second station area sets.
5. The power load forecasting method according to claim 1, characterized in that: The method of classifying each of the sample areas according to the sample power load data to obtain a plurality of first area sets includes: Calculate the load fluctuation range corresponding to the sample area according to the sample power load data; The sample stations are classified according to the load fluctuation range to obtain a plurality of first station sets.
6. The power load forecasting method according to claim 1, characterized in that: The adjusting the parameters of the power load prediction model according to the predicted label pairs corresponding to each of the sample substations in the second substation set and the number of the label pairs includes: Determine a first loss value of the power load prediction model according to the predicted label pairs corresponding to each of the sample substations in the second substation set and the number of the label pairs; According to the first loss value, the parameters of the power load prediction model are adjusted.
7. The power load forecasting method according to claim 6, characterized in that: The method further comprises: Saving the parameters of the power load forecasting model after each adjustment; Calculating a regularization term according to the previously adjusted parameters of the power load forecasting model and the currently adjusted parameters of the power load forecasting model; Obtaining a second loss value according to the regularization term and the first loss value; The parameters of the power load prediction model are adjusted according to the second loss value.
8. A model training method, characterized in that: include: Obtaining sample power load data of multiple sample substations; Determine a preset sliding window and a prediction step size, and obtain a plurality of sample training data and prediction label pairs corresponding to each of the sample training data according to the preset sliding window, the prediction step size and the sample power load data; Obtaining frequency spectrum characteristics and a threshold curve of the sample training data based on the sample training data; Obtaining a target feature sequence according to the frequency spectrum features and threshold curve of the sample training data; Classifying each of the sample substations according to the sample power load data to obtain a plurality of first substation sets; Clustering the sample stations in the first station area set according to the target feature sequence to obtain a plurality of second station area sets; The number of label pairs of the predicted label pairs corresponding to all the sample substations in the second substation set is determined, and the parameters of the power load prediction model are adjusted according to the predicted label pairs corresponding to each of the sample substations in the second substation set and the number of label pairs.
9. An electronic device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the power load forecasting method according to any one of claims 1 to 7 or the model training method according to claim 8 is implemented.
10. A computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the power load forecasting method described in any one of claims 1 to 7 or the model training method described in claim 8.
Citation Information
Patent Citations
Load prediction method and device, computer equipment and storage medium
CN110929954A
Kmeans clustering method and system for low-voltage transformer area
CN111797899A
Transformer area power load prediction method, device and system
CN114330498A
Method and device for detecting pulmonary nodule in computed tomography image, and computer-readable storage medium
US20200005460A1
Cited By
Load data management and control method and system for enterprise platform
CN119740793A
Unsupervised fluctuation mode load identification model construction method and load identification method
CN119917956A
Method for constructing load identification model of unsupervised fluctuation mode and load identification method
CN119917956B
