An industry power consumption prediction method and system, and a storage medium
By combining Fourier period, wavelet period, and prior period with a two-dimensional convolutional neural network, the problems of lag and insufficient extreme value fitting in long program sequence prediction of traditional models are solved. This enables high-accuracy prediction of electricity consumption in the intelligent manufacturing industry, has anti-interference capabilities, and reduces economic losses in market transactions.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUAQIAO UNIVERSITY
- Filing Date
- 2026-06-12
- Publication Date
- 2026-07-14
AI Technical Summary
Traditional machine learning and deep learning prediction models lack the ability to model long-term time-series dependencies when dealing with long-range complex sequences, making it difficult to capture deep evolution patterns. Furthermore, they are prone to failure when faced with sudden shutdowns in the field of smart manufacturing and abnormal electricity consumption data caused by sensor failures, resulting in lagging prediction results and insufficient extreme value fitting, leading to economic losses for industry users in electricity market transactions.
A sliding window mechanism is used to segment time series data. Fourier period extraction, wavelet period extraction and prior period extraction are combined, and features are extracted through a two-dimensional convolutional neural network. A confidence gating mechanism of spectral entropy is introduced to dynamically adjust weight parameters to deal with data anomalies. A three-channel period detection mechanism is constructed to capture multi-scale evolution patterns.
It achieves highly accurate prediction of industry electricity consumption, possesses high robustness and anti-interference capabilities, effectively reduces market deviation assessment costs, and improves prediction accuracy and economic benefits.
Smart Images

