Construction method of industrial park micro-grid energy consumption prediction model and energy consumption prediction method

By constructing feature data sets and using graph neural networks and long-term memory-attention combination model, the problem of low energy consumption prediction accuracy in industrial park microgrids is solved, and higher-precision energy consumption prediction is achieved.

CN120508845APending Publication Date: 2025-08-19SHANGHAI ZHENHUA HEAVY IND
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510587926.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-08
Publication Date
2025-08-19

AI Technical Summary

Technical Problem

The existing microgrid energy consumption prediction methods in industrial parks face complex, variable and highly nonlinear power consumption nodes, have low prediction accuracy and are difficult to meet the high applicability requirements.

Method used

By obtaining the basic data of the power consumption nodes, pre-processing is performed to construct the feature data set, and clustering analysis is performed using a unilateral sliding window and graph neural network, model training is carried out in combination with a long-term and short-term memory-attention combination model to build an energy consumption prediction model.

Benefits of technology

It improves the accuracy and accuracy of the energy consumption prediction of microgrids in industrial parks, and can more accurately predict future energy consumption trends.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120508845A_ABST
    Figure CN120508845A_ABST
Patent Text Reader

Abstract

The invention provides an industrial park micro-grid energy consumption prediction model construction method and an energy consumption prediction method. The construction method comprises the steps that S1, a basic data set is acquired, and the basic data set comprises basic data of power consumption data of each unit time of each power consumption node in a park within preset time; s2, on the basis of the basic data set, a feature data set is constructed, the feature data set comprises feature data of each power utilization node, and clustering analysis is carried out on the feature data set; and S3, performing model training based on a clustering analysis result to obtain an energy consumption prediction model. According to the construction method of the energy consumption prediction model, the accuracy of energy consumption prediction can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of energy management, and in particular to a method for constructing an energy consumption prediction model for an industrial park microgrid and an energy consumption prediction method. Background Art

[0002] Energy production and supply are one of the major challenges facing modern human civilization, particularly in addressing climate change and resource constraints. As the proportion of renewable energy in the global energy mix continues to increase, achieving reliable energy management within a small area has become a pressing issue. In this context, microgrids, as independently operational energy systems, present promising application prospects. The effective operation of microgrid systems relies on accurate forecasting of energy demand from large-scale users within them. Different workshops (power nodes) within industrial parks have distinct electricity consumption characteristics. For example, machining workshops contain a wide variety of equipment, and the instantaneous power consumption during equipment startup and processing is high, resulting in significant load fluctuations and frequent changes in electricity load. Welding workshops have concentrated and highly volatile loads, with peak electricity consumption occurring during periods of high activity. Casting workshops have a stable but high load; stamping workshops experience transient high loads with periodic fluctuations; assembly workshops have relatively low and stable loads; and painting workshops experience periodic high energy consumption. In other words, different power nodes have one or more operating modes, placing high demands on the universality of energy consumption prediction models. However, currently used forecasting methods (including regression analysis and the Autoregressive Integrated Moving Average (ARIMA) model) are typically based on historical data and are suitable for scenarios where energy consumption data has strong regularity and low volatility. For complex, variable, and highly nonlinear energy consumption patterns in industrial parks, forecasting accuracy is low. Summary of the Invention

[0003] In view of this, the present invention provides a method for constructing an energy consumption prediction model for an industrial park microgrid and an energy consumption prediction method, which can improve the accuracy of energy consumption prediction for an industrial park microgrid.

[0004] To solve at least one of the above technical problems, the present invention adopts the following technical solutions:

[0005] A method for constructing an industrial park microgrid energy consumption prediction model according to an embodiment of the present invention includes:

[0006] Step S1, obtaining a basic data set, the basic data set including basic data of power consumption data per unit time of each power node in the park within a preset time;

[0007] Step S2: constructing a feature data set based on the basic data set, the feature data set including feature data of each power consumption node, and performing cluster analysis on the feature data set;

[0008] Step S3: Perform model training based on the results of cluster analysis to obtain an energy consumption prediction model.

[0009] In one embodiment of the present invention, in step S1, after obtaining the basic data of each power consumption node, the basic data is preprocessed to obtain a preprocessed basic data set, and the preprocessing includes supplementing missing values and eliminating abnormal data;

[0010] In step S2, a feature data set is constructed based on the preprocessed basic data set.

[0011] In one embodiment of the present invention, step S2 includes:

[0012] Step S21: Based on the preprocessed basic data set, a single-sided sliding window is used to construct feature data corresponding to each power consumption node to form a feature data set. The feature data corresponding to each power consumption node includes multiple features of the power consumption node in each unit time period.

[0013] Step S22: performing cluster analysis on the feature data set to determine the power consumption type corresponding to each power consumption node.

[0014] In one embodiment of the present invention, the multiple features of each power-consuming node include one or more of timestamp, energy consumption, maximum window energy consumption, standard deviation of window energy consumption, variance of window energy consumption, rate of change of window energy consumption, peak value of window energy consumption, average absolute difference of window energy consumption, mean value of window energy consumption, balance coefficient of window energy consumption, increment of window energy consumption, periodic offset of window energy consumption, sum of window energy consumption, and interquartile range of window energy consumption.

[0015] In one embodiment of the present invention, step S22 includes:

[0016] Step S221: Map multiple feature data to graph nodes corresponding to power consumption nodes respectively;

[0017] Step S222: determining the topological structure of each graph node based on the adjacency matrix, and connecting multiple graph nodes based on the topological structure to form a fully connected graph;

