Monthly electricity consumption forecasting method based on future online user group agency electricity purchasing business

By constructing a historical electricity consumption dataset for future online user groups and combining it with meteorological data and machine learning algorithms, the problems of dynamic changes and short-term mutations in user electricity consumption behavior in traditional forecasting methods are solved, and the accuracy and stability of proxy electricity purchase forecasts are improved.

CN120124818BActive Publication Date: 2025-09-26STATE GRID ZHEJIANG ELECTRIC POWER CO MARKETING SERVICE CENT
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510601382.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-12
Publication Date
2025-09-26
Estimated Expiration
2045-05-12

AI Technical Summary

Technical Problem

Traditional forecasting methods find it difficult to capture the dynamic changes and short-term mutations in the electricity consumption behavior of user groups, resulting in limited forecasting accuracy. Especially in the agency electricity purchasing business, the dynamic grid-connecting and grid-exiting behavior of users makes it difficult to accurately predict the electricity consumption curve.

Method used

By constructing a historical electricity consumption dataset for future online user groups, combining meteorological data with machine learning algorithms, and using Pearson correlation coefficient analysis and support vector regression models, data repair and feature extraction are performed, and model parameters are optimized to improve prediction accuracy.

Benefits of technology

It significantly improves the accuracy and robustness of agent power purchase forecasts, enhances data integrity, optimizes the forecast model, provides a scientific basis for power dispatch and power purchase strategies, and reduces forecast risks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120124818B_ABST
    Figure CN120124818B_ABST
Patent Text Reader

Abstract

This application is a monthly electricity consumption forecasting method based on the future online user group's agency electricity purchasing business, which belongs to the field of electricity consumption forecasting. In order to solve the problem that the results obtained by the existing method are not ideal, the following steps are provided: constructing a future online user set to obtain an electricity consumption data set and meteorological data; setting detection items, arranging the electricity consumption data and temperature data in reverse chronological order, and forming a historical data set of the future online user group; identifying abnormal data in the detection items and repairing them to obtain a repaired data set; obtaining the electricity consumption change trend of the online agency electricity purchasing user group, repairing the historical data missing from the detection items, and obtaining a repaired data set; obtaining the relationship between meteorology and electricity consumption; modeling the extracted features, and then training and testing the model to obtain a tested model; using the model to predict electricity consumption in the future. This application not only enhances data integrity, but also optimizes the prediction model, effectively reduces prediction risks, and improves the reliability and efficiency of power services.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of electricity consumption forecasting, and in particular to a monthly electricity consumption forecasting method based on the future electricity purchasing business of a group of online users. Background Art

[0002] Since electricity demand is affected by many factors, such as the electricity usage habits of user groups, the economic environment, and policy orientations, and for the electricity usage of the industrial and commercial power purchasing user group, the users' dynamic grid connection and disconnection behavior will bring short-term mutations to the electricity consumption curve that cannot be directly predicted, traditional forecasting methods often find it difficult to capture these dynamic changes.

[0003] When forecasting future proxy power purchases for on-grid user groups, given the significant differences in electricity consumption behaviors and demand characteristics among different user groups, leveraging detailed user profile information and historical electricity consumption data to analyze and forecast electricity demand by user group is key to improving forecast accuracy. With the widespread adoption of smart grids and the rapid development of big data technology, the accumulation of massive amounts of user electricity consumption data, socioeconomic data, and policy-driven data has made it possible to gain a deeper understanding of the electricity consumption characteristics and driving factors of each user group, thereby helping to improve the accuracy and timeliness of proxy power purchase forecasts.

[0004] Currently, the technical solution closest to the present invention is "A Method for Predicting Proxy Electricity Purchases" (Publication No.: CN117236487A). The system's workflow includes: first, clarifying the prediction object, collecting relevant historical data and data on external influencing factors (such as policies and weather), and identifying and correcting outliers in the massive data; second, establishing a prediction model library covering multiple prediction models, selecting appropriate models based on the historical patterns of the prediction object, and iteratively optimizing model parameters using methods such as genetic algorithms; then, based on multiple preferred models, constructing a comprehensive prediction model, integrating the advantages of different models through weighted or integrated methods to generate more accurate proxy electricity purchase forecast results; finally, post-evaluating the prediction results of the comprehensive prediction model, analyzing the prediction errors and feeding them back to the model, and continuously improving model performance through iterative optimization to ensure the continuous optimization of the prediction method.

