A database training method and device for regional energy consumption prediction and path optimization, and an optimization method and system

By fusing STIRPAT and LSTM models for prediction and optimizing with NSGA-II, the imbalance between prediction accuracy and causal interpretability in regional energy consumption forecasting is resolved. This achieves a close integration and optimality between prediction and optimization, generating a Pareto optimal solution set with causal logic support, thus supporting regional energy planning.

CN122155009APending Publication Date: 2026-06-05INST OF ATMOSPHERIC PHYSICS CHINESE ACADEMY SCI +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
INST OF ATMOSPHERIC PHYSICS CHINESE ACADEMY SCI
Filing Date
2026-02-26
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing technologies for regional energy consumption forecasting suffer from several problems, including an imbalance between forecast accuracy and causal explanatory power, unstable configuration of fusion forecast weights, weak connection between forecasting and optimization, and insufficient quality control of optimization solution sets. These issues make it difficult to meet the requirements for accurate forecasting and multi-objective collaborative optimization under dual-carbon objectives.

Method used

The method employs a fusion of the STIRPAT model and the LSTM time series prediction model. The model is trained using a standardized multivariate time series dataset. The optimal fusion weights are determined by combining ridge regression and leave-one-out cross-validation. The Pareto optimal solution is generated using the NSGA-II algorithm, achieving efficient connection and optimality between prediction and optimization.

Benefits of technology

It achieves a close integration of prediction and optimization, generating a Pareto optimal solution set with causal logic support and temporal accuracy, and providing reliable support for regional energy planning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122155009A_ABST
    Figure CN122155009A_ABST
Patent Text Reader

Abstract

The application discloses a database training method and device for regional energy consumption prediction and path optimization, an optimization method and system. The STIRPAT model is trained through the standardized multivariate time series data set; the standardized multivariate time series data set is divided to obtain the batched LSTM training data, the batched early stop verification data and the hyperparameter verification set; the LSTM time series prediction model is trained through the batched LSTM training data, the batched early stop verification data and the hyperparameter verification set to obtain the trained LSTM time series prediction model; the optimal fusion weight is solved according to the trained STIRPAT model and the trained LSTM time series prediction model in combination with the hyperparameter verification set, and the STIRPAT-LSTM fusion prediction scheme is constructed. The Pareto optimal solution set finally generated by the application has both the causal logic support and the accurate time series prediction basis, and the optimality and the feasibility are taken into account, thereby providing reliable technical support for regional energy planning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, specifically to a database training method, apparatus, optimization method, and system for regional energy consumption forecasting and path optimization. Background Technology

[0002] Regional energy consumption forecasting and pathway optimization have become core technological supports for balancing economic growth, energy security, and environmental protection. Their accuracy and feasibility directly impact the scientific validity of regional development planning and the effectiveness of policy implementation. Currently, while some progress has been made in the research and application of energy consumption forecasting and pathway optimization technologies, many pressing technical bottlenecks remain to be addressed.

[0003] In the field of regional energy consumption forecasting, existing technologies primarily rely on single forecasting models. The STIRPAT model, as a static impact assessment model, can clearly reveal the causal relationship between driving variables and energy consumption, possessing strong economic interpretability. However, this model has weak ability to capture dynamic changes in time-series data and struggles to adapt to the complex fluctuations in energy consumption over time. The Long Short-Term Memory (LSTM) network model, with its gating mechanism advantage, exhibits good dynamic fitting ability in time-series data forecasting and can effectively uncover temporal dependencies in the data. However, this model is essentially a data-driven black box model, lacking a causal explanation of the driving mechanisms of energy consumption, and its prediction results are susceptible to data noise, resulting in insufficient robustness. Furthermore, some existing technologies attempt to improve forecast accuracy using multi-model fusion strategies, but the fusion weights are often based on subjective empirical settings or simple statistical methods, without rigorous validation set optimization, leading to unstable fusion forecast results and failing to fully leverage the complementary advantages of different models.

[0004] In terms of path optimization, existing technologies still have key technical defects: the connection between prediction results and optimization algorithms is not close enough, and accurate energy consumption predictions are not used as the core input basis for optimization algorithms, resulting in a lack of reliable support for the quantitative calculation of optimization objectives; the constraints are not comprehensive enough, and most schemes only focus on single policy constraints or economic constraints, without fully considering key constraints such as the continuous management requirements after energy consumption reaches its peak and the historical reasonable value range of decision variables, which easily leads to optimization solutions that are detached from reality.

[0005] In summary, existing technologies have significant shortcomings in balancing accuracy and interpretability in regional energy consumption forecasting, optimizing the allocation of forecast weights, deeply integrating forecasting and optimization, and controlling the quality of optimized solutions. These shortcomings make it difficult to meet the actual needs of regions under dual-carbon objectives for accurate energy consumption forecasting, multi-objective collaborative optimization, and the output of feasible policy solutions. Therefore, developing a regional energy consumption forecasting and path optimization technology that can balance forecasting accuracy and causal interpretability, achieve efficient integration of forecasting and optimization, and ensure the feasibility and optimality of optimization solutions has become an urgent technical problem to be solved. Summary of the Invention

[0006] The purpose of this invention is to provide a database training method for regional energy consumption forecasting and path optimization to at least solve one of the above-mentioned technical problems.

[0007] One aspect of the present invention provides a database training method for regional energy consumption forecasting and path optimization, the database training method for regional energy consumption forecasting and path optimization comprising:

[0008] Obtain the standardized multivariate time series dataset;

[0009] Obtain the STIRPAT model and the LSTM time series prediction model;

[0010] The STIRPAT model is trained using a standardized multivariate time series dataset to obtain the trained STIRPAT model.

[0011] The standardized multivariate time series dataset is divided to obtain batch-processed LSTM training data, batch-processed early stopping validation data, and hyperparameter validation set;

[0012] The LSTM time series prediction model is trained by using batch-processed LSTM training data, batch-processed early stopping verification data, and hyperparameter validation set, thereby obtaining the trained LSTM time series prediction model.

[0013] Based on the trained STIRPAT model and the trained LSTM time series prediction model, the optimal fusion weights are solved by combining the hyperparameter validation set, and the STIRPAT-LSTM fusion prediction scheme is constructed.

[0014] Optionally, obtaining the standardized multivariate time series dataset includes:

[0015] Obtain historical statistical data for the region;

[0016] Variables are extracted from historical statistical data of the region to obtain a multivariate time series dataset;

[0017] Preprocess the multivariate time series dataset to obtain the preprocessed multivariate time series dataset;

[0018] The preprocessed multivariate time series dataset is standardized to obtain a standardized multivariate time series dataset.

[0019] Optionally, the STIRPAT model uses the ridge regression algorithm for parameter estimation;

[0020] The objective function of the STIRPAT model is:

[0021] L(β) = ||y std -X std β std ||²+λ||βstd||²;

[0022] Among them, y std Let X be the standardized n×1 dimensional logarithmic vector of the target variable. std For the standardized n×m dimensional logarithmic matrix of driving variables, β std Let be an m×1 dimensional vector of standardized coefficients to be determined, λ be the regularization intensity hyperparameter, and ||·|| denote the L2 norm;

[0023] The verification method for multicollinearity control is set as follows: The logarithmic matrix X of the driving variables is used as the basis for verification. std Calculate the variance inflation factor (VIF) and set the validation criterion as VIF < 10;

[0024] The setup uses leave-one-out cross-validation.

[0025] The initial range of λ is set to a log-uniformly distributed array of candidate hyperparameters;

[0026] Set store_cv_values=True to store cross-validation results;

[0027] The optimization logic is defined as follows: take each sample in the training set as the validation set and the rest as the training set in turn, iterate through all samples, calculate the mean squared error (MSE) of all validation rounds for each candidate λ, and select the λ that minimizes the mean MSE as the optimal value.

[0028] Define a method for obtaining standardized coefficient estimates: based on the optimal λ, through analytical solutions. calculate .

[0029] Optionally, training the STIRPAT model using a standardized multivariate time series dataset to obtain a trained STIRPAT model includes:

[0030] The standardized multivariate time series dataset is divided into basic training set and basic test set according to time order;

[0031] The standardized target variables in the basic training set and basic test set are transformed into logarithmic form to obtain the STIRPAT model-specific training set and STIRPAT model-specific test set; the STIRPAT model-specific training set includes a standardized n×1 dimensional logarithmic vector of target variables and an n×m dimensional logarithmic matrix of driving variables.

[0032] Calculate the logarithmic matrix of the driving variables in the training set, calculate the variance inflation factor (VIF) of the driving variables, check the degree of multicollinearity among variables, and determine whether the VIF of all variables is less than 10. If so, then...

[0033] A candidate range for λ with a predefined log-uniform distribution is used, and a leave-one-out cross-validation strategy is adopted: each training sample is used as the validation set and the remaining samples are used as the training set, and all sample combinations are iterated in turn; for each candidate λ value, the mean square error (MSE) of all validation rounds is calculated, and the λ that minimizes the mean MSE is selected as the optimal hyperparameter.

[0034] The STIRPAT model is trained using the training set and the optimal hyperparameter λ to obtain the trained STIRPAT model.

[0035] The trained STIRPAT model is evaluated and validated using the training and test sets.

[0036] Optionally, the step of partitioning the standardized multivariate time series dataset to obtain batch-processed LSTM training data, batch-processed early stopping validation data, and hyperparameter validation set includes:

[0037] The standardized multivariate time series dataset is divided to obtain the basic training set;

[0038] The basic training set is split into three mutually exclusive subsets in chronological order to obtain the LSTM training subset, the early stopping validation set, and the hyperparameter validation set.

[0039] Feature extraction is performed on a subset of the LSTM training data to obtain the LSTM training input sequence.

[0040] Feature extraction is performed based on the early stopping validation set to obtain the early stopping validation input sequence;

[0041] The target variable is matched to the LSTM training input sequence to obtain the LSTM training dataset;

