Energy consumption prediction method for discrete manufacturing enterprises based on multi-scale dynamic causal graph neural network

By using a multi-scale dynamic causal graph neural network, the causal relationships between production units are identified and spatiotemporal features are extracted. This solves the problems of difficulty in identifying causal relationships and poor adaptability to dynamic changes in energy consumption prediction for discrete manufacturing enterprises, and achieves accurate prediction of total enterprise energy consumption and improved model interpretability.

CN122491606APending Publication Date: 2026-07-31CHONGQING UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHONGQING UNIV
Filing Date
2026-05-21
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing technologies struggle to identify the true causal relationships between production units in energy consumption prediction for discrete manufacturing enterprises. They also exhibit poor adaptability to dynamic changes and lack sufficient multi-scale spatiotemporal modeling, resulting in insufficient accuracy and interpretability of the prediction models.

Method used

A multi-scale dynamic causal graph neural network is adopted to calculate the causal relationship between production units by transferring entropy, construct short-term, medium-term and static causal graphs, combine attention mechanism to perform graph structure fusion, and extract spatiotemporal features through multi-scale temporal convolution and graph convolution network to predict the total energy consumption of enterprises.

Benefits of technology

It improves the accuracy of causal relationship mining and the interpretability of the model, enhances its adaptability to dynamic production changes, and improves prediction accuracy and feature representation capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122491606A_ABST
    Figure CN122491606A_ABST
Patent Text Reader

Abstract

This invention relates to the field of industrial energy management technology and discloses a method for predicting energy consumption in discrete manufacturing enterprises based on a multi-scale dynamic causal graph neural network. The method involves collecting historical energy consumption data from each production unit of the enterprise to construct a time-series dataset; calculating the causal relationships between production units based on transfer entropy; constructing dynamic causal graphs at short-term and medium-term time scales; and fusing these graphs with a static graph to form a hybrid graph structure. Simultaneously, temporal and spatial features are extracted. Temporal feature extraction employs a multi-head attention mechanism and multi-scale temporal convolution, while spatial feature extraction is based on a Mix-Hop graph convolutional network. A two-stage aggregation prediction module is designed: the first stage learns the contribution weights of each production unit to total energy consumption; the second stage performs weighted feature aggregation based on contribution weights and estimates the total energy consumption features. This invention can model the implicit causal relationships between production units even in the absence of production data, improving the accuracy of total energy consumption prediction and the interpretability of the prediction model for discrete manufacturing enterprises.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial energy management technology, and in particular to a method for predicting energy consumption in discrete manufacturing enterprises based on a multi-scale dynamic causal graph neural network. Background Technology

[0002] Energy consumption forecasting for discrete manufacturing enterprises is crucial for achieving balanced energy supply and demand, reducing manufacturing costs, and promoting green and sustainable development. Especially in the current context of achieving dual-carbon goals and lean energy management, accurate energy consumption forecasting helps enterprises formulate reasonable energy allocation plans and prioritize the energy needs of critical production activities. With the increasing informatization of enterprises, researchers have begun to utilize historical total energy consumption data, employing time series analysis methods such as seasonal decomposition, grey prediction, and wavelet analysis to focus on uncovering the inherent temporal regularities in total energy consumption data. However, this modeling approach, which treats the entire enterprise as a "black box," ignores the heterogeneity and interrelationships between various production units within the enterprise. Therefore, the forecasting model often fails when faced with internal production structure adjustments.

[0003] In practical applications of energy consumption prediction in discrete manufacturing enterprises, existing technologies still face numerous insurmountable challenges. First, causal relationship identification is difficult. Traditional methods, based on graph structures constructed using correlation analysis, cannot effectively distinguish between genuine causal relationships and spurious associations. When production information is incomplete, there is a lack of effective means to directly extract the true causal relationships between production units from energy consumption data, making it difficult for models to accurately reflect the intrinsic mechanisms of the production process. Second, dynamic adaptability is poor. The static graph structures used in existing methods cannot adapt to the dynamic changes in relationships between production units caused by the variability in production tasks and frequent adjustments to production plans in discrete manufacturing enterprises. When production modes switch, the static graph structure becomes a key bottleneck restricting the improvement of prediction accuracy. Finally, multi-scale spatiotemporal modeling is insufficient. Enterprise energy consumption is actually affected by both short-term production disturbances such as equipment start-up and shutdown and process switching, and long-term production cycles such as order cycles and maintenance plans. Existing methods struggle to simultaneously model dependencies and spatial causal relationships across multiple time scales within a unified framework. How to achieve accurate prediction of total enterprise energy consumption using only time-series energy consumption data from each production unit has become an urgent problem to be solved in the fields of industrial energy conservation, carbon reduction, and intelligent manufacturing. Summary of the Invention

[0004] This invention provides a method for predicting the energy consumption of discrete manufacturing enterprises based on a multi-scale dynamic causal graph neural network. The technical problem it solves is: under the condition of incomplete production information, how to identify and model the dynamic causal relationship between production units based only on the time-series energy consumption data of each production unit, so as to achieve accurate prediction of the total energy consumption of discrete manufacturing enterprises and enhance the interpretability of the prediction model.

[0005] This invention provides a method for predicting energy consumption in discrete manufacturing enterprises based on a multi-scale dynamic causal graph neural network, comprising:

[0006] S1. Collect historical time-series energy consumption data of each production unit in discrete manufacturing enterprises and total energy consumption data of enterprises, and standardize them respectively. Then, use a sliding time window to divide the data to construct input and output samples, and use the set of multiple input and output samples as the model training dataset.

