A training method and device of an energy consumption prediction model, a terminal device, a storage medium, and an energy consumption prediction method

CN123012580APending Publication Date: 2026-10-30JIANGMEN POWER SUPPLY BUREAU OF GUANGDONG POWER GRID CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611253482.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-18
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0004]本发明提供了一种能耗预测模型的训练方法、装置、终端设备、存储介质以及能耗预测方法,能解决现有技术中仅使用单一变量的历史数据进行能耗预测,存在预测结果精度不足的问题

Benefits of technology

本发明提供了一种能耗预测模型的训练方法、装置、终端设备、存储介质以及能耗预测方法,上述能耗预测模型的训练方法包括:获取历史电量数据、上述历史电量数据对应的历史环境数据、历史运行数据、历史市场数据、历史能耗数据以及历史时段;随后根据上述历史能耗数据,对上述历史电量数据、历史环境数据、历史运行数据、历史市场数据以及历史时段进行特征选择,得到训练样本集和评估样本集;最后根据上述训练样本集对预设初始能耗预测模型进行重复模型优化操作,得到最终的预设能耗预测模型;其中,上述模型优化操作包括:获取当前种群;其中,上述种群包含若干个体,每一个体表示一组模型外层超参数组合,初始时的个体为预设初始个体;针对当前种群中的每一个体,根据当前的模型外层超参数组合构建当前的能耗预测模型,并根据上述训练样本集对当前的能耗预测模型进行迭代训练,直至损失函数收敛,得到更新后的能耗预测模型;根据上述评估样本集计算得到当前个体的适应度;判断当前的模型优化操作次数是否不小于预设优化次数,若是,将适应度最大的当前个体所对应的能耗预测模型,作为上述预设能耗预测模型;否则,根据遗传算法和所有当前个体的适应度对当前种群进行更新。因此在本发明中获取了包含电量、环境与运行数据,以及时间与市场数据等与能耗预测相关联的多源数据量,并基于这些多源数据进行特征选择,构建用于模型训练的样本集,因此训练得到的模型能学习到样本集所对应的多源数据对能耗预测的关联影响,使得训练好的模型在实际应用时,预测出的结果更为精确。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123012580A_ABST
    Figure CN123012580A_ABST
Patent Text Reader

Abstract

The application discloses a kind of training method of energy consumption prediction model, device, terminal equipment, storage medium and energy consumption prediction method, belong to energy consumption prediction technical field, the training method described above is: obtaining historical power data, historical operation data, historical market data, historical energy consumption data, historical time period and historical energy consumption data, and after feature selection, training sample set and evaluation sample set are obtained;According to the training sample set, the preset initial energy consumption prediction model is repeatedly model optimized, and the final preset energy consumption prediction model is obtained. By implementing the present application, it can solve the problem of insufficient prediction result accuracy in the prior art by using only single variable historical data for energy consumption prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of energy consumption prediction technology, and in particular to a training method, apparatus, terminal device, storage medium, and energy consumption prediction method for an energy consumption prediction model. Background Technology

[0002] With the advancement of global low-carbon economy and green development goals, accurately assessing and optimizing energy consumption and carbon emissions in energy-intensive industries has become a key task in driving industry transformation. Energy-intensive industries are not only a significant source of global carbon emissions but also a key area for improving energy efficiency. How to help enterprises achieve energy conservation and emission reduction targets through high-precision energy consumption forecasting and carbon emission assessment while ensuring production efficiency has become an urgent issue to be addressed.

[0003] Existing technologies often rely on statistical time series data for energy consumption prediction and analysis. For example, industries such as steel and chemicals often use autoregressive models or autoregressive moving average models for prediction. Under this prediction method, predictions can usually only be made based on historical data of a single variable. However, in reality, energy consumption is usually affected by multiple factors such as electricity consumption data and external climate. Therefore, existing technologies have the problem of insufficient accuracy in prediction results. Summary of the Invention

[0004] This invention provides a training method, apparatus, terminal device, storage medium, and energy consumption prediction method for an energy consumption prediction model, which can solve the problem of insufficient accuracy of prediction results when using only historical data of a single variable for energy consumption prediction in the prior art.

[0005] An embodiment of the present invention provides a training method for an energy consumption prediction model, comprising: Acquire historical electricity consumption data, the corresponding historical environmental data, historical operational data, historical market data, historical energy consumption data, and historical time periods; Based on the aforementioned historical energy consumption data, feature selection was performed on the aforementioned historical electricity data, historical environmental data, historical operational data, historical market data, and historical time periods to obtain a training sample set and an evaluation sample set. Based on the above training sample set, the preset initial energy consumption prediction model is repeatedly optimized to obtain the final preset energy consumption prediction model. The above model optimization operations include: Obtain the current population; where the population contains several individuals, each individual represents a set of model outer hyperparameter combinations, and the initial individuals are preset initial individuals; For each individual in the current population, a current energy consumption prediction model is constructed based on the current model's outer hyperparameter combination. The current energy consumption prediction model is then iteratively trained using the aforementioned training sample set until the loss function converges, resulting in an updated energy consumption prediction model. The fitness of the current individual is calculated based on the aforementioned evaluation sample set. Determine whether the current number of model optimization operations is not less than the preset number of optimizations. If so, use the energy consumption prediction model corresponding to the current individual with the highest fitness as the preset energy consumption prediction model. Otherwise, update the current population based on the genetic algorithm and the fitness of all current individuals.

[0006] Furthermore, before performing feature selection on the aforementioned historical electricity consumption data, historical environmental data, historical operational data, historical market data, and historical time periods based on the aforementioned historical energy consumption data, the process also includes: The above-mentioned historical electricity data, historical environmental data, historical operational data, historical market data, historical time periods, and historical energy consumption data are normalized to obtain normalized historical electricity data, normalized historical environmental data, normalized historical operational data, normalized historical market data, normalized historical time periods, and normalized historical energy consumption data. Calculate the statistical characteristic values ​​of the normalized historical electricity data, normalized historical environmental data, normalized historical operational data, normalized historical market data, normalized historical time periods, and normalized historical energy consumption data respectively. The normalized data is standardized based on the above statistical characteristic values.

