Time-sharing electric quantity prediction method

By establishing an associated decision matrix and selecting similar day data for training, the problems of performance bottlenecks and overfitting in existing power prediction methods are solved, and the accuracy and efficiency of prediction are improved.

CN119940959APending Publication Date: 2025-05-06国网福建省电力有限公司营销服务中心 +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510004587.1
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

Technical Problem

Existing power prediction methods require a large amount of training data and computing resources, which are prone to performance bottlenecks and overfitting problems, resulting in low prediction efficiency and accuracy.

Method used

By establishing a correlation decision matrix between the date to be predicted and multiple historical days, the projection value between each historical day and the date to be predicted is determined, so that similar days similar to the date to be predicted are selected, and the machine learning model is trained using only the data of the similar day.

Benefits of technology

It improves the accuracy and efficiency of time-sharing power prediction, reduces the need for training data, and avoids overfitting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119940959A_ABST
    Figure CN119940959A_ABST
Patent Text Reader

Abstract

The invention provides a time-sharing electric quantity prediction method. The method comprises the following steps: acquiring various influence factor data of a to-be-predicted day and a plurality of historical days, and time-sharing electric quantity data of the plurality of historical days; according to the influence factor data, establishing an association decision matrix of the to-be-predicted day and a plurality of historical days; determining a projection value between the to-be-predicted day and each historical day according to the association decision matrix; determining similar days of the to-be-predicted day from the plurality of historical days according to the projection value; based on the influence factor data and the time-sharing electric quantity data corresponding to the similar days, training a preset machine learning model to obtain a time-sharing electric quantity prediction model; and inputting the influence factors of the to-be-predicted day into the time-sharing electric quantity prediction model to obtain a time-sharing electric quantity prediction result of the to-be-predicted day. According to the invention, the time-sharing electric quantity prediction efficiency and accuracy can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of power prediction, and in particular to a time-sharing power prediction method. Background Art

[0002] Carrying out user-side time-of-use electricity forecasting for the spot market can provide more accurate data support for power system operation through real-time transactions and on-demand scheduling, which will help optimize the allocation of power resources and improve operating efficiency. In addition, accurate prediction of users' time-of-use electricity can effectively match the volatility and intermittency of new energy power generation, reduce wind and solar power abandonment, and promote the optimization of energy structure.

[0003] In the related technologies, methods such as artificial neural networks and machine learning models are mainly used to predict power consumption. However, these prediction methods require a lot of training for artificial neural networks and machine learning models. The models need to process large amounts of data, which may lead to performance bottlenecks and low prediction efficiency. In addition, when there is too much training data or too many characteristic factors, overfitting is prone to occur, making it difficult to accurately predict the time-sharing power consumption on the user side. Summary of the invention

[0004] The embodiment of the present application provides a time-sharing power prediction method to improve the efficiency and accuracy of time-sharing power prediction.

[0005] In a first aspect, an embodiment of the present application provides a time-sharing power prediction method, comprising:

[0006] Acquire data of various influencing factors for the day to be predicted and multiple historical days, as well as time-sharing electricity data for the multiple historical days;

[0007] According to the influencing factor data, a correlation decision matrix between the day to be predicted and multiple historical days is established;

[0008] Determining the projection value between the to-be-predicted day and each historical day according to the association decision matrix;

[0009] Determining a similar day to the day to be predicted from the plurality of historical days according to the projection value;

[0010] Based on the influencing factor data and time-sharing power data corresponding to the similar days, a preset machine learning model is trained to obtain a time-sharing power prediction model;

[0011] The influencing factors of the day to be predicted are input into the time-sharing power prediction model to obtain the time-sharing power prediction result of the day to be predicted.

[0012] In a possible implementation, a correlation decision matrix between the to-be-predicted day and a plurality of historical days is established according to the influencing factor data, including:

[0013] According to the influencing factor data, respectively calculate the correlation coefficient between each influencing factor of each historical day and the influencing factor corresponding to the day to be predicted;

[0014] Based on each correlation coefficient, a correlation judgment matrix between the day to be predicted and multiple historical days is established;

[0015] According to the predetermined weights of various influencing factors and the association judgment matrix, an association decision matrix between the day to be predicted and a plurality of historical days is obtained.

[0016] In a possible implementation, determining the projection value between the to-be-predicted day and each historical day according to the association decision matrix includes:

[0017] According to the association decision matrix, respectively calculating the angles between the row vector corresponding to the day to be predicted and the row vector corresponding to each historical day;

[0018] According to the angle, the projection value between the day to be predicted and each historical day is obtained.

[0019] In a possible implementation, according to the association decision matrix, the angles between the row vector corresponding to the day to be predicted and the row vector corresponding to each historical day are calculated respectively, including:

