Time series data processing method, device and medium for variable input and output length

By constructing a tree structure and using resampling techniques to process time series with variable input and output lengths, the problem of poor adaptability of existing models is solved, and flexible multivariate time series data processing and efficient prediction are achieved.

CN122947086BActive Publication Date: 2026-11-24ZHEJIANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611444838.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-09-17
Publication Date
2026-11-24
Estimated Expiration
2046-09-17

AI Technical Summary

Technical Problem

Existing time series prediction models are difficult to adapt to variable input and output lengths, resulting in high training costs, large storage requirements, and complex operation and maintenance, and they are difficult to meet the needs of different tasks.

Method used

By constructing a tree structure that matches the input length, resampling and dimensionality reduction are performed to obtain independent and interval representations. These representations are then weighted and fused, and the tree is split layer by layer into nodes that match the target output length, enabling flexible processing of multivariate time series data.

Benefits of technology

It improves the reliability of time series prediction results, reduces model training and storage maintenance costs, and adapts to the needs of different input and output lengths.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122947086B_ABST
    Figure CN122947086B_ABST
Patent Text Reader

Abstract

This invention discloses a method, device, and medium for processing time-series data with variable input and output lengths. The method includes: acquiring a multivariate time-series sequence containing several entity variables; mapping the observation vectors at each sampling time to leaf nodes; concatenating adjacent sub-intervals in chronological order and recursively aggregating parent nodes to construct a tree structure matching the sequence length; resampling the sequence to obtain independent representations of each entity variable and generating complete interval representations; combining the tree structure to obtain and score candidate interval representations to generate a comprehensive weight; selecting a target interval based on the comprehensive weight and weightedly fusing its interval representations to obtain a variable fusion representation; splitting layer by layer with the variable fusion representation and independent representations as root nodes to obtain main leaf nodes and residual leaf nodes matching the target output length; merging the nodes corresponding to the target sampling time and mapping them to predicted entity variable values. This invention can adapt to time-series inputs and outputs with variable lengths.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer technology, and in particular relates to a method, device, and medium for processing time-series data with variable input and output lengths. Background Technology

[0002] Time series forecasting is a technique that predicts the state changes of an object over a future time period based on observational data of the object within a given time period. It has been widely applied in scenarios such as meteorological monitoring, power equipment operation monitoring, energy dispatching, traffic flow forecasting, and industrial equipment condition prediction. These scenarios typically involve multiple time-varying and interrelated entity variables, such as temperature, humidity, air pressure, and wind speed in meteorological scenarios, load and oil temperature in power equipment scenarios, and the output power of different power plants in photovoltaic scenarios.

[0003] In practical applications, the available data length and the required prediction length are not always fixed. For example, the number of sampling points that can be obtained for different prediction tasks may vary due to factors such as equipment start-up and shutdown, sampling interruption, data transmission status, or service call timing. Furthermore, the number of future prediction steps required for tasks such as short-term early warning, operational control, and long-term scheduling also differs. Therefore, time series prediction systems not only need to model sequences of different lengths but also need to output prediction sequences of different lengths according to task requirements.

[0004] Existing deep learning time series prediction methods typically set fixed input and output prediction lengths before training, and construct training samples and network structures according to these predetermined lengths. In a type of prediction model based on linear mapping, the sequence is usually directly mapped to the future sequence through a weight matrix and bias terms, with the dimension of the relevant weight matrix determined by the input and output prediction lengths. When the input or output prediction length changes, the dimension of the original weight matrix will no longer match the new input or output.

[0005] In a class of prediction models based on self-attention mechanisms, the input side typically uses positional encoding, embedding layers, or feature projection layers that match the training window length or block partitioning method. The output side maps hidden features to a pre-defined number of prediction steps via a prediction head. Therefore, even if the self-attention computation in the model can handle a certain degree of sequence variation, its input representation structure and output prediction head may still be constrained by the preset sequence length. For prediction models employing convolution, state space, or other feature extraction structures, although their intermediate feature processing modules may have some variable-length processing capabilities, their input block partitioning, feature flattening, or output mapping stages are often constructed according to predetermined sizes, making it difficult for the end-to-end prediction system to simultaneously adapt to different input and output lengths.

[0006] Therefore, some learnable parameters or network structures of existing prediction models are often coupled with the input length and output prediction length. After training, the model can often only handle length combinations that are the same as or similar to the training configuration. When a real-world task uses a new input length or output prediction length, it is usually necessary to readjust the network structure and retrain the model, or train and deploy multiple dedicated models for different length combinations. This increases training costs, model storage requirements, and operational and maintenance complexity, and also makes it difficult to meet the need for flexible switching of prediction ranges at different operational stages of the same device or business system. Summary of the Invention

