Power consumption demand prediction method based on hybrid model library and dynamic weight optimization

By using a hybrid model library and dynamic weight optimization, the problems of insufficient feature characterization and poor model adaptability in electricity demand forecasting are solved, achieving high-precision and robust electricity demand forecasting.

CN121840558APending Publication Date: 2026-04-10ANHUI JIYUAN SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-28
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing electricity demand forecasting methods suffer from weak feature representation capabilities, poor model adaptability, and rigid weighting mechanisms, making it difficult to maintain high accuracy and robustness across different business scenarios.

Method used

A hybrid model library and dynamic weight optimization method are adopted. By acquiring and preprocessing historical electricity load, temperature and holiday data, deep features are constructed. Multiple heterogeneous prediction models are used for parallel learning and prediction, and weighted fusion is performed by dynamic weight allocation.

Benefits of technology

It achieves high-precision and robust electricity demand forecasting across business scenarios, adapts to dynamic changes in data distribution, and improves the accuracy and stability of forecasting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121840558A_ABST
    Figure CN121840558A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a power consumption demand prediction method based on a hybrid model library and dynamic weight optimization, and belongs to the technical field of power load prediction. The power consumption demand prediction method comprises the following steps: acquiring original data about historical power consumption load, temperature and holiday and festival data, and preprocessing the original data; performing nonlinear conversion and quantitative coding on the preprocessed historical electrical load, temperature and holiday and festival data so as to construct a depth feature reflecting the physical driving strength and the social activity modulation effect of the historical electrical load, the temperature and the holiday and festival data; and inputting the depth features into a hybrid model library to drive a plurality of heterogeneous prediction models in the hybrid model library to perform parallel learning and prediction according to the depth features so as to obtain preliminary prediction results of the heterogeneous prediction models. According to the power demand prediction method, the problem that key factors such as temperature, holidays and festivals cannot be depicted sufficiently in existing feature engineering can be solved, and cross-service scene high-precision and high-robustness power demand prediction can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power load forecasting technology, and more specifically to a method for forecasting electricity demand based on a hybrid model library and dynamic weight optimization. Background Technology

[0002] Electricity demand forecasting is a core component of power system operation and marketing strategy formulation, and its accuracy directly affects the economic dispatch, safe operation, and market transactions of the power grid. With the development of artificial intelligence technology, forecasting methods have gradually evolved from traditional time series models (such as ARIMA and SARIMA) to machine learning models (such as support vector machines and gradient boosting trees) and deep learning models (such as LSTM).

[0003] The existing solutions described above have the following drawbacks: First, existing methods largely rely on a single model. Time series models excel at capturing linear patterns and seasonality, but struggle to characterize the nonlinear effects of external factors such as weather and holidays; machine learning models can learn nonlinear relationships, but their ability to capture long-term time-series dependencies is weak; deep learning models, while capable of automatically extracting features, suffer from high training costs and are sensitive to data quality. More importantly, existing methods often have a superficial feature construction level. For example, they only perform simple linear representations or binarization of key influencing factors such as temperature and holidays, failing to delve into the complex nonlinear correlation mechanisms between these factors and electricity demand. Second, marketing electricity demand exhibits a high degree of scenario dependence in actual business (e.g., the seasonality of agricultural electricity consumption, the correlation between residential electricity consumption and temperature, and the binding of electricity consumption in tourist cities to holidays). The inherent assumptions and limitations of a single model, along with the inadequacy of shallow feature representation, make it difficult to maintain optimal performance in all scenarios, resulting in insufficient generalization ability.

[0004] Secondly, to improve robustness, combined forecasting methods have emerged in existing technologies, but these typically employ fixed weights for weighted averaging. This static weighting mechanism cannot adapt to dynamic changes in data distribution. During periods of stable load, the performance of each model is stable, and the fixed weights can be maintained; however, during periods of drastic load fluctuations (such as extreme weather or public emergencies) or seasonal transitions, the relative performance of each model will change significantly. The fixed weight combination will fail to reflect these changes, leading to a sharp decline in forecast accuracy and failing to meet the stringent requirements of accurate forecasting in actual business operations.

[0005] Therefore, existing technical solutions suffer from weak feature representation capabilities, poor model adaptability, and rigid weighting mechanisms. There is an urgent need for an intelligent prediction solution that can deeply characterize key influencing factors, adapt to different business scenarios, and dynamically adjust model weights. Summary of the Invention

[0006] The purpose of this invention is to provide a method for predicting electricity demand based on a hybrid model library and dynamic weight optimization. This method can solve the problem that existing feature engineering is insufficient in characterizing key factors such as temperature and holidays, and can achieve high-precision and robust electricity demand prediction across business scenarios.

[0007] To achieve the above objectives, embodiments of the present invention provide a method for predicting electricity demand based on a hybrid model library and dynamic weight optimization, the method comprising: Obtain raw data on historical electricity load, temperature, and holidays, and preprocess the raw data; The preprocessed historical electricity load, temperature, and holiday data are nonlinearly transformed and quantized to construct deep features that reflect their physical driving intensity and social activity modulation effect. The deep features are input into a hybrid model library to drive multiple heterogeneous prediction models in the hybrid model library to learn and predict in parallel based on the deep features, so as to obtain the preliminary prediction results of each heterogeneous prediction model. Dynamic weight allocation is performed based on the prediction performance indicators obtained by each heterogeneous prediction model from historical data within a preset sliding window. Based on the weights dynamically allocated from each heterogeneous prediction model and the corresponding preliminary prediction results, a weighted fusion is performed to obtain the final predicted value of marketing electricity demand.