[0020] According to the expression: Calculate the angle between the row vector corresponding to the day to be predicted and the row vector corresponding to each historical day;

[0021] Where D i represents the angle between the row vector corresponding to the day to be predicted and the row vector corresponding to the i-th historical day, W 0j represents the element value corresponding to the jth influencing factor in the row vector corresponding to the day to be predicted, W ij It represents the element value corresponding to the jth influencing factor in the row vector corresponding to the i-th historical day, and m represents the total number of influencing factors.

[0022] In a possible implementation, before obtaining the association decision matrix between the to-be-predicted day and a plurality of historical days according to the predetermined weights of the various influencing factors and the association judgment matrix, the method further includes:

[0023] Standardize the influencing factor data of multiple historical days to obtain the standard data of each influencing factor;

[0024] According to the standard data, the proportion of each influencing factor in the corresponding influencing factor of each historical day is calculated respectively;

[0025] For each influencing factor, the entropy value of the influencing factor is calculated according to the proportion of the influencing factor in each historical day;

[0026] Based on the entropy value of each influencing factor, the weight of each influencing factor is determined respectively.

[0027] In a possible implementation, determining a similar day to the to-be-predicted day from the plurality of historical days according to the projection value includes:

[0028] A historical day with a projection value greater than a preset threshold is selected from the multiple historical days as a similar day to the day to be predicted.

[0029] In one possible implementation, the machine learning model is a random forest algorithm.

[0030] In a second aspect, an embodiment of the present application provides a time-sharing power prediction device, comprising:

[0031] An acquisition module is used to acquire data of various influencing factors of the day to be predicted and multiple historical days, as well as time-sharing power data of the multiple historical days;

[0032] An establishment module is used to establish a correlation decision matrix between the day to be predicted and multiple historical days according to the influencing factor data;

[0033] A determination module, used to determine the projection value between the to-be-predicted day and each historical day according to the association decision matrix;

[0034] A selection module, configured to determine a similar day to the day to be predicted from the plurality of historical days according to the projection value;

[0035] A training module, used to train a preset machine learning model based on the influencing factor data and time-sharing power data corresponding to the similar days to obtain a time-sharing power prediction model;

[0036] The prediction module is used to input the influencing factors of the day to be predicted into the time-sharing power prediction model to obtain the time-sharing power prediction result of the day to be predicted.

[0037] In a third aspect, an embodiment of the present application 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 steps of the method described in the first aspect or any possible implementation method of the first aspect are implemented.

[0038] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the steps of the method described in the first aspect or any possible implementation method of the first aspect.

[0039] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product runs on an electronic device, the electronic device executes the steps of the method described in the first aspect or any possible implementation method of the first aspect.

[0040] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0041] The embodiment of the present application establishes an association decision matrix between the day to be predicted and multiple historical days through the influencing factor data of the day to be predicted and multiple historical days, which can reflect the similarity between each influencing factor between the historical day and the predicted day; then, the projection value between the day to be predicted and each historical day is determined through the association decision matrix, and the similarity between each historical day and the day to be predicted can be determined, so that similar days similar to the day to be predicted can be selected from multiple historical days according to the projection value; finally, the machine learning model is trained through the influencing factor data and time-sharing electricity data corresponding to the selected similar days, and the trained time-sharing electricity prediction model is used to predict the time-sharing electricity of the day to be predicted, so that the trained time-sharing electricity model can be made more targeted to the day to be predicted, thereby improving the accuracy of the time-sharing electricity prediction; and when the time-sharing electricity prediction model is trained, only the data of similar days to the day to be predicted need to be used for training, and there is no need to use the data of all historical days for training, which can improve the efficiency of the time-sharing electricity prediction. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0043] Figure 1 This is an application scenario diagram of the time-sharing power prediction method provided in an embodiment of the present application;

[0044] Figure 2 is a graph of mean absolute percentage errors of random forests of different sizes provided in an embodiment of the present application;

[0045] Figure 3 It is a curve comparison diagram of the time-sharing power prediction results of the three methods provided in the embodiments of the present application;

[0046] Figure 4 It is a structural schematic diagram of a time-sharing power prediction device provided in an embodiment of the present application;

[0047] Figure 5 It is a schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0048] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0049] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0050] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0051] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0052] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0053] In addition, the “plurality” mentioned in the embodiments of the present application should be interpreted as two or more.

[0054] The inventors have found that in order to predict the time-sharing electricity consumption, the relevant data of the time-sharing electricity consumption is usually used to train the artificial neural network and machine learning model to obtain the corresponding prediction model. A large amount of data needs to be processed during the training process, and the calculation efficiency is not high. Moreover, when there are too many training data or characteristic factors, overfitting is prone to occur, resulting in low prediction accuracy. Therefore, it is necessary to consider a prediction method for time-sharing electricity consumption.