[0018] Step S223: Perform multi-layer graph convolution calculations on each graph node in the fully connected graph based on the graph neural network, so that each graph node fuses the feature information of adjacent graph nodes and generates an embedded representation corresponding to each graph node;

[0019] Step S224: construct a loss function including clustering loss and graph regularization loss based on the embedded representation and the cluster centers of the graph neural network, and update the graph neural network using the gradient descent method based on the loss function to optimize the embedded representation;

[0020] Step S225: Determine the power consumption type of the power consumption node corresponding to each graph node based on the optimized embedded representation.

[0021] In one embodiment of the present invention, step S3 includes:

[0022] Step S31, dividing the feature data set based on electricity usage type;

[0023] Step S32: constructing a training model, and training the training model based on the divided feature data set to obtain an energy consumption prediction model corresponding to the electricity consumption type;

[0024] Among them, the training model is a long short-term memory-attention combination model.

[0025] In one embodiment of the present invention, step S32 includes:

[0026] Step S321: Based on the divided feature data set, a long short-term memory-attention combined model is used to determine the predicted value of energy consumption of each power node;

[0027] Step S322, calculating the value of the cross entropy loss function based on the predicted value of the energy consumption of each power node and the divided feature data set;

[0028] Step S323 , optimizing and updating the model parameters of the long short-term memory-attention combination model according to the value of the cross entropy loss function until the cross entropy loss function converges to obtain an energy consumption prediction model.

[0029] In one embodiment of the present invention, step S321 includes:

[0030] Obtain the hidden state of the feature dataset. The hidden state is calculated based on the time series data of the feature dataset using the long short-term memory-attention combination model.

[0031] Based on the hidden state, the attention weight is calculated using the long short-term memory-attention combination model;

[0032] Calculate the context vector of the hidden state based on the attention weights;

[0033] The context vector of the hidden state is input into the fully connected layer, and the activation function is used to determine the predicted value of the energy consumption of the power node.

[0034] In one embodiment of the present invention, obtaining the hidden state of the feature dataset includes:

[0035] Based on the initial hidden state and memory unit state of the long short-term memory-attention combination model, the forget gate, input gate, and output gate corresponding to the feature dataset are calculated respectively;

[0036] Update the memory cell state based on the forget gate and input gate;

[0037] The hidden state of the feature dataset is calculated based on the updated memory cell state and output gate.

[0038] Another aspect of the present invention provides a method for predicting energy consumption of an industrial park microgrid, comprising:

[0039] Obtaining basic data including power consumption data of each unit time of the power consumption node within a preset time and the power consumption type of the power consumption node;

[0040] An energy consumption prediction model corresponding to the power consumption type of the power consumption node is constructed using the method for constructing an industrial park microgrid energy consumption prediction model as described in any of the above embodiments, and energy consumption prediction data of the power consumption node is obtained based on basic data.

[0041] Another aspect of the present invention provides a device for constructing an industrial park microgrid energy consumption prediction model, comprising:

[0042] A data acquisition module is used to obtain a basic data set, which includes basic data on the power consumption data of each power node in the park within a preset time period per unit time;

[0043] A cluster analysis module is used to construct a feature data set based on the basic data set, the feature data set including the feature data of each power consumption node, and perform cluster analysis on the feature data set;

[0044] The model training module is used to perform model training based on the results of cluster analysis to obtain an energy consumption prediction model.

[0045] Another aspect of the present invention provides an industrial park microgrid energy consumption prediction device, comprising:

[0046] The prediction data acquisition module is used to obtain basic data including the power consumption data of each unit time within a preset time of the power node and the power consumption type of the power node;

[0047] The energy consumption prediction module is used to obtain the energy consumption prediction data of the power node based on the basic data by constructing an energy consumption prediction model corresponding to the power consumption type of the power node using the construction method of the industrial park microgrid energy consumption prediction model as described in any of the above embodiments.

[0048] On the other hand, the present invention provides an electronic device, including a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the above-mentioned method for constructing an industrial park microgrid energy consumption prediction model or energy consumption prediction method.

[0049] On the other hand, the present invention provides a computer-readable storage medium, which stores at least one instruction or at least one program. The at least one instruction or at least one program is loaded and executed by a processor to implement the above-mentioned method for constructing an industrial park microgrid energy consumption prediction model or energy consumption prediction method.

[0050] The above technical solution of the present invention has at least one of the following beneficial effects:

[0051] The construction method according to an embodiment of the present invention constructs a feature dataset based on basic data on the energy consumption of each power-consuming node within a pre-set time period. Cluster analysis is then performed on this feature dataset. Model training based on the results of the cluster analysis significantly improves the accuracy of the trained energy consumption prediction model, enabling accurate prediction of energy consumption in industrial parks.

[0052] According to the energy consumption prediction method of an embodiment of the present invention, by obtaining the basic data of the electricity consumption data of each unit time within a preset time of the power consumption node and the power consumption type of the power consumption node, selecting an energy consumption prediction model corresponding to the power consumption type of the power consumption node, and obtaining the energy consumption prediction data of the power consumption node based on the basic data set, the energy consumption prediction accuracy of the power consumption node can be effectively improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 This is a schematic diagram of an implementation environment provided by an embodiment of the present invention;

[0054] Figure 2 This is a flow chart of a method for constructing an industrial park microgrid energy consumption prediction model provided by one embodiment of the present invention;

[0055] Figure 3 is a flow chart of the steps of constructing a feature data set in one embodiment of the present invention;

[0056] Figure 4 This is a flowchart of the steps for determining the power usage type corresponding to a single node in one embodiment of the present invention;