[0008] Optionally, the original data may be preprocessed, including effective interval extraction, missing value imputation, anomaly detection and correction, and dynamic truncation, to obtain regularized and normalized high-quality data.

[0009] Optionally, the temperature in the original data can be nonlinearly transformed to construct the corresponding depth features, including converting the temperature into a depth feature that reflects the nonlinear driving intensity of the cooling or heating load through a piecewise nonlinear mapping function.

[0010] Optionally, the temperature can be converted into a depth characteristic reflecting its nonlinear driving strength to cooling or heating loads using a piecewise nonlinear mapping function, including: Obtain the temperature values ​​from the original data, and calculate their mapped output values ​​according to the range of the temperature values: When temp

[0011] ​Where transition_width is the width of the transition area, which is calculated by the following formula:

[0012] Where temp represents the temperature value, and a represents the initial threshold of the cooling effect. Indicates the maximum impact intensity. Temp This represents the initial threshold of the heating effect, and slope_factor represents the slope adjustment factor of the transition zone. When temp > b, a Gaussian decay function symmetrical to the low-temperature range is used for mapping. Its output value increases smoothly with increasing temperature and approaches max_val + 1. The mapping relationship is calculated using the following defined formula:

[0013] in, This represents the output value when temp > b; When a ≤ temp ≤ b, a quadratic polynomial function is used for mapping, and its output value exhibits a U-shaped distribution within the interval [mid_depth, 1]. The mapping relationship is first normalized as follows:

[0014] Then, the results for the intermediate temperature range are obtained through the defined formula:

[0015] Where mid_depth represents the depth of influence of the intermediate temperature range. This represents the output value when a ≤ temp ≤ b. This represents the normalized value.

[0016] Optionally, the holiday data in the original data is quantized and encoded to construct corresponding deep features, including encoding the holiday data through a multi-dimensional vector of category identifiers, work-rest status codes, and influence intensity coefficients.

[0017] Optionally, the holiday data is encoded using a multi-dimensional vector of category identifiers, work-day adjustment status codes, and influence intensity coefficients, including: Define a structured set of holiday events, which contains M holiday events determined based on statutory holidays and social conventions. Construct a comprehensive holiday feature vector for date d:

[0018] in, ​The date is The comprehensive holiday feature vector; The comprehensive holiday feature vector is composed of at least the following components: The comprehensive intensity scalar S(d) is used to comprehensively characterize the intensity of the impact of different holidays on date d. Its value is calculated using the following formula:

[0019] in, It is to give holidays The learnable strength coefficient, The indicator function; the intensity coefficient These parameters are learned during model training. The workday adjustment status subvector A(d) is used to characterize the workday adjustment arrangements associated with statutory holidays, and it contains at least a component indicating whether date d is a workday adjustment day. And whether the date d is a holiday adjustment day. ; The time-series context vector C(d) is used to provide global time location information for date d, which includes at least one or more of the following: weekday order, monthday, month, and year.

[0020] Optionally, the heterogeneous prediction models in the hybrid model library include at least a fast evaluation model, a time series model, a machine learning model, and a deep learning model, wherein the fast evaluation model is an adaptive year-on-year and month-on-month benchmark model, the time series model is a SARIMA and Prophet model, the machine learning model is an XGBoost model, and the deep learning model is an LSTM model.

[0021] Optionally, dynamic weight allocation is performed based on the prediction performance metrics obtained by each heterogeneous prediction model from historical data within a preset sliding window, including: Within each update cycle, the average absolute percentage error of each heterogeneous prediction model within a preset sliding window is calculated. Based on the mean absolute percentage error of each heterogeneous prediction model, the corresponding initial weights are calculated using formula (8): (8) in, Heterogeneous prediction model The corresponding initial weights, Heterogeneous prediction model The mean absolute percentage error, Indicates the smoothing factor; The initial weights of each heterogeneous prediction model are normalized to perform dynamic weight allocation.

[0022] On the other hand, the present invention can also provide an electricity demand forecasting system based on a hybrid model library and dynamic weight optimization, the electricity demand forecasting system comprising: The data acquisition and preprocessing module is used to acquire raw data on historical electricity load, temperature, and holidays, and to preprocess the raw data. The deep feature mapping module is used to perform nonlinear transformation and quantization encoding on the preprocessed historical electricity load, temperature and holiday data, thereby constructing deep features that reflect their physical driving intensity and social activity modulation effect. The hybrid model library parallel prediction module is used to input the deep features into the hybrid model library to drive multiple heterogeneous prediction models in the hybrid model to perform parallel learning and prediction based on the deep feature input, so as to obtain the preliminary prediction results of each heterogeneous prediction model. The dynamic weight allocation module is used to dynamically allocate weights based on the prediction performance indicators obtained by each heterogeneous prediction model from historical data within a preset sliding window. The weighted fusion prediction module is used to perform weighted fusion based on the weights dynamically allocated from each heterogeneous prediction model and the corresponding preliminary prediction results, in order to obtain the final predicted value of marketing electricity demand.