[0007] To address the shortcomings of existing technologies, embodiments of the present invention provide a method, device, and medium for processing time-series data with variable input / output lengths.

[0008] In a first aspect, embodiments of the present invention provide a time-series data processing method for variable input / output lengths, the method comprising:

[0009] Obtain a multivariate time series with an input length of L and a target output length of T; wherein, the multivariate time series includes observation vectors at L sampling times, each observation vector includes several entity variables, and the target output length T represents the number of target sampling times to be predicted;

[0010] The observation vectors at each sampling time are mapped to leaf nodes, and the nodes of adjacent sub-intervals are concatenated in chronological order and recursively aggregated into a parent node, thereby constructing a tree structure that matches the input length.

[0011] Resampling of multivariate time series yields independent representations of each entity variable;

[0012] The independent representations of each entity variable are reduced in dimensionality to obtain the interval representation of the complete interval; based on the interval representation of the complete interval and the tree structure, the interval representation of each candidate interval is obtained; the candidate intervals are evaluated based on the interval representation of each candidate interval to generate the comprehensive weight of each candidate interval.

[0013] Several target intervals are selected based on the comprehensive weights. The interval representations corresponding to the target intervals are extracted from the tree structure and then weighted and fused according to the corresponding comprehensive weights to obtain the variable fusion representations.

[0014] The variable fusion representation is used as the root node and then splits into main leaf nodes that match the target output length. The independent representation of each entity variable is used as the root node and then splits into residual leaf nodes that match the target output length. The main leaf nodes and residual leaf nodes at the target sampling time are merged and mapped to the predicted values ​​of the entity variables at that time.

[0015] In a second aspect, embodiments of the present invention provide an electronic device, characterized in that it includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores one or more computer programs executable by the at least one processor, and the one or more computer programs are executed by the at least one processor to enable the at least one processor to perform the above-described timing data processing method for variable input / output length.

[0016] Thirdly, embodiments of the present invention provide a computer-readable storage medium having a computer program stored thereon, characterized in that the computer program, when executed by a processor, implements the above-described time-series data processing method for variable input / output lengths.

[0017] Fourthly, embodiments of the present invention provide a computer program product, including a computer program / instruction, characterized in that the computer program / instruction, when executed by a processor, implements the above-described timing data processing method for variable input / output lengths.

[0018] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0019] This invention maps the observation vectors at each sampling time point in a multivariate time series to leaf nodes and recursively aggregates adjacent sub-intervals according to time order to construct a tree structure matching the length of the time series. Simultaneously, it obtains independent representations of each entity variable through resampling and calculates scores and comprehensive weights based on the interval representations of candidate historical intervals, selecting target historical intervals for weighted fusion. This fully utilizes the hierarchical correlation information and key historical change information in the multivariate time series data. Furthermore, using the variable fusion representation and the independent representations of each entity variable as root nodes, it progressively splits into main leaf nodes and residual leaf nodes matching the target output length, and performs merged prediction. This allows the prediction results to simultaneously represent the common change characteristics among multiple variables and the independent change characteristics of each entity variable, thus adapting to the processing needs of time series data with different input and output lengths and improving the reliability of time series prediction results. Attached Figure Description

[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 A flowchart illustrating a timing data processing method for variable input / output lengths provided in an embodiment of the present invention;

[0022] Figure 2 A schematic diagram of a timing data processing method for variable input / output length provided in an embodiment of the present invention;

[0023] Figure 3 A schematic diagram illustrating the construction of a tree structure matching the length of a multivariate time series provided in an embodiment of the present invention;

[0024] Figure 4 This is a schematic diagram illustrating the interval representation of obtaining candidate intervals according to an embodiment of the present invention;

[0025] Figure 5 A schematic diagram illustrating the layer-by-layer splitting into an inverse tree structure matching the target output length, provided for an embodiment of the present invention;

[0026] Figure 6 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0027] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0028] It should be noted that, unless otherwise specified, the features in the following embodiments and implementation methods can be combined with each other.

[0029] like Figure 1 and Figure 2 As shown, this invention provides a time-series data processing method for variable input / output lengths. This invention addresses technical scenarios such as meteorological monitoring, transformer operation monitoring, and photovoltaic power prediction, processing multivariate time-series data with clear physical meanings, including temperature, humidity, air pressure, wind speed, load, oil temperature, and photovoltaic output power. To address the problem of variable input lengths due to equipment start-up / shutdown, sampling interruptions, data transmission status changes, or prediction task variations, this invention constructs a segment tree encoder that matches the input sequence length, enabling time-series data of different lengths to be represented using a unified hierarchical approach. The method includes:

[0030] Step S1: Obtain a multivariate time series with an input length of L and a target output length of T; wherein, the multivariate time series includes observation vectors at L sampling times, each observation vector includes several entity variables, and the target output length T represents the number of target sampling times to be predicted.

[0031] Specifically, the multivariate time series is denoted as ,in, This indicates the input length, i.e., the number of sampling times. Indicates the first The observation vector at the nth sampling time is the... Each time step Indicates the number of entity variables.

[0032] This example can be applied to weather forecasting, power transformers, and photovoltaic power generation; the multivariate time series can be selected from the Weather dataset, ETT dataset, and Solar dataset.

[0033] The Weather dataset contains 21 meteorological or environmental monitoring variables: air pressure (mbar), air temperature (°C), potential temperature (K), dew point temperature (°C), relative humidity (%), saturated vapor pressure (mbar), actual vapor pressure (mbar), vapor pressure deficit (mbar), specific humidity (g / kg), water vapor molar concentration (mmol / mol), air density (g / m³), wind speed (m / s), maximum wind speed (m / s), wind direction (°), precipitation (mm), precipitation duration (s), downward shortwave radiation (W / m²), photosynthetically active radiation (μmol / m² / s), maximum photosynthetically active radiation (μmol / m² / s), data logger internal temperature (°C), and carbon dioxide concentration (ppm). It can be used to predict meteorological elements such as temperature, humidity, air pressure, and wind speed.

[0034] The ETT dataset contains seven transformer operating variables: high-voltage side active load (MW), high-voltage side reactive load (Mvar), medium-voltage side active load (MW), medium-voltage side reactive load (Mvar), low-voltage side active load (MW), low-voltage side reactive load (Mvar), and transformer oil temperature (°C). It can predict power transformer temperature, perform transformer oil temperature prediction and operating status monitoring, anomaly detection, and overheat warning.

[0035] The Solar dataset contains the output power of 137 photovoltaic (PV) power plants, corresponding to PV power plants numbered from 1 to 137. It allows for the prediction of PV power output and PV power generation.

[0036] Step S2: Map the observation vectors at each sampling time to leaf nodes, concatenate the nodes of adjacent sub-intervals in chronological order and recursively aggregate them into a parent node, thereby constructing a tree structure that matches the input length.

[0037] Furthermore, the observation vector at each sampling time is mapped to a leaf node, as shown in the following expression:

[0038]

[0039] In the formula, Indicates the first Observation vector at each sampling time The corresponding leaf node representation, This indicates that the time step is embedded in a linear layer, and D represents the dimension of the leaf node representation.

[0040] Aggregate the node representations of the temporally adjacent left sub-intervals and right sub-intervals in left-right order to generate a parent node covering both the left and right sub-intervals, as shown in the following expression:

[0041]

[0042] In the formula, It is a representation of the left adjacent sub-interval. It is a representation of the adjacent sub-interval on the right. This indicates that the representations of two adjacent subintervals are concatenated in left-right order. It is a shared aggregated linear layer in the tree structure. It is a representation that covers the left and right adjacent sub-intervals.

[0043] For example, the leaf node representation of "load and oil temperature status in the previous hour" and the leaf node representation of "load and oil temperature status in the next hour" in the ETT scenario are concatenated to obtain the load and oil temperature status covering these two hours, which serves as the parent node.

[0044] Figure 3 The process of constructing a tree structure from a multivariate time series is shown, where node labels i:j represent sub-intervals covering the i-th sampling time to the j-th sampling time.

[0045] Figure 3 In (a) of the multivariate time series, when the length L of the multivariate time series is 4, the observation vectors at each sampling time are first mapped to leaf node representations 1:1, 2:2, 3:3 and 4:4, respectively. Adjacent leaf nodes are recursively aggregated according to time order to obtain nodes 1:2 and 3:4, and then the two are aggregated into the root node 1:4.

[0046] Figure 3 In (b) of the diagram, when the length L of the multivariate time series is 5, a new leaf node 5:5 is added at the 5th sampling time. The original 1:4 subtree remains unchanged, and the new node is incrementally expanded along the right-hand path. "Empty" in the diagram indicates a placeholder node for which there is currently no corresponding observation.

[0047] Figure 3In (c), when the length L of the multivariate time series is 8, new leaf nodes 6:6, 7:7, and 8:8 are added, which form parent nodes 5:6, 7:8, and 5:8 in sequence. Then, 1:4 and 5:8 are aggregated into the root node 1:8.