[0042] The target variable is matched to the early stopping verification input sequence to obtain the early stopping verification dataset;

[0043] The LSTM training dataset is divided into batches to obtain the batched LSTM training data.

[0044] The early stopping verification dataset is divided into batches to obtain batch-processed early stopping verification data.

[0045] Optionally, the step of training the LSTM time series prediction model using batched LSTM training data, batched early stopping verification data, and hyperparameter validation set to obtain the trained LSTM time series prediction model includes:

[0046] Initialize the LSTM model: Initialize the weight matrix and bias terms of the LSTM model, including the trainable parameters corresponding to the forget gate, input gate, cell state update, and output gate, as well as the trainable weight matrix and bias terms of the fully connected layers; Set the training configuration: Use the Adam optimizer, MSE as the loss function, early stopping threshold P, and preset maximum training epochs G; Initialize the epoch counter epoch=0, the historical best validation MSE, the consecutive epochs without improvement counter no_improve=0, and the total batch number batch_num=the total number of batches of training data after batch processing;

[0047] Based on the batched LSTM training data and the batched early stopping verification data, the following iterative training is performed:

[0048] Step 11: If epoch < G and no_improve < P, execute step 12 for batch training within a single round;

[0049] Step 12: Batch training within a single round:

[0050] Step 121: Initialize batch index batch_idx=0;

[0051] Step 122: If batch_idx < batch_num, read the training data of the batch_idx batch; otherwise, go to step 127.

[0052] Step 123: Forward Propagation Calculation:

[0053] Forgotten Gate: According to the formula Calculate and filter out information irrelevant to historical cell states (σ is the sigmoid activation function, This is the previous hidden state. (Input sequence elements for the current batch).

[0054] Input gate: Press the formula Generate update vector, according to Generate candidate cell states (tanh is the hyperbolic tangent activation function);

[0055] Cell state update: according to formula Calculation (⊙ represents element-wise multiplication);

[0056] Output gate: according to formula Generate output gate vector, according to Generate the current hidden state;

[0057] Fully connected layer mapping: Input the hidden state of the last LSTM layer into the fully connected layer, and output the prediction value of the current batch. ;

[0058] Step 124: Loss Calculation: Calculate the single-batch loss value according to the MSE formula. ;

[0059] Step 125: Backpropagation: Based on The gradient of the loss function with respect to all trainable weight matrices and bias terms is calculated in reverse.

[0060] Step 126: Parameter update: The Adam optimizer iteratively updates the trainable weight matrix and bias terms based on the gradient, batch_idx = batch_idx + 1, and returns to step 122.

[0061] Step 127: All batches have been processed, and this round of training is now complete;

[0062] Step 13: Early Stop Verification and Optimal Parameter Recording:

[0063] Step 131: Read all batches of the early stop validation data after batch processing, calculate the predicted value for each batch, and summarize to obtain the overall predicted value of the validation set. ;

[0064] Step 132: Based on the overall predicted values ​​of the validation set , Validate the overall true target value Obtain the overall mean square error of the validation set ;

[0065] Step 133: If Update the historical best-verified MSE to Save the current model parameters as the new historical best model parameters, and reset no_improve to 0;

[0066] like If the historical best validation MSE and historical best model parameters remain unchanged, then no_improve will be updated to no_improve+1.

[0067] This application also provides a database training device for regional energy consumption forecasting and path optimization, the database training device for regional energy consumption forecasting and path optimization comprising:

[0068] A multivariate time series dataset acquisition module, which is used to acquire a standardized multivariate time series dataset;

[0069] The model acquisition module is used to acquire the STIRPAT model and the LSTM time series prediction model.

[0070] The STIRPAT model training module is used to train the STIRPAT model using a standardized multivariate time series dataset, thereby obtaining a trained STIRPAT model.

[0071] The dataset partitioning module is used to partition the standardized multivariate time series dataset to obtain batch-processed LSTM training data, batch-processed early stopping validation data, and hyperparameter validation set.

[0072] The LSTM model training module is used to train the LSTM time series prediction model using batched LSTM training data, batched early stopping verification data, and hyperparameter validation set, thereby obtaining the trained LSTM time series prediction model.

[0073] The STIRPAT-LSTM fusion prediction scheme construction module is used to construct the STIRPAT-LSTM fusion prediction scheme by solving for the optimal fusion weights based on the trained STIRPAT model, the trained LSTM time series prediction model, and the hyperparameter validation set.

[0074] This application also provides a method for regional energy consumption forecasting and path optimization, the method comprising:

[0075] Obtain the standardized dataset to be predicted;

[0076] The standardized dataset to be predicted is input into the STIRPAT model trained using the database training method described above for regional energy consumption prediction and path optimization, thereby obtaining the standardized prediction values ​​for each year of the first prediction period.

[0077] The standardized dataset to be predicted is input into the LSTM time series prediction model trained by the database training method for regional energy consumption prediction and path optimization as described above, so as to obtain the standardized prediction values ​​for each year of the second prediction period.

[0078] Based on the NSGA-II algorithm, the decision vector of each individual in the population is input into the STIRPAT-LSTM fusion prediction scheme obtained by the database training method described above for regional energy consumption prediction and path optimization. The fusion prediction value is obtained, and the individual fitness is evaluated by combining the objective function and constraints, and finally the Pareto optimal solution is generated.

[0079] This application also provides a system for regional energy consumption forecasting and path optimization, the system comprising:

[0080] A module for obtaining the dataset to be predicted, which is used to obtain the standardized dataset to be predicted;

[0081] The module for obtaining standardized predicted values ​​for each year of the first prediction period is used to input the standardized dataset to be predicted into the STIRPAT model trained by the database training method for regional energy consumption prediction and path optimization as described above, so as to obtain the standardized predicted values ​​for each year of the first prediction period.

[0082] The module for obtaining standardized predicted values ​​for each year of the second forecast period is used to input the standardized dataset to be predicted into the LSTM time series prediction model trained by the database training method for regional energy consumption prediction and path optimization as described above, so as to obtain the standardized predicted values ​​for each year of the second forecast period.

[0083] The final feasible optimal solution acquisition module is used to obtain the fusion prediction value by inputting the decision vector of each individual in the population into the STIRPAT-LSTM fusion prediction scheme obtained by the database training method for regional energy consumption prediction and path optimization as described above, based on the NSGA-II algorithm. The module combines the objective function and constraints to evaluate the individual fitness and finally generate the Pareto optimal solution.

[0084] This application presents a database training method for regional energy consumption forecasting and path optimization that integrates the STIRPAT model, LSTM model, and NSGA-II algorithm. Through a progressive logic of data supporting the model, the model ensuring prediction, and prediction quantifying the optimization objective, the standardized dataset provides a training foundation for both models at the same scale. The two models respectively leverage their advantages in causal interpretation and temporal series capture. The fused prediction value provides an accurate basis for calculating the objective function of NSGA-II optimization, completely breaking down the technical barrier between prediction and optimization. The final Pareto optimal solution set has both causal logic support and accurate temporal series prediction basis, balancing optimality and feasibility, and providing reliable technical support for regional energy planning. Attached Figure Description

[0085] Figure 1 This is a schematic flowchart of a database training method for regional energy consumption forecasting and path optimization according to an embodiment of this application. Detailed Implementation

[0086] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions in the embodiments of this application will be described in more detail below with reference to the accompanying drawings. In the drawings, the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The described embodiments are some, but not all, embodiments of this application. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application. The embodiments of this application will be described in detail below with reference to the accompanying drawings.

[0087] like Figure 1 The database training methods shown for regional energy consumption forecasting and pathway optimization include:

[0088] Obtain the standardized multivariate time series dataset;

[0089] Obtain the STIRPAT model and the LSTM time series prediction model;

[0090] The STIRPAT model is trained using a standardized multivariate time series dataset to obtain the trained STIRPAT model.

[0091] The standardized multivariate time series dataset is divided to obtain batch-processed LSTM training data, batch-processed early stopping validation data, and hyperparameter validation set;

[0092] The LSTM time series prediction model is trained by using batch-processed LSTM training data, batch-processed early stopping verification data, and hyperparameter validation set, thereby obtaining the trained LSTM time series prediction model.

[0093] Based on the trained STIRPAT model and the trained LSTM time series prediction model, the optimal fusion weights are solved by combining the hyperparameter validation set, and the STIRPAT-LSTM fusion prediction scheme is constructed.

[0094] In this embodiment, obtaining the standardized multivariate time series dataset includes:

[0095] Obtain historical statistical data for the region; specifically, collect historical statistical data for the region. This includes the physical consumption of fossil fuels such as coal, oil, and natural gas, as well as driving variables such as industry, the service sector, and transportation. Based on the authoritative national conversion factor, the physical consumption of various fossil fuels is uniformly converted to standard coal equivalent, and the total energy consumption is summed as the target variable.

[0096] Variables are extracted from historical statistical data of the region to obtain a multivariate time series dataset. The target variable and driving variable are arranged in chronological order to construct a multivariate time series dataset, with each row representing a year and each column corresponding to the target variable and driving variable, respectively.

[0097] The multivariate time series dataset is preprocessed to obtain a preprocessed multivariate time series dataset; specifically, missing values ​​and outliers are checked in the dataset. If missing values ​​exist, they are marked as NaN; for any variable in the dataset (including the target variable and each driving variable), based on the mean μ and standard deviation σ of its statistical data, data points falling outside the range [μ-3σ, μ+3σ] are considered outliers and marked as NaN.

[0098] This process handles missing and outlier values ​​in the dataset. For NaN locations, a high-precision autoregressive integral moving average (ARIMA) model is used, based on the Python programming language. The first step involves using the `pmdarima.auto_arima` module (a third-party open-source library for Python; other modules described below also originate from Python libraries and will not be elaborated further) to determine the optimal combination of differencing order `d`, autoregressive order `p`, and moving average order `q`. `d` is determined using the augmented Dickey-Fuller (ADF) unit root test; `p` and `q` are determined using the partial autocorrelation function (PACF), autocorrelation function (ACF), and Akaike information criterion (AIC). The second step involves initializing the model using the `statsmodels.tsa.arima.model.ARIMA` module, calling the `fit()` method to complete model training, and obtaining the autoregressive term coefficients `Φ` and the moving average term coefficients `θ`. The third step involves randomly hiding a certain proportion of the true values ​​and using the trained ARIMA model for prediction. (Predicted values ​​are shown in the image.) The calculation formula is: , Let ε be the original value of the variable in year t-1, and ε be the residual sequence.

[0099] The root mean square error (RMSE) and mean absolute percentage error (MAPE) between predicted and actual values ​​are calculated using the sklearn.metrics module. If the error is below a set threshold, the model is considered relatively reliable. In the fourth step, the ARIMA model, validated in the third step, is used to complete the numerical values ​​at positions marked as NaN. Time series plots are then drawn before and after completion to visually verify the trend continuity.

[0100] The preprocessed multivariate time series dataset is standardized to obtain a standardized multivariate time series dataset.

[0101] Specifically, this involves eliminating differences in the dimensions and orders of magnitude of different variables. The Z-score method is used to standardize the completed variables. For any variable, the standardized value Z is calculated as: Z = (V - μ) / σ, where V is the original value of the variable.

[0102] In this embodiment, the STIRPAT model is characterized by using the ridge regression algorithm for parameter estimation to overcome the multicollinearity problem that may exist among the driving variables;

[0103] The objective function of the STIRPAT model is:

[0104] ;

[0105] Among them, y std X is a standardized n×1 dimensional logarithmic vector of the target variable (where n is the number of years). std The standardized n×m dimensional logarithmic matrix of driving variables (where m is the number of driving variables).

[0106] β std Let be an m×1 dimensional vector of standardized coefficients to be determined, λ be the regularization intensity hyperparameter (λ≥0), and ||·|| denote the L2 norm;

[0107] use:

[0108] The statsmodels.stats.outliers_influence.variance_inflation_factor module calculates the variance inflation factor (VIF) for Xstd, ensuring that VIF < 10 to verify that multicollinearity is effectively controlled.

[0109] The `sklearn.linear_model.RidgeCV` module is used, and `cv=None` is set to specify leave-one-out cross-validation to determine the optimal λ. λ is pre-defined as a log-uniformly distributed array of candidate hyperparameters, and `store_cv_values=True` is set to store the cross-validation results. Each sample in the training set is used as the validation set, and the remaining samples are used as the training set, iterating through all samples. For each candidate λ value, the mean squared error (MSE) of all validation rounds is calculated, and the λ value that minimizes the mean MSE is selected as the optimal value. In the third step, the model is initialized using the `sklearn.linear_model.Ridge` module, and the `fit()` method is called to complete model training. The optimal λ is then determined analytically. The standardized coefficient estimates of the model are obtained.

[0110] In this embodiment, training the STIRPAT model using a standardized multivariate time series dataset to obtain a trained STIRPAT model includes:

[0111] The standardized multivariate time series dataset is split chronologically to obtain a basic training set and a basic test set. Specifically, the sklearn.model_selection.train_test_split module is used to divide the standardized target variable and driving variable into training and test sets in chronological order (usually in an 8:2 ratio). By setting the shuffle=False parameter, it is ensured that the test set time points are strictly after the training set time points to avoid future information leakage and maintain the prediction logic of the time series.

[0112] The standardized target variables in the basic training set and basic test set are transformed into logarithmic form to obtain the STIRPAT model-specific training set and STIRPAT model-specific test set; the STIRPAT model-specific training set includes a standardized n×1 dimensional logarithmic vector of target variables and an n×m dimensional logarithmic matrix of driving variables.

[0113] Calculate the logarithmic matrix of the driving variables in the training set, calculate the variance inflation factor (VIF) of the driving variables, check the degree of multicollinearity among variables, and determine whether the VIF of all variables is less than 10. If so, then...

[0114] A candidate range for λ with a predefined log-uniform distribution is used, and a leave-one-out cross-validation strategy is adopted: each training sample is used as the validation set and the remaining samples are used as the training set, and all sample combinations are iterated in turn; for each candidate λ value, the mean square error (MSE) of all validation rounds is calculated, and the λ that minimizes the mean MSE is selected as the optimal hyperparameter.

[0115] The STIRPAT model is trained using the training set and the optimal hyperparameter λ to obtain the trained STIRPAT model.

[0116] The trained STIRPAT model is evaluated and validated using the training and test sets.

[0117] Validating and evaluating the model. First, using the sklearn.metrics module, based on the test set data, we calculate the RMSE and MAPE between the model's predicted values ​​and the actual values ​​to quantify the overall fitting accuracy of the model. Second, we test the model's extrapolation robustness using the rolling time window method. We use the pandas library's slicing operation to define the training set as containing the t-th... pred -K years to the t pred The dataset of all samples from year -1, i.e. , Let y be the standardized logarithmic vector of the driving variables in year i. std,i Let X be the standardized logarithmic value of the target variable in year i, (X) std,i y std,i Let be the data pair for year i. The STIRPAT model is trained using this training set, and then the data for year t is... pred Year X std ,t pred Input the trained model to obtain the t-th... pred Year The third step is to use the sklearn.metrics module to iteratively calculate the tpred year. and The RMSE and MAPE values ​​are used to evaluate the predictive stability of the model at different time periods.

[0118] In this embodiment, the step of partitioning the standardized multivariate time series dataset to obtain batch-processed LSTM training data, batch-processed early stopping validation data, and hyperparameter validation set includes:

[0119] The standardized multivariate time series dataset is divided to obtain the basic training set;

[0120] The basic training set is split into three mutually exclusive subsets in chronological order to obtain the LSTM training subset, the early stopping validation set, and the hyperparameter validation set.

[0121] Feature extraction is performed on a subset of the LSTM training data to obtain the LSTM training input sequence.

[0122] Feature extraction is performed based on the early stopping validation set to obtain the early stopping validation input sequence;

[0123] The target variable is matched to the LSTM training input sequence to obtain the LSTM training dataset;

[0124] The target variable is matched to the early stopping verification input sequence to obtain the early stopping verification dataset;

[0125] The LSTM training dataset is divided into batches to obtain the batched LSTM training data.

[0126] The early stopping verification dataset is divided into batches to obtain batch-processed early stopping verification data.

[0127] Specifically, the training and testing sets are divided. Based on the basic training and testing sets, the basic training set is further divided chronologically into three mutually exclusive subsets: the LSTM training subset is used to train the LSTM model and update its weight parameters W∗ and b∗; the early stopping validation set is used to monitor the LSTM training process and prevent overfitting; and the hyperparameter validation set is specifically used for subsequent optimization of the fusion weight α of the STIRPAT and LSTM models. Based on the LSTM training subset and early stopping validation set already divided, the pandas library's slicing operation is used to construct the training and validation input sequences for the LSTM model, setting the time window length to L. For the target year ttarg, the data from its first L years are used to construct a feature tensor. The standardized driving variable vector and target variable value data pairs for year j. The feature tensor sequence and the t-th year are then processed using the torch.utils.data.TensorDataset module. targ Standardized target variable value for the year It is encapsulated as a PyTorch dataset object. It uses torch.utils.data.DataLoader for batch loading and maintains the time series prediction logic by setting the shuffle=False parameter.

[0128] In this embodiment, the step of training the LSTM time series prediction model using batched LSTM training data, batched early stopping verification data, and hyperparameter validation set to obtain the trained LSTM time series prediction model includes:

[0129] Initialize the LSTM model: Initialize the weight matrix and bias terms of the LSTM model, including the trainable parameters corresponding to the forget gate, input gate, cell state update, and output gate, as well as the trainable weight matrix and bias terms of the fully connected layers; Set the training configuration: Use the Adam optimizer, MSE as the loss function, early stopping threshold P, and preset maximum training epochs G; Initialize the epoch counter epoch=0, the historical best validation MSE, the consecutive epochs without improvement counter no_improve=0, and the total batch number batch_num=the total number of batches of training data after batch processing;

[0130] Based on the batched LSTM training data and the batched early stopping verification data, the following iterative training is performed:

[0131] Step 11: If epoch < G and no_improve < P, execute step 12 for batch training within a single round;

[0132] Step 12: Batch training within a single round:

[0133] Step 121: Initialize batch index batch_idx=0;

[0134] Step 122: If batch_idx < batch_num, read the training data of the batch_idx batch; otherwise, go to step 127.

[0135] Step 123: Forward Propagation Calculation:

[0136] Forgotten Gate: According to the formula Calculate and filter out information irrelevant to historical cell states (σ is the sigmoid activation function, This is the previous hidden state. (Input sequence elements for the current batch).

[0137] Input gate: Press the formula Generate update vector, according to Generate candidate cell states (tanh is the hyperbolic tangent activation function);

[0138] Cell state update: according to formula Calculation (⊙ represents element-wise multiplication);

[0139] Output gate: according to formula Generate output gate vector, according to Generate the current hidden state;

[0140] Fully connected layer mapping: Input the hidden state of the last LSTM layer into the fully connected layer, and output the prediction value of the current batch. ;

[0141] Step 124: Loss Calculation: Calculate the single-batch loss value according to the MSE formula. ;

[0142] Step 125: Backpropagation: Based on The gradient of the loss function with respect to all trainable weight matrices and bias terms is calculated in reverse.

[0143] Step 126: Parameter update: The Adam optimizer iteratively updates the trainable weight matrix and bias terms based on the gradient, batch_idx = batch_idx + 1, and returns to step 122.

[0144] Step 127: All batches have been processed, and this round of training is now complete;

[0145] Step 13: Early Stop Verification and Optimal Parameter Recording:

[0146] Step 131: Read all batches of the early stop validation data after batch processing, calculate the predicted value for each batch, and summarize to obtain the overall predicted value of the validation set. ;

[0147] Step 132: Based on the overall predicted values ​​of the validation set , Validate the overall true target value Obtain the overall mean square error of the validation set ;

[0148] Step 133: If Update the historical best-verified MSE to Save the current model parameters as the new historical best model parameters, and reset no_improve to 0;

[0149] like If the historical best validation MSE and historical best model parameters remain unchanged, then no_improve will be updated to no_improve+1.

[0150] In this embodiment, a network layer with a custom number of layers is initialized using the torch.nn.LSTM module, and a fully connected layer is initialized using the torch.nn.Linear module. The training set data is input into the model and processed through the gating mechanism of each network layer, including (1) the forget gate, which determines the state from the previous cell C. j−1 (1) Discard information; (2) Input gate, which determines which new information to store in the cell state; (3) Cell state update, which combines the output of the forget gate and the input gate; (4) Output gate, which determines the output hidden state based on the updated cell state. j This is the forgetting gate vector, with values ​​between 0 and 1; i j The input gate vector has values ​​between 0 and 1; C ’ j C represents the candidate cell state vector, with values ​​between -1 and 1. j Update the cell state vector; o j h is the output gate vector, with values ​​between 0 and 1. j σ is the hidden state vector; σ is the Sigmoid activation function, which compresses any value to between 0 and 1; tanh is the hyperbolic tangent activation function, which compresses any value to between -1 and 1; ⊙ is the Hadamard product, which represents element-wise multiplication. and Here are the trainable weight matrices and bias terms for each category. The hidden state of the last network layer is input into the fully connected layer for dimension mapping, ultimately yielding the predicted value y for the target year. ’ norm,ttarg The optimizer is initialized using the torch.optim.Adam module, with y ’ norm,ttarg and y norm,ttarg The MSE between these values ​​is the loss function, and the loss function is calculated using the backpropagation algorithm with respect to... and The gradient is used by the optimizer to iteratively update the value. and To minimize the loss function, thereby obtaining and The optimal estimate is obtained. Early stopping is introduced during training to improve model efficiency and generalization ability. At the end of each training round, the MSE of the model on the early stopping validation set is calculated. If it is not lower than the historical best record in P consecutive training rounds, the model is determined to be overfitted, training is terminated early, and the model parameters are restored to the minimum MSE of the early stopping validation set as the final model.

[0151] Validate and evaluate the model. Using the sklearn.metrics module, based on the test set data, calculate the RMSE and MAPE between the model's predicted values ​​and the actual values ​​to quantify the overall fitting accuracy of the model.

[0152] In this embodiment, the optimal fusion weights are solved by combining the trained STIRPAT model and the trained LSTM time series prediction model with the hyperparameter validation set, and the STIRPAT-LSTM fusion prediction scheme is constructed.

[0153] In this embodiment, to combine the causal interpretability of the STIRPAT model with the temporal dynamics capture capability of the LSTM model, a linear weighting strategy is adopted for fusion prediction. The final fusion prediction value y' is calculated using the following formula: y ’ =αy ’ s +(1-α)y ’ l y ’ s and y ’ l , respectively, are the standardized predictions of the STIRPAT model and the LSTM model for the same target year. α is the fusion weight coefficient, used to measure the contribution of the STIRPAT model's prediction, and its value ranges from [0,1]. Based on the trained STIRPAT and LSTM models, on a reserved hyperparameter validation set, the scipy.optimize.minimize module is used to solve for the optimal value of α by minimizing the MSE between the fused predictions and the true values ​​on the validation set.

[0154] This application also provides a database construction apparatus for regional energy consumption forecasting and path optimization, the database construction apparatus for regional energy consumption forecasting and path optimization comprising:

[0155] A multivariate time series dataset acquisition module, which is used to acquire a standardized multivariate time series dataset;

[0156] The model acquisition module is used to acquire the STIRPAT model and the LSTM time series prediction model.

[0157] The STIRPAT model training module is used to train the STIRPAT model using a standardized multivariate time series dataset, thereby obtaining a trained STIRPAT model.

[0158] The dataset partitioning module is used to partition the standardized multivariate time series dataset to obtain batch-processed LSTM training data, batch-processed early stopping validation data, and hyperparameter validation set.

[0159] The LSTM model training module is used to train the LSTM time series prediction model using batched LSTM training data, batched early stopping verification data, and hyperparameter validation set, thereby obtaining the trained LSTM time series prediction model.

[0160] The STIRPAT-LSTM fusion prediction scheme construction module is used to construct the STIRPAT-LSTM fusion prediction scheme by solving for the optimal fusion weights based on the trained STIRPAT model, the trained LSTM time series prediction model, and the hyperparameter validation set.

[0161] This application also provides a method for regional energy consumption forecasting and path optimization, the method comprising:

[0162] Obtain the standardized dataset to be predicted;

[0163] The standardized dataset to be predicted is input into the STIRPAT model trained using a database training method for regional energy consumption forecasting and path optimization, thereby obtaining the standardized forecast values ​​for each year of the first forecast period.

[0164] The standardized dataset to be predicted is input into the LSTM time series prediction model trained by the database training method used for regional energy consumption prediction and path optimization, so as to obtain the standardized prediction values ​​of each year in the second prediction period.

[0165] Based on the NSGA-II algorithm, the decision vector of each individual in the population is input into the STIRPAT-LSTM fusion prediction scheme obtained by the database training method of any one of claims 1 to 6 for regional energy consumption prediction and path optimization, to obtain the fusion prediction value, and the individual fitness is evaluated by combining the objective function and constraints, and finally the Pareto optimal solution is generated.

[0166] Based on the NSGA-II algorithm, the decision vector of each individual in the population is input into the STIRPAT-LSTM fusion prediction scheme to obtain the fusion prediction value. The fitness of the individual is evaluated by combining the objective function and constraints, and finally the Pareto optimal solution set is generated.

[0167] Define a multi-objective optimization problem. First, define the decision variables. Based on the standardized coefficients of the driving variables obtained from the STIRPAT model, select the k variables with the highest absolute values ​​and significant policy implications as decision variables. Second, establish two conflicting objective functions, including (1) environmental objective: minimizing the cumulative total fossil energy consumption during the planning period (e.g., 2026-2035), i.e., f1 = (2) Economic objective: Maximize the growth rate of total GDP at the end of the planning period (e.g., 2035) relative to the base year (e.g., 2024), i.e., f2 = -GDP2035 / GDP2024, with the negative sign used to unify it as a minimization problem. The third step is to set system constraints, including (1) Policy constraints: Total fossil energy consumption reaches its peak before tpeak in a certain year, i.e., y tpeak+1≤y tpeak; (2) Development constraints: The average annual GDP growth rate during the planning period shall not be lower than a certain proportion gmin to ensure stable economic development; (3) Structural constraints: The value of each decision variable in any year during the planning period shall not exceed the historical reasonable range set by it. The range is set according to historical statistical data to avoid the model giving a solution that is out of touch with reality; (4) Non-negativity constraints: All variables shall take non-negative values.

[0168] Initialize the NSGA-II optimization algorithm. The first step is to generate an initial population using the Latin hypercube sampling method from the pymoo.factory.get_sampling module, ensuring that the decision variables are uniformly distributed within the feasible region. The population size N is set to 100, achieving a balance between solution set diversity and computational efficiency. Each individual is encoded as a decision vector X = [X1, X2, ..., X...]. k And it satisfies the structural constraints. The second step is to use the simulated binary crossover method of the pymoo.factory.get_crossover module to set the crossover operation parameters, following the NSGA-II standard to set the distribution exponent η. c =15, which can effectively control the similarity between offspring and parents; the crossover probability p is set using a classic genetic algorithm. c =0.9, ensuring sufficient exploration of the solution space; the mutation operation parameters are set using the polynomial mutation method of the pymoo.factory.get_mutation module, and the distribution exponent η is set according to the NSGA-II standard. m =20; As is customary, the mutation probability p is set by taking the complement of the crossover probability. m=0.1. The third step is to run the algorithm with the same parameter settings, recording the hypervolume (HV) index every 10 generations. The algorithm is considered converged when the relative improvement rate of the HV index is less than 1% for 30 consecutive generations. Multiple repeated experiments showed that the algorithm reached the convergence criterion after 150-180 generations; therefore, the maximum number of generations G was set to 200 to ensure sufficient optimization. The fourth step is to use the pymoo.factory.get_algorithm module to complete the full initialization of the NSGA-II algorithm, establishing the computational foundation for subsequent multi-objective optimization solutions.

[0169] Assess population fitness. Input the decision vector X of each individual in the population into the trained STIRPAT-LSTM fusion prediction model to calculate the predicted total fossil energy consumption y for each year within the planning period (e.g., 2026-2035). ’ Verify whether the environmental and economic objectives meet the set requirements, and simultaneously verify whether the constraints meet the set requirements. For individuals that violate the constraints, use the penalty function method to add a penalty term P(x) to their objective function value. , Let represent the degree of violation of the i-th constraint, and n be the number of constraints. For policy constraints, we can define... = This means penalizing any consumption growth after the peak year; for development constraints, they can be defined as... = g GDP This refers to the average annual GDP growth rate during the planning period, i.e., penalizing GDP growth rates below the lower limit; for structural constraints, it can be defined as... = , The value of the i-th decision variable in year t within the planning period must fall within the historically reasonable range [X]. i,min X i,max The total structural penalty is the sum of the penalties for each constraint, i.e. = Here, m represents the number of constraint variables. Finally, the objective function values ​​of all individuals are organized into a matrix and returned, which the algorithm uses for non-dominated sorting and selection.

[0170] The evolutionary process is iterative. First, in each generation, a parent population Pt (of size N) is selected based on a binary tournament selection mechanism. Then, a child population Qt (of size N) is generated through simulated binary crossover and polynomial mutation. Pt and Qt are merged to form a temporary mixed population Rt = Pt∪Qt of size 2N. Second, using the pymoo.util.nds.non_dominated_sorting module, all individuals in Rt are divided into multiple non-dominated layers (F1, F2, ..., Fk) according to Pareto dominance, where F1 is the globally optimal non-dominated solution set. For individuals within the same non-dominated layer, the pymoo.util.nds.crowding_distance module is used to calculate their crowding distance, which measures the distribution density of individuals in the target space. Sparsely distributed individuals are preferentially retained to maintain population diversity.

[0171] The pymoo.operators.survival.RankAndCrowdingSurvival module is used to select a new generation population Pt+1 from Rt. Prioritize selecting the entire lowest non-dominated layer (e.g., F1). If the number of individuals in this layer exceeds N, sort them by crowding distance from largest to smallest and select the top N individuals. If there are insufficient individuals, continue selecting the next non-dominated layer (e.g., F2), and so on, until N individuals are selected.

[0172] Extract and evaluate the Pareto optimal solution set.

[0173] The first non-dominated frontier is extracted from the final population using the pymoo.util.nds.non_dominated_sorting module as the Pareto optimal solution set. It contains k non-dominated solutions, satisfying The Pareto optimality condition. Let be the i-th Pareto optimal solution, representing a specific set of decision variable values. To quantitatively evaluate the quality of the solution set, the pymoo.performance_indicator module is used to calculate the hypervolume index (larger values ​​are better), the spacing index (smaller values ​​are better), and the generational distance index (smaller values ​​are better), ultimately outputting a Pareto optimal solution set that meets the index requirements. This solution set can provide policymakers with a series of optimal policy options that balance environmental and economic objectives and have undergone rigorous convergence and distributional validation.

[0174] This application also provides a system for regional energy consumption forecasting and path optimization, the system comprising:

[0175] A module for obtaining the dataset to be predicted, which is used to obtain the standardized dataset to be predicted;

[0176] The module for obtaining standardized predicted values ​​for each year of the first prediction period is used to input the standardized dataset to be predicted into the trained STIRPAT model to obtain the standardized predicted values ​​for each year of the first prediction period.

[0177] The module for obtaining standardized predicted values ​​for each year of the second prediction period is used to input the standardized dataset to be predicted into the trained LSTM time series prediction model to obtain the standardized predicted values ​​for each year of the second prediction period.

[0178] The final feasible optimal solution acquisition module is used to input the decision vector of each individual in the population into the STIRPAT-LSTM fusion prediction scheme based on the NSGA-II algorithm, obtain the fusion prediction value, evaluate the individual fitness by combining the objective function and constraints, and finally generate the Pareto optimal solution.

[0179] The following examples further illustrate this application in detail. It is understood that these examples do not constitute any limitation on this application.

[0180] I. Training Steps

[0181] (a) Data preprocessing

[0182] 1. Data collection and index calculation

[0183] Historical data for a certain region from 2010 to 2024 was collected over 15 years. The target variable was total energy consumption (converted to standard coal equivalent), and the driving variables were industrial added value, the proportion of the tertiary industry, and transportation turnover.

[0184] Historical data for a certain region from 2010 to 2024 (15 years) was collected. The target variable was total energy consumption (converted to standard coal equivalent), and the driving variables included industrial added value, the proportion of the tertiary sector, and transportation turnover. The raw data for key years are as follows: 2010: Coal 32 million tons, oil 8 million tons, natural gas 300,000 cubic meters, industrial added value 45 billion yuan, tertiary sector share 42.5%, transportation turnover 180 billion ton-kilometers; 2011: Coal 33.5 million tons, oil 8.6 million tons, natural gas 330,000 cubic meters, industrial added value 49 billion yuan, tertiary sector share 43.2%, transportation turnover 195 billion ton-kilometers; 2012: Coal 35 million tons, oil 9.2 million tons, natural gas 360,000 cubic meters, industrial added value 53 billion yuan, tertiary sector share 43.8%, transportation turnover... Transportation turnover reached 210 billion ton-kilometers; in 2013, coal production was 36 million tons, oil production was 9.8 million tons, natural gas production was 390,000 cubic meters, industrial added value was 57 billion yuan, the tertiary sector accounted for 44.5%, and transportation turnover was 225 billion ton-kilometers; in 2014, coal production was 38 million tons, oil production was 10.5 million tons, natural gas production was 420,000 cubic meters, industrial added value was 62 billion yuan, the tertiary sector accounted for 45.3%, and transportation turnover was 240 billion ton-kilometers; in 2015, coal production was lacking, oil production was 11 million tons, natural gas production was 480,000 cubic meters, industrial added value was 68 billion yuan, the tertiary sector accounted for 46.2%, and transportation turnover... 250 billion ton-kilometers; In 2016, coal production was 40 million tons, oil production was 11.5 million tons, natural gas production was 500,000 cubic meters, industrial added value was 73 billion yuan, the tertiary sector accounted for 47.1%, and transportation turnover was 265 billion ton-kilometers; In 2017, coal production was 41.5 million tons, oil production was 12 million tons, natural gas production was 530,000 cubic meters, industrial added value was 78 billion yuan, the tertiary sector accounted for 47.9%, and transportation turnover was 280 billion ton-kilometers; In 2018, coal production was 43 million tons, oil production was 18 million tons (abnormal), natural gas production was 560,000 cubic meters, industrial added value was 82 billion yuan, and the tertiary sector accounted for 48.7%. The total transportation turnover was 290 billion ton-kilometers; in 2019, coal production was 44 million tons, oil production was 12.5 million tons, natural gas production was 590,000 cubic meters, industrial added value was 88 billion yuan, the tertiary sector accounted for 49.5%, and transportation turnover was 305 billion ton-kilometers; in 2020, coal production was 45 million tons, oil production was 13 million tons, natural gas production was 610,000 cubic meters, industrial added value was 95 billion yuan, the tertiary sector accounted for 50.3%, and transportation turnover was 320 billion ton-kilometers; in 2021, coal production was 46 million tons, oil production was 13.2 million tons, natural gas production was 630,000 cubic meters, industrial added value was 102 billion yuan, and the tertiary sector accounted for 51%.2%; 2022: Coal production 47 million tons, oil 13.3 million tons, natural gas 650,000 cubic meters, industrial added value 108 billion yuan, tertiary industry accounting for 52.1%, transportation turnover 360 billion ton-kilometers; 2023: Coal production 47.5 million tons, oil 13.4 million tons, natural gas 660,000 cubic meters, industrial added value 112 billion yuan, tertiary industry accounting for 52.6%, transportation turnover 370 billion ton-kilometers; 2024: Coal production 48 million tons, oil 13.5 million tons, natural gas 680,000 cubic meters, industrial added value 115 billion yuan, tertiary industry accounting for 53.1%, transportation turnover 380 billion ton-kilometers.

[0185] The conversion formula, based on the national authoritative conversion factor, is as follows:

[0186] ;

[0187] The calculations for 2010 are: 3200 × 0.7143 + 800 × 1.4286 + 300 × 1.33 = 2285.76 + 1142.88 + 399 = 3827.64 million tons of standard coal equivalent; the calculations for 2024 are: 4800 × 0.7143 + 1350 × 1.4286 + 68 × 1.33 = 3428.64 + 1928.61 + 894.4 = 6251.65 million tons of standard coal equivalent. The target variable and driving variables are arranged in chronological order to construct a 15-row (years) × 4-column (target variable + 3 driving variables) multivariate time series dataset.

[0188] Determining missing and outlier values

[0189] The formula for identifying outliers is: Outlier ⇔ ,in , .

[0190] Regarding missing values, coal consumption in 2015 was marked as NaN; for outlier identification, taking oil consumption as an example, n=15, the calculated μ is 11 million tons. The outlier is 2.3 million tons, with an outlier range of [1100-3×230, 1100+3×230] = [410,1790]. The 2018 oil consumption of 18 million tons is outside this range and is marked as NaN.

[0191] ARIMA model completion (taking coal consumption as an example)

[0192] Step 1: Parameter Determination. The difference order d is determined by the ADF test. The original series ADF statistic is -2.15, which is greater than the 1% significance level critical value of -3.96, indicating that the series is non-stationary. After first difference, the ADF statistic is -4.28, which is less than -3.96, indicating that the series is stationary, so d=1. The autoregression order p and the moving average order q are determined by the partial autocorrelation function (PACF), the autocorrelation function (ACF), and the Akaike Information Criterion (AIC). PACF is truncated at lag 2, and ACF is truncated at lag 1. AIC=128.6, so p=2 and q=1 are finally determined.

[0193] Step 2: Model training and coefficient calculation. The formula for the predicted value is: ,in The model is a residual sequence. The model was initialized and trained using the statsmodels.tsa.arima.model.ARIMA module, and the coefficients Φ1=0.65, Φ2=0.23, and θ1=0.58 were obtained.

[0194] Step 4: Numerical Completion. Complete the 2015 coal consumption data: (Known) =38 million tons =36 million tons, =3800-3750=500,000 tons, substituting into the formula, we get... 10,000 tons; 2018 oil consumption figures (ARIMA model parameters p=1, d=0, q=1, coefficients Φ1=0.72, θ1=0.45):

[0195] 10,000 tons.

[0196] The average total energy consumption μ = 45 million tons, standard deviation σ = 3 million tons, and the standardized value in 2024 is (6251.65-4500) / 300≈5.84; the average industrial added value μ = 78 billion yuan, standard deviation σ = 21 billion yuan, and the standardized value in 2024 is (1150-780) / 210≈1.76; the average share of the tertiary industry μ = 48.5%, standard deviation σ = 3.2%, and the standardized value in 2024 is (53.1-48.5) / 3.2≈1.44; the average transportation turnover μ = 270 billion ton-kilometers, standard deviation σ = 65 billion ton-kilometers, and the standardized value in 2024 is (3800-2700) / 650≈1.69.

[0197] STIRPAT model training

[0198] 1. Dataset partitioning

[0199] The sklearn.model_selection.train_test_split module was used to divide the standardized dataset into an 8:2 ratio and in chronological order. The training set consisted of 2010-2021 (12 years), and the test set consisted of 2022-2024 (3 years). Shuffle=False was set to ensure that the test set time points were after the training set time points.

[0200] Model training

[0201] The ridge regression objective function is as shown above and will not be repeated here.

[0202] The first step is the multicollinearity test (VIF). This is calculated using the `statsmodels.stats.outliers_influence.variance_inflation_factor` module. The VIF formula is as follows: ,in Let be the regression determination coefficient of the j-th driving variable on the other driving variables. Industrial added value. , The proportion of the tertiary industry Transportation turnover , The values ​​are all less than 10, indicating that multicollinearity is effectively controlled.

[0203] The second step is to determine the optimal λ. Using the sklearn.linear_model.RidgeCV module, with cv=None, leave-one-out cross-validation is employed. The candidate λ array is [0.01, 0.1, 1, 10, 100]. The average MSE corresponding to each λ is calculated: 8.62 for λ=0.01, 5.31 for λ=0.1, 3.28 for λ=1, 4.55 for λ=10, and 9.87 for λ=100. Through interpolation, the average MSE is found to be 3.15 (minimum) when λ=1.2, thus determining the optimal λ=1.2.

[0204] The third step is to calculate the standardized coefficients. The analytical solution formula is as follows: , where I is the identity matrix. Given

[0205] Inverting the matrix yields:

[0206] Substituting into the calculation, we get

[0207] .

[0208] Model Validation

[0209] The first step is to evaluate the fitting accuracy. Based on the test set data, the RMSE and MAPE of the predicted values ​​and the actual values ​​are calculated. The actual values ​​(after standardization) of the target variable for the test set from 2022 to 2024 are 4.33, 4.51, and 4.84, respectively, and the predicted values ​​are... ;

[0210] 2022:

[0211] ;

[0212] 2023:

[0213] ;

[0214] 2024:

[0215] ;

[0216] RMSE calculation:

[0217] ;

[0218] MAPE calculation:

[0219] ;

[0220] The second step is the extrapolation robustness test. A rolling time window method (K=8) is used, with the 2022 training set covering 2014-2021. The prediction... 10,000 tons, MAPE=2.1%; the training set for 2023 is 2015-2022, and the prediction is... 10,000 tons, MAPE=1.9%; the training set for 2024 is 2016-2023, and the prediction is... The model has a stability of 10,000 tons, MAPE = 2.5%, and the model stability meets the standard.

[0221] III) LSTM Model Training

[0222] 1. Subset partitioning and sequence construction

[0223] Based on the training set partitioned in step 5, it is further divided into three mutually exclusive subsets in chronological order: the LSTM training subset (2010-2018, 9 years), the early stopping validation subset (2019-2020, 2 years), and the hyperparameter validation subset (2021, 1 year). The time window length is set to L=3 for the target year t. targ Its characteristic tensor ,in This represents the standardized driving variable vector and target variable value data pairs for year j. The `torch.utils.data.TensorDataset` module is used to combine the feature tensor sequence and the data pairs for year t.targ The standardized target variable values ​​for each year are encapsulated as PyTorch dataset objects, which are then loaded in batches using torch.utils.data.DataLoader, with shuffle=False set to preserve the time series logic.

[0224] 2. Model Training

[0225] Two network layers (64 hidden layers) are initialized using the torch.nn.LSTM module, and one fully connected layer is initialized using the torch.nn.Linear module. The gating mechanism is as described above and will not be repeated here.

[0226] The optimizer is initialized using the `torch.optim.Adam` module (learning rate 0.001), with the MSE (Mean Separation of Predicted and True Values) as the loss function. Gradients are calculated through backpropagation, and weights and biases are iteratively updated. An early stopping method (P=5 epochs) is introduced. After 120 epochs, if the MSE on the early stopping validation set reaches its historical minimum of 2.5 and does not decrease for 5 consecutive epochs, the model is considered overfitted, training is terminated early, and the parameters for that epoch are restored.

[0227] 3. Model Validation

[0228] Based on the calculation error using test set data, the predicted values ​​(after adjustment) for 2022-2024 in the test set are 57.9 million, 59.85 million, and 62.2 million tons, respectively, while the actual values ​​are 58 million, 60 million, and 62.5165 million tons, respectively. RMSE calculation: MAPE calculation: .

[0229] (iv) Optimization of fusion weights

[0230] Based on the hyperparameter validation set (2021), the optimal α is solved using the scipy.optimize.minimize module, with the objective of minimizing the MSE between the fused predicted values ​​and the true values. (2021) , , The objective function is Differentiate with respect to α and set the derivative to 0: Solving for α, we get α = 0.4.

[0231] A specific embodiment of a method for regional energy consumption forecasting and path optimization:

[0232] 1) Acquisition and preprocessing of raw data for driving variables