[0055] In order to improve the efficiency and accuracy of time-sharing electricity forecasting, in the implementation mode of the present application, by establishing an association decision matrix between the day to be predicted and multiple historical days, and calculating the projection value between the day to be predicted and each historical day, the similarity between each historical day and the day to be predicted can be determined, and similar days similar to the day to be predicted can be selected from multiple historical days; then the machine learning model is trained with the influencing factor data and time-sharing electricity data corresponding to the similar days, and the trained time-sharing electricity forecasting model is used to predict the time-sharing electricity of the day to be predicted, so that the trained time-sharing electricity model can be more targeted to the day to be predicted, thereby improving the accuracy and efficiency of the time-sharing electricity forecast.

[0056] In order to make the purpose, technical solutions and advantages of the present application clearer, specific embodiments will be described below in conjunction with the accompanying drawings.

[0057] Figure 1 The implementation flow chart of the time-sharing power prediction method provided in the embodiment of the present application is described in detail as follows:

[0058] Step 101, obtaining data of various influencing factors of a day to be predicted and multiple historical days, and time-sharing electricity data of multiple historical days.

[0059] In this embodiment, the various influencing factor data may include meteorological influencing factors, date influencing factors, historical power influencing factors, etc. The meteorological influencing factors may include temperature, humidity, wind speed, precipitation, etc., and the date influencing factors may include date type, etc.

[0060] Step 102: Establish a correlation decision matrix between the day to be predicted and multiple historical days based on the influencing factor data.

[0061] In this embodiment, the predicted day and the historical day can be analyzed from the perspective of the influencing factors of time-sharing electricity, and the similarity between the historical samples and the predicted day of each influencing factor can be clarified.

[0062] Here, the grey correlation analysis method can be used to analyze the day to be predicted and multiple historical days to clarify the correlation between each historical day and the day to be predicted.

[0063] Step 103, determining the projection value between the day to be predicted and each historical day according to the association decision matrix.

[0064] In this embodiment, by associating the vector corresponding to the day to be predicted in the decision matrix with the vector corresponding to each historical day, the projection value between the day to be predicted and each historical day can be calculated, thereby accurately obtaining the similarity between each historical day and the day to be predicted.

[0065] Step 104: Determine a similar day to the day to be predicted from multiple historical days based on the projection value.

[0066] In this embodiment, the projection value reflects the similarity between the historical day and the day to be predicted. Through the projection value, the historical day similar to the day to be predicted can be found, thereby finding the similar day. The larger the projection value, the higher the similarity between the historical day corresponding to the projection value and the day to be predicted.

[0067] Optionally, this embodiment determines a similar day to the day to be predicted from multiple historical days based on the projection value, and may select a historical day whose projection value is greater than a preset threshold from the multiple historical days as a similar day to the day to be predicted.

[0068] In this embodiment, the projection value of each historical day can be compared with the prediction threshold. If the projection value is greater than the preset threshold, it indicates that the historical day corresponding to the projection value is similar to the day to be predicted and can be used as a similar day to the day to be predicted.

[0069] In addition, all projection values ​​may be sorted, and a preset number of historical days that are most similar to the day to be predicted may be selected as similar days. For example, the projection values ​​may be sorted in descending order, and a preset number of historical days with the largest projection values ​​may be selected as similar days.

[0070] Here, when selecting similar days, the historical day with the largest projection value in a preset proportion may be selected from the historical days as the similar day.

[0071] Step 105: Based on the influencing factor data and time-sharing electricity data corresponding to similar days, a preset machine learning model is trained to obtain a time-sharing electricity prediction model.

[0072] In this embodiment, only the influencing factor data and time-sharing electricity data of similar days are used for model training. The model can be trained by using only data similar to the day to be predicted, so that the trained model is more targeted and the prediction accuracy is improved. In addition, the amount of data used in the model training process can be reduced without using all the data.

[0073] Step 106, input the influencing factors of the day to be predicted into the time-sharing power prediction model to obtain the time-sharing power prediction result of the day to be predicted.

[0074] The embodiment of the present application establishes an association decision matrix between the day to be predicted and multiple historical days through the influencing factor data of the day to be predicted and multiple historical days, which can reflect the similarity between each influencing factor between the historical day and the predicted day; then, the projection value between the day to be predicted and each historical day is determined through the association decision matrix, and the similarity between each historical day and the day to be predicted can be determined, so that similar days similar to the day to be predicted can be selected from multiple historical days according to the projection value; finally, the machine learning model is trained through the influencing factor data and time-sharing electricity data corresponding to the selected similar days, and the trained time-sharing electricity prediction model is used to predict the time-sharing electricity of the day to be predicted, so that the trained time-sharing electricity model can be made more targeted to the day to be predicted, thereby improving the accuracy of the time-sharing electricity prediction; and when the time-sharing electricity prediction model is trained, only the data of similar days to the day to be predicted need to be used for training, and there is no need to use the data of all historical days for training, which can improve the efficiency of the time-sharing electricity prediction.