Figure CN122393970A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data reasoning and prediction, and in particular to a method, system and storage medium for predicting electricity consumption in an industry. Background Technology
[0002] Under the current electricity market trading mechanism, industry users typically need to declare their expected electricity purchase volume for a future period to the electricity sales company or electricity trading center in advance when participating in market-based electricity purchases. If the industry can accurately predict its future electricity demand, it can formulate a more reasonable electricity purchase strategy when signing electricity purchase contracts, effectively avoiding high market deviation assessment fees due to actual electricity consumption deviating significantly from the declared amount, thereby significantly reducing the industry's overall electricity purchase costs.
[0003] Traditional machine learning and classic deep learning prediction models (such as ARIMA and LSTM) are often limited by their narrow local receptive fields when dealing with long-range complex sequences. They lack the ability to model long-term time-series dependencies and cannot fully capture the deep evolution patterns in long-distance historical data. The prediction results are prone to serious lag and underfitting of extreme points, which leads to economic losses for industry users in electricity market transactions due to prediction bias.
[0004] Furthermore, for various industries in the field of intelligent manufacturing, real industrial sites are often accompanied by sudden shutdowns, power rationing, or sensor failures, which can cause abnormal distortions such as a precipitous drop in electricity consumption data or irregular random characters, easily leading to the collapse of the overall prediction model.
[0005] In view of this, the present invention has conducted in-depth research on the above-mentioned problems, resulting in this case. Summary of the Invention
[0006] The purpose of this invention is to provide an industry electricity consumption forecasting method with relatively high prediction accuracy and high robustness and anti-interference ability when facing extremely abnormal and distorted data.
[0007] To achieve the above objectives, the present invention provides the following technical solution: A method for forecasting industry electricity consumption includes the following steps: S1, Data Acquisition: Collect historical daily electricity consumption data and corresponding historical daily meteorological characteristic data of the target industry, and preprocess the historical daily electricity consumption data and the historical daily meteorological characteristic data to obtain time series data; S2, Sample construction: The time series data is divided into multiple fixed-length input samples using a sliding window mechanism, and each fixed-length input sample is divided into a training set and a test set according to the time order. S3, Period Extraction: Fourier period extraction, wavelet period extraction, and prior period extraction are performed on the training set to obtain global long period, local short period, and prior period. At the same time, the spectral entropy corresponding to the frequency domain energy distribution obtained in the Fourier period extraction process and the scale energy distribution obtained in the wavelet period extraction process is calculated respectively. S4, Periodic Fusion: The time series data is converted into two-dimensional tensors according to the lengths of the global long period, the local short period, and the prior period, respectively. A two-dimensional convolutional neural network is used to extract deep features from each of the two-dimensional tensors to obtain corresponding periodic features. Simultaneously, the spectral entropy of each periodic feature is converted into a confidence penalty factor. A set of learnable weight parameters corresponding to each periodic feature is initialized. The learnable weight parameters are multiplied element-wise with the confidence penalty factor to obtain updated weight parameters. The updated weight parameters are then normalized to obtain normalized weight coefficients for each periodic feature. Finally, the periodic features are weighted and fused to output the fused features. S5, Prediction Output: The fused features are processed by residual connection through a multi-layer time-series feature extraction module to obtain the predicted daily electricity consumption value for the target industry in the next preset number of days.
[0008] As an improvement of the present invention, in step S1, the preprocessing includes outlier detection and removal, missing value imputation and normalization processes performed sequentially.
[0009] As an improvement of the present invention, in step S3, the specific method for Fourier period extraction is as follows: a discrete Fourier transform is performed on each of the fixed-length input samples in the training set to obtain a complex sequence in the frequency domain, and then the amplitude of each frequency component in the frequency domain is calculated. ,in, and Let f represent the real and imaginary parts of the frequency domain complex sequence, respectively, and f be the corresponding frequency index. Then, the amplitudes are sorted in descending order, and the k highest amplitude frequency indices are selected. Finally, the global long period corresponding to each frequency is calculated based on the inverse relationship between period and frequency. , where L is the length of the fixed-length input sample.
[0010] As an improvement of the present invention, in step S3, the amplitude of each frequency component in the frequency domain is normalized to obtain the frequency domain energy probability distribution P(f), and then the spectral entropy Hf of the Fourier period is calculated according to the formula Hf=-Σ P(f)×log P(f).
[0011] As an improvement of the present invention, in step S3, the specific method for wavelet period extraction is as follows: The Moray wavelet function is selected as the basis function of the continuous wavelet transform; the global average energy E(a) = (1 / L)×Σ|W(a,b)|² corresponding to each scale parameter in the Moray wavelet function is calculated; the top k scale parameters with the highest energy are selected; and the local short period corresponding to each scale parameter is calculated based on the center frequency fc of the selected Moray wavelet basis function. .
[0012] As an improvement of the present invention, in step S3, the energy corresponding to each scale parameter is normalized to obtain the scale energy probability distribution P(a), and then the spectral entropy Hw of the wavelet period is calculated according to the formula Hw=-Σ P(a)×log P(a).
[0013] As an improvement of the present invention, in step S4, a negative exponential decay function is used. and The spectral entropy Hf of the Fourier period and the spectral entropy Hw of the wavelet period are transformed into confidence penalty factors Cf and Cw for the corresponding periodic features, where α is a preset decay rate hyperparameter and e is a natural constant.
[0014] An industry electricity consumption forecasting system includes: The data acquisition module is used to collect historical daily electricity consumption data and corresponding historical daily meteorological characteristic data of the target industry, and to preprocess the historical daily electricity consumption data and the historical daily meteorological characteristic data to obtain time series data. The sample construction module is used to divide the time series data into multiple fixed-length input samples using a sliding window mechanism, and to divide each fixed-length input sample into a training set and a test set in chronological order. The period extraction module is used to perform Fourier period extraction, wavelet period extraction and prior period extraction on the training set respectively to obtain global long period, local short period and prior period, and to calculate the spectral entropy corresponding to the frequency domain energy distribution obtained in the Fourier period extraction process and the scale energy distribution obtained in the wavelet period extraction process respectively. The periodic fusion module is used to convert the time series data into two-dimensional tensors according to the lengths of the global long period, the local short period, and the prior period, respectively. It then uses a two-dimensional convolutional neural network to perform deep feature extraction on each of the two-dimensional tensors to obtain corresponding periodic features. Simultaneously, it converts the spectral entropy of each periodic feature into a confidence penalty factor, initializes a set of learnable weight parameters corresponding to each periodic feature, dynamically masks and constrains the learnable weight parameters using the confidence penalty factor to obtain updated weight parameters, normalizes the updated weight parameters to obtain normalized weight coefficients for each periodic feature, and finally performs weighted fusion on the periodic features to output fused features. The prediction output module is used to perform residual connection processing on the fused features through a multi-layer time-series feature extraction module to obtain the predicted daily electricity consumption value of the target industry for the next preset number of days.
[0015] As an improvement of the present invention, the periodic extraction module includes: The Fourier period extraction unit is used to calculate the amplitude of the frequency components through Fourier transform, select the global long period corresponding to the high amplitude frequency, and calculate the spectral entropy of the frequency domain energy distribution. The wavelet period extraction unit is used to calculate the global average energy of parameters at each scale using continuous wavelet transform with Moray wavelets as the basis function, select the local short periods corresponding to high-energy scales, and calculate the spectral entropy of the scale energy distribution; and The prior period extraction unit is used to inject the inherent calendar rhythm features of human society as prior periods.
[0016] A storage medium storing a computer program for causing a computer to execute the aforementioned industry electricity consumption forecasting method.
[0017] By adopting the above technical solution, the present invention has the following beneficial effects: 1. This invention constructs a three-channel period discovery mechanism by simultaneously employing three period extraction methods. It can capture global long-term trends through the Fourier period extraction channel, capture local high-frequency short-term fluctuations through the wavelet period extraction channel, and inject prior knowledge such as calendar rhythms through the prior period extraction channel. Then, through period fusion, the three work together to comprehensively and accurately identify the multi-scale evolution patterns nested in industry electricity consumption data. This avoids the collapse of the prediction model due to abnormal distortions such as precipitous drops or irregular random characters in electricity consumption data. The prediction accuracy is relatively high, and it has high robustness and anti-interference ability when facing extremely abnormal and distorted data.
[0018] 2. This invention dynamically allocates the fusion weights of each periodic feature through normalization processing, which can automatically adjust the focus of key periods according to the electricity consumption characteristics of different industries. Compared with simple splicing or averaging operations, it significantly improves the effectiveness and prediction accuracy of multi-scale feature fusion.
[0019] 3. This invention reshapes a one-dimensional time series into a two-dimensional tensor and then uses a two-dimensional convolutional neural network for feature extraction, enabling the model to simultaneously capture high-frequency local fluctuations within a period and low-frequency global evolution trends between periods, effectively alleviating the problems of prediction lag and inadequate extreme value fitting of traditional prediction models on complex non-stationary sequences.
[0020] 4. This invention addresses the data distortion caused by extreme downtime and equipment failures that are prone to occur in intelligent manufacturing environments. It introduces a confidence-based gating mechanism based on spectral entropy at the multi-scale periodic fusion front-end. When data experiences a precipitous drop, this invention can calculate the disorder of frequency domain and scale energy distribution in real time. Once data distortion causing an abnormal surge in spectral entropy is detected, the gating mechanism instantly weakens the fusion weights of purely data-driven channels through a penalty factor, forcing the model to adaptively rely on anti-interference prior periodic channels for prediction. This mechanism endows the model with powerful anomaly self-healing capabilities, completely solving the technical challenge of data discrepancies during multi-channel feature fusion.
[0021] 5. This invention can provide accurate electricity consumption forecast data for the industry in electricity market transactions, help enterprises to formulate reasonable electricity purchase strategies, effectively reduce market deviation assessment costs caused by forecast deviations, and has significant economic benefits and practical value. Attached Figure Description
[0022] Figure 1 This is a flowchart of the industry electricity consumption forecasting method in the embodiments; Figure 2 This is a flowchart of the periodic extraction process in the embodiment; Figure 3 This is a flowchart of periodic fusion in the embodiment. Detailed Implementation
[0023] The present invention will be further described below with reference to the accompanying drawings and specific embodiments.
[0024] This embodiment provides a method for predicting electricity consumption in an industry. The specific industry can be selected according to actual needs. In this embodiment, the intelligent manufacturing industry is used as an example. The intelligent manufacturing industry can specifically include textile industry, footwear manufacturing industry, food processing industry, or stone machinery manufacturing industry, etc.
[0025] like Figure 1 As shown, the industry electricity consumption forecasting method provided in this embodiment includes the following steps: S1, Data Acquisition: Collect historical daily electricity consumption data and corresponding historical daily meteorological characteristics data of the target industry (i.e., the intelligent manufacturing industry). The historical daily meteorological characteristics data include the daily maximum temperature, daily minimum temperature, daily average humidity, and daily rainfall. The time span of data acquisition is preferably no less than 4 years, and the sampling frequency is at the daily level.
[0026] The historical data of daily electricity consumption and historical data of daily meteorological characteristics are then preprocessed. The specific preprocessing method can be determined according to actual needs. In this embodiment, the preprocessing includes outlier detection and removal, missing value imputation and normalization.
[0027] Preferably, in this embodiment, the outlier detection and removal process employs a multidimensional anomaly detection method based on the nearest neighbor algorithm. Specifically, the multidimensional dataset containing historical daily electricity consumption data and historical daily meteorological characteristic data is used, with Manhattan distance as the similarity metric between samples. For any two multidimensional data points x and y, the Manhattan distance is calculated using the following formula: , where n is the total dimension of the input features and i is the index variable of the feature dimension. After calculating the distance between all sample points, for any data point in the dataset, the top 5 neighboring data points with the smallest spatial distance are selected to construct a local neighborhood. The average distance between each data point and its 5 nearest neighbors is calculated as a quantitative indicator of the degree of anomaly. When the average distance exceeds the preset anomaly distance threshold, the data point is determined to be an anomalous outlier and is removed.
[0028] Preferably, in this embodiment, the missing value imputation processing adopts a linear imputation algorithm. Specifically, assuming that in a continuous time series, the data observation value at time t is missing, and the nearest valid observation points before and after the missing breakpoint are located at time t1 and time t2 respectively, and their corresponding real recorded data are x(t1) and x(t2) respectively, then the imputation value of the missing time t can be calculated using the following formula: x(t) = x(t1) + [x(t2) - x(t1)] × (t - t1) / (t2-t1).
[0029] Preferably, in this embodiment, the normalization process employs the max-min normalization method to eliminate dimensional differences between multi-source features. Specifically, daily electricity consumption and corresponding meteorological features such as daily maximum temperature, daily minimum temperature, daily average humidity, and daily rainfall are used as feature variables. Let the maximum value of a certain feature variable in its historical data sequence be max, and the minimum value be min. For any observed value v in this sequence, its normalized value is: v' = (v - min) / (max - min). After this processing, the data range of all input features is uniformly mapped to the interval [0,1].
[0030] After preprocessing, time series data with multidimensional characteristics are obtained, including electricity consumption time series data and meteorological time series data.
[0031] S2, Sample Construction: A sliding window mechanism is used to divide the time series data into multiple fixed-length input samples. These fixed-length input samples are then divided into training and test sets according to chronological order. The training set is used for iterative training of the model's internal network parameters and adaptive dynamic updating of the normalized weight coefficients. The test set is used for verifying the prediction accuracy after model training and evaluating its generalization ability under extreme conditions and data distortion scenarios. In this embodiment, the specific sample construction method is as follows: a historical backtracking window length T is set, preferably 96 days, using multivariate features from the past three months as input. Simultaneously, a prediction window length H is set, preferably 30 days, predicting electricity consumption for the next month. The window slides forward one fixed step along the time axis each time, sequentially dividing the original long time series data into multiple fixed-length input samples. The specific length of each fixed-length input sample can be determined according to actual needs. Then, the dataset composed of these fixed-length input samples is divided into training and test sets according to chronological order. In this embodiment, the first 80% of the data on the time axis is designated as the training set, and the last 20% as the test set.
[0032] S3, periodic extraction, such as Figure 2 As shown, Fourier period extraction, wavelet period extraction, and prior period extraction are performed on the electricity consumption time series data in the training set to obtain global long period, local short period, and prior period. This forms three independent period extraction channels for multi-scale period identification, namely, three-channel period discovery, namely Fourier period extraction channel, wavelet period extraction channel, and prior period extraction channel. At the same time, the spectral entropy corresponding to the frequency domain energy distribution obtained in the Fourier period extraction process and the scale energy distribution obtained in the wavelet period extraction process are calculated to quantify the degree of data anomaly distortion of the current time series segment.
[0033] Fourier periodicity extraction is used to capture the macroscopic and global periodic evolution trend in electricity consumption data in the smart manufacturing industry. It maps the time series to the frequency domain using a Fast Fourier Transform (FFT) and calculates the amplitude of each frequency component. The global long period corresponding to the k frequency components with the highest amplitude is selected, where k is a preset hyperparameter representing the number of periods. Specifically, the method involves performing a Discrete Fourier Transform on the electricity consumption time series data in a fixed-length input sample of length L in the training set, transforming it to the frequency domain to obtain a complex frequency sequence X(f). Then, the amplitude of each frequency component in the frequency domain is calculated according to the formula. ,in, and Let f represent the real and imaginary parts of the complex number sequence in the frequency domain, respectively, and f be the corresponding frequency index. Then, the amplitudes are sorted in descending order, and the k highest amplitude frequency indices are selected. Since the period length is inversely proportional to the frequency, the global long period corresponding to each frequency can be calculated based on this inverse relationship. Where L is the length of the fixed-length input sample, it should be noted that since k frequencies are selected, the corresponding global long period There are also k. At the same time, the amplitude of each frequency component in the frequency domain is normalized to obtain the frequency domain energy probability distribution P(f), and then the spectral entropy Hf of the Fourier period is calculated according to the formula Hf=-Σ P(f)×log P(f), which is used to quantify the confidence of the global long period.
[0034] Wavelet period extraction is used to compensate for the shortcomings of Fourier transform in perceiving time locality, accurately capturing local high-frequency fluctuations caused by short-term operating condition changes. It performs time-frequency localization analysis on the time series using continuous wavelet transform and calculates the global average energy corresponding to each scale parameter. The local short periods corresponding to the k scale parameters with the highest energy are selected. Specifically, the Moray wavelet function is used as the basis function for the continuous wavelet transform. The input time series is subjected to continuous wavelet transform to obtain wavelet coefficients W(a,b), where a is the scale parameter and b is the translation time parameter. Then, the global average energy E(a) = (1 / L)×Σ|W(a,b)|² corresponding to each scale parameter in the Moray wavelet function is calculated. The k scale parameters with the highest energy are selected, and the local short periods corresponding to each scale parameter are calculated based on the center frequency fc of the selected Moray wavelet basis function. It should be noted that, due to the selection of k scale parameters, the corresponding local short periods There are also k. At the same time, the energy corresponding to each scale parameter is normalized to obtain the scale energy probability distribution P(a), and then the spectral entropy Hw of the wavelet period is calculated according to the formula Hw=-Σ P(a)×log P(a), which is used to quantify the confidence of local short periods.
[0035] Prior cycle extraction directly incorporates the inherent calendar rhythms of human society as strong prior knowledge to obtain prior cycles representing fixed work-rest patterns. The specific number of prior cycles can be determined according to actual needs, but there must be at least two, including a weekly cycle of 7 days and a daily cycle of 24 hours. This prior cycle can bypass mathematical transformations and directly participate in subsequent tensor reshaping and feature extraction as a fixed cycle length. This effectively compensates for the deficiency of purely data-driven methods that may miss basic calendar patterns when faced with strong noise interference.
[0036] S4, Periodic fusion, this periodic fusion is an adaptive fusion of multi-period features, such as Figure 3As shown, tensor reshaping from one-dimensional to two-dimensional is performed according to the lengths of each global long period, each local short period, and each prior period obtained in the previous step. This converts the electricity consumption time series data in the training set into two-dimensional tensors; that is, the number of two-dimensional tensors corresponds to the number of periods obtained in step S3. Specifically, for any period p, the corresponding number of folded rows is calculated, and zeros are padded at the end of the sequence to make the total length an integer multiple of p. Then, it is folded and converted into a two-dimensional tensor. In this way, the periodic correlation of the one-dimensional time series can be accurately transformed into the row and column adjacency relationship in two-dimensional space.
[0037] After completing the two-dimensional tensor reshaping, the model network is iteratively trained. Specifically, the corresponding periodic features are obtained by performing deep feature extraction on each two-dimensional tensor through a two-dimensional convolutional neural network. With the help of the spatial sliding calculation of the two-dimensional convolutional neural network, the high-frequency local fluctuations within a single period and the low-frequency global evolution trend between different periods can be captured simultaneously.
[0038] To integrate deep features across different periodic scales and address potential data inconsistencies between multi-channel features under extreme conditions, this embodiment introduces a confidence gating mechanism based on spectral entropy. Specifically, each spectral entropy is converted into a confidence penalty factor for the corresponding periodic feature. It should be noted that the correspondence between spectral entropy and periodic features is as follows: the spectral entropy Hf of the Fourier period corresponds to each global long period, and the spectral entropy Hw of the wavelet period corresponds to each local short period. In other words, each periodic feature corresponds to a periodic extraction channel. Alternatively, it can be described as converting each spectral entropy into a confidence penalty factor for the corresponding periodic extraction channel. Preferably, in this embodiment, a negative exponential decay function is used. and The spectral entropy Hf of the Fourier period and the spectral entropy Hw of the wavelet period are transformed into confidence penalty factors Cf and Cw for the corresponding periodic features. Here, α is a preset decay rate hyperparameter, and e is a natural constant. The setting of the decay rate hyperparameter α can be dynamically adjusted according to the signal-to-noise ratio of the target industry dataset. The signal-to-noise ratio of the target industry dataset is obtained by performing time-series decomposition on the historical data of the training set (such as using the conventional moving average decomposition method), calculating and extracting the total variance of the trend and periodic signal components and the variance of the residual noise component after removing the signal, and taking the ratio of the total variance to the variance of the residual noise component as the signal-to-noise ratio of the dataset. The larger the noise value, the larger α should be to improve the sensitivity to abnormal distortion, and vice versa.
[0039] Next, the set of periodic features consisting of global long-period features extracted by the Fourier periodic extraction channel, local short-period features extracted by the wavelet periodic extraction channel, and prior calendar periodic features extracted by the prior periodic extraction channel are taken as a total of k periodic features. For the extracted total of k periodic features, a set of learnable weight parameters {w1, w2, ..., wk} corresponding to each periodic feature is initialized. Then, the learnable weight parameters are multiplied element-wise with the confidence penalty factor C to obtain updated weight parameters. The confidence penalty factor is used to dynamically mask and constrain the learnable weight parameters. Then, the updated weight parameters are processed by the Softmax normalization function to obtain the normalized weight coefficients of each periodic feature. Finally, the periodic features are weighted and fused, that is, the linear weighted sum of each periodic feature is calculated using the normalized weight coefficients to obtain the final output fused feature.
[0040] During the iterative training of the model network, the final output fused features are input into the model network to obtain the predicted electricity consumption value. This predicted value is then compared with the actual daily electricity consumption labels in the training set. The mean squared error (MSE) is calculated to obtain the model's prediction error. The normalized weight coefficients are adaptively and dynamically updated based on the prediction error using the backpropagation algorithm. The confidence penalty factor C, acting as a forward hard constraint based on physical laws, controls the weights of each extracted channel (or corresponding periodic feature) in real time. When abnormal distortion of data in a certain channel causes a surge in spectral entropy H, the confidence penalty factor C rapidly approaches 0. The gating mechanism adaptively masks the weight of that channel, causing the model to automatically shift its focus to the prior periodic channel, thereby effectively suppressing the interference of the distorted period.
[0041] After the model network is trained iteratively, the industry electricity consumption prediction model is obtained. To more clearly describe the model training process, the specific training steps are summarized as follows: (1) Forward propagation stage: The training set samples after preprocessing and sample construction are input into the network, and the corresponding daily electricity consumption prediction value is calculated by sequentially passing through three-channel period discovery, two-dimensional tensor reshaping, multi-period feature adaptive fusion, multi-layer temporal feature extraction and fully connected layer mapping.
[0042] (2) Loss calculation stage: Substitute the predicted daily electricity consumption value and the corresponding real daily electricity consumption label in the training set into the mean square error (MSE) loss function, calculate the overall deviation between the two, and obtain the predicted loss value of the current iteration round.
[0043] (3) Backpropagation and parameter update stage: Based on the predicted loss value, the gradient of each layer parameter in the network is calculated by backpropagation algorithm, and the preset optimizer (such as Adam optimizer) is used to adaptively and dynamically update the multi-layer temporal feature extraction module, the fully connected layer and all learnable network parameters in the adaptive fusion process.
[0044] (4) Convergence determination stage: Repeat the above forward propagation stage, loss calculation stage and back propagation and parameter update stage to iterate and train the network parameters repeatedly until the preset maximum number of iterations or the loss value converges to the preset error threshold. Stop training, lock and save all current network parameters, and obtain the trained industry electricity consumption prediction model.
[0045] (5) Testing and Validation Phase: After the model network has completed iterative training, fixed-length input samples from the test set are input into the trained model. The period extraction and period fusion methods mentioned above are used to calculate and generate corresponding confidence penalty factors to control the fusion weights in real time, and the corresponding test set prediction values are output by the fully connected layer. Then, by comparing the predicted values of the test set with the real daily electricity consumption labels in the test set, evaluation indicators such as mean squared error (MSE) and mean absolute error (MAE) are calculated to verify and evaluate the model's prediction accuracy, ability to cope with abnormal distorted data, and generalization robustness in extreme intelligent manufacturing scenarios.
[0046] S5, Prediction Output: The fused features are processed by residual connections through a multi-layer temporal feature extraction module to obtain the predicted daily electricity consumption for the target industry for a preset number of days in the future. This predicted daily electricity consumption is output through a fully connected layer. The loss function of the industry electricity consumption prediction model is the mean squared error (MSE). The network parameters are continuously updated through a backpropagation algorithm, and the optimization objective is to minimize the overall deviation between the predicted value and the true value.
[0047] It should be noted that the aforementioned multi-layer temporal feature extraction module and fully connected layer are both modules in the model network. The multi-layer temporal feature extraction module consists of multiple stacked two-dimensional convolutional blocks with residual connections. It is used to receive the fused features output by the multi-period feature adaptive fusion module and perform deep nonlinear spatiotemporal feature extraction on them to obtain a high-dimensional abstract representation. The fully connected layer, as a regression mapping network layer set after the multi-layer temporal feature extraction module, is used to linearly map the feature vector output by the multi-layer temporal feature extraction module and flattened to a preset target prediction dimension, thereby outputting the predicted daily electricity consumption value of the target industry for the next preset number of days.
[0048] This embodiment also provides an industry electricity consumption forecasting system, including a data acquisition module, a sample construction module, a periodic extraction module, a periodic fusion module, and a forecast output module.
[0049] The data acquisition module is used to collect historical daily electricity consumption data and corresponding historical daily meteorological characteristic data of the target industry, and to preprocess the historical daily electricity consumption data and the historical daily meteorological characteristic data to obtain time series data.
[0050] The sample construction module is used to divide the time series data into multiple fixed-length input samples using a sliding window mechanism, and to divide each fixed-length input sample into a training set and a test set in chronological order.
[0051] The period extraction module is used to perform Fourier period extraction, wavelet period extraction and prior period extraction on the training set respectively to obtain global long period, local short period and prior period, and to calculate the spectral entropy corresponding to the frequency domain energy distribution obtained in the Fourier period extraction process and the scale energy distribution obtained in the wavelet period extraction process respectively.
[0052] Preferably, in this embodiment, the period extraction module includes a Fourier period extraction unit, a wavelet period extraction unit, and a priori period extraction unit; wherein, the Fourier period extraction unit is used to calculate the amplitude of the frequency components through Fourier transform and select the global long period corresponding to the high amplitude frequency, and calculate the spectral entropy of the frequency domain energy distribution; the wavelet period extraction unit is used to calculate the global average energy of each scale parameter through continuous wavelet transform with Moray wavelet as the basis function and select the local short period corresponding to the high energy scale, and calculate the spectral entropy of the scale energy distribution; the priori period extraction unit is used to inject the inherent calendar rhythm characteristics of human society as the priori period.
[0053] The periodic fusion module is used to convert the time series data into two-dimensional tensors according to the lengths of the global long period, the local short period, and the prior period, respectively. It then uses a two-dimensional convolutional neural network to perform deep feature extraction on each of the two-dimensional tensors to obtain corresponding periodic features. Simultaneously, it converts each spectral entropy into a confidence penalty factor for the corresponding periodic feature and initializes a set of learnable weight parameters corresponding to each periodic feature. The learnable weight parameters are then dynamically masked and constrained using the confidence penalty factor to obtain updated weight parameters. These updated weight parameters are then normalized to obtain the weight coefficients of each periodic feature. Finally, the periodic features are weighted and fused to output the fused features.
[0054] The prediction output module is used to perform residual connection processing on the fused features through the multi-layer time series feature extraction module to obtain the predicted daily electricity consumption value of the target industry for the next preset number of days.
[0055] The industry electricity consumption forecasting system provided in this embodiment is used in the same way as the industry electricity consumption forecasting method mentioned above, and will not be repeated here. The industry electricity consumption forecasting system provided in this embodiment solves the problem of low prediction accuracy caused by abnormal distortion of complex multi-period intertwined data and multi-channel feature conflicts in the intelligent manufacturing industry. It can be widely used in electricity market trading and energy management in intelligent manufacturing industries such as textiles, footwear, and food processing.
[0056] This embodiment also provides a storage medium storing a computer program for enabling a computer to execute the above-described industry electricity consumption forecasting method.
[0057] The present invention has been described in detail above with reference to the accompanying drawings. However, the embodiments of the present invention are not limited to the above embodiments. Those skilled in the art can make various modifications to the present invention based on the prior art, and these modifications all fall within the protection scope of the present invention.
Claims
1. A method for predicting electricity consumption in an industry, characterized in that, Includes the following steps: S1, Data Acquisition: Collect historical daily electricity consumption data and corresponding historical daily meteorological characteristic data of the target industry, and preprocess the historical daily electricity consumption data and the historical daily meteorological characteristic data to obtain time series data; S2, Sample construction: The time series data is divided into multiple fixed-length input samples using a sliding window mechanism, and each fixed-length input sample is divided into a training set and a test set according to the time order. S3, Period Extraction: Fourier period extraction, wavelet period extraction, and prior period extraction are performed on the training set to obtain global long period, local short period, and prior period. At the same time, the spectral entropy corresponding to the frequency domain energy distribution obtained in the Fourier period extraction process and the scale energy distribution obtained in the wavelet period extraction process is calculated respectively. S4, Periodic Fusion: The time series data is converted into two-dimensional tensors according to the lengths of the global long period, the local short period, and the prior period, respectively. A two-dimensional convolutional neural network is used to extract deep features from each of the two-dimensional tensors to obtain corresponding periodic features. Simultaneously, the spectral entropy of each periodic feature is converted into a confidence penalty factor. A set of learnable weight parameters corresponding to each periodic feature is initialized. The learnable weight parameters are multiplied element-wise with the confidence penalty factor to obtain updated weight parameters. The updated weight parameters are then normalized to obtain normalized weight coefficients for each periodic feature. Finally, the periodic features are weighted and fused to output the fused features. S5, Prediction Output: The fused features are processed by residual connection through a multi-layer time-series feature extraction module to obtain the predicted daily electricity consumption value for the target industry in the next preset number of days.
2. The industry electricity consumption forecasting method as described in claim 1, characterized in that, In step S1, the preprocessing includes outlier detection and removal, missing value imputation, and normalization, performed sequentially.
3. The industry electricity consumption forecasting method as described in claim 1, characterized in that, In step S3, the specific method for Fourier period extraction is as follows: Perform a discrete Fourier transform on each of the fixed-length input samples in the training set to obtain a complex sequence in the frequency domain, and then calculate the amplitude of each frequency component in the frequency domain. ,in, and Let f represent the real and imaginary parts of the frequency domain complex sequence, respectively, and f be the corresponding frequency index. Then, the amplitudes are sorted in descending order, and the k highest amplitude frequency indices are selected. Finally, the global long period corresponding to each frequency is calculated based on the inverse relationship between period and frequency. , where L is the length of the fixed-length input sample.
4. The industry electricity consumption forecasting method as described in claim 3, characterized in that, In step S3, the amplitude of each frequency component in the frequency domain is normalized to obtain the frequency domain energy probability distribution P(f), and then the spectral entropy Hf of the Fourier period is calculated according to the formula Hf=-Σ P(f)×log P(f).
5. The industry electricity consumption forecasting method as described in claim 4, characterized in that, In step S3, the specific method for wavelet period extraction is as follows: The Moray wavelet function is selected as the basis function for continuous wavelet transform. The global average energy E(a) = (1 / L)×Σ|W(a,b)|² corresponding to each scale parameter in the Moray wavelet function is calculated. The top k scale parameters with the highest energy are selected, and the local short period corresponding to each scale parameter is calculated based on the center frequency fc of the selected Moray wavelet basis function. .
6. The industry electricity consumption forecasting method as described in claim 5, characterized in that, In step S3, the energy corresponding to each scale parameter is normalized to obtain the scale energy probability distribution P(a), and then the spectral entropy Hw of the wavelet period is calculated according to the formula Hw=-Σ P(a)×logP(a).
7. The industry electricity consumption forecasting method as described in claim 6, characterized in that, In step S4, through the negative exponential decay function and The spectral entropy Hf of the Fourier period and the spectral entropy Hw of the wavelet period are transformed into confidence penalty factors Cf and Cw for the corresponding periodic features, where α is a preset decay rate hyperparameter and e is a natural constant.
8. An industry electricity consumption forecasting system, characterized in that, include: The data acquisition module is used to collect historical daily electricity consumption data and corresponding historical daily meteorological characteristic data of the target industry, and to preprocess the historical daily electricity consumption data and the historical daily meteorological characteristic data to obtain time series data. The sample construction module is used to divide the time series data into multiple fixed-length input samples using a sliding window mechanism, and to divide each fixed-length input sample into a training set and a test set in chronological order. The period extraction module is used to perform Fourier period extraction, wavelet period extraction and prior period extraction on the training set respectively to obtain global long period, local short period and prior period, and to calculate the spectral entropy corresponding to the frequency domain energy distribution obtained in the Fourier period extraction process and the scale energy distribution obtained in the wavelet period extraction process respectively. The periodic fusion module is used to convert the time series data into two-dimensional tensors according to the lengths of the global long period, the local short period, and the prior period, respectively. It then uses a two-dimensional convolutional neural network to extract deep features from each of the two-dimensional tensors to obtain corresponding periodic features. Simultaneously, it converts each spectral entropy into a confidence penalty factor for the corresponding periodic feature and initializes a set of learnable weight parameters corresponding to each periodic feature. The module uses the confidence penalty factor to dynamically mask and constrain the learnable weight parameters to obtain updated weight parameters. Then, it normalizes the updated weight parameters to obtain normalized weight coefficients for each periodic feature. Finally, it performs weighted fusion of the periodic features and outputs the fused features. as well as The prediction output module is used to perform residual connection processing on the fused features through a multi-layer time-series feature extraction module to obtain the predicted daily electricity consumption value of the target industry for the next preset number of days.
9. The industry electricity consumption forecasting system as described in claim 8, characterized in that, The periodic extraction module includes: The Fourier period extraction unit is used to calculate the amplitude of the frequency components through Fourier transform, select the global long period corresponding to the high amplitude frequency, and calculate the spectral entropy of the frequency domain energy distribution. The wavelet period extraction unit is used to calculate the global average energy of parameters at each scale using continuous wavelet transform with Moray wavelets as the basis function, select the local short periods corresponding to high-energy scales, and calculate the spectral entropy of the scale energy distribution; and The prior period extraction unit is used to inject the inherent calendar rhythm features of human society as prior periods.
10. A storage medium storing a computer program, characterized in that, The computer program is used to enable the computer to execute the industry electricity consumption forecasting method as described in any one of claims 1-7.