Load prediction method and system for dividing multiple tasks based on error, medium and equipment
By using a multi-task load forecasting method based on error partitioning, and utilizing BP neural networks and Fisher information matrix constraint parameters, continuous learning of building load characteristic patterns is achieved. This solves the problems of prediction accuracy and robustness in complex scenarios and simplifies the multi-pattern learning process.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-18
- Publication Date
- 2026-04-07
AI Technical Summary
Existing building load forecasting technologies struggle to accurately predict various load characteristic patterns under complex and multi-condition working conditions. Traditional methods require significant criteria for judgment and are impractical for engineering applications.
A load forecasting method based on error partitioning and multiple tasks is adopted. The model is trained by a BP neural network and combined with the Fisher information matrix and L2 regularization term in the elastic weight consolidation method to continuously learn and partition load characteristic patterns and gradually master diverse load characteristics.
It improves prediction accuracy and robustness under complex load scenarios, simplifies the multi-mode learning process, and avoids forgetting learned modes.
Smart Images

Figure CN121809758A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to the technical field of building energy system load prediction, in particular to a load prediction method and system based on error division multi-task, a medium and equipment. BACKGROUND
[0002] In the face of the severe challenges of global climate change and the strategic deployment of realizing the national "double carbon" target, promoting energy saving and consumption reduction has become an era proposition concerning ecological security and high-quality development. As a key field of global energy consumption, building energy efficiency improvement and fine operation have far-reaching significance for realizing the carbon neutralization target. Under this background, as an important means of energy saving and stable operation, the intelligent operation optimization of building energy systems is being vigorously promoted, and accurate load prediction is the key to realizing efficient and economic operation of building energy systems and avoiding redundant configuration and invalid energy consumption. The accuracy of the prediction results is the focus. SUMMARY
[0003] Therefore, the application provides a load prediction method and system based on error division multi-task, a medium and equipment, which does not need to set division basis artificially, simplifies the multi-mode learning process, and improves the prediction accuracy and robustness in complex load scenarios.
[0004] According to one aspect of the application, a load prediction method based on error division multi-task is provided, which comprises: For the building service area corresponding to the building energy station, the building load related data of the building service area in a preset historical time period is obtained, the building load related data is preprocessed and feature engineered to form a training set, and the training set is used as a load prediction task to train a load prediction model in multiple rounds, wherein the load prediction model is established based on a BP neural network, the building service area includes multiple types of buildings, and the building load related data after data preprocessing corresponds to a load feature mode after feature engineering processing; In any round of training process, the deviation degree between the predicted value and the actual value of the load prediction model for the load prediction task is calculated, the training set is divided into a learned load feature mode and an unlearned load feature mode, and the unlearned load feature mode is used as a new load prediction task to continue training the load prediction model; The Fisher information matrix in the elastic weight consolidation method is used to measure the importance of each network parameter of the load prediction model, and a regularization term is introduced in the next round of training process. The network parameters of the load prediction model are constrained by the introduced regularization term combined with the importance measurement result, until the load prediction model reaches the training completion standard. The trained load prediction model is based on the real-time collected building load related data, and predicts the total load of the building service area in the future preset time period.
[0005] According to another aspect of the present application, a load prediction system based on error division multi-task is provided, comprising: The base model construction module is configured to obtain building load related data of a building service area corresponding to a building energy station in a preset historical time period, perform data preprocessing and feature engineering processing on the building load related data to form a training set, and perform multi-round training on a load prediction model based on the training set as a load prediction task. The load prediction model is established based on a BP neural network. The building service area includes multiple types of buildings. The building load related data after data preprocessing corresponds to a load feature mode after feature engineering processing; The error division module is configured to divide the training set into learned load feature modes and unlearned load feature modes by calculating the deviation between the predicted value and the actual value of the load prediction model for the load prediction task in any round of training process, and continue to train the load prediction model by taking the unlearned load feature mode as a new load prediction task. The load prediction module is configured to measure the importance of each network parameter of the load prediction model by the Fisher information matrix in the elastic weight consolidation method, and introduce a regularization term in the next round of training process. The network parameters of the load prediction model are constrained by the introduced regularization term combined with the importance measurement result, until the load prediction model reaches the training completion standard. The trained load prediction model is based on the real-time collected building load related data, and predicts the total load of the building service area in the future preset time period.
[0006] According to another aspect of the present application, a medium having a computer program stored thereon is provided. The program is executed by a processor to implement the above-mentioned load prediction method based on error division multi-task.
[0007] According to another aspect of the present application, a device is provided, comprising a medium, a processor, and a computer program stored on the medium and executable on the processor. The processor executes the program to implement the above-mentioned load prediction method based on error division multi-task.
[0008] By employing the above technical solutions, this application provides a load forecasting method, system, medium, and device based on error partitioning for multiple tasks. This method combines error partitioning tasks with a continuous learning mechanism. During training, the relative error of samples is first calculated, assigning low-error data to the dataset corresponding to already learned load characteristic patterns, while high-error data is designated as the training set for new tasks related to building loads to be learned. The importance of model parameters is measured using the Fisher information matrix from EWC, and L2 regularization is introduced to constrain core parameter updates, preventing the forgetting of learned old patterns. The task partitioning and model training are executed iteratively, allowing a single model to gradually master diverse load characteristic patterns through continuous learning. This eliminates the need for manually setting partitioning criteria, simplifying the multi-pattern learning process and improving prediction accuracy and robustness under complex load scenarios.
[0009] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description
[0010] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 A flowchart illustrating a load forecasting method based on error partitioning for multiple tasks, provided in an embodiment of this application, is shown. Figure 2 A flowchart illustrating a multi-task process based on error partitioning provided in an embodiment of this application is shown. Figure 3 This illustration shows a preprocessed meteorological data provided in an embodiment of this application. Figure 4 This illustration shows a schematic diagram of preprocessed hourly cooling load data provided in an embodiment of this application. Figure 5 This diagram illustrates the hourly prediction results of a load prediction model provided in an embodiment of this application on the training set. Figure 6 This diagram illustrates the hourly prediction results of a load forecasting model provided in an embodiment of this application on a validation set. Figure 7 This illustration shows the effect of a load prediction model optimized through three rounds of continuous learning on the training set, according to an embodiment of this application. Figure 8This illustration shows the relative error distribution and changes of all data points in the training set from a basic BP neural network model to the final model, according to an embodiment of this application. Figure 9 This illustration shows the prediction performance and error of a load prediction model after three continuous learning cycles on the validation set, as provided in an embodiment of this application. Figure 10 This illustration shows the relative error distribution and changes of all data points on the validation set for a continuous learning model that progresses from a basic BP neural network model to a final completed loop, according to an embodiment of this application. Figure 11 This illustration shows a structural diagram of a load forecasting system based on error partitioning and multiple tasks, provided in an embodiment of this application. Detailed Implementation
[0011] The present application will be described in detail below with reference to the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in the embodiments of the present application can be combined with each other.
[0012] This embodiment provides a load forecasting method based on error partitioning and multiple tasks, the method comprising: Step 101: For the building service area corresponding to the building energy station, obtain the building load-related data of the building service area within a preset historical time period. After data preprocessing and feature engineering processing of the building load-related data, a training set is formed. The training set is used as a load prediction task to train the load prediction model in multiple rounds. The load prediction model is based on a BP neural network. The building service area includes various types of buildings. After feature engineering processing, the preprocessed building load-related data corresponds to a load characteristic pattern. The building load-related data includes chilled water flow rate, supply and return water temperature, instantaneous cooling power of users, cumulative cooling capacity, dry bulb temperature, and dew point temperature. The building service area includes various types of buildings, including at least one of office buildings, hotels, and commercial facilities. Step 102: In any round of training, by calculating the degree of deviation between the predicted value and the actual value of the load prediction model for the load prediction task, the training set is divided into learned load feature patterns and unlearned load feature patterns, and the unlearned load feature patterns are used as new load prediction tasks to continue training the load prediction model. Step 103: The importance of each network parameter of the load forecasting model is measured by the Fisher information matrix in the elastic weight consolidation method, and a regularization term is introduced in the next round of training. The network parameters of the load forecasting model are constrained by the introduced regularization term combined with the importance measurement results until the load forecasting model reaches the training completion standard. The trained load forecasting model predicts the total load of the building service area in the future within a preset time period based on the real-time collected building load-related data.
[0013] Currently, research on building load forecasting can be categorized into two types based on model construction: white-box models based on physical mechanisms and black-box models based on data-driven approaches. Traditional physical mechanism-based models require complete physical parameters of the building's thermal structure, which is difficult to obtain in actual engineering projects. Furthermore, due to the simulation of physical processes, many factors influence the accuracy of the results, leading to high uncertainty in the final outcome. In contrast, data-driven black-box models offer significantly better speed and accuracy than white-box models. Moreover, the widespread adoption of building automation systems and intelligent operation platforms in recent years has provided ample data support for the construction of data-driven models. Data-driven models are now widely used in load forecasting. With the development of artificial intelligence technology, many advanced machine learning algorithms, such as Support Vector Regression (SVR), Artificial Neural Networks (ANN), Recurrent Neural Networks (RNN), and LSTM, have been applied to load forecasting and have demonstrated excellent performance.
[0014] Current research on machine learning for load forecasting is based on the key assumptions of a single training task and independent and identically distributed training data. However, real-world engineering scenarios are far more complex, and the training task cannot be treated as an idealized single pattern. This is because in actual engineering, numerous factors influence load. Due to limitations in model complexity, only a few features with the greatest impact on load are typically selected as model input parameters. Common input parameters include outdoor temperature, humidity, and other climate data, as well as cooling load-related data.
[0015] However, some influencing factors cannot be accurately quantified and directly used for model training, such as the number of people indoors and their activities. These factors are generally described indirectly by other data or are considered stable and unchanging, in which case the load characteristic pattern is regarded as singular. The actual situation is much more complex, and relying solely on common input parameters cannot accurately characterize the different load characteristic patterns caused by these neglected influencing factors. In other words, traditional machine learning, by treating the existing building load-related data training set as a single task, cannot handle complex multi-condition situations.
[0016] To more accurately predict load under various conditions, previous research primarily employed multi-model approaches to learn different tasks. This involves grouping similar or identical data according to load characteristic patterns, thus identifying a finite number of distinct load characteristic patterns, and then modeling each category separately. During prediction, the input data's category is determined based on its characteristics, and the corresponding model is then used for forecasting. The earliest methods involved manually classifying categories; for example, some studies categorized models according to season, while others considered weekdays and non-weekdays. In recent years, clustering-based methods have begun to be applied to multi-model load forecasting research. This method can more objectively and accurately classify different load characteristic patterns. Clustering methods focus more on the load characteristic patterns themselves rather than their influencing factors. For example, some studies used the k-means method to classify weather conditions, while many other studies clustered datasets containing factors such as outdoor temperature, time of day, and heat load, ultimately obtaining multiple load characteristic patterns. These methods have proven to achieve good application results.
[0017] However, whether based on manual classification or clustering, multi-model studies require significant and easily discernible criteria for classification, such as seasonality or daily load curve characteristics. But in practical applications, such clear criteria are not always readily available. For example, in large-scale regional energy station load forecasting cases, the uses of end-point buildings are diverse, numerous factors influence the load, and the types of load characteristic patterns are complex and varied. If a classification-based multi-model approach is used, firstly, it is difficult to select significant influencing factors as classification criteria; secondly, due to the complexity of the load composition, a large number of models are needed to describe different load characteristic patterns, which is not practical for engineering applications.
[0018] Therefore, in the above embodiments of this application, in order to solve the problem of multi-mode learning under complex load feature patterns and how to divide different load feature patterns as different training tasks in practical applications, a continuous learning mechanism combined with task partitioning, parameter constraints and iterative optimization strategies can ensure the adaptability and robustness of the model in complex data scenarios.
[0019] Specifically, such as Figure 1 As shown, the initial dataset is first obtained, and after data preprocessing and feature variable selection, a training set is obtained. This training set is then used to construct a "load prediction model (which can be built using a BP neural network)". The core of the initial dataset is "building load-related data within a preset historical time period". Building load-related data includes, for example, chilled water flow rate, supply and return water temperature, instantaneous cooling power consumption by users, cumulative cooling capacity, dry-bulb temperature, and dew point temperature. This data can be collected through actual monitoring systems within the building's service area. Specifically, building load-related data can be divided into operational data and meteorological data. Operating data (chilled water flow rate, supply and return water temperature, instantaneous cooling power consumption by users, cumulative cooling capacity): can come from equipment sensors in the building energy station (such as flow meters of chilled water pumps, temperature sensors of heat exchangers, and power meters on the user side). Meteorological data (dry bulb temperature, dew point temperature): can be from meteorological monitoring stations within / near the building service area or third-party meteorological data interfaces.
[0020] Next, data preprocessing is performed, such as handling missing values: using linear interpolation and K-nearest neighbor method to fill in missing data caused by sensor failure or communication interruption (e.g., if the chilled water flow rate is missing at a certain moment, fill it in with the average value of the previous and next hours); handling outliers: using the 3σ principle (data exceeding the mean ± 3 times the standard deviation) to filter extreme values (e.g., if the supply and return water temperature difference suddenly becomes 0 at a certain moment, it is obviously a sensor failure and needs to be removed); normalization: mapping all variables to the [0,1] interval (e.g., chilled water flow rate is normalized from 0-500m³ / h to 0-1) to avoid the difference in the dimensions of different variables affecting model training.
[0021] Furthermore, the model can be built based on neural networks (such as BP neural networks), and the training process can follow a cycle of "initial training - error partitioning - continuous learning," specifically: 1. Initial training: Train the model using the entire training set. Input: The processed complete training set.
[0022] 2. Error Assessment: The load characteristic patterns are categorized as "learned" or "unlearned." This can be achieved by ranking the error values based on the degree of deviation between the predicted and actual values. For example, in a load forecasting task, the deviation (e.g., MAE or RMSE) is calculated between the model's output predicted value (e.g., the "total load forecast" at a certain moment) and the actual value in the training set (the actual total load at that moment). Samples with small deviations are classified as "learned load characteristic patterns" (low error data, indicating that the model has mastered the pattern); samples with large deviations are classified as "unlearned load characteristic patterns" (high error data, indicating that the model has not mastered the pattern).
[0023] 3. Continuous Learning: Use "EWC Constraints" to learn new tasks, that is, to take "unlearned load feature patterns" (high-error tasks) as new load prediction tasks (as the focus of the next round of training); use the Fisher information matrix of EWC (Elastic Weight Consolidation) to record the "important parameters of learned patterns" (such as corresponding weights) in the model, and restrict the change of these parameters through L2 regularization terms, so that the model will not "forget" the old patterns it has mastered when learning new tasks; repeat the cycle of "training - error splitting - new task - constrained training" until the model's bias on all tasks meets the requirements (reaching the training completion standard, such as RMSE < 5% for all tasks).
[0024] Therefore, the trained model can predict the total load demand (such as the peak cooling load and cumulative cooling capacity in the next 24 hours) of the building service area based on real-time collected building load-related data (such as the current chilled water flow rate, supply and return water temperature, and instantaneous cooling power of users). Through the above process, the model can systematically learn all load patterns in the service area and achieve accurate prediction of the future total load based on core feature variables.
[0025] Optionally, in step 102, the unlearned load characteristic patterns are used as new load forecasting tasks to continue training the load forecasting model, including: Step 1021: Take the unlearned load characteristic patterns as new load forecasting tasks, continue to train the load forecasting model, and during the training process, use the Fisher information matrix in the elastic weight consolidation method to enable the load forecasting model to learn new load characteristic patterns without losing the learned load characteristic patterns.
[0026] In the above embodiments of this application, a regularization-based continuous learning method, Elastic Weight Consolidation (EWC), is adopted. Its basic principle is that in practical applications, the parameter space of neural networks is usually highly redundant, that is, different parameters contribute very differently to the performance of the task. The EWC method utilizes this feature. Its basic operating logic is that each task has a set of important parameters. By restricting the modification of these parameters through the Fisher information matrix, it is possible to ensure that the optimal solution of the current task is maintained in subsequent learning. At the same time, by adjusting the remaining redundant parameters, a local optimum solution for the new task can be achieved, thereby realizing the learning of the new task.
[0027] Optionally, in step 102, by calculating the degree of deviation between the predicted and actual values of the load forecasting model for the load forecasting task, the training set is divided into learned load characteristic patterns and unlearned load characteristic patterns, including: Step 1022: Calculate the sample relative error of the load forecasting model for the load forecasting task. The sample relative error is obtained by calculating the degree of deviation between the predicted value and the actual value of the load forecasting model for the load forecasting task. Step 1023: When the relative error of the sample is greater than the preset threshold, the unlearned load characteristic patterns are identified based on the building load related data of the load prediction task corresponding to the relative error of the sample that is greater than the preset threshold. Step 1024: When the relative error of the samples is less than or equal to the preset critical value, the learned load feature patterns are divided based on the building load related data of the load prediction task corresponding to the relative error of the samples that is less than or equal to the preset critical value. After each round of training, the Fisher information matrix is updated for the next round of training.
[0028] In the embodiments described above, after each training iteration, the relative error (RE) of each training sample is calculated. Based on the error distribution, the training dataset is divided into two categories: high-error datasets and low-error datasets. Low-error datasets represent stable patterns already learned by the model. The EWC mechanism protects the parameters corresponding to these data, preventing the model from forgetting learned load patterns during continuous learning cycles. High-error datasets, on the other hand, reflect the model's shortcomings in the current learning process. In subsequent continuous learning cycles, training the model using high-error data allows the model to gradually master different load patterns. The complete task partitioning process is as follows: Figure 2 ,exist Figure 2 middle: Sample relative error (RE) k The formula is: , in, This represents the actual value of the k-th sample (total load data); This is the model's predicted value for the k-th sample (total load data output by the model at the same time). The relative error (percentage) for a single sample reflects the degree of deviation between the predicted and actual values.
[0029] The critical value, also known as the preset error threshold (such as 5% or 10%), is used to determine whether the model has mastered a certain type of load pattern (error exceeding the critical value = not mastered, otherwise = mastered).
[0030] The Fisher information matrix measures the importance of model parameters (such as neural network weights) to the "learned pattern." A larger Fisher value indicates a greater influence of that parameter on the prediction results of the learned pattern, requiring more stringent protection. Specifically: First, determine whether to continue the optimization loop. If yes, it means that the model has not reached the optimization goal (e.g., the prediction error of some tasks still exceeds the critical value), and proceed to step 1: task partitioning (calculation error - task partitioning); if no, it means that the model has mastered all load patterns (the error of all tasks ≤ the critical value), and output "Model that has reached the optimization goal" (process ends).
[0031] Next, the sample relative error of the load forecasting task is calculated. For the load forecasting task, the following operations can be performed: 1. Traverse all samples within the task: For each sample k in the task (e.g., the total load data at 9:00 AM on a certain workday), use the predicted value output by the model. and actual value Substitute into the formula to calculate RE k (Relative error of a single sample).
[0032] 2. Error Statistics: Calculate the error rates (REs) for all samples within the task. k Summary.
[0033] Next, the error of each sample in the task is compared with a preset threshold to divide the dataset into high / low error datasets, corresponding to "unlearned / learned load feature patterns". At this point, for example, the following situation may occur: Case 1: Sample error > critical value (e.g., RE of a certain sample) k =8%, critical value =5%) This indicates that the load pattern of this sample has not been learned by the model. As a new training task (entering stage 2: continuous learning), the model needs to learn it specifically.
[0034] Case 2: Sample error ≤ critical value (e.g., RE of a certain sample) k =3%) This indicates that the load pattern of the sample has been learned by the model, and the corresponding model parameters need to be protected by the EWC mechanism to avoid forgetting them in subsequent training.
[0035] Next, continuous learning and parameter protection correspond to step 2. The key to this process is "using continuous learning to enable the model to learn new training tasks," which requires combining the Fisher information matrix to achieve "learning new things without losing old ones." Specifically: 1. New Task Training: The "high error dataset" (unlearned mode) is used as a new task and input into the model for training; 2. Protection of learned parameters: The Fisher information matrix after the previous round of optimization (such as the matrix after the (k-1)th optimization) is called to apply L2 regularization constraints to the model parameters corresponding to the "low error dataset" (learned mode). The larger the Fisher value of the parameter, the stronger the constraint, to ensure that these parameters will not be significantly modified in the training of the new task (to avoid forgetting).
[0036] Specifically, the Fisher information matrix must be updated after each round of training (the k-th optimization). The Fisher matrix records the importance of the model parameters to the "learned patterns" and needs to be continuously updated as the model is optimized to ensure that subsequent constraints are more accurate. That is, the model after the k-th optimization is used to re-predict the "low-error dataset" (learned patterns); the Fisher information value of each model parameter (such as the weight w and bias b of the neural network) is calculated (reflecting the degree of influence of parameter changes on the prediction results); the Fisher values of all parameters are integrated into the Fisher information matrix after the k-th optimization; in the next round (k+1 optimization), the EWC mechanism will call this matrix to apply more precise constraints to the learned parameters.
[0037] Furthermore, assume that the building service area has two implicit load forecasting tasks: task T1 and task T2.
[0038] First round of optimization (k=1): 1. After the model is initially trained, calculate the error of all training samples. The samples with error ≤ the critical value are denoted as task T1, and the samples with error > the critical value are denoted as task T2. 2. T1—Low error—Learned—Parameters protected with Fisher matrix; T2—High error—Unlearned—New task; 3. During continuous learning, use EWC to constrain the parameters of T1 and train T2; 4. After training, update the Fisher matrix (to record the importance of the T1 parameters).
[0039] Second round of optimization (k=2): 1. After training the model to T2, calculate the training sample error of T2. If the error of all samples is less than or equal to the critical value, the error of all samples is considered to be within the target range. 2. Stop the loop and output "The model that has achieved the optimization goal"; 3. The final model simultaneously grasps the load patterns of both task T1 and task T2, and does not forget them.
[0040] In particular, the Fisher matrix is the "brain" of the EWC mechanism, and its update and application run through the entire process: the larger the Fisher value, the more important the parameter is to the learned pattern, and the stronger the constraint; the matrix of the kth iteration is used for the constraints of the k+1th iteration to ensure that the parameters protected in each round are up-to-date; by limiting the changes in the learned parameters, the model is prevented from "losing the watermelon to pick up sesame seeds" when learning new tasks.
[0041] Through this process, the model can systematically identify unmastered load patterns (high-error tasks), learn new patterns in a targeted manner (continuous learning), and at the same time protect the learned patterns from being forgotten (Fisher matrix + EWC), ultimately mastering all load characteristic patterns.
[0042] Optionally, the Fisher information matrix is:
[0043] For Fisher's information matrix, For gradient, It is a Hessian matrix. For parameters Data The probability distribution of T, where T is the transpose. Indicates data The expectation.
[0044] In the embodiments described above, the method for constraining parameter updates during model construction utilizes the Fisher information matrix to measure the importance of each parameter in the current training iteration. This allows for the introduction of a regularization term in the next training iteration to constrain the network parameters. The importance of each weight in the BP neural network model can be estimated by examining the curvature of the loss surface along the gradient descent direction. The diagonal of the Fisher information matrix can be calculated solely from the first derivative, which is equivalent to the second derivative (i.e., curvature) of the loss near its minimum. High curvature indicates that slight changes lead to a sharp increase in loss; the greater the impact of this parameter on model performance, the higher its importance. This ensures that these parameters are not over-adjusted when learning new tasks during iterative updates. The Fisher information matrix is an important tool for measuring the sensitivity of a probability distribution to parameters.
[0045] Specifically, Fisher's value is used to measure the importance of the model parameter θ to the "learned load pattern". The larger the Fisher value of the parameter, the stronger its predictive influence on the learned pattern.
[0046] This is used to iterate through all the training data (low error dataset) of the learned tasks and calculate the statistical average.
[0047] , is the matrix of second-order partial derivatives of the log-likelihood function with respect to the parameter θ (describing the effect of parameter variation on the curvature of the likelihood function).
[0048] ξ represents the training data of the learned task (e.g., the actual load value y of a low-error dataset). k Feature x k ).
[0049] , which are the learnable parameters of the load forecasting model (such as the weights w and biases b of the neural network).
[0050] , is the vector of first-order partial derivatives of the log-likelihood function with respect to the parameter θ (describing the effect of parameter changes on the "slope" of the likelihood function).
[0051] T is used to transpose the gradient vector into a row vector, so that "gradient vector × transposed gradient vector" yields a square matrix (the Fisher matrix is a square matrix).
[0052] Furthermore, ξ represents the training samples of the learned task (such as the actual value yk of "office building weekday cooling load", outdoor temperature t). k Features such as ξ and ξ indicate that the dataset belongs to the "low-error dataset" (the model has mastered its load pattern). θ is a learnable parameter of the model (such as the weights of a neural network), which determines the model's predictive ability for ξ. Small changes in θ directly affect the predicted value y. k Log-likelihood This indicates the "fit" of the model to the data. It represents the probability (or density) of data ξ occurring given a parameter θ. For example: If ξ represents "the actual cooling load of the office building at 9:00 AM on weekdays, y = 100kW", then... This represents the probability that the predicted value y is close to 100kW when the model parameter is θ. After taking the logarithm... Essentially, θ quantifies the degree to which the model fits ξ. The larger the value, the higher the accuracy of the model in predicting ξ using θ.
[0053] gradient , is the vector of the first-order partial derivatives of the log-likelihood function with respect to θ. It measures the direction and magnitude of the influence of a small change in the parameter θ on the "fit". In other words, the larger the absolute value of the gradient, the stronger the influence of the parameter change on the prediction result.
[0054] Hessian matrix , is the second-order partial derivative matrix of the log-likelihood function with respect to θ. It measures the rate of change of the gradient (i.e., the curvature of the "fit" as the parameters change). The larger the absolute value of the Hessian, the more "non-linear" the effect of the parameters on the fit (small parameter changes can cause large fluctuations in the fit).
[0055] Eξ is the expectation of the data ξ for all learned tasks (by iterating through all samples of the low-error dataset, using...). (Weighted average). Its function is to eliminate the randomness of a single sample, so that the Fisher matrix reflects the average importance of the parameter to the "entire learned pattern" (rather than a single sample).
[0056] In the Fisher information matrix, there are two equivalent definitions (which must satisfy the "regularity condition", such as the derivative and expectation being interchangeable), specifically: The left side represents the negative log-likelihood Hessian expectation, and the right side represents the expectation of the gradient outer product. The essence of equivalence is that the Hessian expectation of the log-likelihood function is equal to the negative gradient outer product expectation (which can be derived from "the derivative of the expectation = the expectation of the derivative").
[0057] In the scenario of load forecasting + continuous learning + EWC, the key role of the Fisher information matrix is to quantify "the importance of each model parameter θ to the learned load patterns". The larger the Fisher value of a parameter, the stronger the influence of that parameter on the "prediction results of the learned patterns". When learning new tasks in the future, it is necessary to more strictly constrain the change of this parameter (through the regularization term of EWC) to avoid forgetting the learned patterns.
[0058] Suppose the model has two parameters: θ1: Weights of the neural network in the process of "outdoor temperature → hidden layer"; θ2: Weights in the neural network's "hidden layer → cold load output".
[0059] If the Fisher value of θ2 is much larger than that of θ1, it indicates that θ2 has a greater impact on the prediction results of the "learned load patterns". If θ2 changes significantly during training for a new task, it will directly cause the prediction error of the learned patterns to spike. Therefore, EWC will impose a stronger regularization constraint on θ2 (limiting its update magnitude), while the constraint on θ1 will be weaker.
[0060] The specific operation of "updating the Fisher information matrix after each training round" includes the calculation logic of the corresponding formula, for example: 1. Input: Model parameters θk after the kth optimization, and the low-error dataset ξ of the learned task (the mastered load pattern); 2. Calculation: For each sample in ξ, calculate... gradient Then calculate the gradient outer product, and finally take the expectation (Eξ) over all samples to obtain the Fisher matrix after the k-th optimization. ; 3. Output: The EWC regularization term used in the next round of training constrains changes in learned parameters and protects learned load patterns.
[0061] The Fisher information matrix essentially uses mathematical methods to quantify the importance of parameters to learned patterns. For a known load pattern (low error dataset), it calculates the magnitude of the impact of changes in each model parameter on the prediction results. The parameters with the greater impact should not be changed when learning new tasks. This is the key to Fisher matrix + EWC achieving "learning new things without losing old ones".
[0062] Optionally, a regularization term is introduced into the original loss function, resulting in an improved loss function:
[0063] The original loss function, For the improved loss function with regularization, It represents the importance of the k-th weight or bias, where N is the number of weights and biases. It is the updated k-th weight and bias. It is the old weights and biases. It is a hyperparameter used to control the relative importance of historical knowledge compared to new knowledge.
[0064] In the embodiments described above, after using the Fisher information matrix to measure the importance of each parameter in the current training round, a regularization term is introduced in the next training iteration to constrain the network parameters. An EWC regularization term is added to the loss function to limit the update magnitude of important parameters and to constrain the weights and biases according to their importance.
[0065] In one specific embodiment, the prediction target is the total load of the building service area corresponding to the building energy station for the next hour, i.e., the total load of the area, which is used for energy system operation management. The types of data collected include operational data and outdoor meteorological data. The operational data includes chilled water flow rate, supply and return water temperature, instantaneous cooling power of users, and cumulative cooling capacity. The outdoor meteorological data includes dry bulb temperature and dew point temperature.
[0066] Figure 3 , Figure 4 It is data after data preprocessing. Figure 3 It's meteorological data. Figure 4 This uses hourly cold load data. Data prior to July 2024 was used as the training set, and subsequent data as the validation set. Random forest features were used to calculate the importance of each variable, resulting in importance values and rankings. A heatmap was generated using Pearson correlation coefficients, showing high correlations among parameters with high importance rankings, such as the load in the previous hour and the previous 24 hours. To better filter out redundant variables, values with correlation coefficients greater than 0.6 were filtered out, removing variables with lower importance rankings. These variables were ultimately used as input variables for model construction, as shown in Table 1.
[0067] Table 1
[0068] Figure 5The results show that after training the basic BP neural network model using the selected feature parameters, the model's time-by-time MAPE on the training set is 9.93%. Figure 5 (a) is the hourly actual load value and the predicted load value in the training set, although Figure 5 The results show that the overall learning performance is good, and the absolute error is not significant. Figure 5 The scatter plot in (b) also demonstrates good prediction performance, but Figure 5 (c) shows that while the relative error was below 50% for the vast majority (96%) of time points, there were still some time points with relative errors as high as 200%, which is... Figure 5 The error distribution box plot in (d) also shows that, during model training, while the errors of most data points have been reduced to an acceptable range, there are still high-error points that cannot be reduced during training. This is because the characteristics of the high-error dataset differ from the loading characteristics of the remaining low-error data. Traditional machine learning training can only learn one loading feature pattern and cannot learn multiple loading features.
[0069] Figure 6 The results show the hourly predictions of the basic BP neural network model after training on the validation set, with an overall MAPE of 16.4%. Figure 6 (a) compares the hourly actual load with the predicted values in the validation set, demonstrating that the large average error is not due to an overall high error, but rather to some abnormally high error data occurring when the prediction error is low most of the time, especially in the first week of October. Figure 6 This is also reflected in the relative error of (c). Figure 6 (b) more intuitively shows that when most scattered points are distributed around y=x, some outliers appear. This proves that the basic BP neural network model has failed to learn all load feature patterns. When these unlearned load patterns appear when predicting load, serious errors will occur. Figure 6 (d) Box plot showing the distribution of prediction error of the basic BP neural network model.
[0070] Figure 7 This represents the performance of the model on the training set after three rounds of continuous learning and optimization. After these continuous learning cycles, the MAPE on the training set decreased from 8.83% to 8.58%, showing no particularly significant change based on the data. However... Figure 7 (b) The simulated values are closer to the actual values. Figure 7 (c) The higher values of the relative error are relatively Figure 6 The error rate also decreased significantly, with the number of data points with errors higher than 100% decreasing from 57 to 20, indicating that the model's learning performance improved after continuous learning.Figure 7 (a) is a time series comparison chart, used to visually demonstrate the changes in model training results and actual load over time. Figure 7 (d) is a box plot showing the distribution characteristics of the relative error of the optimized model prediction.
[0071] Figure 8 It shows the relative error distribution and changes of all data points in the training set from the basic BP neural network model to the final model. Figure 8 The connecting lines represent the trend of individual data points, showing that in each iteration, high-error data points transform into low-error data points. The darker lines represent data points where the error successfully decreased from above 9% to below 9% in the current iteration. It can also be observed that data point errors rarely increase. This demonstrates that in each continuous learning iteration, the error-based partitioning method effectively extracts load pattern data different from the learned knowledge. Furthermore, in subsequent training, the EWC regularization mechanism ensures that learned load patterns are not forgotten while new load patterns are learned.
[0072] Figure 9 This represents the prediction performance and error of the model on the validation set after three consecutive learning cycles. After three consecutive learning cycles, the MAPE on the validation set decreased from 16.45% to 10.45%, compared to the basic BP neural network model. Figure 9 (a) can intuitively show that the predicted value is closer to the actual value. Figure 9 (b) shows that the scatter distribution is closer to the equal lines, and its relative error is also greatly reduced. Figure 9 (c) and Figure 8 (c) Compared to, the overall value has decreased. Figure 9 The difference is even more pronounced in (d), where the number of data points with relative errors exceeding 100% decreased from 71 to 19, and the overall mean error and interquartile range also decreased significantly. While maintaining low error on the original low-error data, the model achieved a significant reduction in the amount of high-error data after continuous learning cycles. This indicates that the different load feature patterns learned through continuous learning during training can indeed play a role in subsequent applications, reducing high errors caused by insufficient learning of load feature patterns.
[0073] Figure 10This paper illustrates the relative error distribution and changes across all data points on the validation set, from the basic BP neural network model to the final, iteratively trained continuous learning model. The trend of the lines representing the error changes at each data point shows that after iterative training, the errors of high-error data points in the prediction results continuously decrease, while there are very few low-error data points where the error increases with each iteration. This demonstrates that this error-based task partitioning method and continuous learning can indeed improve the accuracy of model predictions by identifying and learning different load feature patterns in the training set.
[0074] By applying the technical solution of this embodiment, the training set is divided into different tasks, ensuring that the load characteristics within the same task are as consistent as possible. Accurately distinguishing different load patterns is of great significance for subsequent task learning. After task division, the importance of parameters in the neural network model is evaluated. The adjustment of important parameters is constrained by the Fisher information matrix of EWC and the L2 regularization term. The training set with lower error after each training session belongs to the learned task, while the high error set is the new task that has not been learned, thus simplifying and quickly dividing different tasks. Through "error-based task division + EWC continuous learning", the learned (low error) and unlearned (high error) load patterns are first distinguished by the relative error of the training samples. Then, the EWC mechanism is used to protect core parameters and avoid forgetting old patterns, while learning new patterns corresponding to high errors. After iterative optimization, a single model can accurately predict multiple load patterns. Unlike other studies that use EWC to update models, the embodiments described above in this application divide the training set used for model training into learned load patterns and unlearned patterns through task partitioning. The unlearned pattern portion is used as a new task set, and new load patterns are learned without losing the features of the learned patterns through the constraints of the continuous learning mechanism. After each training session, the relative error (RE) of each training sample is calculated. Based on the error distribution, the training dataset is divided into two categories: high-error datasets and low-error datasets. This eliminates the need for manually setting the partitioning criteria, simplifies the multi-mode learning process, and improves the prediction accuracy and robustness under complex load scenarios.
[0075] Furthermore, as Figure 1 In terms of specific implementation, this application provides a load forecasting system based on error partitioning and multi-task implementation, such as... Figure 11 As shown, the system includes: The basic model construction module 201 is used to acquire building load-related data of the building service area corresponding to the building energy station within a preset historical time period, and to form a training set after data preprocessing and feature engineering of the building load-related data. The training set is used as a load prediction task to train the load prediction model in multiple rounds. The load prediction model is based on a BP neural network. The building service area includes various types of buildings. After feature engineering, the preprocessed building load-related data corresponds to a load feature pattern. Error partitioning module 202 is used to divide the training set into learned load feature patterns and unlearned load feature patterns by calculating the degree of deviation between the predicted value and the actual value of the load prediction model for the load prediction task during any round of training, and to take the unlearned load feature patterns as new load prediction tasks to continue training the load prediction model. The load forecasting module 203 is used to measure the importance of each network parameter of the load forecasting model through the Fisher information matrix in the elastic weight consolidation method, and to introduce a regularization term in the next round of training. By combining the introduced regularization term with the importance measurement results, the network parameters of the load forecasting model are constrained until the load forecasting model reaches the training completion standard. The trained load forecasting model predicts the total load of the building service area in the future within a preset time period based on the real-time collected building load-related data.
[0076] It should be noted that other corresponding descriptions of the functional units involved in the error-based multi-task load forecasting system provided in this application embodiment can be found in the following references. Figure 1 to Figure 2 The corresponding descriptions in the method will not be repeated here.
[0077] Based on the above, Figure 1 Accordingly, this application also provides a medium on which a computer program is stored, which, when executed by a processor, implements the above-described method. Figure 1 The load forecasting method based on error partitioning and multiple tasks is shown.
[0078] Based on this understanding, the technical solution of this application can be embodied in the form of a software product, which can be stored in a non-volatile medium (such as CD-ROM, USB flash drive, mobile hard drive, etc.) and includes several instructions to enable a device (such as personal computer, server, or network device, etc.) to execute the methods described in various implementation scenarios of this application.
[0079] Based on the above, Figure 1 The method shown, and Figure 11To achieve the above objectives, the virtual system embodiment shown in this application also provides a device, which may be a personal computer, server, network device, etc. This device includes a medium and a processor; the medium is used to store a computer program; the processor is used to execute the computer program to achieve the above-described objectives. Figure 1 The load forecasting method based on error partitioning and multiple tasks is shown.
[0080] Optionally, the device may also include a user interface, a network interface, a camera, radio frequency (RF) circuitry, sensors, audio circuitry, a Wi-Fi module, etc. The user interface may include a display screen, input units such as a keyboard, etc., and optional user interfaces may also include USB interfaces, card reader interfaces, etc. The network interface may optionally include standard wired interfaces, wireless interfaces (such as Bluetooth interfaces, Wi-Fi interfaces), etc.
[0081] Those skilled in the art will understand that the device structure provided in this embodiment does not constitute a limitation on the device, and may include more or fewer components, or combine certain components, or have different component arrangements.
[0082] The medium may also include an operating system and a network communication module. The operating system is a program that manages and stores the device's hardware and software resources, supporting the operation of information processing programs and other software and / or programs. The network communication module is used to enable communication between the various components within the medium, as well as communication with other hardware and software within the physical device.
[0083] Through the above description of the implementation methods, those skilled in the art can clearly understand that this application can be implemented using software plus necessary general-purpose hardware platforms, or it can be implemented in hardware by combining error partitioning tasks with a continuous learning mechanism. During training, the relative error of the samples is first calculated, and low-error data is assigned to the dataset corresponding to the learned load feature patterns, while high-error data is designated as the training set of new task building load-related data to be learned. The importance of model parameters is measured by the Fisher information matrix of EWC, and L2 regularization is introduced to constrain the update of core parameters to avoid forgetting the old patterns that have been learned. The task partitioning and model training are executed cyclically, so that a single model gradually masters diverse load feature patterns in continuous learning. There is no need to manually set the partitioning criteria, which simplifies the multi-pattern learning process and improves the prediction accuracy and robustness under complex load scenarios.
[0084] Those skilled in the art will understand that the accompanying drawings are merely schematic diagrams of a preferred embodiment, and the modules or processes shown in the drawings are not necessarily essential for implementing this application. Those skilled in the art will understand that the modules in the system of the embodiment scenario can be distributed throughout the system of the embodiment scenario as described, or they can be modified to reside in one or more systems different from this embodiment scenario. The modules of the above-described embodiment scenario can be combined into one module, or further divided into multiple sub-modules.
[0085] The serial numbers in this application are for descriptive purposes only and do not represent the superiority or inferiority of any particular implementation scenario. The above disclosures are merely a few specific implementation scenarios of this application; however, this application is not limited thereto, and any modifications that can be made by those skilled in the art should fall within the protection scope of this application.
Claims
1. A load forecasting method based on error partitioning and multiple tasks, characterized in that, The method includes: For the building service area corresponding to the building energy station, the building load related data of the building service area within a preset historical time period is obtained. After data preprocessing and feature engineering processing of the building load related data, a training set is formed. The training set is used as the load prediction task to train the load prediction model in multiple rounds. The load prediction model is based on a BP neural network. The building service area includes various types of buildings. After feature engineering processing, the preprocessed building load related data corresponds to a load feature pattern. During any round of training, the training set is divided into learned load feature patterns and unlearned load feature patterns by calculating the degree of deviation between the predicted value and the actual value of the load forecasting model for the load forecasting task. The unlearned load feature patterns are then used as new load forecasting tasks to continue training the load forecasting model. The importance of each network parameter in the load forecasting model is measured by the Fisher information matrix in the elastic weight consolidation method. In the next round of training, a regularization term is introduced. The network parameters of the load forecasting model are constrained by the introduced regularization term combined with the importance measurement results until the load forecasting model reaches the training completion standard. The trained load forecasting model predicts the total load of the building service area in the future within a preset time period based on real-time collected building load-related data.
2. The method according to claim 1, characterized in that, The step of using unlearned load characteristic patterns as new load forecasting tasks to continue training the load forecasting model includes: The unlearned load characteristic patterns are used as new load forecasting tasks to continue training the load forecasting model. During the training process, the Fisher information matrix in the elastic weight consolidation method enables the load forecasting model to learn new load characteristic patterns without losing the learned load characteristic patterns.
3. The method according to claim 1, characterized in that, The step of dividing the training set into learned load characteristic patterns and unlearned load characteristic patterns by calculating the degree of deviation between the predicted and actual values of the load forecasting model for the load forecasting task includes: The sample relative error of the load forecasting model for the load forecasting task is calculated. The sample relative error is obtained by calculating the degree of deviation between the predicted value and the actual value of the load forecasting model for the load forecasting task. When the relative error of the sample is greater than the preset threshold, the load characteristic patterns that have not been learned are divided based on the building load related data of the load prediction task corresponding to the relative error of the sample that is greater than the preset threshold. When the relative error of the samples is less than or equal to the preset critical value, the load characteristic patterns that have been learned are divided based on the building load related data of the load prediction task corresponding to the relative error of the samples that is less than or equal to the preset critical value. After each round of training, the Fisher information matrix is updated for the next round of training.
4. The method according to claim 1, characterized in that, The Fisher information matrix is as follows: For Fisher's information matrix, For gradient, It is a Hessian matrix. For parameters Data The probability distribution of T, where T is the transpose. Indicates data The expectation.
5. The method according to claim 1, characterized in that, The regularization term is introduced into the original loss function, and the improved loss function obtained after introducing the regularization term is: The original loss function, For the improved loss function with regularization, It represents the importance of the k-th weight or bias, where N is the number of weights and biases. It is the updated k-th weight and bias. It is the old weights and biases. It is a hyperparameter used to control the relative importance of historical knowledge compared to new knowledge.
6. The method according to any one of claims 1 to 5, characterized in that, Building load-related data include chilled water flow rate, supply and return water temperature, instantaneous cooling power consumption by users, cumulative cooling capacity, dry bulb temperature, and dew point temperature.
7. The method according to claim 6, characterized in that, The building services area includes a variety of building types, including at least one of office buildings, hotels, and commercial facilities.
8. A load forecasting system based on error partitioning and multiple tasks, characterized in that, The system includes: The basic model construction module is used to acquire building load-related data of the building service area corresponding to the building energy station within a preset historical time period. After data preprocessing and feature engineering, the building load-related data is used to form a training set. The training set is used as a load prediction task to train the load prediction model in multiple rounds. The load prediction model is based on a BP neural network. The building service area includes various types of buildings. After feature engineering, the preprocessed building load-related data corresponds to load feature patterns. The error partitioning module is used to divide the training set into learned load feature patterns and unlearned load feature patterns in any round of training by calculating the degree of deviation between the predicted value and the actual value of the load prediction model for the load prediction task. The unlearned load feature patterns are then used as new load prediction tasks to continue training the load prediction model. The load forecasting module is used to measure the importance of each network parameter of the load forecasting model through the Fisher information matrix in the elastic weight consolidation method, and introduces a regularization term in the next round of training. By combining the introduced regularization term with the importance measurement results, the network parameters of the load forecasting model are constrained until the load forecasting model reaches the training completion standard. The trained load forecasting model predicts the total load of the building service area in the future within a preset time period based on real-time collected building load-related data.
9. A medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the load forecasting method based on error partitioning of multiple tasks as described in any one of claims 1 to 7.
10. An apparatus comprising a medium, a processor, and a computer program stored on the medium and executable on the processor, characterized in that, When the processor executes the computer program, it implements the load forecasting method based on error partitioning of multiple tasks as described in any one of claims 1 to 7.
Citation Information
Cited By
An energy load self-adaptive scheduling method and system based on dynamic equivalent cost
CN122434224A