[0075] In some embodiments, based on the influencing factor data, an association decision matrix between the day to be predicted and multiple historical days is established. The method may be to first calculate the correlation coefficient between each influencing factor of each historical day and the influencing factor corresponding to the day to be predicted based on the influencing factor data; then, based on each correlation coefficient, establish an association judgment matrix between the day to be predicted and multiple historical days; finally, based on the predetermined weights of various influencing factors and the association judgment matrix, obtain an association decision matrix between the day to be predicted and multiple historical days.

[0076] In this embodiment, the correlation coefficient of each influencing factor of the day to be predicted is used as the element of the first row of the correlation judgment matrix, and the correlation coefficient of each influencing factor of the historical day is used as the element of the other rows of the correlation judgment matrix. Among them, the correlation coefficient of each influencing factor of the day to be predicted is 1, that is, the elements of the first row of the correlation judgment matrix are all 1.

[0077] Here, considering that each influencing factor has different effects on time-sharing electricity consumption, a weighted approach can be used to highlight the key influencing factors, that is, the weights of various influencing factors are multiplied by the elements of the corresponding influencing factors in the association judgment matrix, so as to obtain an association decision matrix containing weights, highlight the key influencing factors in the matrix, and reduce interference when judging similarity.

[0078] In addition, when determining the correlation coefficient, feature vectors can be established for the influencing factor data of the day to be predicted and the historical day. For example:

[0079] The characteristic vector of the day to be predicted can be: Y0 = [y 01 y 02 …y 0m ].

[0080] The feature vector of the historical day can be:i =[y i1 y i2 …y im ]i=1,2,…,n.

[0081] Among them, i = 0 represents the day to be predicted, i = 1, 2, ..., n represents the historical day, Y i The eigenvector representing the influencing factors on day i, y im Represents the value of the mth influencing factor on the i-th day.

[0082] Optionally, the correlation coefficient can be a grey correlation coefficient, and its calculation formula is as follows:

[0083]

[0084] In the formula, F ik represents the correlation coefficient of the kth influencing factor between the day to be predicted and the i-th day in the history, where i=0 represents the day to be predicted, and i=1,2,…,n represents the history day; x 0k represents the value of the kth influencing factor on the day to be predicted, x ik represents the value of the kth influencing factor on the i-th day in the predicted day and the historical day, ρ represents the resolution coefficient, which can be 0.5, It represents the minimum difference between all historical days and the kth influencing factor in the day to be predicted. It represents the maximum difference between the kth influencing factor in all historical days and the day to be predicted.

[0085] Correspondingly, the association judgment matrix can be expressed as: Among them, F represents the association judgment matrix, F ik It represents the correlation coefficient between the kth influencing factor on the i-th day in the predicted day and the historical day. The elements in the first row of the matrix are all 1.

[0086] If the weight of each influencing factor is W = [w1 w2…w m ], where W represents the weight matrix composed of the weights of various influencing factors, w m represents the weight of the mth influencing factor, then the association decision matrix can be expressed as:

[0087]

[0088] Where F′ represents the association decision matrix, W nm represents the element value corresponding to the mth influencing factor in the row vector corresponding to the nth day, where W 0m Represents the element value corresponding to the mth influencing factor in the row vector corresponding to the day to be predicted.

[0089] Optionally, before obtaining the association decision matrix between the day to be predicted and multiple historical days based on the predetermined weights of each influencing factor and the association judgment matrix, this embodiment may also first standardize the influencing factor data of multiple historical days to obtain standard data for each influencing factor; based on the standard data, calculate the proportion of each influencing factor in the corresponding influencing factor for each historical day; then, for each influencing factor, calculate the entropy value of the influencing factor based on the proportion of the influencing factor in each historical day; finally, based on the entropy value of each influencing factor, determine the weight of each influencing factor.

[0090] In this embodiment, the entropy weight method may be used to determine the weight of each influencing factor to ensure the rationality of weight distribution.

[0091] In some embodiments, the projection value between the day to be predicted and each historical day is determined according to the association decision matrix. The angles between the row vector corresponding to the day to be predicted and the row vector corresponding to each historical day are calculated respectively according to the association decision matrix; and then the projection value between the day to be predicted and each historical day is obtained according to the angle.

[0092] In this embodiment, the angle between the row vector of the historical day and the row vector of the day to be predicted, that is, the gray projection angle, can be used as the projection value between the day to be predicted and each historical day, thereby reflecting the similarity between the historical day and the day to be predicted.

