Time sequence generation method and system based on frequency domain dual learning mechanism

Through the frequency domain dual learning mechanism, dynamic allocation of frequency weights, patch attention and 2D rotation position encoding, the problems of detail loss and trend ambiguity in frequency domain information processing are solved, and high-quality time series generation is achieved, which is suitable for fields such as temperature, finance, medical care and energy.

CN120804593AActive Publication Date: 2025-10-17SOUTH CHINA NORMAL UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510981247.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-16
Publication Date
2025-10-17
Estimated Expiration
2045-07-16

AI Technical Summary

Technical Problem

Existing technologies in frequency domain information processing have problems such as high-amplitude frequency screening leading to loss of details, lack of focus in equal learning, and inability of seasonal decomposition to take into account differentiated needs, resulting in time series generation lacking real data details and blurred core trends.

Method used

A dual learning mechanism based on frequency domain is adopted. A linear layer neural network is used to assign weights to each frequency column. Patch Attention and 2D rotation position encoding are combined to perform attention calculation and residual connection. The trend component is extracted by polynomial regression to generate high-quality time series.

Benefits of technology

It effectively preserves high-amplitude core frequencies and medium- and low-amplitude periods, avoids detail loss, and improves the accuracy and reliability of time series generation. It is suitable for multi-domain time series generation tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120804593A_ABST
    Figure CN120804593A_ABST
Patent Text Reader

Abstract

The invention provides a time sequence generation method based on a frequency domain double learning mechanism, and the method comprises the steps: obtaining the time sequence data of the air temperature of the next year with noise, and carrying out the Fourier transformation of the time sequence data to a frequency domain, and obtaining a spectrogram; analyzing the spectrogram by using a linear layer neural network, calculating the importance weight of each frequency column on the spectrogram, and multiplying the importance weight by the corresponding frequency column to obtain a weighted spectrogram; segmenting the spectrogram into a plurality of square blocks; all the square blocks are sent into an attention network for attention calculation to obtain attention output; performing residual connection on the attention output and the weighted spectrogram to obtain a frequency signal after fusion optimization; converting the fused and optimized frequency signal back to a time domain through inverse Fourier transform to obtain a seasonal component; a trend component is extracted from the time sequence data of'air temperature in the next year 'with noise; and adding the season component and the trend component to obtain the predicted initial data of the air temperature of the next year.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of frequency domain double learning, and particularly relates to a time series generation method and system based on a frequency domain double learning mechanism. BACKGROUND

[0002] In the field of time series generation, frequency domain analysis is the core means to handle seasonal and periodic patterns. The existing technology has the following key defects in frequency domain information processing:

[0003] 1. High amplitude frequency bias leads to loss of details:

[0004] Traditional methods (such as ETSformer) use a Top-K frequency screening strategy, which only retains the K highest amplitude components in the frequency domain. Although this strategy can capture the main periodic patterns (such as the high-amplitude signals of the four seasons), it completely ignores low-amplitude frequency components. For example, in urban temperature sequences, the subtle temperature fluctuations (low amplitude but with fixed periods) corresponding to the 24 solar terms and sudden weather disturbances are directly filtered out, resulting in generated sequences that lack the details of real data and cannot fully restore the multi-level periodic patterns of complex time series.

[0005] 2. Equal learning mechanism is difficult to focus on core features:

[0006] Some technologies (such as Fredformer) avoid the limitations of Top-K screening and use an equal learning strategy for all frequencies, but do not differentiate and reinforce key frequencies. In actual data, the importance of high-amplitude frequencies (such as annual seasonal cycles) and low-amplitude frequencies (such as random noise) differs significantly. Equal learning can distract the model's attention from a large amount of meaningless low-frequency noise, resulting in low learning efficiency of core periodic features (such as main seasonal patterns) and a fuzzy core trend in generated sequences, which cannot highlight the dominant role of key seasonal features.

[0007] 3. Seasonal decomposition module lacks differentiated processing capabilities:

[0008] The seasonal decomposition module of existing diffusion models lacks an adaptive processing mechanism for high and low amplitude frequencies, and cannot meet the learning needs of both types of signals. Specifically, the reinforcement of high-amplitude frequencies is insufficient, resulting in low-quality core seasonal patterns, and the filtering mechanism for low-amplitude frequencies is missing, allowing noise and irrelevant fluctuations to mix with valid signals. This defect is particularly evident in scenarios where multiple scale seasonal patterns coexist (such as temperature data containing main seasons, secondary seasons, and weather disturbances), resulting in seasonal components that not only lose important details but also contain redundant interference information. SUMMARY