[0007] Furthermore, the current energy consumption prediction model is iteratively trained based on the aforementioned training sample set until the loss function converges, resulting in an updated energy consumption prediction model, including: The above training sample set is input into the current energy consumption prediction model for iterative training until the loss function converges, and the updated energy consumption prediction model is obtained. In each iteration of training, the current energy consumption prediction value is generated based on the current training sample; the current loss function is calculated based on the current energy consumption prediction value and the historical energy consumption data corresponding to the current training sample, and it is determined whether the current loss function has converged. If convergence is achieved, the energy consumption prediction model corresponding to the current loss function will be used as the updated energy consumption prediction model. Otherwise, according to the gradient descent method, the inner weight parameters in the energy consumption prediction model corresponding to the current loss function are adjusted, and iterative training continues.

[0008] Furthermore, the above-mentioned generation of the current energy consumption prediction value based on the current training samples includes: The current feature vector is constructed based on the current training samples; The current feature vector is input into the updated energy consumption prediction model; wherein the energy consumption prediction model includes: an input layer, a hidden layer and an output layer; The current feature vector is transmitted to the hidden layer through the input layer; Based on the hidden layer, feature extraction is performed on the current feature vector to obtain high-level features that represent the energy consumption correlation pattern, and the above high-level features are transmitted to the output layer; The current energy consumption prediction value is obtained by linearly activating the above high-level features based on the output layer.

[0009] Furthermore, the fitness of the current individual calculated based on the aforementioned evaluation sample set includes: Obtain the complexity and regularization coefficient corresponding to the current individual; The evaluation samples in the above evaluation sample set are input into the updated energy consumption prediction model to obtain the predicted energy consumption corresponding to each of the above evaluation samples; The fitness of the current individual is calculated based on all predicted energy consumption, historical energy consumption data corresponding to each predicted energy consumption, complexity, and regularization coefficient.

[0010] Furthermore, the above-mentioned updating of the current population based on the genetic algorithm and the fitness of all current individuals includes: Based on the fitness of all current individuals, the probability of each current individual being selected is calculated. Based on the selection probability and the roulette wheel selection method, select several current parent individuals from all current individuals for cross-pairing; Perform crossover operations on the current parent individuals in each group to generate several current child individuals; Perform mutation operations on all current offspring individuals to generate an updated population.

[0011] Based on the above method embodiments, the present invention provides corresponding apparatus embodiments; This invention provides a training device for an energy consumption prediction model, comprising: Data acquisition module, sample set construction module, and model training module; The aforementioned data acquisition module is used for historical environmental data, historical operational data, historical market data, historical energy consumption data, and historical time periods corresponding to the aforementioned historical electricity data; The aforementioned sample set construction module is used to select features from the aforementioned historical electricity data, historical environmental data, historical operational data, historical market data, and historical time periods based on the aforementioned historical energy consumption data, in order to obtain a training sample set and an evaluation sample set. The aforementioned model training module is used to perform repeated model optimization operations on the preset initial energy consumption prediction model based on the aforementioned training sample set, so as to obtain the final preset energy consumption prediction model. The above model optimization operations include: Obtain the current population; where the population contains several individuals, each individual represents a set of model outer hyperparameter combinations, and the initial individuals are preset initial individuals; For each individual in the current population, a current energy consumption prediction model is constructed based on the current model's outer hyperparameter combination. The current energy consumption prediction model is then iteratively trained using the aforementioned training sample set until the loss function converges, resulting in an updated energy consumption prediction model. The fitness of the current individual is calculated based on the aforementioned evaluation sample set. Determine whether the current number of model optimization operations is not less than the preset number of optimizations. If so, use the energy consumption prediction model corresponding to the current individual with the highest fitness as the preset energy consumption prediction model. Otherwise, update the current population based on the genetic algorithm and the fitness of all current individuals.

[0012] Based on the above method embodiments, the present invention provides a corresponding terminal device embodiment; The present invention provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements a training method for an energy consumption prediction model as described in any embodiment of the present invention.

[0013] Based on the above method embodiments, the present invention provides a corresponding storage medium embodiment; The present invention provides a storage medium including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements a training method for an energy consumption prediction model according to any embodiment of the present invention.

[0014] Another embodiment of the present invention provides an energy consumption prediction method, comprising: Acquire electricity consumption data, the corresponding environmental data, operational data, market data, and forecast period; Based on the above electricity data, environmental data, operational data, market data, and forecast period, an input feature vector is constructed; The aforementioned input feature vector is input into a preset energy consumption prediction model so that the preset energy consumption prediction model can predict the energy consumption based on the aforementioned input feature vector; wherein, the aforementioned preset energy consumption prediction model is obtained by training according to the training method of an energy consumption prediction model described in any of the above embodiments.

[0015] The embodiments of the present invention have the following beneficial effects: This invention provides a training method, apparatus, terminal device, storage medium, and energy consumption prediction method for an energy consumption prediction model. The training method includes: acquiring historical electricity consumption data, historical environmental data, historical operational data, historical market data, historical energy consumption data, and historical time periods corresponding to the historical electricity consumption data; then, based on the historical energy consumption data, performing feature selection on the historical electricity consumption data, historical environmental data, historical operational data, historical market data, and historical time periods to obtain a training sample set and an evaluation sample set; finally, performing repeated model optimization operations on a preset initial energy consumption prediction model based on the training sample set to obtain a final preset energy consumption prediction model; wherein, the model optimization operation includes: acquiring the current population; The aforementioned population comprises several individuals, each representing a set of model outer hyperparameter combinations. Initially, each individual is a preset initial individual. For each individual in the current population, a current energy consumption prediction model is constructed based on the current model outer hyperparameter combination. This model is then iteratively trained using the aforementioned training sample set until the loss function converges, resulting in an updated energy consumption prediction model. The fitness of the current individual is calculated based on the aforementioned evaluation sample set. It is determined whether the number of current model optimization operations is not less than a preset number of optimizations. If so, the energy consumption prediction model corresponding to the current individual with the highest fitness is used as the preset energy consumption prediction model. Otherwise, the current population is updated based on the genetic algorithm and the fitness of all current individuals. Therefore, this invention acquires multi-source data related to energy consumption prediction, including electricity consumption, environmental and operational data, as well as time and market data. Feature selection is performed based on this multi-source data to construct a sample set for model training. Thus, the trained model can learn the correlation between the multi-source data corresponding to the sample set and energy consumption prediction, making the predicted results more accurate in practical applications. Attached Figure Description

