An adaptive down-sampling time-sequential encoding method and system

By employing an adaptive downsampling time coding method, which utilizes a step size prediction module and self-attention interactive computation, the problem of downsampling factor dependence on human experience in existing technologies is solved, achieving efficient and accurate time coding that is applicable to various cross-domain time signal processing.

CN121690216BActive Publication Date: 2026-05-15SHANGHAI ARTIFICIAL INTELLIGENCE INNOVATION CENT
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANGHAI ARTIFICIAL INTELLIGENCE INNOVATION CENT
Filing Date
2026-02-11
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

In existing technologies, the selection of downsampling factor in time-series coding relies on human experience and preset rules, which cannot be dynamically optimized according to the specific characteristics of the input signal, resulting in non-adaptive issues that affect model performance and computational efficiency.

Method used

An adaptive downsampling temporal coding method is adopted, which dynamically generates prediction window parameters through a step size prediction module. Combined with a smooth window function, self-attention interactive calculation, and regularization constraints, adaptive downsampling and feature extraction of the signal are realized.

Benefits of technology

It realizes dynamic optimization of downsampling strategy based on input signal characteristics, reduces computational overhead and memory usage, improves the efficiency and accuracy of timing coding, and avoids the loss of signal boundary information and the impact of extreme strategies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121690216B_ABST
    Figure CN121690216B_ABST
Patent Text Reader

Abstract

The application discloses a kind of self-adapting downsampling time series encoding method and system.The method includes providing step prediction module based on learnable network, dynamically generating prediction window parameters based on the global feature of multidimensional time series signal, generating smoothing window function according to the prediction window parameters, weighting multidimensional time series signal and smoothing window function to obtain multiple groups of soft block signals, performing two-dimensional self-attention calculation on each group of signals and extracting feature vectors, and outputting sequence representation after reorganization through global self-attention calculation.The system corresponds to each corresponding functional module, including step learner based on learnable network, and introducing regularization term to optimize training loss.The application gets rid of artificial experience dependence, realizes the adaptive downsampling of time series signal, avoids boundary information loss and extreme downsampling strategy, improves encoding efficiency, accuracy and universality, and can be widely applied to astronomical gravitational wave monitoring, medical treatment, industrial and other cross-domain time series signal processing scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of time series analysis technology, and more specifically, to an adaptive downsampling time series coding method and system. Background Technology

[0002] One of the core tasks of time series analysis is to extract features from the original time series signal and downsample it using an encoder to generate a compact and information-rich feature representation that can meet the processing requirements of subsequent large-scale models. In this process, the choice of downsampling factor directly affects the overall performance of the model. A reasonable downsampling strategy needs to strike a balance between preserving the key information of the original signal and controlling computational overhead and memory usage.

[0003] In existing technologies, static mapping strategies are commonly used to determine the downsampling factor for time-series signals of different lengths. Specifically, a correspondence between the input signal length and a recommended downsampling factor is pre-established, and a fixed downsampling rate is selected for signals of specific lengths based on this relationship during processing. Typical implementation schemes include feature extraction through manually designed block length combinations, preprocessing modules that select a fixed compression factor based on the signal length to compress the feature length to a fixed range, downsampling with a fixed factor in the time dimension and reducing computational cost through sparse attention, and controlling the downsampling factor by manually adjusting the sliding window length. However, these existing technologies all have significant drawbacks. The setting of their downsampling factors is highly dependent on human experience and preset rules, and is a non-adaptive processing method that cannot dynamically optimize the downsampling strategy based on the specific characteristics of the input signal. This results in the selected downsampling factor often not being optimal.

[0004] Therefore, there is an urgent need for a timing coding scheme with adaptive downsampling capability, which can get rid of the dependence on human experience and preset rules, dynamically optimize the downsampling strategy according to the specific characteristics of the input signal, and retain the key information of the original signal to the maximum extent while effectively controlling the computational overhead and memory usage, thus solving the technical problems of non-adaptive downsampling and dependence on human experience and preset rules in the existing technology. Summary of the Invention

[0005] Based on existing technology, the objective of this invention is to provide an adaptive downsampling timing coding method and system, which enables the timing coding model to automatically learn and optimize the optimal downsampling ratio for different input signals. This solves the problem that the setting of the downsampling ratio in existing technical solutions depends on human experience and preset rules, and cannot achieve dynamic optimization based on the specific characteristics of the input signal.

[0006] A first aspect of the present invention provides an adaptive downsampling timing coding method, comprising:

[0007] A step size prediction module is provided, into which a multidimensional time series signal is input. The step size prediction module generates prediction window parameters based on the global features of the multidimensional time series signal using a learnable network.

[0008] A smoothing window function is provided based on the prediction window parameters;

[0009] The multidimensional time-series signal is weighted and calculated with the smooth window function, and the result is divided into multiple soft block signals;

[0010] Extract the feature vector corresponding to each group of soft-block signals; and

[0011] The feature vectors are recombined, and the final sequence representation is output.

[0012] Furthermore, the prediction window parameters include window length parameters and / or window spacing parameters.

[0013] Furthermore, the step size prediction module generates prediction window parameters based on the global features of the multidimensional time series signal, including:

[0014] The total sequence length of the multidimensional time-series signal is logarithmically transformed.

[0015] Simultaneously, the global sequence features of the multidimensional time-series signal are extracted;

[0016] The logarithmically transformed sequence length and the global sequence features are input into the step size prediction module and fused to obtain the logarithmic step size.

[0017] Perform an exponential transformation on the logarithmic step size to obtain the window interval parameter; and

[0018] The window length parameter is calculated according to the linkage rule between window length and window spacing parameter.

[0019] Furthermore, the smoothing window function includes a Gaussian window function and / or a Hanning window function.

[0020] Further, the extraction of the feature vector corresponding to each group of soft-block signals includes:

[0021] For each group of soft-block signals, perform self-attention interaction computation in both time and channel dimensions; and

[0022] The soft block signals of each group are compressed by average pooling, and the feature vector corresponding to the soft block signals of that group is extracted.

[0023] Furthermore, the reorganization of the feature vector and the output of the final sequence representation includes:

[0024] The feature vectors are reorganized according to their original chronological order; and

[0025] Perform global self-attention interactive computation on the recombined feature vectors and output the final sequence representation.

[0026] Furthermore, the method also includes providing a regularization term for the window parameters and the output sequence to optimize the training loss function, the training loss function being expressed as:

[0027]

[0028] in,

[0029] Indicates the total training loss;

[0030] Indicates loss of the main task;

[0031] This represents the step size penalty term, which is configured to impose a loss on step sizes exceeding a threshold;

[0032] This represents the output sequence length penalty term, which is configured to impose a loss on sequences that are too long and / or too short.

[0033] and This represents the weighting coefficient.

[0034] A second aspect of the present invention provides an adaptive downsampling timing coding system, comprising:

[0035] The step size prediction module is configured to extract global features of the input multidimensional time series signal and dynamically predict prediction window parameters that are adapted to the signal based on a learnable network.

[0036] The function generation module is communicatively connected to the step size prediction module, and the function generation module is configured to generate a smoothing window function based on the prediction window parameters.

[0037] The window grouping module is communicatively connected to the step size prediction module and the function generation module, respectively. The window grouping module is configured to perform weighted calculation on the multidimensional time series signal and the smooth window function, and divide the calculation result into multiple soft block signals.

[0038] The feature extraction module, communicatively connected to the windowing grouping module, performs self-attention interaction calculations in both the time and channel dimensions on each group of soft-block signals, then compresses and extracts the feature vector corresponding to each group of soft-block signals; and

[0039] A global self-attention module is communicatively connected to the feature extraction module. The global self-attention module is configured to reorganize the feature vectors into a feature sequence according to the original time order and perform global self-attention interactive calculation on the feature sequence.

[0040] Furthermore, the system also includes:

[0041] The regularization constraint module is communicatively connected to the step size prediction module and the global self-attention module, respectively, and is used to constrain and optimize the window parameters and output sequence during the end-to-end training process of the system, and output the final sequence representation with adaptive downsampling characteristics.

[0042] Furthermore, the step size prediction module includes a step size learner for predicting the prediction window parameters, the step size learner comprising:

[0043] A logarithmic transformation unit is configured to perform a logarithmic transformation on the total sequence length of the multidimensional time-series signal to obtain a logarithmic sequence length;

[0044] A global sequence feature extraction unit is configured to extract global sequence features from the multidimensional time-series signal;

[0045] The fusion calculation unit is communicatively connected to the logarithmic transformation unit and the global sequence feature extraction unit, and is configured to fuse the logarithmic sequence length with the global sequence features to calculate and output the logarithmic step size.

[0046] An exponential transformation unit, communicatively connected to the fusion computing unit, is configured to perform an exponential transformation on the logarithmic step size to obtain the window interval parameter in the prediction window parameters; and

[0047] The linkage calculation unit is communicatively connected to the exponential transformation unit and is configured to calculate the window length parameter in the prediction window parameters according to the linkage rule between the window length parameter and the window interval parameter.

[0048] The present invention has at least the following beneficial effects:

[0049] (1) This invention achieves adaptive downsampling of time-series signals, eliminating the reliance on human experience and preset rules in existing technologies. By dynamically predicting window parameters through a learnable step-size learner, the downsampling strategy can be adjusted according to the global features and specific attributes of the input multi-dimensional time-series signal, effectively avoiding the problems of over-compression or insufficient downsampling caused by a fixed downsampling rate. While preserving key information of the signal, it significantly reduces computational overhead and memory usage, thereby improving the overall efficiency of time-series coding.

[0050] (2) This invention uses a differentiable soft-block approach to process the original time-series signal. By using a continuous and smooth window function to perform weighted calculations with the signal, it avoids the loss of signal boundary information caused by hard-blocking. At the same time, the differentiable characteristics of soft-blocking support end-to-end training of the model and can be coordinated with subsequent modules such as feature extraction and global fusion to further improve the accuracy and stability of time-series coding.

[0051] (3) This invention fully explores the local spatiotemporal dependencies of time-series signals through a dual-dimensional self-attention interactive computation and multi-feature fusion strategy. The time-dimensional self-attention captures the temporal correlations of different time steps within the same channel, while the channel-dimensional self-attention mines the cross-feature collaborative changes of different channels within the same time step. Combined with step size prediction of multi-feature fusion, the extracted features are more comprehensive and representative, providing high-quality feature support for subsequent time-series processing tasks.

[0052] (4) This invention introduces a regularization constraint mechanism, which optimizes the training loss function through step size penalty term and output sequence length penalty term, effectively avoiding unreasonable extreme downsampling strategies. This constraint mechanism can balance the relationship between downsampling efficiency and signal information preservation, preventing the model from over-compressing and causing loss of key information or under-downsampling and causing computational redundancy, thus ensuring the stability of model training and the reliability of encoding effect.

[0053] In summary, this invention effectively solves the problems of non-adaptive downsampling, information-efficiency imbalance, and loss of boundary information in existing time-series coding technologies by employing adaptive downsampling strategies, flexible microblocking, two-dimensional self-attention fusion, and regularization constraints. It significantly improves the efficiency, accuracy, and versatility of time-series coding while reducing the cost of manual intervention and ensuring the stability and practicality of the model. This invention can be widely applied to various cross-domain time-series signal processing scenarios, such as astronomical gravitational wave monitoring, sleep monitoring, industrial vibration detection, ecological time-series analysis, medical image time-series processing, and mental health monitoring, providing efficient and reliable coding support for various time-series related tasks. It possesses significant practical application value and promising prospects for widespread adoption. Attached Figure Description