[0005] There are two key problems with existing technologies: first, genetic algorithm model parameter optimization is prone to falling into local optimal solutions, resulting in limited prediction accuracy; second, existing methods are difficult to effectively deal with the short-term sudden changes in electricity consumption curves caused by users' dynamic grid connection and exit behaviors. Summary of the Invention

[0006] In response to the problem that the results obtained by existing methods are not ideal, this application provides a monthly electricity consumption prediction method based on the future proxy electricity purchasing business of the online user group. By introducing advanced machine learning algorithms, it can not only break through the local optimal limitations of traditional optimization algorithms, but also accurately capture the nonlinear characteristics and short-term fluctuations brought about by changes in user group behavior, significantly improving the accuracy and robustness of proxy electricity purchasing predictions.

[0007] A method for predicting monthly power consumption based on future power purchasing services of a group of online users includes the following steps:

[0008] S1: Build a future online user set based on the current online proxy electricity purchasing user group, process historical electricity usage data based on the objects involved in the future online user set, and obtain a historical electricity usage data set for the future online user set; and obtain temperature data from meteorological data through an API interface;

[0009] S2 sets the monthly maximum temperature and monthly power consumption as detection items, and arranges the power consumption data obtained in S1 and the temperature data in the meteorological data in reverse chronological order to form a historical dataset of the future online user group. It identifies abnormal data in the detection items in the historical dataset of the future online user group and repairs the detected abnormal data to obtain a repaired dataset to ensure data integrity and provide data support for subsequent model training and power consumption prediction.

[0010] S3, using the results of S2 to obtain the electricity consumption trend of the online electricity purchasing agent user group. In the case of incomplete historical data due to the initial entry of users into the market, the reverse prediction filling method is used. Combined with the electricity consumption trend of the existing time period, based on the results of S2, the historical data of the missing detection items are repaired to obtain a repaired data set;

[0011] S4, based on the results of S3, obtain the relationship between meteorological conditions and power consumption through Pearson correlation coefficient analysis;

[0012] S5: Based on the results of S4, feature extraction is performed on the relationship between weather and electricity consumption. The extracted features include the monthly maximum temperature and monthly electricity consumption. The patched dataset obtained in S3 is divided into a training set, a validation set, and a test set. The extracted features are modeled using the training set, and cross-validation techniques are used to evaluate and select the optimal model parameters on the validation set to obtain the trained model. The trained model is tested on the test set to evaluate the model's predictive performance and obtain the tested model.

[0013] S6, using the tested model to predict the power consumption in the future period to obtain the prediction result.

[0014] Furthermore, the specific process of step S1 is: the constructed future online user set includes stable users, future offline users and future online users, and the historical electricity consumption data set of the future online user set is constructed by excluding the historical electricity consumption data of future offline users and adding the historical electricity consumption data of future online users.

[0015] Regarding the electricity consumption of the proxy industrial and commercial electricity purchasing user group, since the dynamic grid connection and disconnection behavior of users will bring about short-term sudden changes in the electricity consumption curve that cannot be directly predicted, it is necessary to consider dividing the current grid-connected proxy electricity purchasing user group into the following three categories:

[0016] (1) Stable user group: users who are continuously online and whose electricity usage behavior is relatively stable.

[0017] (2) Users who will quit the network in the future: users who are expected to quit the network in the future.

[0018] (3) Future network users: users who are expected to join the network in the future.

[0019] Furthermore, the specific method of step S2 is:

[0020] S2.1, extracting power data and temperature data based on the determined prediction object, and arranging the power data and temperature data in reverse chronological order to facilitate subsequent reverse time series prediction;

[0021] S2.2, use the sliding window method to identify anomalies in the electricity data and temperature data in the meteorological data (such as missing data or sudden changes in values), and use interpolation to repair them:

[0022] In the case of missing temperature, the mean of the same detection item in adjacent months is used for interpolation;

[0023] In the case of missing electricity data, linear interpolation is performed based on the user's recent electricity consumption trend;

[0024] If a sudden change value is detected, it is corrected by using the sliding window mean or trend fitting after determining the abnormality through the threshold;

[0025] S2.3, obtain the repaired dataset.