[0016] To more clearly illustrate the technical solution of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0017] Figure 1This is a flowchart illustrating a training method for an energy consumption prediction model according to an embodiment of the present invention.

[0018] Figure 2 This is a schematic diagram of the training results of a preset energy consumption prediction model provided in an embodiment of the present invention.

[0019] Figure 3 This is a schematic diagram of the structure of a training device for an energy consumption prediction model provided in an embodiment of the present invention.

[0020] Figure 4 This is a flowchart illustrating an energy consumption prediction method provided in an embodiment of the present invention. Detailed Implementation

[0021] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0022] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.

[0023] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly defined.

[0024] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0025] In the description of the embodiments in this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.

[0026] In the description of the embodiments of this application, the term "multiple" refers to two or more (including two), similarly, "multiple sets" refers to two or more (including two sets), and "multiple pieces" refers to two or more (including two pieces).

[0027] In the description of the embodiments of this application, unless otherwise expressly specified and limited, technical terms such as "installation," "connection," "joining," and "fixing" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. For those skilled in the art, the specific meaning of the above terms in the embodiments of this application can be understood according to the specific circumstances.

[0028] See Figure 1 To address the issue of insufficient accuracy in energy consumption prediction using only historical data of a single variable in existing technologies, an embodiment of the present invention provides a training method for an energy consumption prediction model, comprising: Step S101: Obtain historical power consumption data, historical environmental data, historical operating data, historical market data, historical energy consumption data, and historical time periods corresponding to the aforementioned historical power consumption data; Specifically, electricity data includes electricity load and power; environmental data includes ambient temperature and humidity; operational data includes production load and equipment operating status; market data includes season and energy prices; energy consumption data refers to non-electrical energy consumption data, including thermal energy consumption data and fuel consumption data; and time periods include seasonal periods.

[0029] Step S102: Based on the above historical energy consumption data, feature selection is performed on the above historical electricity data, historical environmental data, historical operation data, historical market data, and historical time periods to obtain a training sample set and an evaluation sample set; Specifically, this invention uses Lasso (L1 regularization) to filter out feature data that has a significant impact on historical energy consumption data from historical electricity data, historical environmental data, historical operational data, historical market data, and historical time periods. Lasso, by adding an L1 norm regularization term, makes the data more sparse-oriented while fitting it, thereby eliminating features that have a small impact on the target variable (i.e., the historical energy consumption data in this invention). The effect of L1 regularization is to make certain weights zero, thus achieving feature selection. Lasso regression uses the L1 regularization term to implement constraints, thereby achieving feature selection. The objective function of Lasso regression is as follows: In the formula, n represents the number of historical energy consumption data points, reflecting the number of combinations of historical data obtained in the preceding steps, and i represents the combination of the i-th historical data point. Let p represent the historical energy consumption data corresponding to the combination of the i-th historical data, p represent the total number of dimensional features, and j represent the j-th dimensional feature (i.e., the historical data mentioned above). This represents the weight coefficient of the j-th feature. Let the j-th dimension of the i-th historical data combination be represented. This indicates the regularization strength.

[0030] Preferably, Lasso feature selection can compress the weight coefficients of irrelevant features to 0, while the weight coefficients of relevant features are non-zero. Therefore, the features corresponding to these non-zero weight coefficients can be used as the selected target features. After selection, the selected target features are not fixed but determined by the training data. These may include three categories: electricity data (active power, reactive power); environmental and operational data (ambient temperature, operating status of major production equipment (start / stop / standby)); and time and market data (peak / valley / normal periods, daily energy market price).

[0031] Specifically, after obtaining the target features, the historical data corresponding to these target features are proportionally divided to obtain the training sample set and the evaluation sample set. The training sample set is subsequently used to optimize and adjust the inner layer weight parameters of the model, while the evaluation sample set is subsequently used to optimize the outer layer hyperparameters of the model.

[0032] In a preferred embodiment, before performing feature selection on the historical electricity consumption data, historical environmental data, historical operational data, historical market data, and historical time periods based on the aforementioned historical energy consumption data, the method further includes: The above-mentioned historical electricity data, historical environmental data, historical operational data, historical market data, historical time periods, and historical energy consumption data are normalized to obtain normalized historical electricity data, normalized historical environmental data, normalized historical operational data, normalized historical market data, normalized historical time periods, and normalized historical energy consumption data. Specifically, the key to data normalization is to ensure that features of different dimensions contribute equally to model training through numerical transformation, avoiding bias in the model due to excessively large or small numerical ranges of certain features. In this invention, the Min-Max normalization method is used to obtain normalized historical electricity data, normalized historical environmental data, normalized historical operational data, normalized historical market data, normalized historical time periods, and normalized historical energy consumption data.

[0033] Specifically, Min-Max normalization maps the values ​​of historical data to the range of 0 to 1 through a linear mapping. It is particularly suitable for scenarios where data values ​​are not distributed in a uniform interval, effectively avoiding problems caused by differences in the units of measurement between features. After normalization, the data is mapped to the [0,1] interval. The formula for Min-Max normalization is: In the formula, This represents the normalized value of the k-th feature. Let represent the original value of the k-th dimension feature, and let represent . This represents the minimum value of the k-th dimensional feature. This represents the maximum value of the k-th dimension feature.