[0007] S2. Calculate the strength of causal relationships between production units with multiple lag periods based on transfer entropy, and construct short-term dynamic causal graphs and medium-term dynamic causal graphs by combining the first sliding time window and the second sliding time window respectively, and construct static causal graphs by combining the model training dataset. Use attention mechanism to structurally fuse the short-term dynamic causal graphs, medium-term dynamic causal graphs and static causal graphs to obtain a hybrid causal graph.

[0008] S3. The historical time-series energy consumption data of each production unit in the input and output samples are processed by multi-scale temporal convolution to extract temporal features. Based on the hybrid causal graph, a multi-hop graph convolutional network is used to aggregate neighbor information of the historical time-series energy consumption data of each production unit in the input and output samples to extract spatial features. The temporal features and spatial features are fused to obtain the spatiotemporal fusion features of each production unit.

[0009] S4. Calculate the dynamic contribution weight of the spatiotemporal fusion features of each production unit to the total energy consumption of the enterprise based on the attention mechanism, and then perform weighted aggregation of the spatiotemporal fusion features of each production unit to obtain enterprise-level aggregated features. At the same time, estimate the implicit feature representation of the total energy consumption of the enterprise based on the spatiotemporal fusion features of each production unit. Combine the enterprise-level aggregated features and the implicit feature representation and input them into the prediction network to output the total energy consumption prediction result of the discrete manufacturing enterprise.

[0010] Furthermore, S1 specifically includes:

[0011] S101. Collect historical time-series energy consumption data of each production unit and total energy consumption data of the enterprise in the discrete manufacturing enterprise to construct a multivariate time-series dataset, and extract the historical time-series energy consumption data of each production unit from the multivariate time-series dataset as input features, and use the total energy consumption data of the enterprise as the prediction target.

[0012] S102. The historical time-series energy consumption data of each production unit and the total energy consumption data of the enterprise are standardized respectively. The historical time-series energy consumption data of each production unit after standardization are linearly projected to map to a high-dimensional feature space. Then, a sliding time window is used to divide the data to construct input and output samples. The set of multiple input and output samples is used as the model training dataset.

[0013] Furthermore, S2 specifically includes:

[0014] S201. Calculate the strength of causal relationships between production units in multiple lag periods based on the theory of transfer entropy, so as to identify the causal influence paths between production units.

[0015] S202. Construct a static long-term causal graph using the full historical data in the model training dataset to reflect long-term stable production relations. Calculate the transfer entropy matrix on the full historical data and apply a set threshold for sparsification. Finally, perform normalization to obtain a stable static graph structure.

[0016] S203. For energy consumption change patterns at different time scales, short-term dynamic causal graphs and medium-term dynamic causal graphs are constructed respectively, and graph fusion is performed using adaptive attention weights based on node features to obtain an adaptive fused dynamic causal graph.

[0017] S204. The static graph structure and the adaptive fused dynamic causal graph are co-modeled, and the dynamic and static graph structures are fused through an attention mechanism to form an adaptive hybrid causal graph.

[0018] Furthermore, in S201, the formula for calculating the transfer entropy from branch factory X to branch factory Y is as follows:

[0019]

[0020] in, Represents the probability density function. This indicates that the length of branch factory X is... Historical energy consumption sequence This represents the historical energy consumption sequence of branch plant Y with length k;

[0021] In S202, the matrix dimension of the full historical data is represented as follows: The formula for constructing its static long-term causal graph is:

[0022]

[0023] in, Where N is the time step length of the historical data, N is the number of production units, and F is the feature dimension input for each production unit;

[0024] In S203, the short-term dynamic causal graph and intermediate dynamic cause-effect diagram The calculation formulas are as follows:

[0025]

[0026]

[0027] in, For the first sliding time window, The second sliding time window is used to capture rapid production changes within one hour and to model production cycle patterns within one day, respectively.

[0028] The specific formula for calculating the adaptive attention weights for graph fusion is as follows:

[0029]

[0030]

[0031]

[0032] in, This refers to energy consumption data for the corresponding time window. Let be the node feature matrix at time t, and d be the hidden layer dimension of the node features. This indicates the mean pooling operation. The weight matrix is ​​a learnable matrix. For learnable bias vectors, and Let be a learnable attention weight function, and satisfy... ;

[0033] In S204, the calculation formula for collaborative modeling is as follows:

[0034]

[0035] in, This is a static long-term causal graph. To integrate dynamic cause-effect graphs , It is a learnable static-dynamic balancing weight function.

[0036] Furthermore, S3 specifically includes:

[0037] S301. A multi-head self-attention mechanism is used to capture the long-term time dependency relationship of historical time-series energy consumption data of each production unit in the input and output samples, and the time-series location information is enhanced by location encoding.

[0038] S302. Combining multi-scale temporal convolution, temporal convolution with different dilation rates is used to further process the extracted temporal dependencies in order to capture temporal patterns and periodic patterns of different granularities and obtain temporal features.

[0039] S303. Based on the hybrid causal graph, a Mix-Hop graph convolutional network is used to aggregate multi-hop neighbor information to capture the causal propagation effect between the production units and obtain spatial features.

[0040] S304. An attention mechanism is used to adaptively fuse the extracted temporal and spatial features to form a unified spatiotemporal representation, thereby obtaining the spatiotemporal fusion features of each production unit.

[0041] Furthermore, in S301, the calculation process using the multi-head self-attention mechanism is as follows:

[0042]

[0043]

[0044] Where Q, K, and V are the query matrix, key matrix, and value matrix, respectively. Let be the dimension of the key vector. This represents the hidden layer features of the input sequence. This is the temporal feature representation obtained after extraction using a multi-head attention mechanism;

[0045] In step S302, the formula for calculating temporal convolution with different dilation rates is as follows:

[0046]

[0047] Where * denotes the dilation convolution operation, For the k-th convolutional kernel, For the first The input feature representation of the layer, For the first Output features of layer dilated convolution For activation function, For bias terms;

[0048] In step S303, let the normalized adjacency matrix of the hybrid causal graph be... The specific calculation formula for the multi-hop propagation process of the Mix-Hop graph convolutional network is as follows:

[0049]

[0050]

[0051]

[0052] in, As the initial node feature input, Here, K represents the jump connection weight, and K is the maximum number of hops. Let be the linear transformation matrix of the k-th hop. Let k be the feature representation of the k-th jump. The spatial features obtained after finally aggregating neighbor information of different orders For activation functions;

[0053] In step S304, the specific calculation formula for the adaptive fusion of the temporal features and the spatial features is as follows:

[0054]

[0055]

[0056] Where FC represents a fully connected layer, and [;] represents the feature concatenation operation. For the time feature, For the aforementioned spatial features, The spatiotemporal fusion characteristics of each production unit obtained after adaptive fusion, and These are the corresponding attention weight coefficients calculated using a fully connected layer and a softmax function.

[0057] Furthermore, S4 specifically includes:

[0058] S401. Based on the hybrid causal graph and attention mechanism, learn the dynamic contribution weight of each production unit to the total energy consumption of the enterprise, and perform weighted aggregation of the spatiotemporal fusion features of each production unit according to the dynamic contribution weight to obtain enterprise-level aggregated features.

[0059] S402. Estimate the implicit feature representation of the total energy consumption of the enterprise from the spatiotemporal fusion features of each production unit, fuse the enterprise-level aggregated features with the implicit feature representation, input the fusion into the prediction network composed of multilayer perceptrons, and output the total energy consumption prediction result of the discrete manufacturing enterprise.

[0060] Furthermore, the specific process of obtaining the enterprise-level aggregation feature in S401 is as follows:

[0061] First, attention aggregation is performed on the spatiotemporal fusion features of each production unit, and the calculation formula is as follows:

[0062]

[0063]

[0064] in, This represents the spatiotemporal fusion characteristics of the i-th production unit at time t. For temporal attention weights, Here is the weight matrix for the temporal attention mechanism. Let be the feature representation of the i-th production unit after aggregation along the time dimension; then, the dynamic contribution weights of each production unit are learned through a multilayer perceptron and weighted aggregation is performed, with the calculation formula as follows:

[0065]

[0066]

[0067] in, For contribution learning network, The dynamic contribution weight for the i-th production unit is N, where N is the total number of production units. The enterprise-level aggregation features are obtained after weighted aggregation;

[0068] The specific formula for calculating the total energy consumption prediction result output in S402 is as follows:

[0069]

[0070] in, Corresponding to the enterprise-level aggregation feature, These correspond to the feature representations of each production unit after aggregation along the time dimension. This indicates a feature concatenation operation. A multilayer perceptron is used to learn from the concatenated features to obtain the latent feature representation. It is a fusion function used to combine the enterprise-level aggregated features and the implicit feature representations. For the prediction network, This represents the predicted total energy consumption over a time step t.

[0071] This invention also provides an energy consumption prediction device for discrete manufacturing enterprises based on a multi-scale dynamic causal graph neural network. Based on the energy consumption prediction method for discrete manufacturing enterprises based on a multi-scale dynamic causal graph neural network as described above, the device includes:

[0072] The data acquisition module is used to collect historical time-series energy consumption data of each production unit in discrete manufacturing enterprises and total energy consumption data of the enterprise, and to perform standardization processing on each of them. Then, a sliding time window is used to divide the data to construct input and output samples, and the set of multiple input and output samples is used as the model training dataset.

[0073] The first fusion module is used to calculate the strength of the multi-lag causal relationship between each production unit based on the transfer entropy, and to construct a short-term dynamic causal graph and a medium-term dynamic causal graph by combining the first sliding time window and the second sliding time window respectively, and to construct a static causal graph by combining the model training dataset. The attention mechanism is used to structurally fuse the short-term dynamic causal graph, the medium-term dynamic causal graph and the static causal graph to obtain a hybrid causal graph.

[0074] The second fusion module is used to process the historical time-series energy consumption data of each production unit in the input and output samples through multi-scale temporal convolution to extract temporal features, and to use a multi-hop graph convolutional network based on the hybrid causal graph to aggregate neighbor information of the historical time-series energy consumption data of each production unit in the input and output samples to extract spatial features. The temporal features and spatial features are fused to obtain the spatiotemporal fusion features of each production unit.

[0075] The prediction module is used to calculate the dynamic contribution weight of the spatiotemporal fusion features of each production unit to the total energy consumption of the enterprise based on the attention mechanism, so as to obtain the enterprise-level aggregated features by weighting and aggregating the spatiotemporal fusion features of each production unit. At the same time, the implicit feature representation of the total energy consumption of the enterprise is estimated based on the spatiotemporal fusion features of each production unit. The enterprise-level aggregated features and implicit feature representation are combined and input into the prediction network to output the total energy consumption prediction result of the discrete manufacturing enterprise.