[0026] Furthermore, the specific process of step S2.1 includes:

[0027] S2.1.1, based on the monthly electricity forecast demand of the power purchasing agent business, select the total electricity as the forecast object, and set the overall electricity consumption as the total electricity to reflect the overall electricity demand.

[0028] S2.1.2, determine the available features: Available features are factors that affect the prediction object. Temperature data in meteorological data is selected as an available feature because it has a clear correlation with electricity demand;

[0029] S2.1.3, arrange the power data and temperature data in reverse chronological order to organize the power data and temperature data to form a historical data set of the future online user group.

[0030] Furthermore, the specific process of step S4 includes:

[0031] S4.1, based on the S3 patched dataset, uses statistical analysis and machine learning methods to extract the nonlinear relationship between meteorological factors and power consumption through the Pearson correlation coefficient. Its mathematical expression is:

[0032] (1)

[0033] Where: r is the Pearson correlation coefficient, and its value range is [-1,1]. r = 1, it is completely positively correlated. r = -1 is completely negatively correlated. r =0 when there is no linear correlation; is the independent variable, representing the variables that affect power prediction, such as temperature; is the dependent variable, representing the monthly electricity consumption of the future online user group’s power purchasing business; and is the mean of the two variables.

[0034] S4.2, based on the Pearson correlation coefficient analysis results in S4.1, extract the correlation pattern between meteorological conditions and electricity consumption.

[0035] Furthermore, the laws between weather and electricity include:

[0036] Summer (June-August) and winter (December-February), typically peak electricity consumption periods, show a significant correlation between electricity consumption and temperature fluctuations. Specifically, summer temperature is positively correlated with electricity consumption. When temperatures exceed 28°C, demand for air conditioning and cooling surges, leading to a significant increase in electricity consumption. Winter electricity load is negatively correlated with temperature. When temperatures fall below 5°C, heating demand increases significantly, leading to a surge in electricity consumption. In spring and autumn (March-May and September-November), electricity consumption fluctuates more gradually due to moderate temperatures.

[0037] Furthermore, since the electricity consumption changes in special months are significantly different from those in normal months, specifically including:

[0038] (1) Special seasonal months: In summer (June to August) and winter (December to February), the change in power consumption is greatly affected by temperature characteristics.

[0039] (2) Special holiday months: During the Spring Festival and the 15 days before and after the festival, electricity consumption will be significantly reduced, mainly affected by the characteristics of the date.

[0040] For special months, a rule-based model is used for forecasting, adjusting power consumption based on historical experience and business rules. Power consumption in normal months is relatively stable, primarily influenced by regular weather conditions and electricity consumption behavior.

[0041] Support Vector Regression (SVR) is used to model and train the extracted features, and cross-validation is employed to select the optimal model parameters to improve the model's generalization and robustness. The selection and optimization of the kernel function are particularly important steps. The choice of kernel function directly impacts the model's nonlinear mapping capabilities and predictive performance, and optimization of the kernel function parameters requires fine-tuning through cross-validation. This step requires not only selecting an appropriate kernel function type (such as RBF kernel, polynomial kernel, etc.) based on the specific characteristics of the problem, but also experimentally determining the optimal kernel function parameters to ensure optimal model performance in high-dimensional feature spaces.

[0042] Furthermore, the specific process of step S5 is as follows:

[0043] S5.1, divide the S3 patched dataset into training set, validation set, and test set;

[0044] S5.2, select the monthly feature vectors including the monthly maximum temperature and monthly electricity consumption in the historical data as the input features of the model;

[0045] S5.3, distinguish special months from normal months by setting judgment conditions; for special months, use rule-based models for prediction; for normal months, build support vector regression prediction models for prediction;

[0046] S5.4, construct the loss function and optimization objective; introduce slack variables and construct the original SVR problem;

[0047] S5.5, using Lagrange multipliers and Karush-Kuhn-Tucker conditions to transform the original SVR problem into its dual form;

[0048] S5.6, replace the dot product with a kernel function by computing the Lagrange multipliers and finding the support vectors in the expansion.

[0049] All kernel functions that satisfy the theorem are admissible kernels. and Before regressing the parameter vector, choose an appropriate regularization parameter , loss function parameters And the kernel parameters chosen are important.

[0050] Furthermore, the specific process of S5.3 is as follows:

[0051] S5.3.1: The criteria for determining whether a month is a special month include the month of a statutory long holiday, a month with frequent extreme weather events (e.g., July with continuous high temperatures), etc. The rest are normal months;

[0052] S5.3.2, for special months, the rule model is used for prediction, and its expression is:

[0053] (2)

[0054] Where: is the predicted amount of electricity; is the intercept term; For the Non-holiday characteristic variables in time t The value of is the corresponding regression coefficient; For the j Holiday effect variables in time t The indicator function takes the value of 0 or 1; is the corresponding holiday effect coefficient; is the error term;

[0055] S5.3.3, for normal months, a support vector regression prediction model is constructed for prediction. The expression of the support vector regression prediction model is:

[0056] (3)

[0057] Where: is the predicted output value, i.e. the predicted electricity consumption in the target month, is the weight vector of the regression hyperplane, i.e., the characteristic coefficient, which determines the contribution of each input feature to the power prediction; is a nonlinear mapping function, the input from Space transformation to higher dimensional space ; is the bias term, which is a constant used to adjust the intercept of the regression hyperplane. for dimensional mapping space, the dimension may be much higher than the original input space.

[0058] Beneficial Effects: This application provides a monthly electricity consumption forecasting method based on the proxy electricity purchasing service for future online users. By constructing a historical electricity usage dataset for the "future online" proxy electricity purchasing user group and combining it with "reverse" forecasting to fill in the gaps in historical data, this method can comprehensively reflect user electricity consumption trends and improve the accuracy and stability of monthly proxy electricity purchase forecasts. This method not only enhances data integrity but also optimizes the forecasting model, providing a scientific basis for power dispatch and purchasing strategies, effectively reducing forecasting risks, and improving the reliability and efficiency of power services. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] Figure 1 This is a flow chart of an embodiment of the present application;

[0060] Figure 2 This is the recognition result diagram of Table 1;

[0061] Figure 3 for Figure 2 Filling result map;

[0062] Figure 4 This is the correlation diagram between weather and electricity;

[0063] Figure 5 It is the correlation diagram between sensitivity and power;

[0064] Figure 6 This is the error distribution diagram of the training results. DETAILED DESCRIPTION

[0065] The technical solutions of the embodiments of the present invention are explained and described below, but the following embodiments are only preferred embodiments of the present invention and are not exhaustive. Based on the embodiments in the embodiments, other embodiments obtained by those skilled in the art without creative work are all within the scope of protection of the present invention.

[0066] The flowchart of the monthly power consumption prediction method based on the future online user group's power purchasing business is as follows: Figure 1 As shown, the following steps are included:

[0067] The implementation was carried out based on the monthly electricity sales data of a power company. The calculation was carried out based on the data from 2022 to 2024. The implementation process and results are as follows:

[0068] S1, based on the current on-grid agent electricity purchasing user group, construct the future on-grid user set, process the historical electricity consumption data based on the objects involved in the future on-grid user set, and obtain the historical electricity consumption data set of the future on-grid user set; the constructed future on-grid user set includes stable users, future off-grid users and future on-grid users, and by excluding the historical electricity consumption data of future off-grid users and adding the historical electricity consumption data of future on-grid users, a historical electricity consumption data set of the future on-grid user set is constructed.

[0069] Regarding the electricity consumption of the proxy industrial and commercial electricity purchasing user group, since the dynamic grid connection and disconnection behavior of users will bring about short-term sudden changes in the electricity consumption curve that cannot be directly predicted, it is necessary to consider dividing the current grid-connected proxy electricity purchasing user group into the following three categories:

[0070] Stable user group: users who are continuously online and whose electricity usage behavior is relatively stable.

[0071] Users who will quit the network in the future: users who are expected to quit the network in the future.

[0072] Future network users: users who are expected to join the network in the future.

[0073] Construct a new data set of historical electricity consumption of the future online electricity purchasing user group, the expression of which is:

[0074]

[0075] in, To stabilize the historical electricity consumption data of the user group, For the historical electricity consumption data of future network users, The historical electricity consumption data of users who will be disconnected from the grid in the future is removed and the historical electricity consumption data of users who will be connected to the grid in the future is added to accurately reflect the electricity consumption of the future grid user group.