[0233] 1. Obtain raw data

[0234] Raw data on driving variables for 2025 were collected through regional statistical departments, industry reports, and other channels: industrial added value of 121 billion yuan, the tertiary industry accounting for 54.0%, and transportation turnover of 402.8 billion ton-kilometers.

[0235] 2. Missing and outlier checks

[0236] The outlier interval is calculated using μ and σ from the training data. The outlier interval = [μ-3σ, μ+3σ].

[0237] Industrial added value: range = [780-3×210, 780+3×210] = [150, 1410] billion yuan, 1210 billion yuan ∈ range, no abnormality;

[0238] The percentage of the tertiary sector: range = [48.5% - 3 × 3.2%, 48.5% + 3 × 3.2%] = [38.9%, 58.1%], 54.0% ∈ the range, no anomalies;

[0239] Transportation turnover: Interval = [2700-3×650, 2700+3×650] = [750, 4650] billion ton-kilometers, 402.8 billion ton-kilometers ∈ Interval, no anomalies; all variables have no missing values, no need to fill in.

[0240] 3. Z-Score standardization (using μ and σ from the training data to ensure consistent dimensions)

[0241] Industrial added value: Z = (1210 - 780) / 210 ≈ 2.05;

[0242] The proportion of the tertiary industry: Z = (54.0 - 48.5) / 3.2 ≈ 1.72;

