A method and device for power load forecasting based on improved RF-SVR
Through the improved RF-SVR model, the key features of power load data are extracted and predicted, and the accuracy and efficiency of power load prediction in the prior art are solved, thereby ensuring the safe operation of the power system.
Patent Information
- Application Number
- CN202411535361.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-10-31
AI Technical Summary
The prior art cannot accurately and efficiently predict power loads, resulting in the inability to ensure the safe operation of the power system.
Power load prediction method based on the improved random forest support vector regression (RF-SVR) model, which includes feature extraction module and regression prediction module, extracts key data from historical influencing factors data sets and uses support vector regression model to perform predict.
Accurate and efficient prediction of power loads is achieved, prediction efficiency and accuracy are improved, and the safe operation of the power system is ensured.
Smart Images

Figure CN119070301B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of renewable energy power generation, and in particular to a method and device for predicting electric load based on improved RF-SVR. Background Art
[0002] With the rapid development of new energy technologies, the power system is facing increasingly complex supply and demand balance issues. New energy power generation has certain intermittent and unstable characteristics (such as wind power in wind power generation and solar energy in photovoltaic power generation), which will affect the safe and stable operation of the power system.
[0003] Power load forecasting is the key to ensuring the safe operation of the power system. The power generation plan can be adjusted by forecasting the power load, thereby improving the operating efficiency of new energy power generation units to obtain greater benefits.
[0004] Electric load is affected by many factors and has strong time-varying and nonlinear characteristics. The relationship between electric load and its influencing factors is constantly changing, which makes the prediction of electric load complicated. Traditional methods of electric load forecasting, such as time series analysis and machine learning algorithms, cannot effectively deal with the high-frequency fluctuations and complex nonlinear characteristics of electric load. Moreover, due to the large number of factors affecting electric load, there are few comparable samples. Such methods have high requirements on sample size and type of feature data, which will cause the model to easily fall into the local optimal solution, resulting in low prediction accuracy and efficiency.
[0005] To address the above problems, no effective solution has been proposed yet. Summary of the invention
[0006] The embodiments of this specification provide a method and device for predicting power load based on improved RF-SVR to solve the problem that the prior art cannot accurately and efficiently predict power load, and thus cannot ensure the safe operation of the power system.
[0007] In a first aspect, an embodiment of the present specification provides a method for power load forecasting based on an improved RF-SVR, the method comprising:
[0008] Acquire a historical influencing factor dataset that affects power load data, wherein the power load data and the historical influencing factor dataset have the same period range;
[0009] The historical influencing factor data set is input into the target fusion prediction model to obtain the prediction result of the power load data; the target fusion prediction model includes a feature extraction module and a regression prediction module, the feature extraction module is used to extract the key data of the historical influencing factor data set, and the regression prediction module is used to process the input key data to obtain the prediction result of the power load data.
[0010] In some embodiments, the target fusion prediction model is trained in the following manner:
[0011] The random forest model is trained based on the sample data set corresponding to the historical influencing factor data set to obtain a feature extraction module;
[0012] Determine, by using the feature extraction module, a target sample data set in the sample data set that is respectively related to the power load data samples on each date within the period range, and extract key sample data in the target sample data set;
[0013] The key sample data is used as the input of the support vector regression model, and the model parameters of the support vector regression model are continuously adjusted, and when the prediction error indicator data of the support vector regression model is less than a preset error threshold, a regression prediction module is obtained;
[0014] The feature extraction module and the regression prediction module are integrated to obtain the target fusion prediction model.
[0015] In some embodiments, the period range is determined as follows:
[0016] Determine the complex wavelet coefficients of the historical power load data according to the historical power load data;
[0017] Determining the real part variance of the complex wavelet coefficient according to the real part of the complex wavelet coefficient;
[0018] A period trend graph is plotted according to the real part variance of the complex wavelet coefficients, so as to determine the period range from the period trend graph.
[0019] In some embodiments, the sample data set corresponding to the historical influencing factor data set is used to train a random forest model to obtain a feature extraction module, including:
[0020] Divide the sample data set corresponding to the historical influencing factor data set into a preset number of sample subsets;
[0021] Selecting a training set and a test set from the sample subset;
[0022] The random forest model is trained based on the training set, and the training result is verified based on the test set to obtain the feature extraction module, and the number of training times is equal to a preset number.
[0023] In some embodiments, the determining of the target sample data sets in the sample data sets that are respectively related to the power load data samples on each date within the period range by using the feature extraction module includes:
[0024] Sequentially fix the power load data samples of each date within the period range, and when fixed, traverse the sample data sets of each date within the period range;
[0025] Input the traversed date sample data sets into the feature extraction module in sequence to determine the target prediction value from the prediction values output by the feature extraction module, and the evaluation index data corresponding to the target prediction value is less than the preset evaluation threshold;
[0026] The target date sample data set corresponding to the target prediction value is used as the target sample data set.
[0027] In some embodiments, extracting key sample data from the target sample data set includes:
[0028] Randomly sampling the target sample data set to obtain a first target sample data set, and constructing a decision tree according to the first target sample data set;
[0029] Randomly selecting sample data corresponding to historical influencing factors from the target sample data set as node splitting values of the decision tree;
[0030] Changing the node splitting value until a target splitting point is obtained, the weighted mean square error of the target splitting point is less than a preset weighted mean square error threshold, and the target splitting point represents the first historical influencing factor to be sorted;
[0031] Determine an importance value of a target split point, and sort the first historical influencing factors according to the importance value, so as to select a target historical influencing factor from the first historical influencing factors according to the sorting result as key sample data, and the sorting result of the target historical influencing factor is greater than a preset sorting threshold.
[0032] In some embodiments, the model parameters of the support vector regression model include at least a penalty factor and a gamma function, and the prediction error indicator data include at least a MAE indicator and a RMSE indicator; accordingly, the continuously adjusting the model parameters of the support vector regression model includes:
[0033] The penalty factor and the gamma function are continuously adjusted, and when the MAE index and the RMSE index are less than the corresponding preset error thresholds, the regression prediction module is obtained.
[0034] In a second aspect, the embodiments of this specification also provide a power load forecasting device based on improved RF-SVR, the device comprising:
[0035] An acquisition module, used to acquire a data set of historical influencing factors affecting power load data, wherein the power load data and the data set of historical influencing factors have the same period range;
[0036] A prediction module is used to input the historical influencing factor data set into a target fusion prediction model to obtain a prediction result of the power load data; the target fusion prediction model includes a feature extraction module and a regression prediction module, the feature extraction module is used to extract key data of the historical influencing factor data set, and the regression prediction module is used to process the input key data to obtain a prediction result of the power load data.
[0037] In a third aspect, an embodiment of the present specification also provides a computer device, including a memory, a processor, and a computer program / instructions stored in the memory, wherein the processor executes the computer program / instructions to implement the steps of the above-mentioned power load forecasting method based on improved RF-SVR.
[0038] In a fourth aspect, the embodiments of this specification further provide a computer-readable storage medium having a computer program / instruction stored thereon, which, when executed by a processor, implements the steps of the above-mentioned power load forecasting method based on improved RF-SVR.
[0039] In a fifth aspect, the embodiments of this specification also provide a computer program product, and when the computer program / instructions are executed by a processor, the steps of the above-mentioned power load forecasting method based on improved RF-SVR are implemented.
[0040] The embodiment of this specification provides a method and device for power load forecasting based on improved RF-SVR. First, a historical influencing factor data set affecting power load data is obtained, and the power load data and the historical influencing factor data set have the same period range. Then, the historical influencing factor data set is input into the target fusion prediction model to obtain the prediction result of the power load data; the target fusion prediction model includes a feature extraction module and a regression prediction module, the feature extraction module is used to extract the key data of the historical influencing factor data set, and the regression prediction module is used to process the input key data to obtain the prediction result of the power load data. In the embodiment of this specification, the historical influencing factor data set affecting the power load data can be processed based on the target fusion prediction model, so that the prediction result of the power load data can be accurately and efficiently obtained, solving the problem that the existing technology cannot accurately and efficiently predict the power load data, thereby failing to ensure the safe operation of the power system. The target fusion prediction model includes a feature extraction module and a regression prediction module. The key data can be extracted through the feature extraction module, which greatly reduces the number of sample data and reduces the dimension of the sample data. Then, the key data is used as the input of the regression prediction module, which can effectively improve the prediction efficiency and accuracy of the power load data. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0042] Figure 1 It is a flow chart of a method for power load forecasting based on improved RF-SVR provided in an embodiment of this specification;
[0043] Figure 2 It is a schematic diagram of an embodiment of a power load forecasting method based on an improved RF-SVR provided in an embodiment of this specification, in a scenario example;
[0044] Figure 3 It is a schematic diagram of an embodiment of a power load forecasting method based on an improved RF-SVR provided in an embodiment of this specification, in a scenario example;
[0045] Figure 4 It is a schematic diagram of an embodiment of a power load forecasting method based on an improved RF-SVR provided in an embodiment of this specification, in a scenario example;
[0046] Figure 5 It is a schematic diagram of an embodiment of a power load forecasting method based on an improved RF-SVR provided in an embodiment of this specification, in a scenario example;
[0047] Figure 6 It is a schematic diagram of an embodiment of a power load forecasting method based on an improved RF-SVR provided in an embodiment of this specification, in a scenario example;
[0048] Figure 7 It is a schematic diagram of an embodiment of a power load forecasting method based on an improved RF-SVR provided in an embodiment of this specification, in a scenario example;
[0049] Figure 8 It is a schematic diagram of the structure of a power load prediction device based on an improved RF-SVR provided in an embodiment of this specification;
[0050] Fig. 9 It is a schematic diagram of the structural composition of an electronic device provided in an embodiment of this specification. DETAILED DESCRIPTION
[0051] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.
[0052] Power load forecasting is the key to ensuring the safe operation of the power system. The power generation plan can be adjusted by forecasting the power load, thereby improving the operating efficiency of the generator set to obtain greater benefits.
[0053] At present, common power load forecasting models include models based on time series and artificial intelligence system models. Although they can capture high-dimensional data such as images and voices, these methods have high requirements on the sample size and type of feature data, and are prone to fall into local optimal solutions, resulting in low prediction accuracy and efficiency. Moreover, most of the proposed prediction models only use historical loads as inputs, without fully analyzing and considering the impact of other influencing factors on power load forecasting. In addition, these methods cannot effectively deal with the high-frequency fluctuations and complex nonlinear characteristics of power loads.
[0054] In view of the above-mentioned problems existing in the existing methods and the specific reasons for the above-mentioned problems, this application considers introducing a power load forecasting method and device based on improved RF-SVR, which can realize accurate and efficient prediction of power load based on the target fusion prediction model (i.e., a more accurate and robust power load forecasting algorithm).
[0055] It should be noted that the user-related information and data involved in the embodiments of this specification are all information and data authorized by the user or fully authorized by relevant parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with relevant laws, regulations and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users or relevant parties to choose to authorize or refuse.
[0056] It should also be noted that in the embodiments of this specification, certain software, components, models and other existing solutions in the industry may be mentioned. They should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of this application, but it does not mean that the applicant has or will necessarily use the solution.
[0057] Figure 1It is a flow chart of a method for power load forecasting based on improved RF-SVR provided in an embodiment of this specification. Although this specification provides method operation steps or device structures as shown in the following embodiments or drawings, more or fewer operation steps or module units may be included in the method or device based on routine or no creative labor. In the steps or structures that do not logically have a necessary causal relationship, the execution order of these steps or the module structure of the device is not limited to the execution order or module structure shown in the embodiments or drawings of this specification. When the method or module structure described is applied to an actual device, server or terminal product, it can be executed sequentially or in parallel according to the method or module structure shown in the embodiments or drawings (for example, in an environment of parallel processors or multi-threaded processing, or even including distributed processing, server cluster implementation environment). For specific implementation, refer to Figure 1 As shown, the method may include the following contents.
[0058] S101: Acquire a historical influencing factor dataset that affects power load data, wherein the power load data and the historical influencing factor dataset have the same period range;
[0059] S102: Input the historical influencing factor data set into the target fusion prediction model to obtain the prediction result of the power load data; the target fusion prediction model includes a feature extraction module and a regression prediction module, the feature extraction module is used to extract the key data of the historical influencing factor data set, and the regression prediction module is used to process the input key data to obtain the prediction result of the power load data.
[0060] Based on the above embodiments, the historical influencing factor data set that affects the power load data can be processed based on the target fusion prediction model (i.e., a pre-trained target fusion prediction model), so that the prediction results of the power load data can be accurately and efficiently obtained, solving the problem that the existing technology cannot accurately and efficiently predict the power load data, thereby failing to ensure the safe operation of the power system. The target fusion prediction model includes a feature extraction module and a regression prediction module. The feature extraction module can extract key data, greatly reducing the number of sample data and the dimension of the sample data. The key data is then used as the input of the regression prediction module, which can effectively improve the prediction efficiency and accuracy of the power load data.
[0061] In some embodiments, the historical influencing factor data set may include, but is not limited to: historical power load data, power generation, temperature, wind speed, humidity, electricity price policy, and whether it is a holiday.
[0062] In some embodiments, there are many factors that affect the power load data, and these factors may cause changes in the trend of the power load data. These factors may be analyzed first to determine the above-mentioned historical influencing factors in this application.
[0063] Among them, historical power load data: the size of historical load can reflect the changing trend of future load; power generation: power generation depends in part on the installed capacity. Under the condition that the installed capacity remains unchanged in a short period of time, power generation is also related to production practice activities; temperature: changes in temperature during the day will affect people's demand for electricity. For example, when the temperature is high at noon in summer, people have a greater demand for cooling equipment such as air conditioners, and when the temperature is low in winter, people have a greater demand for heating equipment; wind power: typhoon weather along the coast will cause power transmission lines, substations and other power equipment to be damaged, affecting the size of the power load; humidity: in high-humidity weather, air conditioners, dehumidifiers and other dehumidification equipment increase sharply; electricity price policy: electricity consumption can be increased during periods of low power demand and reduced during periods of high power demand; whether it is a holiday: industrial or commercial activities during holidays will be suspended or reduced, which will have a greater impact on power load. Among them, historical power load data, power generation, temperature, wind power, humidity, electricity price policy and other factors are periodic, and power load data may also have a certain periodicity due to the influence of the above factors.
[0064] In some embodiments, the above historical impact data set may also be a preprocessed historical impact data set. Accordingly, the preprocessed historical impact data set may be input into the target fusion prediction model, thereby further improving the prediction accuracy of the model. Preprocessing may include but is not limited to: 1. Data cleaning, using cubic spline interpolation to supplement missing time series data, using mean to supplement non-time series data, and deleting outlier data; 2. Data normalization: scaling the values of all features to between 0 and 1. Preprocessing can eliminate noise and differences between different scales.
[0065] In some embodiments, see Figure 2 As shown, the above target fusion prediction model can be trained in the following way:
[0066] S1: Train the random forest model based on the sample data set corresponding to the historical influencing factor data set to obtain the feature extraction module;
[0067] S2: using the feature extraction module to determine the target sample data sets in the sample data sets that are respectively related to the power load data samples on each date within the period range, and extracting key sample data in the target sample data sets;
[0068] S3: using the key sample data as the input of the support vector regression model, continuously adjusting the model parameters of the support vector regression model, and obtaining a regression prediction module when the prediction error indicator data of the support vector regression model is less than a preset error threshold;
[0069] S4: Fusing the feature extraction module and the regression prediction module to obtain the target fusion prediction model.
[0070] In some embodiments, when training the target fusion prediction model, it involves training a random forest model (i.e., the above-mentioned feature extraction module can be finally trained) and training a support vector regression model (i.e., the above-mentioned regression prediction module can be finally trained), making full use of the powerful feature extraction capability of random forest (RF) and the powerful ability of support vector regression (SVR) to handle nonlinear problems in high-dimensional space and excellent ability to handle small sample problems, thereby improving the accuracy and robustness of small sample power load prediction. In addition, the key sample data extracted by random forest can be used as the input of support vector regression, which greatly reduces the number of sample data and reduces the dimension of sample data, thereby effectively improving the prediction efficiency. In addition, the periodicity of power load data is applied to model training, which can accurately determine the target sample data set related to the power load data samples of each date within the period range, thereby laying the foundation for accurately predicting power load data with extremely strong time-varying and nonlinear characteristics.
[0071] In some embodiments, the historical influencing factor data set may have the same period range as the power load data, wherein the period range includes dates (i.e., days), and the period range may be from 1 to n The historical influencing factor dataset is the current cycle of power load data ( i Belongs to 1,2,3... n , i The influencing factor dataset of the previous cycle or the previous period (days or dates in the current cycle) j Belongs to 1,2,3... n , j is the number of days or dates in the previous cycle) as the historical influencing factor data set.
[0072] In some embodiments, see Figure 3 As shown, the above cycle range can be determined as follows:
[0073] S1: Determine the complex wavelet coefficients of the historical power load data according to the historical power load data;
[0074] S2: Determine the real part variance of the complex wavelet coefficient according to the real part of the complex wavelet coefficient;
[0075] S3: Draw a period trend graph according to the real part variance of the complex wavelet coefficients to determine the period range from the period trend graph.
[0076] In some embodiments, in order to extract the accurate period range of the power load, wavelet analysis can be used to analyze the periodicity of the historical power load data. In order to eliminate the deviation of the analysis result caused by the boundary effect during continuous wavelet transformation, the historical power load data in S1 can be mirrored and expanded. N is the number of historical power load data. N / 2 Round down, the process of rounding down is recorded as floor(N / 2) , and finally get the expanded historical power load data, the process is:
[0077] (1)
[0078] in, N is the number of historical power load data; floor(N / 2) It is the process of rounding down half of the number of historical power load data; x ext [ k ] indicates that the first half of the historical power load data is forward mirrored and extended; x ext [ floor(N / 2)+k ] represents the historical power load data to be expanded; x ext [ floor(N / 2)+N+k ] indicates that the second half of the historical power load data is extended backwards by mirroring.
[0079] The above process is equivalent to mirroring the first half of a fixed-length data forward and the second half backward to obtain the final extended data, for example, 123456 is mirrored and expanded to 321123456654.
[0080] You can use x ext [ k ]、 x ext [ floor(N / 2)+N+k ] is recorded as the expanded historical power load data: f(t) Accordingly, the above S1, based on the historical power load data, determines the complex wavelet coefficients of the historical power load data, which may include:
[0081] The historical power load data is expanded to obtain the expanded historical power load data (the expansion processing is performed according to the above formula (1)); and the complex wavelet coefficients of the expanded historical power load data are determined.
[0082] Specifically, the complex wavelet coefficients of the expanded historical power load data can be determined according to the following formula:
[0083] (2)
[0084] in, W ( a,b ) is the complex wavelet coefficient of the expanded historical power load data; f(t) It is the expanded historical power load data; is the complex wavelet basis function; is the complex conjugate of the complex wavelet basis function; a is the scale parameter; b is the displacement parameter; t For time.
[0085] After determining the above complex wavelet coefficients W ( a,b ), the extended data (i.e. the above-mentioned extended historical power load data, such as 321123456654 in the above example, the purpose of which is to eliminate the deviation of the analysis results caused by the boundary effect during the continuous wavelet transform, and the final complex wavelet calculation result does not consider the calculation result of the extended part, but only considers the complex wavelet coefficients calculated by the original data (such as: 123456 in the above example), which is equivalent to first extending the original data for calculation, and then removing the calculation result of the extended data from the calculated result), to obtain the target complex wavelet coefficients of actual demand. Correspondingly, the above S2 determines the real part variance of the complex wavelet coefficient according to the real part of the complex wavelet coefficient, which can include:
[0086] According to the real part of the target complex wavelet coefficient W realj , determine the real part variance of the target complex wavelet coefficients.
[0087] Specifically, determining the real part variance of the target complex wavelet coefficient may include:
[0088] The real part average value of the target complex wavelet coefficient is determined according to the following formula:
[0089] (3)
[0090] in, is the average value of the real part of the target complex wavelet coefficients; W realj is the real part of the target complex wavelet coefficient; N is the number of historical power load data.
[0091] According to the real part average value of the target complex wavelet coefficient, the real part variance of the target complex wavelet coefficient is determined according to the following formula:
[0092] (4)
[0093] in, is the real part variance of the target complex wavelet coefficient; N is the number of historical power load data; W realj is the real part of the target complex wavelet coefficient; is the average value of the real part of the target complex wavelet coefficients.
[0094] Accordingly, the above S3 may specifically include: obtaining the main period according to the real part variance of the target complex wavelet coefficient n1 , draw the main cycle as n1 A periodic trend diagram is provided, so that the periodic range of the power load data can be determined from the periodic trend diagram.
[0095] Through the above embodiments, the period of power load data can be extracted to improve the accuracy of model training, thereby improving the accuracy of prediction.
[0096] In some embodiments, see Figure 4 As shown, the random forest model is trained based on the sample data set corresponding to the historical influencing factor data set to obtain the feature extraction module. When implemented specifically, it may include:
[0097] S1: Divide the sample data set corresponding to the historical influencing factor data set into a preset number of sample subsets;
[0098] S2: Selecting a training set and a test set from the sample subset;
[0099] S3: Training the random forest model based on the training set, verifying the training result based on the test set, and obtaining the feature extraction module, wherein the number of training times is equal to a preset number.
[0100] In some embodiments, the target fusion prediction model may integrate the random forest (RF) and support vector regression (SVR) algorithms. The random forest (RF) may be trained first to obtain a feature extraction module in the target fusion prediction model, that is, the trained random forest (RF) may be used as the feature extraction module.
[0101] Specifically, a sample data set corresponding to the historical influencing factor data set may be obtained first (it may also be a preprocessed sample data set, the specific preprocessing process is as described above, and this specification will not repeat it again), which may be as follows:
[0102] D(t) =[ L j(t) , G j (t) , T j (t), W j (t), H j (t) ,P j (t) , F j (t) ] (5)
[0103] in, D(t) is the sample data set corresponding to the historical influencing factor data set; j is the current cycle of power load data ( i Belongs to 1,2,3... n ) in the previous cycle ( j Belongs to 1,2,3... n ); L j (t) For the previous cycle j Historical load data for the day; G j (t) For the previous cycle j Daily power generation; T j (t) For the previous cycle j The temperature of the day; W j (t) For the previous cycle j The power of the wind of the sky; H j (t) For the previous cycle j The humidity of the day; P j (t) For the previous cycle j The electricity price policy of the day; F j (t) For the previous cycle j Whether the day is a holiday.
[0104] Correspondingly, the real power load data can be expressed as:
[0105] y i (t) = f ( L j (t), G j (t) , T j (t), W j (t), H j (t) ,P j (t) , F j (t) )(6)
[0106] in, y i (t) Indicates real power load data; i is the current cycle of power load data ( i Belongs to 1,2,3... n ) days or dates.
[0107] In order to improve the prediction accuracy, the number of optimal decision trees can be cross-validated. n_tree The K-fold cross validation method is used to select the above sample set. n_tree . The sample data set corresponding to the above historical influencing factor data set D(t) Divide into preset quantities (e.g. K ) sample subsets of equal size D1, D2, D3...DK , for each tree number n , the sample data D(t) In K -1 sample subset is used as the training set mentioned above, and the remaining 1 sample subset is used as the test set mentioned above D test,k , repeat the training based on the above training set K The test set is used to verify the training results of the training set. Suppose the training random forest (RF) model is M n , the prediction result obtained using the training set is:
[0108] y pred,k,i = M n ( D test,k )(7)
[0109] Among them, the number of decision trees mentioned above n_tree It can be determined according to the following formula:
[0110] 1. Calculation performance indicators:
[0111] (8)
[0112] in, S k ( n ) is a performance indicator; D k is the sample data set corresponding to the historical influencing factor data set; y i It is the real power load data; y pred,k,i is the prediction result obtained using the training set.
[0113] 2. According to the performance indicators, determine the average value of the performance indicators:
[0114] (9)
[0115] in, is the average value of the performance index (or average performance index); K is the number of sample subsets (i.e. the preset number mentioned above); S k ( n ) is a performance indicator.
[0116] 3. Determine the number of decision trees based on the average value of performance indicators n_tree (that is, the number of optimal trees):
[0117] (10)
[0118] in, n is the number of each tree in the decision tree; The parameter value that achieves the minimum in each tree (the value of the independent variable, not the minimum value itself).
[0119] In some embodiments, the training set can be used to train the constructed model, and the test set can be used to test the prediction results of the model after the model is trained.
[0120] In some embodiments, see Figure 5 As shown, the above-mentioned use of the feature extraction module to determine the target sample data sets in the sample data sets that are respectively related to the power load data samples on each date within the period range may include:
[0121] S1: sequentially fix the power load data samples of each date within the period range, and when fixed, traverse the sample data sets of each date within the period range;
[0122] S2: Inputting the traversed date sample data sets into the feature extraction module in sequence to determine the target prediction value from the prediction values output by the feature extraction module, wherein the evaluation index data corresponding to the target prediction value is less than a preset evaluation threshold;
[0123] S3: The target date sample data set corresponding to the target prediction value is used as the target sample data set.
[0124] In some embodiments, see Figure 6 As shown, the above extraction of key sample data from the target sample data set may include, in specific implementation, the following steps:
[0125] S1: randomly sampling a target sample data set to obtain a first target sample data set, and constructing a decision tree according to the first target sample data set;
[0126] S2: Randomly select sample data corresponding to historical influencing factors from the target sample data set as node splitting values of the decision tree;
[0127] S3: changing the node splitting value until a target splitting point is obtained, the weighted mean square error of the target splitting point is less than a preset weighted mean square error threshold, and the target splitting point represents the first historical influencing factor to be sorted;
[0128] S4: Determine an importance value of a target split point, and sort the first historical influencing factors according to the importance value, so as to select a target historical influencing factor from the first historical influencing factors as key sample data according to the sorting result, and the sorting result of the target historical influencing factor is greater than a preset sorting threshold.
[0129] In some embodiments, the feature extraction module described above can be used to screen or determine the period range and ({1,2,3...
[0130] n}), and the correlation between the target sample data set and the power load sample data of each date or day is greater than a preset correlation threshold (that is, the correlation is the largest, and the preset correlation threshold can be set according to actual needs, and this manual does not make specific restrictions on this). Afterwards, the above-mentioned feature extraction module can be used to extract key sample data from the target sample data set with the greatest correlation, and then the key sample data can be input into the subsequent support vector regression model to train the support vector regression model. By screening the target sample data set, the number of samples can be effectively reduced. By extracting the key sample data in the target sample data set, the dimension of the sample data can be effectively reduced or reduced, thereby improving the accuracy and efficiency of model prediction.
[0131] In some embodiments, when selecting a target sample data set related to the power load data samples of each date within a cycle (i.e., selecting the sample data set corresponding to the day that has the greatest impact on the power load data samples of each day in the cycle), the target sample data set within a fixed cycle range ({1,2,3... n}) for each date or day of the power load data sample, in a fixed i When, within the period range ({1,2,3... n}) Traverse the sample data set corresponding to the historical influencing factor data set D(t) That is, in fixed i hour, j From 1 to n The sample data sets of each date traversed can be input into the feature extraction module in sequence, and the output is from 1 to n The corresponding power load forecast value during the traversal is then used to determine the target forecast value. The evaluation index data corresponding to the target forecast value is less than the preset evaluation threshold (the preset evaluation threshold can be set according to actual needs and is not specifically limited in this specification). Finally, the sample data set of the target date or target day corresponding to the target forecast value can be used as a fixed i The target sample data set is the one with the strongest correlation with the power load data samples at that time.
[0132] For example: Fixed i =1, then j From 1 to n Traverse, using the feature extraction module to output 1 to n The corresponding predicted value is determined from 1 to n The evaluation index data corresponding to the corresponding predicted value, if the corresponding evaluation index data is the smallest when traversing 5 times, the sample data set traversing 5 times is used as the target sample data set. At this time, the target sample data can be as follows (that is, the 5th day is the day with the greatest impact on the power load on the 1st day of this cycle. Similarly, i Take 2 to n The corresponding target sample data set is not shown in this manual):
[0133] D(t) =[ L 5 (t) , G 5 (t) , T 5 (t), W 5 (t), H 5 (t) ,P 5 (t) , F5 (t) ]
[0134] The above evaluation index data can also be called the evaluation index data of power load, which can be used to predict the accuracy and reliability of the results, and can include: determining the system R 2 , Adjusted decision system R 2 , the corresponding formula is as follows:
[0135] (11)
[0136] (12)
[0137] in, R 2 To determine the system; Y i It is the real power load data; is the predicted value of power load; is the average value of the actual power load data; R 2 To adjust the decision system; n is the sample size; p is the number of independent variables in the model.
[0138] Selection decision system R 2 It can be used as the power load forecasting model to determine the degree of fit of the load and the selection and adjustment decision system. R 2 , the number of independent variables in the model was considered to avoid spurious increases in explanatory power due to the addition of variables. R 2 The closer it is to 1, the stronger the explanatory power of the model. R 2 This provides a fairer metric by penalizing model complexity.
[0139] Can be fixed i , j From 1 to n When traversing, the smallest R 2 and Adjusted R 2 (i.e. the above evaluation index data is less than the preset evaluation threshold) is used as the target sample data set and the i The power load data sample of the day is the same as that of the previous cycle. j The target sample data set of days is most relevant.
[0140] In the above embodiment, the period range obtained by wavelet analysis is used, and the sample data of each day is traversed within this range, and finally the optimal training data set can be found, thereby effectively improving the prediction accuracy of the model.
[0141] In some embodiments, the feature extraction module can be used to extract the historical influencing factors (which can be used as feature variables, that is, there can be 7 feature variables in total) in the target sample data set, that is, to extract the key sample data mentioned above. A The maximum number of features in the decision tree is set to be the number of feature variables extracted from the target sample data set D with 7 feature variables. max_feature :
[0142] max_feature=sqrt ( total_featur )(13)
[0143] That is, the maximum number of features is 4. A The possible values are 1, 2, 3, and 4. In addition to setting the maximum number of features for the above 7 feature variables, it is also necessary to randomly sample the target sample data set D every 15 minutes in a day. The number of samples is recorded as b0, and the unsampled data set is called out-of-bag data and recorded as b1. At this time, the out-of-bag data b1 is mainly considered to evaluate the model constructed by random forest. The sample data set obtained by randomly sampling the target sample data set can be used as the first target sample data set. Among them, the above random sampling process is based on autonomous sampling, and the above first target sample data set ( A feature variable datasets), constructed using sampling with replacement n Therefore, only some attributes are used in the training of each decision tree to avoid overfitting. Their classification results are combined to improve the accuracy of classification and regression. This method combines the classification accuracy of decision trees with the idea of randomization and has higher accuracy and robustness.
[0144] Afterwards, feature variables (i.e., sample data corresponding to historical influencing factors) can be randomly selected from the target sample data set D as the node splitting value of the decision tree (the left side of the node splitting value can be recorded as the left child node splitting value, and the right side can be recorded as the right child node splitting value). The node splitting value can be continuously changed (i.e., the left and right child node splitting values are changed) until the target splitting point is obtained, and the weighted mean square error of the target splitting point is less than the preset weighted mean square error threshold (i.e., the weighted mean square error of the target splitting point is the smallest). At this time, the target splitting node can be represented as the first sample data corresponding to the first historical influencing factor to be sorted in the sample data corresponding to the historical influencing factors.
[0145] The expression for splitting the value of the left child node is as follows:
[0146] (14)
[0147] The expression for splitting the value of the right child node is as follows:
[0148] (15)
[0149] The node splitting value can be continuously changed according to the following formula to make the weighted mean square error less than the preset weighted mean square error threshold to obtain the target splitting point:
[0150] (16)
[0151] in, n 1 is the number of samples contained in the set of the left child node of the target sample data set when it is split; n 2 is the number of samples contained in the set of the left child node of the target sample data set when it is split; I is the target split point; I 右节点 Split the value for the left child node; I 左节点 Split the value for the right child node; is the current power load of the left and right nodes; It is the arithmetic mean of the current power load.
[0152] Afterwards, the importance value of the target split point can be determined, and the first historical influencing factor (the first historical influencing factor can be located in the first sample data set) represented by it can be sorted from large to small in importance according to the importance value, and then the target historical influencing factor is selected from the first historical influencing factors according to the sorting result as the key sample data. The sorting result of the target historical influencing factor is greater than the preset sorting threshold (the preset sorting threshold can be set according to actual needs, and this manual does not make specific limitations on this).
[0153] Among them, the importance value of the target split point can be determined according to the following formula:
[0154] (17)
[0155] in, Vim is the important value of the target split point; R 2 J For the J The coefficient of determination of the tree; R 2 kJ To disrupt the J The coefficient of determination of a tree, J belongs to K ;K is the number of decision trees; S E for K The standard error of the decision tree.
[0156] In some embodiments, the model parameters of the support vector regression model may include at least a penalty factor and a gamma function, and the prediction error index data may include at least a MAE index and a RMSE index; accordingly, the continuous adjustment of the model parameters of the support vector regression model may include:
[0157] The penalty factor and the gamma function are continuously adjusted, and when the MAE index and the RMSE index are less than the corresponding preset error thresholds, the regression prediction module is obtained.
[0158] In some embodiments, the key sample data extracted above can be used as input features of a support vector regression model (SVR), and the model parameters of the support vector regression model can be continuously adjusted. When the prediction error index data of the support vector regression model is less than a preset error threshold (that is, when the prediction error is minimum, the prediction error threshold can be set according to actual needs, and this specification does not make specific limitations on this), a regression prediction module is obtained, and the above-mentioned feature extraction module and regression prediction module are integrated to obtain a trained target fusion prediction model.
[0159] Among them, since the power load has extremely strong time-varying and nonlinear characteristics, for nonlinear problems, the SVR algorithm maps the feature vector space through the kernel function, which can be transformed into an approximate linear regression problem after conversion. Therefore, the hyperparameters that need to be adjusted in nonlinear regression include the penalty coefficient C and the degree of penalty for the error term. The larger the C, the greater the degree of penalty for the error penalty case, which may lead to overfitting. The smaller the C, the smaller the degree of penalty for the error penalty case, which may lead to underfitting. C that is too large or too small will lead to poor generalization ability. Therefore, the penalty factor is initially set to 0.1, and the penalty factor is gradually increased. In the process of increasing the penalty factor, the point with the highest accuracy is found. Similarly, the relaxation factor and some variables caused by different types of kernel functions can be determined by global optimization through intelligent optimization algorithms.
[0160] The kernel function used in the above support vector regression model may be a radial basis kernel (RBF), which has the advantages of being relatively stable, having fewer parameters, and being able to realize nonlinear mapping. The above model parameters may at least include a penalty factor C and a gamma function (kernel function parameter g). By continuously adjusting the penalty factor C and the gamma function, the most accurate regression prediction model of the power load (i.e., the above regression prediction module) is finally obtained.
[0161] The above-mentioned prediction error index data may at least include the MAE index and the RMSE index (and may also include the Nash efficiency coefficient (NSE)), wherein the smaller the RMSE and MAE values are, the higher the prediction accuracy is. That is, when the MAE index and the RMSE index are less than the corresponding preset error thresholds, the prediction accuracy is the highest. The final target fusion prediction model, that is, the improved RF-SVR fusion model, is innovative in that RF-SVR is applied to power load prediction with extremely strong time-varying and nonlinear characteristics, and the corresponding training methods such as random forests are also adjusted.
[0162] Through the above target fusion prediction model, the power load can be accurately and efficiently predicted, so as to ensure the safe operation of the power system. In addition, the power generation plan can be adjusted by predicting the power load, so as to improve the operating efficiency of the generator set and obtain greater benefits.
[0163] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. For details, please refer to the description of the above-mentioned related processing related embodiments, and no further description is given here.
[0164] The above is an explanation of the present invention, however, it is worth noting that the specific embodiment is only for the purpose of better illustrating the present application and describing a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0165] In a specific implementation scenario, the historical power load data, power generation, temperature, wind speed, humidity, electricity price policy, whether it is a holiday, etc. from March 1 to September 1, 2023 in a certain city are used as input. Based on the above target fusion prediction model, the prediction results of power load data are obtained, see Figure 7 As shown, the following steps may be included:
[0166] Step 1: Get the original data, preprocess the original data, normalize the samples, etc. Specific data preprocessing may include: 1. Data cleaning, using cubic spline interpolation to supplement missing time series data, using mean to supplement non-time series data, and deleting outlier data; 2. Data normalization: scaling the values of all features to between 0 and 1.
[0167] Specifically, in step 1, the preprocessed data set is divided into a training set and a test set. The training set can be used to train the constructed model, and the test set can be used to test the prediction results of the model after the model is trained.
[0168] Step 2: Periodicity extraction: In order to improve the accuracy of the prediction, the complex wavelet coefficients of the power load are calculated using wavelet analysis, and the main period is obtained based on the real part variance of the complex wavelet coefficients. The periodic diagram of the power load is drawn based on the main period.
[0169] Step 3: Feature extraction module: historical power load, power generation, temperature, wind speed, humidity, electricity price policy and whether it is a holiday are used as input features, and the current electricity price is used as the target variable to build the RF model. The results obtained by the random forest algorithm are used to screen out important features that contribute more to power load forecasting (i.e. the key sample data mentioned above).
[0170] Specifically, in step 3, the RF algorithm is used to extract features from the preprocessed data, and the samples of each day of the previous week are used as inputs to independently predict the power load data of each day of this week. The mean square error is used as an evaluation index to select the most suitable sample. The RF algorithm is used to construct multiple decision trees for the seven factors that have an impact on the power load, namely historical power load data, power generation, temperature, wind power, humidity, electricity price policy, and whether it is a holiday. The judgment standard for the output weight is: the importance value output by the importance function constructed in the RF algorithm.
[0171] Step 4: Construct the SVR prediction algorithm module: Use the features calculated in step 3 as the input of the SVR model to find the optimal classification surface with the smallest error between the feature quantity and the feature variable and the separation surface.
[0172] Specifically, in step 4, the feature variables selected in step 3 are used as input data of the support vector regression algorithm to find the optimal classification surface with the smallest error between the feature variables and the separation surface (that is, the above process of continuously adjusting the penalty factor and the gamma function so that the MAE index and the RMSE index are less than the corresponding preset error threshold), and finally the target fusion prediction model is obtained.
[0173] The target fusion prediction model can be used to process the historical influencing factor data set that affects the power load data and output the prediction results of the power load data.
[0174] Although this specification provides examples such as the following embodiments or the attached Figure 8The method operation steps or device structure shown in the figure, but based on routine or no creative labor, the method or device may include more or fewer operation steps or module units after partial merger. In the steps or structures that do not have a necessary causal relationship logically, the execution order of these steps or the module structure of the device is not limited to the execution order or module structure shown in the embodiments of this specification or the drawings. When the method or module structure is applied to an actual device, server or terminal product, it can be executed sequentially or in parallel according to the method or module structure shown in the embodiments or the drawings (for example, in an environment of parallel processors or multi-threaded processing, or even in an implementation environment of distributed processing and server clusters). Based on the above-mentioned power load forecasting method based on improved RF-SVR, the embodiments of this specification also propose an embodiment of a power load forecasting device based on improved RF-SVR. As Figure 8 As shown, the device may specifically include the following modules:
[0175] The acquisition module 801 may be used to acquire a historical influencing factor dataset that affects the power load data, wherein the power load data and the historical influencing factor dataset have the same period range;
[0176] The prediction module 802 can be used to input the historical influencing factor data set into the target fusion prediction model to obtain the prediction result of the power load data; the target fusion prediction model includes a feature extraction module and a regression prediction module, the feature extraction module is used to extract the key data of the historical influencing factor data set, and the regression prediction module is used to process the input key data to obtain the prediction result of the power load data.
[0177] In some embodiments, the period range in the above-mentioned acquisition module 801 can be determined in the following manner: determine the complex wavelet coefficients of the historical power load data based on the historical power load data; determine the real part variance of the complex wavelet coefficients based on the real part of the complex wavelet coefficients; draw a period trend graph based on the real part variance of the complex wavelet coefficients to determine the period range from the period trend graph.
[0178] In some embodiments, the target fusion prediction model in the above-mentioned prediction module 802 is trained in the following manner: a random forest model is trained based on a sample data set corresponding to a historical influencing factor data set to obtain a feature extraction module; the feature extraction module is used to determine a target sample data set in the sample data set that is respectively related to the power load data samples on each date within the period range, and key sample data in the target sample data set is extracted; the key sample data is used as the input of a support vector regression model, and the model parameters of the support vector regression model are continuously adjusted, and a regression prediction module is obtained when the prediction error index data of the support vector regression model is less than a preset error threshold; the feature extraction module and the regression prediction module are integrated to obtain the target fusion prediction model.
[0179] In some embodiments, the above-mentioned prediction module 802 can be specifically used to divide the sample data set corresponding to the historical influencing factor data set into a preset number of sample subsets; select a training set and a test set from the sample subsets; train the random forest model based on the training set, and verify the training results based on the test set to obtain the feature extraction module, and the number of training times is equal to the preset number.
[0180] In some embodiments, the above-mentioned prediction module 802 can be specifically used to sequentially fix the power load data samples of each date within a period range, and when fixed, traverse the sample data sets of each date within the period range; input the traversed sample data sets of each date into the feature extraction module in turn to determine the target prediction value from the prediction value output by the feature extraction module, and the evaluation index data corresponding to the target prediction value is less than the preset evaluation threshold; and use the target date sample data set corresponding to the target prediction value as the target sample data set.
[0181] In some embodiments, the above-mentioned prediction module 802 can be specifically used to randomly sample the target sample data set to obtain a first target sample data set, and construct a decision tree based on the first target sample data set; randomly select sample data corresponding to historical influencing factors from the target sample data set as node splitting values of the decision tree; change the node splitting value until the target splitting point is obtained, the weighted mean square error of the target splitting point is less than the preset weighted mean square error threshold, and the target splitting point represents the first historical influencing factor to be sorted; determine the importance value of the target splitting point, and sort the first historical influencing factor according to the importance value, so as to select the target historical influencing factor from the first historical influencing factors according to the sorting result as the key sample data, and the sorting result of the target historical influencing factor is greater than the preset sorting threshold.
[0182] In some embodiments, the model parameters of the support vector regression model in the above-mentioned prediction module 802 may include at least a penalty factor and a gamma function, and the prediction error index data may include at least a MAE index and a RMSE index; accordingly, the above-mentioned prediction module 802 can be specifically used to continuously adjust the penalty factor and the gamma function, and when the MAE index and the RMSE index are less than the corresponding preset error thresholds, the regression prediction module is obtained.
[0183] As can be seen from the above, based on the power load forecasting device based on improved RF-SVR provided in the embodiment of this specification, on the one hand, the key sample data extracted by random forest can be used as the input of support vector regression, which greatly reduces the number of sample data and reduces the dimension of sample data, thereby effectively improving the prediction efficiency. On the other hand, by applying the periodicity of power load data in model training, the target sample data set related to the power load data samples of each date within the period range can be accurately determined, thereby laying the foundation for accurately predicting power load data with extremely strong time-varying and nonlinear characteristics. The above-mentioned target fusion prediction model can accurately and efficiently predict the power load, thereby ensuring the safe operation of the power system, and adjusting the power generation plan by predicting the power load, thereby improving the operating efficiency of the generator set to obtain greater benefits.
[0184] The embodiment of the present specification also provides an electronic device based on the above-mentioned power load forecasting method based on improved RF-SVR, including a processor and a memory for storing processor executable programs / instructions, and the processor can perform the following steps according to the program / instructions when implemented: obtaining a historical influencing factor data set that affects power load data, and the power load data and the historical influencing factor data set have the same period range; inputting the historical influencing factor data set into a target fusion prediction model to obtain a prediction result of the power load data; the target fusion prediction model includes a feature extraction module and a regression prediction module, the feature extraction module is used to extract key data of the historical influencing factor data set, and the regression prediction module is used to process the input key data to obtain a prediction result of the power load data.
[0185] In order to complete the above instructions more accurately, refer to Fig. 9 As shown, the embodiment of this specification also provides another specific electronic device, wherein the electronic device includes a network communication port 901, a processor 902 and a memory 903, and the above structures are connected through internal cables so that each structure can perform specific data interaction.
[0186] The network communication port 901 can be used to obtain a historical influencing factor dataset that affects the power load data, wherein the power load data and the historical influencing factor dataset have the same period range;
[0187] The processor 902 may be specifically configured to input the historical influencing factor data set into a target fusion prediction model to obtain a prediction result of the power load data; the target fusion prediction model includes a feature extraction module and a regression prediction module, the feature extraction module is configured to extract key data of the historical influencing factor data set, and the regression prediction module is configured to process the input key data to obtain a prediction result of the power load data;
[0188] The memory 903 may be specifically used to store corresponding instruction programs.
[0189] In this embodiment, the network communication port 901 can be a virtual port that is bound to different communication protocols so that different data can be sent or received. For example, the network communication port can be a port responsible for web data communication, a port responsible for FTP data communication, or a port responsible for email data communication. In addition, the network communication port can also be a physical communication interface or communication chip. For example, it can be a wireless mobile network communication chip, such as GSM, CDMA, etc.; it can also be a Wifi chip; it can also be a Bluetooth chip.
[0190] In this embodiment, the processor 902 may be implemented in any appropriate manner. For example, the processor may take the form of a microprocessor or a processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) executable by the (micro)processor, a logic gate, a switch, an application specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller, etc. This specification does not limit this.
[0191] In this embodiment, the memory 903 may include multiple levels. In a digital system, anything that can store binary data can be a memory; in an integrated circuit, a circuit with a storage function that has no physical form is also called a memory, such as RAM, FIFO, etc.; in a system, a storage device with a physical form is also called a memory, such as a memory stick, TF card, etc.
[0192] The embodiments of the present specification also provide a computer storage medium based on the above-mentioned power load forecasting method based on improved RF-SVR, wherein the computer storage medium stores a computer program / instruction, and when the computer program / instruction is executed, the following are achieved: obtaining a historical data set of influencing factors affecting power load data, wherein the power load data and the historical data set of influencing factors have the same period range; inputting the historical data set of influencing factors into a target fusion prediction model to obtain a prediction result of the power load data; the target fusion prediction model includes a feature extraction module and a regression prediction module, wherein the feature extraction module is used to extract key data of the historical data set of influencing factors, and the regression prediction module is used to process the input key data to obtain a prediction result of the power load data.
[0193] In this embodiment, the storage medium includes but is not limited to a random access memory (RAM), a read-only memory (ROM), a cache, a hard disk (HDD) or a memory card. The memory may be used to store computer program instructions. The network communication unit may be an interface for network connection communication set in accordance with the standard specified by the communication protocol.
[0194] In this embodiment, the functions and effects specifically implemented by the program instructions stored in the computer storage medium can be explained in comparison with other implementations and will not be described in detail here.
[0195] The embodiments of the present specification also provide a computer program product based on the above-mentioned power load forecasting method based on improved RF-SVR, including a non-transitory computer-readable storage medium storing a computer program / instruction, wherein the computer program / instruction is operable to cause the computer to perform the following steps: obtaining a historical data set of influencing factors affecting power load data, wherein the power load data and the historical data set of influencing factors have the same period range; inputting the historical data set of influencing factors into a target fusion prediction model to obtain a prediction result of the power load data; the target fusion prediction model includes a feature extraction module and a regression prediction module, wherein the feature extraction module is used to extract key data of the historical data set of influencing factors, and the regression prediction module is used to process the input key data to obtain a prediction result of the power load data.
[0196] Although the present specification provides method operation steps as described in the embodiments or flow charts, more or fewer operation steps may be included based on conventional or non-creative means. The order of steps listed in the embodiments is only one way of executing the order of many steps and does not represent the only order of execution. When the device or client product in practice is executed, it can be executed in sequence or in parallel according to the method shown in the embodiments or the drawings (for example, a parallel processor or a multi-threaded processing environment, or even a distributed data processing environment). The terms "include", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, product or device including a series of elements includes not only those elements, but also other elements that are not explicitly listed, or also includes elements inherent to such a process, method, product or device. In the absence of more restrictions, it is not excluded that there are other identical or equivalent elements in the process, method, product or device including the elements. The words first, second, etc. are used to represent the name, and do not represent any particular order.
[0197] Those skilled in the art also know that, in addition to implementing the controller in a purely computer-readable program code, the controller can be made to implement the same function in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, such a controller can be considered as a hardware component, and the devices for implementing various functions included therein can also be considered as structures within the hardware component. Or even, the devices for implementing various functions can be considered as both software modules for implementing the method and structures within the hardware component.
[0198] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, classes, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media including storage devices.
[0199] Through the description of the above embodiments, it can be known that those skilled in the art can clearly understand that the present specification can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present specification can essentially be embodied in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a mobile terminal, a server, or a network device, etc.) to execute the methods described in each embodiment of the present specification or some parts of the embodiments.
[0200] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. This specification can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, multi-processor systems, microprocessor-based systems, set-top boxes, programmable electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc.
[0201] Although the present specification is described through embodiments, persons skilled in the art will appreciate that there are many variations of the present specification without departing from the spirit of the present specification, and it is intended that the appended claims include these variations without departing from the spirit of the present specification.
Claims
1. A power load forecasting method based on improved RF-SVR, characterized in that: include: Acquire a historical influencing factor dataset that affects power load data, wherein the power load data and the historical influencing factor dataset have the same period range; The historical influencing factor data set is input into the target fusion prediction model to obtain the prediction result of the power load data; the target fusion prediction model includes a feature extraction module and a regression prediction module, the feature extraction module is obtained according to the random forest model training and is used to extract the key data of the historical influencing factor data set, and the regression prediction module is obtained according to the support vector regression model training and is used to process the input key data to obtain the prediction result of the power load data; The period range is determined in the following manner: The expanded historical power load data is determined according to the following formula: in, N is the number of historical power load data; floor(N / 2) It is the process of rounding down half of the number of historical power load data; x ext [ k ] indicates that the first half of the historical power load data is forward mirrored and extended; x ext [ floor (N / 2)+k ] represents the historical power load data to be expanded; x ext [ floor(N / 2)+N+k ] indicates that the second half of the historical power load data is extended backwards by mirroring; ext [ k ]、 x ext [ floor(N / 2)+N+k ] is recorded as the expanded historical power load data; in, N is the number of historical power load data; floor(N / 2) It is the process of rounding down half of the number of historical power load data; x ext [ k ] indicates that the first half of the historical power load data is forward mirrored and extended; x ext [ floor (N / 2)+k ] represents the historical power load data to be expanded; x ext [ floor(N / 2)+N+k ] indicates that the second half of the historical power load data is extended backwards by mirroring; ext [ k ]、 x ext [ floor(N / 2)+N+k ] is recorded as the expanded historical power load data; in, W ( a,b ) is the complex wavelet coefficient of the expanded historical power load data; f(t) It is the expanded historical power load data; is the complex wavelet basis function; is the complex conjugate of the complex wavelet basis function; a is the scale parameter; b is the displacement parameter; t For time; Removing the expanded historical power load data from the complex wavelet coefficients of the expanded historical power load data to obtain target complex wavelet coefficients; The average value of the real part of the target complex wavelet coefficients is determined according to the following formula: in, is the average value of the real part of the target complex wavelet coefficients; W realj is the real part of the target complex wavelet coefficient; N is the number of historical power load data; According to the average value of the real part of the target complex wavelet coefficient, the real part variance of the target complex wavelet coefficient is determined according to the following formula: in, is the real part variance of the target complex wavelet coefficient; N is the number of historical power load data; W realj is the real part of the target complex wavelet coefficient; is the average value of the real part of the target complex wavelet coefficients; A period trend graph is drawn according to the real part variance of the target complex wavelet coefficient, so as to determine the period range from the period trend graph.
2. The method according to claim 1, characterized in that The target fusion prediction model is trained in the following way: The random forest model is trained based on the sample data set corresponding to the historical influencing factor data set to obtain a feature extraction module; Determine, by using the feature extraction module, a target sample data set in the sample data set that is respectively related to the power load data samples on each date within the period range, and extract key sample data in the target sample data set; The key sample data is used as the input of the support vector regression model, and the model parameters of the support vector regression model are continuously adjusted, and when the prediction error indicator data of the support vector regression model is less than a preset error threshold, a regression prediction module is obtained; The feature extraction module and the regression prediction module are integrated to obtain the target fusion prediction model.
3. The method according to claim 2, characterized in that The random forest model is trained based on the sample data set corresponding to the historical influencing factor data set to obtain a feature extraction module, including: Divide the sample data set corresponding to the historical influencing factor data set into a preset number of sample subsets; Selecting a training set and a test set from the sample subset; The random forest model is trained based on the training set, and the training result is verified based on the test set to obtain the feature extraction module, and the number of training times is equal to a preset number.
4. The method according to claim 2, characterized in that: The step of using the feature extraction module to determine the target sample data sets in the sample data sets that are respectively related to the power load data samples on each date within the period range includes: Sequentially fix the power load data samples of each date within the period range, and when fixed, traverse the sample data sets of each date within the period range; Input the traversed date sample data sets into the feature extraction module in sequence to determine the target prediction value from the prediction values output by the feature extraction module, and the evaluation index data corresponding to the target prediction value is less than the preset evaluation threshold; The target date sample data set corresponding to the target prediction value is used as the target sample data set.
5. The method according to claim 2, characterized in that: The extracting key sample data from the target sample data set includes: Randomly sampling the target sample data set to obtain a first target sample data set, and constructing a decision tree according to the first target sample data set; Randomly select sample data corresponding to historical influencing factors from the target sample data set as node splitting values of the decision tree; Changing the node splitting value until a target splitting point is obtained, the weighted mean square error of the target splitting point is less than a preset weighted mean square error threshold, and the target splitting point represents the first historical influencing factor to be sorted; Determine an importance value of a target split point, and sort the first historical influencing factors according to the importance value, so as to select a target historical influencing factor from the first historical influencing factors according to the sorting result as key sample data, and the sorting result of the target historical influencing factor is greater than a preset sorting threshold.
6. The method according to claim 2, characterized in that The model parameters of the support vector regression model include at least a penalty factor and a gamma function, and the prediction error index data include at least a MAE index and a RMSE index; accordingly, the model parameters of the support vector regression model are continuously adjusted, including: The penalty factor and the gamma function are continuously adjusted, and when the MAE index and the RMSE index are less than the corresponding preset error thresholds, the regression prediction module is obtained.
7. A power load forecasting device based on improved RF-SVR, characterized in that: include: An acquisition module, used to acquire a data set of historical influencing factors affecting power load data, wherein the power load data and the data set of historical influencing factors have the same period range; A prediction module, used to input the historical influencing factor data set into the target fusion prediction model to obtain the prediction result of the power load data; the target fusion prediction model includes a feature extraction module and a regression prediction module, the feature extraction module is obtained according to the random forest model training and is used to extract the key data of the historical influencing factor data set, and the regression prediction module is obtained according to the support vector regression model training and is used to process the input key data to obtain the prediction result of the power load data; The period range is determined in the following manner: The expanded historical power load data is determined according to the following formula: in, N is the number of historical power load data; floor(N / 2) It is the process of rounding down half of the number of historical power load data; x ext [ k ] indicates that the first half of the historical power load data is forward mirrored and extended; x ext [ floor (N / 2)+k ] represents the historical power load data to be expanded; x ext [ floor(N / 2)+N+k ] indicates that the second half of the historical power load data is extended backwards by mirroring; ext [ k ]、 x ext [ floor(N / 2)+N+k ] is recorded as the expanded historical power load data; According to the expanded historical power load data, the complex wavelet coefficients of the expanded historical power load data are determined according to the following formula: in, W ( a,b ) is the complex wavelet coefficient of the expanded historical power load data; f(t) It is the expanded historical power load data; is the complex wavelet basis function; is the complex conjugate of the complex wavelet basis function; a is the scale parameter; b is the displacement parameter; t For time; Removing the expanded historical power load data from the complex wavelet coefficients of the expanded historical power load data to obtain target complex wavelet coefficients; The average value of the real part of the target complex wavelet coefficients is determined according to the following formula: in, is the average value of the real part of the target complex wavelet coefficients; W realj is the real part of the target complex wavelet coefficient; N is the number of historical power load data; According to the average value of the real part of the target complex wavelet coefficient, the real part variance of the target complex wavelet coefficient is determined according to the following formula: in, is the real part variance of the target complex wavelet coefficient; N is the number of historical power load data; W realj is the real part of the target complex wavelet coefficient; is the average value of the real part of the target complex wavelet coefficients; A period trend graph is drawn according to the real part variance of the target complex wavelet coefficient, so as to determine the period range from the period trend graph.
8. A computer device comprising a memory, a processor and a computer program / instruction stored in the memory, characterized in that: The processor executes the computer program / instructions to implement the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Bus load prediction method
CN106485262A
Short-term load prediction method based on variant selection and Gaussian process regression
CN106971240A