[0009] The present application aims to overcome the above technical deficiencies, provide a time series generation method and system based on a frequency domain double learning mechanism, solve the technical problems of detail loss caused by high amplitude screening, lack of focus in equal learning, and inability to balance differentiated needs in seasonal decomposition in the prior art.

[0010] To achieve the above technical purpose, the technical scheme of the first aspect of the present application provides a time series generation method based on a frequency domain double learning mechanism, acquires noisy "future one-year temperature" time series data, performs Fourier transform on the time series data to obtain a frequency spectrum graph, the horizontal axis is frequency, and the vertical axis is amplitude;

[0011] A linear layer neural network is used to analyze the frequency spectrum graph, calculate the importance weight of each frequency column on the frequency spectrum graph, and obtain a weighted frequency spectrum graph based on the importance weight multiplied by the corresponding frequency column;

[0012] The weighted frequency spectrum graph is divided into multiple blocks, each block contains information of a local frequency region, and a 2D rotation position encoding is used for the block;

[0013] All the blocks are sent to an attention network for attention calculation to obtain an attention output;

[0014] The attention output and the weighted frequency spectrum graph are connected in residual to obtain a fusion-optimized frequency signal;

[0015] The fusion-optimized frequency signal is converted back to the time domain through inverse Fourier transform to obtain a seasonal component, which includes clear four-season fluctuations and distinguishable solstice transitions;

[0016] A polynomial regression is used to extract a trend component from the noisy "future one-year temperature" time series data;

[0017] The seasonal component and the trend component are added to obtain predicted "future one-year temperature" initial data.

[0018] Compared with the prior art, the present application has the following advantages:

[0019] The present application dynamically allocates weights to each frequency column through a linear layer, high-amplitude core frequencies (such as four-season replacement) are given high weights, medium and low-amplitude meaningful frequencies (such as solstice fluctuations) are given medium weights, and noise frequencies are given weights close to 0. This mechanism avoids the loss of low-amplitude details caused by traditional "Top-K screening", and ensures the generation quality of core seasonal patterns through weight reinforcement.

[0020] In the temperature data, both the high-amplitude signals of the four seasons and the medium-low amplitude periods of the solar terms are retained, and the generation sequence is avoided to present only the monotonic four-season fluctuations. The Patch Attention equally learns all frequencies, divides the spectrum into local patches, and introduces 2D RoPE position encoding, so that the model can accurately capture the position information and correlation of each frequency region. Even the low-amplitude weather disturbance frequency will be included in the attention calculation, avoiding the problem of noise interference with core features in equal learning. Compared with the indiscriminate learning of Fredformer, the scheme allows the model to equally focus with emphasis through position encoding, neither ignoring details nor distinguishing information importance.

[0021] According to some embodiments of the present application, after all the blocks are sent into an attention network for attention calculation to obtain an attention output, the following steps are further included:

[0022] The attention network separates a residual component, and the residual component is completely random noise;

[0023] The seasonal component, the trend component, and the residual component are added to obtain initial data of predicted "future one-year temperature".

[0024] According to some embodiments of the present application, after the seasonal component, the trend component, and the residual component are added to obtain initial data of predicted "future one-year temperature", the following steps are included:

[0025] Real future one-year temperature time series are collected to obtain real data;

[0026] The initial data and the real data are subjected to loss calculation to obtain a weighted total loss;

[0027] Based on the weighted total loss, all parameters of the model are adjusted in a backward propagation manner, and the parameters include an adaptive weight layer, a Patch Attention, and a trend extractor.

[0028] According to some embodiments of the present application, the initial data and the real data are subjected to loss calculation, including the following steps:

[0029] Time domain loss (L_tmp): directly comparing the difference between the initial data and the real data at a time point;

[0030] Frequency domain loss (L_feq): Fourier transforming the initial data and the real data, and comparing the difference in the frequency domain;

[0031] Weighted total loss (L_alpha): adding the time domain loss and the frequency domain loss in proportion (alpha).

[0032] According to some embodiments of the present application, the frequency column includes:

[0033] Four seasons column, solstice column and noise column.

[0034] According to some embodiments of the present application, the importance weight of each frequency column on the spectrum diagram is calculated, including:

[0035] The four seasons column weight is 0.9, the solstice column weight is 0.7, and the noise column weight is 0.01.

[0036] In a second aspect, the present application provides a time series generation system based on a frequency domain double learning mechanism, comprising:

[0037] A frequency transformation module acquires a noisy "future one-year temperature" time series data, performs Fourier transform on the time series data to the frequency domain to obtain a spectrum diagram, the horizontal axis is frequency, and the vertical axis is amplitude;

[0038] An adaptive weighting module uses a linear layer neural network to analyze the spectrum diagram, calculates the importance weight of each frequency column on the spectrum diagram, and obtains a weighted spectrum diagram based on the importance weight multiplied by the corresponding frequency column;

[0039] A spectrum segmentation module divides the spectrum diagram into multiple blocks, each block contains information of a local frequency area, and a 2D rotation position encoding is used for the block.

[0040] An attention calculation module sends all the blocks to an attention network for attention calculation to obtain an attention output;

[0041] A fusion optimization module performs residual connection on the attention output and the weighted spectrum diagram to obtain a fusion-optimized frequency signal;

[0042] An inverse transformation module converts the fusion-optimized frequency signal back to the time domain through inverse Fourier transform to obtain a seasonal component, the seasonal component includes clear four-season fluctuations and distinguishable solstice transitions.

[0043] A trend component extraction module extracts a trend component from the noisy "future one-year temperature" time series data using polynomial regression.

[0044] An initial data generation module adds the seasonal component and the trend component to obtain predicted "future one-year temperature" initial data.

[0045] According to some embodiments of the present application, further comprising:

[0046] A loss calculation module acquires a real future one-year temperature time series to obtain real data, calculates a loss between the initial data and the real data to obtain a weighted total loss.

[0047] In a third aspect, the present application provides a computer readable storage medium storing computer executable instructions for causing a computer to execute the time series generation method based on frequency domain double learning mechanism according to any one of the first aspect.

[0048] Additional aspects and advantages of the present application will be made apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS

[0049] The above and / or additional aspects and advantages of the present application will become apparent and be more readily understood through consideration of the following description, taken in conjunction with the accompanying drawings, in which:

[0050] Figure 1 a flowchart of the time series generation method based on frequency domain double learning mechanism according to an embodiment of the present application;

[0051] Figure 2 a flowchart of the time series generation method based on frequency domain double learning mechanism according to an embodiment of the present application;

[0052] Figure 3 a flowchart of the time series generation method based on frequency domain double learning mechanism according to an embodiment of the present application. DETAILED DESCRIPTION

[0053] In order to make the objects, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and should not be used to limit the present application.

[0054] It should be noted that although the functional modules are divided in the system schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a manner different from the module division in the system or the order in the flowchart. The terms "first", "second", etc. in the specification and claims and the above drawings are used to distinguish similar objects, and do not necessarily describe a specific order or sequence.

[0055] Reference Figures 1-3 , Figure 1 a flowchart of the time series generation method based on frequency domain double learning mechanism according to an embodiment of the present application; Figure 2 a flowchart of the time series generation method based on frequency domain double learning mechanism according to an embodiment of the present application; Figure 3A flow detail diagram of a time series generation method based on a frequency domain double learning mechanism is provided for an embodiment of the present application. The time series generation method based on the frequency domain double learning mechanism includes but is not limited to the following steps:

[0056] In step S110, the "future one-year air temperature" time series data with noise is obtained, and Fourier transform is performed on the time series data to the frequency domain to obtain a frequency spectrum diagram;

[0057] In step S120, a linear layer neural network is used to analyze the frequency spectrum diagram, the importance weight of each frequency column on the frequency spectrum diagram is calculated, and the weighted frequency spectrum diagram is obtained based on the importance weight multiplied by the corresponding frequency column;

[0058] In step S130, the frequency spectrum diagram is divided into multiple blocks, each block contains information of a local frequency region, 2D rotation position coding is used for the blocks, and all the blocks are sent into an attention network for attention calculation to obtain an attention output;

[0059] In step S140, the attention output and the weighted frequency spectrum diagram are connected in residual to obtain a fusion-optimized frequency signal, the fusion-optimized frequency signal is converted back to the time domain through inverse Fourier transform to obtain a seasonal component, and the seasonal component includes clear four-season fluctuations and distinguishable solstice transitions;

[0060] In step S150, a polynomial regression is used to extract a trend component from the "future one-year air temperature" time series data with noise, and the seasonal component and the trend component are added to obtain initial data of the predicted "future one-year air temperature".

