Carbon transaction price prediction method and system
By extracting the time characteristics of carbon trading market data, signal segmentation and self-attention mechanisms are used to enhance interactive learning, solving the problem of carbon price prediction with high volatility in carbon trading market data, and achieving more accurate carbon price prediction.
Patent Information
- Application Number
- CN202510283491.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-10
- Publication Date
- 2025-04-25
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Carbon trading market data is characterized by non-stationarity, strong randomness and extreme volatility, which makes it difficult to predict carbon prices.
A carbon trading price prediction method is adopted, by obtaining the preset carbon price data set, extracting time characteristics, performing boundary filling and median pooling smoothing processing, calculating slope information, dividing high-frequency, low-frequency and intermediate-frequency signals, and introducing a self-attention mechanism for enhanced interactive learning to output prediction results.
This method can more accurately capture the multi-scale characteristics and complex dependencies of carbon price changes, improve prediction capabilities, and achieve accurate prediction of carbon price.
Smart Images

Figure CN119887265A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of carbon market forecasting, and in particular to a method and system for forecasting carbon trading prices. Background Art
[0002] Climate change has become a serious challenge facing the world, and countries are actively seeking strategies to deal with it. Carbon emissions are one of the main causes of climate change. Carbon dioxide, as one of the main greenhouse gases, will remain in the atmosphere, causing global temperatures to rise. Carbon emissions trading has become an important means to address climate change, aiming to alleviate climate problems by rationally allocating atmospheric emission capacity. Carbon trading market data is characterized by non-stationarity, strong randomness, and extreme volatility, which brings great difficulties to carbon price prediction.
[0003] Therefore, studying an efficient and practical carbon trading price forecasting method has very important theoretical value and practical significance for timely grasping changes in the carbon trading market, optimizing carbon emission reduction resource allocation and promoting green and low-carbon development. Summary of the invention
[0004] In order to accurately predict carbon prices, the present application provides a carbon trading price prediction method and system.
[0005] In the first aspect, a carbon trading price prediction method provided in this application adopts the following technical solution:
[0006] A carbon trading price prediction method, comprising:
[0007] Obtain a preset carbon price dataset and extract temporal features to determine the time series;
[0008] Perform boundary filling and median pooling smoothing processing on the time series to generate a target sequence;
[0009] Calculating slope information corresponding to the target sequence and determining a high-frequency signal, a low-frequency signal, and an intermediate-frequency signal according to the slope information;
[0010] Dynamically adjusting the intermediate frequency signal according to the slope mean to divide it into a high frequency signal and / or a low frequency signal;
[0011] Obtain all current high-frequency signals and low-frequency signals as output information;
[0012] A self-attention mechanism is introduced and combined with the output information to perform enhanced interactive learning to output the corresponding prediction results.
[0013] Optionally, the step of performing boundary filling and median pooling smoothing processing on the time series to generate a target sequence includes:
[0014] The time series is filled left and right using a reflection filling mode;
[0015] Smooth the padded time series by median operation:
[0016] x p =Pad(x,w)
[0017] x s = medianPool1D(x p ,w)
[0018] Among them, x p represents the input sequence x after padding; x s represents the smoothed signal after median pooling, and w represents the window size.
[0019] Optionally, the step of calculating slope information corresponding to the target sequence and determining the high-frequency signal, the low-frequency signal, and the intermediate-frequency signal according to the slope information includes:
[0020] The first-order difference method is used to calculate the slope information corresponding to the target sequence, and the signal change rate dx calculation formula is:
[0021] dx t =x s,t+1 -x s,t ;
[0022] The difference is normalized using the sampling rate r to obtain the slope information:
[0023] S t =|dx t |×r
[0024] Among them, S t represents the local slope at the tth time step;
[0025] Preset threshold information is obtained, and a high-frequency signal, a low-frequency signal, and an intermediate-frequency signal are determined according to the preset threshold information.
[0026] Optionally, the step of obtaining preset threshold information and determining the high-frequency signal, the low-frequency signal, and the intermediate-frequency signal according to the preset threshold information includes:
[0027] Obtain preset threshold information, wherein the preset threshold information includes a high frequency threshold T high and low frequency threshold T low ;
[0028] The signal slope exceeding the high-frequency threshold is classified as a high-frequency signal, the signal slope below the low-frequency threshold is classified as a low-frequency signal, and the signal slope between the two is a medium-frequency signal:
[0029]
[0030] Among them, M high Represented as a high-frequency signal, M low Represents low-frequency signal; M mid It represents the intermediate frequency signal; S represents the slope.
[0031] Optionally, the step of dynamically adjusting the intermediate frequency signal according to the slope mean to divide it into a high frequency signal and / or a low frequency signal includes:
[0032] The mean value of the slope of the intermediate frequency signal is calculated, and the slope of the intermediate frequency signal is compared with the mean value to classify the signal into a high frequency signal and / or a low frequency signal:
[0033] M dhigh =M mid &(S>S mean )
[0034] M dlow =M mid &(S≤S mean )
[0035] Among them, M dhigh Represented as a dynamic high-frequency signal; M dlow Represents a dynamic low-frequency signal; S mean It is expressed as the average slope of the intermediate frequency signal, and S is expressed as the slope of the intermediate frequency signal.
[0036] Optionally, the step of introducing a self-attention mechanism and combining the output information to perform enhanced interactive learning to output a corresponding prediction result includes:
[0037] In the output information, the subsequence F is mapped to three feature spaces: Query (Q), Key (K) and Value (V):
[0038]
[0039] in, are the linear transformations of the Query, Key, and Value of the input sequence F, respectively. Q ,W K ,W V It is represented as a parameter matrix, and d is represented as the feature dimension;
[0040] Get the high-frequency subsequences in the sequence F updated by the self-attention mechanism and low frequency subsequences And map the high-frequency subsequence and the low-frequency subsequence to the hidden state and convert them into exponential form;
[0041] Combine the high-frequency subsequence and the low-frequency subsequence with another original subsequence F high and F low Perform element-wise multiplication to perform scaling transformation;
[0042]
[0043] The two scaled features are linearly transformed through two one-dimensional convolution modules ρ and η and After the self-attention set, it is projected to the other two hidden states and becomes and
[0044] These two hidden states are and Addition or subtraction operations are performed on it, and the two updated sub-features F' are obtained through the self-attention mechanism and interaction operations. high and F' low
[0045]
[0046] Optionally, use mean absolute error as the loss function:
[0047]
[0048] Among them, τ is the total number of test samples; is the predicted value; y i is the true value.
[0049] In a second aspect, the present application provides a carbon trading price prediction system, the carbon trading price prediction system comprising:
[0050] A data acquisition module, used to acquire a preset carbon price data set and determine a time series by extracting time features;
[0051] A target sequence module, used for performing boundary filling and median pooling smoothing processing on the time series to generate a target sequence;
[0052] A slope calculation module, used to calculate the slope information corresponding to the target sequence and determine the high-frequency signal, the low-frequency signal and the intermediate-frequency signal according to the slope information;
[0053] A dynamic segmentation module, used for dynamically adjusting the intermediate frequency signal according to the slope mean to divide it into a high frequency signal and / or a low frequency signal;
[0054] The output information module is used to obtain all current high-frequency signals and low-frequency signals as output information;
[0055] The prediction result module is used to introduce a self-attention mechanism and combine the output information to perform enhanced interactive learning to output the corresponding prediction result.
[0056] In a third aspect, the present application provides a computer device, comprising: a memory and a processor, wherein the processor executes the method described above when running computer instructions stored in the memory.
[0057] In a fourth aspect, the present application provides a computer-readable storage medium, comprising instructions, which, when executed on a computer, enable the computer to execute the method described above.
[0058] In summary, the present application includes the following beneficial technical effects:
[0059] This application obtains a preset carbon price data set and determines the time series by extracting time features; performs boundary filling and median pooling smoothing on the time series to generate a target sequence; calculates the slope information corresponding to the target sequence and determines the high-frequency signal, low-frequency signal and intermediate-frequency signal according to the slope information; dynamically adjusts the intermediate-frequency signal according to the slope mean to divide it into high-frequency signal and / or low-frequency signal; obtains all current high-frequency signals and low-frequency signals as output information; introduces a self-attention mechanism and combines the output information for enhanced interactive learning to output the corresponding prediction results. The context information is fully captured, and the technical effect of accurately predicting carbon prices is further achieved from improving the prediction ability. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 It is a schematic diagram of the computer device structure of the hardware operating environment involved in the embodiment of the present application;
[0061] Figure 2 This is a flow chart of an embodiment of a method for predicting carbon trading prices in this application;
[0062] Figure 3 It is the carbon trading price trend chart of Province A in the carbon trading price prediction method of this application;
[0063] Figure 4 It is the carbon trading price trend chart of Province B in the carbon trading price prediction method of this application;
[0064] Figure 5 It is the Frequency-split structure diagram in the carbon trading price prediction method of this application;
[0065] Figure 6 This is the FACNet framework diagram in the carbon trading price prediction method of this application;
[0066] Figure 7It is the FAC-Block structure diagram in the carbon trading price prediction method of this application;
[0067] Figure 8 It is a structural block diagram of an embodiment of the carbon trading price prediction system of the present application. DETAILED DESCRIPTION
[0068] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below through the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0069] Reference Figure 1 , Figure 1 A schematic diagram of the computer device structure of the hardware operating environment involved in the embodiment of the present application.
[0070] like Figure 1 As shown, the computer device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (Wireless-Fidelity, Wi-Fi) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM), or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk storage. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0071] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the computer device, and may include more or less components than shown in the figure, or combine some components, or arrange the components differently.
[0072] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a network communication module, a user interface module, and a carbon trading price prediction program.
[0073] exist Figure 1In the computer device shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the present application can be set in the computer device, and the computer device calls the carbon trading price prediction program stored in the memory 1005 through the processor 1001, and executes the carbon trading price prediction method provided in the embodiment of the present application.
[0074] This application embodiment provides a carbon trading price prediction method, referring to Figure 2 , Figure 2 This is a flow chart of an embodiment of a method for predicting carbon trading prices in the present application.
[0075] In this embodiment, the carbon trading price prediction method includes the following steps:
[0076] Step S10: Obtain a preset carbon price data set and determine a time series by extracting time features.
[0077] It should be noted that the preset carbon price data set in this embodiment includes the carbon trading price data of Province A and the carbon trading data of Province B. This embodiment selects 2275 carbon price data from April 3, 2014 to March 4, 2024 for analysis. The data set is divided into a training set (70%), a validation set (10%), and a test set (20%) to ensure the accuracy and reliability of the model. The trend of carbon trading prices in Province A is as follows: Figure 3 shown.
[0078] At the same time, in order to verify the robustness of the model, the carbon price of Province B was selected as a supplementary case. The carbon trading data of Province B will select 2184 carbon price data from December 19, 2013 to March 5, 2024 for analysis. The data set is divided into a training set (70%), a validation set (10%), and a test set (20%). Among them, the trend of carbon trading prices in Province B is as follows Figure 4 shown.
[0079] In the specific implementation, in this embodiment, the open source deep learning library Scikit-learn based on pytorch is mainly used to build the model. The experiment was carried out on a PC server composed of a 12th Gen Intel(R)Core(TM)i9-12900H, Intel(R)Iris(R)Xe Graphics and NVIDIA GeForce RTX 3060Laptop GPU.
[0080] In order to prevent FACNet from overfitting during training, a variety of strategies are adopted, including adding a dropout strategy to the convolutional layer and setting an early stopping criterion. The root mean square error (RMSE) and mean absolute error (MAE) are used as performance indicators to evaluate the performance of the model. The calculation formula is as follows:
[0081]
[0082] Among them, i represents the data of the i-th time step; τ represents the total length of the predicted data; y i Represents the true value of the i-th time step; represents the predicted value at the i-th time step.
[0083] Step S20: The time series is subjected to boundary filling and median pooling smoothing processing to generate a target sequence.
[0084] It should be noted that the step of performing boundary filling and median pooling smoothing on the time series to generate the target series includes: using the reflection filling mode to fill the time series on the left and right; and smoothing the filled time series by the median operation:
[0085] x p =Pad(x,w)
[0086] x s = medianPool1D(x p ,w)
[0087] Among them, x p represents the input sequence x after padding; x s represents the smoothed signal after median pooling, and w represents the window size.
[0088] In the specific implementation, in order to better capture the multi-scale features in the time series, the frequency segmentation strategy is used to replace the original odd-even segmentation strategy. This strategy divides the input sequence into two sub-sequences of high frequency and low frequency by calculating the local change rate, so that the model can handle the rapid changes and long-term stable trends in the sequence respectively, thereby enhancing the prediction ability of the model.
[0089] Specifically, the input time series F is first subjected to boundary filling and median pooling smoothing processing to remove noise and maintain the main trend of the signal. Next, the slope of the smoothed signal is calculated, and high-frequency, low-frequency, and medium-frequency masks are generated to obtain the updated sequence F'. Then, based on different masks, it is dynamically segmented into high-frequency, low-frequency, and medium-frequency signals. For the medium-frequency signal, its slope mean is dynamically adjusted, and then it is refined into high-frequency or low-frequency signals. So that the model can better capture multi-scale features and complex dependencies. Finally, the segmented high-frequency and low-frequency signals are used as the output of the model for subsequent feature extraction and prediction tasks. Among them, the Frequency-split structure diagram is shown in Figure 5 shown.
[0090] Step S30: Calculate the slope information corresponding to the target sequence and determine the high-frequency signal, the low-frequency signal and the intermediate-frequency signal according to the slope information.
[0091] It can be understood that the steps of calculating the slope information corresponding to the target sequence and determining the high-frequency signal, the low-frequency signal and the intermediate-frequency signal according to the slope information include: using a first-order difference method to calculate the slope information corresponding to the target sequence, and the signal change rate dx calculation formula is:
[0092] dx t =x s,t+1 -x s,t ;
[0093] The difference is normalized using the sampling rate r to obtain the slope information:
[0094] S t =|dx t |×r
[0095] Among them, S t represents the local slope at the tth time step;
[0096] Preset threshold information is obtained, and a high-frequency signal, a low-frequency signal, and an intermediate-frequency signal are determined according to the preset threshold information.
[0097] It should be noted that the step of obtaining preset threshold information and determining the high-frequency signal, the low-frequency signal and the intermediate-frequency signal by using the preset threshold information includes: obtaining preset threshold information, wherein the preset threshold information includes the high-frequency threshold T high and low frequency threshold T low ; The signal slope exceeding the high-frequency threshold is classified as a high-frequency signal, the signal slope below the low-frequency threshold is classified as a low-frequency signal, and the signal slope between the two is a medium-frequency signal:
[0098]
[0099] Among them, M highRepresented as a high-frequency signal, M low Represents low-frequency signal; M mid It represents the intermediate frequency signal; S represents the slope.
[0100] It is understandable that the purpose of introducing SCINet in this embodiment is to capture cross-time scale dependencies when processing complex time series data. SCINet uses the odd-even segmentation method to divide the original sequence into two subsequences for information interaction, aiming to capture short-term and long-term dependencies within the sequence. However, odd-even segmentation is essentially a "binarization" segmentation strategy, which forces the sequence to be split into two parts, and cannot take into account the complexity of the sequence for more detailed segmentation. This segmentation method may cause key information to be scattered in different subsequences, and the context information cannot be fully retained. Therefore, this segmentation method has limitations when processing complex, multi-period, and nonlinear time series data, affecting the model's ability to capture multi-scale dependencies. In addition, a simple odd-even segmentation method may not be able to fully extract feature information in the sequence, making it difficult to fully capture the complex relationship between short-term fluctuations and long-term trends, ultimately affecting the overall performance of the model. When the segmented odd-even sequence is interactively learned, the key contextual information may be distributed in different subsequences, and the model cannot fully capture these important dependencies during the interaction process. In addition, the depth and method of interaction are relatively limited, resulting in insufficient information flow between the two subsequences. When the long-term and short-term dependency features of a time series are divided into different subsequences, it is difficult for a simple interaction mechanism to effectively integrate this information, limiting the overall performance of the model. Therefore, in order to address the limitations of the SCINet model in processing complex time series tasks, this embodiment proposes a new model, called Frequency-split and Attention Interaction Convolutional Networks (FACNet), whose architecture is as follows: Figure 6 As shown, the (a) module is the FACNet architecture, the (b) module is the FAC-Block architecture, and the (c) module is the stacked FACNet architecture.
[0101] In the specific implementation, the model first preprocesses the input time series through the frequency segmentation method. Then, the padded sequence is smoothed through the median pooling operation to reduce the impact of noise and outliers and generate a smoother signal. Subsequently, based on the first-order difference of the signal, the slope of change in the original sequence is calculated. According to the size of the slope, the sequence is divided into high-frequency, low-frequency and medium-frequency regions. The high-frequency region is the signal part with a larger change rate, the low-frequency is the part with a smaller recognition rate, and the medium-frequency mask is further dynamically adjusted to high frequency or low frequency by comparing with the mean of the slope. In order to further enhance the ability to extract multi-scale features in time series, FACNet introduces the TCN network to capture the dependencies of different scales in the sequence. The TCN network expands the receptive field by dilating convolution, thereby providing more detailed features for subsequent frequency segmentation and signal analysis. After obtaining the high-frequency subsequence F high and the low-frequency subsequence F low After that, the subsequences are convolved in FAC-Block, and the interactive learning is enhanced through the self-attention mechanism. Finally, F′ after interaction high and F′ low The subsequences are fused with the information in the original sequence through rearrangement and residual connection to ensure that the feature information is not lost during the multi-level recursive processing. After recursive processing and interaction of multiple layers of FAC-Block, the rearranged sequence outputs the final prediction result through the fully connected layer.
[0102] FACNet combines the frequency segmentation strategy and attention mechanism, which can not only integrate global and local features at multiple resolutions, but also capture short-term fluctuations and long-term trends at the same time, thus greatly improving the prediction accuracy of the model. This new network structure shows stronger modeling ability and robustness when dealing with complex time series prediction tasks.
[0103] Step S40: dynamically adjusting the intermediate frequency signal according to the slope mean to divide it into a high frequency signal and / or a low frequency signal.
[0104] It should be noted that the step of dynamically adjusting the intermediate frequency signal according to the slope mean to divide it into the high frequency signal and / or the low frequency signal includes:
[0105] Calculate the mean of the slope of the intermediate frequency signal, and compare the slope of the intermediate frequency signal with the mean to classify it into high-frequency signal and / or low-frequency signal:
[0106] M dhigh =M mid &(S>S mean )
[0107] M dlow =M mid &(S≤S mean )
[0108] Among them, M dhigh Represented as a dynamic high-frequency signal; M dlow Represents a dynamic low-frequency signal; S mean It is expressed as the average slope of the intermediate frequency signal, and S is expressed as the slope of the intermediate frequency signal.
[0109] Step S50: Acquire all current high-frequency signals and low-frequency signals and use them as output information.
[0110] Step S60: Introduce a self-attention mechanism and combine the output information to perform enhanced interactive learning to output corresponding prediction results.
[0111] It can be understood that the steps of introducing the self-attention mechanism and combining the output information to enhance interactive learning to output the corresponding prediction results include: mapping the subsequence F to the three feature spaces of Query (Q), Key (K) and Value (V) in the output information
[0112]
[0113] in, are the linear transformations of the Query, Key, and Value of the input sequence F, respectively. Q ,W K ,W V It is represented as a parameter matrix, and d is represented as the feature dimension;
[0114] Get the high-frequency subsequences in the sequence F updated by the self-attention mechanism and low frequency subsequences And map the high-frequency subsequence and the low-frequency subsequence to the hidden state and convert them into exponential form;
[0115] Combine the high-frequency subsequence and the low-frequency subsequence with another original subsequence F high and F low Perform element-wise multiplication to perform scaling transformation;
[0116]
[0117] The two scaled features are linearly transformed through two one-dimensional convolution modules ρ and η and After the self-attention set, it is projected to the other two hidden states and becomes and
[0118] These two hidden states are and Addition or subtraction operations are performed on it, and the two updated sub-features F' are obtained through the self-attention mechanism and interaction operations. highand F' low
[0119]
[0120] In the specific implementation, the mean absolute error is used as the loss function:
[0121]
[0122] Among them, τ is the total number of test samples; is the predicted value; y i is the true value.
[0123] In the specific implementation, the SCINet model mainly relies on convolution and exponential operations to update the odd-even sequence. Although it can effectively extract local information, it is insufficient in capturing global information and long-term dependencies. In order to address these limitations, the FACNet model introduces a self-attention mechanism in FAC-Block to enhance the model's ability to capture long-term dependencies and complex features, ensuring that the feature information of the sequence is not lost during multi-level recursive processing. The FAC-Block framework is shown in the figure below. Figure 7 As shown. By introducing the self-attention mechanism in the interactive learning of FAC-Block, the self-attention mechanism allows the model to dynamically assign weights according to the correlation between time steps, making the interaction between subsequences more flexible and able to capture the dependencies between distant time steps, thereby improving the ability of the FACNet model to capture long-term and short-term dependencies. At the same time, it also enables the model to dynamically adjust the information flow between different time steps according to the input data, making the information interaction more flexible. This improvement can better capture the multi-scale features and long-term and short-term dependencies in the time series, thereby significantly improving the prediction accuracy and generalization ability of the model.
[0124] In FAC-Block, the input sequence F is first divided into high-frequency subsequences F by frequency segmentation. high and the low-frequency subsequence F low , and then use the one-dimensional convolution γ and δ with a convolution kernel size of 5 to project it to the hidden state, and then convert the high and low frequency subsequences of the hidden state into exponential form. Then, the segmented high and low frequency subsequences are mapped to the three feature spaces of Query (Q), Key (K) and Value (V) through the self-attention mechanism. The attention weight and updated features can be calculated by the following formula:
[0125]
[0126] in, are the linear transformations of the Query, Key, and Value of the input sequence F; W Q ,W K,W V Represented as a parameter matrix; d represents the feature dimension.
[0127] Then the subsequence after the self-attention mechanism and With another original subsequence F high and F low Performing element-wise multiplication, we get and This operation mainly uses convolution operations and self-attention mechanisms to enable the model to dynamically adjust the influence range and weight of features between different subsequences. Next, and Perform the same operation, use the one-dimensional convolution modules μ and α with convolution kernel 7 to linearly transform them and project them to the hidden state. and After self-attention again, we get and Again with and Perform addition or subtraction operations. Finally, the two updated sub-features F′ are obtained through the self-attention mechanism and interaction operations. high and F′ low This interactive method of self-attention mechanism can better capture the long-range dependencies and global features in time series data, ensuring that feature information is not lost during multi-layer interaction and processing.
[0128]
[0129] γ and δ: One-dimensional convolution modules with a kernel size of 5. They are represented by different symbols to distinguish them. μ and α: One-dimensional convolution modules with a kernel size of 7. They are represented by different symbols to distinguish them.
[0130] It can be understood that this embodiment proposes a new carbon trading price prediction method, which is based on the frequency-split and attention interaction convolutional network (FACNet). FACNet solves the limitations of the traditional odd-even segmentation method in processing complex time series data by introducing the frequency segmentation strategy and self-attention mechanism. By calculating the rate of change of the time series, the sequence is dynamically divided into high-frequency, low-frequency and medium-frequency signals to capture rapid changes and long-term stable trends respectively. The medium-frequency signal is dynamically divided to further optimize the accuracy of high-frequency and low-frequency signals. The self-attention mechanism is introduced in FAC-Block to enhance the information interaction between high-frequency and low-frequency signals and capture the long-term and short-term dependencies of the time series. Through recursive processing and feature fusion, information loss is avoided and the depth and quality of feature extraction are improved.
[0131] It should be noted that the FACNet proposed in this embodiment achieves significant technical improvements in capturing the multi-scale features, long-term and short-term dependencies, and global characteristics of complex time series through the combination of frequency segmentation strategy and self-attention mechanism, and its model performance and prediction ability are better than traditional methods. The following are the main technical effects and advantages of this solution:
[0132] ① Enhanced multi-scale feature capture capability:
[0133] By introducing the frequency segmentation strategy, FACNet can effectively separate high-frequency and low-frequency features, respectively capturing rapid changes and long-term stable trends in time series. This strategy is more detailed than the traditional odd-even segmentation and can more comprehensively preserve the multi-scale features of the sequence.
[0134] ②Adaptive segmentation and dynamic adjustment:
[0135] Using slope analysis and dynamic threshold adjustment, FACNet can flexibly reallocate intermediate-frequency signals to high-frequency or low-frequency categories, thereby extracting key features more accurately and avoiding information loss.
[0136] ③Noise and outlier suppression:
[0137] In the preprocessing stage, the signal is smoothed by median pooling, which effectively reduces noise interference and the influence of outliers, while retaining the main change trends in the time series, providing high-quality input for subsequent feature extraction.
[0138] ④ Enhanced long-term dependency capture capabilities:
[0139] The self-attention mechanism is introduced in FAC-Block, which enables the model to dynamically adjust the weights according to the correlation between time steps, so as to better capture the long-distance dependencies in the sequence. This mechanism makes up for the shortcomings of traditional convolutional networks in global feature extraction.
[0140] ⑤ Information flow and interaction optimization:
[0141] By jointly using the self-attention mechanism and multi-layer convolution operations, FACNet ensures that the information between the segmented high-frequency and low-frequency signals can fully interact, enhancing the overall learning ability of the model.
[0142] ⑥ Improved prediction accuracy and robustness:
[0143] FACNet shows significant improvement in prediction accuracy when processing complex time series. Its ability to model short-term fluctuations and long-term trends makes it suitable for a variety of scenarios. The model design also ensures strong noise resistance and generalization performance.
[0144] ⑦Flexible structural adaptability:
[0145] Through multi-layer recursive design and residual connections, FACNet is able to adapt to time series tasks of different complexities while maintaining computational efficiency.
[0146] ⑧ Scalability and explainability:
[0147] The combination of the frequency segmentation method and the attention mechanism not only makes the model scalable, but also provides a more intuitive explanation of the distribution of time series features.
[0148] The FACNet (Frequency-split and Attention Interaction Convolutional Networks) proposed in this scheme significantly improves the modeling ability of complex time series prediction by introducing frequency segmentation strategy and self-attention interaction mechanism. Its frequency segmentation strategy dynamically divides high-frequency, low-frequency and medium-frequency signals based on the signal change rate, effectively capturing the multi-scale characteristics of short-term fluctuations and long-term trends; the dynamic adjustment mechanism further refines the feature segmentation and enhances the adaptability of the model to diversified data. In addition, FACNet combines the self-attention mechanism in feature interaction, which can not only flexibly model long-range dependencies, but also realize the organic integration of global and local features. Combined with boundary filling and median pooling processing, FACNet shows strong noise resistance and robustness, and provides good scalability and flexibility through modular design. Overall, FACNet shows excellent performance and stronger generalization ability in complex, multi-period, nonlinear time series prediction tasks, providing an innovative solution for the field of time series modeling.
[0149] This embodiment obtains a preset carbon price data set and extracts time features to determine the time series; performs boundary filling and median pooling smoothing on the time series to generate a target sequence; calculates the slope information corresponding to the target sequence and determines the high-frequency signal, low-frequency signal, and intermediate-frequency signal based on the slope information; dynamically adjusts the intermediate-frequency signal according to the slope mean to divide it into high-frequency signal and / or low-frequency signal; obtains all current high-frequency signals and low-frequency signals as output information; introduces a self-attention mechanism and combines the output information for enhanced interactive learning to output the corresponding prediction results. The context information is fully captured, and the technical effect of accurately predicting carbon prices is further achieved from improving the prediction ability.
[0150] In addition, an embodiment of the present application also proposes a computer-readable storage medium, on which a program for predicting carbon trading prices is stored. When the program for predicting carbon trading prices is executed by a processor, the steps of the method for predicting carbon trading prices as described above are implemented.
[0151] Reference Figure 8 , Figure 8 This is a structural block diagram of an embodiment of a carbon trading price prediction system of the present application.
[0152] like Figure 8 As shown, the carbon trading price prediction system proposed in the embodiment of the present application includes:
[0153] A data acquisition module 10, used to acquire a preset carbon price data set and determine a time series by extracting time features;
[0154] A target sequence module 20 is used to perform boundary filling and median pooling smoothing processing on the time series to generate a target sequence;
[0155] A slope calculation module 30, used to calculate the slope information corresponding to the target sequence and determine the high frequency signal, the low frequency signal and the intermediate frequency signal according to the slope information;
[0156] A dynamic segmentation module 40, configured to dynamically adjust the intermediate frequency signal according to the slope mean to divide the intermediate frequency signal into a high frequency signal and / or a low frequency signal;
[0157] An output information module 50 is used to obtain all current high-frequency signals and low-frequency signals and use them as output information;
[0158] The prediction result module 60 is used to introduce a self-attention mechanism and combine the output information to perform enhanced interactive learning to output the corresponding prediction result.
[0159] It should be understood that the above is only an example and does not constitute any limitation on the technical solution of the present application. In specific applications, technicians in this field can make settings as needed, and the present application does not impose any limitation on this.
[0160] This embodiment obtains a preset carbon price data set and extracts time features to determine the time series; performs boundary filling and median pooling smoothing on the time series to generate a target sequence; calculates the slope information corresponding to the target sequence and determines the high-frequency signal, low-frequency signal, and intermediate-frequency signal based on the slope information; dynamically adjusts the intermediate-frequency signal according to the slope mean to divide it into high-frequency signal and / or low-frequency signal; obtains all current high-frequency signals and low-frequency signals as output information; introduces a self-attention mechanism and combines the output information for enhanced interactive learning to output the corresponding prediction results. The context information is fully captured, and the technical effect of accurately predicting carbon prices is further achieved from improving the prediction ability.
[0161] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of the present application. In practical applications, technicians in this field can select part or all of it according to actual needs to achieve the purpose of the present embodiment, and no limitation is made here.
[0162] In addition, for technical details not fully described in this embodiment, please refer to the method for predicting carbon trading prices provided in any embodiment of the present application, which will not be repeated here.
[0163] In addition, it should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0164] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0165] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory (ROM) / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of each embodiment of the present application.
[0166] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A carbon trading price prediction method, characterized in that: include: Obtain a preset carbon price dataset and extract temporal features to determine the time series; Perform boundary filling and median pooling smoothing processing on the time series to generate a target sequence; Calculating slope information corresponding to the target sequence and determining a high-frequency signal, a low-frequency signal, and an intermediate-frequency signal according to the slope information; Dynamically adjusting the intermediate frequency signal according to the slope mean to divide it into a high frequency signal and / or a low frequency signal; Obtain all current high-frequency signals and low-frequency signals as output information; A self-attention mechanism is introduced and combined with the output information to perform enhanced interactive learning to output the corresponding prediction results.
2. The carbon trading price prediction method according to claim 1, characterized in that: The step of performing boundary filling and median pooling smoothing processing on the time series to generate a target sequence includes: The time series is filled left and right using a reflection filling mode; Smooth the padded time series by median operation: x p =Pad(x,w) x s =medianPool1D(x p ,w) Among them, x p represents the input sequence x after padding; x s represents the smoothed signal after median pooling, and w represents the window size.
3. The carbon trading price prediction method according to claim 2, characterized in that: The step of calculating the slope information corresponding to the target sequence and determining the high-frequency signal, the low-frequency signal and the intermediate-frequency signal according to the slope information comprises: The first-order difference method is used to calculate the slope information corresponding to the target sequence, and the signal change rate dx calculation formula is: dx t =x s,t+1 -x s,t ; The difference is normalized using the sampling rate r to obtain the slope information: S t =|dx t |×r Among them, S t represents the local slope at the tth time step; Preset threshold information is obtained, and a high-frequency signal, a low-frequency signal, and an intermediate-frequency signal are determined according to the preset threshold information.
4. The carbon trading price prediction method according to claim 3 is characterized in that: The step of obtaining preset threshold information and determining the high frequency signal, the low frequency signal and the intermediate frequency signal according to the preset threshold information includes: Obtain preset threshold information, wherein the preset threshold information includes a high frequency threshold T high and low frequency threshold T low ; The signal slope exceeding the high-frequency threshold is classified as a high-frequency signal, the signal slope below the low-frequency threshold is classified as a low-frequency signal, and the signal slope between the two is a medium-frequency signal: Among them, M high Represented as a high-frequency signal, M low Represents low-frequency signal; M mid It represents the intermediate frequency signal; S represents the slope.
5. The carbon trading price prediction method according to claim 4, characterized in that: The step of dynamically adjusting the intermediate frequency signal according to the slope mean to divide it into a high frequency signal and / or a low frequency signal comprises: The mean value of the slope of the intermediate frequency signal is calculated, and the slope of the intermediate frequency signal is compared with the mean value to classify the signal into a high frequency signal and / or a low frequency signal: M dhigh =M mid &(S>S mean ) M dlow =M mid &(S≤S mean ) Among them, M dhigh Represented as a dynamic high-frequency signal; M dlow Represents a dynamic low-frequency signal; S mean It is expressed as the average slope of the intermediate frequency signal, and S is expressed as the slope of the intermediate frequency signal.
6. The carbon trading price prediction method according to claim 1, characterized in that: The step of introducing the self-attention mechanism and combining the output information to perform enhanced interactive learning to output the corresponding prediction result includes: In the output information, the subsequence F is mapped to three feature spaces: Query (Q), Key (K) and Value (V): Where, Q = FW Q , K=FW K , V=FW V are the linear transformations of the Query, Key, and Value of the input sequence F, respectively. Q ,W K ,W V It is represented as a parameter matrix, and d is represented as the feature dimension; Get the high-frequency subsequences in the sequence F updated by the self-attention mechanism and low frequency subsequences And map the high-frequency subsequence and the low-frequency subsequence to the hidden state and convert them into exponential form; Combine the high-frequency subsequence and the low-frequency subsequence with another original subsequence F high and F low Perform element-wise multiplication to perform scaling transformation; The two scaled features are linearly transformed through two one-dimensional convolution modules ρ and η and After the self-attention set, it is projected to the other two hidden states and becomes and These two hidden states are and Addition or subtraction operations are performed on it, and the two updated sub-features F' are obtained through the self-attention mechanism and interaction operations. high and F' low 7. The carbon trading price prediction method according to any one of claims 1 to 6, characterized in that: The mean absolute error is used as the loss function: Among them, τ is the total number of test samples; is the predicted value; y i is the true value.
8. A carbon trading price prediction system, characterized in that: The carbon trading price prediction system includes: A data acquisition module, used to acquire a preset carbon price data set and determine a time series by extracting time features; A target sequence module, used for performing boundary filling and median pooling smoothing processing on the time series to generate a target sequence; A slope calculation module, used to calculate the slope information corresponding to the target sequence and determine the high-frequency signal, the low-frequency signal and the intermediate-frequency signal according to the slope information; A dynamic segmentation module, used for dynamically adjusting the intermediate frequency signal according to the slope mean to divide it into a high frequency signal and / or a low frequency signal; The output information module is used to obtain all current high-frequency signals and low-frequency signals as output information; The prediction result module is used to introduce a self-attention mechanism and combine the output information to perform enhanced interactive learning to output the corresponding prediction result.
9. A computer device, characterized in that: The device comprises: a memory and a processor, and when the processor runs the computer instructions stored in the memory, the processor executes the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The method comprises instructions, which, when executed on a computer, cause the computer to execute the method according to any one of claims 1 to 7.