[0023] Through the above technical solution, the electricity demand forecasting method based on a hybrid model library and dynamic weight optimization provided by this invention obtains raw data on historical electricity load, temperature, and holidays, and then preprocesses this raw data. After preprocessing, the preprocessed historical electricity load, temperature, and holiday data can be nonlinearly transformed and quantized to construct deep features reflecting their physical driving intensity and social activity modulation effects. After obtaining the deep features, these features can be input into the hybrid model library, driving multiple heterogeneous prediction models in the library to learn and predict in parallel based on the deep features, thereby obtaining preliminary prediction results from each heterogeneous prediction model. After obtaining the preliminary prediction results, dynamic weight allocation can be performed based on the prediction performance indicators obtained by each heterogeneous prediction model based on historical data within a preset sliding window. After the dynamic weight allocation is completed, the weights dynamically allocated to each heterogeneous prediction model and the corresponding preliminary prediction results can be weighted and fused to obtain the final marketing electricity demand forecast value. This electricity demand forecasting method can solve the problem that existing feature engineering methods are insufficient in characterizing key factors such as temperature and holidays, and can achieve high-precision and robust electricity demand forecasting across business scenarios.

[0024] Other features and advantages of the embodiments of the present invention will be described in detail in the following detailed description section. Attached Figure Description

[0025] The accompanying drawings are provided to further illustrate embodiments of the present invention and form part of the specification. They are used together with the following detailed description to explain the embodiments of the present invention, but do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart of an electricity demand forecasting method based on a hybrid model library and dynamic weight optimization according to an embodiment of the present invention. Figure 2 This is a flowchart of weight allocation in an electricity demand forecasting method based on a hybrid model library and dynamic weight optimization according to an embodiment of the present invention. Figure 3 This is a system block diagram of an electricity demand forecasting system based on a hybrid model library and dynamic weight optimization according to an embodiment of the present invention. Detailed Implementation

[0026] The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit the scope of the present invention.

[0027] In the embodiments of this application, certain software, components, models and other existing solutions in the industry may be mentioned. These should be regarded as exemplary and are only intended to illustrate the feasibility of implementing the technical solution of this application. However, they do not mean that the applicant has used or necessarily used the solution.

[0028] Figure 1 This is a flowchart of an electricity demand forecasting method based on a hybrid model library and dynamic weight optimization according to an embodiment of the present invention. In this invention, the flowchart of the electricity demand forecasting method may include: In step S1, raw data on historical electricity load, temperature, and holidays are obtained and preprocessed.

[0029] In step S2, the preprocessed historical electricity load, temperature and holiday data are nonlinearly transformed and quantized to construct deep features that reflect their physical driving intensity and social activity modulation effect.

[0030] In step S3, deep features are input into the hybrid model library to drive multiple heterogeneous prediction models in the hybrid model library to learn and predict in parallel based on the deep features, so as to obtain the preliminary prediction results of each heterogeneous prediction model.

[0031] In step S4, dynamic weight allocation is performed based on the prediction performance index obtained by each heterogeneous prediction model from historical data within a preset sliding window.

[0032] In step S5, the weights dynamically allocated by each heterogeneous prediction model and the corresponding preliminary prediction results are weighted and fused to obtain the final predicted value of marketing electricity demand.

[0033] In this invention, when forecasting electricity demand, raw data on historical electricity load, temperature, and holidays can be acquired and preprocessed. After preprocessing, the preprocessed historical electricity load, temperature, and holiday data can be nonlinearly transformed and quantized to construct deep features reflecting their physical driving intensity and social activity modulation effects. After acquiring these deep features, they can be input into a hybrid model library, driving multiple heterogeneous prediction models in the library to learn and predict in parallel based on these deep features, thus obtaining preliminary prediction results for each heterogeneous prediction model. After obtaining the preliminary prediction results, dynamic weight allocation can be performed based on the prediction performance indicators obtained by each heterogeneous prediction model from historical data within a preset sliding window. After dynamic weight allocation, weighted fusion can be performed based on the dynamically allocated weights and corresponding preliminary prediction results of each heterogeneous prediction model to obtain the final marketing electricity demand forecast. This electricity demand forecasting method can solve the problem of insufficient characterization of key factors such as temperature and holidays in existing feature engineering, and can achieve high-precision and robust electricity demand forecasting across business scenarios.

[0034] In one embodiment of the present invention, the preprocessing of raw data may include effective interval extraction, missing value imputation, anomaly detection and correction, and dynamic truncation, thereby obtaining well-organized and normalized high-quality data. When acquiring data, raw data can be periodically obtained from the historical database of the electricity marketing system and the meteorological service platform. This data may include monthly aggregated electricity consumption data, daily electricity consumption data, and load data sequences with a sampling interval of 15 minutes.