[0061] In an embodiment, the time series generation method based on the frequency domain double learning mechanism includes the following steps: obtaining "future one-year air temperature" time series data with noise, performing Fourier transform on the time series data to the frequency domain to obtain a frequency spectrum diagram, the horizontal axis is frequency, and the vertical axis is amplitude; using a linear layer neural network to analyze the frequency spectrum diagram, calculating the importance weight of each frequency column on the frequency spectrum diagram, and obtaining a weighted frequency spectrum diagram based on the importance weight multiplied by the corresponding frequency column; dividing the weighted frequency spectrum diagram into multiple blocks, each block containing information of a local frequency region, and using 2D rotation position coding for the blocks; sending all the blocks into an attention network for attention calculation to obtain an attention output; connecting the attention output and the weighted frequency spectrum diagram in residual to obtain a fusion-optimized frequency signal; converting the fusion-optimized frequency signal back to the time domain through inverse Fourier transform to obtain a seasonal component, and the seasonal component includes clear four-season fluctuations and distinguishable solstice transitions; using a polynomial regression to extract a trend component from the "future one-year air temperature" time series data with noise; and adding the seasonal component and the trend component to obtain initial data of the predicted "future one-year air temperature".

[0062] Actual case: generating a daily air temperature time series of a city in the future for one year

[0063] Real data features:

[0064] Trend (T): Global warming causes the average annual temperature to rise slowly (long-term change).

[0065] Season(s):

[0066] 1. Main season (high amplitude): obvious alternation of four seasons (spring, summer, autumn, winter, large amplitude).

[0067] 2. Sub-seasonal (low amplitude): subtle temperature fluctuations caused by the 24 solar terms (such as "Qingzhe" and "Qingzhe").

[0068] Warming up and cooling down after "Frost Descent", the amplitude is small but the pattern is important).

[0069] 3. Weather disturbances (low amplitude): sudden cold waves, heat waves, etc. (no fixed cycle, small amplitude).

[0070] 4. Residual (R): Completely random measurement noise or small disturbances.

[0071] Problems with traditional methods:

[0072] If only the top-K high-amplitude frequencies (such as top-1) are selected, only the most obvious "four seasons" changes will be learned, and the "solar term" fluctuations and "weather disturbance" patterns will be completely lost. The generated temperature curve will only have monotonous four-season fluctuations and lack details.

[0073] If all frequencies are treated equally, the model may be distracted by a large number of tiny "weather disturbances" and noise frequencies, resulting in insufficient learning of the most important "four seasons" and "solar terms" features, and the generated four seasons features may be unclear.

[0074] 1. Frequency domain conversion

[0075] Operation: Send the current noisy "temperature in the next year" time series data Xk into the Fourier transform (FFT).

[0076] Result: The frequency domain signal Ak is obtained. Ak is no longer a temperature curve, but a spectrum graph, with the horizontal axis being frequency (speed of change) and the vertical axis being amplitude (intensity of change).

[0077] In this graph: the seasonal changes (1 year / cycle) correspond to high amplitude;

[0078] Solar term changes (15 days / cycle) correspond to medium and low amplitudes; weather disturbances and noise correspond to low amplitudes.

[0079] Purpose: Decomposes complex temporal variations into combinations of different frequencies (speed) and intensities (amplitude). This is a key first step in addressing seasonality.

[0080] By converting time series data into the frequency domain through Fourier transform, the information hidden in different frequency components of the time series can be mined. Compared with the method of analyzing only in the time domain, this way from the frequency domain can more accurately capture the frequency characteristics corresponding to the periodic changes such as annual cycle, seasonal cycle in the air temperature data, providing a good foundation for subsequent accurate generation of time series, and helping to grasp the internal rhythm of air temperature change over time.

[0081] 2. Dual learning mechanism

[0082] a) Adaptive weighting

[0083] Operation: Design a small neural network (linear layer) to analyze the spectrogram Ak. Automatically calculate the "importance weight" of each frequency column. High amplitude (such as seasons) will get a high weight, medium-low amplitude but possible (such as solstices) will get a medium or higher weight, and short columns of pure noise will have a low weight or even close to 0. Then, multiply this weight with the corresponding column in Ak to get the weighted frequency spectrum Gk.

[0084] Example: Season column weight = 0.9, solstice column weight = 0.7, noise column weight = 0.01. Gk strengthens the signals of seasons and solstices, greatly weakening the noise.

[0085] What problem is solved: Ensure that the model focuses on truly important frequency patterns (seasons, solstices), and avoid them being overwhelmed or under-learned. Corresponding to "emphasize important frequencies".

[0086]