[0093] Optionally, this embodiment calculates the angle between the row vector corresponding to the day to be predicted and the row vector corresponding to each historical day according to the association decision matrix, which can be based on the expression: The angle between i represents the angle between the row vector corresponding to the day to be predicted and the row vector corresponding to the i-th historical day, W 0j W represents the element value corresponding to the jth influencing factor in the row vector corresponding to the day to be predicted. ij It represents the element value corresponding to the jth influencing factor in the row vector corresponding to the i-th historical day, and m represents the total number of influencing factors.

[0095] In some embodiments, the machine learning model is a random forest algorithm.

[0096] Random forest is a supervised ensemble learning algorithm. Its core idea is to combine multiple classification and regression trees with weaker performance into a forest according to certain rules. The final result is determined by voting of all decision trees in the forest.

[0097] As the basic learner of the random forest algorithm, the decision tree is an important part of the study of the random forest algorithm. The random forest consists of multiple unpruned decision trees. In the study, the decision tree can be regarded as a tree model with a root node, leaf nodes, and intermediate nodes. When building a decision tree, it starts to split from the root node, passes through multiple intermediate nodes, and finally reaches the leaf node. In this process, the nodes in the decision tree represent a single feature, and the path split from each node represents the value that the feature may choose. The output rule of the decision tree is unique, that is, the final output value is unique. In other words, only a unique leaf node can be reached from the root node, so it can be used for classification and prediction.

[0098] Classification and regression tree (CART) is a binary recursive partitioning technique in which each non-leaf node is partitioned into two leaf nodes. The CART decision tree algorithm uses the Gini coefficient as the attribute selection metric in the classification tree and the least squares deviation as the attribute metric in the regression tree.

[0099] Assume that the dataset D contains n different categories C i , C i,D It belongs to category C in dataset D i tuples, |D| represents the total number of tuples in the dataset D, and |C i,D | means C i,D Then, the CART decision tree is calculated using the Gini index Gini (D) formula.

[0100]

[0101] Where P is C i The frequency with which the category tuple occurs.

[0102] The Gini index performs a binary partition for each attribute. For a binary partition of a discrete attribute A, A partitions the data set D into D1 and D2, and the Gini index of the data set D is given based on this partition. The impurity caused by the binary partition of attribute A is reduced to ΔGini A (D) = Gini(D) - Gini A (D).

[0103] By observing the possible binary partitions of each attribute, a subset with the smallest Gini index is selected from all cases and used as the split subset. That is, the Gini index of attribute A is Gini A (D) The larger the Gini A The smaller (D) is, the better the division on A is.

[0104] For the data set D = {(x1,y1),(x2,y2),…,(x n ,y n )}, use feature j and segmentation point s to divide all input regions into two sub-regions: R1(j,s)={xx ( j ) ≤s}And R2(j,s)={xx ( j ) >s}.

[0105] The minimum loss function is:

[0106] Where c1 and c2 represent the average values ​​of the output of regions R1 and R2, respectively. The minimum loss function can only be obtained by traversing the different values ​​of each feature, continuously calculating the error of each truncation point, and selecting the point with the smallest truncation error to divide the input into two regions, so as to finally meet the termination condition. Finally, the input space is divided into M regions {R1, R2, …, R M}, and the final regression tree is generated based on the least squares deviations. In the formula, C m It is region R m The average value of .

[0107] Random forest contains two random ideas, namely the idea of ​​bagging for sample selection and the idea of ​​random subspace for feature selection. A decision tree is constructed for each self-help sample, and then the prediction results of all decision trees are combined to generate the prediction results of random forest. When integrating the results of decision trees, the regression algorithm averages the prediction results of the decision trees, while the classification algorithm adopts the majority voting method.

[0108] Random forest is a tree composed of multiple decision trees {h(x,θ t ),t=1,2,…,T}. Among them, h(x,θ t ) represents a decision tree, θ t is a random variable that follows an independent distribution, x is the independent variable, and T is the number of decision trees

[0109] The classification model predicts: In the formula, represents the classification prediction result, Y represents the classification type, and I represents the schematic function.

[0110] The results predicted by the regression model are: In the formula, Represents the regression prediction result, h(x,θ t ) represents the relationship between x and θ t The output of the decision tree.

[0111] The main steps of the random forest construction process are:

[0112] 1) Using the idea of ​​bagging sampling to generate multiple decision trees requires extracting N samples with replacement from the original data set to form a subset containing N samples, where the number of samples in each subset is approximately 2 / 3 of the number of samples in the original data set.

[0113] 2) For the extracted training subset, the idea of ​​random subspace is used to randomly extract f features as the feature subspace, the optimal feature is selected from the feature subspace, and node splitting is performed starting from this feature to build a decision tree. During the node splitting process, for the regression model, a regression tree is built based on the mean square error; for the classification model, a classification tree is built based on the Gini index.