[0035] If it is load data, the load data sequence with a sampling interval of 15 minutes can be converted into hourly power data using a load-power conversion algorithm. Then, the power data is cleaned and normalized sequentially. Effective data range extraction: Identify and remove consecutive null value segments at the beginning and end of the data sequence to determine the effective data range for subsequent analysis. Layered missing value imputation: A layered strategy is used to handle missing values ​​in the data. Time-weighted interpolation is preferred for primary imputation; for missing points where interpolation is not applicable, rolling average calculation is used as an auxiliary imputation layer to ensure the continuity of the data sequence. Anomaly detection and correction: An anomaly judgment threshold n is set (in this embodiment, n=4). If the data value of the current period is n times or 1 / n times the corresponding data of the previous period, the data point is determined to be an anomaly and corrected to the corresponding value of the previous period. Dynamic data truncation: To eliminate noise interference that may be introduced by excessively long historical data, a truncation threshold is dynamically set according to the total data volume and specific business needs, and the effective data range is truncated again to optimize data quality.

[0036] Normalization: The max-min normalization method is used to map the various data processed in the above steps to the interval [0, 1]. Specifically, for any feature data x, the normalized value x_norm is calculated as: x_norm = (x - X_min) / (X_max - X_min), where X_max and X_min are the maximum and minimum values ​​of the feature in the data sequence, respectively. This processing aims to eliminate the influence of differences in the dimensions and orders of magnitude of different features on the prediction model, thereby improving the stability and convergence speed of model training.

[0037] In one embodiment of the present invention, when mapping the original data in step S2 to construct corresponding deep features, the correlation between electricity demand and various potential influencing factors is analyzed, and a framework for deep feature mapping is established. Specifically, for continuous variables, including temperature, the Pearson correlation coefficient between them and electricity demand is calculated; for categorical variables, including holiday types and weekday types, analysis of variance is applied to test their significance. Subsequently, two deep feature mapping methods are constructed: adaptive temperature mapping features and learnable holiday intensity features, to quantify the nonlinear impact of temperature and holidays on electricity demand, respectively.

[0038] Based on the preprocessed raw data, a feature set for prediction can be constructed. The core of this method is to perform deep feature mapping to accurately characterize the complex nonlinear relationship between key influencing factors and electricity demand.

[0039] To address the temperature factor in the original data, a piecewise nonlinear mapping function can be used to transform the temperature data into continuous characteristic values ​​that accurately reflect the intensity of its nonlinear driving force. This function utilizes Gaussian decay and a quadratic polynomial to achieve a smooth transition across different temperature ranges, aiming to effectively characterize the saturation effect of the influence in the low and high temperature ranges, as well as the minimum influence in the comfortable temperature range.

[0040] To address the impact of holidays, a multi-dimensional coding mechanism is employed to quantify discrete holiday events into features reflecting the intensity of social activity modulation. This coding mechanism encompasses precise identification of holiday types, sensitive recognition of special work schedule adjustments, and dynamic quantification of the impact intensity of different holidays.

[0041] Finally, the high-order features generated by the aforementioned deep feature mapping, combined with conventional features systematically constructed from the dimensions of temporal characteristics, external environment, and social cycles, constitute the initial feature set. Subsequently, a feature selection process is used to filter out key features, forming a comprehensive multidimensional feature set for subsequent predictive modeling.

[0042] In one embodiment of the present invention, when converting the temperature into a deep characteristic reflecting its nonlinear driving intensity on cooling or heating loads using a piecewise nonlinear mapping function, the adaptive temperature mapping characteristic is considered to be mapped by a piecewise function so that the output value exhibits a U-shaped distribution of "high at low temperatures, low in the comfort zone, and high at high temperatures" as the temperature changes, thus better reflecting the actual physical mechanism of cooling and heating loads. In the monthly electricity consumption forecasting scenario, the cumulative value of the daily average temperature within the month is calculated to construct the monthly aggregated temperature characteristic. The temperature characteristic mapping function is used to convert the monthly aggregated temperature (temp) into a nonlinear characteristic value reflecting its impact on electricity demand. Its specific implementation includes: The parameters set during mapping are: a: Cooling effect initiation threshold (default: 5°C), below which the impact of temperature on electricity demand gradually increases; b: Heating effect initiation threshold (default: 30°C), above which the impact of temperature on electricity demand gradually increases; max_val: Maximum influence intensity (default: 50), representing the maximum contribution value when the temperature deviates extremely from the threshold; slope_factor: Transition zone slope adjustment factor (default: 4), controlling the smoothness of the temperature transition near the threshold; mid_depth: Influence depth of the intermediate temperature range (default: 0.01), representing the minimum influence weight on electricity demand when the temperature is within the range [a, b].

[0043] After obtaining the temperature value from the raw data, the calculator can map and output the value according to the range of the temperature value.

[0044] When temp

[0045] Where transition_width is the width of the transition area, which is calculated by the following formula:

[0046] Where temp represents the temperature value, and a represents the initial threshold of the cooling effect. Indicates the maximum impact intensity. Temp `max_val` represents the initial threshold of the heating effect, and `slope_factor` represents the slope adjustment factor for the transition zone. This formula ensures that when the temperature is below `a`, the effect value increases smoothly as the temperature decreases, approaching `max_val + 1`.

[0047] When temp > b, that is, in the high-temperature range, a Gaussian decay function symmetrical to that in the low-temperature range can be used for mapping. Its output value increases smoothly with increasing temperature and approaches max_val + 1. The mapping relationship is calculated by the following defined formula:

[0048] in, This represents the output value when temp > b. This formula ensures that when the temperature is higher than b, the influence value increases smoothly with increasing temperature, approaching max_val + 1.

[0049] When a ≤ temp ≤ b, that is, in the intermediate temperature range, a quadratic polynomial function can be used for mapping. Its output value has a U-shaped distribution in the interval [mid_depth, 1]. The mapping relationship is first normalized as follows:

[0050] Then, the results for the intermediate temperature range are obtained through the defined formula:

[0051] Where mid_depth represents the depth of influence of the intermediate temperature range. This represents the output value when a ≤ temp ≤ b. ​​This represents the normalized value. This function ensures that when the temperature is within the range of [a, b], the impact value remains within the range of [mid_depth, 1], exhibiting a U-shaped distribution, reflecting that the impact on electricity demand is relatively small when the temperature is moderate.

[0052] By using adaptive temperature mapping features, the impact of temperature on electricity demand can be accurately characterized, avoiding the underfitting problem of traditional linear methods. A smooth transition mechanism is employed to ensure that the effect of temperature changes continuously and differently near the threshold, improving the training stability of the machine learning model. By adjusting slope_factor and mid_depth, it can flexibly adapt to the climate characteristics and electricity consumption patterns of different regions.

[0053] In one embodiment of the present invention, when encoding holiday data using a multidimensional vector of category identifiers, work schedule adjustment status codes, and influence intensity coefficients, a feature mapping system containing learnable intensity coefficients can be constructed to accurately quantify the nonlinear impact of different holidays on electricity demand. First, based on national statutory holiday arrangements and social conventions, a structured set of holiday events is defined. ,in Representing the Spring Festival, Representing holidays such as National Day, this set contains M holiday events determined based on statutory holidays and social conventions. A comprehensive holiday feature vector can then be constructed for date d:

[0054] in, The date is The comprehensive holiday feature vector, Represents the comprehensive strength scalar. This represents the sub-vector of the rest state. This represents the timing context vector.

[0055] The comprehensive intensity scalar S(d) is used to comprehensively characterize the intensity of the impact of different holidays on date d. Its value is calculated using the following formula:

[0056] in, It is to give holidays The learnable intensity coefficient quantifies the impact of the holiday relative to a normal day (with a baseline intensity of 1). This is an indicator function, indicating when date d falls on a public holiday. The value is 1 when the condition is met, and 0 otherwise. Strength coefficient A set of model parameters is constructed, with preset hyperparameters used as initial values ​​for the model. These hyperparameters are then used as learnable parameters for fine-tuning during subsequent model training. For example, the Spring Festival. It may correspond to a higher initial coefficient. And New Year's Day Possible correspondence .

[0057] The workday adjustment status subvector A(d) is used to characterize the workday adjustment arrangements associated with statutory holidays, and it contains at least a component indicating whether date d is a workday adjustment day. And whether the date d is a holiday adjustment day. .

[0058] The time-series context vector C(d) is used to provide global time location information for date d, which includes at least one or more of the following: weekday order, monthday, month, and year.

[0059] Through the above mapping, the model can comprehensively learn the complex nonlinear modulation effect of social activity cycles on electricity load from three dimensions: holiday type, special scheduling rules, and absolute time location.

[0060] Systematic construction of general features: General features are constructed and combined with deep semantic features to form an initial feature pool for subsequent filtering. These general features include: Temporal dynamic characteristics refer to the features extracted from the historical sequence of electricity load that characterize its dynamic evolution. This includes establishing lagged values ​​of electricity load at multiple time scales, such as historical same period, previous day, and previous week, to capture the lagged characteristics of short- and medium-term temporal dependence and statistical measures of electricity load within a specified time window, including but not limited to moving average, moving standard deviation, moving maximum, and moving minimum, to describe the recent level, fluctuation trend, and extreme values ​​of the load within a moving window statistical feature.

[0061] Basic periodic features: Introducing basic time features that are strongly correlated with natural cycles to provide a benchmark time coordinate system for the model. Specifically, by performing sine-cosine transformations on "time of day" and "day of year" respectively, the periodic linear time values ​​are mapped to circular coordinates with continuous boundaries, thereby avoiding the model from misjudging periodic endpoints (such as 23:59 and 00:00) as discontinuities.

[0062] Auxiliary environmental features: To supplement the core temperature driving factors, other environmental observation data (such as humidity, wind speed, etc.) are introduced to form information synergy with the depth temperature mapping features.

[0063] Feature selection: The initial feature pool is used as input, and it is optimized and filtered based on feature importance assessment and business interpretability, specifically including: A machine learning-based feature importance quantification method is employed to evaluate the contribution of each feature to electricity demand prediction. By training a gradient boosting decision tree (such as XGBoost), the information gain or frequency of use of each feature during node splits is calculated to obtain the feature importance ranking. Simultaneously, an importance test is performed, i.e., after successively removing individual features from the feature set, the model performance is re-evaluated. If the model prediction error increases significantly, the feature is determined to be a key feature.