[0076] Taking September 2024 as the prediction target, the characteristic information data of the monthly proxy electricity purchasing users are obtained, including the monthly proxy electricity purchasing user profile and operating capacity. Based on the user list, a sample set is constructed using historical user data. This sample set is based on the proxy electricity purchasing user group from January 2022 to August 2024, and a future state sample set for September 2024 is constructed, as shown in Table 1.

[0077] Table 1

[0078]

[0079] Through the API interface, the historical meteorological data of a province from January 2003 to August 2004 are obtained as shown in Table 2.

[0080] Table 2

[0081]

[0082] In S2, set the monthly maximum temperature and monthly electricity consumption as detection items, and arrange the electricity consumption data obtained in S1 and the temperature data in the meteorological data in reverse chronological order to form a historical dataset of the future online user group. Based on the historical dataset of the future online user group, use the sliding window method to identify abnormal values ​​of the detection items (such as missing data or sudden changes in values), and use the interpolation method to repair the detection items to obtain a repaired dataset; the specific method is as follows:

[0083] S2.1. Extracting power data and temperature data based on the determined prediction object and arranging them in reverse chronological order to facilitate subsequent reverse time series prediction. The specific process includes:

[0084] S2.1.1, based on the monthly electricity demand forecast for the power purchasing agent business, select the total electricity data as the forecast object, and set the overall electricity consumption as the total electricity to reflect the overall electricity demand;

[0085] S2.1.2, determine the available features: Available features are factors that affect the prediction object. Temperature data in meteorological data is selected as an available feature because it has a clear correlation with electricity demand;

[0086] S2.1.3, arrange the power data and temperature data in reverse chronological order to organize the power data and temperature data to form a historical data set of the future online user group.

[0087] S2.2: Use the sliding window method to identify anomalies in the electricity consumption data and meteorological temperature data (such as missing data or sudden changes in values) in the historical data of the future user group, and use interpolation to repair them:

[0088] In the case of missing temperature, the mean of the same detection item in adjacent months is used for interpolation;

[0089] In the case of missing electricity data, linear interpolation is performed based on the user's recent electricity consumption trend;

[0090] If a sudden change value is detected, it is corrected by using the sliding window mean or trend fitting after determining the abnormality through the threshold;

[0091] S2.3, obtain the repaired dataset.

[0092] Detect the full amount of data in the future state sample data set, identify and process the user dimension data, including power and meteorological data, identify data missing, data mutation and other problems, and the identification results are as follows: Figure 2 shown.

[0093] After identification, automatic repair is performed, and the data is covered by interpolation method, and filled according to the logic of historical data mean. The result after filling is as follows Figure 3 shown.

[0094] S3, using the results of S2 (repaired dataset) to obtain the electricity consumption change trend of the existing data of the online power purchasing user group. In case of incomplete historical data due to the initial entry of users into the market, the reverse prediction filling method is used. Combined with the electricity consumption change trend of the existing time period, based on the results of S2 (repaired dataset), the historical data with missing detection items is repaired to obtain a repaired dataset;

[0095] The filling logic reversely infers the historical and long-term electricity data based on the electricity data generated by the user and the recent electricity data. The filling results are shown in Table 3 (the bold numbers are the data after filling).

[0096] Table 3

[0097]

[0098] S4, based on the results of S3 (the patched data set), obtain the relationship between weather and power consumption through Pearson correlation coefficient analysis. The specific process of step S4 includes:

[0099] S4.1, based on the results of S3 (patched data set), uses statistical analysis and machine learning methods to extract the nonlinear relationship between meteorological factors and power consumption. Its mathematical expression is:

[0100] (1)

[0101] Where: r is the Pearson correlation coefficient, and its value range is [-1,1]. r = 1, it is completely positively correlated. r = -1 is completely negative correlation. r =0 when there is no linear correlation; is the independent variable, representing the variable that affects the power forecast; is the dependent variable, representing the monthly electricity consumption of the future online user group’s power purchasing business; and is the mean of the two variables, is the total number of training samples.

[0102] S4.2, based on the Pearson correlation coefficient analysis results in S4.1, extract the correlation pattern between meteorological conditions and electricity consumption.

[0103] The correlation analysis between meteorological data and electricity data is carried out through the Pearson correlation coefficient, which assists in supporting algorithm feature engineering and coding, converts meteorological data into analytical data through algorithms, and applies it in a standardized form. Figure 4 and Figure 5 shown.