[0048] Depend on Figure 3 It can be seen that the observation vector at each sampling time is mapped to a leaf node, and parent nodes are formed layer by layer through the splicing and recursive aggregation of adjacent time intervals. When the input length of the multivariate time series increases, that is, when a new sampling time is added, a new leaf node corresponding to the new sampling time is added, and only the parent nodes on the path from the newly added leaf node to the updated root node are calculated.

[0049] Step S3: Resample the multivariate time series to obtain independent representations of each entity variable.

[0050] Specifically, M resampling points are set along the time axis, and the resampling results of each entity variable corresponding to the M resampling points are obtained by linear interpolation.

[0051] For each entity variable, the M resampling results corresponding to the entity variable are arranged in chronological order to form a resampling vector, and the resampling vector is processed by a linear layer to obtain the independent representation corresponding to the entity variable.

[0052] For the c-th entity variable, the M resampling results are arranged in chronological order to form a resampling vector. Calculate the independent representation corresponding to the c-th entity variable, as shown in the following expression:

[0053]

[0054] In the formula, This represents the independent representation of the c-th entity variable. This indicates that variables are independently embedded in a linear layer.

[0055] For example, the oil temperature sequence in the ETT scenario is resampled to obtain an independent characterization of the oil temperature; the high-voltage side active load sequence in the ETT scenario is resampled to obtain an independent characterization of the high-voltage side active load; and a photovoltaic power station in the Solar scenario is resampled to obtain an independent characterization of the power of the photovoltaic power station.

[0056] Step S4: Dimensionality reduction is performed on the independent representations of each entity variable to obtain the interval representation of the complete interval; based on the interval representation of the complete interval and the tree structure, the interval representation of each candidate interval is obtained; the candidate intervals are scored based on the interval representation of each candidate interval to generate the comprehensive weight of each candidate interval.

[0057] Specifically, step S4 includes the following sub-steps:

[0058] Step S401: Dimensionality reduction is performed on the independent representations of each entity variable to obtain the interval representation of the complete interval, as shown in the following expression:

[0059]

[0060] In the formula, The interval representation of the complete interval corresponding to the c-th entity variable. Indicates a linear reduction layer. The dimension representing the interval representation of the complete interval.

[0061] Step S402: Based on the interval representation of the complete interval and the tree structure, obtain the interval representation of each candidate interval.

[0062] Furthermore, for the candidate interval from the i-th sampling time to the j-th sampling time, it is obtained by concatenating the candidate sub-intervals from the (i-1)-th sampling time to the j-th sampling time and the candidate sub-intervals from the i-th sampling time to the (j+1)-th sampling time, as shown in the following expression:

[0063]

[0064] In the formula, This represents the interval representation of the candidate interval [i:j] for the c-th entity variable from the i-th sampling time to the j-th sampling time. This represents the interval representation of the candidate sub-interval [i-1:j] of the c-th entity variable from the (i-1)-th sampling time to the j-th sampling time. This represents the interval representation of the candidate sub-interval [i:j+1] of the c-th entity variable from the i-th sampling time to the (j+1)-th sampling time. This represents the linear layer of the Yang Hui triangle.

[0065] Step S403: Score the candidate intervals based on the interval representation of each candidate interval to generate a comprehensive weight for each candidate interval.

[0066] Furthermore, obtain the interval representation of each entity variable in each candidate interval;

[0067] The weights corresponding to the interval representations of each entity variable in each candidate interval are obtained through a linear layer.

[0068] The average weight of all entity variables for the same candidate interval is obtained by averaging the weights of all entity variables for that candidate historical interval.

[0069] The expression is as follows:

[0070]

[0071]

[0072] In the formula, This represents the weight of the c-th entity variable within the candidate interval [i:j] from the i-th sampling time to the j-th sampling time. This indicates a linear layer with interval weights. This represents the comprehensive weight corresponding to the candidate interval [i:j] from the i-th sampling time to the j-th sampling time.

[0073] For example, in the Weather data scenario, entity variables such as air pressure, temperature, humidity, wind speed, precipitation, and radiation are scored for candidate intervals [i:j], and the average is taken to obtain the comprehensive weight corresponding to candidate interval [i:j]. In the ETT data scenario, entity variables including active load on the high-voltage side, reactive load on the high-voltage side, active load on the medium-voltage side, reactive load on the medium-voltage side, active load on the low-voltage side, reactive load on the low-voltage side, and transformer oil temperature are scored for candidate intervals [i:j], and the average is taken to obtain the comprehensive weight corresponding to candidate interval [i:j]. In the Solar data scenario, the output power of 137 photovoltaic power stations is scored for candidate intervals [i:j], and the average is taken to obtain the comprehensive weight corresponding to candidate interval [i:j].