[0064] Based on prior knowledge in the power sector, features with insufficient statistical significance or inconsistent with business logic are manually verified and eliminated. Specifically, this includes: setting a correlation threshold and retaining features with an absolute Pearson correlation coefficient greater than 0.1 with electricity demand; conducting mechanistic rationality verification, such as eliminating features deemed spuriously correlated if wind speed has no direct physical impact on electricity load in actual business operations; and implementing feature redundancy detection by calculating mutual information between features and eliminating highly redundant feature pairs with mutual information greater than 0.8.

[0065] Finally, the feature set is dynamically adjusted according to the needs of the prediction scenario. For example, in the monthly prediction scenario, the monthly aggregated temperature mapping feature, business cycle feature and sliding window statistical feature are retained first.

[0066] In one embodiment of the present invention, in step S3, when the deep features output by feature engineering are input in parallel into multiple heterogeneous prediction models in the hybrid model library, each heterogeneous prediction model is trained independently based on the same training set and outputs its own preliminary prediction results for the same test period.

[0067] The heterogeneous prediction models in this hybrid model library include at least a fast evaluation model, a time series model, a machine learning model, and a deep learning model. The fast evaluation model is an adaptive year-on-year and month-on-month benchmark model, the time series models are SARIMA and Prophet models, the machine learning model is an XGBoost model, and the deep learning model is an LSTM model.

[0068] Rapid evaluation model: Adaptive year-on-year and month-on-month benchmark model As a forecasting benchmark, this embodiment constructs an adaptive year-on-year and month-on-month benchmark model. The model is based on the mechanism that "the current forecast value is jointly determined by the previous benchmark and the historical growth trend of the same period." Predicted value The calculation formula is as follows: Where y(t-1) represents the actual observed value at the previous time (t-1), which serves as the baseline for prediction; The formula for representing the historical year-on-year growth rate is: = (y(tp) - y(tp-1)) / y(tp-1). Here, p is the period length (e.g., for a scenario with hourly granularity and a weekly period, p=168). This value reflects the growth rate of the same period in the previous complete period. a is a configurable scaling factor (0 ≤ a ≤ 1) used to adjust the historical growth rate according to the inherent growth trend of different businesses. Perform smoothing corrections to make predictions more closely match actual business scenarios.

[0069] Time series model 1: SARIMA model This embodiment employs a Seasonal Autoregressive Integral Moving Average (SARIMA) model. This model is suitable for capturing linear trends, seasonality, and autocorrelation in data. To clarify the implementation method, in this embodiment, the model hyperparameters are determined to a set of optimal values ​​through grid search, denoted as SARIMA(p=1, d=1, q=1)(P=1, D=1, Q=1, s=24). Here, (p=1, d=1, q=1) represent the parameters of the non-seasonal part, indicating the autoregressive order, differencing order, and moving average order, respectively. (P=1, D=1, Q=1, s=24) represent the parameters of the seasonal part, where s=24 represents the daily seasonal period (24 hours / day).

[0070] (3) Time series model 2: Prophet model This embodiment also employs the Prophet model. This model, based on additive models, is particularly adept at handling strong seasonality, multiple periods, and holiday effects in time series. To implement this invention, the model is configured as follows: Periodicity and Seasonality: Enable and configure yearly_seasonality and weekly_seasonality to automatically capture periodic patterns at different time scales. Holiday Effects: Create a list of holidays based on Chinese statutory holidays (such as Spring Festival and National Day) and input it into the model to characterize the unique impact of holidays on social electricity consumption patterns. Change Points and Trends: The model automatically detects trend change points in the time series and allows adjustment of the flexibility of trend changes through the parameter changepoint_prior_scale (default value 0.05). The remaining parameters use the model's default settings.

[0071] Machine learning model: XGBoost model This embodiment employs the Extreme Gradient Boosting Tree (XGBoost) model. This model effectively captures the complex nonlinear relationship between features and the target. To achieve this invention, the key hyperparameters used during model training are set as follows: max_depth is 6 (maximum tree depth, controlling model complexity), n_estimators is 100 (maximum number of weak learners), and learning_rate is set to 0.1 (learning rate, controlling the weights at each iteration). The remaining hyperparameters use the default settings of this algorithm library.

[0072] (5) Deep learning model: LSTM model This embodiment employs a Long Short-Term Memory (LSTM) network model to capture the long-term temporal dependencies of electricity load. The specific LSTM network structure is as follows: the network contains one LSTM layer with 50 neurons. A fully connected (dense) layer is connected after the LSTM layer to output the final predicted value. To suppress overfitting, a dropout layer is added after the LSTM layer with a dropout rate of 0.2. The model uses the Adam optimizer and is trained with mean squared error (MSE) as the loss function.

[0073] In one embodiment of the present invention, such as Figure 2 As shown, the weight allocation process may include: In step S6, within each update cycle, the average absolute percentage error of each heterogeneous prediction model within a preset sliding window is calculated.

[0074] In step S7, the corresponding initial weights are calculated using formula (8) based on the mean absolute percentage error of each heterogeneous prediction model: (8) in, Heterogeneous prediction model The corresponding initial weights, Heterogeneous prediction model The mean absolute percentage error, This represents the smoothing factor.

[0075] In step S8, the initial weights of each heterogeneous prediction model are normalized to perform dynamic weight allocation.