[0114] 3) Repeat steps 1) and 2) to generate T decision trees. For each decision tree, let it grow without restriction (without pruning), and finally, these T decision trees constitute the entire random forest.

[0115] 4) Combine the prediction results of T decision trees and summarize them to get the prediction results of random forest. For regression model, the average method is used; for classification model, the voting method is used.

[0116] In some feasible embodiments, since there is not a single factor that affects the accuracy of electricity forecasting, in order to improve the forecasting accuracy, this embodiment considers multiple influencing factors and inputs daily meteorological factors and hourly meteorological factors as input sample data into the time-sharing electricity forecasting model obtained in the above-mentioned embodiments.

[0117] The electricity variables input into the model include the electricity in the same hour of the previous day, the current hourly electricity, the maximum hourly electricity of the day, and the minimum hourly electricity of the day. The meteorological variables input into the model include the daily average temperature, daily average humidity, current hourly temperature, current hourly humidity, daily average wind speed, daily average rainfall, daily average air pressure, and visibility.

[0118] Combined with the actual power forecasting needs, in order to observe the comparison results more intuitively, the average error and mean absolute percentage error (MAPE) can be calculated respectively. If the error between the predicted time-of-use power value and the actual time-of-use power value is small, then the MAPE value will also be small, which means that the forecast is more effective.

[0119] Therefore, in order to minimize the mean absolute percentage error (MAPE) as much as possible, the number of prediction trees in the random forest should be carefully selected for time-sharing power forecasting. In this embodiment, before using the random forest algorithm for time-sharing power forecasting, simulation training can be performed using 7 days of data randomly selected within a week, and it is found that random forests of different sizes have a certain impact on the mean absolute percentage error (MAPE). For this reason, the average MAPE of each scale can be taken for comparison.

[0120] The mean absolute percentage error (MAPE) of random forests of different sizes is as follows Figure 2 As shown in the figure, the number of trees ranges from 100 to 700, with a minimum interval of 50 trees. As the number of decision trees increases, MAPE generally shows a downward trend, but it does not mean that the more trees there are, the smaller MAPE will be. Figure 2 The number of trees fluctuates between 300 and 600. When considering the number of trees, it is best to consider other factors, such as the time required for the algorithm. The number of trees is an important factor affecting the prediction accuracy. Therefore, when conducting time-of-day power forecasting in the power system, the optimal tree size in the validation set can be selected for modeling and prediction analysis.

[0121] This embodiment combines the historical time-sharing electricity data and influencing factor data of the electricity in area A to predict the time-sharing electricity on the day to be predicted. The mean absolute percentage error (MAPE) is used as the evaluation index to compare the prediction results of the time-sharing electricity prediction method provided by this application with the prediction results of the traditional random forest algorithm (RF), and the prediction results of the support vector machine (SVM) algorithm and the weighted grey projection.

[0122] The error comparison of the three prediction methods is shown in Table 1.

[0123] Table 1 Error comparison of three prediction methods

[0124]

[0125]

[0126] In order to facilitate the comparison of the results, Figure 3 The curve comparison diagram of the time-sharing power prediction results of the three methods is shown. In this embodiment, the time-sharing power prediction method provided by the present application gives a smaller prediction error, and its average relative error is 1.18%. The average relative errors of the traditional random forest (RF) and support vector machine (SVM) algorithms are 2.09% and 1.56%, respectively. Therefore, the effect of time-sharing power prediction using the time-sharing power prediction method provided by the present application is better than the SVM algorithm and the traditional random forest RF algorithm.

[0127] The embodiment of the present application constructs an association judgment matrix, in which each element in the matrix represents the degree of association between the historical sample and the influencing factors of the day to be predicted, and the uncertainty of various influencing factors is considered in the association degree, so that the relationship between the data can be more truly reflected; the weights of the influencing factors are determined by the entropy weight method, and the association judgment matrix is ​​weighted, so that each element in the association judgment matrix can more accurately reflect its corresponding influence, and obtain an association decision matrix. Then, by calculating the projection value using the row vector in the association decision matrix, and selecting the historical day using the projection value, a set of similar days with high similarity to the day to be predicted can be obtained, so that this set can be used as the data basis for subsequent prediction model training. Subsequently, a prediction model is established using a random forest algorithm, and the model is trained using the set of similar days selected, which can ensure that the model can capture the features and patterns most relevant to the day to be predicted, and obtain a random forest prediction model with a feature vector, thereby improving prediction accuracy and efficiency.

[0128] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0129] The following is an embodiment of the device of the present application. For details not described in detail, please refer to the corresponding method embodiment described above.