[0076] The present invention also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described method.

[0077] The present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the above-described method.

[0078] The beneficial effects of this invention are as follows:

[0079] 1. Accurate causal relationship mining and high model interpretability: Addressing situations where key information such as process parameters and production plans are missing, this invention employs transfer entropy to construct a causal relationship diagram between branch plants. Compared to traditional static correlation analysis, this method more accurately reflects the actual impact relationships in the production process, effectively solving the problem of mining true causal relationships between production units based solely on energy consumption data, and significantly improving the interpretability of the prediction model.

[0080] 2. Strong multi-scale time modeling capability and good dynamic adaptability: Addressing the problem that existing static modeling methods cannot adapt to dynamically generated energy consumption fluctuations, this invention constructs multi-scale dynamic causal graphs for short-term and medium-term energy consumption change patterns at different time scales. This mechanism can simultaneously capture energy consumption change patterns at different time granularities, greatly enhancing the model's adaptability to the flexible and ever-changing production characteristics of discrete manufacturing enterprises.

[0081] 3. Enhanced spatiotemporal feature fusion and significantly improved feature representation capabilities: This invention designs parallel temporal and spatial feature extraction modules and combines them with an adaptive fusion mechanism, which can fully utilize the temporal dependence patterns and spatial correlation information in the data. This architecture not only avoids the loss of feature information that may be caused by single serial processing, but also significantly enhances the feature representation capabilities, ultimately improving the prediction accuracy of total energy consumption for discrete manufacturing enterprises. Attached Figure Description

[0082] Figure 1 This is a schematic diagram of a method flow according to an embodiment of the present invention.

[0083] Figure 2 This is a schematic diagram of the device structure according to an embodiment of the present invention.

[0084] Figure 3 This is a schematic diagram of the internal structure of a computer device according to an embodiment of the present invention.

[0085] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0086] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0087] This invention employs a multi-scale dynamic causal graph neural network technology driven by transfer entropy. It implicitly solves the problem of missing production information through causal modeling, adapts to dynamic changes in production patterns through the fusion of dynamic and static graphs, and captures multi-scale dependencies through spatiotemporal parallel analysis. This enables accurate prediction of the total energy consumption of discrete manufacturing enterprises and improves the interpretability of the prediction model, providing a scientific basis for energy management of enterprises under conditions of incomplete production information.

[0088] like Figure 1 As shown, this invention provides a method for predicting energy consumption in discrete manufacturing enterprises based on a multi-scale dynamic causal graph neural network, comprising:

[0089] S1. Collect historical time-series energy consumption data of each production unit in the discrete manufacturing enterprise and total energy consumption data of the enterprise, and perform standardization processing respectively. Then, use a sliding time window to divide the data to construct input and output samples, and use the set of multiple input and output samples as the model training dataset.

[0090] In a specific embodiment of the present invention, step S1 includes the following sub-steps:

[0091] S101. Collect historical time-series energy consumption data of each production unit (i.e., each branch plant) in the discrete manufacturing enterprise, and simultaneously collect the enterprise's historical total energy consumption data (i.e., total load) to construct a multivariate time-series dataset. From the multivariate time-series dataset, extract the historical time-series energy consumption data of each production unit (branch plant) as the input features of the model, and use the enterprise's total energy consumption data (total load) as the prediction target of the model.

[0092] S102. In order to eliminate the impact of differences between different production units or data of different dimensions on model training, the energy consumption data of each production unit and the total energy consumption data of the enterprise are standardized respectively; further, the energy consumption data of the production unit (branch plant) is subjected to linear projection transformation and mapped to a high-dimensional feature space to enhance the feature representation capability of the data.

[0093] After standardizing and linearly projecting the data, a sliding time window technique is used to partition the processed time series data, thereby constructing the input and output samples of the time series. By continuously sliding the sliding time window, multiple consecutive input and output samples are obtained, and the set of these multiple input and output samples forms the model training dataset for subsequent graph construction and network training.

[0094] S2. Calculate the strength of causal relationships between production units with multiple lag periods based on transfer entropy, and construct short-term dynamic causal graphs and medium-term dynamic causal graphs by combining the first sliding time window and the second sliding time window respectively, and construct a static causal graph by combining the model training dataset. Use an attention mechanism to structurally fuse the short-term dynamic causal graph, the medium-term dynamic causal graph and the static causal graph to obtain a hybrid causal graph.

[0095] In one specific embodiment of the present invention, step S2 includes the following sub-steps:

[0096] S201, Transfer Entropy Calculation

[0097] The strength of multi-lag causal relationships between production units is calculated based on the theory of transfer entropy to identify the true causal influence paths between production units. The specific formula for calculating the transfer entropy from plant X to plant Y is as follows:

[0098]

[0099] in, Represents the probability density function. This indicates that the length of branch factory X is... Historical energy consumption sequence This represents the historical energy consumption sequence of branch plant Y with length k. This causal modeling can implicitly solve the problem of missing production information. Even when key information such as process parameters is missing, it can mine causal relationships between production units based solely on energy consumption data, thus improving the interpretability of the model.

[0100] S202, Static Graph Construction

[0101] A static causal graph is constructed using historical data to reflect long-term stable production relations. Specifically, a static long-term causal graph is constructed using all historical data from the model training dataset, and its matrix dimension on the full historical data is represented as follows. The formula for constructing a static graph is:

[0102]