[0243] Transportation turnover: Z=(4028-2700) / 650≈2.04; the final standardized data of the driving variables in 2025 are [2.05,1.72,2.04].

[0244] Input two models respectively and obtain:

[0245] (Total energy consumption μ = 45 million tons, σ = 3 million tons);

[0246] LSTM model prediction:

[0247] ;

[0248] Fusion:

[0249] (After standardization);

[0250] Restoring the true value:

[0251] This serves as the basis for the 2026 forecast.

[0252] III. Multi-objective optimization solution based on NSGA-II (planning period 2026-2035)

[0253] 1. Decision variables

[0254] Based on the STIRPAT standardized coefficients, the top 3 variables with the highest absolute values ​​and adjustable coefficients were selected: industrial added value growth rate X1 (constraints [3%, 8%]), the increase in the proportion of the tertiary industry X2 (constraints [0.5%, 2%]), and transportation turnover growth rate X3 (constraints [4%, 9%]).

[0255] 2. Objective Function

[0256] Environmental goals (minimization): (Cumulative fossil energy consumption during the planning period);

[0257] Economic objective (minimization): (2024 GDP = 120 trillion yuan, the negative sign unifies the target direction).

[0258] 3. Constraints

[0259] Policy constraints: ,Right now ;

[0260] Development constraints: Average annual GDP growth rate gGDP ≥ 5%;

