Building peak valley electricity consumption optimization configuration method and system based on AI prediction
Patent Information
- Application Number
- CN202611152414.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-31
- Publication Date
- 2026-10-23
AI Technical Summary
[0005]为了解决现有技术存在的现有建筑峰谷用电能耗优化过程通常依赖固定规则或简单预测,缺乏对历史负荷数据和预测误差的分析,难以准确调控可调负荷,导致峰谷波动控制不精确、能源利用效率低,进而导致储能设备无法充分发挥优化作用的技术问题,本发明提供了一种融合AI预测的建筑峰谷用电能耗优化配置方法及系统
在本发明实施例中,通过获取实时和历史用电负荷数据,预训练的负荷预测模型能够准确预测未来建筑负荷,同时构建预测误差相关矩阵以量化预测不确定性。结合建筑可调负荷,计算净负荷系数并评估峰谷波动程度,再通过构建最小化峰谷波动的目标函数,利用解析梯度和共轭梯度迭代优化可调负荷分配。最终,储能模块根据优化结果灵活调节充放电功率,从而平衡建筑负荷分布,降低高峰压力,提高能源利用效率,同时缓解电网波动,实现储能设备的充分利用与建筑能耗的智能化、可持续优化。通过优化可调负荷使建筑负荷曲线平滑,既实现削峰填谷,又考虑预测不确定性和储能约束。可显著降低电网输配电压力,并减少频繁调频需求,提高系统运行的安全性和经济性,同时确保建筑用电的高效调度和负荷利用。
Smart Images

