Hydrogen energy load prediction method and system applied to industrial parks
Through deep neural network and multi-scale feature extraction technology, combined with frequency domain analysis and adaptive gate fusion network, the problem of capturing trend and periodic characteristics in hydrogen energy load forecasting in industrial parks is solved. A comprehensive trend periodic sensing loss function is designed to significantly improve improve the accuracy and stability of predictions.
Patent Information
- Application Number
- CN202411124271.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-16
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2044-08-16
AI Technical Summary
Existing technology is difficult to simultaneously capture long-term trends and seasonal fluctuations in hydrogen energy load forecasting in industrial parks, and the loss function focuses too much on local errors and ignores the macroscopic behavior of the data, resulting in biased prediction results.
Using deep neural network combined with multi-scale feature extraction and frequency domain analysis, through the global time-frequency feature capture network, multi-scale feature fusion network and adaptive gate fusion network, global periodic and local non-linear features are extracted, and comprehensive trend period perception is designed. Loss function to improve prediction accuracy and stability.
It significantly improves the accuracy and stability of hydrogen energy load forecasting, can more comprehensively analyze the inherent laws of hydrogen energy demand, enhances the model's understanding and generalization ability of complex data, and improves the comprehensiveness and accuracy of predictions.
Smart Images

Figure CN118644359B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of energy supply, and in particular to a method and system for predicting hydrogen energy load applied to an industrial park. Background Art
[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.
[0003] Hydrogen is a clean and efficient secondary energy source that can meet the needs of energy-intensive scenarios. Taking an industrial park as an example, when supplying hydrogen to an industrial park, it is necessary to predict the demand of each hydrogen consumption point in the park as accurately as possible, that is, load forecasting, so as to save the cost of hydrogen storage.
[0004] In industrial parks, the production and operation status, production line operation conditions, etc. of each enterprise are different, which makes the hydrogen energy load forecast for industrial parks complex and dynamically changing. Although traditional load forecasting methods such as time series analysis and statistical models have their applicable scenarios, they are obviously insufficient in capturing the nonlinear changes, high dynamics and uncertainty of hydrogen energy demand. In contrast, deep learning technology has shown significant advantages with its powerful data fitting capabilities and automatic feature learning mechanisms. The deep learning model can automatically extract complex features that characterize the hydrogen energy demand pattern from historical data without manual design, which enables it to have higher prediction accuracy and generalization ability when dealing with hydrogen energy load forecasting problems in industrial parks with high nonlinearity and complex periodicity.
[0005] Although deep learning models have shown great potential in the field of load forecasting, a single deep learning model still faces limitations when dealing with hydrogen energy forecasting in industrial parks. Single models tend to focus on global feature extraction or local detail analysis, and it is difficult to take both into account at the same time. Hydrogen energy load forecasting in industrial parks requires both understanding long-term trends and seasonal fluctuations (global features) and insight into short-term fluctuations and abnormal events (local features). A single model cannot fully capture the laws of demand changes on different time scales, resulting in deviations in forecast results.
[0006] At the same time, the loss function in existing methods mainly focuses on the local error between the predicted value and the actual value, that is, the degree of point-to-point difference. However, this local error-oriented evaluation method may be misleading when dealing with data with complex periodicity and long-term trends. Specifically, the loss function that relies only on local errors often ignores the macro behavior of the data, including the maintenance of long-term trends and the recurrence of periodic changes, which may cause the model to deviate from the overall trend and periodic characteristics, affecting the comprehensiveness and accuracy of the prediction results. Summary of the invention
[0007] In order to solve the technical problems existing in the above-mentioned background technology, the present invention provides a hydrogen energy load prediction method and system applied to industrial parks, which utilizes the powerful fitting ability of deep neural networks and the periodic recognition advantage of frequency domain analysis, combined with multi-scale feature extraction technology, and can more comprehensively and finely analyze the inherent laws of hydrogen energy demand, and significantly improve the accuracy and stability of the prediction.
[0008] In order to achieve the above object, the present invention adopts the following technical solution:
[0009] A first aspect of the present invention provides a hydrogen energy load prediction method for an industrial park, comprising the following steps:
[0010] Obtain the historical energy load data of the industrial park, the historical meteorological data of the meteorological station where the industrial park is located, and time data, perform preprocessing, and obtain feature representation through encoding operations;
[0011] The preprocessed data is represented in the frequency domain based on the global time domain feature capture network, and the global periodic features are further obtained;
[0012] Based on the obtained feature representation, a multi-scale feature fusion network is used to extract local nonlinear features;
[0013] The obtained global periodic features and local nonlinear features are used to obtain the prediction results using an adaptive gating fusion network.
[0014] Furthermore, the historical energy load data of the industrial park include the hydrogen energy consumption, electricity load, heat energy consumption and carbon emissions during the historical period of the industrial park; the historical meteorological data of the meteorological station where the industrial park is located include the dew point temperature, dry bulb temperature, wet bulb temperature, humidity, rainfall and wind speed during the historical period of the industrial park.
[0015] Furthermore, the preprocessing includes at least one of missing value processing, outlier detection and normalization.
[0016] Furthermore, the preprocessed data is represented in the frequency domain based on the global time domain feature capture network. Specifically, the preprocessed data is used as the input signal , based on the adaptive frequency band enhancement module, the frequency domain representation is obtained through Fourier transform , calculate the energy of each frequency component, and obtain the relative importance of the frequency component by normalization, as shown in the following formula:
[0017] ;
[0018] ;
[0019] in, represents the Fourier transform, is the frequency point, and the normalized energy is expressed as , Refers to the maximum frequency index of the frequency domain signal.
[0020] Furthermore, the global periodic characteristics are obtained, specifically:
[0021] According to the energy threshold parameter , before selecting The frequency components with the highest energy are taken as new frequency domain signals, and the index set of these components is determined;
[0022] Through inverse Fourier transform, the selected frequency components are reconstructed back into the time domain signal, which is then combined with the input signal Combined to obtain the reconstructed signal ;
[0023] Reconstructing the signal Two linear layers are used to perform different transformations. The first linear layer uses The activation function enhances the nonlinear expression capability, and the second linear layer retains the information of the original linear transformation;
[0024] The outputs from the two linear layers are fused by element-wise multiplication to generate feature representations. , and then another linear layer and The activation function is processed to obtain the optimized feature representation, and the input Added to the optimized features, we get the global periodic features .
[0025] Furthermore, according to the energy threshold parameter , before selecting The frequency component with the highest energy is shown in the following formula:
[0026] ;
[0027] in, yes function, represents the length of the input signal, is the normalized energy representation.
[0028] Furthermore, the multi-scale feature fusion network has at least two multi-scale weighted feature fusion modules and a multi-layer perceptron module connected in sequence; wherein the scale-weighted feature fusion module has multiple parallel convolution branches, and each branch is used to extract features of a specific scale;
[0029] Define the weight generator function to generate the weight tensor, through The convolution layer reduces the number of feature channels and utilizes The function ensures that the sum of the weights is 1;
[0030] The output of the convolution branch is weighted fused with the weight tensor, and the mixed result is combined with the signal of the input multi-scale feature fusion network. The convolution is followed by additive fusion, thereby enhancing the network's ability to capture multi-scale features and its adaptability through a dynamic weight allocation mechanism.
[0031] Furthermore, based on the obtained feature representation, a multi-scale feature fusion network is used to extract local nonlinear features; specifically:
[0032] Feature representation obtained by encoding operation , through the multi-scale weighted feature fusion module from Multi-scale feature extraction is performed within Multi-scale feature extraction is performed between the two layers, and the output is the feature representation. ;
[0033] Feature Representation After flattening, the dimensions are merged and local nonlinear features are obtained through the multi-layer perceptron module. .
[0034] Furthermore, the obtained global periodic features and local nonlinear features are used to obtain the prediction results using an adaptive gating fusion network, specifically:
[0035] The global periodic characteristics obtained and local nonlinear characteristics Concatenate into a single tensor and use linear layers to extract high-level features ;
[0036] Map to a low-dimensional space, generate a gating signal, and use an activation function to normalize the gating signal to ensure that the sum of all input weights is equal to 1;
[0037] Dynamically adjust the weight of each input based on the gating signal to achieve weighted fusion while retaining the influence of the original input to obtain the prediction result .
[0038] Furthermore, by combining encoding operations, global time-frequency feature capture networks, multi-scale feature fusion networks, and adaptive gated fusion networks, a hydrogen energy load forecasting model is obtained and trained. During the training, the comprehensive trend cycle perception loss is used. As an evaluation index of the prediction results, Including loss , Trend Loss and cycle loss Three parts, as shown below:
[0039] ;
[0040] ;
[0041] ;
[0042] ;
[0043] In the formula, and are the weights of the trend and periodic error terms, respectively, and the forecast results The trend term of the forecast result is obtained by moving average , prediction results The periodic term of the prediction result is obtained through the adaptive frequency band enhancement module , Indicates the window size; correspondingly, the actual load value The trend items of the real load value are obtained by moving average method and adaptive frequency band enhancement module. and periodic terms .
[0044] A second aspect of the present invention provides a hydrogen energy load forecasting system for an industrial park, comprising:
[0045] The data acquisition preprocessing module is configured to: obtain the historical energy load data of the industrial park, the historical meteorological data of the meteorological station where the industrial park is located, and the time data, and perform preprocessing to obtain feature representation through encoding operation;
[0046] The global time domain feature module is configured as follows: the preprocessed data is represented in the frequency domain based on the global time domain feature capture network, and the global periodic feature is further obtained;
[0047] The multi-scale feature fusion module is configured to: extract local nonlinear features using a multi-scale feature fusion network according to the obtained feature representation;
[0048] The adaptive gated fusion module is configured to obtain the global periodic features and local nonlinear features and obtain the prediction results using the adaptive gated fusion network.
[0049] Compared with the prior art, one or more of the above technical solutions have the following beneficial effects:
[0050] 1. By utilizing the powerful fitting ability of deep neural networks and the periodic recognition advantages of frequency domain analysis, through a series of feature extraction and fusion technologies such as combined coding operations, global time-frequency feature capture networks, multi-scale feature fusion networks and adaptive gated fusion networks, it is possible to analyze the inherent laws of hydrogen energy demand more comprehensively and finely, especially the hydrogen energy load in industrial parks, and significantly improve the accuracy and stability of predictions.
[0051] 2. By designing a global time-frequency feature capture network, the frequency components with larger energy are adaptively adjusted to help the model focus on the periodic patterns and trend information in the load data. The product of branch outputs enhances the grasp of the internal relationship of the load data, effectively capturing the global features and complex periodic patterns in the load time series data. At the same time, the jump connection retains the global information of the original input, which promotes the model's ability to learn long-term dependencies.
[0052] 3. The multi-scale weighted feature fusion network is mainly reflected in the multi-scale feature learning ability. It captures the local and nonlinear characteristics of load data through convolution kernels of different scales and inter-layer interaction characteristics, and adaptively weights the outputs of different branches through a dynamic weight allocation mechanism, thereby enhancing the model's recognition and fusion of key features.
[0053] 4. The adaptive gated fusion network introduces a gating mechanism to dynamically adjust the weights of local and global features, which enhances the model's understanding of complex data while maintaining the integrity of the original features, ensuring that the model's prediction results can make full use of all available information, and overall improving the model's performance and generalization ability.
[0054] 5. During training, the comprehensive trend cycle perception loss The traditional Losses and Trend Losses and cycle loss Combined with other methods, the model can not only learn the local details of load data during training, but also grasp its macroscopic behavior, thereby improving the comprehensiveness and accuracy of load forecasting. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0056] Figure 1 is a schematic diagram of a process for hydrogen energy load prediction provided by one or more embodiments of the present invention;
[0057] Figure 2 is a schematic diagram of the architecture of a hydrogen energy load prediction method provided by one or more embodiments of the present invention;
[0058] Figure 3 is a schematic diagram of a convolution module in a hydrogen energy load prediction method provided by one or more embodiments of the present invention;
[0059] Figure 4 is a schematic diagram of a multi-scale feature weighted fusion module in a hydrogen energy load prediction method provided by one or more embodiments of the present invention;
[0060] Figure 5 is a schematic diagram of a collaborative interaction module in a hydrogen energy load prediction method provided by one or more embodiments of the present invention;
[0061] Figure 6 It is a schematic diagram of an adaptive gating fusion network in a hydrogen energy load prediction method provided by one or more embodiments of the present invention. DETAILED DESCRIPTION
[0062] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0063] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0064] Terminology explanation:
[0065] Interquartile Range: Interquartile Range (IQR) is an important indicator used in statistics to describe the degree of dispersion of a set of data. It is defined as the difference between the upper quartile (Q3) and the lower quartile (Q1), where Q1 is the number of values less than or equal to it in the data, accounting for 25% of the total data, and Q3 is the number of values greater than or equal to it in the data, accounting for 75% of the total data. In other words, IQR covers the middle 50% of the data range.
[0066] Time-frequency analysis: Considering the characteristics of both time (time domain) and frequency (frequency domain) in time series data. For example, using Fast Fourier Transform (FFT) to analyze the signal in the frequency domain, and then inverse transforming it back to the time domain for the next step of analysis.
[0067] Frequency Domain: In time series analysis, frequency domain refers to the field that uses frequency to represent and analyze time series data. Unlike time domain analysis, frequency domain analysis focuses on the intensity and distribution of different frequency components in the time series.
[0068] As introduced in the background technology, when it comes to hydrogen energy load forecasting, the existing technology methods are difficult to adapt to the scenario of industrial parks. The hydrogen energy load forecasting of industrial parks requires both understanding of long-term trends and seasonal fluctuations (global characteristics) and insight into short-term fluctuations and abnormal events (local characteristics). The single model in the existing technology may not be able to fully capture the demand change patterns on different time scales, resulting in deviations in the forecast results. In addition, the error-oriented evaluation method that focuses on the local loss function in the existing technology may be misleading when dealing with hydrogen energy supply data in industrial parks with complex periodicity and long-term trends, resulting in deviations in the forecast results.
[0069] Therefore, the following embodiments provide a hydrogen energy load forecasting method and system applied to industrial parks, which comprehensively analyze the complex characteristics of hydrogen energy loads in industrial parks from different angles. By utilizing the powerful fitting ability of deep neural networks and the periodic recognition advantages of frequency domain analysis, combined with multi-scale feature extraction technology, it is possible to more comprehensively and finely analyze the inherent laws of hydrogen energy demand, and significantly improve the accuracy and stability of predictions. At the same time, a loss function is proposed to improve the comprehensiveness and accuracy of load forecasting by combining the trend loss term and the periodic loss term of the prediction results. Through application, energy managers in industrial parks can obtain more reliable data support, helping them to formulate more scientific hydrogen energy scheduling strategies to ensure the efficient operation and sustainable development of industrial parks.
[0070] Embodiment 1:
[0071] The hydrogen energy load prediction method applied to the industrial park includes the following steps:
[0072] Obtain the historical energy load data of the industrial park, the historical meteorological data of the meteorological station where the industrial park is located, and time data, perform preprocessing, and obtain feature representation through encoding operations;
[0073] The preprocessed data is represented in the frequency domain based on the global time domain feature capture network, and the global periodic features are further obtained. ;
[0074] According to the obtained feature representation, a multi-scale feature fusion network is used to extract local nonlinear features. ;
[0075] The global periodic characteristics obtained and local nonlinear characteristics , the prediction results are obtained using the adaptive gating fusion network.
[0076] In this embodiment, with respect to the hydrogen energy load prediction of the industrial park, the operating characteristics of the industrial park and the status of hydrogen energy supply are analyzed through mathematical thinking to determine the problems to be solved in realizing the hydrogen energy load.
[0077] 1. When dealing with data with high nonlinearity and complex correlations, existing models have difficulty balancing short-term details and long-term trends. To address this problem, a hydrogen energy load forecasting method for industrial parks based on frequency domain analysis and multi-scale feature extraction is proposed to capture local details and short-term fluctuations of hydrogen energy demand locally, and extract the cyclical laws and long-term trends of hydrogen energy demand globally.
[0078] 2. The existing loss function focuses too much on local errors and ignores the macro behavior of the data, such as long-term trends or cyclical changes. To address this problem, a loss function is proposed that combines the trend loss term and the cycle loss term of the prediction results to improve the comprehensiveness and accuracy of load forecasting.
[0079] like Figure 1-Figure 2 As shown, the hydrogen energy load prediction method applied to the industrial park includes the following steps:
[0080] Step (1) collects historical energy load data of the industrial park, historical meteorological data of the local meteorological station, and time data, and performs preprocessing operations to construct a standard historical data set, and divides the data set into a training set, a test set, and a validation set.
[0081] The specific implementation process of the operation in step (1) is as follows:
[0082] 1-1 Obtain historical energy load data of the industrial park, including time information, power load collected by sensors in the park, heat energy consumption, carbon emissions, and historical weather data (dew point temperature, dry bulb temperature, wet bulb temperature, humidity, rainfall, and wind speed) stored by the meteorological station where the industrial park is located.
[0083] 1-2 Process missing values of the collected historical data and fill missing values of the historical data with the previous value of the missing value.
[0084] The specific operation is for the historical data series Every missing value in (in ), find its nearest previous non-missing value (in and ). The non-missing values found , assigned to the missing values , that is, perform the assignment operation .
[0085] 1-3 pairs of historical data series with missing values filled The interquartile range was used for outlier detection and outliers were processed by boundary value replacement.
[0086] The specific operation is to Sort in ascending order, and get , calculate the quartiles, the first quartile (Q1) is The third quartile (Q3) is the value at the 0.75T position in the data set. This process can be expressed as:
[0087] ; ;
[0088] in, is the interquartile range, and the upper outlier limit is , the lower limit of outliers is . Detect and identify All less than or greater than The data points with a value less than The outliers are replaced by , will be greater than The outliers are replaced by .
[0089] 1-4 Input the processed data set into the reversible normalization layer, perform normalization on it, and output .
[0090] Step (2) builds the feature information encoding layer of the industrial park hydrogen energy load forecasting model to obtain the feature representation of the standard historical data set. After encoding the input time series data, the result is usually called feature representation, and the intrinsic characteristics of the time series can be captured through the feature vector.
[0091] The specific implementation process of the operation in step (2) is as follows:
[0092] 2-1 For step (1) Perform encoding operation to obtain feature representation .first right Padding is performed to ensure that there is enough information at the boundary for subsequent sliding window operations. Next, apply operation, i.e. sliding the window to the specified length and step length Slice the padded sequence to get a series of For each implement Operation, mapping them into a high-dimensional space to form feature representation The operation process can be described as follows:
[0093] ;
[0094] in, represents a sliding window operation, Represents a copy-fill operation, represents a linear operation, Length is , The step length between , Represents the feature dimension.
[0095] Step (3) build a global time-frequency feature capture network for the industrial park hydrogen energy load forecasting model. The global time-frequency feature capture network includes an adaptive frequency band enhancement module and a collaborative interaction module, which are used to capture global periodic features.
[0096] The specific implementation process of the operation in step (3) is as follows:
[0097] 3-1 The adaptive frequency band enhancement module firstly processes the input signal Perform Fourier transform to get frequency domain representation , then calculate the energy of each frequency component, and obtain the relative importance of the frequency component by normalization. The process can be expressed as:
[0098] ;
[0099] ;
[0100] in, represents the Fourier transform, is the frequency point, and the normalized energy is expressed as , Refers to the maximum frequency index of the frequency domain signal.
[0101] 3-2 Through a learnable energy threshold parameter , dynamically determine the number of retained frequency components , ensuring that the main features of the signal are retained in the reconstructed signal. The process can be expressed as:
[0102] ;
[0103] in, yes function, Indicates the length of the input signal.
[0104] 3-3 Before selection The frequency component with the highest energy, is the index set of these components, then the new frequency domain signal Defined as:
[0105] .
[0106] 3-4 Through inverse Fourier transform, the selected frequency components are reconstructed back into the time domain signal, and then combined with the input signal Combined to obtain the reconstructed signal , the process can be expressed as:
[0107] ;
[0108] in, represents the inverse Fourier transform.
[0109] 3-5 will reconstruct the signal Send to the collaborative interaction module to extract global periodic features .like Figure 5 As shown, first reconstruct the signal It is sent to two linear layers and transformed differently. The first branch adopts The activation function enhances the nonlinear expression capability, and the second branch retains the original linear transformation information. The outputs of the two branches are fused through element-by-element multiplication to generate a richer feature representation. . The process can be expressed as:
[0110] ;
[0111] in, yes Activation function, and represents the corresponding weight matrix and bias vector, Represents element-wise multiplication.
[0112] 3-6 The fused features go through Figure 5 Another linear layer shown and Activation function processing, and through layer normalization and Further optimize the feature representation. Through the jump connection, the input Add it to the optimized features to maintain the continuity of information flow. The process can be expressed as:
[0113] ;
[0114] in, Representation layer normalization operation, express , yes Activation function, and Denote the corresponding weight matrix and bias vector.
[0115] Step (4) build a multi-scale feature fusion network for the industrial park hydrogen energy load prediction model. The multi-scale feature fusion network consists of two multi-scale weighted feature fusion modules and a multi-layer perceptron module. Based on the feature representation obtained in step (2), the input features are sent to the multi-scale weighted feature fusion module through the multi-scale feature fusion network. Inter The local nonlinear features of the sequence data are further extracted through the multi-layer perceptron module. .
[0116] The specific implementation process of the operation in step (4) is as follows:
[0117] 4-1 The multi-scale weighted feature fusion module contains three parallel convolution branches, each of which is responsible for extracting features of a specific scale. The dynamic weight allocation mechanism is used to enhance the network's ability to capture and adapt to multi-scale features. The framework diagram of the multi-scale weighted feature fusion module is shown in Figure 4. Figure 4 shown.
[0118] The convolution branch in the multi-scale weighted feature fusion module is defined as , represents the feature channel dimension, and 3 is the number of branches. Each branch includes convolution modules with different convolution kernel sizes, such as Figure 3 As shown, each convolution module includes a one-dimensional convolution, Activation function, and batch normalization. Figure 4 As shown, the input of the first branch first passes through The depth-separable convolution module outputs the feature , and then go through The convolution module outputs the first branch feature ; The input of the second branch first passes through The depth-separable convolution module outputs the feature , the features of the first branch With the characteristics of the second branch Perform splicing operations to obtain features , and then go through The convolution module outputs the feature , and finally passed The convolution module outputs the second branch feature ; The input of the third branch first passes through The depth-separable convolution module outputs the feature , the features of the second branch With the characteristics of the third branch Perform splicing operations to obtain features , and finally passed The convolution module and The convolution module outputs the third branch feature The process can be described as:
[0119] ;
[0120] ;
[0121] ;
[0122] in, represents a one-dimensional depth-separable convolution module with a convolution kernel of 3. represents a one-dimensional depth-wise separable convolution module with a convolution kernel of 5. represents a one-dimensional depth-wise separable convolution with a convolution kernel of 9. Show splicing operation, Indicates The feature representation of each branch is Represents a one-dimensional convolution module with a convolution kernel of 1.
[0123] 4-2 Define the weight generator function to generate weight tensors ,pass The convolutional layer reduces the number of feature channels to 3 and then applies function to ensure that the sum of the weights is 1. The process can be expressed as:
[0124] ;
[0125] in, express Activation function, Represents a one-dimensional convolution with a convolution kernel of 1.
[0126] 4-3 The output of the convolution branch With the weight tensor Perform weighted fusion and combine the mixed result with the input signal Convolution is followed by addition and fusion. The process can be described as:
[0127] ;
[0128] in Represents a one-dimensional convolution with a convolution kernel of 1.
[0129] 4-4 The feature representation of step (2) is Through the multi-scale weighted feature fusion module, we first Multi-scale feature extraction is performed within Multi-scale feature extraction is performed between the two layers, and the output is the feature representation. The process can be described as:
[0130] ;
[0131] in, Represents a dimensional transformation.
[0132] 4-5 Input the feature extraction results into the multi-layer perceptron module to extract the local nonlinear features of the sequence data First, the input features Perform a flattening operation to merge the last two dimensions into one. Local nonlinear features are obtained through the multi-layer perceptron module The process can be described as:
[0133] ;
[0134] in Indicates the expansion operation. Representation layer normalization operation, express , represents a linear operation, yes Activation function.
[0135] Step (5) constructs an adaptive gated fusion network for the industrial park hydrogen energy load forecasting model. And the global periodicity characteristics obtained in step (3) Input into the adaptive gated fusion network for dynamic adaptive feature fusion to obtain the final prediction result The specific implementation process is as follows Figure 6 shown.
[0136] 5-1 Two input features and Concatenate into a single tensor , using linear layers to extract high-level features The linear layer accepts a channel dimension of The input and produces a channel dimension of Output.
[0137] 5-2 Map the converted features to a lower dimensional space to generate a gating signal ,application The function normalizes the gated signal to ensure that the sum of the weights of all inputs is equal to 1. The weights of each input are dynamically adjusted based on the gated signal to achieve weighted fusion while retaining the influence of the original input. The final prediction result is The process can be described as:
[0138] ;
[0139] ;
[0140] in, express Activation function, represents a linear operation, Represents element-wise multiplication.
[0141] Step (6) constructs an industrial park hydrogen energy load forecasting model based on the feature information encoding layer, the global time-frequency feature capture network, the multi-scale weighted feature fusion network and the adaptive gated fusion network. The data set divided in step (1) is input into the industrial park hydrogen energy demand load forecasting model for training, and a comprehensive trend cycle perception loss is designed. Enhance the model's ability to understand the complex dynamics of hydrogen energy loads.
[0142] 6-1 During the training process, Adam is used as the optimizer, the input sequence length is 168, the batch size is 32, the training is 20 rounds, and the mean square error and mean absolute error are used as evaluation indicators of the prediction results.
[0143] 6-2 Step (6) also includes the comprehensive trend cycle-aware loss used in the model training process , Depend on , Trend Loss and cycle loss It consists of three parts: Gradient changes are small and more robust to outliers, trend loss and cycle loss It is used to encourage the model prediction values to be consistent with the trends and cycles of the actual values, and to more comprehensively consider the characteristics of the load.
[0144] The predicted load results The trend term of the forecast result is obtained by moving average , the predicted load results The periodic term of the prediction result is obtained by the adaptive frequency band enhancement module in step (3) ,in represents the window size. Similarly, the actual load value The trend term of the real load value is obtained in the same way and periodic terms . The calculation process can be expressed as:
[0145] ;
[0146] ;
[0147] ;
[0148] ;
[0149] in, and are the weights of the trend and periodic error terms, respectively, and their values are 0.1.
[0150] Step (7) Develop an inference script for the industrial park hydrogen energy load forecasting model. This script integrates and loads the optimal parameters obtained from historical data training, thereby encapsulating and deploying the trained industrial park hydrogen energy load forecasting model, specifically for predicting the hydrogen energy demand of the industrial park. The script is deployed and run on a local server to provide automated load forecasting services.
[0151] By designing a global time-frequency feature capture network, including an adaptive frequency band enhancement module and a collaborative interaction module, the adaptive frequency band enhancement module adaptively adjusts and retains those frequency components with larger energy by setting an energy threshold, helping the model focus on the periodic patterns and trend information in the load data. The collaborative interaction module enhances the grasp of the intrinsic relationship of the load data through the product of branch outputs, effectively capturing the global features and complex periodic patterns in the load time series data, while the jump connection retains the global information of the original input, promoting the model's ability to learn long-term dependencies.
[0152] The design of the multi-scale weighted feature fusion network is mainly reflected in the multi-scale feature learning ability. It captures the local and nonlinear characteristics of the load data through convolution kernels of different scales and inter-layer interaction characteristics, and uses the weight generator to adaptively weight the outputs of different branches, which enhances the model's recognition and fusion of key features. The adaptive gated fusion network introduces a gating mechanism to dynamically adjust the weights of local and global features, which enhances the model's understanding of complex data while maintaining the integrity of the original features, ensuring that the model's prediction results can make full use of all available information, and overall improving the performance and generalization ability of the model.
[0153] The comprehensive trend cycle perception loss designed in this embodiment The traditional Losses and specially designed trend losses and cycle loss Combined with other methods, the model can not only learn the local details of load data during training, but also grasp its macroscopic behavior, thereby improving the comprehensiveness and accuracy of load forecasting.
[0154] Embodiment 2:
[0155] The hydrogen energy load forecasting system used in industrial parks includes:
[0156] The data acquisition preprocessing module is configured to: obtain the historical energy load data of the industrial park, the historical meteorological data of the meteorological station where the industrial park is located, and the time data, and perform preprocessing to obtain feature representation through encoding operation;
[0157] The global time domain feature module is configured as follows: the preprocessed data is represented in the frequency domain based on the global time domain feature capture network, and the global periodic feature is further obtained;
[0158] The multi-scale feature fusion module is configured to: extract local nonlinear features using a multi-scale feature fusion network according to the obtained feature representation;
[0159] The adaptive gated fusion module is configured to obtain the global periodic features and local nonlinear features and obtain the prediction results using the adaptive gated fusion network.
[0160] By designing a global time-frequency feature capture network, including an adaptive frequency band enhancement module and a collaborative interaction module, the adaptive frequency band enhancement module adaptively adjusts and retains those frequency components with larger energy by setting an energy threshold, helping the model focus on the periodic patterns and trend information in the load data. The collaborative interaction module enhances the grasp of the intrinsic relationship of the load data through the product of branch outputs, effectively capturing the global features and complex periodic patterns in the load time series data, while the jump connection retains the global information of the original input, promoting the model's ability to learn long-term dependencies.
[0161] The design of the multi-scale weighted feature fusion network is mainly reflected in the multi-scale feature learning ability. It captures the local and nonlinear characteristics of the load data through convolution kernels of different scales and inter-layer interaction characteristics, and uses the weight generator to adaptively weight the outputs of different branches, which enhances the model's recognition and fusion of key features. The adaptive gated fusion network introduces a gating mechanism to dynamically adjust the weights of local and global features, which enhances the model's understanding of complex data while maintaining the integrity of the original features, ensuring that the model's prediction results can make full use of all available information, and overall improving the performance and generalization ability of the model.
[0162] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A hydrogen energy load prediction method applied to an industrial park, characterized in that: The following steps are involved: Obtain the historical energy load data of the industrial park, the historical meteorological data of the meteorological station where the industrial park is located, and time data, perform preprocessing, and obtain feature representation through encoding operations; The preprocessed data is represented in the frequency domain based on the global time domain feature capture network, and the global periodic features are further obtained; Based on the obtained feature representation, a multi-scale feature fusion network is used to extract local nonlinear features; The obtained global periodic features and local nonlinear features are used to obtain prediction results using an adaptive gating fusion network; The historical energy load data of the industrial park include the hydrogen energy consumption, power load, heat energy consumption and carbon emissions in the historical time period of the industrial park; the historical meteorological data of the meteorological station where the industrial park is located include the dew point temperature, dry bulb temperature, wet bulb temperature, humidity, rainfall and wind speed in the historical time period of the industrial park; Obtaining the global periodic characteristics includes the following steps: According to the energy threshold parameter , before selecting The frequency components with the highest energy are taken as new frequency domain signals, and the index set of these components is determined; Through inverse Fourier transform, the selected frequency components are reconstructed back into the time domain signal, which is then combined with the input signal Combined to obtain the reconstructed signal ; Reconstructing the signal Two linear layers are used to perform different transformations. The first linear layer uses The activation function enhances the nonlinear expression capability, and the second linear layer retains the information of the original linear transformation; The outputs from the two linear layers are fused by element-wise multiplication to generate feature representations. , and then another linear layer and The activation function is processed to obtain the optimized feature representation, and the input Added to the optimized features, we get the global periodic features ; According to the obtained feature representation, a multi-scale feature fusion network is used to extract local nonlinear features, including the following steps: Feature representation obtained by encoding operation , through the multi-scale weighted feature fusion module from Multi-scale feature extraction is performed within Multi-scale feature extraction is performed between the two layers, and the output is the feature representation. ; Feature Representation After flattening, the dimensions are merged and local nonlinear features are obtained through the multi-layer perceptron module. ; Among them, the feature representation obtained by the encoding operation The process is shown as follows: ; in, represents a sliding window operation, Represents a copy-fill operation, represents a linear operation, Length is , The step length between , represents the feature dimension, represents the input signal; The obtained global periodic features and local nonlinear features are used to obtain the prediction results using an adaptive gating fusion network, specifically: The global periodic characteristics obtained and local nonlinear characteristics Concatenate into a single tensor and use linear layers to extract high-level features ; Advanced Features Map to a low-dimensional space, generate a gating signal, and use an activation function to normalize the gating signal to ensure that the sum of all input weights is equal to 1; Dynamically adjust the weight of each input based on the gating signal to achieve weighted fusion while retaining the influence of the original input to obtain the prediction result .
2. The method for predicting hydrogen energy load applied to an industrial park according to claim 1, characterized in that: The preprocessed data is represented in the frequency domain based on the global time domain feature capture network. Specifically, the preprocessed data is used as the input signal , after Fourier transform, we get the frequency domain representation , calculate the energy of each frequency component, and obtain the relative importance of the frequency component by normalization, as shown in the following formula: ; ; in, represents the Fourier transform, is the frequency point, and the normalized energy is expressed as , Refers to the maximum frequency index of the frequency domain signal.
3. The method for predicting hydrogen energy load applied to an industrial park according to claim 1, characterized in that: According to the energy threshold parameter , before selecting The frequency component with the highest energy is shown in the following formula: ; in, yes function, Indicates the length of the input signal.
4. The method for predicting hydrogen energy load applied to an industrial park according to claim 1, characterized in that: The multi-scale feature fusion network has a multi-scale weighted feature fusion module. The multi-scale weighted feature fusion module has multiple parallel convolution branches, and each branch is used to extract features of a set scale. By defining a weight generator function to generate weight tensors, The convolution layer reduces the number of feature channels and utilizes The function ensures that the sum of the weights is 1; The output of the convolution branch is weighted fused with the weight tensor, and the mixed result is combined with the signal of the input multi-scale feature fusion network. The convolution is followed by additive fusion, thereby enhancing the network's ability to capture multi-scale features and its adaptability through a dynamic weight allocation mechanism.
5. The method for predicting hydrogen energy load applied to an industrial park according to claim 1, characterized in that: By combining encoding operations, global time-frequency feature capture networks, multi-scale feature fusion networks, and adaptive gated fusion networks, a hydrogen energy load forecasting model is obtained and trained. During the training, the comprehensive trend cycle perception loss is used. As an evaluation index of the prediction results, Including loss , Trend Loss and cycle loss Three parts, as shown below: ; ; ; ; In the formula, and are the weights of the trend and periodic error terms, respectively, and the forecast results The trend term of the forecast result is obtained by moving average , prediction results The periodic term of the prediction result is obtained through the adaptive frequency band enhancement module , Indicates the window size; correspondingly, the actual load value The trend items of the real load value are obtained by moving average method and adaptive frequency band enhancement module. and periodic terms .
6. A hydrogen energy load prediction system for implementing the method according to any one of claims 1 to 5, characterized in that: include: The data acquisition preprocessing module is configured to: obtain the historical energy load data of the industrial park, the historical meteorological data of the meteorological station where the industrial park is located, and the time data, and perform preprocessing to obtain feature representation through encoding operation; The global time domain feature module is configured as follows: the preprocessed data is represented in the frequency domain based on the global time domain feature capture network, and the global periodic feature is further obtained; The multi-scale feature fusion module is configured to: extract local nonlinear features using a multi-scale feature fusion network according to the obtained feature representation; The adaptive gated fusion module is configured to obtain the global periodic features and local nonlinear features and obtain the prediction results using the adaptive gated fusion network.