[0054] To further illustrate the advantages and other features of the various embodiments of the present invention, a more specific description of the embodiments of the present invention will be presented with reference to the accompanying drawings. It is understood that these drawings depict only typical embodiments of the invention and are therefore not intended to limit its scope. In the drawings, identical or corresponding parts will be indicated by the same or similar reference numerals for clarity.

[0055] Figure 1 A flowchart of a method according to one embodiment of the present invention is shown.

[0056] Figure 2A system module architecture diagram of one embodiment of the present invention is shown.

[0057] Figure 3 A schematic diagram illustrating the structure and principle of a method and system in one embodiment of the present invention is shown.

[0058] Figure 4 A schematic diagram of the step-size learner in one embodiment of the present invention is shown.

[0059] List of reference numerals

[0060] 100 coding system

[0061] 101 Step Size Prediction Module

[0062] 101-1 Logarithmic Transformation Unit

[0063] 101-2 Global Sequence Feature Extraction Unit

[0064] 101-3 Fusion Computing Unit

[0065] 101-4 Exponential Transformation Unit

[0066] 101-5 Linked Computing Unit

[0067] 102 Function Generation Module

[0068] 103 Window Grouping Module

[0069] 104 Feature Extraction Module

[0070] 105 Global Self-Attention Module

[0071] 106 Regular Constraint Module Detailed Implementation

[0072] It should be noted that the components in the various figures may be shown exaggeratedly for illustrative purposes and are not necessarily to scale. In each figure, the same reference numerals are used for components that are identical or have the same function.

[0073] In this invention, the various embodiments are merely intended to illustrate the solutions of the invention and should not be construed as limiting.

[0074] It should also be noted that, in the embodiments of the present invention, only a portion of the components or parts may be shown for clarity and simplicity. However, those skilled in the art will understand that, under the teachings of the present invention, necessary components or parts can be added as needed for specific scenarios. Furthermore, unless otherwise stated, features in different embodiments of the present invention can be combined with each other. For example, a feature in the second embodiment can replace a corresponding or functionally identical or similar feature in the first embodiment, and the resulting embodiment will also fall within the scope of disclosure or description of this application.

[0075] In this invention, the modules of the system according to the invention can be implemented using software, hardware, firmware, or a combination thereof. When a module is implemented using software, its function can be implemented through computer program flow. For example, the module can be implemented using code segments (such as code segments in languages ​​like C and C++) stored in a storage device (such as a hard disk, memory, etc.), wherein the corresponding function of the module can be implemented when the code segment is executed by a processor. When a module is implemented using hardware, its function can be implemented by setting a corresponding hardware structure. For example, the module's function can be implemented by hardware programming a programmable device such as a field-programmable gate array (FPGA), or by designing an application-specific integrated circuit (ASIC) that includes multiple transistors, resistors, capacitors, and other electronic devices. When a module is implemented using firmware, the module's function can be written into a read-only memory such as an EPROM or EEPROM in the form of program code, and the corresponding function of the module can be implemented when the program code is executed by a processor. In addition, some functions of the module may need to be implemented by separate hardware or by working in cooperation with the hardware. For example, the detection function is implemented by a corresponding sensor (such as a proximity sensor, accelerometer, gyroscope, etc.), the signal transmission function is implemented by a corresponding communication device (such as a Bluetooth device, infrared communication device, baseband communication device, Wi-Fi communication device, etc.), the output function is implemented by a corresponding output device (such as a display, speaker, etc.), and so on.

[0076] In this invention, "F1 score" refers to a statistical indicator used to measure the accuracy of a binary classification model. Its maximum value is 100 and its minimum value is 0. The higher the F1 score, the higher the model accuracy.

[0077] Furthermore, the numbering of the steps in the methods of the present invention does not limit the execution order of the method steps. Unless otherwise specified, the method steps may be executed in different orders.

[0078] The present invention will be further described below with reference to the accompanying drawings and specific embodiments.

[0079] Figure 1 A flowchart of a method according to one embodiment of the present invention is shown.

[0080] In one embodiment of the present invention, an adaptive downsampling timing coding method is provided, specifically including the following steps:

[0081] S100. Generation of prediction window parameters for the learnable step-size prediction module: The multi-dimensional time-series signal to be encoded is acquired and input into a pre-constructed step-size prediction module. The step-size prediction module dynamically generates prediction window parameters adapted to the current signal based on the global characteristics of the multi-dimensional time-series signal. The global characteristics include one or more of the following: the total sequence length, number of channels, and global statistical characteristics in the time domain. The global statistical characteristics in the time domain encompass features characterizing the overall attributes of the signal, such as the mean, variance, and overall fluctuation amplitude across the entire time dimension.

[0082] In one embodiment of the present invention, the prediction window parameters include a window length parameter and a window spacing parameter.

[0083] In a specific embodiment of the present invention, the specific generation process of the prediction window parameter is as follows: First, a logarithmic transformation is performed on the total sequence length of the multidimensional time series signal to convert the linear scale length into a logarithmic scale. At the same time, feature extraction is performed on the original multidimensional time series signal to obtain global sequence features. Then, the logarithmically transformed sequence length and the global sequence features are input into the step size prediction module. The step size prediction module includes a step size learner constructed using a lightweight multilayer perceptron. After weight calculation and feature fusion within the network, a logarithmic step size is output. An exponential transformation is performed on the logarithmic step size to restore it to a linear scale window interval parameter. Finally, according to the preset linkage rules between the window length and the window interval parameter, the window length parameter is calculated based on the window interval parameter to achieve adaptive generation of the prediction window parameter.