[0034] Calculate the statistical characteristic values ​​of the normalized historical electricity data, normalized historical environmental data, normalized historical operational data, normalized historical market data, normalized historical time periods, and normalized historical energy consumption data respectively. Specifically, the above statistical characteristic values ​​are the average and standard deviation of the historical data after normalization.

[0035] The normalized data is standardized based on the above statistical characteristic values.

[0036] Specifically, this invention employs Z-score standardization to standardize data. Z-score standardization, by subtracting the mean and dividing by the standard deviation, ensures that the data follows a standard normal distribution. This method is particularly effective when the data distribution is normal or close to normal. After standardization, the data will have zero mean and unit variance. The formula for Z-score standardization is: In the formula, This represents the standardized value of the k-th feature. This represents the average value of the k-th feature. This represents the standard deviation of the k-th dimension feature.

[0037] In this preferred embodiment, the historical data are normalized and standardized before feature filtering.

[0038] Step S103: Repeat the model optimization operation on the preset initial energy consumption prediction model based on the above training sample set to obtain the final preset energy consumption prediction model. The above model optimization operations include: Obtain the current population; where the population contains several individuals, each individual represents a set of model outer hyperparameter combinations, and the initial individuals are preset initial individuals; Specifically, this invention employs a genetic algorithm to perform repeated model optimization operations. In the genetic algorithm, the population consists of multiple individuals, each representing a set of model outer-layer hyperparameters, namely the learning rate and the number of hidden layers. The energy consumption prediction model in this invention is constructed based on a deep neural network. Initially, a reasonable initial search range is set for each model outer-layer hyperparameter based on experience or relevant literature (e.g., the learning rate is preset to [0.0001, 0.01]), and multiple preset initial individuals are randomly generated within this range to form the initial population. This approach introduces prior knowledge while ensuring population diversity, avoiding the algorithm getting trapped in local optima due to a single initial value.

[0039] For each individual in the current population, a current energy consumption prediction model is constructed based on the current model's outer hyperparameter combination. The current energy consumption prediction model is then iteratively trained using the aforementioned training sample set until the loss function converges, resulting in an updated energy consumption prediction model. The fitness of the current individual is calculated based on the aforementioned evaluation sample set. Specifically, the loss function described above not only includes the traditional mean squared error (MSE) but also incorporates Elastic Net regularization, encompassing both L1 and L2 (Ridge) regularization. Elastic Net regularization combines the advantages of Lasso and Ridge, enabling feature selection and preventing overfitting. L1 regularization promotes weight sparsity, aiding feature selection, while L2 regularization suppresses excessively large weights, preventing overfitting. Therefore, the loss function is calculated using the following formula: In the formula, Represents the loss function. This represents the inner weight parameters, and n' represents the number of training samples in the training sample set. This indicates the combination of hyperparameters in the outer layer of the model. Below, the historical energy consumption data corresponding to the i'th training sample, This indicates the combination of hyperparameters in the outer layer of the model. Below, the predicted energy consumption value corresponding to the i'th training sample. This represents the L1 regularization coefficient, used to control the strength of L1 regularization, promote weight sparsity, and assist in feature selection. This represents the L2 regularization coefficient, used to control the strength of L2 regularization, suppressing excessive weights and preventing model overfitting. These two parameters are usually automatically determined during hyperparameter optimization through cross-validation or genetic algorithms to balance model fitting ability and generalization performance. It checks whether the current number of model optimization operations is not less than the preset number of optimization operations. If so, the energy consumption prediction model corresponding to the current individual with the highest fitness is used as the preset energy consumption prediction model. Specifically, in the current model optimization operation, each individual corresponds to a fitness level and an energy consumption prediction model. The individual with the highest fitness level is found, and the energy consumption prediction model corresponding to that individual is used as the final trained preset energy consumption prediction model.

[0040] Otherwise, update the current population based on the genetic algorithm and the fitness of all current individuals.

[0041] Preferably, during model optimization, anomaly detection can be performed on samples based on the model's output. When an anomaly is detected, it is marked and recorded in the anomaly log, and then removed from the training set to avoid interfering with the model. By analyzing the model residuals, it is possible to detect which samples have abnormally large prediction errors, thereby identifying anomalous predictions from the model. These anomalies typically reflect prediction failures under certain special circumstances and should be further investigated. The model residuals are calculated using the following formula: In the formula, Let represent the model residual corresponding to the i'th training sample.

[0042] Specifically, if the model residuals exceed a set threshold, the sample is considered an outlier. In the formula, To represent a constant, usually chosen as 2 or 3. This represents the standard deviation of the residuals for all models.

[0043] Preferably, after obtaining the preset energy consumption prediction model, to further evaluate the prediction accuracy of the model, mean square error (MSE) and root mean square error (RMSE) are set as error evaluation indicators. MSE is obtained by squaring the error, and this indicator can effectively quantify the degree of deviation of the data. RMSE is the square root of MSE, and it has the same unit as the predicted value, playing a unique role in measuring prediction accuracy.

[0044] Specifically, the pre-built validation set is input into the preset energy consumption prediction model. Based on the prediction results output by the model and the actual energy consumption corresponding to the validation set, the mean square error and root mean square error are calculated. The mean square error is calculated using the following formula: In the formula, This represents the mean square error.

[0045] Specifically, the root mean square error is calculated using the following formula: In the formula, This represents the root mean square error.

[0046] Preferably, based on the evaluation results of MSE and RMSE metrics, when the validation set MSE and RMSE consistently exceed 10% of the historical baseline values ​​for a preset evaluation period (e.g., 3 consecutive days), the tuning process is triggered. This tuning strategy includes: first, adjusting the model's outer hyperparameters using methods such as grid search or random search to find the optimal combination of outer hyperparameters; and second, improving model performance by minimizing MSE and RMSE. In the formula, This represents the adjusted combination of outer hyperparameters of the model.

[0047] Secondly, the error of a single model can be reduced by integrating multiple models (such as linear regression, decision trees, neural networks, etc.) and combining their prediction results. Integration methods such as Bagging and Boosting can effectively improve prediction accuracy. In this invention, weighted averaging or voting methods can be used to fuse the prediction results of multiple models, thereby improving the final prediction accuracy. In the formula, This represents the ensembled prediction results, where m represents the number of base learners. This represents the prediction result output by the i''th base learner.