[0103] in, Where N is the time step length of the historical data, N is the number of production units (factories), and F is the feature dimension input for each production unit. The construction process of this static long-term causal graph is as follows: First, the transfer entropy matrix TE on the full historical data is calculated. Then, the transfer entropy matrix is ​​sparsified by applying a set threshold. Finally, the sparsified matrix is ​​normalized to obtain a stable static graph structure.

[0104] S203, Construction and Fusion of Multi-Scale Dynamic Graphs

[0105] Short-term dynamic causal graphs were constructed for energy consumption change patterns at different time scales. and intermediate dynamic cause-effect diagram .

[0106] The short-term dynamic causal graph is based on a first sliding time window. The energy consumption data within the system is used to construct the calculation formula: The intermediate-term dynamic causal graph is based on a second sliding time window. The energy consumption data within the system is used to construct the calculation formula: ; and It is used to capture rapid production changes within 1 hour and to model production cycle patterns within 1 day.

[0107] To adapt to dynamically changing energy consumption fluctuations, an adaptive attention weighting method based on node features is used for graph fusion. The specific fusion calculation formula is as follows:

[0108]

[0109]

[0110]

[0111] in, This refers to energy consumption data for the corresponding time window; Let be the node feature matrix at time t, and d be the hidden layer dimension of the node features; This indicates the mean pooling operation; The weight matrix is ​​a learnable matrix. It is a learnable bias vector; and Let be a learnable attention weight function, and satisfy... .

[0112] S204, Collaborative Modeling of Dynamic and Static Diagrams