[0084] S200. Generation of smooth window functions based on prediction window parameters: Based on the window length parameter and window interval parameter obtained in step S100, a set of smooth window functions adapted to the current multidimensional time series signal is generated. The number of smooth window functions is determined by the total sequence length of the multidimensional time series signal and the window interval parameter. The time coverage of a single smooth window function is limited by the window length parameter. The offset of two adjacent smooth window functions on the time axis is limited by the window interval parameter. The generated smooth window functions all have the characteristics of continuous smoothness, providing a differentiable basis for subsequent weighted calculations.

[0085] In a specific embodiment of the present invention, the smoothing window function may be a Gaussian window function or a Hanning window function.

[0086] S300. Windowing Weighting and Soft Blocking of Multidimensional Time-Series Signals: The original multidimensional time-series signal is weighted by a set of smoothing window functions generated in step S200. The weighting calculation uses element-wise multiplication, that is, the value at each time point in the multidimensional time-series signal is multiplied element-wise by the weight value of the corresponding smoothing window function to complete the windowing operation. Based on the weighting calculation result, the original multidimensional time-series signal is divided into multiple groups of soft-block signals. Each group of soft-block signals corresponds to the weighting result of a smoothing window function. Because the smoothing window function has the characteristic of continuous smoothness, the soft-block signals have no obvious hard cutting boundaries, effectively avoiding the loss of signal boundary information and realizing the soft blocking of the original signal.

[0087] S400. High-dimensional feature vector extraction of soft-block signals: Feature extraction is performed on each group of soft-block signals obtained in step S300 to obtain the high-dimensional feature vector corresponding to each group of signals. Specifically, the extraction process involves first performing self-attention interaction calculations in the time dimension and channel dimension sequentially on a single group of soft-block signals. In the time dimension self-attention interaction calculation, the temporal dependencies between signals at different time steps within the same channel are explored; in the channel dimension self-attention interaction calculation, the cross-feature dependencies between signals from different channels within the same time step are explored, fully capturing the local spatiotemporal dependency features within each group of soft-block signals. Then, average pooling is performed on each group of soft-block signals after the self-attention interaction calculation, compressing and aggregating the features of each group of signals, condensing the high-dimensional soft-block features into a one-dimensional high-dimensional feature vector, thus completing the high-dimensional feature vector extraction for a single group of signals.

[0088] S500, Preliminary Sequence Representation Output from High-Dimensional Feature Vector Recombination and Global Fusion: All high-dimensional feature vectors extracted in step S400 are collected. Following the temporal order of each soft-block signal in the original multi-dimensional time-series signal, all high-dimensional feature vectors are recombined into an ordered feature sequence, ensuring temporal consistency of the features. The recombined feature sequence is input into the global self-attention module. Through global self-attention interactive computation, global contextual association information between different soft-block signals is mined, achieving global fusion of each group of local features. After processing by the global self-attention module, a preliminary sequence representation is output.

[0089] S600. Final sequence representation output after training loss function optimization: During end-to-end training, a regularization term for the window parameters and the output sequence is introduced to optimize the training loss function. The optimized training loss function is then used for backpropagation to update the weight parameters of all learnable networks, including the step size prediction module and the self-attention module, ultimately outputting a final sequence representation with adaptive downsampling characteristics. The training loss function is a composite loss function, and its expression is:

[0090]

[0091] in,

[0092] Indicates the total training loss;

[0093] The loss represents the main task loss, which is determined based on the actual downstream task of this temporal coding method. Conventional loss functions in this field, such as cross-entropy loss and mean squared error loss, can be selected.

[0094] This represents the step size penalty term, which is configured to impose a loss on step sizes exceeding a threshold;

[0095] This represents the output sequence length penalty term, which is configured to impose a loss on output sequence lengths N that are too long or too short.

[0096] and This represents the weighting coefficient, used to balance the loss of the main task with the loss of the regularization penalty term, so as to avoid unreasonable extreme downsampling strategies while completing the downstream main task.

[0097] In a specific embodiment of the present invention, the step size penalty term Represented as:

[0098]

[0099] In this embodiment, the step size penalty term Only penalize step length In extreme cases, >400 When the value is ≤400, the penalty term has a loss of 0 and no additional constraints. A logarithmic transformation can be used to make the penalty vary with the step size. The increase in value is smooth and incremental, avoiding abrupt changes in loss at the threshold, making model training more stable; Huber loss combines the robustness of L1 loss and the smoothness of L2 loss, making it suitable for regularization constraint scenarios.

[0100] In a specific embodiment of the present invention, the output sequence length penalty term is... Represented as:

[0101]

[0102] In this embodiment, the output sequence length penalty term is used. The bidirectional penalty applies to extreme cases where the output sequence length N > 200 and N < 5. It applies a loss to both excessively long and excessively short output sequences to constrain the output sequence length N to a reasonable range. This avoids both excessive compression and information loss due to an output sequence length N that is too small, and insufficient downsampling and computational redundancy due to an output sequence length N that is too large.

[0103] In one embodiment of the present invention, the method relies on a learnable step size prediction module to dynamically generate window parameters, achieves efficient encoding of time series signals through flexible micro-blocking and hierarchical self-attention feature mining, and introduces a regularization constraint mechanism to avoid extreme downsampling strategies, and finally outputs a sequence representation that has both information integrity and reasonable compression.

[0104] Figure 2 A system module architecture diagram of one embodiment of the present invention is shown.

[0105] like Figure 2 As shown, in one embodiment of the present invention, an adaptive downsampling temporal coding system (hereinafter referred to as the "coding system") 100 is provided. The coding system 100 is configured to adaptively downsample and encode features of the input multidimensional temporal signal. Through learnable window parameter prediction, soft segmentation, hierarchical self-attention feature fusion, and regularization constraints, it outputs a sequence representation that combines information integrity and computational efficiency, adapting to various subsequent temporal signal processing tasks. In one embodiment of the present invention, the coding system 100 includes a step size prediction module 101, a function generation module 102, a windowing grouping module 103, a feature extraction module 104, and a global self-attention module 105. Each module is connected through a preset communication link to collaboratively complete the entire temporal coding process. In some embodiments, a regularization constraint module 106 may be added to further optimize the coding effect.