[0057] Figure 5 is a flow chart of the model training steps in one embodiment of the present invention;

[0058] Figure 6 is a flowchart of the steps of building and training a model in one embodiment of the present invention;

[0059] Figure 7 This is a schematic diagram of the structure of a device for constructing an industrial park microgrid energy consumption prediction model provided by one embodiment of the present invention;

[0060] Figure 8This is a schematic diagram of the structure of an industrial park microgrid energy consumption prediction device provided by one embodiment of the present invention;

[0061] Figure 9 It is a structural diagram of an electronic device provided by one embodiment of the present invention. DETAILED DESCRIPTION

[0062] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions of the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the described embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field are within the scope of protection of the present invention.

[0063] First, a method for predicting energy consumption of an industrial park microgrid according to an embodiment of the present invention is described in detail below with reference to the accompanying drawings.

[0064] Figure 1 A schematic diagram of an implementation environment provided by an embodiment of the present invention is shown. Figure 1 As shown, the environment of this embodiment may include at least one power node 110, at least one smart meter 120 corresponding to the power node 110, and an electronic device 130. The electronic device 130 and each smart meter 120 may be directly or indirectly connected via wireless or wired communication, which is not limited in this embodiment of the present invention.

[0065] The electronic device 130 may be, but is not limited to, various computing devices such as servers, personal computers, laptops, smart phones, tablet computers, and portable wearable devices. The server may be an independent server or a server cluster or distributed system composed of multiple servers. It may also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.

[0066] In an embodiment of the present invention, the smart meter 120 can monitor and obtain basic data including the power consumption data of each unit time within a preset time of the power node 110. The electronic device 130 can construct a basic data set based on the basic data including the power consumption data of each unit time within the preset time of each power node 110, and construct a feature data set based on the basic data set structure and perform cluster analysis on the feature data set, and perform model training based on the results of the cluster analysis to construct an energy consumption prediction model. And using the constructed energy consumption prediction model, based on the basic data of the power consumption data of each unit time within the preset time of the power node 110 and the power consumption type of the power node 110, an energy consumption prediction model corresponding to the power consumption type of the power node 110 is selected to obtain the energy consumption prediction data of the power node 110, thereby improving the energy consumption prediction accuracy of the power node 110.

[0067] It should be noted that Figure 1 It is just an example. Those skilled in the art will understand that although Figure 1 Only two power consumption nodes 110 and two smart meters 120 are shown, but this does not constitute a limitation on the embodiments of the present invention, and more or fewer power consumption nodes 110 and smart meters 120 than shown in the figure may be included.

[0068] The present invention provides an industrial park microgrid energy consumption prediction method, which can be applied to Figure 1 In the electronic device 130.

[0069] The energy consumption prediction method of the industrial park microgrid can include the following steps:

[0070] (1) Obtaining basic data including the power consumption data of each unit time of the power consumption node within a preset time and the power consumption type of the power consumption node.

[0071] In this embodiment, the smart meter 120 can collect basic data on the energy consumption of each unit of electricity from each power node 110 within a preset time period. Specifically, the smart meter 120 can collect energy consumption data from each power node 110 every five minutes within a preset time period. The preset time period can be determined based on actual needs, for example, the past month or the past year, and is not specifically limited in this embodiment.

[0072] In one possible embodiment, after obtaining basic data for each power consumption node 110, the basic data can be preprocessed to obtain preprocessed basic data. This preprocessing includes filling missing values and removing abnormal data. Specifically, missing values can be filled with values from the same time on adjacent dates. When removing abnormal data, if a value differs by more than 50% from the values from the same time on three adjacent dates, the data is removed and replaced with the average value from the same time on the three adjacent dates.

[0073] (2) Using a pre-built energy consumption prediction model corresponding to the power consumption type of the power consumption node, based on the basic data, energy consumption prediction data of the power consumption node is obtained.

[0074] That is to say, the energy consumption prediction method of an embodiment of the present invention obtains the basic data of the power consumption data of each unit time within a preset time of the power consumption node and the power consumption type of the power consumption node, selects an energy consumption prediction model corresponding to the power consumption type of the power consumption node, and obtains the energy consumption prediction data of the power consumption node based on the basic data set, which can effectively improve the energy consumption prediction accuracy of the power consumption node.

[0075] Below, refer to the instruction manual Figure 2 , a detailed description is given of a method for constructing an industrial park microgrid energy consumption prediction model according to an embodiment of the present invention.

[0076] Figure 2 The figure shows the process of constructing a method for predicting energy consumption of an industrial park microgrid provided by an embodiment of the present invention. Figure 2 As shown, the method may include the following steps:

[0077] Step S1: Obtain a basic data set, where the basic data set includes basic data on power consumption data per unit time of each power-consuming node in the park within a preset time.

[0078] In this embodiment, a smart meter can collect basic data on the energy consumption of each unit of electricity at each power-consuming node within a preset time period to form a basic data set. Specifically, the smart meter can collect energy consumption data for each power-consuming node every five minutes within a preset time period. The preset time period can be determined based on actual needs, for example, the past month or the past year, and is not specifically limited in this embodiment.

[0079] In one possible embodiment, after obtaining basic data for each electricity consumption node, the basic data can be preprocessed to obtain a preprocessed basic data set. This preprocessing includes filling in missing values and removing abnormal data. Specifically, missing values can be filled with values from the same time on adjacent dates. When removing abnormal data, if a value differs by more than 50% from the values from the same time on three adjacent dates, the data is removed and replaced with the average value from the same time on the three adjacent dates.