[0076] In this invention, to overcome the rigidity of fixed-weight fusion in dealing with the complex time-varying characteristics of power load, a dynamic weight optimization fusion mechanism based on multi-dimensional rolling performance evaluation can be constructed. This mechanism constructs a closed-loop feedback system, enabling the model weights to adaptively adjust according to their comprehensive performance within recent historical windows, thereby significantly improving the robustness of the prediction system under different operating conditions.

[0077] First, we can set a length as... A rolling evaluation window (e.g., 6 months for monthly forecasts) is used to continuously track the performance of each forecasting model. Within each weight update cycle, the mean absolute percentage error of each heterogeneous forecasting model within that window is calculated. To ensure the robustness of the weight allocation and avoid numerical instability in extreme cases, a small smoothing factor can be introduced into the error term before calculating the weights. (Usually the value is taken as) The initial weights are generated using formula (8) based on the principle of the inverse of the error. Subsequently, the initial weights of all models are normalized, thereby enabling dynamic weight allocation.

[0078] Based on the obtained dynamic weights, weighted fusion prediction can be performed. This combines the independent prediction results of each heterogeneous prediction model for the target time. With corresponding dynamic weights A linear combination is performed to generate the final ensemble prediction. The core advantage of this dynamic weight optimization mechanism lies in its ability to automatically rely on a long-term stable benchmark model during periods of stable load, rapidly increase reliance on complex nonlinear models (such as LSTM) during periods of drastic load fluctuations, and flexibly balance the contribution ratios of each model during seasonal transitions. Through this continuous adaptive adjustment, the system not only significantly improves prediction accuracy across all scenarios but also possesses strong robustness in dealing with dynamic changes in data distribution, effectively overcoming the inherent limitations of traditional fixed-weight fusion methods.

[0079] On the other hand, the present invention can also provide an electricity demand forecasting system based on a hybrid model library and dynamic weight optimization, such as... Figure 3 As shown, the electricity demand forecasting system may include: The data acquisition and preprocessing module is used to acquire raw data on historical electricity load, temperature, and holidays, and to preprocess the raw data. The deep feature mapping module is used to perform nonlinear transformation and quantization encoding on preprocessed historical electricity load, temperature and holiday data, thereby constructing deep features that reflect their physical driving intensity and social activity modulation effect. The parallel prediction module of the hybrid model library is used to input deep features into the hybrid model library to drive multiple heterogeneous prediction models in the hybrid model to perform parallel learning and prediction based on the deep feature input, so as to obtain the preliminary prediction results of each heterogeneous prediction model. The dynamic weight allocation module is used to dynamically allocate weights based on the prediction performance indicators obtained by each heterogeneous prediction model from historical data within a preset sliding window. The weighted fusion prediction module is used to perform weighted fusion based on the weights dynamically allocated from each heterogeneous prediction model and the corresponding preliminary prediction results, in order to obtain the final predicted value of marketing electricity demand.

[0080] Through the above technical solution, the electricity demand forecasting method based on a hybrid model library and dynamic weight optimization provided by this invention obtains raw data on historical electricity load, temperature, and holidays, and then preprocesses this raw data. After preprocessing, the preprocessed historical electricity load, temperature, and holiday data can be nonlinearly transformed and quantized to construct deep features reflecting their physical driving intensity and social activity modulation effects. After obtaining the deep features, these features can be input into the hybrid model library, driving multiple heterogeneous prediction models in the library to learn and predict in parallel based on the deep features, thereby obtaining preliminary prediction results from each heterogeneous prediction model. After obtaining the preliminary prediction results, dynamic weight allocation can be performed based on the prediction performance indicators obtained by each heterogeneous prediction model based on historical data within a preset sliding window. After the dynamic weight allocation is completed, the weights dynamically allocated to each heterogeneous prediction model and the corresponding preliminary prediction results can be weighted and fused to obtain the final marketing electricity demand forecast value. This electricity demand forecasting method can solve the problem that existing feature engineering methods are insufficient in characterizing key factors such as temperature and holidays, and can achieve high-precision and robust electricity demand forecasting across business scenarios.

[0081] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0082] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0083] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0084] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0085] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0086] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0087] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0088] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0089] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A method for predicting electricity demand based on a hybrid model library and dynamic weight optimization, characterized in that, The electricity demand forecasting method includes: Obtain raw data on historical electricity load, temperature, and holidays, and preprocess the raw data; The preprocessed historical electricity load, temperature, and holiday data are nonlinearly transformed and quantized to construct deep features that reflect their physical driving intensity and social activity modulation effect. The deep features are input into a hybrid model library to drive multiple heterogeneous prediction models in the hybrid model library to learn and predict in parallel based on the deep features, so as to obtain the preliminary prediction results of each heterogeneous prediction model. Dynamic weight allocation is performed based on the prediction performance indicators obtained by each heterogeneous prediction model from historical data within a preset sliding window. Based on the weights dynamically allocated from each heterogeneous prediction model and the corresponding preliminary prediction results, a weighted fusion is performed to obtain the final predicted value of marketing electricity demand.

2. The electricity demand forecasting method according to claim 1, characterized in that, The raw data is preprocessed, including valid interval extraction, missing value imputation, anomaly detection and correction, and dynamic truncation, to obtain regularized and normalized high-quality data.