[0106] In one embodiment of the present invention, the step size prediction module 101, as the core control module of the encoding system 100, is configured to extract global features of the input multidimensional time-series signal and dynamically predict prediction window parameters adapted to the signal based on a learnable network. The multidimensional time-series signal can originate from various time-series data scenarios such as multi-sensor monitoring, medical signal acquisition, and industrial data monitoring, and is characterized by containing multiple time steps and multiple signal channels. The global features are a set of features that characterize the overall attributes of the multidimensional time-series signal, including but not limited to the total sequence length, number of channels, and global statistical characteristics in the time domain. The global statistical characteristics in the time domain encompass the signal's mean, variance, and overall fluctuation amplitude across the entire time dimension.

[0107] In one embodiment of the present invention, the core component of the step size prediction module 101 is a step size learner. The step size learner is constructed using a lightweight learnable network, preferably a multilayer perceptron, which has the characteristics of few parameters and fast inference speed. It can avoid adding extra computational overhead to the window parameter prediction stage, and supports end-to-end training, which can continuously optimize the window parameter prediction accuracy through training. The step size learner integrates multiple functional units, which work together to generate the prediction window parameters. Specifically, it includes a logarithmic transformation unit 101-1, a global sequence feature extraction unit 101-2, a fusion calculation unit 101-3, an exponential transformation unit 101-4, and a linkage calculation unit 101-5.

[0108] In one embodiment of the present invention, the logarithmic transformation unit 101-1 is configured to perform a logarithmic transformation operation on the total sequence length of the multidimensional time series signal. Its core function is to convert the total sequence length on a linear scale to a logarithmic scale, so as to avoid the difficulty of subsequent learning networks due to the large difference in the total sequence length values ​​of different signals. At the same time, it realizes the scale normalization of the signal length and improves the stability of window parameter prediction.

[0109] In one embodiment of the present invention, the global sequence feature extraction unit 101-2 is configured to extract global sequence features of multidimensional time series signals. By performing lightweight feature processing on the original multidimensional time series signals, it captures abstract features such as the overall fluctuation pattern of the signal and the overall correlation between channels. These abstract features are then transformed into feature vectors that can be recognized and processed by the fusion computing unit, providing more comprehensive feature support for the accurate prediction of window parameters.

[0110] In one embodiment of the present invention, the fusion calculation unit 101-3 establishes communication connections with the logarithmic transformation unit 101-1 and the global sequence feature extraction unit 101-2, respectively, and is configured to receive the logarithmic sequence length output by the logarithmic transformation unit 101-1 and the global sequence feature vector output by the global sequence feature extraction unit 101-2, and perform feature fusion and weighted calculation on the two types of input data. Relying on the learnable weights of the step-size learner, the fusion calculation unit 101-3 autonomously mines the correlation between the logarithmic sequence length and the global sequence features, maps the fused features to a logarithmic step size and outputs it, completing the preliminary prediction of the window interval parameter.

[0111] In one embodiment of the present invention, the exponential transformation unit 101-4 is communicatively connected to the fusion computing unit 101-3 and is configured to receive the logarithmic step size output by the fusion computing unit 101-3, perform an inverse exponential transformation operation on the logarithmic step size, and restore the logarithmic step size of the logarithmic scale to a linear scale value, which is used as the window interval parameter in the prediction window parameters. This inverse exponential transformation operation can also ensure that the output window interval parameter is a positive number, which conforms to the physical meaning of the window interval parameter and avoids the occurrence of invalid negative value parameters.

[0112] In one embodiment of the present invention, the linkage calculation unit 101-5 is communicatively connected to the exponential transformation unit 101-4 and is configured to receive the window spacing parameter output by the exponential transformation unit 101-4. According to a preset linkage rule between the window length parameter and the window spacing parameter, the unit calculates the window length parameter in the prediction window parameters. The core purpose of the linkage rule is to ensure that the subsequently generated smooth window functions can achieve reasonable overlap, avoiding the loss of signal boundary information or computational redundancy during soft segmentation. The specific linkage relationship can be preset according to actual encoding requirements to ensure a reasonable ratio between the window length parameter and the window spacing parameter, enabling effective overlap between adjacent smooth window functions.

[0113] In one embodiment of the present invention, the function generation module 102 establishes a stable communication connection with the step size prediction module 101 and is configured to receive prediction window parameters output by the step size prediction module 101, including window length parameters and window interval parameters, and generate a set of continuously smooth window functions based on the prediction window parameters. The smooth window functions are continuously differentiable window functions, and Gaussian window functions and / or Hanning window functions can be selected. Their number is determined by the total sequence length of the multidimensional time-series signal and the window interval parameter. The time coverage of a single smooth window function is limited by the window length parameter, and the offset of two adjacent smooth window functions on the time axis is limited by the window interval parameter. The smooth window functions generated by the function generation module 102 provide a basis for the weighted calculation of the subsequent window grouping module 103. Their continuously differentiable characteristics can avoid the signal boundary information loss problem caused by hard segmentation, realizing the signal's soft segmentation.

[0114] In one embodiment of the present invention, the windowing grouping module 103 establishes communication connections with the step size prediction module 101 and the function generation module 102, respectively, and is configured to receive the original multidimensional time-series signal output by the step size prediction module 101 and a set of smoothing window functions output by the function generation module 102, perform weighted calculations on the two types of data, and divide the calculation results into multiple soft block signals. The weighted calculation adopts element-wise multiplication operation, specifically multiplying the value of each time point and each channel in the multidimensional time-series signal element-wise with the weight value of the corresponding smoothing window function. Through this weighted calculation, the signal is windowed, highlighting the key information in the signal center area, while smoothing the signal in the edge area. The windowing grouping module 103 naturally divides the weighted signal into multiple soft block signals according to the coverage of the smoothing window function. Each soft block signal corresponds to the weighted result of a smoothing window function. Since there is reasonable overlap between the smoothing window functions, there is also partial overlap between the soft block signals, effectively avoiding the breakage and loss of signal information.