[0080] Accordingly, in the following step S2, a feature dataset may be constructed based on the preprocessed basic dataset.

[0081] Step S2: constructing a feature data set based on the basic data set, the feature data set including feature data of each power consumption node, and performing cluster analysis on the feature data set.

[0082] In the embodiment of the present invention, feature data corresponding to each power consumption node may be constructed based on the basic data set to form a feature data set, and cluster analysis may be performed on the feature data set to determine the power consumption type of each power consumption node.

[0083] In one possible embodiment, the Figure 3 , the step S2 may include:

[0084] Step S21: Based on the preprocessed basic data set, a unilateral sliding window is used to construct feature data corresponding to each power consumption node to form a feature data set. The feature data corresponding to each power consumption node includes multiple features of the power consumption node in each unit time period.

[0085] In this embodiment, based on the preprocessed basic data set, a unilateral sliding window can be used to slide in a time series with a preset step size to extract the energy consumption data of the power consumption node in the corresponding time period to construct the characteristic data corresponding to the unit time of each power consumption node, thereby forming a characteristic data set. Among them, the preset step size can be 13. In the case where the smart meter collects the energy consumption data of the power consumption node every five minutes, the energy consumption data of the power consumption node within a one-hour period starting from a certain moment can be extracted. Of course, the preset step size can be determined according to actual needs, for example, it can be an odd number such as 13, 15, 17, etc., and the embodiment of the present invention does not impose specific restrictions on this.

[0086] In one possible embodiment, the multiple features of each power consumption node may include one or more of timestamp, energy consumption, window energy consumption maximum value, window energy consumption standard deviation, window energy consumption variance, window energy consumption change rate, window energy consumption peak value, window energy consumption average absolute difference, window energy consumption mean, window energy consumption balance coefficient, window energy consumption increment, window energy consumption cycle offset, window energy consumption sum, and window energy consumption interquartile range. Specifically, the power consumption characteristics of power consumption nodes in different operating modes are different, and the feature data of each power consumption node can be constructed in a targeted manner based on the different pre-divided operating modes. For example, for power consumption nodes with high instantaneous power and large load fluctuations during the startup and processing of multiple devices, the power consumption node can be constructed to calculate the maximum value, standard deviation, variance and change rate characteristic values within the window. For power consumption nodes with concentrated and large fluctuations in load, the power consumption node can be constructed to calculate the window content peak value and average absolute deviation characteristic values. For power consumption nodes with stable but high loads, the mean value and smoothing coefficient characteristic values within the window can be constructed to calculate. For power nodes with transient high loads and periodic fluctuations, characteristic values for calculating increments and periodic offsets can be constructed. For power nodes with relatively low and stable loads, characteristic values for calculating sums and interquartile ranges can be constructed. The constructed characteristics can be determined based on actual needs and are not specifically limited in this embodiment of the present invention.

[0087] Step S22: performing cluster analysis on the feature data set to determine the power consumption type corresponding to each power consumption node.

[0088] In this embodiment, cluster analysis can be further performed on the feature dataset to determine the similarities in the behavior patterns or energy consumption characteristics of each power-consuming node, thereby classifying different types of power consumption. Through this cluster analysis process, power-consuming nodes with similar characteristics can be grouped into the same category, thereby achieving preliminary attribution and classification of power consumption behavior, laying the foundation for the subsequent construction of a more targeted energy consumption prediction model.

[0089] In one possible embodiment, the Figure 4 , the step S22 may include:

[0090] Step S221: Map multiple feature data into graph nodes corresponding to electricity consumption nodes respectively.

[0091] In this embodiment, a high-order feature vector X can be defined for each power consumption node per unit time based on the feature data set. The high-order feature vector X = {x1 timestamp, energy consumption, x2 window energy consumption maximum value, x3 window energy consumption standard deviation, x4 window energy consumption variance, x5 window energy consumption change rate, x6 window energy consumption peak value, x7 window energy consumption average absolute difference, x8 window energy consumption mean, x9 window energy consumption balance coefficient, x10 window energy consumption increment, x11 window energy consumption cycle offset, x12 window energy consumption sum, x13 window energy consumption interquartile range}. Then, the high-order feature vector corresponding to each power consumption node is mapped to n graph nodes corresponding to the power consumption node. Each graph node carries its corresponding feature information, which can provide a basis for subsequent graph neural network processing.

[0092] Step S222: Determine the topological structure of each graph node based on the adjacency matrix, and connect multiple graph nodes based on the topological structure to form a fully connected graph.

[0093] In this embodiment, an adjacency matrix A can be calculated based on the similarity between the feature vectors of each node (such as Euclidean distance or cosine similarity). The adjacency matrix A represents the connection relationship between each graph node. The adjacency matrix A defines the connectivity and weight information between nodes and can be used to describe the topological structure between each graph node. Then, all graph nodes can be connected to each other, and the weights can be taken as the similarity values to form a weighted fully connected graph.

[0094] Step S223: Perform multi-layer graph convolution calculations on each graph node in the fully connected graph based on the graph neural network, so that each graph node fuses the feature information of adjacent graph nodes and generates an embedded representation corresponding to each graph node.