[0048] Finally, since the key objective of model evaluation and tuning is to enhance the model's predictive accuracy, the previously selected features can be further refined using regularization methods. In the formula, W represents the weight matrix used for transformation, and the best features are selected by optimizing W. X represents the feature matrix to be screened.

[0049] Preferably, K-fold cross-validation can be used for model performance evaluation. The specific steps are as follows: Divide the entire validation set into K subsets, where K refers to the number of folds in the dataset during cross-validation. The entire dataset is evenly divided into K parts. Each time, select one subset from these K subsets as the test set, and use the remaining subsets as the training set. Repeat this process K times, and finally calculate the average performance of the model by analyzing the results of these K iterations.

[0050] Specifically, in this evaluation system, the CV Score represents the score obtained from cross-validation. This score is mainly used to measure the model's performance on different subsets, and the score type includes mean squared error (MSE) or root mean square error (RMSE). The cross-validation score can be calculated using the following formula: In the formula, This represents the cross-validation score, where K represents the number of subsets. This represents the score obtained during the k'th cross-validation.

[0051] An illustrative diagram showing the training results of a pre-defined energy consumption prediction model is shown below. Figure 2 As shown, Figure 2 In this diagram, the x-axis represents "Samples," the y-axis represents "Energy Consumption," "Predicted Values" represents the energy consumption prediction results output by the energy consumption prediction model, and "True Values" represents the actual energy consumption corresponding to each energy consumption prediction result. Figure 2 It can be seen that the output of the preset energy consumption prediction model is very close to the actual energy consumption, and the lines almost overlap. This indicates that the output accuracy of the preset energy consumption prediction model trained by the model training method of the present invention is very high.

[0052] Preferably, this invention combines deep neural networks (DNNs) and genetic algorithms (GAs) to construct a multi-objective optimization framework, enabling the model to flexibly adapt to the complex relationship between electricity data and energy consumption in high-energy-consuming industries. This framework utilizes GA to optimize the hyperparameters of the DNN, significantly improving the model's prediction accuracy and global search capability, effectively avoiding the dilemma of local optima.

[0053] Preferably, by introducing incremental learning and dynamic data update mechanisms, the problem of declining prediction accuracy of traditional methods when facing dynamically changing production scale and market demand is solved.

[0054] In a preferred embodiment, the current energy consumption prediction model is iteratively trained based on the above-mentioned training sample set until the loss function converges, resulting in an updated energy consumption prediction model, including: The above training sample set is input into the current energy consumption prediction model for iterative training until the loss function converges, and the updated energy consumption prediction model is obtained. In each iteration of training, the current energy consumption prediction value is generated based on the current training sample; the current loss function is calculated based on the current energy consumption prediction value and the historical energy consumption data corresponding to the current training sample, and it is determined whether the current loss function has converged. If convergence is achieved, the energy consumption prediction model corresponding to the current loss function will be used as the updated energy consumption prediction model. Specifically, if the loss function converges, the combination of the current inner layer weight parameters and the outer layer hyperparameters of the model in this round of model optimization will correspond to an energy consumption prediction model, namely the "energy consumption prediction model corresponding to the current loss function" mentioned above. This model will be used as the energy consumption prediction model after iterative training in this round of model optimization, and this model will participate in the subsequent fitness calculation.

[0055] Otherwise, according to the gradient descent method, the inner weight parameters in the energy consumption prediction model corresponding to the current loss function are adjusted, and iterative training continues.

[0056] Specifically, this invention employs the Adam optimizer to update gradient descent parameters. The Adam optimizer is a type of adaptive learning rate optimization algorithm that adaptively adjusts the learning rate of each inner layer weight parameter by fusing first-order moment estimates (mean) and second-order moment estimates (variance). This allows for faster convergence in gradient updates and effectively avoids getting trapped in local optima in complex high-dimensional problems. The inner layer weight parameters optimized by the Adam optimizer are the weight matrix and bias vector of each layer in the model, minimizing the loss function through gradient descent. Its update rule is as follows: In the formula, This represents the inner layer weight parameters updated after the t-th iteration of training. This represents the inner layer weight parameters during the t-th iteration of training. Indicates the learning rate. This represents the exponentially weighted average of the squared gradients during the t-th training iteration. This represents the exponentially weighted average of the gradients during the t-th training iteration. This represents a constant used to prevent division by zero.

[0057] In this preferred embodiment, the energy consumption prediction model is iteratively trained using a training sample set to obtain an updated energy consumption prediction model.

[0058] In another preferred embodiment, generating the current energy consumption prediction value based on the current training samples includes: The current feature vector is constructed based on the current training samples; The current feature vector is input into the updated energy consumption prediction model; wherein the energy consumption prediction model includes: an input layer, a hidden layer and an output layer; The current feature vector is transmitted to the hidden layer through the input layer; Specifically, the energy consumption prediction model is built on a deep neural network, which employs a multi-layer fully connected structure, including an input layer, hidden layers, and an output layer. The input layer receives the feature vectors constructed using Lasso filtering and transmits them to the hidden layers.

[0059] Based on the hidden layer, feature extraction is performed on the current feature vector to obtain high-level features that represent the energy consumption correlation pattern, and the above high-level features are transmitted to the output layer; Specifically, the hidden layer also contains several levels, each of which further extracts features based on the features extracted in the previous level. For example, taking a three-layer hidden layer, the first layer extracts primary non-linear features using the following formula: In the formula, This represents the output of the first hidden layer. Indicates activation operation. Let x''' represent the weight matrix of the first hidden layer, and let x''' represent the feature vector. This indicates the bias of the first level of the hidden layer.

[0060] Specifically, the second level of the hidden layer further extracts abstract features based on the output of the first level: In the formula, This represents the output of the second hidden layer. This represents the weight matrix of the second hidden layer. This indicates the bias of the second level of the hidden layer.