[0115] In one embodiment of the present invention, the feature extraction module 104 establishes a communication connection with the window grouping module 103 and is configured to receive multiple sets of soft block signals output by the window grouping module 103, and perform feature extraction operations on each set of soft block signals to obtain a high-dimensional feature vector corresponding to each set of soft block signals. The core operation of the feature extraction module 104 is divided into two steps: the first step is local self-attention interaction calculation, and the second step is feature compression extraction. During the local self-attention interaction calculation, the feature extraction module 104 performs self-attention interaction calculations in the time dimension and channel dimension on a single set of soft block signals. Among them, the time dimension self-attention interaction calculation is used to mine the temporal dependency relationship between signals at different time steps within the same channel and capture the local temporal change law of the signal; the channel dimension self-attention interaction calculation is used to mine the cross-feature dependency relationship between signals in different channels within the same time step and capture the cooperative change law of signals in different channels. Through the two-dimensional self-attention interaction calculation, the local spatiotemporal dependency features within each set of soft block signals are fully mined. During the feature compression and extraction process, the feature extraction module 104 performs compression operations on each group of soft block signals after completing the self-attention interaction calculation. The preferred operation is average pooling, which condenses the high-dimensional soft block signal features into a one-dimensional high-dimensional feature vector. This not only achieves feature dimensionality reduction and compression, reducing subsequent computational overhead, but also preserves the core local features of each group of soft block signals.

[0116] In one embodiment of the present invention, the global self-attention module 105 establishes a communication connection with the feature extraction module 104 and is configured to receive all high-dimensional feature vectors output by the feature extraction module 104, completing the feature sequence recombination and global context fusion operations. First, the global self-attention module 105 reassembles all high-dimensional feature vectors into an ordered feature sequence according to the soft-block signals corresponding to each high-dimensional feature vector and their temporal order in the original multi-dimensional time-series signal. This ensures that the reassembled feature sequence retains the temporal characteristics of the original signal and avoids temporal information disorder. Subsequently, the global self-attention module 105 performs global self-attention interactive computation on the reassembled feature sequence, mining the global contextual relationships between high-dimensional feature vectors corresponding to different soft-block signals, fusing each group of local features into global features, achieving synergy between local and global features, improving the completeness and effectiveness of the sequence representation, and outputting a preliminary sequence representation after global self-attention interactive computation.

[0117] In one embodiment of the present invention, the encoding system 100 further includes a regularization constraint module 106, which establishes communication connections with the step size prediction module 101 and the global self-attention module 105, respectively. This module is configured to perform constraint optimization on the prediction window parameters and the output sequence during the end-to-end training process of the encoding system, and output a final sequence representation with adaptive downsampling characteristics. The core function of the regularization constraint module 106 is to avoid unreasonable extreme downsampling strategies, preventing problems such as excessive compression leading to the loss of key signal information, or near-zero compression leading to computational redundancy and excessive memory usage. Specifically, the regularization constraint module 106 introduces a regularization term into the training loss function, and through constraining the window parameters and the output sequence, ultimately outputs a high-quality adaptive downsampling sequence representation.

[0118] In one embodiment of the present invention, the modules of the encoding system 100 work collaboratively, and its overall workflow is as follows: the step size prediction module 101 extracts global features of the multi-dimensional time-series signal and generates prediction window parameters through the functional units of the step size learner; the function generation module 102 generates a smoothing window function based on the prediction window parameters; the window grouping module 103 completes signal window weighting and soft segmentation; the feature extraction module 104 mines local spatiotemporal dependencies and extracts high-dimensional feature vectors; the global self-attention module 105 realizes feature recombination and global fusion; and the regularization constraint module 106 optimizes the training loss function, constrains the window parameters and the output sequence, and finally outputs a high-quality adaptive downsampling sequence representation. The entire system replaces manual presets with learnable window parameter prediction, replaces "hard cutting" with differentiable "soft segmentation," and improves feature quality through hierarchical self-attention fusion.

[0119] The overall structure and principle of an adaptive downsampling timing coding method and system according to an embodiment of the present invention will be further described below with reference to the accompanying drawings.

[0120] Figure 3 A schematic diagram illustrating the structure and principle of a method and system in one embodiment of the present invention is shown.

[0121] like Figure 3 As shown, in one embodiment of the present invention, the leftmost step-size learner serves as the core control module, receiving the original multi-dimensional time-series signal (the dimension being the time step). T ×Number of channels C The global features of the sequence (such as sequence length) are used to dynamically predict the step size (window interval) through a learnable network. str And according to the preset linkage rules W = 2 × str Generate window length W This replaces the manually preset fixed window parameters in existing technologies, enabling adaptive adjustment of the downsampling strategy.

[0122] The original time-series signal then enters the Gaussian window weighting and soft-blocking stage: element-wise weighting is performed with the generated continuous smooth Gaussian window function to divide the original signal into... N Group soft block signal (dimension is) N× ( W×C Soft segmentation avoids the loss of boundary information caused by hard cutting through the smooth weights of Gaussian windows, and its differentiable properties support end-to-end training.

[0123] After the soft-block signals are upscaled by convolutional layers, they enter a two-dimensional feature enhancement stage: the time dimension Transformer encoder mines the local temporal dependencies within each group of signals, the channel dimension Transformer encoder mines the cross-channel dependencies, and global mean pooling compresses each group of features, finally extracting the high-dimensional feature vector corresponding to each group.

[0124] After all high-dimensional feature vectors are reassembled in their original temporal order, they are input into a global Transformer encoder for global context fusion to mine global correlation information between groups. The resulting sequence is then mapped through embedding and connection layers to form the final sequence representation. During model training, in addition to calculating the task loss, a step size penalty term (constraining the step size) is introduced. str ≤400) and length penalty term (constraining the length of the output sequence) N (Between 5 and 200), the total loss is optimized through regularization to avoid extreme strategies such as over-compression or under-sampling.