[0113] The static graph constructed in step S202 by combining historical data The fusion animation that is updated in real time in step S203 (Right now Collaborative modeling is performed, and the specific calculation formula is as follows:

[0114]

[0115] in, The static-dynamic balance weight function is learnable, and by fusing this static and dynamic graph, the model can effectively adapt to the dynamic changes in the production mode of discrete manufacturing enterprises.

[0116] S3. The historical time-series energy consumption data of each production unit in the input and output samples are processed by multi-scale temporal convolution to extract temporal features. Based on the hybrid causal graph, a multi-hop graph convolutional network is used to aggregate neighbor information of the historical time-series energy consumption data of each production unit in the input and output samples to extract spatial features. The temporal features and spatial features are fused to obtain the spatiotemporal fusion features of each production unit.

[0117] In a specific embodiment of the present invention, step S3 includes the following sub-steps:

[0118] S301, Multi-head Temporal Attention Modeling (Temporal Feature Extraction Branch)

[0119] A multi-head self-attention mechanism is employed to capture the long-term temporal dependencies of historical time-series energy consumption data for each production unit in the input and output samples. Simultaneously, location encoding is used to enhance the temporal location information. The calculation process of the multi-head self-attention mechanism is as follows:

[0120]

[0121]

[0122] Where Q, K, and V are the query, key, and value matrices, respectively. The dimension of the key vector; This represents the hidden layer features of the input sequence. This is the temporal feature representation obtained after extraction using a multi-head attention mechanism.

[0123] S302, Multi-scale dilated convolution (temporal feature extraction branch)

[0124] In the temporal feature extraction module, multi-scale temporal convolution is used to further capture temporal patterns and periodic patterns at different granularities. Specifically, temporal convolutions with different dilation rates are used for feature extraction, and the calculation formula is as follows:

[0125]

[0126] Where * denotes the dilation convolution operation, For the k-th convolutional kernel, For the first The input feature representation of the layer, For the first Output features of layer dilated convolution This is the activation function.

[0127] S303, Mix-Hop graph convolution (spatial feature extraction branch)

[0128] Design a spatial feature extraction branch based on the hybrid causal graph constructed in step S2. A Mix-Hop graph convolutional network is employed to aggregate multi-hop neighbor information, aiming to capture the causal propagation effect between production units. This involves a mixed causal graph. The normalized adjacency matrix is The formula for calculating the multi-hop propagation process is:

[0129]

[0130]

[0131]

[0132] in, As the initial node feature input, This is the normalized adjacency matrix corresponding to the final constructed hybrid causal graph. Here, K represents the jump connection weight, and K is the maximum number of hops. Let be the linear transformation matrix of the k-th hop. Let k be the feature representation of the k-th jump. This refers to the spatial features obtained after aggregating neighbor information of different orders.

[0133] S304, Spatiotemporal Feature Adaptive Fusion

[0134] An attention mechanism is employed to adaptively fuse the extracted temporal and spatial features, forming a unified spatiotemporal representation. The specific calculation formula for the fusion process is as follows:

[0135]

[0136]

[0137] Where FC represents a fully connected layer, and [;] represents the feature concatenation operation. As a time feature, For spatial features, The spatiotemporal fusion characteristics of each production unit obtained after adaptive fusion, and These are the corresponding attention weight coefficients calculated using a fully connected layer and a softmax function.

[0138] S4. Calculate the dynamic contribution weight of the spatiotemporal fusion features of each production unit to the total energy consumption of the enterprise based on the attention mechanism, and then perform weighted aggregation of the spatiotemporal fusion features of each production unit to obtain enterprise-level aggregated features. At the same time, estimate the implicit feature representation of the total energy consumption of the enterprise based on the spatiotemporal fusion features of each production unit. Combine the enterprise-level aggregated features and the implicit feature representation and input them into the prediction network to output the total energy consumption prediction result of the discrete manufacturing enterprise.

[0139] In a specific embodiment of the present invention, step S4 includes the following sub-steps:

[0140] S401, Branch Plant Contribution Learning (Phase 1)

[0141] The dynamic contribution weights of each production unit (branch plant) to the enterprise's total energy consumption are learned based on a hybrid causal graph structure and attention mechanism. First, the temporal characteristics of each branch plant (i.e., the spatiotemporal fusion characteristics output in step S3) are analyzed. Attention aggregation is performed, and the specific calculation formula is as follows:

[0142]

[0143]

[0144] in, This represents the spatiotemporal fusion characteristics of the i-th branch factory at time t. For temporal attention weights, Here is the weight matrix for the temporal attention mechanism. This represents the feature representation of the i-th branch factory after aggregation along the time dimension.

[0145] Then, the dynamic contribution weights of each branch factory are learned through a multilayer perceptron, and the features of each branch factory are weighted and aggregated according to the contribution weights. The calculation formula is as follows:

[0146]

[0147]

[0148] in, For contribution learning network, Let N be the contribution weight of the i-th branch factory, and N be the total number of branch factories. This represents the enterprise-level aggregation feature after weighted aggregation.

[0149] S402, Predicted Output (Second Stage)

[0150] While weighted aggregating the spatiotemporal fusion features of each production unit, the implicit feature representation of the enterprise's total energy consumption is estimated from the production unit features. Finally, the aggregated features are fused with the estimated implicit feature representation to output the energy consumption prediction result. The specific calculation formula for the prediction output is as follows:

[0151]

[0152] in, The weighted aggregation features corresponding to all manufacturing units obtained in step S401 ; Timing characteristics corresponding to each branch factory ; Indicates feature concatenation operation; It is a multilayer perceptron used to learn enterprise-level patterns from the features of connected units to obtain an implicit feature representation of total enterprise energy consumption; It is a fusion function used to combine weighted aggregate features and the estimated latent feature representation; For predicting networks; It is the predicted electricity consumption at time step t (i.e., the total energy consumption prediction result of discrete manufacturing enterprises).

[0153] like Figure 2 As shown, the present invention also provides an energy consumption prediction device for discrete manufacturing enterprises based on a multi-scale dynamic causal graph neural network. Based on the energy consumption prediction method for discrete manufacturing enterprises based on a multi-scale dynamic causal graph neural network as described above, the device includes:

[0154] The data acquisition module 1 is used to collect historical time-series energy consumption data of each production unit in the discrete manufacturing enterprise and total energy consumption data of the enterprise, and to perform standardization processing on each of them. Then, a sliding time window is used to divide the data to construct input and output samples, and the set of multiple input and output samples is used as the model training dataset.

[0155] The first fusion module 2 is used to calculate the strength of the multi-lag causal relationship between each production unit based on the transfer entropy, and to construct a short-term dynamic causal graph and a medium-term dynamic causal graph by combining the first sliding time window and the second sliding time window respectively, and to construct a static causal graph by combining the model training dataset. The attention mechanism is used to structurally fuse the short-term dynamic causal graph, the medium-term dynamic causal graph and the static causal graph to obtain a hybrid causal graph.

[0156] The second fusion module 3 is used to process the historical time-series energy consumption data of each production unit in the input and output samples through multi-scale temporal convolution to extract temporal features, and to use a multi-hop graph convolutional network based on the hybrid causal graph to aggregate neighbor information of the historical time-series energy consumption data of each production unit in the input and output samples to extract spatial features. The temporal features and spatial features are fused to obtain the spatiotemporal fusion features of each production unit.

[0157] Prediction module 4 is used to calculate the dynamic contribution weight of the spatiotemporal fusion features of each production unit to the total energy consumption of the enterprise based on the attention mechanism, so as to obtain the enterprise-level aggregated features by weighting and aggregating the spatiotemporal fusion features of each production unit. At the same time, the implicit feature representation of the total energy consumption of the enterprise is estimated based on the spatiotemporal fusion features of each production unit. The enterprise-level aggregated features and implicit feature representation are combined and input into the prediction network to output the total energy consumption prediction result of the discrete manufacturing enterprise.

[0158] Each of the above modules is used to perform the corresponding steps in the discrete manufacturing enterprise energy consumption prediction method based on multi-scale dynamic causal graph neural network. The specific implementation method is as described in the above method embodiment, and will not be repeated here.

[0159] like Figure 3 As shown, the present invention also provides a computer device, which may be a server, and its internal structure may be as follows: Figure 3As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores all the data required for the process of a discrete manufacturing enterprise energy consumption prediction method based on a multi-scale dynamic causal graph neural network. The network interface is used for communication with external terminals via a network connection. The computer program is executed by the processor to implement the discrete manufacturing enterprise energy consumption prediction method based on a multi-scale dynamic causal graph neural network.

[0160] Those skilled in the art will understand that Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer equipment on which the present application is applied.

[0161] An embodiment of this application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements any of the above-described discrete manufacturing enterprise energy consumption prediction methods based on a multi-scale dynamic causal graph neural network.

[0162] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by hardware related to computer program instructions. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the above method embodiments. Any references to memory, storage, databases, or other media provided in this application and used in the embodiments can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM), such as dynamic RAM (used as main storage) or static RAM (commonly used as cache memory). By way of illustration and not limitation, RAM has various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), and Rambus DRAM (RDRAM).

[0163] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, apparatus, article, or method. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, apparatus, article, or method that includes that element.