[0087] S k = PatchAttention(X k -G k )+G k

[0088] F(·) represents Fourier transform of Xk to the frequency domain, and IF(·) represents inverse Fourier transform, converting frequency domain data back to time series.

[0089] Using a linear layer neural network to analyze the spectrogram and calculate the importance weight of each frequency column can automatically filter out the frequency components that have a greater impact on the "future year air temperature" time series data. By weighting, these important frequency information is strengthened, and the relatively less important part is weakened, so that the subsequent generated prediction data focuses more on the core periodic fluctuations and other key factors, improving the accuracy and reliability of the prediction.

[0090] Patch Attention is a method proposed by the present application:

[0091] b) Patch Attention

[0092] Operation: Cut the whole spectrogram Ak into many small, non-overlapping patches, like cutting a big picture into many small puzzle pieces. Each small patch contains the information of a local frequency region.

[0093] 2D RoPE Attention: Send these “frequency patches” into a special attention network. The key point is that 2D Rotated Position Encoding (RoPE) is used. This lets the model not only focus on the information inside each patch, but also know exactly where each patch is in the whole spectrogram (which frequency range, which amplitude region), and calculate the correlation between different patches.

[0094] Result: The model equally examines and processes each local region (each patch) of the spectrogram. Even if a patch is mainly low amplitude (such as the frequency region corresponding to a solstice or weather disturbance), the model has the opportunity to learn it because its patch is included in the attention calculation.

[0095] What problem is solved: Prevent the model from ignoring frequency information with low amplitude but may be meaningful (such as solstice fluctuations). Ensure that the information of all frequency regions is “seen” and considered. Corresponding to “equally learn all frequencies”.

[0096] The following three formulas are the calculation of Patch Attention

[0097]

[0098] · F(·) represents the Fourier transform of Xk to the frequency domain to obtain the amplitude of each frequency component. Patch(·) represents the division of Ak into multiple non-overlapping local feature blocks. represents the normalization of the data. Attention(·) represents the calculation of the dependence between data points. IF(·) represents the inverse Fourier transform, which converts the frequency domain data back to time series.

[0099] The following two formulas are the calculation of 2d repo

[0100]

[0101] R(n,t) represents the elements of the rotation matrix, where: n is the position index, t is the frequency index, represents the complex exponential function of the rotation at position n and frequency t, Re(·) represents the real part of the complex number, and * represents the complex conjugate operation.

[0102] The weighted spectrogram is divided into multiple patches, and 2D rotation position encoding is adopted. This operation not only considers the information of local frequency regions, but also gives these local features a position-dependent unique representation through rotation position encoding, enabling the model to better capture the correlation and difference between different local frequency regions, enriching the description of frequency domain information and helping to more accurately restore the characteristics of temperature changes at different stages.

[0103] c) Residual connection fusion:

[0104] Operation: Add the output of Patch Attention (which contains equal learning information of all frequencies) to the adaptively weighted output Gk (which contains reinforced information of key frequencies) (residual connection).

[0105] Result: Obtain the final seasonal frequency representation that integrates the dual advantages. It retains and reinforces key patterns (seasons, solstices and equinoxes) without losing other potentially important details (certain specific weather patterns).

[0106] Effect: This is the core "magic" of DiffFreq, allowing the model to achieve "equal look at the whole" and "focus on the key" at the same time.

[0107] With the help of attention network, attention calculation is performed on the segmented patches, allowing the model to dynamically focus on more critical local areas and feature combinations in the spectrogram, adaptively allocate computing resources, and further explore deep feature relationships, thereby integrating more representative and valuable attention output and optimizing the utilization of frequency domain information in the entire generation process.

[0108] Through residual connection, the attention output is fused with the weighted spectrogram, so that the fused frequency signal can retain the basic frequency information in the original spectrogram and also incorporate important features filtered and refined by the attention mechanism, effectively avoiding problems such as gradient disappearance that may occur during information fusion, which helps to better optimize the frequency signal and improve the quality of the final generated seasonal components.

[0109] 3. Time series reconstruction

[0110] Operation: Convert the frequency signal optimized through fusion (result of the previous step) back to the time domain through inverse Fourier transform (IFFT).

[0111] Result: Obtain high-quality seasonal components Sk. This Sk contains clear seasonal fluctuations, distinguishable solstice transitions, and even possibly contains some regular weather disturbance patterns, while suppressing most pure noise.

[0112] 4. Generate the final time series