[0074] Step S5: Select several target intervals according to the comprehensive weight, extract the interval representations corresponding to the target intervals from the tree structure, and perform weighted fusion according to the corresponding comprehensive weights to obtain the variable fusion representation.

[0075] Specifically, the comprehensive weights of all candidate historical intervals are sorted in descending order, and the top K candidate historical intervals are selected as the target intervals.

[0076] For each target interval, select the minimum number of nodes from the tree structure that can completely cover the target interval, based on the start and end positions of the target interval.

[0077] When the target interval corresponds to a node already saved in the tree structure, the node is read directly to obtain the interval representation of the target interval; when the selected node is in a different tree layer, the nodes of the lower tree layer are aggregated upwards level by level, and zero values ​​are filled in the same level sub-interval positions that do not belong to the target interval to perform hierarchical alignment of each node. According to the temporal position of each node and the tree structure, the nodes that have completed the tree layer alignment are aggregated layer by layer to obtain the interval representation of the target interval.

[0078] The interval representation of each target interval is multiplied by the corresponding comprehensive weight, and the resulting product is processed through a linear layer. The processing results of each linear layer are summed and then processed by the GELU activation function to obtain the variable fusion representation.

[0079] For example, such as Figure 4As shown, the tree structure stores leaf nodes and parent nodes formed layer by layer. When a target interval is needed, the minimum number of tree nodes that can completely cover the interval are first found, and then these nodes are aggregated along the tree structure to the root node position to obtain the interval representation corresponding to the target interval.

[0080] like Figure 4 As shown in (a), the target interval [1:4] already corresponds to the root node [1:4] of the entire tree. This node has already been formed by the aggregation of lower-level nodes during the encoding stage, so it can be read directly during extraction without the need to combine other nodes again. In real-world scenarios, this is equivalent to directly reading the state of the entire window. For example, taking ETT data as an example, when the input is transformer load and oil temperature data from the past four sampling times (i.e., [1:1], [2:2], [3:3], [4:4]), [1:4] already represents the complete running process of these four times.

[0081] like Figure 4 As shown in (b), to extract the interval representation corresponding to the target interval [2:4], the target interval [2:4] is jointly covered by nodes [2:2] and [3:4]. These two nodes cannot be aggregated immediately because [2:2] is a single-time leaf node, while [3:4] is an upper-level node that has already covered two times, and the two are at different tree levels. In this example, [2:2] is first aggregated upwards to the same level as [3:4]. Since the interval [1:1] under the same parent node does not belong to the target interval, 0 is used as a placeholder for this position. After completing the level alignment, the aligned left sub-interval is aggregated with [3:4] to form [2:4]. For example, in the Weather scenario, this can represent the weather conditions from the 2nd sampling time to the 4th sampling time. The 1st sampling time is not within the query range, so the readings of air pressure, temperature, humidity, and wind speed at the 1st sampling time are not included in this interval representation.

[0082] like Figure 4 As shown in (c), to extract the interval representation corresponding to the target interval [2:3], which spans the left and right boundaries of the tree, the required base nodes are [2:2] and [3:3]. In this example, the two single-time-point nodes are first aligned upwards: the interval [1:1] to the left of [2:2] uses 0 as a placeholder, and the interval [4:4] to the right of [3:3] uses 0 as a placeholder. The two aligned intermediate nodes are then aggregated upwards to form [2:3]. In the Solar scenario, this is equivalent to extracting only the power changes of 137 photovoltaic power plants within the 2nd and 3rd sampling times. The 1st and 4th sampling times do not belong to the target interval and do not contribute entity data to the representation of this interval.

[0083] Furthermore, weighted fusion is performed according to the corresponding comprehensive weights to obtain the variable fusion representation; the expression is as follows:

[0084]

[0085] In the formula, K represents the number of target intervals. This represents the comprehensive weight corresponding to the k-th target interval. This represents the interval representation corresponding to the k-th target interval. The interval representation represents the projected linear layer, and GELU represents the GELU activation function. This represents the fusion of variables.

[0086] For example, in the Weather scenario, this instance can integrate the pressure drop range, the humidity rapid increase range, and the radiation change range; in the ETT scenario, this instance can integrate the load surge range and the oil temperature continuous rise range; in the Solar scenario, this instance can integrate the ranges of sunrise power increase, cloud shading power decrease, and power recovery.