[0061] Specifically, the third level of the hidden layer, based on the output of the second level, further extracts the high-level energy consumption correlation pattern: In the formula, This represents the output of the third hidden layer. This represents the weight matrix of the third hidden layer. This indicates the bias of the third level of the hidden layer.

[0062] Specifically, the output of the third level of the hidden layer is used as the final output of the entire hidden layer and transmitted to the output layer.

[0063] The current energy consumption prediction value is obtained by linearly activating the above high-level features based on the output layer.

[0064] Specifically, the linear activation process of the output layer can be represented by the following formula: In the formula, ŷ represents the predicted value. This represents the weight matrix of the output layer. This indicates the bias of the output layer.

[0065] In general, the forward propagation of a deep neural network can be divided into multiple layers, each of which is a linear transformation of the previous layer plus a non-linear activation function. The calculation process of each layer is shown in the following equation: Input layer: Hidden layer 1: In the formula, This represents the features corresponding to the input layer. Let σ(⋅) represent the output features of the l-th hidden layer. Let be the weight matrix of the l-th hidden layer. The bias of the l-th hidden layer, This represents the output feature of the (l-1)th hidden layer.

[0066] Specifically, in the output layer, the neural network transforms the characteristics of the hidden layers into predicted values ​​through a weighted summation in the final layer, thereby achieving the goal of predicting the target variable. Generally, the choice of the output layer activation function depends on the characteristics of the problem. For example, in regression problems, a linear activation function is often chosen. The output of the final layer is obtained by weighted summation plus a bias term. In the formula, L' represents the predicted energy consumption value corresponding to the i'-th training sample, and L' represents the total number of layers. This represents the weight matrix of the L'-th layer (i.e., the output layer). This represents the output feature vector of the (L'-1)th layer (i.e., the last hidden layer). This represents the bias vector of the output layer.

[0067] In this preferred embodiment, the updated energy consumption prediction model uses its built-in input layer, hidden layer, and output layer to extract features and perform linear activation on the training samples, thereby obtaining the current energy consumption prediction value.

[0068] In another preferred embodiment, the calculation of the current individual's fitness based on the aforementioned evaluation sample set includes: Obtain the complexity and regularization coefficient corresponding to the current individual; The evaluation samples in the above evaluation sample set are input into the updated energy consumption prediction model to obtain the predicted energy consumption corresponding to each of the above evaluation samples; The fitness of the current individual is calculated based on all predicted energy consumption, historical energy consumption data corresponding to each predicted energy consumption, complexity, and regularization coefficient.

[0069] Specifically, the fitness function used to calculate fitness is usually defined based on the model's performance. In this invention, mean squared error and complexity penalty terms are used as the evaluation criteria for fitness. Therefore, the fitness function is constructed as follows: In the formula, This indicates the combination of hyperparameters in the outer layer of the model. The fitness function under the following conditions This represents the regularization coefficient used to balance error and complexity. Represents the combination of outer hyperparameters of the model The corresponding complexity (e.g., the number of model parameters, computation time, etc.).

[0070] In this preferred embodiment, the fitness of the current individual is calculated using the complexity, regularization coefficient, predicted energy consumption, and historical energy consumption data corresponding to each predicted energy consumption.

[0071] In another preferred embodiment, updating the current population based on the genetic algorithm and the fitness of all current individuals includes: Based on the fitness of all current individuals, the probability of each current individual being selected is calculated. Based on the selection probability and the roulette wheel selection method, select several current parent individuals from all current individuals for cross-pairing; Specifically, when selecting the outer hyperparameter combination of the next generation model, the genetic algorithm simulates the selection, crossover, and mutation operations of biological evolution. First, a roulette wheel selection method is used to select parent individuals to participate in pairing. In this process, the probability of an individual being selected is directly proportional to its fitness; that is, the higher the fitness, the greater the probability of being selected into the mating pool. The formula for calculating the selection probability is as follows: In the formula, Represents an individual The probability of being selected. Represents an individual Fitness, where N represents the total number of individuals in the population. Represents an individual The degree of adaptability.

[0072] Perform crossover operations on the current parent individuals in each group to generate several current child individuals; Specifically, firstly, these parent individuals are randomly selected and paired from the mating pool to obtain several groups of current parent individuals. Then, a crossover operation is performed on each group of current parent individuals to generate several current offspring individuals. During this process, for successfully paired parent individuals, the values ​​of some of their model outer hyperparameters are exchanged with a certain probability to generate offspring individuals. Illustratively, for the k-th model outer hyperparameter of two parent individuals, simulated binary crossover (SBX) is used to generate two offspring: In the formula, and This indicates the two offspring individuals produced. Represents an individual The k''th outer hyperparameter of the model. Represents an individual The k''th outer hyperparameter of the model. This represents a random factor related to the distribution index.

[0073] Perform mutation operations on all current offspring individuals to generate an updated population.

[0074] Specifically, for each model outer hyperparameter of the offspring individuals, random perturbations are applied with a small mutation probability to introduce population diversity and explore new solution spaces. For model outer hyperparameters requiring mutation, multinomial mutation is employed: In the formula, This represents the k''-th outer hyperparameter of the model after mutation. This represents the k''-th outer hyperparameter of the model before mutation. This represents the value of a small random disturbance calculated based on the variation distribution index. This represents the upper bound of the range of values ​​for the k''-th outer hyperparameter of the model. This represents the lower bound of the range of values ​​for the k''th outer hyperparameter of the model.

[0075] Specifically, after mutation, the updated offspring individuals can be obtained based on the mutated outer hyperparameters of the model, and thus the updated population can be obtained.

[0076] In this preferred embodiment, the current population is updated based on the genetic algorithm and the fitness of all current individuals.

[0077] Based on the above method embodiments, the present invention provides corresponding apparatus embodiments.

[0078] like Figure 3 As shown, an embodiment of the present invention provides a training device for an energy consumption prediction model, comprising: Data acquisition module, sample set construction module, and model training module; The aforementioned data acquisition module is used to acquire historical electricity data, historical environmental data corresponding to the aforementioned historical electricity data, historical operating data, historical market data, historical energy consumption data, and historical time periods; The aforementioned sample set construction module is used to select features from the aforementioned historical electricity data, historical environmental data, historical operational data, historical market data, and historical time periods based on the aforementioned historical energy consumption data, in order to obtain a training sample set and an evaluation sample set. The aforementioned model training module is used to perform repeated model optimization operations on the preset initial energy consumption prediction model based on the aforementioned training sample set, so as to obtain the final preset energy consumption prediction model. The above model optimization operations include: Obtain the current population; where the population contains several individuals, each individual represents a set of model outer hyperparameter combinations, and the initial individuals are preset initial individuals; For each individual in the current population, a current energy consumption prediction model is constructed based on the current model's outer hyperparameter combination. The current energy consumption prediction model is then iteratively trained using the aforementioned training sample set until the loss function converges, resulting in an updated energy consumption prediction model. The fitness of the current individual is calculated based on the aforementioned evaluation sample set. Determine whether the current number of model optimization operations is not less than the preset number of optimizations. If so, use the energy consumption prediction model corresponding to the current individual with the highest fitness as the preset energy consumption prediction model. Otherwise, update the current population based on the genetic algorithm and the fitness of all current individuals.

[0079] It should be noted that the device embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can be implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without creative effort. The above schematic diagrams are merely examples of a training device for an energy consumption prediction model and do not constitute a limitation on a training device for an energy consumption prediction model. It may include more or fewer components than illustrated, or combine certain components, or use different components.

[0080] Based on the above method embodiments, the present invention provides corresponding terminal device embodiments.

[0081] Another embodiment of the present invention provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements a training method for an energy consumption prediction model as described in any embodiment of the present invention.

[0082] For example, in this embodiment, the computer program can be divided into one or more modules, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the device. The aforementioned terminal devices may be computing devices such as desktop computers, laptops, handheld computers, and cloud servers. These devices may include, but are not limited to, processors and memory. The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. This processor is the control center of the device, connecting various parts of the device via various interfaces and lines. The aforementioned memory can be used to store the aforementioned computer programs and / or modules. The aforementioned processor implements various functions of the aforementioned device by running or executing the computer programs and / or modules stored in the aforementioned memory, and by calling data stored in the memory. The aforementioned memory may mainly include a program storage area and a data storage area, wherein the program storage area may store the operating system, at least one application program required for a function, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0083] Based on the above method embodiments, the present invention provides corresponding storage medium embodiments.