[0164] The above description is merely a preferred embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A method for energy consumption prediction of discrete manufacturing enterprises based on a multi-scale dynamic causal graph neural network, characterized in that, include: S1. Collect historical time-series energy consumption data of each production unit in discrete manufacturing enterprises and total energy consumption data of enterprises, and standardize them respectively. Then, use a sliding time window to divide the data to construct input and output samples, and use the set of multiple input and output samples as the model training dataset. S2. Calculate the strength of causal relationships between production units with multiple lag periods based on transfer entropy, and construct short-term dynamic causal graphs and medium-term dynamic causal graphs by combining the first sliding time window and the second sliding time window respectively, and construct static causal graphs by combining the model training dataset. Use attention mechanism to structurally fuse the short-term dynamic causal graphs, medium-term dynamic causal graphs and static causal graphs to obtain a hybrid causal graph. S3. The historical time-series energy consumption data of each production unit in the input and output samples are processed by multi-scale temporal convolution to extract temporal features. Based on the hybrid causal graph, a multi-hop graph convolutional network is used to aggregate neighbor information of the historical time-series energy consumption data of each production unit in the input and output samples to extract spatial features. The temporal features and spatial features are fused to obtain the spatiotemporal fusion features of each production unit. S4. Calculate the dynamic contribution weight of the spatiotemporal fusion features of each production unit to the total energy consumption of the enterprise based on the attention mechanism, and then perform weighted aggregation of the spatiotemporal fusion features of each production unit to obtain enterprise-level aggregated features. At the same time, estimate the implicit feature representation of the total energy consumption of the enterprise based on the spatiotemporal fusion features of each production unit. Combine the enterprise-level aggregated features and the implicit feature representation and input them into the prediction network to output the total energy consumption prediction result of the discrete manufacturing enterprise.

2. The method of claim 1, wherein the method further comprises: S1 specifically includes: S101. Collect historical time-series energy consumption data of each production unit and total energy consumption data of the enterprise in the discrete manufacturing enterprise to construct a multivariate time-series dataset, and extract the historical time-series energy consumption data of each production unit from the multivariate time-series dataset as input features, and use the total energy consumption data of the enterprise as the prediction target. S102. The historical time-series energy consumption data of each production unit and the total energy consumption data of the enterprise are standardized respectively. The historical time-series energy consumption data of each production unit after standardization are linearly projected to map to a high-dimensional feature space. Then, a sliding time window is used to divide the data to construct input and output samples. The set of multiple input and output samples is used as the model training dataset.

3. The method of claim 1, wherein the method further comprises: S2 specifically includes: S201. Calculate the strength of causal relationships between production units in multiple lag periods based on the theory of transfer entropy, so as to identify the causal influence paths between production units. S202. Construct a static long-term causal graph using the full historical data in the model training dataset to reflect long-term stable production relations. Calculate the transfer entropy matrix on the full historical data and apply a set threshold for sparsification. Finally, perform normalization to obtain a stable static graph structure. S203. For energy consumption change patterns at different time scales, short-term dynamic causal graphs and medium-term dynamic causal graphs are constructed respectively, and graph fusion is performed using adaptive attention weights based on node features to obtain an adaptive fused dynamic causal graph. S204. The static graph structure and the adaptive fused dynamic causal graph are co-modeled, and the dynamic and static graph structures are fused through an attention mechanism to form an adaptive hybrid causal graph.

4. The method of claim 3, wherein the method further comprises: In S201, the formula for calculating the transfer entropy from branch factory X to branch factory Y is as follows: in, Represents the probability density function. This indicates that the length of branch factory X is... Historical energy consumption sequence This represents the historical energy consumption sequence of branch plant Y with length k; In the S202, the matrix dimension of the full history data is represented as The construction formula of the static long-term causal graph is: in, Where N is the time step length of the historical data, N is the number of production units, and F is the feature dimension input for each production unit; In S203, the short-term dynamic causal graph and intermediate dynamic cause-effect diagram The calculation formulas are as follows: in, For the first sliding time window, The second sliding time window is used to capture rapid production changes within one hour and to model production cycle patterns within one day, respectively. The specific formula for calculating the adaptive attention weights for graph fusion is as follows: in, This refers to energy consumption data for the corresponding time window. Let be the node feature matrix at time t, and d be the hidden layer dimension of the node features. This indicates the mean pooling operation. The weight matrix is ​​a learnable matrix. For learnable bias vectors, and Let be a learnable attention weight function, and satisfy... ; In S204, the calculation formula for collaborative modeling is as follows: in, This is a static long-term causal graph. To integrate dynamic cause-effect graphs , It is a learnable static-dynamic balancing weight function.

5. The method for predicting energy consumption of discrete manufacturing enterprises based on multi-scale dynamic causal graph neural networks according to claim 1, characterized in that, S3 specifically includes: S301. A multi-head self-attention mechanism is used to capture the long-term time dependency relationship of historical time-series energy consumption data of each production unit in the input and output samples, and the time-series location information is enhanced by location encoding. S302. Combine multi-scale temporal convolution and use temporal convolution with different dilation rates to further process the extracted temporal dependencies in order to capture temporal patterns and periodic patterns of different granularities and obtain temporal features. S303. Based on the hybrid causal graph, a Mix-Hop graph convolutional network is used to aggregate multi-hop neighbor information to capture the causal propagation effect between the production units and obtain spatial features. S304. An attention mechanism is used to adaptively fuse the extracted temporal and spatial features to form a unified spatiotemporal representation, thereby obtaining the spatiotemporal fusion features of each production unit.