[0113] Operation: Extract the trend component Tk (capturing the long-term rising trend of global warming) from the noisy data Xk using polynomial regression.

[0114]

[0115] where “·” denotes tensor multiplication. Here, the polynomial space C is a matrix of powers of the vector c = [1, 2,..., t-2, t-1, t] / t, t represents the time step, and p is a small order (e.g., p = 3)

[0116] The model can also separate a small residual component Rk (completely random noise); add Tk (trend) + Sk (optimized seasonality) + Rk (residual / noise).

[0117] Result: Generate predicted, clean initial data X0, that is, the final high-quality future year temperature time series. This sequence: has a clear long-term warming trend (Tk). Has significant and detailed four-season replacement and solstice fluctuations (Sk, thanks to double learning). Retains the necessary randomness (Rk).

[0118] After the above series of frequency domain processing, the seasonality component converted back to the time domain has clear four-season fluctuations and distinguishable solstice transitions, which can well restore the changes of temperature with the replacement of seasons within a year. At the same time, the trend component is extracted using polynomial regression, and finally the two are added to obtain the predicted initial data, which takes into account both long-term trends and periodic seasonal changes, making the prediction results more in line with the actual temperature change law, improving the practicality and credibility of the prediction data.

[0119] 5. Loss calculation

[0120] Operation: Calculate the difference between the generated X0 and the true, clean X0 (i.e., the actual data in the dataset) as the loss.

[0121] Double loss:

[0122] Time domain loss (L_tmp): Directly compare the difference (mean square error MSE) between the generated sequence and the true sequence at the time point. Ensure overall shape matching.

[0123]

[0124] Frequency domain loss (L_feq): Do FFT on both the generated sequence and the true sequence, and compare their differences in the frequency domain (L1 Loss). Core role: Force the model not only to look like in time, but also in frequency components (which periods exist, how strong they are). This directly supervises the quality of seasonal decomposition.

[0125]

[0126] Weighted total loss (L_alpha): Add two losses proportionally (alpha).

[0127] Objective: According to this total loss, adjust all parameters of the model (including adaptive weight layer, patch attention, trend extractor, etc.) through back propagation, so that the next generation is better. Frequency domain loss L_feq is the key supervision signal to drive the model to learn frequency information well.

[0128]

[0129] Achieved effect:

[0130] 1. Generation quality improved:

[0131] On 6 benchmark datasets, the average correlation score (Corr.) decreased by 36%, and the Context-FID decreased by 19%;

[0132] In the long-term sequence generation task (ETTh dataset 128 steps), the FID index improved by 38% compared with the optimal baseline.

[0133] 2. Frequency learning ability optimized:

[0134] Simultaneously capture high-amplitude core patterns (such as seasonal cycles) and low-amplitude details (such as sudden anomalies);

[0135] Adaptive weight visualization verifies that the model selectively strengthens key frequencies.

[0136] 3. Application expandability:

[0137] Suitable for time series generation in multiple fields such as finance, medicine, and energy (verified by Stock, fMRI, etc. datasets).

[0138] Further, after sending all blocks into an attention network for attention calculation to obtain attention output, the steps include:

[0139] The attention network separates a residual component, and the residual component is completely random noise;

[0140] Add the seasonal component, the trend component, and the residual component to obtain the predicted "future year temperature" initial data. Represented as Tk (trend) + Sk (optimized season) + Rk (residual / noise) is added.

[0141] In real temperature data, in addition to regular seasonal fluctuations and long-term trends, there are inevitably some random noise components that are difficult to accurately depict with conventional patterns. By allowing the attention network to separate completely random noise as a residual component and adding it to the initial data calculation of the final prediction "future year temperature" (i.e. Tk+Sk+Rk form), the prediction result can more comprehensively reflect the complex situation of actual temperature changes, and improve the model's fitting ability for temperature data with uncertainty and randomness in the real world.

[0142] The present application actively separates and considers the noise component in the form of a residual component, which means that the model is not simply trying to filter out all noise, but rather acknowledges its existence and attempts to adapt to this random change. In this way, when faced with different levels and types of noise interference, the model can show better adaptability and will not cause large deviations in the prediction result due to the presence of noise, enhancing the model's robustness in complex and changing real-world application scenarios and ensuring the stability and reliability of the prediction result.

[0143] After adding the seasonal component, the trend component and the residual component to obtain the predicted "future year temperature" initial data, the steps include: collecting real future year temperature time series to obtain real data; calculating the loss between the initial data and the real data to obtain the weighted total loss; adjusting all parameters of the model based on the weighted total loss backpropagation, including adaptive weight layer, Patch Attention, and trend extractor.