[0087] Step S6: Using the variable fusion representation as the root node, split layer by layer into main leaf nodes that match the target output length; using the independent representation of each entity variable as the root node, split layer by layer into residual leaf nodes that match the target output length; merge the main leaf nodes and residual leaf nodes at the target sampling time and map them to the predicted values ​​of the entity variables at that time.

[0088] Furthermore, the process of using the variable fusion representation as the root node of the main inverse tree structure and splitting it layer by layer into main leaf nodes corresponding one-to-one with the T target sampling times includes:

[0089] Taking the variable fusion representation as the root node, that is = ;

[0090] The expression for layer-by-layer splitting is as follows:

[0091]

[0092] In the formula, This represents the representation of the left subinterval of the l-th layer. This represents the representation of the right sub-interval of the l-th layer. This represents the parent node of the (l-1)th level. It is a shared linear layer that is split upwards from the root node of the main decoder.

[0093] Adjust the number of layers in the main inverse tree structure according to the target output length T, and after layer-by-layer splitting, obtain the main leaf nodes corresponding one-to-one with the T target sampling times. }

[0094] For example, in the Weather scenario, the main leaf node state can represent the common changes in temperature, humidity, air pressure, and wind speed affected by the same weather process; in the ETT scenario, the main leaf node state can represent the coupled changes in load and oil temperature on each side; in the Solar scenario, the main leaf node state can represent the trend of synchronous power increase and decrease of multiple power plants caused by regional irradiance changes.

[0095] The process of further splitting the independent representations of each entity variable into residual leaf nodes corresponding to the T target sampling times, with each entity variable as the root node of the corresponding residual inverse tree structure, includes:

[0096] Independent representation of the c-th entity variable The root node, i.e. = ;

[0097] The expression for layer-by-layer splitting is as follows:

[0098]

[0099] In the formula, This represents the representation of the left sub-interval of the l-th layer for the c-th entity variable. This represents the representation of the right subinterval of the l-th layer for the c-th entity variable. This represents the parent node representation of the c-th entity variable at level l-1. It is a residual decoder root node that splits upwards to share a linear layer.

[0100] The number of layers in the residual inverse tree structure is adjusted according to the target output length T, and after layer-by-layer splitting, residual leaf nodes corresponding one-to-one with the T target sampling times are obtained. }

[0101] For example, in the ETT scenario, the residual leaf node state retains the thermal inertia of transformer oil temperature, the capacity of a single photovoltaic power station, and the differences in shading; in the Weather scenario, the residual leaf node state can be the independent change of specific weather sensor variables.

[0102] Furthermore, for the t-th target sampling time and the c-th entity variable, t∈T, the main leaf node of the t-th target sampling time is merged with the residual leaf node of the c-th entity variable at the t-th target sampling time. After processing by a multilayer perceptron, the predicted value of the c-th entity variable at the t-th target sampling time is obtained, as shown in the following expression:

[0103]

[0104]

[0105] In the formula, This represents the predicted representation of the c-th entity variable at the t-th target sampling time. This represents the main leaf node at the t-th target sampling time. This represents the leaf node of the residual of the c-th entity variable at the target sampling time t. This represents the predicted value of the c-th entity variable at the t-th target sampling time.

[0106] For example, in the Weather scenario, the predicted value It can correspond to predicted values ​​of future air temperature, relative humidity, air pressure, wind speed, precipitation, or radiation; in ETT scenarios, the predicted values... It can correspond to the future active / reactive load or transformer oil temperature on each side; in the Solar scenario, the predicted value Corresponding to the first The photovoltaic power station in the future Output power at each sampling time.

[0107] It should be noted that this invention uses variable fusion representation as the root node, splitting layer by layer into main leaf node states matching the target output length. It also uses the independent representation of each entity variable as the root node, splitting layer by layer into residual leaf node states matching the target output length. By merging the main leaf node states and residual leaf node states, it can express the common changing trend among multiple entity variables while preserving the independent changing characteristics of each entity variable. This invention can generate predictive output sequences of different lengths by adjusting the splitting level, which is beneficial for switching prediction ranges between different technical tasks such as short-term early warning, equipment operation control, and long-term scheduling, without needing to set a prediction head or deploy a dedicated prediction model for each output length, thereby reducing model storage, training, and operation and maintenance costs.

[0108] like Figure 5 As shown, Figure 5 This demonstrates a top-down recursive splitting of the obtained root node state to generate leaf node states that match the target output length.