[0095] In this embodiment, the graph convolution layer of the graph neural network can be used to combine the graph structure of the fully connected graph and the node features of the graph nodes, and data embedding can be achieved through the message passing mechanism. Each layer of graph convolution calculation updates the features of the graph nodes to a linear combination of its own features and the features of the neighboring graph nodes. Specifically, l layers of graph convolution (GCN) modules can be stacked in sequence, and each layer performs a linear transformation on the graph node features through the normalized adjacency matrix and aggregates and activates them with the features of the neighboring graph nodes, so that the new representation of each graph node absorbs the information of the surrounding graph nodes layer by layer. The definition formula of the graph convolution layer is:

[0096]

[0097] in, is the adjacency matrix after adding self-loops, and I is the identity matrix; yes The degree matrix of (l) Represents the node feature matrix of the lth layer, the initial layer H (0) =X;W(l) represents the weight matrix of the lth layer; σ is the activation function. After the lth layer of graph convolution, each graph node obtains the embedded representation at the lth layer:

[0098] Z=H (L)

[0099] Step S224: Construct a loss function including clustering loss and graph regularization loss based on the embedded representation and the cluster centers of the graph neural network, and update the graph neural network through the gradient descent method based on the loss function to optimize the embedded representation.

[0100] In this embodiment, after completing multi-layer graph convolution calculations and generating node embedding representations, the cluster centers and graph neural network parameters can be jointly optimized to ensure that the embedding space simultaneously satisfies both intra-cluster compactness and graph structural consistency. Specifically, a loss function can be constructed that includes dual constraints: a clustering loss and a graph Laplacian regularization term. The clustering loss assigns each node embedding to a cluster center, while the graph Laplacian regularization term ensures that adjacent nodes in the original graph maintain similarity in the embedding space, thereby preserving local structure.

[0101] Specifically, the clustering loss formula can adopt the classic K-means objective form to minimize the Euclidean distance between the embedded point and the cluster center. The cluster center set is:

[0102]

[0103] Among them, K is the preset total number of clusters, μ K is the vector of the kth cluster center. At this time, in order to make the embedded point close to the center of the cluster to which it belongs and improve the similarity within the cluster, the clustering loss formula can be:

[0104]

[0105] Where N is the total number of nodes, z i is the embedding representation of the i-th node, μ K The dimension of the node embedding z i Similarly, in order to force connected nodes to be similar in the embedding space, preserve the local structure of the graph, and avoid the embedding space destroying the topological association between the original features, the graph Laplace regularization term formula can be:

[0106]

[0107] Among them, A ij is the connection weight between node i and node j in the adjacency matrix, z i is the embedding representation of node i, z j is the embedding representation of node j. Then we can calculate the joint loss function of clustering loss and graph regularization loss. The calculation formula of the joint loss function is:

[0108] L total =L reg +λL cluster

[0109] Among them, λ is a balancing hyperparameter that can be determined through cross-validation or empirical tuning and is used to adjust the strength of graph structure constraints.

[0110] Then, parameter optimization can be performed based on the joint loss function. During the parameter optimization process, the weights of the graph convolution layer and the cluster centers {μ K} to achieve collaborative optimization of embedding representation and clustering results. Specifically, forward propagation can be performed first to calculate the node embedding representation of the graph neural network based on the current weight matrix. At this time, the characteristics of each node have been integrated with its neighborhood topology information. Then, the joint loss L is calculated by combining the embedding space and the preset cluster center. total , and perform back propagation, and calculate the loss by chain rule on the weights of the graph convolution layer and the cluster center {μ K} and update the parameters using gradient descent. This process needs to be iterated until the joint loss function converges or the preset optimization rounds are reached. Ultimately, the embedding representation generated by the graph neural network can capture the relationship between node features and graph structure, while ensuring that the cluster division guided by the cluster center is topologically consistent with the original data.

[0111] Step S225: Determine the power consumption type of the power consumption node corresponding to each graph node based on the optimized embedded representation.

[0112] In this embodiment, nodes can be assigned to corresponding clusters using the nearest neighbor criterion based on the distance between the node embedding and the cluster center, generating hard classification labels. Subsequently, semantic analysis is performed based on the raw energy consumption characteristics of the nodes within each cluster (such as mean, peak, and volatility statistics) to define meaningful power consumption type labels for each cluster, such as "high-energy stable" or "low-energy volatile." The final output is a structured mapping table containing node IDs, cluster numbers, and power consumption type descriptions, thereby determining the power consumption type of the power consumption node corresponding to each graph node.

[0113] Step S3: Perform model training based on the results of cluster analysis to obtain an energy consumption prediction model.

[0114] In this embodiment, after determining the power consumption type of each power node, since the energy consumption characteristics of each type of power node are different, model training can be performed separately for different power consumption types to obtain energy consumption prediction models corresponding to each power consumption type, so as to improve the accuracy of the prediction and the generalization ability of the model. Figure 5 , the step S3 may include:

[0115] Step S31 : dividing the feature data set based on electricity usage type.

[0116] In this embodiment, samples belonging to the same electricity usage type in the feature dataset can be grouped into a subset, thereby obtaining multiple sub-datasets corresponding to different electricity usage types. The filtered dataset is then randomly divided into 20% as a test feature dataset and 80% as a training feature dataset to ensure consistent energy consumption data distribution across different time dimensions.

[0117] Step S32: construct a training model, and perform model training on the training model based on the divided feature data set to obtain an energy consumption prediction model corresponding to the electricity consumption type.

[0118] In this embodiment, the training model is a combined long-short-term memory and attention model. This model can further enhance the perception of key time steps while considering temporal characteristics, thereby more accurately predicting future energy consumption. The training model can be trained using a training set and tested using a test set, thereby obtaining an energy consumption prediction model corresponding to the electricity usage type.

[0119] In one possible embodiment, the Figure 6 , the step S32 may include:

[0120] Step S321: Based on the divided feature data set, the long short-term memory-attention combination model is used to determine the predicted value of the energy consumption of each power node.

[0121] In this embodiment, the hidden state of the feature dataset can be first obtained. The hidden state is calculated based on the time series data of the feature dataset using a long short-term memory-attention combined model. Subsequently, the attention weight can be calculated based on the hidden state using the long short-term memory-attention combined model. Based on the attention weight, a context vector for the hidden state can be calculated. Finally, the hidden state context vector is input into a fully connected layer, and an activation function is used to determine the predicted energy consumption value of the power node.

[0122] Specifically, the initial hidden state h0 and memory unit state c0 can be set for the long short-term memory-attention combination model. The initial hidden state h0 and memory unit state c0 can be set by random initialization. Then the normalized training feature dataset X is input into the long short-term memory-attention combination model, where the training feature dataset X = [x1, x2, ..., x n ]. Specifically, for each time step t of the training feature dataset X, the long short-term memory-attention combination model receives the current input x tAt the same time, combined with the hidden state h of the previous time step t-1 and the memory cell state c t-1 Calculate the forget gate, input gate, and output gate corresponding to the training feature data set. t The calculation formula is:

[0123] f t =σ(W f ·[h t-1 ,x t ]+b f )

[0124] Among them, W f and b f is the weight matrix and bias of the forget gate, σ is the Sigmoid activation function. Then, calculate the input gate, input gate i t The calculation formula is:

[0125] i t =σ(W i ·[h t-1 ,x t ]+b i )

[0126] Among them, W i and b i is the weight matrix and bias of the input gate. Then, the output gate is calculated, which determines the output of the hidden state and the contribution of the current memory cell state. Output gate o t The calculation formula is:

[0127] o t =σ(W o ·[h t-1 ,x t ]+b o )

[0128] Among them, W o and b o Is the weight matrix and bias of the output gate. At the same time, the candidate memory unit can be calculated based on the current input and the hidden state of the previous time step. The candidate memory unit can be used to update the intermediate calculation results of the current memory unit state. Candidate memory unit state The calculation formula is:

[0129]

[0130] Among them, W c and b c is the weight matrix and bias of the candidate memory state, and tanh is the hyperbolic tangent activation function. Then, the memory cell state c can be updated based on the forget gate, input gate, candidate memory cell state, and memory cell state at the previous time step.t , memory cell state c t The calculation formula is:

[0131]

[0132] Then, the hidden state h of the feature dataset can be calculated based on the updated memory cell state and output gate t , h t The calculation formula is:.

[0133] h t =o t *tanh(c t )