[0104] S5: Based on the results of S4, feature extraction is performed on the relationship between weather and electricity consumption. The extracted features include the monthly maximum temperature and monthly electricity consumption. The patched dataset obtained in S3 is divided into a training set, a validation set, and a test set. The extracted features are modeled using the training set, and cross-validation technology is used to evaluate and select the optimal model parameters on the validation set to obtain the trained model. The trained model is tested on the test set to evaluate the model's prediction performance and obtain the tested model. The specific process is as follows:

[0105] S5.1, divide the S3 patched dataset into training set, validation set, and test set;

[0106] S5.2, select the monthly feature vectors including the monthly maximum temperature, monthly minimum temperature, monthly electricity consumption, etc. As input features of the model;

[0107] Where: for No. Input feature vector of month (transposed form); For the Monthly maximum temperature, For the Monthly electricity consumption; Represents vector transpose.

[0108] S5.3, distinguish special months from normal months by setting judgment conditions; for special months, use the rule model for prediction; for normal months, build a support vector regression prediction model for prediction; in this embodiment, the distinction results are shown in Table 4.

[0109] Table 4

[0110]

[0111] Specifically include:

[0112] S5.3.1: The criteria for determining whether a month is a special month include the month of a statutory long holiday, a month with frequent extreme weather events (e.g., July with continuous high temperatures), etc. The rest are normal months;

[0113] S5.3.2, for special months, the rule model is used for prediction, and its expression is:

[0114] (2)

[0115] Where: is the predicted amount of electricity; is the intercept term; For the Non-holiday characteristic variables in time t The value of is the corresponding regression coefficient; For the j Holiday effect variables in time t The indicator function takes the value of 0 or 1; is the corresponding holiday effect coefficient; is the error term;

[0116] S5.3.3, for normal months, a support vector regression prediction model is constructed for prediction. The expression of the support vector regression prediction model is:

[0117] (3)

[0118] Where: is the predicted output value, i.e. the predicted electricity consumption in the target month, is the weight vector of the regression hyperplane, i.e., the characteristic coefficient, which determines the contribution of each input feature to the power prediction; is a nonlinear mapping function, the input from Space transformation to higher dimensional space ; is the bias term, which is a constant used to adjust the intercept of the regression hyperplane. for dimensional mapping space, the dimension may be much higher than the original input space.

[0119] S5.4, construct the loss function and optimization objective; introduce slack variables and construct the original problem of SVR; in order to measure the gap between the actual value and the predicted value, Vapnik introduced Insensitive loss function . The purpose is to find a scalar with the output At least exists The function of the deviation, where and This can be achieved by minimizing the following regularization function To obtain:

[0120] (4)

[0121] Where: is the weight vector (i.e., characteristic coefficient) of the regression hyperplane; is the penalty coefficient, which is used to balance the weight of model complexity and training error; is the total number of training samples.

[0122] (5)

[0123] Where: is the error tolerance threshold; For the The actual power value of each sample; For the model The predicted power value of samples; No. The input feature vector of samples. Yes Insensitive loss function. If and only if the observation value is in the insensitive area or outside the insensitive area, it can be used as the construction decision function. In order to indicate the error outside the insensitive region, the slack variable is introduced The original problem of constructing SVR is expressed as:

[0124] (6)

[0125] Where: is the weight vector (i.e., characteristic coefficient) of the regression hyperplane; is the weight vector norm squared; is the penalty coefficient; 、 are slack variables, corresponding to the upper and lower bound errors respectively; is the total number of training samples; For the The actual power value of each sample; No. The input feature vector of samples; is a nonlinear mapping function; is the bias term (constant); is the error tolerance threshold.

[0126] S5.5, using Lagrange multipliers and Karush-Kuhn-Tucker conditions to transform the original SVR problem into its dual form;

[0127] The linear constraints of the quadratic programming and the original problem guarantee that SVR will always achieve the global optimal solution. Indicates the complexity of the model; parameters Complexity and training error expressed as a function The balance between If the value of is too large, the algorithm will overfit the data and the generalization ability will become lower); parameter Controls the width of the insensitive area, The higher it is, the fewer support vectors are selected; and Represents the original parameters of SVR, which are generally determined by cross-validation. Lagrange multipliers can be used The Karush-Kuhn-Tucker condition transforms the above problem into a dual form:

[0128] (7)

[0129] Where: 、 are dual variables, corresponding to the original problem and constraints; Representation feature space The dot product in ; For the The actual power value of each sample; No. The input feature vector of samples; is the error tolerance threshold; is the total number of training samples; is the penalty coefficient.

[0130] The support vectors are found by computing the Lagrange multipliers and expanding them: From the perspective of solving the dual problem, The function can be written as:

[0131] (8)

[0132] Where: 、 are dual variables, corresponding to the original problem and constraints; Representation feature space The dot product in ; is the bias term (constant).

[0133] S5.6, by calculating the Lagrange multiplier and finding the support vector in the expansion, the kernel function is used to replace the dot product. , use the kernel function to replace the dot product, as shown in formula (9):

[0134] (9)

[0135] Where: is the training data; For input data, is the kernel function, kernel function , which is important for the predictive ability of SVR; is a bias term (constant). All kernel functions that satisfy the theorem are admissible kernels. and Before regressing the parameter vector, choose an appropriate regularization parameter , loss function parameters And the kernel parameters chosen are important.

[0136] All kernel functions that satisfy the theorem are admissible kernels. and Before regressing the parameter vector, choose an appropriate regularization parameter , loss function parameters And the kernel parameters chosen are important.

[0137] The data from January 2022 to December 2024 are divided into data sets, the data from January 2022 to January 2024 are the training set, the data from February 2024 to May 2024 are the validation set, and the data from June 2024 to August 2024 are the test set.

[0138] In order to predict the monthly demand for electricity purchase by agents, the SVR (support vector machine regression) algorithm is selected for prediction, and the main parameter configuration is shown in Table 5.

[0139] Table 5

[0140]

[0141] The error distribution of the sample data training results is as follows Figure 6 shown.

[0142] S5: Based on the results of S4, feature extraction is performed on the relationship between weather and electricity consumption. The extracted features include the monthly maximum temperature and monthly electricity consumption. The patched dataset obtained in S3 is divided into a training set, a validation set, and a test set. The extracted features are modeled using the training set, and cross-validation techniques are used to evaluate and select the optimal model parameters on the validation set to obtain the trained model. The trained model is tested on the test set to evaluate the model's predictive performance and obtain the tested model.

[0143] The test set is data from June 2024 to August 2024, and the model test verification results are shown in Table 6.

[0144] Table 6

[0145]

[0146] S6: Use the tested model to predict the electricity consumption in the future and obtain the prediction results. The monthly electricity consumption of the agent industry and commerce in a certain province in September 2024 is predicted, and the prediction results are shown in Table 7.

[0147] Table 7

[0148]

[0149] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the field can still modify or replace the specific implementation methods of the present invention. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be included in the scope of protection of the claims of the present invention.

Claims

