Time block hierarchical modeling based time series data processing method and related device
By dividing time series into time blocks for local convolutional encoding and global modeling, and fusing local and global features, the problem of difficulty in balancing local features and global dependencies in existing technologies is solved, achieving efficient and stable long-term series modeling and decision-making capabilities.
Patent Information
- Application Number
- CN202611683998.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-29
- Publication Date
- 2026-11-27
AI Technical Summary
In existing technologies, time series modeling methods struggle to balance local feature extraction and global dependency modeling, resulting in high computational complexity and easily disrupted temporal structures. Consequently, they are limited in their ability to model long-term series, are inefficient, and have insufficient discriminative performance.
A time-block-based hierarchical modeling approach is adopted, which divides the time series into multiple consecutive time blocks, performs intra-block local convolutional encoding and inter-block global modeling, and fuses local features with global context features to finally generate sample-level feature representations to output task prediction results.
It effectively balances the extraction of short-term fine-grained features and long-term evolutionary trends, significantly improves the model's ability to express complex temporal patterns, reduces processing complexity, enhances training and inference efficiency, and maintains temporal order consistency.
Smart Images

Figure CN123179096A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of time series data analysis technology, and in particular to a time series data processing method and related equipment based on time block hierarchical modeling. Background Technology
[0002] Time series data refers to datasets arranged chronologically, reflecting changes in system state or behavior over time. It is widely used in fields such as intelligent medical monitoring, industrial equipment operation analysis, financial time series forecasting, and intelligent transportation. This type of data typically features continuous sampling, long time spans, and diverse patterns, placing high demands on the model's ability to capture local features, its efficiency in modeling long-range dependencies, and its preservation of time series structure. How to efficiently and accurately extract multi-level time series features from long-term series has become a key technical challenge in current time series data analysis and intelligent modeling.
[0003] In existing technologies, methods for time series modeling mainly include models based on recurrent neural networks (RNNs) and their variants (such as LSTM and GRU), models based on convolutional neural networks (CNNs), and hybrid models combining the two. RNN-type models process sequences step by step through recursive structures, possessing a certain ability to model long-range dependencies, but suffer from problems such as low training efficiency and gradient vanishing / exploding. CNN-type models extract local features by sliding convolutional kernels, performing well in short-term pattern recognition, but their ability to model long-range temporal dependencies is limited. To improve the modeling performance of long sequences, existing technologies often employ methods such as multi-layer stacked convolution, dilated convolution, or global pooling. However, these methods still have the following significant drawbacks: First, it is difficult to effectively balance local fine-grained features with global long-term dependencies, resulting in a trade-off between capturing short-term transient changes and long-term evolutionary trends. Second, when dealing with sequences with high sampling rates and long time spans, point-by-point or multi-layer stacked computations lead to high computational complexity, making it difficult to meet real-time requirements. Third, compression operations such as global pooling used to adapt to classification or prediction modules often destroy temporal sequence information, weakening the model's ability to represent temporal structures. Fourth, the lack of a unified and structured multi-scale feature fusion mechanism limits the model's expressive power and generalization performance under complex temporal patterns. Summary of the Invention
[0004] This invention provides a time series data processing method and related equipment based on time block hierarchical modeling, to solve the problems of limited long-term series modeling ability, low efficiency and insufficient discrimination performance caused by the difficulty in balancing local feature extraction and global dependency modeling, high computational complexity and easy destruction of time series structure in the prior art.
[0005] The first aspect of this invention provides a time-series data processing method based on time-block hierarchical modeling, comprising: acquiring time-series input data, performing standardization preprocessing and length alignment to obtain an aligned time series; dividing the aligned time series according to a preset time block length and step size to obtain multiple consecutive time blocks; performing intra-block local convolutional encoding on each time block to extract intra-block local features, and vectorizing the local features to obtain local feature vectors corresponding to each time block; constructing a block-level feature sequence based on the local feature vectors of all time blocks, and performing cross-time-block global modeling on the block-level feature sequence to obtain global context feature vectors corresponding to each time block; fusing the local feature vectors of each time block with the corresponding global context feature vectors to obtain a fused time block feature representation; concatenating and converging the fused feature representations of all time blocks in chronological order to generate a sample-level feature representation, and outputting task prediction results based on the sample-level feature representation.
[0006] In one feasible implementation, the step of dividing the aligned time series according to a preset time block length and step size to obtain multiple consecutive time blocks includes: setting consecutive time windows on the time axis, starting from the beginning of the sequence, with the step size as the interval; extracting data segments within each time window with a length equal to the preset time block length as independent time blocks; arranging all extracted time blocks according to their chronological order in the original sequence to form a time block sequence, wherein the total number of time blocks is calculated using the following formula:
[0007] Among them, T fix The total length of the time series after length alignment is given, L is the preset length of a single time block, and S is the step size for dividing the time block.
[0008] In one feasible implementation, the step of performing intra-block local convolutional encoding on each time block, extracting intra-block local features, and vectorizing the local features to obtain the local feature vector corresponding to each time block includes: inputting each time block into a convolutional neural network submodule with shared weights; extracting local feature maps reflecting waveform or pattern changes within the time block through the convolutional layers in the convolutional neural network submodule; and flattening and transforming the structure of the local feature maps to convert them into fixed-dimensional vector representations as the local feature vectors of the time block.
[0009] In one feasible implementation, the step of constructing a block-level feature sequence based on the local feature vectors of all time blocks and performing cross-time-block global modeling on the block-level feature sequence to obtain the global context feature vector corresponding to each time block includes: stacking the local feature vectors of all time blocks according to their order in the time block sequence to construct a two-dimensional block-level feature matrix; inputting the block-level feature matrix into a temporal modeling network, which can capture long-range dependencies between sequence elements; and extracting the output feature vector corresponding to the position of each input time block from the output of the temporal modeling network as the global context feature vector corresponding to each time block.
[0010] In one feasible implementation, extracting the output feature vector corresponding to the position of each input time block from the output of the temporal modeling network as the global context feature vector for each time block includes: determining the temporal position of each time block in the block-level feature matrix; and inputting the block-level feature matrix into an extended causal one-dimensional convolutional network for forward propagation, the processing of which is expressed as follows:
[0011] in, This represents the dilated causal one-dimensional convolution operation, where F represents the block-level feature sequence. This represents the global context feature sequence output after computation.
[0012] From the output matrix of the extended causal one-dimensional convolutional network, the corresponding row vectors are extracted according to the temporal position index to obtain the global context feature vector of each time block.
[0013] In one feasible implementation, the step of fusing the local feature vector and the corresponding global context feature vector for each time block to obtain a fused time block feature representation includes: for each time block index, extracting its local feature vector and the corresponding global context feature vector; concatenating the local feature vector and the global context feature vector to form a new fused feature vector; and performing a nonlinear transformation on the fused feature vector to generate the final time block feature representation that simultaneously contains local information and global context information.
[0014] In one feasible implementation, the step of concatenating and aggregating the fused feature representations of all time blocks in chronological order to generate sample-level feature representations, and outputting task prediction results based on the sample-level feature representations, includes: concatenating the fused feature representations of each time block sequentially according to the chronological order of the time blocks to form a long vector; inputting the long vector into one or more fully connected layers for feature integration and dimensionality adjustment; and connecting the corresponding output layer at the output end of the fully connected layer according to the task type to generate task prediction results corresponding to classification, regression, or detection tasks.
[0015] A second aspect of the present invention provides a time-series data processing apparatus based on time-block hierarchical modeling, comprising: an acquisition module for acquiring time-series input data and performing standardized preprocessing and length alignment to obtain an aligned time series; a segmentation module for segmenting the aligned time series according to a preset time block length and step size to obtain multiple consecutive time blocks; a processing module for performing intra-block local convolutional encoding on each time block, extracting intra-block local features, and vectorizing the local features to obtain local feature vectors corresponding to each time block; a modeling module for constructing a block-level feature sequence based on the local feature vectors of all time blocks, and performing cross-time-block global modeling on the block-level feature sequence to obtain global context feature vectors corresponding to each time block; a fusion module for fusing the local feature vectors of each time block with the corresponding global context feature vectors to obtain a fused time block feature representation; and an output module for concatenating and aggregating the fused feature representations of all time blocks along the time sequence to generate a sample-level feature representation, and outputting task prediction results based on the sample-level feature representation.
[0016] In one feasible implementation, the segmentation module is specifically used for: setting continuous time windows on the time axis, starting from the beginning of the sequence, with the step size as the interval; extracting data segments within each time window, each with a preset time block length, into an independent time block; arranging all extracted time blocks according to their chronological order in the original sequence to form a time block sequence, wherein the total number of time blocks is calculated using the following formula:
[0017] Among them, T fix The total length of the time series after length alignment is given, L is the preset length of a single time block, and S is the step size for dividing the time block.
[0018] In one feasible implementation, the processing module is specifically used to: input each time block into a convolutional neural network submodule with shared weights; extract local feature maps reflecting waveform or pattern changes within the time block through the convolutional layers in the convolutional neural network submodule; flatten and transform the structure of the local feature maps to convert them into fixed-dimensional vector representations as local feature vectors of the time block.
[0019] In one feasible implementation, the modeling module includes: a construction unit for stacking the local feature vectors of all time blocks according to their order in the time block sequence to construct a two-dimensional block-level feature matrix; an input unit for inputting the block-level feature matrix into a temporal modeling network, the temporal modeling network being able to capture long-range dependencies between sequence elements; and an extraction unit for extracting the output feature vector corresponding to the position of each input time block from the output of the temporal modeling network, as the global context feature vector corresponding to each time block.
[0020] In one feasible implementation, the extraction unit is specifically used to: determine the temporal position of each time block in the block-level feature matrix; and input the block-level feature matrix into an extended causal one-dimensional convolutional network for forward propagation. The processing procedure is as follows:
[0021] in, This represents the dilated causal one-dimensional convolution operation, where F represents the block-level feature sequence. This represents the global context feature sequence output after computation.
[0022] From the output matrix of the extended causal one-dimensional convolutional network, the corresponding row vectors are extracted according to the temporal position index to obtain the global context feature vector of each time block.
[0023] In one feasible implementation, the fusion module is specifically used to: extract the local feature vector and the corresponding global context feature vector for each time block index; concatenate the local feature vector and the global context feature vector to form a new fused feature vector; and perform a nonlinear transformation on the fused feature vector to generate the final time block feature representation that simultaneously contains local information and global context information.
[0024] In one feasible implementation, the output module is specifically used to: sequentially concatenate the fusion feature representations of each time block according to the time order of the time blocks to form a long vector; input the long vector into one or more fully connected layers for feature integration and dimension adjustment; and connect the corresponding output layer to the output end of the fully connected layer according to the task type to generate task prediction results corresponding to classification, regression or detection tasks.
[0025] A third aspect of the present invention provides an electronic device, comprising: a memory and at least one processor, wherein the memory stores instructions; the at least one processor invokes the instructions in the memory to cause the electronic device to perform the aforementioned time-series data processing method based on time block hierarchical modeling.
[0026] A fourth aspect of the present invention provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the aforementioned time-series data processing method based on time-block hierarchical modeling.
[0027] The technical solution provided by this invention involves acquiring time-series input data, performing standardization preprocessing and length alignment to obtain an aligned time series; dividing the aligned time series into multiple consecutive time blocks according to a preset time block length and step size; performing intra-block local convolutional encoding on each time block to extract intra-block local features, and vectorizing the local features to obtain local feature vectors corresponding to each time block; constructing a block-level feature sequence based on the local feature vectors of all time blocks, and performing cross-time block global modeling on the block-level feature sequence to obtain global context feature vectors corresponding to each time block; fusing the local feature vectors of each time block with the corresponding global context feature vectors to obtain a fused time block feature representation; concatenating and converging the fused feature representations of all time blocks in chronological order to generate a sample-level feature representation, and outputting the task prediction result based on the sample-level feature representation. In this embodiment of the invention, by dividing long-term time series into ordered time blocks and adopting a hierarchical processing structure of "intra-block local convolutional encoding - inter-block global modeling - local-global feature fusion", the extraction of short-term fine-grained features and long-term evolutionary trends is effectively taken into account, significantly improving the model's ability to express complex temporal patterns. At the same time, the block-level parallel computing mechanism greatly reduces the processing complexity of long-term time series and enhances training and inference efficiency. In addition, the entire process maintains the consistency of temporal order, avoiding the loss of temporal structure information caused by pooling or disordered operations, thereby achieving more stable and efficient end-to-end modeling and decision-making capabilities in time-sensitive scenarios such as medical monitoring and industrial analysis. Attached Figure Description
[0028] Figure 1This is a schematic diagram of an embodiment of the time-series data processing method based on time block hierarchical modeling in this invention. Figure 2 This is a schematic diagram of another embodiment of the time-series data processing method based on time block hierarchical modeling in this invention; Figure 3 This is a schematic diagram of an embodiment of a time-series data processing device based on time block hierarchical modeling in this invention. Figure 4 This is a schematic diagram of another embodiment of the time-series data processing device based on time block hierarchical modeling in this invention; Figure 5 This is a schematic diagram of one embodiment of the electronic device in this invention. Detailed Implementation
[0029] This invention provides a time series data processing method and related equipment based on time block hierarchical modeling. By dividing a long time series into continuous time blocks, extracting local features within the blocks, modeling global dependencies between blocks, and finally fusing local and global features, it achieves efficient and multi-level representation of long time series, effectively improving the accuracy, efficiency, and generalization ability of the model in time series classification, prediction, and anomaly detection tasks.
[0030] The terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" or "having" and any variations thereof are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0031] It is understood that the execution subject of this invention can be a time-series data processing device based on time-block hierarchical modeling, or it can be a terminal or a server; the specific implementation is not limited here. This embodiment of the invention will be described using a server as an example.
[0032] For ease of understanding, the specific process of the embodiments of the present invention is described below. Please refer to [link / reference]. Figure 1 One embodiment of the time-series data processing method based on time-block hierarchical modeling in this invention includes: 101. Obtain the time series input data, and perform standardization preprocessing and length alignment to obtain the aligned time series; Raw multivariate time series data is acquired from sources such as sensors or databases, containing sampled values from multiple channels at different time steps. To eliminate the impact of differences in dimensions and distributions of each channel on model training, the mean and standard deviation of the values at all time steps are calculated independently for each channel. Each data point for that channel is then standardized by subtracting the mean and dividing by the standard deviation. Next, to meet the consistency requirements of the input size in subsequent network structures, a uniform fixed time length is set, and all sample sequences are adjusted to this length. For sequences shorter than this length, zero values are padded at the end of their time dimension until the target length is reached; for sequences longer than this length, they are truncated from the starting position to the target length, ultimately resulting in a set of time series data with aligned lengths and stable numerical distributions.
[0033] 102. Based on the aligned time series, divide it according to the preset time block length and step size to obtain multiple consecutive time blocks; Using pre-aligned time series data as input, a fixed time block length and a sliding step size are set. Starting from the beginning of the sequence, a window of length equal to the time block length slides along the time dimension at intervals equal to the step size. Each slide extracts a subsequence within the window as an independent time block. This process continues until the entire time series has been traversed. During the last slide, if the end of the window exceeds the sequence boundary, resulting in a subsequence length that is less than the preset time block length, zero values are padded to the end of the subsequence to make its length meet the requirements. Ultimately, the original long sequence is transformed into a series of temporally continuous, possibly partially overlapping, and uniformly long short sequences, i.e., a set of time blocks.
[0034] 103. Perform intra-block local convolutional encoding on each time block to extract local features within the block, and vectorize the local features to obtain the local feature vector corresponding to each time block; For each segmented time block, a one-dimensional convolutional neural network with causal constraints is used for local temporal feature extraction. This causal convolution ensures that the features of each output time step depend only on the inputs of the current and previous time steps, thus preserving temporal order and causal relationships. The convolution operation uses multiple filters sliding within the time block to capture short-term fine-grained patterns such as waveform morphology and instantaneous rhythms. The extracted multidimensional feature maps are then compressed and fused along the channel dimension through a pointwise convolutional layer. The feature maps are then flattened along the time and channel dimensions, transforming them into a one-dimensional vector. Finally, this vector is normalized using the L2 norm, so that each time block is represented as a local feature vector with a uniform dimension and stable numerical range.
[0035] For vectors Perform L2 norm normalization:
[0036] 104. Construct block-level feature sequences based on the local feature vectors of all time blocks, and perform cross-time block global modeling on the block-level feature sequences to obtain the global context feature vectors corresponding to each time block; The local feature vectors obtained after vectorizing each time block They are arranged strictly according to the order in which they appear in the original time series, thus constructing a block-level feature sequence. Above this block-level feature sequence, a causal one-dimensional convolutional layer with an expansion rate greater than one is applied for global modeling. This dilated convolution expands the receptive field by inserting holes between the convolutional kernel elements, enabling it to capture long-term dependencies and overall evolutionary trends across multiple adjacent time blocks. At the same time, its causality ensures that the feature at any position depends only on the current and previous block information. After processing by this convolutional layer, the feature vector at each position in the output feature sequence is the global context feature vector corresponding to the original time block, which incorporates the long-term context across blocks.
[0037] 105. For each time block, its local feature vector is fused with the corresponding global context feature vector to obtain the fused time block feature representation; For each time block, the local feature vector encoded within the block is combined with the global context feature vector corresponding to the same time position in the global modeling output sequence. The specific fusion operation employs vector concatenation, directly linking the two feature vectors along their feature dimensions to form a longer joint feature vector. This concatenated vector is then fed into a trainable fully connected layer for linear transformation and dimensionality mapping to learn the effective interaction and integration between local and global information, outputting a new feature vector with a unified dimension. This new vector is the fused feature representation of the time block, simultaneously encoding the fine-grained patterns within the time block and its global semantic context within the entire sequence.
[0038] The fusion process can be represented as:
[0039] in, and This is a learnable weight matrix and bias vector. This new vector... This is the fused feature representation of the time block, which simultaneously encodes the fine-grained patterns within the time block and its global semantic context throughout the entire sequence.
[0040] 106. Based on the fusion feature representations of all time blocks, the blocks are spliced and converged in chronological order to generate sample-level feature representations, and the task prediction results are output based on the sample-level feature representations.
[0041] The feature representations obtained after fusing each time block are concatenated end-to-end along the feature dimension according to their chronological order in the original time series, thus forming a long sample-level feature vector. This process fully preserves the temporal structure between time blocks. Next, this sample-level feature vector is input into one or more fully connected layers for nonlinear transformation and feature integration to complete the mapping from temporal features to the task objective. Finally, depending on the specific task requirements, an output layer generates the prediction result: for classification tasks, this layer is typically a softmax function, outputting the probability of each class; for regression or prediction tasks, this layer is a linear layer, directly outputting the predicted value. The entire process achieves end-to-end computation from local feature fusion to the final decision.
[0042] The sample-level feature vector is represented as:
[0043] The probability of each category is expressed as:
[0044] in, and The weights and biases of the classification layer.
[0045] In this embodiment of the invention, by dividing long-term time series into ordered time blocks and adopting a hierarchical processing structure of "intra-block local convolutional encoding - inter-block global modeling - local-global feature fusion", the extraction of short-term fine-grained features and long-term evolutionary trends is effectively taken into account, significantly improving the model's ability to express complex temporal patterns. At the same time, the block-level parallel computing mechanism greatly reduces the processing complexity of long-term time series and enhances training and inference efficiency. In addition, the entire process maintains the consistency of temporal order, avoiding the loss of temporal structure information caused by pooling or disordered operations, thereby achieving more stable and efficient end-to-end modeling and decision-making capabilities in time-sensitive scenarios such as medical monitoring and industrial analysis.
[0046] Please see Figure 2 Another embodiment of the time-series data processing method based on time-block hierarchical modeling in this invention includes: 201. Obtain the time series input data, and perform standardization preprocessing and length alignment to obtain the aligned time series; Raw multivariate time series data is acquired from sources such as sensors or databases, containing sampled values from multiple channels at different time steps. To eliminate the impact of differences in the units and distributions of each channel on model training, the mean and standard deviation of the values at all time steps are calculated independently for each channel, and each data point for that channel is standardized accordingly.
[0047] in, This represents the original value of the k-th channel at time step t. and Let be the mean and standard deviation of the k-th channel, respectively. To prevent the use of tiny constants in division by zero, and to ensure consistency in input size across subsequent network structures, a uniform fixed time length is set. All sample sequences are adjusted to this length. For sequences shorter than this length, zero values are padded at the end of their time dimension until the target length is reached; for sequences longer than this length, they are truncated from the starting position to the target length, ultimately resulting in a set of time series data with aligned lengths and stable numerical distribution.
[0048] 202. Based on the aligned time series, divide it according to the preset time block length and step size to obtain multiple consecutive time blocks; On the timeline, starting from the beginning of the sequence, consecutive time windows are set at step sizes; data segments within each time window, with a preset time block length, are extracted as independent time blocks; all extracted time blocks are arranged according to their chronological order in the original sequence to form a time block sequence. The total number of time blocks is calculated using the following formula:
[0049] Among them, T fix The total length of the time series after length alignment is given, L is the preset length of a single time block, and S is the step size for dividing the time block.
[0050] Two core parameters are defined: time block length L and sliding step size S. L determines the number of consecutive sampling points contained in each time segment, while S controls the interval between the starting points of adjacent time blocks. Starting from index 0 of the length-aligned time series, the system sequentially sets a series of consecutive, non-overlapping time windows on the time axis with a step size of S. The right boundary of each time window is determined by adding L-1 to the left boundary index. Within each time window, the system precisely extracts all data points from the original aligned sequence from the left boundary to the right boundary of the window. These data points constitute a complete subsequence of length L, which is encapsulated and marked as an independent time block. If, during the sliding process, the right boundary index of the last time window exceeds the maximum index T_fix-1 of the sequence, the system executes a boundary handling strategy: when the excess is less than L, the excess is padded with zeros to ensure that the time block still has a length L; if the excess is too large or the step size setting prevents the formation of a valid block, the incomplete window is discarded. During the extraction process, the system assigns a unique time sequence identifier to each time block, which strictly corresponds to its index at the start position in the original sequence. All successfully extracted time blocks are arranged in ascending order according to the value of their time sequence identifiers, thus forming a time block sequence that maintains a strict chronological order in the time dimension. The data of adjacent time blocks in this sequence may partially overlap or be continuous on the original time axis, depending on the relative relationship between the step size S and the block length L: when S is less than L, adjacent time blocks share some data, achieving redundant capture of local patterns; when S equals L, the time blocks are exactly connected end-to-end, completely covering the sequence without overlap; when S is greater than L, there are gaps between time blocks, suitable for downsampling feature extraction of the sequence.
[0051] 203. Perform intra-block local convolutional encoding on each time block to extract local features within the block, and vectorize the local features to obtain the local feature vector corresponding to each time block; Each time block is input into a convolutional neural network submodule with shared weights; local feature maps reflecting waveform or pattern changes within the time block are extracted through the convolutional layers in the convolutional neural network submodule; the structure of the local feature maps is flattened and its dimensions are transformed into a fixed-dimensional vector representation, which serves as the local feature vector of the time block.
[0052] Each time block is fed into a convolutional neural network submodule for independent forward propagation computation. This submodule typically consists of several stacked one-dimensional convolutional layers with progressively smaller kernel sizes. The first kernel has a larger time span to extract the overall waveform trend over a wider range, while subsequent kernels gradually shrink to focus on finer short-term fluctuations and transient patterns. All convolutional layers employ causal padding to ensure that the output features at each time point depend only on the current and historical inputs, thus maintaining the directionality of temporal dependencies. A non-linear activation function such as ReLU is typically applied after the convolutional layers to introduce the model's non-linear expressive power, and batch normalization layers can be selectively added to accelerate the convergence and stability of the training process. After these convolutional operations, each time block is mapped to a two-dimensional local feature map with multiple channels. This feature map preserves the evolutionary information within the block in the temporal dimension and encodes the diverse pattern features responded to by different filters in the channel dimension. Next, the system performs a structural transformation operation on the local feature map. First, it fully unfolds the feature map along its time and channel dimensions, reshaping it into a one-dimensional long vector. Since the feature maps generated after different time blocks are processed by the same network structure have the same size, the flattened one-dimensional vector also has a uniform length. Subsequently, the system can optionally standardize this vector, for example, by applying L2 norm normalization to fix its magnitude to 1, in order to eliminate possible differences in feature scale between different time blocks and enhance the numerical stability of subsequent processing stages. Finally, this flattened and standardized vector with fixed dimensions is formally defined as the local feature vector of that time block, which is a compact and normalized mathematical representation of all short-term and transient modes within that time block.
[0053] 204. Stack the local feature vectors of all time blocks in order of their position in the time block sequence to construct a two-dimensional block-level feature matrix; Using a set of local feature vectors as the basic input, each vector carries an absolute temporal position identifier for its corresponding time block in the original sequence. The system first strictly sorts all local feature vectors in ascending order based on these temporal identifiers, ensuring that their arrangement order perfectly matches the order in which the time blocks appear on the timeline, thus reconstructing the temporal context of the original data stream at the feature level. After sorting, the system initializes a two-dimensional array data structure with the number of rows equal to the total number of time blocks and the number of columns equal to the fixed dimension length of each local feature vector. Next, the system sequentially traverses the sorted list of local feature vectors, filling each vector as a row into the corresponding row of the two-dimensional array. This operation is performed efficiently in memory, ultimately generating a regular two-dimensional matrix, which we call the block-level feature matrix. In this matrix, each row represents a local pattern summary at a specific time point, and the entire matrix constitutes a continuous, discretized temporal feature stream along the row dimension.
[0054] 205. Input the block-level feature matrix into a temporal modeling network. The temporal modeling network can capture the long-range dependencies between sequence elements. The block-level feature matrix is input into a temporal modeling network specifically designed for temporal data. The core architecture of this network typically employs either dilated causal one-dimensional convolutional layers or Transformer encoding layers based on self-attention mechanisms, the choice depending on the task's requirements for receptive field size and computational efficiency. If dilated causal convolutions are used, the network is configured with multiple convolutional layers, each with an exponentially increasing dilation rate. This allows high-level neurons to have a broad receptive field covering the entire time span of the input sequence without increasing the number of parameters. Its causality ensures that feature computation strictly follows temporal order, relying only on current and historical information. If a Transformer structure is used, temporal information is injected into the block-level feature matrix through positional encoding, and its multi-head self-attention mechanism dynamically calculates the association weights between any two time-block features in the sequence, thus directly modeling long-range dependencies. This temporal modeling network may also include components such as layer normalization, residual connections, and feedforward neural networks to improve training stability and representational capabilities. The network takes the aforementioned block-level feature matrix as input, and through its internal multi-layer nonlinear transformation, it aggregates and abstracts contextual information from different time spans layer by layer, and finally outputs a new feature sequence. The feature vector at each position in the sequence is deeply integrated with rich information from itself and its historical context, realizing multi-scale semantic understanding of the original time series from local to global.
[0055] 206. Extract the output feature vector corresponding to the position of each input time block from the output of the temporal modeling network, and use it as the global context feature vector for each time block; Determine the temporal position of each time block in the block-level feature matrix; input the block-level feature matrix into an extended causal one-dimensional convolutional network for forward propagation. The processing procedure is as follows:
[0056] in, This represents the dilated causal one-dimensional convolution operation, where F represents the block-level feature sequence. This represents the global context feature sequence output after computation.
[0057] From the output matrix of the extended causal one-dimensional convolutional network, the corresponding row vectors are extracted according to the temporal position index to obtain the global context feature vector of each time block.
[0058] When the block-level feature matrix F is input into the dilated causal one-dimensional convolutional network, the network performs layer-by-layer feature transformation on it using the aforementioned causality and dilation structure. The network maintains a strict temporal correspondence, ensuring that the output matrix G and the input matrix F have completely consistent lengths in the time step dimension. To extract the global context feature vector for each time block, the system first needs to define the temporal position index i of each time block in the input matrix F. This index is determined during the construction of the block-level feature matrix and is bound to the absolute temporal order of the time blocks. After the network completes forward propagation to obtain the output matrix G, the system directly extracts the vector of the i-th row from matrix G based on the pre-stored index i. Due to the characteristics of dilated causal convolution, the calculation of the feature vector of the i-th row in the output matrix G depends only on the feature information of the i-th row and all preceding rows in the input matrix F, and is completely unaffected by future information. This ensures temporal causality and also integrates long-range historical context through the wide receptive field of dilated convolution. Therefore, each extracted row vector is the global context feature vector of the corresponding time block. Together, they form a new sequence rich in long-range dependency information, providing crucial global semantic supplementation for subsequent fusion operations.
[0059] 207. For each time block, its local feature vector is fused with the corresponding global context feature vector to obtain the fused time block feature representation; For each time block index, extract its local feature vector and corresponding global context feature vector; concatenate the local feature vector and global context feature vector to form a new fused feature vector; perform a nonlinear transformation on the fused feature vector to generate the final time block feature representation that contains both local and global context information.
[0060] Based on the index of the currently processed time block, the local feature vector for that time block is retrieved from the corresponding set of local feature vectors. This local feature vector encodes the fine waveform patterns within the time block. Simultaneously, the global context feature vector with the same index is retrieved from the corresponding set of global context feature vectors. This global context feature vector contains long-range dependencies and overall trend information from the beginning of the sequence to the current time block. Next, a vector concatenation operation is performed, specifically concatenating the local and global context feature vectors end-to-end along their feature dimensions to create a new fused feature vector with dimensions equal to the sum of the two. Mathematically, this concatenation operation is a parameter-free information merging process, preserving the complete original information of both local and global features. Subsequently, this concatenated fused feature vector is fed into a specially designed fusion transformation layer, typically composed of one or more fully connected layers equipped with non-linear activation functions such as ReLU or GELU. The role of this transformation layer is to learn how to effectively interact and integrate features from different levels of abstraction and sources. It uses a trainable weight matrix to linearly project and compress the high-dimensional concatenated vector, and then introduces complex interaction relationships through a non-linear activation function, ultimately outputting a new feature vector with a unified and fixed dimension. This final output vector is the fused feature representation of the time block, which simultaneously embeds local perceptual details from the convolutional network and global structural semantics from the temporal modeling network, forming a comprehensive temporal representation that is complementary and rich in layers.
[0061] 208. Based on the fusion feature representations of all time blocks, the blocks are spliced and converged in chronological order to generate sample-level feature representations, and the task prediction results are output based on the sample-level feature representations.
[0062] Following the temporal order of the time blocks, the fused feature representations of each time block are sequentially concatenated to form a long vector. This long vector is then input into one or more fully connected layers for feature integration and dimensionality adjustment. Depending on the task type, the corresponding output layer is connected at the output of the fully connected layer to generate the task prediction results for classification, regression, or detection tasks.
[0063] A list of indices, perfectly aligned with the time-block sequence, is maintained. This list is then used to iterate through all fused feature vectors, concatenating them end-to-end along their feature dimensions to form a very long sample-level feature vector. This long vector fully preserves all temporal features from the beginning to the end of the sequence, incorporating both local and global information. This long vector is then fed into a multilayer perceptron module, which consists of stacked fully connected layers. Non-linear activation functions such as ReLU and optional batch normalization layers are typically introduced between layers to improve training stability. These fully connected layers perform deep non-linear transformations, information compression, and high-level abstraction on the high-dimensional concatenated features, gradually mapping them to a feature space more suitable for the final task decision. Finally, depending on the specific downstream task requirements, a specific type of output layer is connected to the end of this fully connected network: for classification tasks, a fully connected layer with the number of neurons equal to the number of categories is connected, followed by a Softmax activation function to output the probability distribution of each category; for regression tasks, a linear output layer with one or more neurons is connected to directly predict continuous target values; for detection tasks, a more complex output head may be designed, such as connecting multiple fully connected layers to simultaneously output the target bounding box coordinates and class confidence scores. The entire process achieves an end-to-end mapping from temporal feature sequences to the final task results, ensuring the effective utilization of local and global information.
[0064] In this embodiment of the invention, by structurally segmenting long-term sequences into ordered time blocks, efficient collaborative extraction of local fine-grained features and global long-range dependencies is achieved: intra-block convolutional encoding focuses on capturing short-term temporal patterns, ensuring fine-grained feature representation; while the block-level feature matrix establishes global dependencies across time blocks through temporal modeling networks (such as dilated convolutions, recurrent networks, or attention mechanisms), effectively modeling the overall evolutionary trend; finally, through block-by-block fusion and sequential aggregation of local and global features, a sample-level representation with both detailed and contextual information is formed. This structure significantly reduces the computational complexity of long sequences while maintaining the consistency of the temporal structure, thereby achieving more accurate and efficient classification, prediction, and anomaly detection performance in time-series analysis tasks such as medical monitoring and equipment diagnosis.
[0065] The above describes the time-series data processing method based on time-block hierarchical modeling in the embodiments of the present invention. The following describes the time-series data processing apparatus based on time-block hierarchical modeling in the embodiments of the present invention. Please refer to [link to relevant documentation]. Figure 3 One embodiment of the time-series data processing apparatus based on time-block hierarchical modeling in this invention includes: The acquisition module 301 is used to acquire time series input data, perform standardization preprocessing and length alignment to obtain the aligned time series; The segmentation module 302 is used to segment the aligned time series according to a preset time block length and step size to obtain multiple consecutive time blocks. The processing module 303 is used to perform intra-block local convolutional encoding on each time block, extract intra-block local features, and vectorize the local features to obtain the local feature vectors corresponding to each time block. Modeling module 304 is used to construct block-level feature sequences based on the local feature vectors of all time blocks, and to perform cross-time block global modeling on the block-level feature sequences to obtain the global context feature vectors corresponding to each time block. The fusion module performs fusion on line 305 to obtain the fused time block feature representation; The output module 306 is used to splice and converge the fused feature representations of all time blocks in chronological order to generate sample-level feature representations, and output the task prediction results based on the sample-level feature representations.
[0066] In this embodiment of the invention, by dividing long-term time series into ordered time blocks and adopting a hierarchical processing structure of "intra-block local convolutional encoding - inter-block global modeling - local-global feature fusion", the extraction of short-term fine-grained features and long-term evolutionary trends is effectively taken into account, significantly improving the model's ability to express complex temporal patterns. At the same time, the block-level parallel computing mechanism greatly reduces the processing complexity of long-term time series and enhances training and inference efficiency. In addition, the entire process maintains the consistency of temporal order, avoiding the loss of temporal structure information caused by pooling or disordered operations, thereby achieving more stable and efficient end-to-end modeling and decision-making capabilities in time-sensitive scenarios such as medical monitoring and industrial analysis.
[0067] Please see Figure 4 Another embodiment of the time-series data processing device based on time block hierarchical modeling in this invention includes: The acquisition module 301 is used to acquire time series input data, perform standardization preprocessing and length alignment to obtain the aligned time series; The segmentation module 302 is used to segment the aligned time series according to a preset time block length and step size to obtain multiple consecutive time blocks. The processing module 303 is used to perform intra-block local convolutional encoding on each time block, extract intra-block local features, and vectorize the local features to obtain the local feature vectors corresponding to each time block. Modeling module 304 is used to construct block-level feature sequences based on the local feature vectors of all time blocks, and to perform cross-time block global modeling on the block-level feature sequences to obtain the global context feature vectors corresponding to each time block. The fusion module performs fusion on line 305 to obtain the fused time block feature representation; The output module 306 is used to splice and converge the fused feature representations of all time blocks in chronological order to generate sample-level feature representations, and output the task prediction results based on the sample-level feature representations.
[0068] Optionally, the segmentation module 302 can be specifically used for: On the timeline, starting from the beginning of the sequence, consecutive time windows are set at step sizes; data segments within each time window, with a preset time block length, are extracted as independent time blocks; all extracted time blocks are arranged according to their chronological order in the original sequence to form a time block sequence. The total number of time blocks is calculated using the following formula:
[0069] Among them, T fix The total length of the time series after length alignment is given, L is the preset length of a single time block, and S is the step size for dividing the time block.
[0070] Optionally, the processing module 303 can be specifically used for: Each time block is input into a convolutional neural network submodule with shared weights; local feature maps reflecting waveform or pattern changes within the time block are extracted through the convolutional layers in the convolutional neural network submodule; the structure of the local feature maps is flattened and its dimensions are transformed into a fixed-dimensional vector representation, which serves as the local feature vector of the time block.
[0071] Optionally, modeling module 304 includes: Construction unit 3041 is used to stack the local feature vectors of all time blocks according to their order in the time block sequence to construct a two-dimensional block-level feature matrix; Input unit 3042 is used to input the block-level feature matrix into a temporal modeling network, which can capture long-range dependencies between sequence elements; Extraction unit 3043 is used to extract the output feature vector corresponding to the position of each input time block from the output of the temporal modeling network, and use it as the global context feature vector for each time block.
[0072] Optionally, the extraction unit 3043 can be specifically used for: Determine the temporal position of each time block in the block-level feature matrix; input the block-level feature matrix into an extended causal one-dimensional convolutional network for forward propagation. The processing procedure is as follows:
[0073] in, This represents the dilated causal one-dimensional convolution operation, where F represents the block-level feature sequence. This represents the global context feature sequence output after computation.
[0074] From the output matrix of the extended causal one-dimensional convolutional network, the corresponding row vectors are extracted according to the temporal position index to obtain the global context feature vector of each time block.
[0075] Optionally, the fusion module 305 is specifically used for: For each time block index, extract its local feature vector and corresponding global context feature vector; concatenate the local feature vector and global context feature vector to form a new fused feature vector; perform a nonlinear transformation on the fused feature vector to generate the final time block feature representation that simultaneously contains local and global context information.
[0076] Optionally, output module 306 is specifically used for: Following the temporal order of the time blocks, the fused feature representations of each time block are sequentially concatenated to form a long vector. This long vector is then input into one or more fully connected layers for feature integration and dimensionality adjustment. Depending on the task type, the corresponding output layer is connected at the output of the fully connected layer to generate the task prediction results for classification, regression, or detection tasks.
[0077] In this embodiment of the invention, by structurally segmenting long-term sequences into ordered time blocks, efficient collaborative extraction of local fine-grained features and global long-range dependencies is achieved: intra-block convolutional encoding focuses on capturing short-term temporal patterns, ensuring fine-grained feature representation; while the block-level feature matrix establishes global dependencies across time blocks through temporal modeling networks (such as dilated convolutions, recurrent networks, or attention mechanisms), effectively modeling the overall evolutionary trend; finally, through block-by-block fusion and sequential aggregation of local and global features, a sample-level representation with both detailed and contextual information is formed. This structure significantly reduces the computational complexity of long sequences while maintaining the consistency of the temporal structure, thereby achieving more accurate and efficient classification, prediction, and anomaly detection performance in time-series analysis tasks such as medical monitoring and equipment diagnosis.
[0078] above Figure 3 and Figure 4 The timing data processing device based on time block hierarchical modeling in the embodiments of the present invention will be described in detail from the perspective of modular functional entities. The electronic device in the embodiments of the present invention will be described in detail from the perspective of hardware processing.
[0079] See Figure 5 As shown, the electronic device includes a processor 500 and a memory 501. The memory 501 stores machine-executable instructions that can be executed by the processor 500. The processor 500 executes the machine-executable instructions to implement the aforementioned time-series data processing method based on time block hierarchical modeling.
[0080] Furthermore, Figure 5 The electronic device shown also includes a bus 502 and a communication interface 503. The processor 500, the communication interface 503 and the memory 501 are connected via the bus 502.
[0081] The memory 501 may include high-speed random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 503 (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc. The bus 502 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 5 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0082] The processor 500 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 500 or by instructions in software form. The processor 500 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this disclosure. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this disclosure can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules may reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 501. The processor 500 reads the information in memory 501 and, in conjunction with its hardware, completes the method steps of the aforementioned embodiment.
[0083] The present invention also provides an electronic device, the computer device including a memory and a processor, the memory storing computer-readable instructions, which, when executed by the processor, cause the processor to perform the steps of the time-series data processing method based on time block hierarchical modeling described in the above embodiments.
[0084] The present invention also provides a computer-readable storage medium, which can be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium, wherein the computer-readable storage medium stores instructions that, when the instructions are executed on a computer, cause the computer to perform the steps of the time-series data processing method based on time block hierarchical modeling.
[0085] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0086] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0087] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A time-series data processing method based on time-block hierarchical modeling, characterized in that, The time-series data processing method based on time-block hierarchical modeling includes: Obtain the time series input data, and perform standardization preprocessing and length alignment to obtain the aligned time series; Based on the aligned time series, it is divided according to the preset time block length and step size to obtain multiple consecutive time blocks; For each time block, perform intra-block local convolutional encoding to extract intra-block local features, and vectorize the local features to obtain the local feature vector corresponding to each time block; A block-level feature sequence is constructed based on the local feature vectors of all time blocks, and the block-level feature sequence is then used for cross-time block global modeling to obtain the global context feature vector corresponding to each time block. For each time block, its local feature vector is fused with the corresponding global context feature vector to obtain the fused time block feature representation; Based on the fused feature representations of all time blocks, the data are spliced and converged in chronological order to generate sample-level feature representations, and the task prediction results are output based on these sample-level feature representations.
2. The time-series data processing method based on time-block hierarchical modeling according to claim 1, characterized in that, The process involves dividing the aligned time series according to a preset time block length and step size to obtain multiple consecutive time blocks, including: On the time axis, starting from the beginning of the sequence, consecutive time windows are set at intervals of the step size; Extract a data segment within each time window, with a length equal to the preset time block length, into an independent time block; All extracted time blocks are arranged according to their chronological order in the original sequence to form a time block sequence. The total number of time blocks is calculated using the following formula: Among them, T fix The total length of the time series after length alignment is given, L is the preset length of a single time block, and S is the step size for dividing the time block.
3. The time-series data processing method based on time-block hierarchical modeling according to claim 1, characterized in that, The step of performing intra-block local convolutional encoding on each time block to extract intra-block local features, and vectorizing the local features to obtain the local feature vector corresponding to each time block, includes: Each time block is fed into a convolutional neural network submodule with shared weights; The convolutional layers in the convolutional neural network submodule extract local feature maps that reflect waveform or pattern changes within the time block. The structure of the local feature map is flattened and its dimensions are transformed into a fixed-dimensional vector representation, which serves as the local feature vector of the time block.
4. The time-series data processing method based on time-block hierarchical modeling according to claim 1, characterized in that, The step of constructing a block-level feature sequence based on the local feature vectors of all time blocks, and performing cross-time-block global modeling on the block-level feature sequence to obtain the global context feature vector corresponding to each time block includes: The local feature vectors of all time blocks are stacked in order of their position in the time block sequence to construct a two-dimensional block-level feature matrix. The block-level feature matrix is input into a temporal modeling network, which is able to capture long-range dependencies between sequence elements. From the output of the time series modeling network, the output feature vector corresponding to the position of each input time block is extracted as the global context feature vector for each time block.
5. The time-series data processing method based on time-block hierarchical modeling according to claim 4, characterized in that, The step of extracting the output feature vector corresponding to the position of each input time block from the output of the temporal modeling network, as the global context feature vector for each time block, includes: Determine the temporal position of each time block in the block-level feature matrix; The block-level feature matrix is input into an extended causal one-dimensional convolutional network for forward propagation. The processing procedure is as follows: in, This represents the dilated causal one-dimensional convolution operation, where F represents the block-level feature sequence. This represents the global context feature sequence output after processing; From the output matrix of the extended causal one-dimensional convolutional network, the corresponding row vectors are extracted according to the temporal position index to obtain the global context feature vector of each time block.
6. The time-series data processing method based on time-block hierarchical modeling according to claim 1, characterized in that, For each time block, its local feature vector is fused with the corresponding global context feature vector to obtain the fused time block feature representation, including: For each time block index, extract its local feature vector and the corresponding global context feature vector; The local feature vector is concatenated with the global context feature vector to form a new fused feature vector; The fused feature vector is subjected to a nonlinear transformation to generate the final time block feature representation that simultaneously contains local and global contextual information.
7. The time-series data processing method based on time-block hierarchical modeling according to any one of claims 1-6, characterized in that, The step of concatenating and converging the fused feature representations of all time blocks in chronological order to generate sample-level feature representations, and outputting task prediction results based on these sample-level feature representations, includes: Following the temporal order of the time blocks, the fused feature representations of each time block are concatenated sequentially to form a long vector; The long vector is input into one or more fully connected layers for feature integration and dimension adjustment. Depending on the task type, a corresponding output layer is connected to the output of the fully connected layer to generate task prediction results for classification, regression, or detection tasks.
8. A time-series data processing device based on time-block hierarchical modeling, characterized in that, The time-series data processing device based on time-block hierarchical modeling includes: The acquisition module is used to acquire time series input data, perform standardization preprocessing and length alignment to obtain the aligned time series; The segmentation module is used to segment the aligned time series according to a preset time block length and step size to obtain multiple consecutive time blocks. The processing module is used to perform intra-block local convolutional encoding on each time block, extract intra-block local features, and vectorize the local features to obtain the local feature vector corresponding to each time block. The modeling module is used to construct a block-level feature sequence based on the local feature vectors of all time blocks, and to perform cross-time block global modeling on the block-level feature sequence to obtain the global context feature vector corresponding to each time block. The fusion module is used to fuse the local feature vector of each time block with the corresponding global context feature vector to obtain the fused time block feature representation; The output module is used to splice and converge the fused feature representations of all time blocks in chronological order to generate sample-level feature representations, and output the task prediction results based on the sample-level feature representations.
9. An electronic device, characterized in that, The electronic device includes: a memory and at least one processor, wherein the memory stores instructions; The at least one processor invokes the instructions in the memory to cause the time-block hierarchical modeling-based time-series data processing device to execute the time-block hierarchical modeling-based time-series data processing method as described in any one of claims 1-7.
10. A computer-readable storage medium storing instructions thereon, characterized in that, When the instructions are executed by the processor, they implement the time-series data processing method based on time block hierarchical modeling as described in any one of claims 1-7.