[0109] Figure 5 In (a) of the diagram, when the target output length T is 4, the root node 1:4 first splits into 1:2 and 3:4, and then continues to split into four single-time leaf nodes 1:1 to 4:4. Figure 5 In (b) of the diagram, when the target output length T is 5, the left 1:4 interval is completely split, and the right 5:8 interval is only expanded to cover the level of the 5th output position, generating a 5:5 node. Figure 5 In (c), when the target output length T is 8, the root node 1:8 is completely split into eight leaf nodes from 1:1 to 8:8.

[0110] Figure 5The splitting process shown can be applied to two types of root nodes: one uses the variable fusion representation as the root node, generating the main leaf node state layer by layer; the other uses the independent representation of each entity variable as the root node, generating the residual leaf node state according to the same interval splitting structure. The two types of leaf nodes correspond to each other in time position, but respectively bear the main output information and entity variable residual information.

[0111] In summary, this invention provides a time-series data processing method for variable input-output lengths. It maps the observation vectors at each sampling time point in a multivariate time-series sequence to leaf nodes and recursively aggregates adjacent sub-intervals according to time order to construct a tree structure matching the time-series sequence length. Simultaneously, it obtains independent representations of each entity variable through resampling and calculates scores and comprehensive weights based on the interval representations of candidate historical intervals, selecting target historical intervals for weighted fusion. This fully utilizes the hierarchical correlation information and key historical change information in the multivariate time-series data. Furthermore, using the variable fusion representation and the independent representations of each entity variable as root nodes, it progressively splits into main leaf nodes and residual leaf nodes matching the target output length, and performs merging predictions. This allows the prediction results to simultaneously represent the common change characteristics among multiple variables and the independent change characteristics of each entity variable, thus adapting to the processing needs of time-series data with different input and output lengths and improving the reliability of time-series prediction results.

[0112] Accordingly, this application also provides an electronic device, comprising: one or more processors; a memory for storing one or more programs; and, when the one or more programs are executed by the one or more processors, causing the one or more processors to implement the timing data processing method for variable input / output lengths as described above. Figure 6 The diagram shown illustrates a hardware structure of any device with data processing capabilities within which the time-series data processing method for variable input / output lengths provided in this embodiment of the invention is implemented. (Except for...) Figure 6 In addition to the processor, memory, and network interface shown, any data processing device in the embodiment may also include other hardware depending on the actual function of the data processing device, which will not be described in detail here.

[0113] Accordingly, this application also provides a computer-readable storage medium storing computer instructions that, when executed by a processor, implement the aforementioned time-series data processing method for variable input / output lengths. The computer-readable storage medium can be an internal storage unit of any data-processing device as described in any of the foregoing embodiments, such as a hard disk or memory. The computer-readable storage medium can also be an external storage device, such as a plug-in hard disk, smart media card (SMC), SD card, flash card, etc., equipped on the device. Furthermore, the computer-readable storage medium can include both internal storage units of any data-processing device and external storage devices. The computer-readable storage medium is used to store the computer program and other programs and data required by the data-processing device, and can also be used to temporarily store data that has been output or will be output.

[0114] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the disclosure herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only.

[0115] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope.

Claims

1. A method for processing time-series data with variable input / output lengths, characterized in that, For transformer operation monitoring scenarios, the method for processing multivariate time-series data, including load, transformer oil temperature, or transformer temperature, includes: Obtain a multivariate time series with an input length of L and a target output length of T; wherein, the multivariate time series includes observation vectors at L sampling times, each observation vector includes several entity variables, and the target output length T represents the number of target sampling times to be predicted; The observation vectors at each sampling time are mapped to leaf nodes, and the nodes of adjacent sub-intervals are concatenated in chronological order and recursively aggregated into a parent node, thereby constructing a tree structure that matches the input length. Resampling of multivariate time series yields independent representations of each entity variable; The independent representations of each entity variable are reduced in dimensionality to obtain the interval representation of the complete interval; based on the interval representation of the complete interval and the tree structure, the interval representation of each candidate interval is obtained; the candidate intervals are evaluated based on the interval representation of each candidate interval to generate the comprehensive weight of each candidate interval. Several target intervals are selected based on the comprehensive weights. The interval representations corresponding to the target intervals are extracted from the tree structure and then weighted and fused according to the corresponding comprehensive weights to obtain the variable fusion representations. The variable fusion representation is used as the root node and then splits into main leaf nodes that match the target output length. The independent representation of each entity variable is used as the root node and then splits into residual leaf nodes that match the target output length. The main leaf nodes and residual leaf nodes at the target sampling time are merged and mapped to the predicted values ​​of the entity variables at that time. The process of constructing a tree structure that matches the input length includes: Map the observation vector at each sampling time to a leaf node; Aggregate the node representations of the left sub-intervals and the right sub-intervals that are temporally adjacent in order to generate a parent node that covers the left and right sub-intervals. Recursively generate parent nodes until a root node covering all sampling times is obtained, resulting in a tree structure that matches the length of the multivariate time series sequence; When the input length of the multivariate time series increases, i.e. when a new sampling time is added, a new leaf node corresponding to the new sampling time is added, and only the parent node on the path from the newly added leaf node to the updated root node is calculated. The process of obtaining the predicted values ​​of entity variables at the target sampling time includes: The variable fusion representation is used as the root node of the main inverse tree structure, and it is split layer by layer into main leaf nodes that correspond one-to-one with the T target sampling times. The independent representation of each entity variable is used as the root node of the corresponding residual inverse tree structure, and then splits layer by layer into residual leaf nodes that correspond one-to-one with each of the T target sampling times for each entity variable. For the t-th target sampling time and the c-th entity variable, t∈{1,2,...,T}, the main leaf node of the t-th target sampling time is merged with the residual leaf node of the c-th entity variable at the t-th target sampling time. After processing by a multilayer perceptron, the predicted value of the c-th entity variable at the t-th target sampling time is obtained.