6. The method for predicting energy consumption of discrete manufacturing enterprises based on multi-scale dynamic causal graph neural networks according to claim 5, characterized in that, In step S301, the calculation process using the multi-head self-attention mechanism is as follows: Where Q, K, and V are the query matrix, key matrix, and value matrix, respectively. Let be the dimension of the key vector. This represents the hidden layer features of the input sequence. This is the temporal feature representation obtained after extraction using a multi-head attention mechanism; In step S302, the formula for calculating temporal convolution with different dilation rates is as follows: Where * denotes the dilation convolution operation, For the k-th convolutional kernel, For the first The input feature representation of the layer, For the first Output features of layer dilated convolution For activation function, For bias terms; In step S303, let the normalized adjacency matrix of the hybrid causal graph be... The specific calculation formula for the multi-hop propagation process of the Mix-Hop graph convolutional network is as follows: in, As the initial node feature input, Here, K represents the jump connection weight, and K is the maximum number of hops. Let be the linear transformation matrix of the k-th hop. Let k be the feature representation of the k-th jump. The spatial features obtained after finally aggregating neighbor information of different orders For activation functions; In step S304, the specific calculation formula for the adaptive fusion of the temporal features and the spatial features is as follows: Where FC represents a fully connected layer, and [;] represents the feature concatenation operation. For the time feature, For the aforementioned spatial features, The spatiotemporal fusion characteristics of each production unit obtained after adaptive fusion, and These are the corresponding attention weight coefficients calculated using a fully connected layer and a softmax function.

7. The method for predicting energy consumption of discrete manufacturing enterprises based on multi-scale dynamic causal graph neural networks according to claim 1, characterized in that, S4 specifically includes: S401. Based on the hybrid causal graph and attention mechanism, learn the dynamic contribution weight of each production unit to the total energy consumption of the enterprise, and perform weighted aggregation of the spatiotemporal fusion features of each production unit according to the dynamic contribution weight to obtain enterprise-level aggregated features. S402. Estimate the implicit feature representation of the total energy consumption of the enterprise from the spatiotemporal fusion features of each production unit, fuse the enterprise-level aggregated features with the implicit feature representation, input the fusion into the prediction network composed of multilayer perceptrons, and output the total energy consumption prediction result of the discrete manufacturing enterprise.

8. The method for predicting energy consumption of discrete manufacturing enterprises based on multi-scale dynamic causal graph neural networks according to claim 7, characterized in that, The specific process for obtaining the enterprise-level aggregation feature in S401 is as follows: First, attention aggregation is performed on the spatiotemporal fusion features of each production unit, and the calculation formula is as follows: in, This represents the spatiotemporal fusion characteristics of the i-th production unit at time t. For temporal attention weights, Here is the weight matrix for the temporal attention mechanism. Let be the feature representation of the i-th production unit after aggregation along the time dimension; then, the dynamic contribution weights of each production unit are learned through a multilayer perceptron and weighted aggregation is performed, with the calculation formula as follows: in, For contribution learning network, The dynamic contribution weight for the i-th production unit is N, where N is the total number of production units. The enterprise-level aggregation features are obtained after weighted aggregation; The specific formula for calculating the total energy consumption prediction result output in S402 is as follows: in, Corresponding to the enterprise-level aggregation feature, These correspond to the feature representations of each production unit after aggregation along the time dimension. This indicates a feature concatenation operation. A multilayer perceptron is used to learn from the concatenated features to obtain the latent feature representation. It is a fusion function used to combine the enterprise-level aggregated features and the implicit feature representations. For the prediction network, This represents the predicted total energy consumption over a time step t.

9. A discrete manufacturing enterprise energy consumption prediction device based on a multi-scale dynamic causal graph neural network, based on the discrete manufacturing enterprise energy consumption prediction method based on a multi-scale dynamic causal graph neural network as described in any one of claims 1 to 8, characterized in that, The device includes: The data acquisition module is used to collect historical time-series energy consumption data of each production unit in discrete manufacturing enterprises and total energy consumption data of the enterprise, and to perform standardization processing on each of them. Then, a sliding time window is used to divide the data to construct input and output samples, and the set of multiple input and output samples is used as the model training dataset. The first fusion module is used to calculate the strength of the multi-lag causal relationship between each production unit based on the transfer entropy, and to construct a short-term dynamic causal graph and a medium-term dynamic causal graph by combining the first sliding time window and the second sliding time window respectively, and to construct a static causal graph by combining the model training dataset. The attention mechanism is used to structurally fuse the short-term dynamic causal graph, the medium-term dynamic causal graph and the static causal graph to obtain a hybrid causal graph. The second fusion module is used to process the historical time-series energy consumption data of each production unit in the input and output samples through multi-scale temporal convolution to extract temporal features, and to use a multi-hop graph convolutional network based on the hybrid causal graph to aggregate neighbor information of the historical time-series energy consumption data of each production unit in the input and output samples to extract spatial features. The temporal features and spatial features are fused to obtain the spatiotemporal fusion features of each production unit. The prediction module is used to calculate the dynamic contribution weight of the spatiotemporal fusion features of each production unit to the total energy consumption of the enterprise based on the attention mechanism, so as to obtain the enterprise-level aggregated features by weighting and aggregating the spatiotemporal fusion features of each production unit. At the same time, the implicit feature representation of the total energy consumption of the enterprise is estimated based on the spatiotemporal fusion features of each production unit. The enterprise-level aggregated features and implicit feature representation are combined and input into the prediction network to output the total energy consumption prediction result of the discrete manufacturing enterprise.

10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 8.