1. A monthly electricity consumption prediction method based on the future electricity purchasing business of the online user group, characterized by: The following steps are involved: S1: Based on the current group of online power purchasing agents, a set of future online users is constructed, a data set of historical electricity consumption of the future online users is obtained, and meteorological data is obtained through the API interface. The specific process is as follows: the constructed set of future online users includes stable users, future offline users, and future online users. By excluding the historical electricity consumption data of future offline users and adding the historical electricity consumption data of future online users, a historical electricity consumption data set of the future online users is constructed. At the same time, historical meteorological data of the user's area is obtained through the API interface. S2 sets the monthly maximum temperature and monthly power consumption as detection items, arranges the power consumption data obtained in S1 and the temperature data in the meteorological data in reverse chronological order, and forms a historical data set of the future online user group; identifies abnormal data in the detection items, and repairs the detected abnormal data to obtain a repaired data set; S3, using the results of S2, obtains the electricity consumption trend of the online electricity purchasing user group, and uses the reverse prediction filling method to repair the historical data of the missing detection items to obtain a repaired data set; S4, based on the results of S3, obtain the relationship between meteorological conditions and power consumption through Pearson correlation coefficient analysis; S5, based on the results of S4, perform feature extraction; based on the results of S3, build a model for the extracted features, and use cross-validation technology to evaluate and select the optimal model parameters to train the model, test the trained model, and obtain a tested model; the specific process is as follows: S5.1, divide the S3 patched dataset into training set, validation set, and test set; S5.2, select the monthly feature vectors including the monthly maximum temperature and monthly electricity consumption in the historical data as the input features of the model; S5.3, distinguish special months from normal months by setting judgment conditions; for special months, use rule model for prediction; for normal months, build support vector regression prediction model for prediction; the specific process is as follows: S5.3.1, the criteria include the months of statutory long holidays and months with frequent extreme weather events in history being designated as special months, and the rest being normal months; S5.3.2, for special months, the rule model is used for prediction, and its expression is: Where: is the predicted amount of electricity; is the intercept term; For the Non-holiday characteristic variables in time t The value of is the corresponding regression coefficient; For the j Holiday effect variables in time t The indicator function takes the value of 0 or 1; is the corresponding holiday effect coefficient; is the error term; S5.3.3, for normal months, a support vector regression prediction model is constructed for prediction. The expression of the support vector regression prediction model is: Where: is the predicted output value, i.e. the predicted electricity consumption in the target month, is the weight vector of the regression hyperplane, i.e., the characteristic coefficient, which determines the contribution of each input feature to the power prediction; is a nonlinear mapping function, the input from Space transformation to higher dimensional space ; is the bias term, which is a constant used to adjust the intercept of the regression hyperplane. for dimensional mapping space, the dimension may be much higher than the original input space; S5.4, construct the loss function and optimization objective; introduce slack variables and construct the original SVR problem; S5.5, using Lagrange multipliers and Karush-Kuhn-Tucker conditions to transform the original SVR problem into its dual form; S5.6, replace the dot product with a kernel function by computing the Lagrange multiplier and finding the support vectors in the expansion; S6, using the tested model to predict the electricity consumption for the next month and obtain the prediction results.

2. The monthly electricity consumption prediction method based on the future electricity purchasing business of the online user group according to claim 1 is characterized in that: The specific method of step S2 is: S2.1, extracting power data and temperature data based on the determined prediction object, and arranging the power data and temperature data in reverse chronological order; S2.2, use the sliding window method to identify abnormalities in the power data and temperature data in the meteorological data, and use the interpolation method to repair them: In the case of missing temperature, the mean of the same detection item in adjacent months is used for interpolation; In the case of missing electricity data, linear interpolation is performed based on the user's recent electricity consumption trend; If a sudden change value is detected, it is corrected by using the sliding window mean or trend fitting after determining the abnormality through the threshold; S2.3, obtain the repaired dataset.

3. The monthly electricity consumption prediction method based on the future electricity purchasing business of the online user group according to claim 2 is characterized in that: The specific process of step S2.1 includes: S2.1.1, based on the monthly electricity consumption forecast requirements of the power purchasing agent business, select the total electricity consumption data as the forecast object, and set the overall electricity consumption as the total electricity consumption; S2.1.2, select temperature data from meteorological data as available features; S2.1.3, arrange the power data and temperature data in reverse chronological order to organize the power data and temperature data to form a historical data set of the future online user group.

4. The monthly electricity consumption prediction method based on the future electricity purchasing business of the online user group according to claim 1 is characterized in that: The specific process of step S4 includes: S4.1, based on the S3 patched dataset, uses statistical analysis and machine learning methods to extract the nonlinear relationship between meteorological factors and power consumption through the Pearson correlation coefficient; S4.2, based on the Pearson correlation coefficient analysis results in S4.1, extract the correlation pattern between meteorological conditions and electricity consumption.

5. The monthly electricity consumption prediction method based on the future electricity purchasing business of the online user group according to claim 4 is characterized in that: The mathematical expression of the nonlinear relationship between meteorological factors and electricity is: Where: r is the Pearson correlation coefficient, and its value range is [-1,1]. r = 1, it is completely positively correlated. r = -1 is completely negative correlation. r =0 when there is no linear correlation; is the independent variable, representing the variable that affects the power forecast; is the dependent variable, representing the monthly electricity consumption of the future online user group’s power purchasing business; and is the mean of the two variables, is the total number of training samples.

Citation Information

Patent Citations

  • Prediction method for electricity quantity of proxy electricity purchase

    CN117236487A

  • Short-term load prediction method and device considering agent power purchase of low-power grid

    CN118013466A

  • Power grid fluctuation optimization method and system based on air conditioner electric quantity prediction

    CN119582261A