3. The electricity demand forecasting method according to claim 1, characterized in that, The temperature in the original data is nonlinearly transformed to construct the corresponding depth features. This includes converting the temperature into a depth feature that reflects the nonlinear driving intensity of the cooling or heating load through a piecewise nonlinear mapping function.

4. The electricity demand forecasting method according to claim 3, characterized in that, The temperature is converted into a deep characteristic reflecting its nonlinear driving strength to cooling or heating loads through a piecewise nonlinear mapping function, including: Obtain the temperature values ​​from the original data, and calculate their mapped output values ​​according to the range of the temperature values: When temp < a, a mapping relationship based on a Gaussian decay function is adopted, and its output value smoothly increases with decreasing temperature and approaches max_val + 1. The mapping relationship is defined by the following formula: Where transition_width is the width of the transition area, which is calculated by the following formula: Where temp represents the temperature value, and a represents the initial threshold of the cooling effect. Indicates the maximum impact intensity. This represents the output value when temp < a. This represents the initial threshold of the heating effect, and slope_factor represents the slope adjustment factor of the transition zone. When temp > b, a Gaussian decay function symmetrical to the low-temperature range is used for mapping. Its output value increases smoothly with increasing temperature and approaches max_val + 1. The mapping relationship is calculated using the following defined formula: in, This represents the output value when temp > b; When a ≤ temp ≤ b, a quadratic polynomial function is used for mapping, and its output value exhibits a U-shaped distribution within the interval [mid_depth, 1]. The mapping relationship is first normalized as follows: Then, the results for the intermediate temperature range are obtained through the defined formula: Where mid_depth represents the depth of influence of the intermediate temperature range. This represents the output value when a ≤ temp ≤ b. This represents the normalized value.

5. The electricity demand forecasting method according to claim 1, characterized in that, The holiday data in the original data is quantized and encoded to construct corresponding deep features, including encoding the holiday data through a multi-dimensional vector of category identifiers, work-rest status codes, and influence intensity coefficients.

6. The electricity demand forecasting method according to claim 5, characterized in that, The holiday data is encoded using a multi-dimensional vector of category identifiers, work-off status codes, and influence intensity coefficients, including: Define a structured set of holiday events, which contains M holiday events determined based on statutory holidays and social conventions. Construct a comprehensive holiday feature vector for date d: in, The date is The comprehensive holiday feature vector; The comprehensive holiday feature vector is composed of at least the following components: The comprehensive intensity scalar S(d) is used to comprehensively characterize the intensity of the impact of different holidays on date d. Its value is calculated using the following formula: in, It is to give holidays The learnable strength coefficient, The indicator function; the intensity coefficient These parameters are learned during model training. The workday adjustment status subvector A(d) is used to characterize the workday adjustment arrangements associated with statutory holidays, and it contains at least a component indicating whether date d is a workday adjustment day. And whether the date d is a holiday adjustment day. ; The time-series context vector C(d) is used to provide global time location information for date d, which includes at least one or more of the following: weekday order, monthday, month, and year.

7. The electricity demand forecasting method according to claim 1, characterized in that, The heterogeneous prediction models in the hybrid model library include at least a fast evaluation model, a time series model, a machine learning model, and a deep learning model. The fast evaluation model is an adaptive year-on-year and month-on-month benchmark model, the time series model is a SARIMA and Prophet model, the machine learning model is an XGBoost model, and the deep learning model is an LSTM model.

8. The electricity demand forecasting method according to claim 1, characterized in that, Dynamic weight allocation is performed based on the prediction performance metrics obtained by each heterogeneous prediction model from historical data within a preset sliding window, including: Within each update cycle, the average absolute percentage error of each heterogeneous prediction model within a preset sliding window is calculated. Based on the mean absolute percentage error of each heterogeneous prediction model, the corresponding initial weights are calculated using formula (8): (8) in, Heterogeneous prediction model The corresponding initial weights, Heterogeneous prediction model The mean absolute percentage error, Indicates the smoothing factor; The initial weights of each heterogeneous prediction model are normalized to perform dynamic weight allocation.

9. A power demand forecasting system based on a hybrid model library and dynamic weight optimization, characterized in that, The electricity demand forecasting system includes: The data acquisition and preprocessing module is used to acquire raw data on historical electricity load, temperature, and holidays, and to preprocess the raw data. The deep feature mapping module is used to perform nonlinear transformation and quantization encoding on the preprocessed historical electricity load, temperature and holiday data, thereby constructing deep features that reflect their physical driving intensity and social activity modulation effect. The hybrid model library parallel prediction module is used to input the deep features into the hybrid model library to drive multiple heterogeneous prediction models in the hybrid model to perform parallel learning and prediction based on the deep feature input, so as to obtain the preliminary prediction results of each heterogeneous prediction model. The dynamic weight allocation module is used to dynamically allocate weights based on the prediction performance indicators obtained by each heterogeneous prediction model from historical data within a preset sliding window. The weighted fusion prediction module is used to perform weighted fusion based on the weights dynamically allocated from each heterogeneous prediction model and the corresponding preliminary prediction results, in order to obtain the final predicted value of marketing electricity demand.