[0084] Another embodiment of the present invention provides a storage medium including a stored computer program, wherein, when the computer program is running, it controls the device where the storage medium is located to execute the training method of an energy consumption prediction model described in any embodiment of the present invention.

[0085] In this embodiment, the storage medium is a computer-readable storage medium, and the computer program includes computer program code, which may be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium may include any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.

[0086] like Figure 4 As shown, based on the training method of the energy consumption prediction model of the present invention, the present invention provides a corresponding energy consumption prediction method; An embodiment of the present invention provides an energy consumption prediction method, comprising: Step S201: Obtain power consumption data, environmental data, operational data, market data, and forecast period corresponding to the power consumption data; Step S202: Construct an input feature vector based on the above-mentioned electricity data, environmental data, operational data, market data, and forecast period; Specifically, the features contained in the feature vector constructed here are the same features selected by the energy consumption prediction model during the training phase.

[0087] Step S203: Input the above-mentioned input feature vector into the preset energy consumption prediction model so that the preset energy consumption prediction model can predict the energy consumption based on the above-mentioned input feature vector; wherein, the preset energy consumption prediction model is obtained by training according to the training method of the above-mentioned energy consumption prediction model in any embodiment.

[0088] Specifically, the predicted energy consumption can support various advanced applications, thereby achieving energy saving, cost reduction, and efficiency improvement: First, in terms of anomaly warning and proactive intervention, the current predicted energy consumption can be compared with the real-time actual energy consumption. If the actual energy consumption far exceeds the predicted value, it is determined to be an equipment anomaly, and an immediate warning is issued, prompting the equipment to be inspected. If the predicted energy consumption for a future period is too high, an early warning can be issued, production plans can be adjusted, or energy storage discharge can be initiated to reduce peak loads and lower demand electricity costs. Second, in terms of production planning decision support, by inputting the input feature vectors of different production schemes, such as different outputs and production scheduling times, the model predicts the energy consumption under each scheme, assisting managers in selecting the optimal production scheme with the lowest energy consumption and carbon emissions.

[0089] Preferably, since the preset energy consumption prediction model trained by the present invention will be applied to high energy-consuming industries, and the energy consumption data in high energy-consuming industries is time-sensitive and dynamic, incremental learning is set to enable the model to be continuously updated over time, further addressing the issues of data flow and timeliness.

[0090] Specifically, incremental learning means that once the model receives new data, it can continuously adjust and optimize the already built model without retraining the entire model. This helps the model adapt to changes in a timely manner and improves the stability of long-term predictions.

[0091] Specifically, during incremental learning, when the preset energy consumption prediction model receives a new input feature vector, its inner layer weight parameters are updated according to the following formula: In the formula, This represents the updated inner weight parameters. This represents the inner layer weight parameters before the preset energy consumption prediction model is updated. This represents the amount of inner layer weight parameter update adjusted based on the new input feature vector. This represents the new input feature vector.