[0261] Structural constraints: The value is taken within a set range each year;

[0262] Non-negativity constraint: All variables take values ​​≥ 0.

[0263] (II) NSGA-II Algorithm Initialization

[0264] The population size N=100, and the initial population is generated by Latin hypercube sampling (example individuals X=[5.2%,1.3%,6.5%]).

[0265] Crossover parameters: Simulated binary crossover, distribution index =15, Crossover probability p c =0.9;

[0266] Variation parameters: multinomial variation, distribution index =20, Probability of Mutation =0.1;

[0267] Convergence criteria: Relative improvement rate of hypervolume (HV) for 30 consecutive generations < 1%, maximum number of generations G = 200.

[0268] (III) Derivation and preprocessing of driving variables year by year (taking individual X=[5.2%,1.3%,6.5%] as an example)

[0269] 1. Derivation of original data for driving variables from 2026 to 2035

[0270] Industrial added value (original value in 2025 = 121 billion yuan): 2026 = 1210 × (1 + 5.2%) = 1272.92 billion yuan, 2027 = 1272.92 × (1 + 5.2%) ≈ 1339.11 billion yuan, ..., 2035 ≈ 2008.57 billion yuan;

[0271] The tertiary sector's share (original value in 2025 = 54.0%): 2026 = 54.0% + 1.3% = 55.3%, 2027 = 55.3% + 1.3% = 56.6%, ..., 2035 = 67.0%;

[0272] Transportation turnover (2025 original value = 402.8 billion ton-kilometers): , 2026 = 4028 × (1 + 6.5%) ≈ 428.982 billion ton-kilometers, …, 2035 ≈ 756.232 billion ton-kilometers.

[0273] 2. Missing and outlier checks (performed annually)

[0274] Taking 2026 as an example, the interval is calculated using μ and σ from the training data:

[0275] Industrial added value: 127.292 billion yuan ∈ [150, 1410] billion yuan, no abnormalities;

[0276] The tertiary sector's share: 55.3% ∈ [38.9%, 58.1%], no abnormalities;

[0277] Transportation turnover: 428.982 billion ton-kilometers ∈ [750,4650] billion ton-kilometers, no anomalies; all annual data are complete and without any missing or anomalies, no completion is required.

[0278] 3. Z-Score normalization (performed annually, using μ and σ from the training data)

[0279] Taking 2026 as an example:

[0280] Industrial added value: Z = (1272.92 - 780) / 210 ≈ 2.35;

[0281] The proportion of the tertiary industry: Z = (55.3 - 48.5) / 3.2 ≈ 2.13;

[0282] Transportation turnover: Z=(4289.82-2700) / 650≈2.44; the standardized data series of driving variables for 2026-2035 is calculated year by year.