[0130] Figure 4 The schematic diagram of the structure of the time-sharing power prediction device provided by the embodiment of the present application is shown. For the convenience of explanation, only the part related to the embodiment of the present application is shown, which is described in detail as follows:

[0131] like Figure 4 As shown, the time-sharing power prediction device 40 includes:

[0132] The acquisition module 41 is used to acquire data of various influencing factors of the day to be predicted and multiple historical days, as well as time-sharing power data of multiple historical days;

[0133] Establishing module 42, for establishing a correlation decision matrix between the day to be predicted and a plurality of historical days according to the influencing factor data;

[0134] A determination module 43, for determining the projection value between the day to be predicted and each historical day according to the associated decision matrix;

[0135] A selection module 44, for determining a similar day to the day to be predicted from a plurality of historical days according to the projection value;

[0136] The training module 45 is used to train the preset machine learning model based on the influencing factor data and time-sharing power data corresponding to similar days to obtain a time-sharing power prediction model;

[0137] The prediction module 46 is used to input the influencing factors of the day to be predicted into the time-sharing power prediction model to obtain the time-sharing power prediction result of the day to be predicted.

[0138] In a possible implementation, the establishing module 42 is specifically used for:

[0139] According to the influencing factor data, the correlation coefficient between each influencing factor of each historical day and the influencing factor corresponding to the day to be predicted is calculated respectively;

[0140] Based on each correlation coefficient, a correlation judgment matrix between the day to be predicted and multiple historical days is established;

[0141] According to the predetermined weights of various influencing factors and the association judgment matrix, the association decision matrix between the day to be predicted and multiple historical days is obtained.

[0142] In a possible implementation, the determination module 43 is specifically configured to:

[0143] According to the correlation decision matrix, the angles between the row vector corresponding to the day to be predicted and the row vector corresponding to each historical day are calculated respectively;

[0144] According to the angle, the projection value between the day to be predicted and each historical day is obtained.

[0145] In a possible implementation, the determination module 43 is specifically configured to:

[0146] According to the expression: Calculate the angle between the row vector corresponding to the day to be predicted and the row vector corresponding to each historical day;

[0147] Where D i represents the angle between the row vector corresponding to the day to be predicted and the row vector corresponding to the i-th historical day, W 0j W represents the element value corresponding to the jth influencing factor in the row vector corresponding to the day to be predicted. ij It represents the element value corresponding to the jth influencing factor in the row vector corresponding to the i-th historical day, and m represents the total number of influencing factors.

[0148] In a possible implementation, the establishing module 42 is further configured to:

[0149] Standardize the influencing factor data of multiple historical days to obtain the standard data of each influencing factor;

[0150] According to the standard data, calculate the proportion of each influencing factor in the corresponding influencing factor for each historical day;

[0151] For each influencing factor, the entropy value of the influencing factor is calculated according to the proportion of the influencing factor in each historical day;

[0152] Based on the entropy value of each influencing factor, the weight of each influencing factor is determined respectively.

[0153] In a possible implementation, the selection module 44 is specifically configured to:

[0154] A historical day with a projection value greater than a preset threshold is selected from multiple historical days as a similar day to the day to be predicted.

[0155] In one possible implementation, the machine learning model is a random forest algorithm.

[0156] Figure 5 Schematic diagram of an electronic device provided in an embodiment of the present application. Figure 5 As shown, the electronic device 50 of this embodiment includes: a processor 51, a memory 52, and a computer program 53 stored in the memory 52 and executable on the processor 51. When the processor 51 executes the computer program 53, the steps in the above-mentioned various time-sharing power prediction method embodiments are implemented, such as Figure 1 Alternatively, when the processor 51 executes the computer program 53, the functions of each module in the above-mentioned device embodiments are realized, for example Figure 4 The functions of the modules 41 to 46 are shown.

[0157] Exemplarily, the computer program 53 may be divided into one or more modules / units, one or more modules / units are stored in the memory 52 and executed by the processor 51 to complete the present application. One or more modules / units may be a series of computer program instruction segments that can complete specific functions, and the instruction segments are used to describe the execution process of the computer program 53 in the electronic device 50. For example, the computer program 53 may be divided into Figure 4 Modules 41 to 46 are shown.

[0158] The electronic device 50 may include, but is not limited to, a processor 51 and a memory 52. ​​Those skilled in the art will appreciate that Figure 5 It is only an example of the electronic device 50 and does not constitute a limitation of the electronic device 50. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device may also include input and output devices, network access devices, buses, etc.

[0159] The processor 51 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0160] The memory 52 may be an internal storage unit of the electronic device 50, such as a hard disk or memory of the electronic device 50. The memory 52 may also be an external storage device of the electronic device 50, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 50. Further, the memory 52 may also include both an internal storage unit of the electronic device 50 and an external storage device. The memory 52 is used to store computer programs and other programs and data required by the electronic device. The memory 52 may also be used to temporarily store data that has been output or is to be output.