[0092] The above are preferred embodiments of the present invention. It should be noted that, for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A training method for an energy consumption prediction model, characterized in that, include: Acquire historical electricity consumption data, historical environmental data, historical operating data, historical market data, historical energy consumption data, and historical time periods corresponding to the historical electricity consumption data; Based on the historical energy consumption data, feature selection is performed on the historical electricity data, historical environmental data, historical operational data, historical market data, and historical time periods to obtain a training sample set and an evaluation sample set. The preset initial energy consumption prediction model is repeatedly optimized based on the training sample set to obtain the final preset energy consumption prediction model. The model optimization operation includes: Obtain the current population; wherein the population contains several individuals, each individual represents a set of model outer hyperparameter combinations, and the initial individuals are preset initial individuals; For each individual in the current population, a current energy consumption prediction model is constructed based on the current combination of outer hyperparameters of the model. The current energy consumption prediction model is then iteratively trained using the training sample set until the loss function converges, resulting in an updated energy consumption prediction model. The fitness of the current individual is calculated based on the evaluation sample set. Determine whether the current number of model optimization operations is not less than the preset number of optimizations. If so, use the energy consumption prediction model corresponding to the current individual with the highest fitness as the preset energy consumption prediction model. Otherwise, update the current population based on the genetic algorithm and the fitness of all current individuals.

2. The training method for an energy consumption prediction model according to claim 1, characterized in that, Before performing feature selection on the historical electricity consumption data, historical environmental data, historical operational data, historical market data, and historical time periods based on the historical energy consumption data, the process also includes: The historical electricity data, historical environmental data, historical operational data, historical market data, historical time periods, and historical energy consumption data are normalized to obtain normalized historical electricity data, normalized historical environmental data, normalized historical operational data, normalized historical market data, normalized historical time periods, and normalized historical energy consumption data. Calculate the statistical characteristic values ​​of the normalized historical electricity data, normalized historical environmental data, normalized historical operational data, normalized historical market data, normalized historical time periods, and normalized historical energy consumption data respectively. The normalized data is standardized based on the statistical characteristic values.

3. The training method for an energy consumption prediction model according to claim 2, characterized in that, The current energy consumption prediction model is iteratively trained based on the training sample set until the loss function converges, resulting in an updated energy consumption prediction model, including: The training sample set is input into the current energy consumption prediction model for iterative training until the loss function converges, and the updated energy consumption prediction model is obtained. In each iteration of training, the current energy consumption prediction value is generated based on the current training sample; the current loss function is calculated based on the current energy consumption prediction value and the historical energy consumption data corresponding to the current training sample, and it is determined whether the current loss function has converged. If convergence is achieved, the energy consumption prediction model corresponding to the current loss function will be used as the updated energy consumption prediction model. Otherwise, according to the gradient descent method, the inner weight parameters in the energy consumption prediction model corresponding to the current loss function are adjusted, and iterative training continues.

4. The training method for an energy consumption prediction model according to claim 3, characterized in that, The step of generating the current energy consumption prediction value based on the current training samples includes: The current feature vector is constructed based on the current training samples; The current feature vector is input into the updated energy consumption prediction model; wherein the energy consumption prediction model includes: an input layer, a hidden layer, and an output layer; The current feature vector is transmitted to the hidden layer through the input layer; Based on the hidden layer, feature extraction is performed on the current feature vector to obtain high-level features that represent the energy consumption correlation pattern, and the high-level features are transmitted to the output layer; The current energy consumption prediction value is obtained by linearly activating the high-level features based on the output layer.

5. The training method for an energy consumption prediction model according to claim 4, characterized in that, The calculation of the fitness of the current individual based on the evaluation sample set includes: Obtain the complexity and regularization coefficient corresponding to the current individual; The evaluation samples in the evaluation sample set are input into the updated energy consumption prediction model to obtain the predicted energy consumption corresponding to each evaluation sample; The fitness of the current individual is calculated based on all predicted energy consumption, historical energy consumption data corresponding to each predicted energy consumption, complexity, and regularization coefficient.

6. The training method for an energy consumption prediction model according to claim 5, characterized in that, The process of updating the current population based on the genetic algorithm and the fitness of all current individuals includes: Based on the fitness of all current individuals, the probability of each current individual being selected is calculated. Based on the selection probability and the roulette wheel selection method, select several current parent individuals from all current individuals for cross-pairing; Perform crossover operations on the current parent individuals in each group to generate several current child individuals; Perform mutation operations on all current offspring individuals to generate an updated population.

7. A training device for an energy consumption prediction model, characterized in that, include: Data acquisition module, sample set construction module, and model training module; The data acquisition module is used to acquire historical electricity data, historical environmental data, historical operating data, historical market data, historical energy consumption data, and historical time periods corresponding to the historical electricity data; The sample set construction module is used to select features from the historical electricity data, historical environmental data, historical operational data, historical market data, and historical time periods based on the historical energy consumption data to obtain a training sample set and an evaluation sample set. The model training module is used to perform repeated model optimization operations on the preset initial energy consumption prediction model based on the training sample set to obtain the final preset energy consumption prediction model. The model optimization operation includes: Obtain the current population; wherein the population contains several individuals, each individual represents a set of model outer hyperparameter combinations, and the initial individuals are preset initial individuals; For each individual in the current population, a current energy consumption prediction model is constructed based on the current combination of outer hyperparameters of the model. The current energy consumption prediction model is then iteratively trained using the training sample set until the loss function converges, resulting in an updated energy consumption prediction model. The fitness of the current individual is calculated based on the evaluation sample set. Determine whether the current number of model optimization operations is not less than the preset number of optimizations. If so, use the energy consumption prediction model corresponding to the current individual with the highest fitness as the preset energy consumption prediction model. Otherwise, update the current population based on the genetic algorithm and the fitness of all current individuals.

8. A terminal device, characterized in that, The system includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement a training method for an energy consumption prediction model as described in any one of claims 1 to 6.

9. A storage medium, characterized in that, The storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device where the storage medium is located to perform a training method for an energy consumption prediction model as described in any one of claims 1 to 6.

10. An energy consumption prediction method, characterized in that, include: Acquire power consumption data, the corresponding environmental data, operational data, market data, and forecast period; Based on the electricity consumption data, environmental data, operational data, market data, and the predicted time period, an input feature vector is constructed; The input feature vector is input into a preset energy consumption prediction model, so that the preset energy consumption prediction model predicts the energy consumption based on the input feature vector; wherein, the preset energy consumption prediction model, The energy consumption prediction model is obtained after training according to any one of claims 1-6.