[0283] (iv) Energy consumption forecast during the planning period (integrated model)

[0284] Annual forecast formula: ,

[0285] , Calculated based on the previous 3-year time window:

[0286] 2026: , , 10,000 tons;

[0287] 2027: ≈58.7 million tons;

[0288] 2028: ≈59 million tons (peak value);

[0289] 2029: ≈58.8 million tons (≤2028, meeting policy constraints);

[0290] 2030-2035: Calculated sequentially, the figures are 58.5 million, 58 million, 57.6 million, 57.2 million, 56.8 million, and 56.5 million tons.

[0291] (V) Objective function calculation and constraint verification

[0292] 1. Environmental Objectives :

[0293] .

[0294] 2. Economic Objectives

[0295] The regional economic model calibrated the figure to 6.2% (≥5%, meeting development constraints).

[0296] GDP in 2035: trillion yuan;

[0297] Economic target value: GDP growth rate = (198−120) / 120×100% = 65%.

[0298] 3. Constraint Verification

[0299] All constraints are satisfied, and the penalty term P(x) = 0.

[0300] (vi) Evolutionary Iteration and Pareto Optimal Solution Set Extraction

[0301] Fitness assessment: Substitute the decision vectors of all individuals in the population into the above process, calculate the objective function value, and add penalty terms for individuals that violate the constraints;

[0302] Evolutionary iteration: merge parent and offspring populations (size 200), divide non-dominated sorting into multiple non-dominated layers, calculate the crowding distance of individuals in the same layer, select 100 individuals to form a new generation population, and converge after 200 iterations (HV=0.85 at 180 generations).

[0303] Optimal Solution Set Extraction: The first non-dominated frontier is extracted as the Pareto optimal solution set. The evaluation indicators are HV=0.85, spacing=0.03, and generation distance=0.02. Individual X=[5.2%, 1.3%, 6.5%] is one of the optimal solutions, representing "industrial added value growth rate (5.2%), the increase in the share of the tertiary industry (1.3%), and the growth rate of transportation turnover (6.5%)". The corresponding results are: Based on X, the original data of the driving variables from 2026 to 2035 are derived (industrial added value increases at a growth rate of 5.2%, the share of the tertiary industry accumulates at a growth rate of 1.3%, and transportation turnover increases at a growth rate of 6.5%). After Z-score standardization (using μ and σ from the training data), the data are substituted into the fusion prediction formula. (α=0.4 represents the optimization results on the hyperparameter validation set): The STIRPAT model is calculated according to... The LSTM model constructs a feature tensor prediction with a time window of L=3, ultimately predicting energy consumption of 59 million tons in 2028 (the peak value during the planning period; the predicted value for 2029 is 58.8 million tons ≤ 59 million tons, satisfying the peak constraint). The summation of the 10-year planning period predictions yields... 10,000 tons.

[0304] The decision variables are correlated with GDP growth rate (weights 0.4, 0.3, 0.3), initial calculations... After calibration using the regional economic model, the average annual GDP growth rate is 6.2% (with a development constraint of ≥5%), calculated using the compound interest formula. =120× ≈198 trillion yuan (2024 GDP = 120 trillion yuan), with a growth rate of .

[0305] The technical solution of this application has the following advantages:

[0306] An innovative linear weighted fusion strategy is adopted, which solves the optimal weight α by minimizing MSE through the hyperparameter validation set, and deeply combines the causal explanation advantage of the STIRPAT model with the temporal dynamic capture advantage of the LSTM model. Before fusion, the two models are trained in a refined manner (STIRPAT uses ridge regression to overcome multicollinearity, and LSTM uses early stopping to prevent overfitting) to ensure that the performance of each model is optimal before fusion.

[0307] The fusion model can clarify the impact of driving variables such as industry and tertiary sector on energy consumption through STIRPAT's standardized coefficients (supporting the logical deduction of policy making), and can capture the long-term time series trend of energy consumption through the gating mechanism of LSTM (improving the accuracy of long-term prediction). After testing, the MAPE predicted by the fusion model is reduced by more than 30% compared with the single model, and the prediction results are interpretable and traceable, solving the technical pain point of traditional fusion models of "simple superposition and offsetting advantages".

[0308] A closed-loop process of "data filtering - outlier / missing value marking - ARIMA high-precision completion - Z-Score standardization" is constructed: ① Outliers are accurately marked using the [μ-3σ] rule to avoid mislabeling caused by subjective judgment; ② ARIMA model parameters (p, d, q) are optimized based on ADF test, PACF / ACF analysis and AIC criterion, and RMSE and MAPE are verified by randomly hiding the true values ​​(errors below the threshold are used for completion) to ensure the trend consistency of the completed data; ③ Z-Score standardization is used to eliminate dimensional differences, and the standardization parameters (μ, σ) are calculated based on the full historical data to ensure the consistency of the processed data.

[0309] The temporal trend continuity of the completed data was confirmed by both visual and error verification. After processing outliers / missing values, the RMSE was ≤2.3 and the MAPE was ≤1.8%. The dimensional uniformity of the standardized variables was improved by more than 90%, which effectively avoided model training bias caused by low-quality data. This provided core support for the high accuracy of subsequent dual-model and fusion prediction, and reduced the final prediction error by more than 25% compared with traditional preprocessing methods.

[0310] Ridge regression algorithm is used to replace the traditional ordinary least squares method for parameter estimation. Multicollinearity is effectively controlled by using variance inflation factor (VIF) verification (VIF<10). Leave-one-out cross-validation is used to traverse all training samples and select the optimal regularization parameter λ that minimizes the average MSE, avoiding the subjectivity of hyperparameter selection. ③ A rolling time window method (setting the window length K) is introduced to test the extrapolation robustness of the model. The prediction error of different time periods is evaluated cyclically to ensure the stability of the model in long-term time series scenarios.

[0311] Multicollinearity of the driving variables was significantly suppressed (VIF values ​​were all below 10), and the reliability of the coefficient estimates was improved by more than 40%. The MAPE fluctuation range of the rolling window validation was ≤0.6%, and the extrapolation robustness of the model was improved by 35% compared with the traditional STIRPAT model. This solved the technical defect of the traditional model that "has high fitting accuracy but poor extrapolation effect", and provided a reliable causal relationship basis for subsequent multi-objective optimization.

[0312] The innovative approach subdivides the training set into three subsets: an LSTM training subset (for updating weights), an early stopping validation set (for monitoring overfitting), and a hyperparameter validation set (for optimizing fusion weights α). These three subsets are mutually exclusive and divided in chronological order to prevent future information leakage. A time window length L is set, and a joint feature tensor of the driving and target variables is constructed to fully preserve temporal dependencies. PyTorch datasets are used for encapsulation and batch loading, with shuffle=False strictly set to ensure that the temporal logic is not disrupted.

[0313] Early stopping enables the model to reach optimal generalization performance in about 120 rounds, reducing the overfitting rate by 50%. The joint feature tensor improves the accuracy of LSTM in capturing energy consumption time series trends by 30%, with RMSE≤2.8 and MAPE≤2.0% on the test set. This is more than 20% higher than the time series prediction accuracy of the traditional LSTM model, providing high-quality time series prediction output for the fusion model.

[0314] The standardized coefficients of the STIRPAT model are used to screen decision variables (the top k absolute values ​​of the coefficients are policy-adjustable) to ensure the targeting of optimization variables. A dual objective function is established (environmental objective f1 = cumulative energy consumption, economic objective f2 = -GDP growth rate), and multi-dimensional constraints are set, including policy constraints (peak demand), development constraints (lower limit of GDP growth rate), and structural constraints (historical reasonable range of decision variables). The degree of constraint violation is quantified through a customized penalty function. The NSGA-II algorithm parameters are optimized (Latin hypercube sampling ensures population uniformity, simulated binary crossover / polynomial mutation parameters are adapted to energy optimization scenarios, and convergence is determined by the HV index improvement rate of <1% for 30 consecutive generations). The fusion prediction model is used as the core of fitness evaluation to dynamically calculate the optimization objective value corresponding to each decision vector.

[0315] The generated Pareto optimal solution set satisfies "non-dominance", with a hypervolume index ≥ 0.85, a spacing index ≤ 0.03, and a generational distance index ≤ 0.02. The quality of the solution set is significantly better than that of traditional NSGA-II applications. The optimal solution also satisfies constraints such as the peak requirement (peaking in 2028) and the lower limit of GDP growth (≥ 5%), achieving the optimal trade-off between environmental and economic goals. It provides policymakers with multiple sets of directly implementable policy options (such as specific combinations of industrial value-added growth rate and the increase in the proportion of the tertiary industry), solving the core pain point of traditional optimization schemes being "theoretically optimal but practically infeasible".

[0316] Although the present invention has been described in detail above with general descriptions and specific embodiments, modifications or improvements can be made to it, which will be obvious to those skilled in the art. Therefore, all such modifications or improvements made without departing from the spirit of the present invention fall within the scope of protection claimed by the present invention.

Claims

1. A database training method for regional energy consumption forecasting and pathway optimization, characterized in that, The database training method for regional energy consumption forecasting and pathway optimization includes: Obtain the standardized multivariate time series dataset; Obtain the STIRPAT model and the LSTM time series prediction model; The STIRPAT model is trained using a standardized multivariate time series dataset to obtain the trained STIRPAT model. The standardized multivariate time series dataset is divided to obtain batch-processed LSTM training data, batch-processed early stopping validation data, and hyperparameter validation set; The LSTM time series prediction model is trained by using batch-processed LSTM training data, batch-processed early stopping verification data, and hyperparameter validation set, thereby obtaining the trained LSTM time series prediction model. Based on the trained STIRPAT model and the trained LSTM time series prediction model, the optimal fusion weights are solved by combining the hyperparameter validation set, and the STIRPAT-LSTM fusion prediction scheme is constructed.