[0161] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0162] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0163] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0164] In the embodiments provided in the present application, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0165] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0166] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0167] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. Computer-readable media may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.

[0168] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.

Claims

1. A time-sharing electricity prediction method, characterized in that: include: Acquire data of various influencing factors for the day to be predicted and multiple historical days, as well as time-sharing electricity data for the multiple historical days; According to the influencing factor data, a correlation decision matrix between the day to be predicted and multiple historical days is established; Determining the projection value between the to-be-predicted day and each historical day according to the association decision matrix; Determining a similar day to the day to be predicted from the plurality of historical days according to the projection value; Based on the influencing factor data and time-sharing power data corresponding to the similar days, a preset machine learning model is trained to obtain a time-sharing power prediction model; The influencing factors of the day to be predicted are input into the time-sharing power prediction model to obtain the time-sharing power prediction result of the day to be predicted.

2. The time-sharing electricity prediction method according to claim 1 is characterized in that: According to the influencing factor data, a correlation decision matrix between the day to be predicted and multiple historical days is established, including: According to the influencing factor data, respectively calculate the correlation coefficient between each influencing factor of each historical day and the influencing factor corresponding to the day to be predicted; Based on each correlation coefficient, a correlation judgment matrix between the day to be predicted and multiple historical days is established; According to the predetermined weights of various influencing factors and the association judgment matrix, an association decision matrix between the day to be predicted and a plurality of historical days is obtained.

3. The time-sharing electricity prediction method according to claim 1 is characterized in that: Determining the projection value between the to-be-predicted day and each historical day according to the association decision matrix includes: According to the association decision matrix, respectively calculating the angles between the row vector corresponding to the day to be predicted and the row vector corresponding to each historical day; According to the angle, the projection value between the day to be predicted and each historical day is obtained.

4. The time-sharing electricity prediction method according to claim 3 is characterized in that: According to the association decision matrix, the angles between the row vector corresponding to the day to be predicted and the row vector corresponding to each historical day are calculated respectively, including: According to the expression: Calculate the angle between the row vector corresponding to the day to be predicted and the row vector corresponding to each historical day; Where D i represents the angle between the row vector corresponding to the day to be predicted and the row vector corresponding to the i-th historical day, W 0j represents the element value corresponding to the jth influencing factor in the row vector corresponding to the day to be predicted, W ij It represents the element value corresponding to the jth influencing factor in the row vector corresponding to the i-th historical day, and m represents the total number of influencing factors.

5. The time-sharing electricity prediction method according to claim 2 is characterized in that: Before obtaining the association decision matrix between the to-be-predicted day and a plurality of historical days according to the predetermined weights of the various influencing factors and the association judgment matrix, the method further includes: Standardize the influencing factor data of multiple historical days to obtain the standard data of each influencing factor; According to the standard data, the proportion of each influencing factor in the corresponding influencing factor of each historical day is calculated respectively; For each influencing factor, the entropy value of the influencing factor is calculated according to the proportion of the influencing factor in each historical day; Based on the entropy value of each influencing factor, the weight of each influencing factor is determined respectively.

6. The time-sharing electricity prediction method according to claim 1 is characterized in that: Determining a similar day to the to-be-predicted day from the plurality of historical days according to the projection value includes: A historical day with a projection value greater than a preset threshold is selected from the multiple historical days as a similar day to the day to be predicted.

7. The time-sharing electricity prediction method according to claim 1 is characterized in that: The machine learning model is a random forest algorithm.

8. A time-sharing electricity prediction device, characterized in that: include: An acquisition module is used to acquire data of various influencing factors of the day to be predicted and multiple historical days, as well as time-sharing power data of the multiple historical days; An establishment module is used to establish a correlation decision matrix between the day to be predicted and multiple historical days according to the influencing factor data; A determination module, used to determine the projection value between the to-be-predicted day and each historical day according to the association decision matrix; A selection module, configured to determine a similar day to the day to be predicted from the plurality of historical days according to the projection value; A training module, used to train a preset machine learning model based on the influencing factor data and time-sharing power data corresponding to the similar days to obtain a time-sharing power prediction model; The prediction module is used to input the influencing factors of the day to be predicted into the time-sharing power prediction model to obtain the time-sharing power prediction result of the day to be predicted.

9. An electronic device comprising a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium storing 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.

Citation Information

Patent Citations

  • Bus load prediction method

    CN106485262A

  • Load prediction method based on similar day selection and random forest algorithm

    CN108537683A

  • Short-term load prediction method based on weighted grey correlation projection method

    CN117318025A

  • Day-ahead time-sharing electric quantity prediction method and device based on feature fusion and medium

    CN119004035A