[0144] The present application can automatically adjust the parameters of the adaptive weight layer, Patch Attention and trend extractor based on the differences between the actual observed temperature data and the prediction result by collecting real data and calculating the loss function for backpropagation. This end-to-end learning mechanism allows the model to dynamically optimize each processing step based on the characteristics of the real data, avoiding the tedious process of manually adjusting parameters and improving the automation level and optimization efficiency of the model.

[0145] The calculation of the loss function directly measures the deviation between the predicted data and the real data, and by minimizing this deviation, the model can continuously improve its ability to capture temperature change patterns. Especially based on the frequency domain double learning mechanism combined with parameter optimization, the model can more accurately identify important frequency components, adjust the attention allocation of local features, and optimize the fitting effect of trend extraction, thereby significantly improving the accuracy and reliability of the "future year temperature" prediction.

[0146] In an embodiment, the time series generation system based on the frequency domain double learning mechanism comprises: a frequency transformation module, obtaining the noisy "future one-year temperature" time series data, performing Fourier transform on the time series data to obtain a frequency spectrum, the horizontal axis is frequency, and the vertical axis is amplitude; an adaptive weighting module, using a linear layer neural network to analyze the frequency spectrum, calculating the importance weight of each frequency column on the frequency spectrum, and multiplying the corresponding frequency column based on the importance weight to obtain the weighted frequency spectrum; a frequency spectrum segmentation module, segmenting the frequency spectrum into multiple blocks, each block containing local frequency area information, and using 2D rotation position encoding on the block; an attention calculation module, feeding all the blocks into an attention network for attention calculation to obtain an attention output; a fusion optimization module, performing residual connection on the attention output and the weighted frequency spectrum to obtain a fusion-optimized frequency signal; an inverse transformation module, converting the fusion-optimized frequency signal back to the time domain through inverse Fourier transform to obtain a seasonal component, the seasonal component including clear four-season fluctuations and distinguishable solstice transitions; a trend component extraction module, extracting a trend component from the noisy "future one-year temperature" time series data by polynomial regression; an initial data generation module, adding the seasonal component and the trend component to obtain predicted "future one-year temperature" initial data; and a loss calculation module, collecting a real future one-year temperature time series to obtain real data, performing loss calculation on the initial data and the real data to obtain a weighted total loss.

[0147] The memory, as a kind of non-transient computer readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs.In addition, the memory can include high-speed random access memory, and can also include non-transient memory, such as at least one magnetic disk storage device, flash memory device, or other non-transient solid-state storage device.In some embodiments, the memory can optionally include a memory remotely arranged relative to the processor, which can be connected to the processor through a network.The examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network and a combination thereof.

[0148] The device embodiments described above are only schematic, wherein the units described as separate components can or can not be physically separate, and can be located in one place or distributed on multiple network units.A part or all of the modules can be selected according to actual needs to achieve the purpose of the embodiment.

[0149] In addition, one embodiment of the present application also provides a computer readable storage medium, which stores computer executable instructions, the computer executable instructions are executed by a processor or controller, for example, a processor in the above terminal embodiment, so that the above processor executes the time series generation method based on the frequency domain double learning mechanism in the above embodiment.

[0150] Those skilled in the art will appreciate that all or certain steps of the methods disclosed above can be implemented as software, firmware, hardware, and suitable combinations thereof. Certain physical components or all physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software can be distributed on computer readable media, which can include computer storage media (or non-transitory media) and communication media (or transitory media). As is well known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by a computer. Further, it is common in the art for a person skilled in the art to appreciate that communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. Accordingly, the disclosure is considered to include any modification or derivative of the above disclosed methods that otherwise falls within the scope of the present claims.

[0151] The above description is only specific implementation of the present application, but the present application is not limited to the above implementation, and those skilled in the art can make various equivalent modifications or replacements without departing from the spirit of the present application, and these equivalent modifications or replacements are included in the scope defined by the claims of the present application.

[0152] The above description of the specific implementation of the present application does not constitute a limitation on the scope of protection of the present application. Any various other corresponding changes and modifications made according to the technical concept of the present application should be included in the scope of protection of the claims of the present application.

Claims