[0134] The above process can be performed once for all time steps of the input sequence to obtain the hidden state sequence {h1,h2,…,h T The hidden state sequence can then be input into the attention layer of the LSTM-Attention combination model to generate the normalized attention weight α t Specifically, we can firstly t and the weight matrix W a Calculate the attention score e t , attention score e t The calculation formula is:

[0135] e t =tanh(W a ·h t )

[0136] Then, based on the attention score e t Perform probability distribution calculation to obtain attention weight α t , attention weight α t The calculation formula is:

[0137]

[0138] in, is the attention score e t The transpose of , c is the context vector, is the attention score e t The inner product of the context vector c, the denominator It is the sum of the attention scores of all time steps after exponentialization, which can be used for normalization.

[0139] Then, the context vector c of the hidden state can be calculated by weighted summation based on the attention weights. The calculation formula of the context vector c is:

[0140]

[0141] Finally, the context vector c of the hidden state can be input into the fully connected layer, and the activation function can be used to determine the predicted value of the energy consumption of the power node, and the predicted value of the energy consumption of the power node for each hour in the future can be calculated. For example, the energy consumption prediction value can be 1 hour, 3 hours, 6 hours, 12 hours and 24 hours.

[0142] Step S322 , calculating the value of the cross entropy loss function according to the predicted value of the energy consumption of each power node and the divided feature data set.

[0143] In this embodiment, in order to measure the difference between the energy consumption prediction value output by the model and the actual energy consumption, the cross-entropy loss function can be used to calculate the error of each prediction value. Specifically, based on the difference between the predicted value of the energy consumption of each power node and the actual energy consumption of each power node, the cross-entropy loss function value can be calculated to quantify the prediction performance of the model. The cross-entropy loss function can effectively measure the degree of closeness between the probability distribution output by the model and the true distribution, and can improve the accuracy of the prediction. During the optimization process, the Adam optimization algorithm can be used to iteratively update the model parameters in combination with the prediction error reflected by the cross-entropy loss function, thereby improving the model's energy consumption prediction accuracy for various types of power nodes at different time scales.

[0144] Step S323 , optimizing and updating the model parameters of the long short-term memory-attention combination model according to the value of the cross entropy loss function until the cross entropy loss function converges to obtain an energy consumption prediction model.

[0145] In this embodiment, during each round of training, the model continuously adjusts internal weights to gradually reduce the cross-entropy loss function until it converges to a set threshold or stable range, thereby completing the optimal solution process for model parameters. Ultimately, a short-term energy consumption prediction model applicable to the current power node category is obtained, enabling accurate prediction of energy consumption trends at multiple future timescales.

[0146] In one possible embodiment, after the training is completed, the test set can be used as test sample data to test the prediction performance of the trained energy consumption prediction model, evaluate the performance of the energy consumption prediction model, and perform 5-fold cross-validation until the training is completed when the trained energy consumption prediction model meets the preset accuracy conditions, thereby obtaining a reliable prediction model that can be used to predict the future power consumption of power nodes.

[0147] In summary, the construction method of the present invention constructs a feature dataset based on the energy consumption data of each power-consuming node within a preset time period, and then performs cluster analysis on the feature dataset. Model training based on the results of cluster analysis significantly improves the prediction accuracy of the trained energy consumption prediction model, enabling accurate prediction of energy consumption in industrial parks.

[0148] Reference Manual Figure 7 , which shows the structure of a device 700 for constructing an industrial park microgrid energy consumption prediction model provided by an embodiment of the present invention. Figure 7 As shown, the apparatus 700 may include:

[0149] The data acquisition module 710 is used to acquire a basic data set, which includes basic data on the power consumption data of each power node in the park within a preset time period per unit time;

[0150] The cluster analysis module 720 is used to construct a feature data set based on the basic data set, the feature data set including feature data of each power node, and perform cluster analysis on the feature data set;

[0151] The model training module 730 is used to perform model training based on the results of cluster analysis to obtain an energy consumption prediction model.

[0152] Reference Manual Figure 8 , which shows the structure of an industrial park microgrid energy consumption prediction device provided by an embodiment of the present invention. Figure 8 As shown, the apparatus 800 may include:

[0153] The prediction data acquisition module 810 is used to acquire basic data including the power consumption data of each unit time of the power node within a preset time and the power consumption type of the power node;

[0154] The energy consumption prediction module 820 is used to obtain the energy consumption prediction data of the power node based on the basic data by constructing an energy consumption prediction model corresponding to the power consumption type of the power node using the construction method of the industrial park microgrid energy consumption prediction model as described in any of the above embodiments.

[0155] On the other hand, the present invention provides an electronic device, including a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the above-mentioned method for constructing an industrial park microgrid energy consumption prediction model or energy consumption prediction method.

[0156] In a specific embodiment, Figure 9 The hardware structure diagram of an electronic device 130 is shown. The electronic device 130 is used to implement the method for constructing an industrial park microgrid energy consumption prediction model and / or the energy consumption prediction method provided in the embodiment of the present invention. The electronic device 130 can be, but is not limited to, various servers, personal computers, laptops, smart phones, tablet computers, portable wearable devices, etc. Figure 9As shown, the electronic device 130 may include one or more computer-readable storage media memories 1310, one or more processing core processors 1320, an input unit 1330, a display unit 1340, a radio frequency (RF) circuit 1350, a wireless fidelity (WiFi) module 1360, and a power supply 1370. Those skilled in the art will understand that Figure 9 The electronic device structure shown in the figure does not constitute a limitation on the electronic device 130, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0157] The memory 1310 can be used to store software programs and modules. The processor 1320 executes various functional applications and data processing by running or executing the software programs and modules stored in the memory 1310 and accessing data stored in the memory 1310. The memory 1310 may mainly include a program storage area and a data storage area. The program storage area may store an operating system, at least one application required for a function, etc.; the data storage area may store data created based on the use of the electronic device, etc. In addition, the memory 1310 may include high-speed random access memory and non-volatile memory, such as a hard disk, internal memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a flash card, at least one disk storage device, a flash memory device, or other volatile solid-state storage device. Accordingly, the memory 1310 may also include a memory controller to provide the processor 1320 with access to the memory 1310.

[0158] The processor 1320 is the control center of the electronic device 130. It connects the various parts of the entire electronic device using various interfaces and lines. By running or executing software programs and / or modules stored in the memory 1310 and calling data stored in the memory 1310, it performs various functions of the electronic device 130 and processes data, thereby monitoring the entire electronic device 130. The processor 1320 can be a central processing unit, or other general-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, etc. The general-purpose processor can be a microprocessor or any conventional processor.

[0159] The input unit 1330 may be configured to receive input digital or character information and generate keyboard, mouse, joystick, optical, or trackball signal input related to user settings and function control. Specifically, the input unit 1330 may include a touch-sensitive surface 1331 and other input devices 1332. Specifically, the touch-sensitive surface 1331 may include, but is not limited to, a touchpad or a touch screen, and the other input devices 1332 may include, but are not limited to, one or more of a physical keyboard, function keys (such as a volume control button, an on / off button, etc.), a trackball, a mouse, a joystick, and the like.

[0160] The display unit 1340 can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of the electronic device. These graphical user interfaces can be composed of graphics, text, icons, videos, or any combination thereof. The display unit 1340 may include a display panel 1341. Optionally, the display panel 1341 can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.

[0161] The RF circuit 1350 can be used to receive and send signals during information transmission or calls. In particular, after receiving downlink information from the base station, it is handed over to one or more processors 1320 for processing; in addition, uplink data is sent to the base station. Generally, the RF circuit 1350 includes but is not limited to an antenna, at least one amplifier, a tuner, one or more oscillators, a subscriber identity module (SIM) card, a transceiver, a coupler, a low noise amplifier (LNA), a duplexer, etc. In addition, the RF circuit 1350 can also communicate with the network and other devices via wireless communication. The wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile Communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), etc.

[0162] WiFi is a short-range wireless transmission technology. The electronic device 130 can help users send and receive emails, browse web pages, and access streaming media through the WiFi module 1360. It provides users with wireless broadband Internet access. Figure 9 A WiFi module 1360 is shown, but it is understandable that it is not an essential component of the electronic device 130 and can be omitted as needed without changing the essence of the invention.