[0125] Figure 4 A schematic diagram of the step-size learner in one embodiment of the present invention is shown.

[0126] like Figure 4 As shown, in embodiments of the present invention, the step-size learner can have various model structures. Specifically:

[0127] In a specific embodiment of the present invention, the step size learner is a static function mapping type step size learner, and its model structure is as follows: Figure 4 As shown in Figure 1, the static function mapping step-size learner is a basic implementation in existing technologies. It takes only the total sequence length of the multi-dimensional time-series signal as input. This learner directly generates the step size through a manually preset fixed function, calculates the step size, and then calculates the window length according to linkage rules. This scheme has a simple structure and fast inference speed, but it relies entirely on manually preset rules and cannot adjust the step size based on dynamic characteristics such as signal fluctuation intensity and channel correlation. This can easily lead to problems such as insufficient downsampling of long signals and excessive compression of short signals.

[0128] In a specific embodiment of the present invention, the step-size learner is a single-feature learnable step-size learner, and its model structure is as follows: Figure 4As shown in Figure 2, the single-feature learnable step-size learner is an improvement on the static mapping scheme. It still uses the total sequence length of the multi-dimensional time-series signal as the sole input. First, it performs a logarithmic transformation on the total sequence length to obtain the logarithmic length, avoiding excessive numerical differences at the linear scale that could hinder model learning. This logarithmic length is then input into a two-layer lightweight MLP to learn the logarithmic step size. Subsequently, the logarithmic step size is converted to a linear-scale step size using the inverse exponential transformation of 1+exp(x), and the window length is calculated according to the linkage rule. This scheme achieves adaptive step-size adjustment by introducing a learnable MLP, but it relies solely on the single feature of signal length and does not incorporate global sequence features such as signal fluctuations and channel correlations, thus limiting its adaptive capability.

[0129] In a specific embodiment of the present invention, the step size learner is preferably a multi-feature fusion learnable step size learner, and its model structure is as follows: Figure 4 As shown in Figure 3, the multi-feature fusion learnable step-size learner is the core innovation of this invention. It takes the total sequence length of the multi-dimensional time-series signal and the original signal as input. First, it performs a logarithmic transformation on the total sequence length to obtain the logarithmic length. Simultaneously, it performs time-averaged pooling on the original signal to compress it. This signal is then input into a Transformer encoder to extract global sequence features, which include abstract information such as the overall fluctuation amplitude and channel-coordinated changes of the signal. The logarithmic length is then concatenated with the global sequence features and input into an MLP for fusion calculation, outputting the logarithmic step size. The step size is obtained through the inverse exponential transformation of 1+exp(x), and the window length is calculated according to the linkage rules. This scheme combines the macroscopic length features of the signal with global sequence features, allowing the MLP to learn more comprehensive adaptation rules. For example, a large step size is used for long and smooth signals, while a small step size is used for short and fluctuating signals. The accuracy and adaptability of step-size prediction are significantly improved, and it supports end-to-end training, enabling linkage optimization with other modules of the encoder.

[0130] In one embodiment of the present invention, to verify the effectiveness and performance advantages of the adaptive downsampling time series coding method, six cross-domain time series datasets from "SciTS: Scientific Time Series Understanding and Generation with LLMs" were selected, specifically including:

[0131] GWOSC Astronomical Gravitational Wave Dataset;

[0132] SleepEDF sleep monitoring dataset;

[0133] Powdermill Industrial Vibration Dataset;

[0134] iNaturalist ecological time-series dataset;

[0135] RadSeg medical image time series dataset;

[0136] MDD Mental Health Time Series Dataset.

[0137] Using the F1 score of a classification task as the core evaluation metric, the performance difference between the method and system provided in this invention and the control group encoder employing fixed-length downsampling was compared. During the experiment, the encoder of this invention used a multi-feature fusion step-size learner to dynamically predict window parameters, and completed temporal encoding through Gaussian windowing, soft block partitioning, two-dimensional self-attention feature mining, and regularization constraints. The control group encoder, on the other hand, used a manually preset fixed-length downsampling strategy to uniformly compress all input signals to a fixed number of feature frames. Some experimental results are shown in Table 1.

[0138] Table 1. Comprehensive evaluation experimental results on some general-purpose time-series tasks.

[0139]

[0140] Experimental results show that, under the same task settings, the method and system of this invention significantly outperform the control group with fixed-length downsampling in F1 scores on some test datasets: on the RadSeg medical image time series dataset, the F1 score of this invention reaches 95.2, while that of the control group is only 25.5, representing a performance improvement of more than 3 times. This difference stems from the fact that RadSeg signals fluctuate wildly and have dense local feature information. The excessive compression of fixed-length downsampling leads to the loss of a large number of key features, while the adaptive downsampling of this invention can dynamically adjust the window parameters according to signal fluctuations, accurately preserving local key features; on the GWOSC astronomical gravity dataset, the method and system of this invention achieve F1 scores significantly better than the control group with fixed-length downsampling. On the gravitational wave dataset, the F1 score of this invention is 97.4, while the control group's is 73.2. Because gravitational wave signals have long-period smooth segments and short-period abrupt change segments, adaptive downsampling can use large step sizes to compress redundant information in smooth segments and small step sizes to preserve details in abrupt change segments. Fixed-length downsampling cannot adapt to this dynamic change, leading to feature loss. Furthermore, on the SleepEDF sleep monitoring dataset, the Powdermill industrial vibration dataset, and the iNaturalist ecological time-series dataset, this invention also shows stable performance improvements. On the MDD mental health time-series dataset, it is basically on par with the control group. Comprehensive evaluations on various other general time-series tasks show that the method and system provided by this invention perform on par with current general time-series model encoders, and even show significant advantages on some tasks.

