Smart park electrical load prediction method and system
By constructing a hybrid model that integrates convolutional neural networks and bidirectional long short-term memory layers, the problem of nonlinear temporal characteristics in power load forecasting in smart parks is solved, achieving high-precision power load forecasting, which is suitable for multi-source data fusion scenarios.
Patent Information
- Application Number
- CN202511016178.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-23
- Publication Date
- 2025-11-11
AI Technical Summary
Traditional forecasting methods struggle to capture the nonlinear time-series characteristics of electricity load in smart parks, and ordinary LSTM models lack the ability to fuse multi-source heterogeneous data, resulting in low forecast accuracy and susceptibility to noise interference.
A smart park electricity load prediction method is adopted. By collecting and cleaning electricity consumption, environmental and equipment status data, a hybrid model integrating convolutional neural network, bidirectional long short-term memory layer and multi-head attention mechanism is constructed. Data recombination and feature evaluation are performed to achieve high-precision prediction.
By effectively integrating the spatiotemporal correlation of environmental and production data, accurate and real-time prediction of power load in smart parks is achieved, making it suitable for high-precision prediction in multi-source data fusion scenarios.
Smart Images

Figure CN120933909A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power load forecasting technology, specifically a method and system for forecasting power load in smart parks. Background Technology
[0002] As the scale of smart parks expands, the main electricity users within the parks become more diverse (such as office buildings, production workshops, and public facilities), and the electricity load is affected by various dynamic factors (such as weather, holidays, and equipment operating status), resulting in strong fluctuations.
[0003] In existing technologies, traditional forecasting methods (such as ARIMA) struggle to capture the nonlinear temporal characteristics of electricity consumption data, while ordinary LSTM models lack the ability to fuse multi-source heterogeneous data and are susceptible to noise interference. In smart park scenarios, electricity consumption is affected by multiple dimensions such as equipment operation and environmental factors, necessitating a high-precision, adaptive forecasting solution. Summary of the Invention
[0004] This invention addresses the problem that traditional prediction models struggle to handle the nonlinear temporal characteristics of electricity consumption in industrial parks (such as sudden equipment start-up and shutdown, and holiday effects), by providing a smart park electricity load prediction method and system that enables accurate and real-time prediction of electricity load in smart parks.
[0005] Firstly, the present invention provides a method for predicting electricity load in smart parks, and the technical solution adopted to solve the above-mentioned technical problems is as follows:
[0006] A method and system for predicting electricity load in a smart industrial park, comprising the following steps:
[0007] S1. Collect electricity consumption data, environmental data, equipment status data, and time characteristic data of the smart park;
[0008] S2. Perform data cleaning and data normalization preprocessing operations on the collected data;
[0009] S3. Based on the preprocessed data, important features are evaluated and key features are selected. Then, the data is reorganized into a three-dimensional data table according to three dimensions: time series, feature type, and feature. The data is then transformed into an input-output data frame suitable for supervised learning. The input consists of historical time series data and real-time feature vectors, and the output is the target prediction value.
[0010] S4. Construct a prediction model, which is a hybrid model that integrates a convolutional neural network, a bidirectional long short-term memory layer, and a multi-head attention mechanism; train the prediction model using the input-output data frame output in step S3;
[0011] S5. After the prediction model is trained, input the historical time series data of the time to be predicted and the real-time feature vector output in step S3 into the prediction model, and the prediction model outputs the prediction result.
[0012] Optionally, the electricity data includes the current, voltage, and power time-series data of the park's main electricity meter and sub-meters, with a sampling frequency of 30 minutes;
[0013] Environmental data includes temperature, humidity, wind speed, weather, air quality, PM2.5 index, and carbon dioxide index, which are obtained in real time through meteorological APIs and environmental monitoring equipment.
[0014] Device status data includes device start / stop logs and load rates collected by IoT sensors;
[0015] The time-related data includes holiday markers and weekday / weekend markers.
[0016] Optionally, step S2 specifically includes:
[0017] S2.1. Clean the collected electricity consumption data, environmental data, equipment status data and time characteristic data, use time series linear interpolation to fill in missing data, and based on the 3σ principle, remove data points that exceed the mean ± 3 times the standard deviation.
[0018] S2.2 First, convert the collected equipment status data and time feature data into one-hot vectors. Then, standardize the collected electricity consumption data, environmental data, equipment status data, and time feature data using Z-score, as shown in the formula. Where x is the original feature value, μ is the mean of the feature, and σ is the standard deviation of the feature.
[0019] Further optionally, step S3 specifically includes:
[0020] S3.1 Construct time-series features and extract electricity consumption data for the past 24 hours through a sliding window;
[0021] S3.2. Feature importance assessment using the random forest algorithm: Train the random forest model and obtain the importance ranking of each feature based on the Gini impurity reduction; calculate the score according to the feature importance score formula (A), set the threshold Ntree=10, and filter and retain the top 10 key features with the highest importance scores.
[0022]
[0023] In the formula, Ij represents the importance score of the j-th feature, which is equal to the average local importance score of all decision trees in the random forest for that feature; Ntree represents the total number of decision trees in the random forest; t represents the t-th decision tree in the random forest. Let represent the local importance value of the j-th feature in the t-th decision tree, calculated using the Gini impurity reduction.
[0024] S3.3. Based on the key features that are selected and retained, the data is reorganized into a three-dimensional data table according to the three dimensions of time sequence, feature type and feature, and transformed into an input-output data frame suitable for supervised learning, which serves as a single sample of training data; wherein, the time sequence refers to the data collection time points arranged according to the time step.
[0025] Optionally, the prediction models involved may specifically include:
[0026] The convolutional neural network layer, as a feature extraction layer, contains two convolutional layers and two pooling layers. Each convolutional layer is equipped with 24 convolutional kernels, corresponding to 24 hours of a day. Data is input cyclically at intervals between each hour.
[0027] The data storage and processing layer has its input end connected to the output end of the convolutional neural network layer. It is used to temporarily store the data output by the convolutional neural network layer and sort the data output by the convolutional neural network layer after the sampling data is processed in a loop, forming a two-dimensional array sorted according to the sampling time.
[0028] The time series modeling layer, whose input is connected to the output of the data storage and processing layer, includes three bidirectional long short-term memory layers stacked in sequence. The three bidirectional long short-term memory layers increase the model parameter scale through the stacking structure to improve the fitting ability of complex nonlinear relationships and the ability to capture long-term dependencies, thereby realizing the modeling of the time series characteristics of the data.
[0029] The multi-head attention layer has its input connected to the output of the temporal modeling layer and is used to automatically calculate the weighted average of the output of the temporal modeling layer. The multi-head attention layer has 4 attention heads, corresponding to 4 feature types.
[0030] The fully connected layer, whose input is connected to the output of the multi-head attention layer, is used to perform data dimensionality reduction and inverse normalization processing, and output the final prediction result.
[0031] Optionally, the loss function of the prediction model can be set to smooth the mean absolute error, used to balance the mean absolute error and the mean squared error. The expression for the loss function is as follows:
[0032]
[0033] In the formula, This represents the loss function value, used to measure the degree of deviation between the predicted value and the actual value; y represents the model's predicted value; y represents the true label value; δ is a hyperparameter with a default value of 1.0.
[0034] Further optionally, when performing step S4 and training the prediction model using the input-output data frame output in step S3, the optimizer used is Adam, the initial learning rate is set to 0.001, and the weight decay coefficient is set to 0.01 to suppress overfitting; the learning rate adjustment adopts a cosine annealing strategy, with a period of 50 training rounds, so that the learning rate decays periodically according to the cosine curve as the training progresses, balancing the convergence speed and optimization accuracy of the model.
[0035] During the training of the prediction model, if the validation set loss does not decrease for five consecutive training rounds, or if the number of training rounds reaches the preset maximum number of training rounds, then training is stopped. If the above termination conditions are not met, the model parameters and network weights are updated after each iteration, and the next round of training continues until the termination conditions are met.
[0036] Secondly, this invention provides a smart park electricity load forecasting system, and the technical solution adopted to solve the above-mentioned technical problems is as follows:
[0037] A smart park electricity load forecasting system, comprising:
[0038] The data acquisition module is used to collect electricity consumption data, environmental data, equipment status data, and time characteristic data of the smart park.
[0039] The data preprocessing module is used to perform data cleaning and data normalization preprocessing operations on the collected data;
[0040] The feature processing module is used to evaluate important features based on the preprocessed data, select key features, and then reorganize the data according to three dimensions: time series, feature type, and feature to form a three-dimensional data table. It is then transformed into an input-output data frame suitable for supervised learning, where the input is historical time series data and real-time feature vectors, and the output is the target prediction value.
[0041] The model building and training module is used to build a prediction model, which is a hybrid model that integrates a convolutional neural network, a bidirectional long short-term memory layer, and a multi-head attention mechanism; it is also used to train the prediction model using the input-output data frames output by the feature processing module.
[0042] The prediction model takes the historical time-series data of the time to be predicted and the real-time feature vector output by the feature processing module as input, and outputs the prediction result.
[0043] The system achieves smart park electricity load prediction through the method described in the first aspect.
[0044] Thirdly, the present invention also provides a smart park electricity load prediction device, which includes: at least one memory and at least one processor;
[0045] At least one memory is used to store machine-readable programs;
[0046] At least one processor is used to invoke the machine-readable program to implement the smart park power load prediction method described in the first aspect.
[0047] Fourthly, the present invention also provides a computer-readable medium having computer instructions stored thereon, which, when executed by a processor, can implement the smart park power load prediction method described in the first aspect.
[0048] The present invention provides a smart park electricity load forecasting method and system, which has the following advantages compared with the prior art:
[0049] This invention can effectively integrate the spatiotemporal correlation of environmental data and production data to accurately and in real time predict the power load of smart parks. It solves the problem that traditional prediction models are difficult to handle the nonlinear time series characteristics of power consumption in parks, and is suitable for high-precision power load prediction in smart parks under multi-source data fusion scenarios. Attached Figure Description
[0050] Appendix Figure 1 This is a flowchart of the method according to Embodiment 1 of the present invention;
[0051] Appendix Figure 2 This is a structural diagram of the prediction model in Embodiment 1 of the present invention;
[0052] Appendix Figure 3 This is a module connection block diagram of Embodiment 2 of the present invention. Detailed Implementation
[0053] To make the technical solution, the technical problem solved, and the technical effect of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with specific embodiments.
[0054] Example 1:
[0055] Reference Appendix Figure 1 , 2 This embodiment proposes a method and system for predicting electricity load in smart parks, which includes the following steps:
[0056] S1. Collect electricity consumption data, environmental data, equipment status data, and time characteristic data of the smart park.
[0057] Electricity consumption data includes time-series data of current, voltage, and power from the park's main electricity meter and sub-meters (air conditioning, lighting, etc.), with a sampling frequency of 30 minutes;
[0058] Environmental data includes temperature, humidity, wind speed, weather, air quality, PM2.5 index, and carbon dioxide index, which are obtained in real time through meteorological APIs and environmental monitoring equipment.
[0059] Device status data includes device start / stop logs and load rates collected by IoT sensors;
[0060] The time-related data includes holiday markers and weekday / weekend markers.
[0061] S2. Preprocessing operations such as data cleaning and data normalization are performed on the collected data, specifically including:
[0062] S2.1. Clean the collected electricity consumption data, environmental data, equipment status data and time characteristic data, use time series linear interpolation to fill in missing data, and based on the 3σ principle, remove data points that exceed the mean ± 3 times the standard deviation.
[0063] S2.2 First, convert the collected equipment status data and time feature data into one-hot vectors. Then, standardize the collected electricity consumption data, environmental data, equipment status data, and time feature data using Z-score, as shown in the formula. Where x is the original feature value, μ is the mean of the feature, and σ is the standard deviation of the feature.
[0064] S3. Based on the preprocessed data, important features are evaluated and key features are selected. Then, the data is reorganized into a three-dimensional data table according to three dimensions: time series, feature type, and feature. The data is then transformed into an input-output data frame suitable for supervised learning. The input consists of historical time series data and real-time feature vectors, and the output is the target prediction value.
[0065] This process specifically includes:
[0066] S3.1 Construct time-series features and extract electricity consumption data for the past 24 hours through a sliding window;
[0067] S3.2. Feature importance assessment using the random forest algorithm: Train the random forest model and obtain the importance ranking of each feature based on the Gini impurity reduction; calculate the score according to the feature importance score formula (A), set the threshold Ntree=10, and filter and retain the top 10 key features with the highest importance scores.
[0068]
[0069] In the formula, Ij represents the importance score of the j-th feature, which is equal to the average local importance score of all decision trees in the random forest for that feature; Ntree represents the total number of decision trees in the random forest; t represents the t-th decision tree in the random forest. Let represent the local importance value of the j-th feature in the t-th decision tree, calculated using the Gini impurity reduction.
[0070] S3.3. Based on the key features that are selected and retained, the data is reorganized into a three-dimensional data table according to the three dimensions of time sequence, feature type and feature, and transformed into an input-output data frame suitable for supervised learning, which serves as a single sample of training data; wherein, the time sequence refers to the data collection time points arranged according to the time step.
[0071] S4. Construct a prediction model, which is a hybrid model that integrates a convolutional neural network (CNN), a bidirectional long short-term memory layer (BiLSTM), and a multi-head attention mechanism; train the prediction model using the input-output data frames output in step S3.
[0072] The constructed prediction model specifically includes:
[0073] The convolutional neural network (CNN) layer serves as a feature extraction layer. This CNN layer contains two convolutional layers and two pooling layers. Each convolutional layer is equipped with 24 convolutional kernels, corresponding to 24 hours of the day. Data is input cyclically at intervals between each hour.
[0074] The data storage and processing layer has its input end connected to the output end of the convolutional neural network layer. It is used to temporarily store the data output by the convolutional neural network layer and sort the data output by the convolutional neural network layer after the sampling data is processed in a loop, forming a two-dimensional array sorted according to the sampling time.
[0075] The time series modeling layer, whose input is connected to the output of the data storage and processing layer, includes three bidirectional long short-term memory (BiLSTM) layers stacked in sequence. The three BiLSTM layers increase the model parameter scale through the stacking structure to improve the fitting ability of complex nonlinear relationships and the ability to capture long-term dependencies, thereby realizing the modeling of the time series characteristics of the data.
[0076] The multi-head attention layer has its input connected to the output of the temporal modeling layer and is used to automatically calculate the weighted average of the output of the temporal modeling layer. The multi-head attention layer has 4 attention heads, corresponding to 4 feature types.
[0077] The fully connected layer, whose input is connected to the output of the multi-head attention layer, is used to perform data dimensionality reduction and inverse normalization processing, and output the final prediction result.
[0078] The loss function for the prediction model is set to smoothed mean absolute error (Huber Loss), used to balance mean absolute error and mean squared error. The expression for the loss function is as follows:
[0079]
[0080] In the formula, This represents the loss function value, used to measure the degree of deviation between the predicted value and the actual value; y represents the model's predicted value; y represents the true label value; δ is a hyperparameter with a default value of 1.0.
[0081] When training the prediction model using the input-output data frame output in step S3, the optimizer used is Adam, the initial learning rate is set to 0.001, and the weight decay coefficient is set to 0.01 to suppress overfitting. The learning rate is adjusted using a cosine annealing strategy with a period of 50 training rounds, so that the learning rate decays periodically according to a cosine curve as the training progresses, balancing the convergence speed and optimization accuracy of the model.
[0082] During the training of the prediction model, if the validation set loss does not decrease for five consecutive training rounds, or if the number of training rounds reaches the preset maximum number of training rounds, then training is stopped. If the above termination conditions are not met, the model parameters and network weights are updated after each iteration, and the next round of training continues until the termination conditions are met.
[0083] S5. After the prediction model is trained, input the historical time series data of the time to be predicted and the real-time feature vector output in step S3 into the prediction model, and the prediction model outputs the prediction result.
[0084] This embodiment can effectively integrate the spatiotemporal correlation of environmental data and production data to accurately and in real time predict the power load of smart parks. It solves the problem that traditional prediction models are difficult to handle the nonlinear time series characteristics of power consumption in parks, and is suitable for high-precision power load prediction in smart parks under multi-source data fusion scenarios.
[0085] Example 2:
[0086] Reference Appendix Figure 2 , 3 This embodiment proposes a smart park electricity load forecasting system, which achieves electricity load forecasting through the smart park electricity load forecasting method described in Embodiment 1.
[0087] This embodiment of a smart park electricity load forecasting system specifically includes:
[0088] The data acquisition module is used to collect electricity consumption data, environmental data, equipment status data, and time-related data for the smart park. Electricity consumption data includes time-series data of current, voltage, and power from the park's main electricity meter and individual meters (air conditioning, lighting, etc.), sampled every 30 minutes. Environmental data includes real-time data on temperature, humidity, wind speed, weather, air quality, PM2.5 index, and carbon dioxide index obtained through meteorological APIs and environmental monitoring equipment. Equipment status data includes equipment start / stop logs and load rates collected by IoT sensors. Time-related data includes holiday markers and weekday / weekend markers.
[0089] The data preprocessing module is used to perform data cleaning and normalization preprocessing operations on the collected data. Specifically, it includes:
[0090] (1) Data cleaning was performed on the collected electricity consumption data, environmental data, equipment status data and time characteristic data. Time series linear interpolation was used to fill in the missing data. Based on the 3σ principle, data points that exceeded the mean ± 3 times the standard deviation were removed.
[0091] (2) First, convert the collected equipment status data and time feature data into One-hot vectors. Then, standardize the collected electricity consumption data, environmental data, equipment status data, and time feature data using Z-score. The formula is as follows: Where x is the original feature value, μ is the mean of the feature, and σ is the standard deviation of the feature.
[0092] The feature processing module evaluates important features based on the preprocessed data, filters out key features, and then reorganizes the data according to three dimensions: time series, feature type, and feature, forming a three-dimensional data table. This table is then transformed into an input-output data frame suitable for supervised learning. The input consists of historical time series data and real-time feature vectors, and the output is the target predicted value. The process of forming the three-dimensional data table specifically includes:
[0093] (1) Construct time-series features and extract the electricity consumption data of the past 24 hours through a sliding window;
[0094] (2) Use the random forest algorithm to evaluate feature importance: train the random forest model and obtain the importance ranking of each feature based on the Gini impurity reduction; calculate the score according to the feature importance score formula (A), set the threshold Ntree=10, and filter and retain the top 10 key features with the highest importance scores.
[0095]
[0096] In the formula, Ij represents the importance score of the j-th feature, which is equal to the average local importance score of all decision trees in the random forest for that feature; Ntree represents the total number of decision trees in the random forest; t represents the t-th decision tree in the random forest. Let represent the local importance value of the j-th feature in the t-th decision tree, calculated using the Gini impurity reduction.
[0097] (3) Based on the key features that are selected and retained, the data is reorganized into a three-dimensional data table according to the three dimensions of time sequence, feature type and feature, and transformed into an input-output data frame suitable for supervised learning, which serves as a single sample of training data; wherein, the time sequence refers to the data collection time points arranged according to the time step.
[0098] The model building and training module is used to build a prediction model, which is a hybrid model that integrates convolutional neural networks (CNN), bidirectional long short-term memory layers (BiLSTM), and multi-head attention mechanisms; it is also used to train the prediction model using the input-output data frames output by the feature processing module.
[0099] The constructed prediction model specifically includes:
[0100] The convolutional neural network (CNN) layer serves as a feature extraction layer. This CNN layer contains two convolutional layers and two pooling layers. Each convolutional layer is equipped with 24 convolutional kernels, corresponding to 24 hours of the day. Data is input cyclically at intervals between each hour.
[0101] The data storage and processing layer has its input end connected to the output end of the convolutional neural network (CNN) layer. It is used to temporarily store the data output by the CNN layer and sort the data output by the CNN layer after the sampling data has been processed in a loop, forming a two-dimensional array sorted according to the sampling time.
[0102] The time series modeling layer, whose input is connected to the output of the data storage and processing layer, includes three bidirectional long short-term memory (BiLSTM) layers stacked in sequence. The three BiLSTM layers increase the model parameter scale through the stacking structure to improve the fitting ability of complex nonlinear relationships and the ability to capture long-term dependencies, thereby realizing the modeling of the time series characteristics of the data.
[0103] The multi-head attention layer has its input connected to the output of the temporal modeling layer and is used to automatically calculate the weighted average of the output of the temporal modeling layer. The multi-head attention layer has 4 attention heads, corresponding to 4 feature types.
[0104] The fully connected layer, whose input is connected to the output of the multi-head attention layer, is used to perform data dimensionality reduction and inverse normalization processing, and output the final prediction result.
[0105] The loss function for the prediction model is set to smoothed mean absolute error (Huber Loss), used to balance mean absolute error and mean squared error. The expression for the loss function is as follows:
[0106]
[0107] In the formula, This represents the loss function value, used to measure the degree of deviation between the predicted value and the actual value; y represents the model's predicted value; y represents the true label value; δ is a hyperparameter with a default value of 1.0.
[0108] When training the prediction model using the input-output data frames output by the feature processing module, the optimizer used is Adam, the initial learning rate is set to 0.001, and the weight decay coefficient is set to 0.01 to suppress overfitting. The learning rate is adjusted using a cosine annealing strategy with a period of 50 training epochs, so that the learning rate decays periodically according to a cosine curve as the training progresses, balancing the convergence speed and optimization accuracy of the model.
[0109] During the training of the prediction model, if the validation set loss does not decrease for five consecutive training rounds, or if the number of training rounds reaches the preset maximum number of training rounds, then training is stopped. If the above termination conditions are not met, the model parameters and network weights are updated after each iteration, and the next round of training continues until the termination conditions are met.
[0110] The prediction model takes the historical time-series data of the time to be predicted and the real-time feature vector output by the feature processing module as input, and outputs the prediction result.
[0111] Example 3:
[0112] This embodiment also provides a smart park power load prediction device, which includes: at least one memory and at least one processor;
[0113] At least one memory is used to store machine-readable programs;
[0114] At least one processor is used to call the machine-readable program to implement the smart park power load prediction method described in Embodiment 1.
[0115] Example 4:
[0116] This embodiment also provides a computer-readable medium storing computer instructions, which, when executed by a processor, can implement the smart park power load prediction method described in Embodiment 1.
[0117] Specifically, a system or apparatus equipped with a storage medium may be provided, on which software program code implementing the functions of any of the embodiments described above is stored, and the computer (or CPU or MPU) of the system or apparatus may read and execute the program code stored in the storage medium.
[0118] In this case, the program code read from the storage medium can itself implement the function of any of the above embodiments, and therefore the program code and the storage medium storing the program code constitute part of the present invention.
[0119] Examples of storage media used to provide program code include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, program code can be downloaded from a server computer via a communication network.
[0120] Furthermore, it should be clear that not only can the program code read by the computer be executed, but also the operating system or other components operating on the computer can be instructed based on the program code to perform some or all of the actual operations, thereby realizing the function of any of the embodiments described above.
[0121] Furthermore, it is understood that the program code read from the storage medium is written to the memory set in the expansion board inserted into the computer or to the memory set in the expansion unit connected to the computer. Then, based on the instructions of the program code, the CPU or other components installed on the expansion board or expansion unit execute some and all of the actual operations, thereby realizing the function of any of the embodiments described above.
[0122] The present invention has been shown and described in detail above with reference to the accompanying drawings and preferred embodiments. However, the present invention is not limited to these disclosed embodiments. Based on the above embodiments, those skilled in the art will know that more embodiments of the present invention can be obtained by combining the code review methods in the different embodiments. These embodiments are also within the protection scope of the present invention.
Claims
1. A method and system for predicting electricity load in a smart industrial park, characterized in that, Includes the following steps: S1. Collect electricity consumption data, environmental data, equipment status data, and time characteristic data of the smart park; S2. Perform data cleaning and data normalization preprocessing operations on the collected data; S3. Based on the preprocessed data, important features are evaluated and key features are selected. Then, the data is reorganized into a three-dimensional data table according to three dimensions: time series, feature type, and feature. The data is then transformed into an input-output data frame suitable for supervised learning. The input consists of historical time series data and real-time feature vectors, and the output is the target prediction value. S4. Construct a prediction model, which is a hybrid model that integrates a convolutional neural network, a bidirectional long short-term memory layer, and a multi-head attention mechanism; train the prediction model using the input-output data frame output in step S3; S5. After the prediction model is trained, input the historical time series data of the time to be predicted and the real-time feature vector output in step S3 into the prediction model, and the prediction model outputs the prediction result.
2. The method for predicting electricity load in a smart park according to claim 1, characterized in that, The electricity consumption data includes the current, voltage, and power time-series data of the park's main electricity meter and individual electricity meters, with a sampling frequency of 30 minutes; The environmental data includes temperature, humidity, wind speed, weather, air quality, PM2.5 index, and carbon dioxide index, which are obtained in real time through meteorological APIs and environmental monitoring equipment. The device status data includes device start / stop logs and load rate collected by IoT sensors; The time-related data includes holiday markers and weekday / weekend markers.
3. The method for predicting electricity load in a smart park according to claim 1, characterized in that, Step S2 specifically includes: S2.
1. Clean the collected electricity consumption data, environmental data, equipment status data and time characteristic data, use time series linear interpolation to fill in missing data, and based on the 3σ principle, remove data points that exceed the mean ± 3 times the standard deviation. S2.2 First, convert the collected equipment status data and time feature data into one-hot vectors. Then, standardize the collected electricity consumption data, environmental data, equipment status data, and time feature data using Z-score, as shown in the formula. Where x is the original feature value, μ is the mean of the feature, and σ is the standard deviation of the feature.
4. The method for predicting electricity load in a smart park according to claim 3, characterized in that, Step S3 specifically includes: S3.1 Construct time-series features and extract electricity consumption data for the past 24 hours through a sliding window; S3.
2. Feature importance assessment using the random forest algorithm: Train the random forest model and obtain the importance ranking of each feature based on the Gini impurity reduction; calculate the score according to the feature importance score formula (A), set the threshold Ntree=10, and filter and retain the top 10 key features with the highest importance scores. In the formula, Ij represents the importance score of the j-th feature, which is equal to the average local importance score of all decision trees in the random forest for that feature; Ntree represents the total number of decision trees in the random forest; t represents the t-th decision tree in the random forest. Let represent the local importance value of the j-th feature in the t-th decision tree, calculated using the Gini impurity reduction. S3.
3. Based on the key features that are selected and retained, the data is reorganized into a three-dimensional data table according to the three dimensions of time sequence, feature type and feature, and transformed into an input-output data frame suitable for supervised learning, which serves as a single sample of training data; wherein, the time sequence refers to the data collection time points arranged according to the time step.
5. The method for predicting electricity load in a smart park according to claim 1, characterized in that, The prediction model specifically includes: The convolutional neural network layer, as a feature extraction layer, contains two convolutional layers and two pooling layers. Each convolutional layer is equipped with 24 convolutional kernels, corresponding to 24 hours of a day. Data is input cyclically at intervals between each hour. The data storage and processing layer has its input end connected to the output end of the convolutional neural network layer. It is used to temporarily store the data output by the convolutional neural network layer and sort the data output by the convolutional neural network layer after the sampling data is processed in a loop, forming a two-dimensional array sorted according to the sampling time. The time series modeling layer, whose input is connected to the output of the data storage and processing layer, includes three bidirectional long short-term memory layers stacked in sequence. The three bidirectional long short-term memory layers increase the model parameter scale through the stacking structure to improve the fitting ability of complex nonlinear relationships and the ability to capture long-term dependencies, thereby realizing the modeling of the time series characteristics of the data. The multi-head attention layer has its input connected to the output of the temporal modeling layer and is used to automatically calculate the weighted average of the output of the temporal modeling layer. The multi-head attention layer has 4 attention heads, corresponding to 4 feature types. The fully connected layer, whose input is connected to the output of the multi-head attention layer, is used to perform data dimensionality reduction and inverse normalization processing, and output the final prediction result.
6. The method for predicting electricity load in a smart park according to claim 5, characterized in that, The loss function of the prediction model is set as the smoothed mean absolute error, used to balance the mean absolute error and the mean squared error. The expression of the loss function is as follows: In the formula, This represents the loss function value, used to measure the degree of deviation between the predicted value and the actual value; y represents the model's predicted value; y represents the true label value. δ is a hyperparameter with a default value of 1.
0.
7. The method for predicting electricity load in a smart park according to claim 5, characterized in that, When executing step S4, the optimization model is trained using the input-output data frame output in step S3. The optimizer used is Adam, the initial learning rate is set to 0.001, and the weight decay coefficient is set to 0.01 to suppress overfitting. The learning rate is adjusted using a cosine annealing strategy with a period of 50 training rounds, so that the learning rate decays periodically according to a cosine curve as the training progresses, balancing the convergence speed and optimization accuracy of the model. During the training of the prediction model, if the validation set loss does not decrease for five consecutive training rounds, or if the number of training rounds reaches the preset maximum number of training rounds, then training is stopped. If the above termination conditions are not met, the model parameters and network weights are updated after each iteration, and the next round of training continues until the termination conditions are met.
8. A smart park electricity load forecasting system, characterized in that, It includes: The data acquisition module is used to collect electricity consumption data, environmental data, equipment status data, and time characteristic data of the smart park. The data preprocessing module is used to perform data cleaning and data normalization preprocessing operations on the collected data; The feature processing module is used to evaluate important features based on the preprocessed data, select key features, and then reorganize the data according to three dimensions: time series, feature type, and feature to form a three-dimensional data table. It is then transformed into an input-output data frame suitable for supervised learning, where the input is historical time series data and real-time feature vectors, and the output is the target prediction value. The model building and training module is used to build a prediction model, which is a hybrid model that integrates a convolutional neural network, a bidirectional long short-term memory layer, and a multi-head attention mechanism; it is also used to train the prediction model using the input-output data frames output by the feature processing module. The prediction model takes the historical time-series data of the time to be predicted and the real-time feature vector output by the feature processing module as input, and outputs the prediction result. The system achieves smart park power load prediction through the method described in any one of claims 1 to 7.
9. A smart park electricity load prediction device, characterized in that, include: At least one memory and at least one processor; The at least one memory is used to store a machine-readable program; The at least one processor is configured to invoke the machine-readable program to implement the method according to any one of claims 1 to 7.
10. A computer-readable medium, characterized in that, The computer-readable medium stores computer instructions that, when executed by a processor, enable the implementation of the method described in any one of claims 1 to 7.