Figure CN122969044A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power distribution optimization technology, and in particular to a method and system for optimizing the configuration of peak and valley electricity consumption in buildings by integrating AI prediction. Background Technology
[0002] Building peak and valley electricity consumption refers to the energy consumption of a building during peak and valley periods, depending on changes in electricity load. Peak periods involve high electricity consumption and load, typically occurring during daytime working hours or when equipment such as air conditioners and elevators are used frequently. Valley periods involve low electricity consumption and load, typically occurring at night or during periods of lower building usage intensity.
[0003] Building electricity consumption is often excessively high during peak hours, leading to increased electricity costs, increased grid pressure, and excessive equipment wear and tear; while during off-peak hours, electricity efficiency is low, and energy is not fully utilized. By adjusting the power distribution of equipment and optimizing peak-valley load distribution, the power pressure and operating costs during peak hours can be reduced, and energy utilization efficiency can be improved. Optimizing peak-valley electricity consumption allows for the scientific adjustment of equipment operation strategies, balancing load distribution, improving energy utilization efficiency, reducing operating costs, and enhancing the sustainability and economic benefits of building electricity consumption.
[0004] However, existing peak-valley electricity consumption optimization processes for buildings typically rely on fixed rules or simple predictions, lacking analysis of historical load data and prediction errors. This makes it difficult to accurately control adjustable loads, resulting in inaccurate peak-valley fluctuation control, low energy utilization efficiency, and consequently, the inability of energy storage devices to fully play their optimization role. Summary of the Invention
[0005] To address the technical problems of existing building peak-valley electricity consumption optimization processes that typically rely on fixed rules or simple predictions, lack analysis of historical load data and prediction errors, make it difficult to accurately control adjustable loads, resulting in inaccurate peak-valley fluctuation control, low energy utilization efficiency, and consequently preventing energy storage devices from fully playing their optimization role, this invention provides a building peak-valley electricity consumption optimization configuration method and system that integrates AI prediction.
[0006] The technical solutions provided by the embodiments of the present invention are as follows: First aspect This invention provides a method for optimizing building peak and valley electricity consumption using AI-predicted data. This method is applied to an electricity consumption scheduling system comprising a power grid, an energy storage module, and a building power management module. The energy storage module is connected to both the power grid and the building power management module. The power grid is also connected to the building power management module. The energy storage module includes a charging and discharging control unit. The method includes: S1: Obtain building electrical load correlation data and historical building electrical load correlation data through the charging and discharging control unit; S2: Input the building electricity load correlation data and historical building electricity load correlation data into the pre-trained load prediction model, and output the predicted building load and the offline predicted building load; S3: Establish the prediction error correlation coefficient matrix of the pre-trained load prediction model based on offline predicted building load; S4: Determine the net load factor by combining the building's adjustable load and the predicted building load; S5: Calculate the time-series volume of the net load factor to measure the peak-valley fluctuation of building electricity consumption; S6: Combining the prediction error correlation coefficient matrix, establish an objective function for the adjustable load of the building with the goal of minimizing the time series volume; S7: Calculate the analytical gradient of the objective function with respect to the adjustable load of the building, and perform conjugate gradient iteration based on the analytical gradient to output the adjustment amount of the adjustable load of the building; S8: Adjust the charging and discharging power of the energy storage module according to the adjustable load of the building to optimize the peak and valley power consumption of the building.
[0007] Second aspect This invention provides a building peak-valley electricity consumption optimization configuration system that integrates AI prediction, comprising: processor; The memory stores computer-readable instructions that, when executed by the processor, implement the building peak-valley energy consumption optimization configuration method based on AI prediction as described in the first aspect.
[0008] Third aspect The present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the building peak-valley power consumption optimization configuration method as described in the first aspect, which integrates AI prediction.
[0009] The beneficial effects of the technical solutions provided in the embodiments of the present invention include at least the following: In this embodiment of the invention, by acquiring real-time and historical electricity load data, a pre-trained load prediction model can accurately predict future building loads. Simultaneously, a prediction error correlation matrix is constructed to quantify prediction uncertainty. Combined with adjustable building loads, the net load factor is calculated and the peak-valley fluctuation level is assessed. Then, by constructing an objective function that minimizes peak-valley fluctuations, the adjustable load allocation is iteratively optimized using analytical gradients and conjugate gradients. Finally, the energy storage module flexibly adjusts its charging and discharging power based on the optimization results, thereby balancing building load distribution, reducing peak pressure, improving energy utilization efficiency, and mitigating grid fluctuations. This achieves full utilization of energy storage devices and intelligent, sustainable optimization of building energy consumption. By optimizing adjustable loads to smooth building load curves, peak shaving and valley filling are achieved while considering prediction uncertainty and energy storage constraints. This significantly reduces grid transmission and distribution pressures, decreases the need for frequent frequency regulation, improves system operation safety and economy, and ensures efficient scheduling and load utilization of building electricity. Attached Figure Description
[0010] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0011] Figure 1 A flowchart illustrating a method for optimizing building peak and valley electricity consumption based on AI prediction, provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the structure of an energy consumption scheduling system provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of a pre-trained load prediction model provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of a building peak-valley electricity consumption optimization configuration system that integrates AI prediction, provided as an embodiment of the present invention. Detailed Implementation
[0012] The technical solution of the present invention will now be described with reference to the accompanying drawings.
[0013] In embodiments of the present invention, words such as "exemplarily," "for example," etc., are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary" in the present invention should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the word "exemplary" is intended to present the concept in a concrete manner. Furthermore, in embodiments of the present invention, the meaning expressed by "and / or" can be both, or either one.
[0014] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.
[0015] Reference manual attached Figure 1 The diagram illustrates a flowchart of a method for optimizing building peak and valley electricity consumption based on AI prediction, provided by an embodiment of the present invention.
[0016] Reference manual attached Figure 2 The diagram shows a schematic representation of an energy consumption scheduling system provided in an embodiment of the present invention.
[0017] Figure 2 The power consumption dispatching system shown collects real-time load data of buildings through the building power management module and adjusts the power of the energy storage module in conjunction with the charging and discharging control unit of the energy storage unit, thereby achieving coordination between building load and power grid. The system intelligently controls the charging and discharging of energy storage according to the building's power demand and the grid load, thereby peak shaving and valley filling, smoothing the building load curve, improving energy utilization efficiency, and ensuring the safety and stability of grid operation.
[0018] Reference manual attached Figure 3 The diagram shows a structural schematic of a pre-trained load prediction model provided in an embodiment of the present invention.
[0019] Figure 3 In this context, L represents the number of stacked LSTM cell layers. Figure 3 The structure shown represents the hierarchical architecture of the LSTM load forecasting model. The input layer receives real-time and historical building electricity load data, feeding the time-series features into multi-layered stacked LSTM units. Forget gates, input gates, and output gates capture the long-term dependencies and dynamic changes in the load sequence. After the multi-layered LSTM units extract deep time-series features, the output layer maps the final hidden state to the predicted building load, thereby achieving accurate predictions of future load trends.
[0020] This invention provides a method for optimizing the configuration of peak and valley electricity consumption in buildings by integrating AI prediction. It is applied to an electricity consumption scheduling system that includes a power grid, an energy storage module, and a building power management module. The energy storage module is connected to both the power grid and the building power management module. The power grid is connected to the building power management module. The energy storage module includes a charging and discharging control unit.
[0021] The power grid provides electricity to the building and interacts with energy storage modules and the building power management module to handle the building's overall electrical load. The energy storage module includes a charge / discharge control unit for storing or releasing electrical energy, achieving peak-valley regulation and load balancing. The building power management module collects building load data, controls the operation of adjustable loads and energy storage modules, and achieves optimized power management. By acquiring real-time building load data and combining it with intelligent control of the energy storage module, this system achieves peak-valley load balancing and optimized energy utilization, reducing peak-hour pressure, improving energy efficiency, and fully utilizing the energy storage device to realize intelligent and sustainable management of building electricity consumption.
[0022] This method can be implemented using a building peak-valley electricity consumption optimization configuration device that integrates AI prediction. This device can be a terminal or a server. The processing flow of the building peak-valley electricity consumption optimization configuration method that integrates AI prediction can include the following steps: S1: Obtain building electrical load correlation data and historical building electrical load correlation data through the charging and discharging control unit.
[0023] Among them, building electricity load correlation data refers to the real-time electricity consumption information of a building at the current moment. Historical building electricity load correlation data refers to the electricity consumption information of a building over a certain period of time in the past.
[0024] In one possible implementation, building electricity load correlation data includes power consumption data, meteorological data, and time-of-use electricity price data. Historical building electricity load correlation data includes historical power consumption data, historical meteorological data, and historical time-of-use electricity price data.
[0025] It should be noted that by simultaneously acquiring real-time and historical electricity consumption data, and combining them with meteorological and time-of-use electricity price information, the characteristics of building load and electricity consumption patterns can be comprehensively reflected, providing rich feature support for AI load forecasting. This improves the accuracy of load forecasting and the scientific nature of peak-valley regulation, and enhances the effectiveness and reliability of building energy consumption optimization.
[0026] S2: Input the building electricity load correlation data and historical building electricity load correlation data into the pre-trained load prediction model, and output the predicted building load and the offline predicted building load.
[0027] Among them, pre-trained load prediction models refer to models that have been trained on historical building load data and are used to predict future building loads. Predicted building load refers to short-term or real-time load prediction results generated by the model based on current real-time building electricity load correlation data, used to guide building energy consumption control and reflecting the building's possible electricity consumption trends over a future period. Offline predicted building load refers to load prediction results generated by the model based on historical building electricity load correlation data, typically generated during the model training or simulation analysis phase.
[0028] In one possible implementation, the pre-trained load prediction model is specifically a long short-term memory network model.
[0029] The Long Short-Term Memory (LSTM) network model consists of an input layer, several LSTM unit layers, and a fully connected output layer. The input layer receives building electricity load correlation data and historical data, and feeds the feature vector of each time step into the LSTM unit. The LSTM unit captures long-term dependency information in the sequence through forget gates, input gates, and output gates. Multiple LSTM unit layers can be stacked to form a deep temporal feature extraction network. The output layer maps the last hidden state of the LSTM to the predicted building load value.
[0030] During training, the input features are first normalized. Historical load sequences and related features are then input into the LSTM network step-by-step. Predicted values are calculated through forward propagation, and a loss function (such as mean squared error) is calculated between the predicted and actual load values. The network parameters are then updated using backpropagation. This process is iterated multiple times until the loss converges, resulting in a pre-trained LSTM model suitable for real-time load prediction. During training, the hyperparameter tuning of the Long Short-Term Memory (LSTM) network model can be combined with adaptive trust region natural gradient search of the Fisher information matrix. This progressive approach, by continuously subdividing high-curvature regions, replaces traditional global line search or fixed grids.
[0031] The hyperparameters of Long Short-Term Memory (LSTM) networks include the number of LSTM layers, input time step, number of hidden units, dropout rate, learning rate, and batch size. The tuning formulas for these hyperparameters primarily include the information geometric trust region update equation and the sub-region partitioning decision criterion. During iteration, the upper limit of the trust region radius is determined. Is it sufficient to accommodate a natural gradient step size? .if ,in, Indicates the current search area The upper limit of the trust region radius, Indicates the current search area The local condition number indicates that the current region has been sufficiently flattened to be directly optimized, in which case a complete formula update is performed within that region. (The step size is automatically truncated by the confidence radius), and then the region is redefined centered on the updated point. If the decision fails, it indicates that the region curvature is too large or the area to be explored exceeds the confidence range of the second-order approximation. Along about Fisher Information Matrix The feature direction corresponding to the largest eigenvalue Perform a bipartite partitioning to generate sub-regions. R 1 and R 2. Assign an initial radius to each sub-region. The damping natural gradient is recursively calculated in descending order of eigenvalues (priority from high to low) until all sub-regions meet the condition that no segmentation is required.
[0032] Among them, at the hyperparameter point The calculation process of the Fisher information matrix is as follows: For each sample in the training set, first calculate the gradient vector of the model's predicted log-likelihood with respect to all hyperparameters, then perform an outer product on this vector (i.e., multiply the gradient vector by its own transpose) to obtain the curvature contribution matrix corresponding to that sample; after traversing all samples, sum these outer product matrices and divide by the total number of samples to obtain the averaged Fisher information matrix. It reflects the average curvature and directional sensitivity of the hyperparameter space near that point.
[0033] The information geometric trust region update equation is as follows: .
[0034] .
[0035] in, Indicates the first k At the start of the next iteration, the old hyperparameter vector corresponding to the center of the current search sub-region. Indicates the first k+ The new hyperparameter vector obtained after one iteration is the output of this update. Indicates the first k The damped natural gradient is calculated at the center point of the current sub-region obtained in the next iteration. The damped natural gradient represents the step size required for the current steepest descent direction. This indicates taking the minimum value. Indicates the current point The largest non-zero eigenvalue of the Fisher information matrix at that point. This represents the maximum reliable search radius (trust region radius) of the current search area, indicating that within this radius, the error of the second-order approximation will definitely not exceed the preset tolerance. . represents the natural gradient step size, which is the upper limit of the safe search step size in the current region; represents the Euclidean norm of the current damped natural gradient, which is the step size of the current search direction itself. Represents the trace of the Fisher information matrix. This indicates the upper limit of the preset matrix condition number. Indicates the current hyperparameters Fisher information matrix at the location, This represents the identity matrix with the same dimensions as the Fisher information matrix. This represents the mean squared error loss function of the LSTM load forecasting model on the validation set under the current hyperparameters. express right The gradient of the Fisher information matrix is calculated as follows: First, under the current hyperparameter center, each sample in the training set is input into the model, and the gradient of the log-likelihood function of the predicted output with respect to the hyperparameters is calculated using backpropagation. Then, the gradient vector is multiplied by its transpose to obtain a matrix. Finally, the gradients of all samples are averaged, that is, the gradients of all samples are summed and then divided by the total number of samples, thus obtaining the empirical Fisher information matrix that characterizes the local curvature and sensitivity of the hyperparameter space.
[0036] The upper limit of the preset matrix condition number is a pre-defined regularization parameter, requiring that the number of conditions in the current search region cannot exceed this upper limit, ensuring numerical stability during the update process and avoiding gradient oscillations. It is understood that those skilled in the art can set the size of the preset matrix condition number upper limit according to actual needs; this invention does not limit this. Optionally, the value range can be set to... .
[0037] The preset tolerance is the maximum permissible error of the second-order approximation model relative to the true loss, and determines the size of the credible search range. During hyperparameter search, a second-order Taylor expansion is used to approximate the real, complex, non-convex loss surface (the undulating surface of loss as hyperparameters change) within the current sub-region. However, the true loss is high-dimensional and nonlinear, and the second-order Taylor expansion is only a local approximation—the farther away from the center point of the search region, the greater the error between the approximation and the true situation (i.e., the model mismatch error). If the error exceeds a reasonable range, the obtained descent direction will be completely wrong, skewing the hyperparameter search. Those skilled in the art can set the preset tolerance according to actual needs; this invention does not limit this. Optionally, it can be set to... .
[0038] The specific decision criteria for subregion partitioning are as follows: .
[0039] in, Represents the logical OR operator. This indicates the current hyperparameter preset sub-region. Perform the partitioning and splitting; this operation is triggered when subsequent conditions are met. Indicates the current point Find the smallest non-zero eigenvalue of the empirical Fisher information matrix.
[0040] During hyperparameter optimization, the allowed value range for each hyperparameter to be tuned is first defined. All these ranges are then combined to form a complete initial large search space (e.g., the allowed range for the learning rate is [1e-5, 1e-1], the allowed range for the number of hidden units is [16, 256], and the allowed range for the dropout rate is [0, 0.5]; these three ranges constitute a three-dimensional initial large search region). The algorithm then continuously breaks down large regions that do not meet the optimization conditions into smaller connected sub-regions. The small region currently being processed and evaluated is the current sub-region.
[0041] Specifically, in the hyperparameter optimization process of the LSTM load prediction model, the entire hyperparameter space is first treated as a high-dimensional non-Euclidean loss. Using information geometry, multiple trust region sub-regions are divided based on local curvature. An empirical Fisher information matrix is calculated at the center of each sub-region to characterize the local curvature, and a damped natural gradient is used to determine the safe step size and update direction. Large steps can be taken in flat regions, while in high-curvature directions, sub-regions are subdivided for recursive exploration, thus avoiding misleading explorations of steep regions. Compared to grid search or random search, this method can adaptively focus on searching high-influence directions in complex non-convex spaces, avoiding blindly trying invalid regions, improving convergence speed and numerical stability, while ensuring that the found hyperparameter configuration is closer to the global optimum, significantly improving the model's prediction accuracy and generalization ability.
[0042] It should be noted that by inputting real-time and historical building load data into a pre-trained LSTM model and combining information geometry and damped natural gradient adaptive search to optimize hyperparameters, it is possible not only to capture the long-term dependence and complex temporal characteristics of loads, but also to improve prediction accuracy and generalization ability, providing a reliable basis for building energy consumption regulation, while accelerating model convergence and ensuring numerical stability.
[0043] S3: Establish the prediction error correlation coefficient matrix of the pre-trained load prediction model based on offline predicted building load.
[0044] The prediction error correlation coefficient matrix refers to the correlation matrix between the prediction residuals calculated based on offline predicted building loads. By establishing the prediction error correlation coefficient matrix, the error characteristics of the prediction model can be accurately evaluated, providing uncertainty constraints for subsequent optimization of adjustable loads, making peak-valley load regulation of buildings safer and more robust, while avoiding over- or under-regulation of energy storage due to prediction deviations.
[0045] In one possible implementation, each element of the prediction error correlation coefficient matrix is specifically the Pearson correlation coefficient between the prediction residuals at two time points, wherein the prediction residual is specifically the difference between the actual building load and the offline predicted building load at the same time point.
[0046] It should be noted that by constructing a prediction error correlation coefficient matrix, the correlation between prediction residuals at different time points can be quantified, accurately reflecting the uncertainty of load prediction. This provides constraints for adjustable load optimization, ensures the safety and reliability of peak-valley regulation, reduces the regulation risk of energy storage equipment due to prediction deviations, and improves the system scheduling robustness and energy efficiency optimization effect.
[0047] S4: Determine the net load factor by combining the adjustable load of the building and the predicted building load.
[0048] The net load factor refers to the normalized ratio of a building's actual load at a given moment to its adjusted load value relative to the historical maximum load. The building load value is equal to the combined value of the predicted building load and the adjustable load (such as the charging and discharging power of energy storage modules), divided by the historical maximum load value to obtain the net load factor. This factor reflects the relative magnitude of the building load after considering adjustable load adjustments and is used to measure peak-valley load distribution. Calculating the net load factor quantifies the load adjustment effect, providing a data foundation for subsequent time-series volume calculations and peak-valley reduction, making building load optimization more accurate and controllable, while also considering the coordinated scheduling of predicted and adjustable loads.
[0049] In one possible implementation, the adjustable load of the building specifically includes the positive energy storage module charging and discharging power and the negative energy storage module charging and discharging power, wherein the positive energy storage module charging and discharging power represents charging the energy storage module through the power grid, and the negative energy storage module charging and discharging power represents discharging the energy storage module to the building power management module through the energy storage module.
[0050] The net load factor is specifically the quotient of the building load value and the historical maximum building load value. The building load value is specifically the difference between the sum of the loads at the same moment and the power of the power grid. The sum of the loads is specifically the sum of the adjustable building load and the predicted building load.
[0051] It should be noted that by calculating the net load factor, the building load and adjustable energy storage power can be combined and normalized to quantify the load regulation effect, achieve accurate assessment of peak and valley load distribution, and thus provide a reliable basis for time-series volume calculation and optimized control, thereby improving the accuracy, controllability and energy utilization efficiency of building load regulation.
[0052] S5: Calculate the time-series volume of the net load factor to measure the peak-valley fluctuation of building electricity consumption.
[0053] The time-series volume is a geometric quantity obtained by hysteresis embedding the normalized net load coefficient sequence to obtain the hysteresis embedding matrix, and then calculating the Gram matrix determinant of this matrix. The volume of the parallel polyhedron spanned by the time-series vectors quantifies the peak-valley fluctuations of the building load curve: the more dramatic the peak-valley fluctuations and the more dispersed the load changes, the larger the time-series volume. The smoother the curve and the more collinear adjacent loads are, the smaller the time-series volume. The time-series volume not only quantifies the dynamic correlation of load time sequences, which is difficult to reflect using traditional peak-valley differences or variance, but also accurately reflects net load fluctuations through geometric evaluation, providing precise indicators for subsequent optimization of adjustable loads.
[0054] In one possible implementation, S5 specifically includes: S501: Determine the lag embedding dimension based on the number of scheduling periods corresponding to the scheduling cycle. Specifically, the number of scheduling periods is the quotient of the scheduling cycle and the scheduling interval. The value range of the lag embedding dimension is an integer greater than 1 and less than half the lower bound of the number of scheduling periods.
[0055] Specifically, the range of values for the lag embedding dimension is as follows: .in, This indicates the lag embedding dimension. Indicates the total number of scheduling periods. This indicates taking the lower bound. By determining the lag embedding dimension based on the scheduling cycle and scheduling interval, the historical window length of the time series features can be reasonably selected. This ensures that the time series matrix contains sufficient historical information to capture load change patterns while avoiding redundant data interference, thereby improving the accuracy of peak-valley fluctuation quantification and the effectiveness of subsequent load optimization.
[0056] For example, if the scheduling cycle is set to 1 calendar day and the scheduling interval is set to every 15 minutes, then the number of scheduling periods is 24 × 60 ÷ 15 = 96.
[0057] S502: Establish a lag embedding matrix for the net load coefficient based on the lag embedding dimension. The number of columns in the lag embedding matrix is the same as the lag embedding dimension, and the number of rows in the lag embedding matrix is the number of scheduling periods minus the lag embedding dimension plus 1.
[0058] The formula for the hysteresis embedding matrix is as follows: .
[0059] in, Represents the hysteresis embedding matrix. Indicates the first t Net load factor corresponding to each scheduling period , T This indicates the total number of scheduling periods.
[0060] S503: Calculate the Gram matrix of the lag embedding matrix, where the Gram matrix is the product of the transpose of the lag embedding matrix and the lag embedding matrix.
[0061] S504: Output the Gram matrix determinant as the time volume.
[0062] The time-series volume is a geometric evaluation index used to quantify the peak-to-valley fluctuations of the building's net load curve. It is obtained by performing time-series lag embedding on the normalized net load sequence to obtain a Gram matrix, and then taking the matrix determinant. It represents the volume of a parallel polyhedron spanned by the time-lag vectors of each row of the lag embedding matrix. The more dramatic the peak-to-valley fluctuations of the curve, the more dispersed the load changes between adjacent time periods, and the greater the difference in the direction of the time-lag vectors, the larger the time-series volume. Conversely, the flatter the curve and the stronger the collinearity between adjacent loads, the closer the time-series volume is to zero. By minimizing the time-series volume, peak-to-valley smoothing and valley-filling of the net load curve can be automatically achieved. It can also capture the dynamic correlation of load time sequences that traditional peak-to-valley difference and variance cannot reflect, making the measurement of fluctuations more aligned with actual scheduling needs.
[0063] Specifically, by performing hysteresis embedding on the normalized net load coefficient sequence to form a hysteresis embedding matrix, the time-series volume is obtained by calculating the Gram matrix determinant of this matrix. This geometric quantity can quantify the peak-valley fluctuation of the building load curve: when the load curve fluctuates sharply and the load difference between adjacent time periods is large, the time-series vector direction difference is significant, and the volume value is large. When the load curve is smooth and adjacent loads are highly correlated, the time-series vectors tend to be collinear, and the volume value is close to zero. By minimizing the time-series volume, the system can automatically adjust the adjustable load, achieve peak-valley reduction and smooth the load curve, and at the same time capture the time-series dynamic correlation that traditional peak-valley difference or variance cannot reflect, making building load regulation more accurate, improving energy utilization efficiency and enhancing the stability and reliability of peak-valley regulation, thereby optimizing the overall power consumption structure and ensuring the effective utilization of energy storage equipment.
[0064] S6: Combining the prediction error correlation coefficient matrix, establish an objective function for the adjustable load of the building with the goal of minimizing the time series volume.
[0065] The objective function is constructed by taking the adjustable load of the building as a variable and comprehensively considering the uncertainty constraints of the time-series volume of the net load curve and the correlation coefficient matrix of the prediction error. By establishing an objective function that comprehensively considers load smoothing and prediction uncertainty, the optimal control of peak and off-peak electricity consumption in buildings can be achieved while ensuring the safety of load regulation, thereby improving energy utilization efficiency and dispatch robustness.
[0066] In one possible implementation, S6 specifically includes: S601: Calculate the determinant of the correlation coefficient matrix of prediction error.
[0067] S602: Perform a logarithmic transformation on both the determinant of the Gram matrix and the determinant of the correlation coefficient matrix of the prediction error.
[0068] It should be noted that, since the logarithm is a monotonically increasing function, minimizing the logarithmic determinant and minimizing the original time series volume are completely equivalent and do not change the optimization direction. Furthermore, the logarithmic transformation can compress excessively large determinant values, avoiding computational overflow, simplifying gradient calculation, and facilitating efficient solutions using the conjugate gradient method.
[0069] S603: The logarithmic transformation result of the determinant of the prediction error correlation coefficient matrix is used as the prediction uncertainty penalty term. The objective function is obtained by summing the logarithmic transformation results of the prediction error correlation coefficient matrix determinant and the Gram matrix determinant. The weight of the prediction uncertainty penalty term is the quotient of the determinant of the prediction error correlation coefficient matrix and the sum of the determinants, where the sum of the determinants is the sum of the determinant of the prediction error correlation coefficient matrix and the Gram matrix determinant.
[0070] The objective function is as follows: .
[0071] .
[0072] in, Indicates the adjustable load of the building. Represents the minimum objective function value corresponding , Represents the natural logarithm. This indicates the weight of the penalty term for prediction uncertainty. Represents the determinant of a Gram matrix. Represents the Gram matrix. This represents the correlation coefficient matrix of prediction errors.
[0073] The prediction uncertainty penalty term weight is a dynamic weight used to balance the impact of load smoothing optimization and prediction error uncertainty constraints in the objective function. When the net load curve fluctuates drastically, the columns of the Gram matrix determinant are nearly linearly independent, resulting in a larger Gram matrix determinant, a larger denominator, and a smaller penalty term weight. This automatically reduces the penalty term weight, further smoothing out peak loads and filling valleys. When the net load curve has been driven very flat, the Gram matrix determinant approaches zero, and the penalty term weight approaches 1, meaning the penalty term weight automatically increases to its maximum. This prevents further adjustments from blindly relying on prediction results, which could lead to load reversal, irreversible power loss from energy storage devices, or disturbances caused by over-adjustment. This ensures safe and stable power supply while reducing adverse effects caused by prediction errors.
[0074] Specifically, this process establishes an objective function with the building's adjustable load as the variable, combining the time-series volume of the net load curve with the uncertainty constraint of the prediction error correlation coefficient matrix to achieve comprehensive optimization of building load smoothing and prediction risk. The process first calculates the Gram matrix determinant to quantify peak-valley fluctuations, then performs a logarithmic transformation on it and the prediction error matrix determinant to compress the numerical range for easier calculation. Prediction uncertainty is added as a dynamic penalty term to the objective function, automatically balancing the weights of load smoothing and prediction error constraints during optimization. When the load curve fluctuates significantly, the system automatically reduces the penalty weight, prioritizing peak smoothing and valley filling. When the load curve tends to flatten, the penalty weight increases to prevent over-adjustment or energy storage loss due to prediction deviations. Through this method, the optimization of the building's adjustable load not only smooths peak-valley load curves and improves energy utilization efficiency, but also effectively addresses the uncertainty caused by prediction errors, ensuring the safety and robustness of energy storage regulation and scheduling, thus achieving safe, intelligent, and sustainable optimization of building energy consumption.
[0075] S7: Calculate the analytical gradient of the objective function with respect to the adjustable load of the building, and perform conjugate gradient iteration based on the analytical gradient to output the adjustment amount of the adjustable load of the building.
[0076] The analytical gradient refers to the precise partial derivative of the objective function with respect to the adjustable load of the building, calculated directly by a formula rather than through numerical difference approximation. The adjustable load adjustment amount is the optimized change value of the adjustable load obtained by iterative calculation based on the analytical gradient and conjugate gradient. It is used to guide the charging and discharging of energy storage modules or the power adjustment of other adjustable load devices, thereby achieving peak-valley load smoothing.
[0077] In one possible implementation, S7 specifically includes: S701: Calculate the analytical gradient of the objective function with respect to the adjustable load of the building.
[0078] The formula for the analytical gradient is as follows: .
[0079] .
[0080] in, This indicates the partial derivative. This represents the analytical gradient of the objective function with respect to the adjustable load of the building. This represents the multidimensional tensor shrinking operation. The gradient subscript representing the determinant of the Gram matrix with respect to the adjustable load of the building. This indicates transpose.
[0081] S702: Establish charging power constraint range and discharging power constraint range for adjustable load of building, wherein the upper and lower limits of the charging power constraint range are the maximum and minimum charging power of the energy storage module, respectively, and the upper and lower limits of the discharging power constraint range are the maximum and minimum discharging power of the energy storage module, respectively.
[0082] S703: Under the constraints of the charging power constraint range and the discharging power constraint range, the building adjustable load adjustment amount is obtained by performing conjugate gradient iteration based on the analytical gradient.
[0083] Specifically, during the conjugate gradient iteration process, within the charging power constraint interval and the discharging power constraint interval, the initial value of the building's adjustable load is first set as a feasible solution. Then, the gradient direction of the objective function with respect to each adjustable load is calculated using the analytical gradient formula. Based on this gradient, the search direction for load adjustment is determined, and the load value is updated along the current search direction during the conjugate gradient iteration process. At the same time, it is checked whether the updated load meets the upper and lower limits of charging and discharging power constraints. If it exceeds the constraints, it is truncated or projected. After each iteration, the analytical gradient is recalculated and the search direction is adjusted until the iteration converges or meets the preset accuracy requirements, thereby obtaining the final adjustment amount of the building's adjustable load that meets the power constraints.
[0084] Using analytical gradient combined with conjugate gradient iterative calculation to determine the adjustable load adjustment of a building can accurately obtain the sensitivity of the objective function to load changes, avoiding the problems of low accuracy and high computational cost caused by numerical difference. At the same time, it can efficiently utilize gradient direction to accelerate convergence during the iteration process and can naturally handle charging and discharging power constraints, thereby significantly improving the solution efficiency and feasible solution quality while ensuring computational accuracy.
[0085] It should be noted that this process first uses analytical gradients to accurately calculate the sensitivity of the objective function to the building's adjustable load, clarifying the direction and magnitude of the impact of each load adjustment on peak-valley fluctuations and smoothing effects. Then, it utilizes conjugate gradient iteration to optimize load allocation within the power constraint range of charging and discharging. This avoids the accuracy loss caused by numerical difference approximation, fully leverages gradient information to accelerate convergence, and automatically handles power constraints to ensure the safe and reliable charging and discharging operation of the energy storage modules. Through this constrained iterative optimization, the building's adjustable load adjustment can efficiently and robustly achieve peak-valley reduction and load curve smoothing, thereby improving energy utilization efficiency and ensuring dispatch safety.
[0086] S8: Adjust the charging and discharging power of the energy storage module according to the adjustable load of the building to optimize the peak and valley power consumption of the building.
[0087] The beneficial effects of the technical solutions provided in the embodiments of the present invention include at least the following: In this embodiment of the invention, by acquiring real-time and historical electricity load data, a pre-trained load prediction model can accurately predict future building loads. Simultaneously, a prediction error correlation matrix is constructed to quantify prediction uncertainty. Combined with adjustable building loads, the net load factor is calculated and the peak-valley fluctuation level is assessed. Then, by constructing an objective function that minimizes peak-valley fluctuations, the adjustable load allocation is iteratively optimized using analytical gradients and conjugate gradients. Finally, the energy storage module flexibly adjusts its charging and discharging power based on the optimization results, thereby balancing building load distribution, reducing peak pressure, improving energy utilization efficiency, and mitigating grid fluctuations. This achieves full utilization of energy storage devices and intelligent, sustainable optimization of building energy consumption. By optimizing adjustable loads to smooth building load curves, peak shaving and valley filling are achieved while considering prediction uncertainty and energy storage constraints. This significantly reduces grid transmission and distribution pressures, decreases the need for frequent frequency regulation, improves system operation safety and economy, and ensures efficient scheduling and load utilization of building electricity.
[0088] Reference manual attached Figure 4 The diagram shows a structural schematic of a building peak-valley electricity consumption optimization configuration system that integrates AI prediction, provided by the present invention.
[0089] The present invention also provides a building peak-valley electricity consumption optimization configuration system 20 that integrates AI prediction, applied to the above-mentioned building peak-valley electricity consumption optimization configuration method that integrates AI prediction, including: Processor 201.
[0090] The memory 202 stores computer-readable instructions. When the computer-readable instructions are executed by the processor 201, they implement the building peak-valley power consumption optimization configuration method that integrates AI prediction, as described in the method embodiment.
[0091] The building peak-valley electricity consumption optimization configuration system 20 provided by the present invention can execute the above-mentioned building peak-valley electricity consumption optimization configuration method based on AI prediction and achieve the same or similar technical effects. To avoid duplication, the present invention will not elaborate further.
[0092] This invention provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the building peak-valley energy consumption optimization configuration method as described in the method embodiment, which integrates AI prediction.
[0093] The present invention provides a computer-readable storage medium that can implement the steps and effects of the building peak and valley power consumption optimization configuration method based on the fusion AI prediction of the above-described method embodiments. To avoid repetition, the present invention will not repeat the details.
[0094] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
[0095] The following points need to be explained: (1) The accompanying drawings of the embodiments of the present invention only involve the structures involved in the embodiments of the present invention. Other structures can refer to the general design.
[0096] (2) For clarity, the thickness of layers or regions is enlarged or reduced in the drawings used to describe embodiments of the invention, i.e., these drawings are not drawn to scale. It is understood that when an element such as a layer, film, region or substrate is referred to as being “above” or “below” another element, the element may be “directly” located “above” or “below” the other element or there may be intermediate elements.
[0097] (3) Where there is no conflict, the embodiments of the present invention and the features in the embodiments can be combined with each other to obtain new embodiments.
[0098] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. The scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for optimizing building peak and valley electricity consumption by integrating AI prediction, characterized in that, An energy consumption dispatching system is applied to a power grid, an energy storage module, and a building power management module. The energy storage module is connected to both the power grid and the building power management module. The power grid is connected to the building power management module. The energy storage module includes a charging and discharging control unit. The method includes: S1: Obtain building electricity load correlation data and historical building electricity load correlation data through the charging and discharging control unit; S2: Input the building electricity load correlation data and the historical building electricity load correlation data into the pre-trained load prediction model respectively, and output the predicted building load and the offline predicted building load; S3: Based on the offline predicted building load, establish the prediction error correlation coefficient matrix of the pre-trained load prediction model; S4: Determine the net load factor by combining the adjustable building load and the predicted building load; S5: Calculate the time-series volume of the net load factor to measure the peak-valley fluctuation of building electricity consumption; S6: Combining the prediction error correlation coefficient matrix, establish an objective function for the adjustable load of the building with the goal of minimizing the time series volume; S7: Calculate the analytical gradient of the objective function with respect to the adjustable load of the building, and perform conjugate gradient iteration based on the analytical gradient to output the adjustment amount of the adjustable load of the building; S8: Adjust the charging and discharging power of the energy storage module according to the adjustable load adjustment amount of the building to optimize the peak and valley power consumption of the building.
2. The method for optimizing building peak and valley electricity consumption based on AI prediction as described in claim 1, characterized in that, The building electricity load correlation data includes power consumption data, meteorological data, and time-of-use electricity price data; the historical building electricity load correlation data includes historical power consumption data, historical meteorological data, and historical time-of-use electricity price data.
3. The method for optimizing building peak and valley electricity consumption based on AI prediction as described in claim 1, characterized in that, The pre-trained load prediction model is specifically a long short-term memory network model.
4. The method for optimizing building peak and valley electricity consumption based on AI prediction as described in claim 1, characterized in that, Each element of the prediction error correlation coefficient matrix is specifically the Pearson correlation coefficient between the prediction residuals at two time points, wherein the prediction residual is specifically the difference between the actual building load and the offline predicted building load at the same time point.
5. The method for optimizing building peak and valley electricity consumption based on AI prediction as described in claim 1, characterized in that, The adjustable load of the building specifically includes the charging and discharging power of the positive energy storage module and the charging and discharging power of the negative energy storage module. The charging and discharging power of the positive energy storage module represents the charging of the energy storage module through the power grid, and the charging and discharging power of the negative energy storage module represents the discharging of the energy storage module to the building power management module. The net load factor is specifically the quotient of the building load value and the historical maximum building load value. The building load value is specifically the difference between the sum of the loads at the same moment and the power supply grid power. The sum of the loads is specifically the sum of the adjustable building load and the predicted building load.
6. The method for optimizing building peak and valley electricity consumption based on AI prediction as described in claim 1, characterized in that, S5 specifically includes: S501: Determine the lag embedding dimension based on the number of scheduling periods corresponding to the scheduling cycle, wherein the number of scheduling periods is specifically the quotient of the scheduling cycle and the scheduling interval, and the value range of the lag embedding dimension is an integer greater than 1 and less than half the lower bound of the number of scheduling periods. S502: Establish a lag embedding matrix for the net load coefficient based on the lag embedding dimension, wherein the number of columns of the lag embedding matrix is the same as the lag embedding dimension, and the number of rows of the lag embedding matrix is the number of scheduling periods minus the lag embedding dimension plus 1; S503: Calculate the Gram matrix of the hysteresis embedding matrix, wherein the Gram matrix is the product of the transpose of the hysteresis embedding matrix and the hysteresis embedding matrix; S504: Output the Gram matrix determinant as the time volume.
7. The method for optimizing building peak and valley electricity consumption based on AI prediction as described in claim 6, characterized in that, S6 specifically includes: S601: Calculate the determinant of the correlation coefficient matrix of prediction errors; S602: Perform a logarithmic transformation on both the determinant of the Gram matrix and the determinant of the prediction error correlation coefficient matrix; S603: The logarithmic transformation result of the determinant of the prediction error correlation coefficient matrix is used as the prediction uncertainty penalty term. The logarithmic transformation results of the prediction error correlation coefficient matrix and the Gram matrix are summed to obtain the objective function. The weight of the prediction uncertainty penalty term is the quotient of the determinant of the prediction error correlation coefficient matrix and the sum of the determinants, where the sum of the determinants is the sum of the determinant of the prediction error correlation coefficient matrix and the Gram matrix.
8. The method for optimizing building peak and valley electricity consumption based on AI prediction as described in claim 1, characterized in that, Specifically, S7 includes: S701: Calculate the analytical gradient of the objective function with respect to the adjustable load of the building; S702: Establish the charging power constraint range and the discharging power constraint range of the adjustable load of the building, wherein the upper and lower limits of the charging power constraint range are the maximum and minimum charging power of the energy storage module, respectively, and the upper and lower limits of the discharging power constraint range are the maximum and minimum discharging power of the energy storage module, respectively. S703: Under the constraints of the charging power constraint range and the discharging power constraint range, the building adjustable load adjustment amount is obtained by performing conjugate gradient iteration based on the analytical gradient.
9. A building peak-valley electricity consumption optimization configuration system integrating AI prediction, characterized in that, include: processor; A memory storing computer-readable instructions, which, when executed by the processor, implement the building peak-valley energy consumption optimization configuration method based on AI prediction as described in any one of claims 1 to 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the building peak and valley power consumption optimization configuration method that incorporates AI prediction as described in any one of claims 1 to 8.