2. The time-series data processing method for variable input / output lengths according to claim 1, characterized in that, The process of resampling a multivariate time series to obtain independent representations of each entity variable includes: M resampling points are set along the time axis, and the resampling results of each entity variable corresponding to the M resampling points are obtained by linear interpolation; For each entity variable, the M resampling results corresponding to the entity variable are arranged in chronological order to form a resampling vector, and the resampling vector is processed by a linear layer to obtain the independent representation corresponding to the entity variable.

3. The time-series data processing method for variable input / output lengths according to claim 1, characterized in that, The process of obtaining the interval representation of each candidate interval based on the interval representation of the complete interval and the tree structure includes: For each entity variable, the interval representation of the complete interval corresponding to the entity variable is obtained by dimensionality reduction of the independent representation of the entity variable. Using the interval representation of the complete interval as the root node, the interval representation of each candidate interval is generated layer by layer according to the tree structure; wherein, for the candidate historical interval [i:j] from the i-th sampling time to the j-th sampling time, the interval representation from the (i-1)-th sampling time to the j-th sampling time is concatenated with the interval representation from the i-th sampling time to the (j+1)-th sampling time to obtain the interval representation of the candidate historical interval [i:j].

4. The time-series data processing method for variable input / output lengths according to claim 1, characterized in that, The process of evaluating candidate intervals based on their interval representations and generating a comprehensive weight for each candidate interval includes: Obtain the interval representation of each entity variable in each candidate interval; The linear layer is used to obtain the weight of each entity variable in each candidate interval, representing the interval representation of that interval. The average weight of all entity variables for the same candidate interval is obtained by averaging the weights of all entity variables for that candidate historical interval.

5. The time-series data processing method for variable input / output lengths according to claim 1, characterized in that, The process of selecting several target intervals based on comprehensive weights, extracting the interval representations corresponding to the target intervals from the tree structure, and then weighting and fusing them according to the corresponding comprehensive weights to obtain the variable fusion representations includes: Sort all candidate historical intervals by their combined weights in descending order, and select the top K candidate historical intervals as the target intervals. For each target interval, select the minimum number of nodes from the tree structure that can completely cover the target interval, based on the start and end positions of the target interval. When the target interval corresponds to a node already saved in the tree structure, the node is read directly to obtain the interval representation of the target interval; when the selected node is in a different tree layer, the nodes of the lower tree layer are aggregated upwards level by level, and zero values ​​are filled in the same level sub-interval positions that do not belong to the target interval to perform hierarchical alignment of each node. According to the temporal position of each node and the tree structure, the nodes that have completed the tree layer alignment are aggregated layer by layer to obtain the interval representation of the target interval. The interval representation of each target interval is multiplied by the corresponding comprehensive weight, and the resulting product is processed through a linear layer. The processing results of each linear layer are summed and then processed by the GELU activation function to obtain the variable fusion representation.

6. An electronic device, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores one or more computer programs that can be executed by the at least one processor, the one or more of the computer programs being executed by the at least one processor to enable the at least one processor to perform the timing data processing method for variable input / output length as described in any one of claims 1-5.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the timing data processing method for variable input / output length as described in any one of claims 1-5.

8. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instruction is executed by the processor, it implements the timing data processing method for variable input / output length as described in any one of claims 1-5.