[0141] The comprehensive experimental results show that the adaptive downsampling temporal coding method and system of the present invention have been experimentally verified to be feasible and effective. It can significantly improve coding performance in cross-domain temporal tasks, solve the problem of information and efficiency imbalance in fixed downsampling strategies, and has broad practical application value.

[0142] Although various embodiments of the invention have been described above, it should be understood that they are presented by way of example only and not as limitations. It will be apparent to those skilled in the art that various combinations, modifications, and alterations can be made without departing from the spirit and scope of the invention. Therefore, the breadth and scope of the invention disclosed herein should not be limited by the exemplary embodiments disclosed above, but should be defined solely by the appended claims and their equivalents.

Claims

1. An adaptive downsampling timing coding method, characterized in that, include: A step size prediction module is provided, and a multi-dimensional time series signal is input into the step size prediction module. The step size prediction module generates prediction window parameters based on the global features of the multi-dimensional time series signal using a learnable network. The prediction window parameters include window length parameters and window interval parameters. A smoothing window function is provided based on the prediction window parameters, wherein: The number of smoothing window functions is determined by the total sequence length of the multidimensional time-series signal and the window interval parameter. The time coverage of the smoothing window function is limited by the window length parameter; The offset of the adjacent smoothing window functions on the time axis is limited by the window interval parameter; The multidimensional time-series signal is weighted and calculated with the smooth window function, and the result is divided into multiple soft block signals; Extract the feature vector corresponding to each group of soft-block signals; and The feature vectors are recombined, and the final sequence representation is output.

2. The method according to claim 1, characterized in that, The step size prediction module generates prediction window parameters based on the global features of the multidimensional time series signal, including: The total sequence length of the multidimensional time-series signal is logarithmically transformed. Simultaneously, the global sequence features of the multidimensional time-series signal are extracted; The logarithmically transformed sequence length and the global sequence features are input into the step size prediction module and fused to obtain the logarithmic step size. Perform an exponential transformation on the logarithmic step size to obtain the window interval parameter; and The window length parameter is calculated according to the linkage rule between window length and window spacing parameter.

3. The method according to claim 1, characterized in that, The smoothing window function includes a Gaussian window function and / or a Hanning window function.

4. The method according to claim 1, characterized in that, The extraction of the feature vector corresponding to each group of soft block signals includes: For each group of soft-block signals, perform self-attention interaction computation in both time and channel dimensions; and The soft block signals of each group are compressed by average pooling, and the feature vector corresponding to the soft block signals of that group is extracted.

5. The method according to claim 1, characterized in that, The process of recombining the feature vectors and outputting the final sequence representation includes: The feature vectors are reorganized according to their original chronological order; and Perform global self-attention interactive computation on the recombined feature vectors and output the final sequence representation.

6. The method according to claim 1, characterized in that, The method further includes providing a training loss function optimized for the window parameters and the regularization term of the output sequence, the training loss function being expressed as: in, Indicates the total training loss; Indicates loss of the main task; This represents the step size penalty term, which is configured to impose a loss on step sizes exceeding a threshold; This represents the output sequence length penalty term, which is configured to impose a loss on sequences that are too long and / or too short. and This represents the weighting coefficient.

7. An adaptive downsampling timing coding system, characterized in that, include: The step size prediction module is configured to extract global features of the input multidimensional time series signal and dynamically predict prediction window parameters adapted to the signal based on a learnable network, wherein the prediction window parameters include window length parameters and window spacing parameters. A function generation module is communicatively connected to the step size prediction module. The function generation module is configured to generate a smoothing window function based on the prediction window parameters, wherein: The number of smoothing window functions is determined by the total sequence length of the multidimensional time-series signal and the window interval parameter. The time coverage of the smoothing window function is limited by the window length parameter; The offset of the adjacent smoothing window functions on the time axis is limited by the window interval parameter; The window grouping module is communicatively connected to the step size prediction module and the function generation module, respectively. The window grouping module is configured to perform weighted calculation on the multidimensional time series signal and the smooth window function, and divide the calculation result into multiple soft block signals. The feature extraction module, communicatively connected to the windowing grouping module, performs self-attention interaction calculations in the time and channel dimensions on each group of soft-block signals, then compresses and extracts the feature vector corresponding to each group of soft-block signals; and A global self-attention module is communicatively connected to the feature extraction module. The global self-attention module is configured to reorganize the feature vectors into a feature sequence according to the original time order and perform global self-attention interactive calculation on the feature sequence.

8. The system according to claim 7, characterized in that, The system also includes: The regularization constraint module is communicatively connected to the step size prediction module and the global self-attention module, respectively, and is used to constrain and optimize the window parameters and output sequence during the end-to-end training process of the system, and output the final sequence representation with adaptive downsampling characteristics.

9. The system according to claim 7, characterized in that, The step size prediction module includes a step size learner for predicting the prediction window parameters, the step size learner comprising: A logarithmic transformation unit is configured to perform a logarithmic transformation on the total sequence length of the multidimensional time-series signal to obtain a logarithmic sequence length. A global sequence feature extraction unit is configured to extract global sequence features from the multidimensional time-series signal; The fusion calculation unit is communicatively connected to the logarithmic transformation unit and the global sequence feature extraction unit, and is configured to fuse the logarithmic sequence length with the global sequence features to output the logarithmic step size; An exponential transformation unit, communicatively connected to the fusion computing unit, is configured to perform an exponential transformation on the logarithmic step size to obtain the window interval parameter in the prediction window parameters; and The linkage calculation unit is communicatively connected to the exponential transformation unit and is configured to calculate the window length parameter in the prediction window parameters according to the linkage rule between the window length parameter and the window interval parameter.