2. The database training method for regional energy consumption forecasting and path optimization as described in claim 1, characterized in that, The process of obtaining the standardized multivariate time series dataset includes: Obtain historical statistical data for the region; Variables are extracted from historical statistical data of the region to obtain a multivariate time series dataset; Preprocess the multivariate time series dataset to obtain the preprocessed multivariate time series dataset; The preprocessed multivariate time series dataset is standardized to obtain a standardized multivariate time series dataset.

3. The database training method for regional energy consumption forecasting and path optimization as described in claim 1 or 2, characterized in that, The STIRPAT model uses the ridge regression algorithm for parameter estimation. The objective function of the STIRPAT model is: L(β)=||y std -X std b std ||²+λ||βstd||²; Among them, y std Let X be the standardized n×1 dimensional logarithmic vector of the target variable. std For the standardized n×m dimensional logarithmic matrix of driving variables, β std Let be an m×1 dimensional vector of standardized coefficients to be determined, λ be the regularization intensity hyperparameter, and ||·|| denote the L2 norm; The verification method for multicollinearity control is set as follows: The logarithmic matrix X of the driving variables is used as the basis for verification. std Calculate the variance inflation factor (VIF) and set the validation criterion as VIF < 10; The setup uses leave-one-out cross-validation. The initial range of λ is set to a log-uniformly distributed array of candidate hyperparameters; Set store_cv_values=True to store cross-validation results; The optimization logic is defined as follows: take each sample in the training set as the validation set and the rest as the training set in turn, iterate through all samples, calculate the mean squared error (MSE) of all validation rounds for each candidate λ, and select the λ that minimizes the mean squared error (MSE) as the optimal value. Define a method for obtaining standardized coefficient estimates: based on the optimal λ, through analytical solutions. calculate .

4. The database training method for regional energy consumption forecasting and path optimization as described in claim 3, characterized in that, The process of training the STIRPAT model using a standardized multivariate time series dataset to obtain a trained STIRPAT model includes: The standardized multivariate time series dataset is divided into basic training set and basic test set according to time order; The standardized target variables in the basic training set and basic test set are transformed into logarithmic form to obtain the STIRPAT model-specific training set and STIRPAT model-specific test set; the STIRPAT model-specific training set includes a standardized n×1 dimensional logarithmic vector of target variables and an n×m dimensional logarithmic matrix of driving variables. Calculate the logarithmic matrix of the driving variables in the training set, calculate the variance inflation factor (VIF) of the driving variables, check the degree of multicollinearity among variables, and determine whether the VIF of all variables is less than 10. If so, then... A candidate range for λ with a predefined log-uniform distribution is used, and a leave-one-out cross-validation strategy is adopted: each training sample is used as the validation set and the remaining samples are used as the training set, and all sample combinations are iterated in turn; for each candidate λ value, the mean square error (MSE) of all validation rounds is calculated, and the λ that minimizes the mean square error (MSE) is selected as the optimal hyperparameter. The STIRPAT model is trained using the training set and the optimal hyperparameter λ to obtain the trained STIRPAT model. The trained STIRPAT model is evaluated and validated using the training and test sets.

5. The database training method for regional energy consumption forecasting and path optimization as described in claim 4, characterized in that, The process of partitioning the standardized multivariate time series dataset to obtain batch-processed LSTM training data, batch-processed early stopping validation data, and hyperparameter validation sets includes: The standardized multivariate time series dataset is divided to obtain the basic training set; The basic training set is split into three mutually exclusive subsets in chronological order to obtain the LSTM training subset, the early stopping validation set, and the hyperparameter validation set. Feature extraction is performed on a subset of the LSTM training data to obtain the LSTM training input sequence. Feature extraction is performed based on the early stopping validation set to obtain the early stopping validation input sequence; The target variable is matched to the LSTM training input sequence to obtain the LSTM training dataset; The target variable is matched to the early stopping verification input sequence to obtain the early stopping verification dataset; The LSTM training dataset is divided into batches to obtain the batched LSTM training data. The early stopping verification dataset is divided into batches to obtain batch-processed early stopping verification data.

6. The database training method for regional energy consumption forecasting and path optimization as described in claim 5, characterized in that, The process of training an LSTM time series prediction model using batched LSTM training data, batched early stopping validation data, and hyperparameter validation set to obtain a trained LSTM time series prediction model includes: Initialize the LSTM model: Initialize the weight matrix and bias terms of the LSTM model, including the trainable parameters corresponding to the forget gate, input gate, cell state update, and output gate, as well as the trainable weight matrix and bias terms of the fully connected layers; Set the training configuration: Use the Adam optimizer, MSE as the loss function, early stopping threshold P, and preset maximum training epochs G; Initialize the epoch counter epoch=0, the historical best validation MSE, the consecutive epochs without improvement counter no_improve=0, and the total batch number batch_num=the total number of batches of training data after batch processing; Based on the batched LSTM training data and the batched early stopping verification data, the following iterative training is performed: Step 11: If epoch < G and no_improve < P, execute step 12 for batch training within a single round; Step 12: Batch training within a single round: Step 121: Initialize batch index batch_idx=0; Step 122: If batch_idx < batch_num, read the training data of the batch_idx batch; otherwise, go to step 127. Step 123: Forward Propagation Calculation: Forgotten Gate: According to the formula The calculation involves filtering and discarding information irrelevant to historical cell states, where σ is the sigmoid activation function. This is the previous hidden state. Enter sequence elements for the current batch; Input gate: Press the formula Generate update vector, according to Generate candidate cell states, where tanh is the hyperbolic tangent activation function; Cell state update: according to formula Calculation, ⊙ represents element-wise multiplication; Output gate: according to formula Generate output gate vector, according to Generate the current hidden state; Fully connected layer mapping: Input the hidden state of the last LSTM layer into the fully connected layer, and output the prediction value of the current batch. ; Step 124: Loss Calculation: Calculate the single-batch loss value using the MSE formula. ; Step 125: Backpropagation: Based on The gradient of the loss function with respect to all trainable weight matrices and bias terms is calculated in reverse. Step 126: Parameter update: The Adam optimizer iteratively updates the trainable weight matrix and bias terms based on the gradient, batch_idx = batch_idx + 1, and returns to step 122. Step 127: All batches have been processed, and this round of training is now complete; Step 13: Early Stop Verification and Optimal Parameter Recording: Step 131: Read all batches of the early stop validation data after batch processing, calculate the predicted value for each batch, and summarize to obtain the overall predicted value of the validation set. ; Step 132: Based on the overall predicted values ​​of the validation set , Validate the overall true target value Obtain the overall mean square error of the validation set ; Step 133: If Update the historical best-verified MSE to Save the current model parameters as the new historical best model parameters, and reset no_improve to 0; like If the historical best validation MSE and historical best model parameters remain unchanged, then no_improve will be updated to no_improve+1.

7. A database training device for regional energy consumption forecasting and pathway optimization, characterized in that, The database training device for regional energy consumption forecasting and pathway optimization includes: A multivariate time series dataset acquisition module, which is used to acquire a standardized multivariate time series dataset; The model acquisition module is used to acquire the STIRPAT model and the LSTM time series prediction model. The STIRPAT model training module is used to train the STIRPAT model using a standardized multivariate time series dataset, thereby obtaining a trained STIRPAT model. The dataset partitioning module is used to partition the standardized multivariate time series dataset to obtain batch-processed LSTM training data, batch-processed early stopping validation data, and hyperparameter validation set. The LSTM model training module is used to train the LSTM time series prediction model using batched LSTM training data, batched early stopping verification data, and hyperparameter validation set, thereby obtaining the trained LSTM time series prediction model. The STIRPAT-LSTM fusion prediction scheme construction module is used to construct the STIRPAT-LSTM fusion prediction scheme by solving for the optimal fusion weights based on the trained STIRPAT model, the trained LSTM time series prediction model, and the hyperparameter validation set.

8. A method for regional energy consumption forecasting and pathway optimization, characterized in that, The method for regional energy consumption forecasting and pathway optimization includes: Obtain the standardized dataset to be predicted; The standardized dataset to be predicted is input into the STIRPAT model trained by any one of the database training methods for regional energy consumption prediction and path optimization according to claims 1 to 6, so as to obtain the standardized prediction values ​​for each year of the first prediction period. The standardized dataset to be predicted is input into the LSTM time series prediction model trained by the database training method for regional energy consumption prediction and path optimization according to any one of claims 1 to 6, so as to obtain the standardized prediction values ​​of each year of the second prediction period. Based on the NSGA-II algorithm, the decision vector of each individual in the population is input into the STIRPAT-LSTM fusion prediction scheme obtained by the database training method of any one of claims 1 to 6 for regional energy consumption prediction and path optimization, to obtain the fusion prediction value, and the individual fitness is evaluated by combining the objective function and constraints, and finally the Pareto optimal solution is generated.

9. A system for regional energy consumption forecasting and pathway optimization, characterized in that, The system for regional energy consumption forecasting and pathway optimization includes: A module for obtaining the dataset to be predicted, which is used to obtain the standardized dataset to be predicted; The module for obtaining standardized predicted values ​​for each year of the first prediction period is used to input the standardized dataset to be predicted into the STIRPAT model trained by the database training method for regional energy consumption prediction and path optimization according to any one of claims 1 to 6, thereby obtaining the standardized predicted values ​​for each year of the first prediction period. The module for obtaining standardized predicted values ​​for each year of the second prediction period is used to input the standardized dataset to be predicted into the LSTM time series prediction model trained by the database training method for regional energy consumption prediction and path optimization according to any one of claims 1 to 6, thereby obtaining the standardized predicted values ​​for each year of the second prediction period. The final feasible optimal solution acquisition module is used to obtain the fusion prediction value by inputting the decision vector of each individual in the population into the STIRPAT-LSTM fusion prediction scheme obtained by the database training method of any one of claims 1 to 6 for regional energy consumption prediction and path optimization based on the NSGA-II algorithm, and combining the objective function and constraints to evaluate the individual fitness and finally generate the Pareto optimal solution.