1. A time series generation method based on frequency domain dual learning mechanism, characterized in that: Including steps: Obtain noisy time series data for "temperature in the next year" and perform Fourier transform on the data to the frequency domain to obtain a spectrum graph, with the horizontal axis representing frequency and the vertical axis representing amplitude. Analyzing the spectrogram using a linear layer neural network, calculating the importance weight of each frequency column on the spectrogram, and multiplying the importance weight by the corresponding frequency column to obtain a weighted spectrogram; Dividing the weighted spectrum map into a plurality of blocks, each block containing information of a local frequency region, and applying 2D rotation position encoding to the blocks; Send all the blocks into an attention network for attention calculation to obtain attention output; Performing a residual connection between the attention output and the weighted spectrogram to obtain a fused and optimized frequency signal; The fused and optimized frequency signal is converted back to the time domain through inverse Fourier transform to obtain seasonal components, which include clear seasonal fluctuations and discernible solar term transitions; Use polynomial regression to extract trend components from the noisy "temperature in the next year" time series data; The seasonal component and the trend component are added together to obtain the predicted initial data of "temperature in the next year".

2. The time series generation method based on the frequency domain dual learning mechanism according to claim 1 is characterized in that: After all the blocks are fed into an attention network for attention calculation to obtain attention output, the following steps are also included: The attention network separates a residual component, which is completely random noise; The seasonal component, the trend component and the residual component are added together to obtain the predicted initial data of "temperature in the next year".

3. The time series generation method based on frequency domain dual learning mechanism according to claim 2 is characterized in that: After the seasonal component, the trend component and the residual component are added together to obtain the predicted initial data of "temperature in the next year", the method includes the following steps: Collect the real temperature time series for the next year to obtain real data; Performing loss calculation on the initial data and the real data to obtain a weighted total loss; Based on the weighted total loss backpropagation, all model parameters are adjusted, including the adaptive weight layer, PatchAttention, and trend extractor.

4. The time series generation method based on the frequency domain dual learning mechanism according to claim 3 is characterized in that: Calculating the loss of the initial data and the real data includes the following steps: Time domain loss (L_tmp): directly compares the difference between the initial data and the real data at the time point; Frequency domain loss (L_feq): Perform Fourier transform on both the initial data and the real data, and compare the differences in the frequency domain; Weighted total loss (L_alpha): Add the time domain loss and frequency domain loss in proportion (alpha).

5. The time series generation method based on frequency domain dual learning mechanism according to claim 1 is characterized in that: The frequency column includes: Four seasons columns, solar terms columns and noise columns.

6. The time series generation method based on frequency domain dual learning mechanism according to claim 5 is characterized in that: Calculating the importance weight of each frequency bin on the spectrogram includes: The weight of the four seasons column is 0.9, the weight of the solar term column is 0.7, and the weight of the noise column is 0.

01.

7. A time series generation system based on frequency domain dual learning mechanism, characterized in that: include: The frequency conversion module obtains the noisy "temperature in the next year" time series data and performs Fourier transform on the time series data to the frequency domain to obtain a spectrum graph with the horizontal axis being frequency and the vertical axis being amplitude. an adaptive weighting module that uses a linear layer neural network to analyze the spectrogram, calculates the importance weight of each frequency bin on the spectrogram, and multiplies the importance weight by the corresponding frequency bin to obtain a weighted spectrogram; A spectrum segmentation module, which segments the spectrum map into a plurality of blocks, each of which contains information of a local frequency region, and uses 2D rotation position encoding for the blocks; An attention calculation module sends all the blocks into an attention network for attention calculation to obtain attention output; A fusion optimization module performs a residual connection between the attention output and the weighted spectrogram to obtain a fusion-optimized frequency signal; The inverse transformation module converts the fused and optimized frequency signal back to the time domain through inverse Fourier transform to obtain seasonal components, which include clear seasonal fluctuations and discernible solar term transitions; The trend component extraction module uses polynomial regression to extract trend components from the noisy "temperature in the next year" time series data; The initial data generation module adds the seasonal component and the trend component to obtain the predicted initial data of "temperature in the next year".

8. The time series generation system based on frequency domain dual learning mechanism according to claim 7, characterized in that: Also includes: The loss calculation module collects the actual temperature time series of the next year to obtain real data, calculates the loss by combining the initial data with the real data, and obtains the weighted total loss.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the time series generation method based on the frequency domain dual learning mechanism according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Traffic flow prediction method based on multi-scale map attention network, medium and equipment

    CN118711384A

  • Time sequence data modeling method for body-equipped agent based on frequency domain learning

    CN119357642A

  • Method and system for reconstructing magnetic particle distribution model based on time-frequency spectrum enhancement

    US11816767B1