[0163] The electronic device 130 also includes a power supply 1370 (e.g., a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 1320 via a power management system, thereby enabling the power management system to manage charging, discharging, and power consumption. The power supply 1370 can also include one or more DC or AC power supplies, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and other arbitrary components.

[0164] It should be noted that, although not shown, the electronic device 130 may further include a Bluetooth module, etc., which will not be described in detail here.

[0165] On the other hand, the present invention provides a computer-readable storage medium, which stores at least one instruction or at least one program. The at least one instruction or at least one program is loaded and executed by a processor to implement the above-mentioned method for constructing an industrial park microgrid energy consumption prediction model or energy consumption prediction method.

[0166] Unless otherwise defined, the technical or scientific terms used in the present invention shall have the usual meanings understood by persons of ordinary skill in the field to which the present invention belongs. The words "first", "second" and similar terms used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. Similarly, words such as "one" or "a" do not indicate a quantity limitation, but rather indicate the existence of at least one. Words such as "connected" or "connected" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the object being described changes, the relative positional relationship also changes accordingly.

[0167] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.

Claims

1. A method for constructing an energy consumption prediction model for an industrial park microgrid, characterized in that: include: Step S1, obtaining a basic data set, wherein the basic data set includes basic data of power consumption data per unit time of each power node in the park within a preset time; Step S2: constructing a feature data set based on the basic data set, wherein the feature data set includes feature data of each power consumption node, and performing cluster analysis on the feature data set; Step S3: performing model training based on the results of the cluster analysis to obtain the energy consumption prediction model.

2. The method according to claim 1, characterized in that In step S1, after obtaining the basic data of each power consumption node, the basic data is preprocessed to obtain a preprocessed basic data set, wherein the preprocessing includes supplementing missing values and eliminating abnormal data; Wherein, in the step S2, a feature data set is constructed based on the preprocessed basic data set.

3. The method according to claim 2, characterized in that The step S2 comprises: Step S21: Based on the preprocessed basic data set, a unilateral sliding window is used to construct feature data corresponding to each power consumption node to form a feature data set, wherein the feature data corresponding to each power consumption node includes multiple features of the power consumption node in each unit time period; Step S22: performing cluster analysis on the characteristic data set to determine the power consumption type corresponding to each power consumption node.

4. The method according to claim 3, characterized in that The multiple features of each power-consuming node include one or more of timestamp, energy consumption, maximum window energy consumption, standard deviation of window energy consumption, variance of window energy consumption, rate of change of window energy consumption, peak value of window energy consumption, average absolute difference of window energy consumption, mean value of window energy consumption, balance coefficient of window energy consumption, increment of window energy consumption, periodic offset of window energy consumption, sum of window energy consumption, and interquartile range of window energy consumption.

5. The method according to claim 3, characterized in that The step S22 includes: Step S221: Map the plurality of characteristic data into graph nodes corresponding to the electricity consumption nodes respectively; Step S222: determining a topological structure of each of the graph nodes based on the adjacency matrix, and connecting multiple graph nodes based on the topological structure to form a fully connected graph; Step S223: performing multi-layer graph convolution calculations on each of the graph nodes in the fully connected graph based on a graph neural network, so that each graph node fuses feature information of adjacent graph nodes, and generates an embedded representation corresponding to each graph node; Step S224: constructing a loss function including clustering loss and graph regularization loss based on the embedding representation and the cluster centers of the graph neural network, and updating the graph neural network by gradient descent based on the loss function to optimize the embedding representation; Step S225: Determine the electricity consumption type of the electricity consumption node corresponding to each of the graph nodes based on the optimized embedded representation.

6. The method according to claim 5, characterized in that The step S3 comprises: Step S31, dividing the feature data set based on the electricity usage type; Step S32: constructing a training model, and performing model training on the training model based on the divided feature data set to obtain the energy consumption prediction model corresponding to the electricity consumption type; Wherein, the training model is a long-short-term memory-attention combination model.

7. The method according to claim 6, characterized in that The step S32 includes: Step S321: Based on the divided feature data set, the long short-term memory-attention combined model is used to determine the predicted value of the energy consumption of each power node; Step S322, calculating a value of a cross entropy loss function according to the predicted value of the energy consumption of each power-consuming node and the divided feature data set; Step S323: Optimize and update the model parameters of the long short-term memory-attention combination model according to the value of the cross entropy loss function until the cross entropy loss function converges to obtain the energy consumption prediction model.

8. The method according to claim 7, characterized in that The step S321 includes: Obtaining a hidden state of the feature data set, where the hidden state is calculated based on time series data of the feature data set using the long short-term memory-attention combination model; Based on the hidden state, an attention weight is calculated using the long short-term memory-attention combination model; Calculating a context vector for the hidden state based on the attention weight; The context vector of the hidden state is input into a fully connected layer, and an activation function is used to determine a predicted value of the energy consumption of the power node.

9. The method according to claim 8, characterized in that The obtaining of the hidden state of the feature data set includes: Calculating the forget gate, input gate, and output gate corresponding to the feature data set based on the initial hidden state and memory unit state of the long short-term memory-attention combination model; Update the memory unit state based on the forget gate and the input gate; The hidden state of the feature data set is calculated based on the updated memory cell state and the output gate.

10. A method for predicting energy consumption of an industrial park microgrid, characterized in that: include: Obtaining basic data including power consumption data of each unit time of a power consumption node within a preset time and the power consumption type of the power consumption node; The energy consumption prediction data of the power consumption node is obtained based on the basic data using the energy consumption prediction model corresponding to the power consumption type of the power consumption node constructed by the method according to any one of claims 1 to 9.