Time series prediction system, method, device, storage medium and program product

Through the combination of multiple timing prediction modules and the token router weight matrix, the timing data processing problem of different time scales is solved, and the accuracy and robustness of timing prediction are improved.

CN118568673BActive Publication Date: 2025-01-10ALIBABA CLOUD FEITIAN (HANGZHOU) CLOUD COMPUTING TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411045332.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2025-01-10
Estimated Expiration
2044-07-31

AI Technical Summary

Technical Problem

The prior art is difficult to effectively process time series data of different time scales, resulting in the impact of timing prediction accuracy.

Method used

Multiple timing prediction modules are used to combine with the pre-learned token router weight matrix, and the contribution of each module to the timing prediction results is determined through the gating mechanism, and aggregation is performed to realize timing prediction of multiple time scales.

Benefits of technology

It improves the accuracy of timing prediction, integrates the results of multiple time scales and takes into account the importance of each time scale, and enhances the robustness of prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118568673B_ABST
    Figure CN118568673B_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide a time series prediction system, method, device, storage medium and program product. In the embodiments of the present application, multiple time series prediction modules can use time series data of multiple time scales to perform time series prediction and output their own initial time series prediction data. The gating mechanism is implemented by the weight matrix of the pre-learned token router, and the contribution of multiple time series prediction modules to the time series prediction results can be determined, reflecting the importance of multiple time scales. Afterwards, the outputs of multiple time series prediction modules can be aggregated according to the contribution of multiple time series prediction modules to the time series prediction results to obtain the time series prediction results, thereby realizing time series prediction at multiple time scales. This time series prediction method not only integrates the time series prediction results of multiple time scales, but also takes into account the importance of each time scale, which helps to improve the accuracy of time series prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a time series prediction system, method, device, storage medium and program product. Background Art

[0002] Time series forecasting, also known as time series prediction, refers to the use of historical data arranged in chronological order to analyze the direction and degree of change, so as to speculate on the levels that may be achieved in several future periods. Time series data in the real world usually show complex patterns and dynamics on different time scales. Sequences that appear to be almost the same on a short time scale may show their own unique characteristics on a longer time scale. The time span of historical time series data has a great impact on the accuracy of time series prediction results, which undoubtedly brings challenges to the accurate prediction of time series data. Summary of the invention

[0003] Multiple aspects of the present application provide a time series prediction system, method, device, storage medium and program product to implement time series prediction on multiple time scales, which helps to improve the accuracy of time series prediction.

[0004] The embodiment of the present application provides a timing prediction system, comprising: a plurality of timing prediction modules, a token router and an aggregation module; the weight matrix of the token router is pre-learned and used to determine the routing probability of the plurality of timing prediction modules;

[0005] The token router is used to determine the contribution of the multiple time series prediction modules to the time series prediction result according to the input original time series data and the weight matrix of the token router, and input the contribution of the multiple time series prediction modules to the time series prediction result to the aggregation module;

[0006] The multiple time series prediction modules correspond one-to-one to the multiple time scales, and are used to obtain time series segments of corresponding time scales obtained by segmenting the original time series data; and perform time series prediction according to the time series segments of corresponding time scales to obtain initial time series prediction data output by the multiple time series prediction modules; the time series segments of corresponding time scales are obtained by segmenting the original time series data;

[0007] The aggregation module is used to aggregate the initial time series prediction data output by the multiple time series prediction modules according to the contribution of the multiple time series prediction modules to the time series prediction result, so as to obtain the time series prediction data.

[0008] The present application also provides a time series prediction method, including:

[0009] Obtaining time series segments with multiple time scales obtained by segmenting the original time series data and a pre-learned weight matrix of a token router; the weight matrix of the token router is used to determine the routing probabilities of multiple time series prediction modules;

[0010] Determining the contribution of multiple timing prediction modules to the timing prediction result according to the original timing data and the weight matrix of the token router;

[0011] Using the multiple time series prediction modules to perform time series prediction according to the time series segments of the corresponding time scales, respectively, to obtain initial time series prediction data output by the multiple time series prediction modules; the multiple time series prediction modules correspond to the multiple time scales one by one;

[0012] According to the contribution of the multiple time series prediction modules to the time series prediction result, the initial time series prediction data output by the multiple time series prediction modules are aggregated to obtain the time series prediction data.

[0013] The embodiment of the present application further provides an electronic device, comprising: a memory and a processor; wherein the memory is used to store a computer program;

[0014] The processor is coupled to the memory and is used to execute the computer program to perform the steps in the above-mentioned time series prediction method.

[0015] An embodiment of the present application also provides a computer-readable storage medium storing computer instructions. When the computer instructions are executed by one or more processors, the one or more processors are caused to execute the steps in the above-mentioned timing prediction method.

[0016] An embodiment of the present application also provides a computer program product, including a computer program. When the computer program is executed by one or more processors, the one or more processors are caused to execute the steps in the above-mentioned timing prediction method.

[0017] In an embodiment of the present application, multiple timing prediction modules can use timing data of multiple time scales to perform timing prediction and output their own initial timing prediction data. The gating mechanism is implemented by the weight matrix of the pre-learned token router, and the contribution of multiple timing prediction modules to the timing prediction results can be determined, reflecting the importance of multiple time scales. Afterwards, the outputs of multiple timing prediction modules can be aggregated according to the contribution of multiple timing prediction modules to the timing prediction results to obtain timing prediction results, thereby realizing timing prediction of multiple time scales. This timing prediction method not only integrates the timing prediction results of multiple time scales, but also takes into account the importance of each time scale, which helps to improve the accuracy of timing prediction. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0019] Figure 1 A schematic diagram of the distribution of time series data shown in an embodiment of the present application;

[0020] Figure 2a , Figure 2b and Figure 3 A schematic diagram of the structure of a time prediction system provided in an embodiment of the present application;

[0021] Figure 4 A schematic diagram of the structure of a timing prediction module provided in an embodiment of the present application;

[0022] Figure 5 A schematic diagram of the structure of a token router provided in an embodiment of the present application;

[0023] Figure 6 A schematic diagram of the structure of the global prompt pool provided in an embodiment of the present application;

[0024] Figure 7 A schematic diagram of a process of performing timing prediction by a timing prediction module provided in an embodiment of the present application;

[0025] Figure 8 A schematic diagram of the structure of another time series prediction system provided in an embodiment of the present application;

[0026] Fig. 9 A schematic diagram of the structure of a local prompt learner provided in an embodiment of the present application;

[0027] Fig.10 A schematic diagram of the training process of the local prompt learner provided in an embodiment of the present application;

[0028] Fig.11 A schematic diagram of another process of performing timing prediction by the timing prediction module provided in an embodiment of the present application;

[0029] Fig.12 A schematic diagram of another process of performing timing prediction by the timing prediction module provided in an embodiment of the present application;

[0030] Fig.13 A schematic diagram of a flow chart of a timing prediction method provided in an embodiment of the present application;

[0031] Fig.14 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0032] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0033] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0034] Time series data refers to a series of data that is continuously generated based on a certain frequency. Time series data may include: tags, time

[0035] The tag consists of a tag key (TagKey) and a corresponding tag.

[0036] The tag value is used to indicate the monitoring object. The metric indicates the monitoring indicator; the metric value indicates the specific value of the monitoring indicator.

[0037] Real-world time series data often exhibit complex patterns and dynamics at different time scales. Due to their unique spatiotemporal dynamics and intrinsic properties, different types of time series data are affected by both short-term and long-term patterns. Figure 1 As shown in the figure above, if we only observe from the perspective of short time scale, we can see that the value of the series has only small fluctuations. Figure 1 The three sequences selected by the dashed boxes below show that the values ​​of the sequences are significantly different. Although the overall trends of the sequences selected by the dashed boxes are similar, the changes in the values ​​of the time series become obvious. When viewed from a longer time scale, the sequences that were almost identical in a short period of time show their own unique characteristics. Among them, Figure 1 The jagged curve with dramatic changes is the actual time series data, and the curve with smooth changes on the actual time series data is a curve fitting of the change trend of the actual time series data.

[0038] Based on the above analysis, the results of time series prediction using time series data of different time scales may vary greatly, which requires a modeling and time series prediction method that can integrate multi-time scale representations. In order to solve this problem, some embodiments of the present application provide a time series prediction method with multi-time scale fusion, the main principle of which is: multiple time series prediction modules can use time series data of multiple time scales to perform time series prediction and output their own initial time series prediction data. The gating mechanism is realized by the weight matrix of the pre-learned token router, and the contribution of multiple time series prediction modules to the time series prediction results can be determined, reflecting the importance of multiple time scales. Afterwards, the outputs of multiple time series prediction modules can be aggregated according to the contribution of multiple time series prediction modules to the time series prediction results to obtain the time series prediction results, thereby realizing time series prediction at multiple time scales. This time series prediction method not only integrates the time series prediction results of multiple time scales, but also takes into account the importance of each time scale, which helps to improve the accuracy of time series prediction.

[0039] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.

[0040] It should be noted that the same reference numerals denote the same objects in the following drawings and embodiments, and therefore, once an object is defined in one drawing or embodiment, it does not need to be further discussed in the subsequent drawings and embodiments.

[0041] Figure 2a , Figure 2b and Figure 3 This is a schematic diagram of the structure of the time prediction system provided in the embodiment of the present application. Figure 2a , Figure 2b and Figure 3 As shown, the time series prediction system includes: a plurality of time series prediction modules 10. A plurality refers to more than two. The plurality of time series prediction modules 10 are as follows: Figure 2a , Figure 2b and Figure 3 As shown in the timing prediction modules 1-N in .

[0042] In an embodiment of the present application, in order to realize time series prediction at multiple time scales, multiple time prediction modules 10 are set. Multiple time series prediction modules 10 are respectively used to process time series data at multiple time scales. Time scale is a key concept in time series analysis and multi-scale analysis, which refers to the duration of measuring the change of events or data points over time. For example, the time scale can be 1 hour, 1 day, 1 week, 1 month or other time periods. Multiple time scales are different. Each time series prediction module 10 is used to process time series data at a time scale. The time series prediction modules 10 correspond one-to-one to the time scales, and are used to process the time series data of the corresponding time scales.

[0043] In some embodiments, the time scale corresponding to the time series prediction module 10 can be measured by the data length (such as the number of data points) or the number of sampling periods, and the time scale is equal to the sampling period multiplied by the number of data. The time scales corresponding to multiple time series prediction modules 10 can increase exponentially, and accordingly, the data length of the time series data input by the time series prediction module 10 can also increase exponentially. For example, the data length of the time series data input by the (i+1)th time series prediction module (i.e., the time series prediction module (i+1)) is Q times the data length of the time series data input by the i-th time prediction module (i.e., the time series prediction module (i+1)). Q>1. For example, the data length of the time series data input by the (i+1)th time series prediction module (i.e., the time series prediction module (i+1)) is twice the data length of the time series data input by the i-th time prediction module (i.e., the time series prediction module (i+1)). Assuming that the data length of the time series data input to the first time series prediction module (that is, time series prediction module 1) is 4, the data length of the time series data input to the second time series prediction module (that is, time series prediction module 2) is 8. The data length of the time series data input to each additional time series prediction module doubles the data length of the previous time series prediction module.

[0044] In the embodiment of the present application, the specific implementation form of the timing prediction module 10 is not limited. The timing prediction module 10 can be implemented as an expert module (Expert) in a Mixture of Experts (MoE) model. Among them, MoE combines multiple expert modules that specialize in processing different data subsets or task fields, and can take advantage of the advantages of multiple expert modules while overcoming the limitations that a single large model may encounter, such as overfitting or inefficiency. The MoE model mainly includes: multiple expert modules (Experts), a gating mechanism, and a combination mechanism. Among them, the expert module is a small model specifically for different tasks or data subsets. Each expert module focuses on solving a part of the problem, so they can learn and represent local features more efficiently. The gating mechanism is responsible for deciding which expert modules should be used for a given input, or how to allocate weights between expert modules. This gating mechanism is usually a separate network that learns the correlation between the input and the expert module, so that it can dynamically select the expert module that best suits the current input. The combination mechanism of the module will combine the outputs of all expert modules according to these weights to produce a final prediction or decision.

[0045] In the MoE model, multiple expert modules can be trained and executed in parallel, which helps to accelerate the training and reasoning process. MoE takes advantage of the sparsity of knowledge, that is, not all expert modules need to respond to all inputs, which helps to reduce redundant computing and storage requirements.

[0046] Among them, the expert module can be implemented as a neural network with a self-attention mechanism, a convolutional neural network (CNN), a recurrent neural network (RNN) or a deep neural network (DNN), etc. The neural network with a self-attention mechanism can be a transformer neural network. Among them, the Transformer neural network allows the model to focus on elements at different positions in the sequence when processing sequence data, thereby capturing long-term dependencies, and the self-attention mechanism adopted by the Transformer neural network allows the model to be trained in parallel, which can increase the model training speed. In an embodiment of the present application, multiple time series prediction modules 10 independently process the input data assigned to them, and each generates a local prediction or representation.

[0047] In the embodiment of the present application, for each time series prediction module 10, the time series segments with corresponding time scales obtained by segmenting the original time series data can be obtained. For example, for the time series prediction module i, the time series segments with time scales L obtained by segmenting the original time series data can be obtained. i The time series segments with multiple time scales are obtained by segmenting the original time series data according to multiple time scales. In some embodiments, the original time series data and the time series segments with multiple time scales obtained by segmenting the original time series data can be pre-stored. During time series prediction, the time series prediction module 10 can read the time series segments with the time scale corresponding to the time series prediction module from the pre-stored time series segments with multiple time scales.

[0048] In other embodiments, in order to save storage resources, the original time series data may be segmented during the time series prediction process to obtain time series segments with multiple time scales. Figure 2b and Figure 3 As shown, multiple segmentation modules 20 can be configured for multiple time series prediction modules 10. The segmentation modules 20 correspond to the time series prediction modules 10 one by one, and respectively provide time series data of corresponding time scales for the corresponding time series prediction modules 10. The multiple segmentation modules 20 segment the original time series data X0 into time series segments with corresponding time scales; and input the time series segments with corresponding time scales into the corresponding time series prediction modules 10. Figure 2b and Figure 3 The time scale corresponding to the segmentation module 20 is L i . i represents the i-th time series prediction module, and can also be the i-th segmentation module or the i-th time scale.

[0049] In the embodiment of the present application, the original time series data It can be the time series data input to the time series prediction system. C represents the number of sequences contained in the original time series data, C≥1, and is an integer; H represents the data length of each sequence, which can also be the number of data points contained in each sequence, H≥2, and is an integer. For example, the original time series data contains temperature time series, humidity time series, and power consumption time series. The sampling period of these time series is 1 hour, and the time scale (or time span) of the original time series data is 3 days. Then each time series includes 72 data points, then C=3, H=72.

[0050] In other embodiments, Figure 3 As shown, the time series prediction system may also include: an instance normalization module (Instance Norm) 50. The instance normalization module is used to deal with the possible distribution mismatch problem between training data and test data, and ensure the distribution consistency of data through normalization, thereby improving the performance of the time series prediction system in the time series prediction task. Accordingly, the instance normalization module 50 can perform normalization processing on the input time series data to obtain the normalized time series data. In this embodiment, the original time series data The data may be normalized time series data.

[0051] Specifically, the instance normalization module 50 can calculate the mean and standard deviation of the input time series data; then, normalize the mean and standard deviation of the time series data according to the mean and standard deviation of each feature dimension; thereafter, scale and translate the normalized time series data to obtain the normalized time series data.

[0052] In the embodiment of the present application, multiple segmentation modules 20 segment the original time series data X into time series segments (Patch) with corresponding time scales. ; and input the time series segments with corresponding time scales into the corresponding time series prediction modules 10. For example, Figure 2b and Figure 3 As shown, the time scale corresponding to the i-th segmentation module 20 is L i , then the i-th segmentation module 20 segments the original time series data X into data with a time scale of L i Where i=1, 2, ..., N. Multiple time sequence segments can form a time sequence segment array .in, Indicates rounding down.

[0053] In some embodiments, for any segmentation module i, the corresponding time scale is L i The segmentation module i can use the sliding window method to segment the original time series data into time series with a time scale of L i The length of the sliding window used by the sliding window method is equal to the time scale Li , the step size of the sliding window is S i Smaller than the time scale L i Here the time scale is measured in the number of sampling periods or the number of data points.

[0054] Specifically, we can start from the first data point of the original time series data, use the sliding window to select data points, slide one step each time, and obtain the data point currently selected by the sliding window as a time series segment. The same method can be used to divide the original time series data into multiple time series segments. If the time scale of the data point selected by the last sliding window is smaller than the time scale L i , then fill in with 0, so that the time scale of the padded data point is L i .

[0055] In some embodiments, the time scale L i Can be the step size S of the sliding window i A positive integer multiple of , and the multiple is greater than or equal to 2. For example, the time scale L i Can be the step size S of the sliding window i twice, that is .

[0056] Since the step size of the sliding window is smaller than the size of the sliding window, the beginning and end of the data points selected twice before and after the sliding window overlap, that is, there is a certain amount of data overlap in the divided time series segments, which takes into account the context of the time series segments and helps to improve the accuracy of subsequent time series predictions.

[0057] The segmentation module 20 segments the original time series data into a plurality of time series segments with corresponding time scales, and inputs the segmented plurality of time series segments into the corresponding time series prediction module 10. The time series prediction module 10 may obtain the input time series segments with corresponding time scales.

[0058] Furthermore, the multiple time series prediction modules 10 can perform time series prediction according to the input time series segments to obtain initial time series prediction data output by each of the multiple time series prediction modules 10. Among them, F represents the length of the data to be predicted, that is, the number of data points to be predicted, which is determined by the length of time to be predicted and the sampling rate. For example, if the length of time to be predicted is one month in the future (assuming it is 30 days), and the sampling rate is one data point per day, then the length of the data to be predicted is 30.

[0059] In some embodiments, Figure 4As shown, the time series prediction module 10 includes: a fully connected layer 101, an encoder 102 and a prediction unit 103. The fully connected layer 101 can be a feedforward neural network (FNN), a multi-layer perceptron (MLP), a CNN, an RNN or other neural network. Preferably, the fully connected layer 101 is an MLP. Because the structure of the MLP is composed of a series of fully connected layers (each neuron is connected to all neurons in the next layer), data is passed from the previous layer to the next layer without feedback connection. The basic structure of the MLP includes an input layer, one or more hidden layers and an output layer. The nodes (neurons) in each layer are connected to the nodes of the next layer through weighted connections, and each node usually uses a nonlinear activation function to introduce nonlinear features into the model, so that the network can learn and approximate complex functional relationships.

[0060] The encoder 102 may be an encoder derived from a self-attention model, such as an encoder of a Transformer model. For example, the encoder 102 may be a plurality of Transformer encoders, where a plurality refers to more than two.

[0061] Based on the basic structure of the time series prediction module 10, for the i-th time series prediction module receiving the time scale L i Time series snippet , the fully connected layer 101 can transform the input time series fragments Mapped to the embedding dimension D supported by encoder 102 to obtain the input time sequence fragments The first embedded space representation of the time sequence segment is input into the encoder 102 to obtain an encoding result, and the encoding result is input into the prediction unit 103. The prediction unit 103 can use the encoding result to perform time sequence prediction to obtain the initial time sequence prediction data output by the i-th time sequence prediction module.

[0062] In order to integrate the timing prediction results of multiple timing prediction modules 10, a token router 30 is introduced in the embodiment of the present application. The token router 30 can be implemented as a gated network to determine which timing prediction module is most suitable for processing specific input data. The "token" here can be regarded as an abstract concept, indicating which timing prediction module the data should flow to.

[0063] In the embodiment of the present application, the weight matrix of the token router 30 Assigned to different timing prediction modules. The weight matrix here acts as a decision-making mechanism, which determines which timing prediction modules are more suitable for processing specific inputs by calculating the degree of association between each timing segment and each timing prediction module. is learned in advance. In an online time series prediction, the weight matrix of the token router 30 is fixed, but does not mean that the weight matrix of the token router 30 used in each online timing prediction The weight matrix of token router 30 is the same. Therefore, the weight matrix of the token router 30 can determine the routing probabilities of multiple timing prediction modules 10.

[0064] Based on the weight matrix of the token router 30 , the token router 30 may determine the contribution of the plurality of timing prediction modules 10 to the timing prediction result according to the original timing data and the weight matrix of the token router 30 .

[0065] Specifically, the token router 30 can convert the original timing data , mapped to time series data with a data length equal to the target data length F to be predicted For ease of description, the time series data , defined as the first time series data.

[0066] In some embodiments, Figure 5 As shown, the token router may include: a fully connected layer 301, a computing layer 302 and a normalization layer 303. The implementation form of the fully connected layer 301 can refer to the implementation form of the fully connected layer 101 in the aforementioned time series prediction module 10, which will not be repeated here.

[0067] Furthermore, the fully connected layer 301 can convert the first time series data Input to the computing layer 302. The computing layer 302 can be based on the first time series data and the weight matrix of the token router , determine the routing scores of multiple time series prediction modules. As a dynamic allocator, the weight matrix can determine the participation of each time series prediction module in the network based on the characteristics of the input time series, ensuring that patterns on different time scales can be processed by the most appropriate time prediction module, which helps to improve the accuracy of subsequent time series prediction. The routing scores of multiple time series prediction modules reflect the suitability of each time series prediction module to process the input time series fragments.

[0068] In some embodiments, the first time series data may be Weight matrix with token router Matrix multiplication is performed, and the matrix multiplication result is used as the routing score of the multiple timing prediction modules 10.

[0069] In order to achieve load balancing of multiple timing prediction modules and prevent some timing prediction modules from being overused while other timing prediction modules are neglected and rarely or even not used, in other embodiments, a random noise score (Dropout) is introduced when determining the routing scores of multiple timing prediction modules. Specifically, the noise weights of the routing of multiple timing prediction modules can be learned in advance. .

[0070] Further, the computing layer 302 may use an activation function to process the first time series data. With noise weight The matrix multiplication result of is normalized to obtain the noise scores of multiple time series prediction modules. In this embodiment, the specific implementation form of the activation function is not limited. Optionally, the activation function can be a Softplus function, a Softmax function, a Relu function, a Sigmoid function or a tanh function, etc.

[0071] Furthermore, the calculation layer 302 may calculate the product of the coefficients satisfying the preset probability distribution and the noise scores of the multiple time series prediction modules to obtain the random noise scores of the multiple time series prediction modules. The preset probability distribution may be a normal distribution.

[0072] The manner of obtaining random noise of the multiple time series prediction modules shown in the above embodiment is only an exemplary description and does not constitute a limitation.

[0073] In this embodiment, the computing layer 302 can process the first time series data Weight matrix with token router Matrix multiplication is performed, and the matrix multiplication result is used as the initial routing score of the multiple timing prediction modules 10. Further, random noise scores are added to the initial routing scores of the multiple timing prediction modules 10 to obtain the routing scores of the multiple timing prediction modules 10. The introduction of random noise scores helps to make the input timing segments more evenly distributed among the timing prediction modules, avoiding some timing prediction modules from being overused and other timing prediction modules from being ignored, thereby achieving load balancing among the multiple timing prediction modules.

[0074] In an optional implementation, the routing scores of multiple timing prediction modules can be expressed as:

[0075] (1).

[0076] In formula (1), Represents the routing scores of multiple timing prediction modules, To satisfy the coefficient of normal distribution, that is For the first time series data With noise weight The activation function used to normalize the matrix multiplication result is the Softplus function.

[0077] After obtaining the routing scores of the multiple time series prediction modules, the calculation layer 302 may input the routing scores of the multiple time series prediction modules into the normalization layer 303. The normalization layer 303 may normalize the routing scores of the multiple time series prediction modules using an activation function to obtain the contribution of the multiple time series prediction modules to the time series prediction result, which may also be referred to as the routing probabilities of the multiple time series prediction modules.

[0078] For the convenience of description and distinction, the calculation layer 302 calculates the first time series data With noise weight The activation function used to normalize the matrix multiplication result is defined as the first activation function; and the activation function used by the normalization layer 303 to normalize the routing scores of multiple time series prediction modules is defined as the second activation function. The second activation function can be a Softmax function. Accordingly, the contribution of multiple time series prediction modules to the time series prediction result can be expressed as:

[0079] (2).

[0080] In formula (2), Indicates the contribution of the i-th time series prediction module to the time series prediction results at time t. It represents the routing score of the timing prediction result of the i-th timing prediction module at time t.

[0081] Among them, the Softmax function can map the routing scores of multiple time series prediction modules to between 0 and 1, that is, the contribution of multiple time series prediction modules to the time series prediction results is distributed between 0 and 1, and the sum of the contributions of multiple time series prediction modules to the time series prediction results is 1.

[0082] After determining the contribution of the multiple time series prediction modules 10 to the time series prediction result, the contribution of the multiple time series prediction modules 10 to the time series prediction result can be input to the aggregation module 40. The multiple time series prediction modules 10 perform time series prediction to obtain multiple initial time series prediction data. The aggregation module 40 can aggregate the multiple initial time series prediction data output by the multiple time series prediction modules 10 according to the contribution of the multiple time series prediction modules 10 to the time series prediction results. Aggregation processing is performed to obtain time series prediction data, that is, time series prediction results.

[0083] Specifically, the aggregation module 40 can use the contribution of multiple time series prediction modules 10 to the time series prediction results to aggregate multiple initial time series prediction data output by the multiple time series prediction modules 10. Perform weighted averaging to achieve multiple initial time series prediction data Aggregation processing is performed to obtain time series prediction data, that is, time series prediction results. It can be expressed as:

[0084] (3).

[0085] In formula (3), i represents the i-th time series prediction module, represents the initial time series prediction data output by the i-th time series prediction module, that is, .

[0086] In an embodiment of the present application, multiple timing prediction modules can use timing data of multiple time scales to perform timing prediction and output their own initial timing prediction data. Each timing prediction module captures time features at a specific time scale. The gating mechanism is implemented by the weight matrix of the pre-learned token router, and the contribution of multiple timing prediction modules to the timing prediction results can be determined, reflecting the importance of multiple time scales to the timing prediction. Therefore, according to the contribution of multiple timing prediction modules to the timing prediction results, the outputs of multiple timing prediction modules are aggregated to obtain the timing prediction results, thereby realizing the timing prediction of multiple time scales. This timing prediction method not only integrates the timing prediction results of multiple time scales, but also takes into account the importance of each time scale, which helps to improve the accuracy of timing prediction.

[0087] In an embodiment of the present application, before the time series prediction system performs time series prediction online, it is necessary to perform model training on the time series prediction system. When the time series prediction system is trained, the minimization of the loss function is used as the training goal, and the time series data samples are used as the training samples to train the time series prediction system. Among them, the loss function may include: the loss of the prediction result. Among them, the loss of the prediction result can be expressed as: the mean square error between the time series prediction data output by the model training and the actual time series prediction data.

[0088] If the model training of the timing prediction system is performed only using the loss minimization of the prediction results, load balancing problems may occur. Although the selection of the gating network (i.e., token router) can be enhanced by faster training of the dominant timing prediction modules, this advantage may form a self-reinforcing cycle, with only some timing prediction modules dominating. This is because the popular timing prediction modules are trained faster, resulting in these timing prediction modules being continuously selected, further marginalizing other timing prediction modules. In order to solve this problem, in some embodiments of the present application, in the loss function, additional regularization terms are added on the basis of the loss of the prediction results to encourage all timing prediction modules to be used in a balanced manner, i.e., to achieve load balancing of the timing prediction modules. Among them, the added regularization term is an auxiliary loss term, which can be expressed as:

[0089] (4).

[0090] Among them, in formula (4), represents a time series data sample; H0 represents the length of the time series data sample. It represents the sum of the contributions of N time series prediction modules to the time series prediction results at time t. represents the coefficient of variation, is a scaling factor. This auxiliary loss term measures the change in contribution and ensures that each time series prediction module is treated fairly so that all time series prediction modules have sufficient training opportunities.

[0091] In order to further improve the accuracy of timing prediction, some embodiments of the present application also provide prompt enhancement for the timing prediction module to guide the timing prediction module to perform timing prediction from more perspectives, thereby improving the accuracy of timing prediction. The prompt enhancement method provided in the embodiments of the present application is exemplarily described below.

[0092] Implementation 1: In order to provide the time series prediction module with a richer perspective to understand the multi-time scale dynamics, some embodiments of the present application also propose the concept of a shared global prompt pool. Figure 3 and Figure 6 The timing prediction system may further include: a global hint pool 60 and a hint router 70 .

[0093] Among them, the global prompt pool 60 stores prompt information (Prompt), which is called global prompt information (GlobalPrompt). The global prompt information is pre-learned using historical time series data as training samples. The historical time series data and the original time series data belong to the same field, and the corresponding monitoring objects and monitoring indicators are the same. For example, if the original time series data is the time series data of power generation of a certain device, then the historical time series data is the historical time series data of power generation of the same type of device.

[0094] In some embodiments, the global hint information may be a plurality of pre-learned hint vectors, each hint vector having a specific time scale (L p ), and the hint vector has an embedding dimension D supported by the encoder 102 in the temporal prediction module 10.

[0095] Among them, the global prompt information in the global prompt pool can be expressed as: , M is the number of global prompt information in the global prompt pool, The length is L p And the global prompt information with an embedding dimension of D. The embedding dimension D is an embedding dimension supported by the encoder in the time series prediction module 10.

[0096] The prompt router 70 establishes a connection between the multiple temporal prediction modules 10 and the shared global prompt pool 60. Specifically, the prompt router 70 can select and assign appropriate prompts to each temporal prediction module 10 according to the characteristics of the currently input temporal segment to enhance their prediction capabilities. For the prompt router 70, the weight matrix of the prompt router 70 can be pre-learned. .in, is the hidden layer dimension of the prompt router. The weight matrix of the prompt router 70 is used to determine the global prompt information in the global prompt pool 60 and the multiple time scales L i Specifically, the weight matrix of the prompt router 70 can be a weight matrix of the global prompt information in the global prompt pool 60 and a weight matrix of the global prompt information in the global prompt pool 60. i Establish a connection between them.

[0097] Based on the weight matrix of the prompt router, the prompt router 70 can and time series segments with multiple time scales, determining the weights of the global cue information in the global cue pool at multiple time scales.

[0098] Specifically, for the time scale L i multiple time segments, prompting the router 70 to convert any time scale L i The multiple time series segments are reshaped into three-dimensional tensors. The three-dimensional tensor of each time scale represents the feature representation of the time series at that time scale. In order to adapt to different time scales, zero values ​​can also be filled in the time dimension to ensure that the data is suitable for the reshaping process. Among them, the reshaped three-dimensional tensor can be expressed as:

[0099] (5).

[0100] in, is a function that expands a time series with zeros in the time dimension so that it matches the time scale used by reshape compatible, N is the number of time scales. . Indicates rounding up.

[0101] Furthermore, the hint router 70 may map the three-dimensional tensor into the embedding space of the hint router to obtain any time scale L i Further, the router 70 can be prompted to perform any time scale L in the time dimension. i The corresponding embedding representation is average pooled to obtain any time scale L i The corresponding embedding matrix The embedding matrix corresponding to each time scale can be obtained in the same way. Among them, the embedding matrix corresponding to multiple time scales can be expressed as: Among them, in the time dimension, the time scale L i Average pooling of the corresponding embedding representations can fuse features at different time scales, thereby enhancing the model's ability to understand time series at multiple time scales.

[0102] Furthermore, the activation function (defined as the third activation function) can be used to embed the corresponding matrices of multiple time scales and the weight matrix of the hint router The matrix multiplication result of is normalized to obtain the weights of the global prompt information in the global prompt pool at multiple time scales. M represents the total number of global prompt information in the global prompt pool, and N represents the total number of time series prediction modules, that is, the total number of time scales. The third activation function can be a Softmax function. Accordingly, the weights of the global prompt information in the global prompt pool on multiple time scales are It can be expressed as:

[0103] (6).

[0104] In formula (6), M represents the total number of global prompt information in the global prompt pool, N represents the total number of temporal prediction modules, that is, the total number of time scales. i represents the i-th time scale, and j represents the j-th global prompt information. i=1, 2, …, N; j=1, 2, …, M. Represents the weight of the j-th global prompt information at the i-th time scale.

[0105] Among them, the Softmax function can embed the matrix corresponding to each time scale and the weight matrix of the hint router The matrix multiplication result is mapped to between 0 and 1, that is, the weight of the global prompt information in the global prompt pool at multiple time scales. Distributed between 0 and 1, the sum of the weights of the global prompt information in the global prompt pool at multiple time scales is 1.

[0106] The prompt router 70 calculates the weight of each global prompt information in the global prompt pool based on the representation of the timing segment at each time scale. In this way, a quantitative index of relevance is given to each global prompt information in the global prompt pool, which can be used to evaluate the relevance of each global prompt information with the currently input timing segment, thereby determining which global prompt information is most suitable for the current state of the currently input timing segment.

[0107] Further, combined with Figure 3 and Figure 6 The prompt router 70 may input the weights of the global prompt information in the global prompt pool at multiple time scales into the global prompt pool 60, and the global prompt pool 60 may input the weights of the global prompt information in the global prompt pool at multiple time scales according to the weights of the global prompt information in the global prompt pool , for the global prompt information in the global prompt pool A weighted processing is performed to obtain target global prompt information of multiple time series prediction modules 10 .

[0108] Specifically, the global prompt pool 60 can be used to calculate the weights of the global prompt information in the global prompt pool on multiple time scales. Global prompt information in the global prompt pool Matrix multiplication is performed to obtain target global prompt information of multiple time series prediction modules 10, namely: .in, Represents all global prompt information in the global prompt pool. It is represented as a collection of global prompt information of each time series prediction module.

[0109] like Figure 3 As shown, the global prompt pool 60 can output the target global prompt information of multiple time series prediction modules 10 to multiple time series prediction modules 10, that is, the global prompt pool 60 outputs the target global prompt information of each time series prediction module 10 to the corresponding time series prediction module 10, such as the global prompt pool 60 outputs the target global prompt information of the i-th time series prediction module 10 , output to the i-th time series prediction module 10. For the i-th time series prediction module 10, in the target global prompt information Under the prompt, according to the time scale L received by the i-th time series prediction module 10 i The time series segment is used for time series prediction to obtain the initial time series prediction data of the i-th time series prediction module 10 The target global prompt information of the time series prediction module 10 can provide the time series prediction module with a richer perspective to understand the multi-time scale dynamics, so the initial time series prediction data predicted by the time series prediction module 10 is more accurate.

[0110] In implementation mode 1, the prompt information of the i-th time series prediction module can be expressed as:

[0111] (7).

[0112] In formula (7), Indicates prompt information of the i-th time series prediction module obtained by using implementation mode 1; It is the target global prompt information of the i-th time series prediction module.

[0113] Furthermore, the multiple time series prediction modules 10 may input their respective initial time series prediction data into the aggregation module 40, and the aggregation module 40 may aggregate the multiple initial time series prediction data output by the multiple time series prediction modules 10 according to the contribution of the multiple time series prediction modules 10 to the time series prediction result. Aggregation processing is performed to obtain time series prediction data, that is, time series prediction results.

[0114] based on Figure 4 The internal structure of the timing prediction module is shown as Figure 7 As shown, in implementation mode 1, the target global prompt information of the i-th time series prediction module 10 can be (like Figure 7 The white rectangle in the middle) and the embedding space representation of the input temporal fragment (defined as the first embedding space representation, such as Figure 7 The second embedding space representation is obtained by splicing (shown as a gray rectangle in the middle) and inputting the second embedding space representation into the encoder 102. The encoder 102 encodes the second embedding space representation to obtain an encoding result; the prediction unit 103 uses the encoding result to perform time series prediction, using the initial time series prediction data output by the time series prediction module 10.

[0115] In implementation mode 1, on the one hand, the time series prediction module 10 uses the target global prompt information of the time series prediction module as a prompt to perform time series prediction during time series prediction. The target global prompt information can provide the time series prediction module with a richer perspective to understand the dynamics of multiple time scales, and the initial time series prediction data predicted by the time series prediction module is more accurate, thereby making the time series prediction data obtained by the aggregation module 40 through aggregation processing of the initial time series prediction data more accurate. On the other hand, according to the contribution of multiple time series prediction modules to the time series prediction results, the outputs of multiple time series prediction modules are aggregated, which not only integrates the time series prediction results of multiple time scales, but also takes into account the importance of each time scale, which helps to improve the accuracy of time series prediction.

[0116] Implementation 2: In order to enable the time series prediction module to capture the detailed features of the time series data at the corresponding time scale of the input, in other embodiments of the present application, a local prompt learner is introduced. The local prompt learner, also known as the soft prompt learner, refers to a set of additional learnable parameters that are inserted into the input of the model as static context information and trained together with the model to optimize the performance of a specific task, thereby achieving fine-grained adjustment of the model behavior without modifying the model architecture. Accordingly, combined with Figure 8 and Fig. 9 , the time series prediction system may also include: a local prompt learner 80.

[0117] The local hint learner 80 can encode the original time series data to obtain the hidden state of the original time series data ; Afterwards, the hidden state of the original time series data can be Mapped to the embedding dimension D supported by multiple time series prediction modules 10, local prompt information of multiple time series prediction modules 10 is obtained. Specifically, the hidden state of the original time series data is Mapped to the embedding dimension D supported by the encoder in multiple temporal prediction modules 10.

[0118] Specifically, Fig. 9 As shown, the local hint learner 80 may include: an encoder 801 and a fully connected layer 802. The encoder 801 may include: K gated recurrent units (GRU). K ≥ 2 and is an integer. GRU is a simplified version of the Long Short-Term Memory Networks (LSTM), a variant of the recurrent neural network, used to process sequence data, can capture long-term dependencies through a gating mechanism, and has the characteristics of high computational efficiency.

[0119] The implementation of the fully connected layer 802 can refer to the relevant content of the fully connected layer 101 described above, which will not be repeated here. Figure 8 In the figure, the fully connected layer 802 is only taken as MLP as an example, but it does not constitute a limitation.

[0120] Based on the implementation form of the local hint learner 80, the encoder 801 can encode the input original time series data to obtain the hidden state of the original time series data ; Afterwards, the hidden state of the original time series data can be As the potential code z, it is input to the fully connected layer 802. The fully connected layer 802 can convert the hidden state of the original time series data into Mapped to the embedding dimension D supported by the encoder in the multiple time series prediction modules 10. For example, if the encoder in the time series prediction module 10 is a Transformer encoder, the fully connected layer 802 converts the hidden state of the original time series data Mapped to the embedding dimension D supported by the Transformer encoder in the multiple time series prediction modules 10. For the embodiment in which the fully connected layer 802 is MLP, the local prompt information of the multiple time series prediction modules 10 can be expressed as: MLP (z).

[0121] It is worth noting that if Fig.10 As shown, in the model training stage, the local hint learner 80 may further include a decoder 803. The decoder 803 has the same structure as the encoder 802 and is used to decode the hidden state of the time series data sample output by the encoder 801. Decode to obtain the reconstructed time series data of the time series data samples. The loss function used in the model training phase can be expressed as:

[0122] (8).

[0123] In formula (8), represents a time series data sample, and H0 represents the length of the time series data sample. Reconstructed time series data representing the time series sample data output by the decoder. Represents the reconstruction loss between the reconstructed time series data and the time series data samples, expressed as the mean square error between the reconstructed time series data and the time series data samples, that is, Represents the reconstruction loss between the reconstructed time series data and the time series data samples. represents the Kullback-Leibler divergence loss, z is the hidden state output by encoder 801, , represents encoder 801, Represents sampling on the normal distribution function.

[0124] Further, combined with Figure 8 and Fig.11 The local prompt learner 80 can output the local prompt information of multiple time series prediction modules 10 to multiple time series prediction modules 10. For the i-th time series prediction module 10, under the prompt of the local prompt information, according to the time scale L received by the i-th time series prediction module 10 i The time series segment is used for time series prediction to obtain the initial time series prediction data of the i-th time series prediction module 10 The local prompt information of the time series prediction module 10 enables the time series prediction module to capture the detailed features of the time series data at the corresponding time scale of the input, so the initial time series prediction data predicted by the time series prediction module 10 is more accurate.

[0125] In implementation mode 2, the prompt information of the i-th time series prediction module can be expressed as:

[0126] (9).

[0127] In formula (9), Indicates prompt information of the i-th time series prediction module obtained by using implementation mode 2; The local prompt information of the i-th time series prediction module. In formula (9), the fully connected layer 802 is taken as MLP as an example, but it does not constitute a limitation.

[0128] based on Figure 4 The internal structure of the timing prediction module is shown as Fig.11 As shown, in implementation mode 2, the local prompt information (such as Fig.11 The rectangle filled with diagonal lines in the figure) and the embedding space representation of the input time sequence fragment (defined as the first embedding space representation, such as Fig.11 The third embedding space representation is obtained by splicing (shown as a gray rectangle in the middle) and the third embedding space representation is input into the encoder 102. The encoder 102 encodes the third embedding space representation to obtain an encoding result; the prediction unit 103 uses the encoding result to perform time series prediction, using the initial time series prediction data output by the time series prediction module 10.

[0129] In implementation mode 2, on the one hand, the time series prediction module 10 uses local prompt information as a prompt to perform time series prediction during time series prediction. The local prompt information enables the time series prediction module to capture the detailed features of the time series data at the corresponding time scale of the input, so the initial time series prediction data predicted by the time series prediction module 10 is more accurate. On the other hand, according to the contribution of multiple time series prediction modules to the time series prediction results, the outputs of multiple time series prediction modules are aggregated, which not only integrates the time series prediction results of multiple time scales, but also takes into account the importance of each time scale, which helps to improve the accuracy of time series prediction.

[0130] Implementation 3: In order to further improve the accuracy of timing prediction, in some embodiments, the above implementation 1 and implementation 2 are combined to enhance the prompt. Specifically, Fig.12 As shown, the prompt enhancement method shown in the aforementioned embodiment 1 can be used to obtain target global prompt information of multiple time series prediction modules 10; and the prompt enhancement method shown in embodiment 2 can be used to obtain local prompt information of multiple time series prediction modules 10.

[0131] Furthermore, for any time scale L i The corresponding multiple time series segments are divided into time scales L iThe target global prompt information of the corresponding time series prediction module (i.e., the i-th time series prediction module) And the local prompt information of the target time series prediction module (such as MLP (z)) as prompt information (Prompt). Specifically, the time scale L can be calculated i The target global prompt information of the corresponding time series prediction module (i.e., the i-th time series prediction module) The sum of the vectors of the local prompt information (such as MLP (z)) of the target time series prediction module is used as the prompt information of the i-th time series prediction module. i The multiple time series segments are input into the i-th time series prediction module. In the i-th time series prediction module, under the prompt of the prompt information of the i-th time series prediction module, according to the time scale L i The multiple time series segments are used for timing prediction to obtain the initial timing prediction data output by the target timing prediction module. .

[0132] In implementation mode 3, the prompt information of the i-th time series prediction module can be expressed as:

[0133] (10).

[0134] In formula (10), Indicates prompt information of the i-th time series prediction module obtained by using implementation mode 3; The target global prompt information of the i-th time series prediction module; The local prompt information of the i-th time series prediction module. In formula (10), the fully connected layer 802 is shown as an example of MLP, but it does not constitute a limitation.

[0135] In implementation mode 3, the target global prompt information of multiple timing prediction modules obtained by using the global prompt information in the global prompt pool in implementation mode 1 provides the timing prediction module with a richer perspective to understand the multi-time scale dynamics, and the local prompt information of multiple timing prediction modules obtained by using the prompt enhancement method provided in implementation mode 2 can provide the timing prediction module with local features that are more in line with the current input timing fragment, so that the timing prediction module can capture the detailed time pattern of the timing fragment at the corresponding time scale. The two realize the prompt enhancement of the timing prediction module from different angles, enrich the reference dimension of the timing prediction module for timing prediction, and help improve the accuracy of timing prediction.

[0136] based on Figure 4 The internal structure of the timing prediction module is shown as Fig.12As shown, in implementation mode 3, for the i-th time series prediction module 10, the target global prompt information and the local prompt information of the i-th time series prediction module can be vector-added to obtain the prompt information (Prompt) of the i-th time series prediction module (such as Fig.12 ); then, the prompt information (Prompt) of the i-th time series prediction module is combined with the embedding space representation of the input time series segment (defined as the first embedding space representation, as shown in Fig.12 The fourth embedding space representation is spliced ​​(shown as a gray rectangle in the middle) to obtain a fourth embedding space representation, and the fourth embedding space representation is input to the encoder 102. The encoder 102 encodes the fourth embedding space representation to obtain an encoding result; the prediction unit 103 uses the encoding result to perform time series prediction, using the initial time series prediction data output by the time series prediction module 10.

[0137] In implementation mode 3, on the one hand, the target global prompt information of the time series prediction module provides the time series prediction module with a richer perspective to understand the multi-time scale dynamics, and the local prompt information of the time series prediction module can provide the time series prediction module with local features that are more in line with the current input time series fragment, so that the time series prediction module can capture the detailed time pattern of the time series fragment under the corresponding time scale. The two realize the prompt enhancement of the time series prediction module from different angles, enrich the reference dimension of the time series prediction module for time series prediction, and help improve the accuracy of time series prediction. On the other hand, according to the contribution of multiple time series prediction modules to the time series prediction results, the outputs of multiple time series prediction modules are aggregated, which not only integrates the time series prediction results of multiple time scales, but also takes into account the importance of each time scale, which helps to improve the accuracy of time series prediction.

[0138] In addition to the time series prediction system provided in the above-mentioned embodiment, the embodiment of the present application also provides a time series prediction method. The time series prediction method provided in the embodiment of the present application is exemplarily described below.

[0139] Fig.13 The flowchart of the timing prediction method provided in the embodiment of the present application is shown in FIG. Fig.13 As shown, the time series prediction method mainly includes:

[0140] 131. Obtaining time series segments with multiple time scales obtained by segmenting the original time series data and a pre-learned weight matrix of a token router; the weight matrix of the token router is used to determine the routing probabilities of multiple time series prediction modules.

[0141] 132. Determine the contribution of multiple timing prediction modules to the timing prediction results based on the original timing data and the weight matrix of the token router.

[0142] 133. Use multiple time series prediction modules to perform time series prediction according to time series segments of corresponding time scales, so as to obtain initial time series prediction data output by the multiple time series prediction modules; the multiple time series prediction modules correspond one to one to the multiple time scales.

[0143] 134. According to the contribution of the multiple time series prediction modules to the time series prediction result, the initial time series prediction data output by the multiple time series prediction modules are aggregated to obtain the time series prediction data.

[0144] In an embodiment of the present application, in order to realize time series prediction of multiple time scales, multiple time prediction modules are set. Multiple time series prediction modules are respectively used to process time series data of multiple time scales. Multiple time scales are different. Each time series prediction module processes time series data of one time scale. The time series prediction module corresponds to the time scale one by one, and is used to process the time series data of the corresponding time scale.

[0145] In step 131 , time series segments with corresponding time scales obtained by segmenting the original time series data X may be obtained.

[0146] In some embodiments, original time series data and time series segments with multiple time scales obtained by segmenting the original time series data may be pre-stored. During time series prediction, time series segments with time scales corresponding to each time series prediction module may be read from the pre-stored time series segments with multiple time scales, and the time series segments with corresponding time scales may be input into the corresponding time series prediction module.

[0147] In other embodiments, the original time series data X may be segmented according to multiple time scales corresponding to multiple time series prediction modules to obtain time series segments with multiple time scales.

[0148] In the embodiment of the present application, the original time series data It can be the time series data input to the time series prediction system. C represents the number of sequences contained in the original time series data, C ≥ 1, and is an integer; H represents the data length of each sequence, which can also be the number of data points contained in each sequence, H ≥ 2, and is an integer.

[0149] In other embodiments, the input time series data may be normalized to obtain normalized time series data. It can be normalized time series data. Among them, normalizing the input time series data can handle the possible distribution mismatch between training data and test data, and ensure the distribution consistency of data through normalization, thereby improving the performance of the time series prediction system in the time series prediction task.

[0150] In the embodiment of the present application, for any time scale L i, the original time series data X can be divided into i Multiple time-series clips (Patch) . Where i = 1, 2, ..., N. Multiple time sequence segments can form a time sequence segment array .

[0151] In some embodiments, for any segmentation module i, the corresponding time scale is L i The segmentation module i can use the sliding window method to segment the original time series data into time series with a time scale of L i The length of the sliding window used by the sliding window method is equal to the time scale L i , the step size of the sliding window is S i Smaller than the time scale L i Here the time scale is measured in the number of sampling periods or the number of data points.

[0152] Since the step size of the sliding window is smaller than the size of the sliding window, the beginning and end of the data points selected twice before and after the sliding window overlap, that is, there is a certain amount of data overlap in the divided time series segments, which takes into account the context of the time series segments and helps to improve the accuracy of subsequent time series predictions.

[0153] Further, in step 133, multiple time series prediction modules can be used to perform time series prediction according to time series segments of corresponding time scales, so as to obtain initial time series prediction data output by each of the multiple time series prediction modules. Among them, F represents the length of the data to be predicted, that is, the number of data points to be predicted, which is determined by the length of time to be predicted and the sampling rate.

[0154] In some embodiments, the time series prediction module includes: a fully connected layer, an encoder, and a prediction unit. Based on the basic structure of the time series prediction module, for the i-th time series prediction module received a time scale L i Time series snippet , the input time series fragments can be transformed into Mapped to the embedding dimension D supported by the encoder of the i-th time series prediction module to obtain the input time series fragment The embedding space representation of (defined as the first embedding space representation); then, the encoder is used to encode the time sequence fragments The first embedding space is encoded to obtain an encoding result; and the encoding result is used to perform time series prediction through the encoding unit to obtain initial time series prediction data output by the i-th time series prediction module.

[0155] In order to integrate the timing prediction results of multiple timing prediction modules, a token router is introduced in the embodiment of the present application. In the embodiment of the present application, the weight matrix of the token router is Assigned to different timing prediction modules. The weight matrix here acts as a decision-making mechanism, which determines which timing prediction modules are more suitable for processing specific inputs by calculating the degree of association between each timing segment and each timing prediction module. is learned in advance. Therefore, the weight matrix of the token router can determine the routing probability of multiple timing prediction modules.

[0156] Accordingly, in step 131, the weight matrix of the token router may be obtained, and in step 132, the contribution of multiple timing prediction modules to the timing prediction result may be determined based on the original timing data and the weight matrix of the token router.

[0157] Specifically, the original time series data can be , mapped to time series data with a data length equal to the target data length F to be predicted For ease of description, the time series data , defined as the first time series data.

[0158] Further, according to the first time series data and the weight matrix of the token router , determine the routing scores of multiple time series prediction modules. As a dynamic allocator, the weight matrix can determine the participation of each time series prediction module in the network based on the characteristics of the input time series, ensuring that patterns on different time scales can be processed by the most appropriate time prediction module, which helps to improve the accuracy of subsequent time series prediction. The routing scores of multiple time series prediction modules reflect the suitability of each time series prediction module to process the input time series fragments.

[0159] In some embodiments, the first time series data may be Weight matrix with token router Matrix multiplication is performed, and the matrix multiplication result is used as the routing score of multiple timing prediction modules.

[0160] In order to achieve load balancing of multiple timing prediction modules and prevent some timing prediction modules from being overused while other timing prediction modules are neglected and rarely or even not used, in other embodiments, a random noise score (Dropout) is introduced when determining the routing scores of multiple timing prediction modules. Specifically, the noise weights of the routing of multiple timing prediction modules can be learned in advance. .

[0161] Furthermore, the activation function (defined as the first activation function) can be used to transform the first time series data With noise weight The matrix multiplication results are normalized to obtain the noise scores of multiple time series prediction modules.

[0162] Furthermore, the noise scores of the multiple time series prediction modules may be randomized using coefficients that satisfy a preset probability distribution to obtain random noise scores of the multiple time series prediction modules. The preset probability distribution may be a normal distribution.

[0163] The manner of obtaining the random noise scores of the multiple time series prediction modules shown in the above embodiment is only an exemplary description and does not constitute a limitation.

[0164] In this embodiment, the first time series data may be Weight matrix with token router Matrix multiplication is performed, and the matrix multiplication result is used as the initial routing score of multiple timing prediction modules. Further, random noise scores are added to the initial routing scores of multiple timing prediction modules to obtain routing scores of multiple timing prediction modules. The introduction of random noise scores helps to distribute the input timing segments more evenly among the timing prediction modules, avoiding some timing prediction modules from being overused while other timing prediction modules are ignored, thereby achieving load balancing among multiple timing prediction modules.

[0165] After obtaining the routing scores of multiple timing prediction modules, the routing scores of the multiple timing prediction modules can be normalized using an activation function to obtain the contribution of the multiple timing prediction modules to the timing prediction results, which can also be called the routing probabilities of the multiple timing prediction modules.

[0166] After determining the contribution of the multiple time series prediction modules to the time series prediction result, in step 134, the multiple initial time series prediction data output by the multiple time series prediction modules may be analyzed according to the contribution of the multiple time series prediction modules to the time series prediction result. Aggregation processing is performed to obtain time series prediction data, that is, time series prediction results.

[0167] Specifically, the contribution of multiple time series prediction modules to the time series prediction results can be used to calculate the multiple initial time series prediction data output by the multiple time series prediction modules. Perform weighted averaging to achieve multiple initial time series prediction data Aggregation processing is performed to obtain time series prediction data, that is, time series prediction results.

[0168] In an embodiment of the present application, multiple timing prediction modules can use timing data of multiple time scales to perform timing prediction and output their own initial timing prediction data. Each timing prediction module captures time features at a specific time scale. The gating mechanism is implemented by the weight matrix of the pre-learned token router, and the contribution of multiple timing prediction modules to the timing prediction results can be determined, reflecting the importance of multiple time scales to the timing prediction. Therefore, according to the contribution of multiple timing prediction modules to the timing prediction results, the outputs of multiple timing prediction modules are aggregated to obtain the timing prediction results, thereby realizing the timing prediction of multiple time scales. This timing prediction method not only integrates the timing prediction results of multiple time scales, but also takes into account the importance of each time scale, which helps to improve the accuracy of timing prediction.

[0169] In order to further improve the accuracy of timing prediction, some embodiments of the present application also provide prompt enhancement for the timing prediction module to guide the timing prediction module to perform timing prediction from more perspectives, thereby improving the accuracy of timing prediction. The prompt enhancement method provided in the embodiments of the present application is exemplarily described below.

[0170] Implementation 1: In order to provide the time series prediction module with a richer perspective to understand the multi-time scale dynamics, some embodiments of the present application also propose the concept of a shared global prompt pool. For the description of the global prompt pool and the prompt router, please refer to the relevant content of the aforementioned system embodiment, which will not be repeated here.

[0171] Among them, the global prompt pool stores prompt information (Prompt), which is called global prompt information (GlobalPrompt). The global prompt information is pre-learned using historical time series data as training samples. The historical time series data and the original time series data belong to the same field, and the corresponding monitoring objects and monitoring indicators are the same.

[0172] In some embodiments, the global hint information may be a plurality of pre-learned hint vectors, each hint vector having a specific time scale (L p ), and the hint vector has an embedding dimension D supported by the encoder in the temporal prediction module.

[0173] The prompt router establishes a connection between multiple temporal prediction modules and a shared global prompt pool. Specifically, the prompt router can select and assign appropriate prompts to each temporal prediction module according to the characteristics of the current input temporal segment to enhance their prediction capabilities. For the prompt router, the weight matrix of the prompt router can be pre-learned .in, is the hidden layer dimension of the prompt router. The weight matrix of the prompt router is used to determine the global prompt information in the global prompt pool and the multiple time scales L iSpecifically, the weight matrix of the hint router can be used to compare the global hint information in the global hint pool with the multiple time scales L i Establish a connection between them.

[0174] Based on the weight matrix of the prompt router, the weight matrix of the prompt router can be and time series segments with multiple time scales, determining the weights of the global cue information in the global cue pool at multiple time scales.

[0175] Specifically, for the time scale L i Multiple time series segments with any time scale L i The three-dimensional tensor of each time scale represents the feature representation of the time series at that time scale. In order to adapt to different time scales, zero values ​​can also be filled in the time dimension to ensure that the data is suitable for the reshaping process. Among them, the reshaped three-dimensional tensor can be expressed as .

[0176] Furthermore, the three-dimensional tensor can be mapped to the embedding space of the prompt router to obtain any time scale L i The corresponding embedding representation. Furthermore, we can embed any time scale L in the time dimension i The corresponding embedding representation is average pooled to obtain any time scale L i The corresponding embedding matrix The embedding matrix corresponding to each time scale can be obtained in the same way. Among them, the embedding matrix corresponding to multiple time scales can be expressed as: .

[0177] Furthermore, the activation function (defined as the third activation function) can be used to embed the corresponding matrices of multiple time scales and the weight matrix of the hint router The matrix multiplication result of is normalized to obtain the weights of the global prompt information in the global prompt pool at multiple time scales. M represents the total number of global cue information in the global cue pool, and N represents the total number of temporal prediction modules, that is, the total number of time scales.

[0178] Based on the representation of the time sequence segment at each time scale, the weight of each global prompt information in the global prompt pool is calculated. In this way, a quantitative index of relevance is given to each global prompt information in the global prompt pool, which can be used to evaluate the degree of relevance between each global prompt information and the current input time sequence segment, thereby determining which global prompt information is most suitable for the current state of the current input time sequence segment.

[0179] Furthermore, the weights of the global prompt information in the global prompt pool at multiple time scales can be used to , for the global prompt information in the global prompt pool A weighted process is performed to obtain target global prompt information of multiple time series prediction modules.

[0180] Specifically, the weights of the global cue information in the global cue pool at multiple time scales can be Global prompt information in the global prompt pool Perform matrix multiplication to obtain the target global prompt information of multiple time series prediction modules, namely: .in, Represents all global prompt information in the global prompt pool. It is represented as a collection of global prompt information of each time series prediction module.

[0181] For the i-th time series prediction module, the target global prompt information Under the prompt, according to the time scale received by the i-th time series prediction module, L i The time series segment is used for time series prediction to obtain the initial time series prediction data of the i-th time series prediction module The same method can be used to obtain the initial time series prediction data of multiple time series prediction modules. The target global prompt information of the time series prediction module can provide the time series prediction module with a richer perspective to understand the multi-time scale dynamics. Therefore, the initial time series prediction data predicted by the time series prediction module is more accurate.

[0182] based on Figure 4 The internal structure of the timing prediction module shown in the first embodiment can be the target global prompt information of the i-th timing prediction module. The second embedding space representation is concatenated with the embedding space representation of the input time series segment (defined as the first embedding space representation) to obtain a second embedding space representation, and the second embedding space representation is input into the encoder in the time series prediction module, and the second embedding space representation can be encoded by the encoder to obtain an encoding result; thereafter, the encoding result is used to perform time series prediction, using the initial time series prediction data output by the time series prediction module.

[0183] Furthermore, the multiple initial time series prediction data output by the multiple time series prediction modules can be analyzed according to the contribution of the multiple time series prediction modules to the time series prediction results. Aggregation processing is performed to obtain time series prediction data, that is, time series prediction results.

[0184] In implementation mode 1, on the one hand, when predicting time series, the time series prediction module uses the target global prompt information of the time series prediction module as a prompt to perform time series prediction. The target global prompt information can provide the time series prediction module with a richer perspective to understand the dynamics of multiple time scales, and the initial time series prediction data predicted by the time series prediction module is more accurate, thereby making the time series prediction data obtained by aggregating the initial time series prediction data more accurate. On the other hand, according to the contribution of multiple time series prediction modules to the time series prediction results, the outputs of multiple time series prediction modules are aggregated, which not only integrates the time series prediction results of multiple time scales, but also takes into account the importance of each time scale, which helps to improve the accuracy of time series prediction.

[0185] Implementation method 2: In order to enable the time series prediction module to capture the detailed features of the time series data at the corresponding time scale of the input, in other embodiments of the present application, a local prompt learner is introduced.

[0186] The local hint learner can encode the original time series data to obtain the hidden state of the original time series data. ; Afterwards, the hidden state of the original time series data can be Mapped to the embedding dimension D supported by multiple time series prediction modules 10, local prompt information of multiple time series prediction modules is obtained. Specifically, the hidden state of the original time series data is Mapped to embedding dimensions supported by the encoder in multiple temporal prediction modules.

[0187] Specifically, the input original time series data can be encoded to obtain the hidden state of the original time series data ; Afterwards, the hidden state of the original time series data can be Mapped to the embedding dimension D supported by the encoder in multiple time series prediction modules to obtain local prompt information of multiple time series prediction modules.

[0188] Based on the local prompt information of multiple time series prediction modules, for the i-th time series prediction module, under the prompt of the local prompt information, according to the time scale L received by the i-th time series prediction module i The multiple time series segments are used for time series prediction to obtain the initial time series prediction data of the i-th time series prediction module The local prompt information of the time series prediction module enables the time series prediction module to capture the detailed features of the time series data at the corresponding time scale of the input, so the initial time series prediction data predicted by the time series prediction module is more accurate.

[0189] based on Figure 4The internal structure of the time series prediction module shown in the figure, in implementation mode 2, the local prompt information can be spliced ​​with the embedded space representation of the input time series segment (defined as the first embedded space representation) to obtain a third embedded space representation, and the third embedded space representation is input to the encoder of the time series prediction module. The encoder encodes the third embedded space representation to obtain an encoding result; then, the encoding result is used to perform time series prediction, and the time series prediction module outputs the initial time series prediction data.

[0190] In implementation mode 2, on the one hand, the time series prediction module uses local prompt information as a prompt to perform time series prediction during time series prediction. The local prompt information enables the time series prediction module to capture the detailed features of the time series data at the corresponding time scale of the input, so the initial time series prediction data predicted by the time series prediction module is more accurate. On the other hand, according to the contribution of multiple time series prediction modules to the time series prediction results, the outputs of multiple time series prediction modules are aggregated, which not only integrates the time series prediction results of multiple time scales, but also takes into account the importance of each time scale, which helps to improve the accuracy of time series prediction.

[0191] Implementation 3: In order to further improve the accuracy of time series prediction, in some embodiments, the above-mentioned implementation 1 and implementation 2 are combined to perform prompt enhancement. Specifically, the prompt enhancement method shown in the above-mentioned implementation 1 can be used to obtain the target global prompt information of multiple time series prediction modules 10; and the prompt enhancement method shown in implementation 2 can be used to obtain the local prompt information of multiple time series prediction modules 10.

[0192] Furthermore, for any time scale L i The corresponding multiple time series segments are divided into time scales L i The target global prompt information of the corresponding time series prediction module (i.e., the i-th time series prediction module) And the local prompt information of the target timing prediction module (such as MLP (z)) is the prompt information (Prompt), and the target global prompt information of the i-th timing prediction module is , local prompt information of the target time series prediction module and the time scale L i The multiple time series segments are input into the i-th time series prediction module. In the i-th time series prediction module, the target global prompt information of the i-th time series prediction module And the local hint information of the target time series prediction module (such as MLP (z)), according to the time scale L i The multiple time series segments are used for timing prediction to obtain the initial timing prediction data output by the target timing prediction module. .

[0193] In implementation mode 3, the target global prompt information of multiple timing prediction modules obtained by using the global prompt information in the global prompt pool in implementation mode 1 provides the timing prediction module with a richer perspective to understand the multi-time scale dynamics, and the local prompt information of multiple timing prediction modules obtained by using the prompt enhancement method provided in implementation mode 2 can provide the timing prediction module with local features that are more in line with the current input timing fragment, so that the timing prediction module can capture the detailed time pattern of the timing fragment at the corresponding time scale. The two realize the prompt enhancement of the timing prediction module from different angles, enrich the reference dimension of the timing prediction module for timing prediction, and help improve the accuracy of timing prediction.

[0194] based on Figure 4 The internal structure of the timing prediction module shown in the implementation mode 3, for the i-th timing prediction module, the sum of the vectors of the target global prompt information and the local prompt information of the i-th timing prediction module can be calculated as the prompt information (Prompt) of the i-th timing prediction module; then, the prompt information (Prompt) of the i-th timing prediction module is spliced ​​with the embedding space representation of the input timing segment (defined as the first embedding space representation) to obtain a fourth embedding space representation, and the fourth embedding space representation is input into the encoder of the timing prediction module, and the fourth embedding space representation is encoded by the encoder to obtain an encoding result; then, the encoding result is used to perform timing prediction, and the initial timing prediction data output by the timing prediction module is used.

[0195] In implementation mode 3, on the one hand, the target global prompt information of the time series prediction module provides the time series prediction module with a richer perspective to understand the multi-time scale dynamics, and the local prompt information of the time series prediction module can provide the time series prediction module with local features that are more in line with the current input time series fragment, so that the time series prediction module can capture the detailed time pattern of the time series fragment under the corresponding time scale. The two realize the prompt enhancement of the time series prediction module from different angles, enrich the reference dimension of the time series prediction module for time series prediction, and help improve the accuracy of time series prediction. On the other hand, according to the contribution of multiple time series prediction modules to the time series prediction results, the outputs of multiple time series prediction modules are aggregated, which not only integrates the time series prediction results of multiple time scales, but also takes into account the importance of each time scale, which helps to improve the accuracy of time series prediction.

[0196] It should be noted that the execution subject of each step of the method provided in the above embodiment can be the same device, or the method can be executed by different devices. For example, the execution subject of steps 131 and 132 can be device A; for another example, the execution subject of step 131 can be device A, and the execution subject of step 132 can be device B; and so on.

[0197] In addition, in some of the processes described in the above embodiments and the accompanying drawings, multiple operations appearing in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this document or may be executed in parallel, and the serial numbers of the operations, such as 132, 133, etc., are only used to distinguish between different operations, and the serial numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel.

[0198] Accordingly, an embodiment of the present application also provides a computer-readable storage medium storing computer instructions. When the computer instructions are executed by one or more processors, the one or more processors are caused to execute the steps in the above-mentioned timing prediction method.

[0199] The embodiment of the present application also provides a computer program product, including a computer program, which, when executed by one or more processors, causes the one or more processors to execute the steps in the above-mentioned timing prediction method. In the embodiment of the present application, the specific implementation form of the computer program product is not limited. In some embodiments, the computer program product can be implemented as an application (Application, APP), a mini-program, a computer-side client, a program module, a plug-in, an installation package, a software development kit (Software Development Kit, SDK), an image file of a CD (such as an ISO file), a plug-in or software in the form of software as a service (Software as a Service, SaaS), etc., but is not limited to this.

[0200] In order to verify the effectiveness of the time series prediction system provided by the embodiment of the present application, the inventor of the present application used existing data sets for verification. The data sets cover diverse fields such as electricity, meteorology, and transportation. Specifically, the data sets used to evaluate the effectiveness of the time series prediction system include: ETTh1, ETTh2, ETTm1, ETTm2, Electricity Consuming Load (ECL) data set, Weather data set, Traffic data set, and Influenza-like Illness (ILI) data set, etc.

[0201] Table 1: Complete results of multivariate time series forecasting, the target data length to be predicted is T∈{96,192,336,720}. The lower the MSE and MAE, the better the forecasting performance of the model. In Table 1, the best results are in bold and the suboptimal results are underlined.

[0202]

[0203]

[0204]

[0205] During the performance verification, the time series prediction system used by the inventors of the present application is: the time series prediction module is implemented as an expert module in MoE, and the global prompt information and local prompt information provided in the aforementioned implementation mode 3 are used together as the prompt information of the expert module. The time series prediction system can be called an adaptive multi-scale time series prediction model based on a hybrid expert network (Adaptive Multi-Scale Modeling with Mixture of Experts for TimeSeries Forecasting, AMSMoE). The baseline model used by the inventors of the present application includes models in the field of long-term prediction, including Transformer-based models, such as iTransformer models, PatchTST models, Scaleformer models, and FEDformer models. At the same time, models that are not based on Transformer models but are highly competitive are also used, such as GPT4TS models, DLinear models, TimesNet models, and LightTS models. For the fairness and consistency of model evaluation, we use a unified length H of the original time series data and a length T of the target data to be predicted in each model. Specifically, for the ILI dataset, H=104 and T={24, 36, 48, 60}. For other datasets, H=336 and T={96,192, 336, 720}, and the mean square error (MSE) and mean absolute error (MAE) are used as the accuracy measures of the prediction task.

[0206] The inventors of the present application used the time series prediction system provided in the embodiments of the present application and the baseline model used above to perform time series prediction, and the prediction results obtained are shown in Table 1 above.

[0207] It can be seen from Table 1 that the time series prediction system model provided by the embodiment of the present application performs well in long-term prediction tasks, exceeding 97.5% of other baseline models. Compared with the baseline model PatchTST model, the prediction performance of the time series prediction system provided by the embodiment of the present application is improved by 3%, indicating that the time series prediction system provided by the embodiment of the present application can better process time series by compensating for the lack of local time features in the PatchTST model. This performance improvement is mainly due to the fact that the time series prediction system provided by some embodiments of the present application can effectively extract local prompt information and global prompt information from a multi-time scale perspective, and adaptively fuse knowledge across time scales.

[0208] In addition, the performance of the time series prediction system provided by some embodiments of the present application is better than the GPT4TS model, which is a cutting-edge (State-of-the-Art, SOTA) model that uses a natural language processing (NLP) model as a backbone network. The average MSE and MAE of the time series prediction system provided by some embodiments of the present application on all data sets have been reduced by 6% and 3% compared to the GPT4TS model. The performance improvement of the time series prediction system provided by some embodiments of the present application is particularly obvious in data sets with greater temporal pattern variability, such as weather (Weather) data sets and traffic (Traffic) data sets. Therefore, it can be obtained that: the time series prediction system provided by some embodiments of the present application can adaptively capture the complex dependencies between different time scales.

[0209] Fig.14 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Fig.14 As shown, the electronic device includes: a memory 14a and a processor 14b. The memory 14a is used to store computer programs.

[0210] The processor 14b is coupled to the memory 14a and is used to execute a computer program to execute the steps in the time series prediction method provided in the above embodiments. The specific implementation of each step can be found in the relevant description of the above embodiments, which will not be repeated here.

[0211] In some optional embodiments, such as Fig.14 As shown, the electronic device may also include optional components such as a communication component 14c, a power component 14d, a display component 14e and an audio component 14f. Fig.14 Some components are shown schematically, and it does not mean that electronic devices must include Fig.14 The components shown do not necessarily mean that the electronic device can only include Fig.14 Components shown.

[0212] in addition, Fig.14 The components in the dashed box are optional components, not mandatory components, and may depend on the product form of the electronic device. The electronic device of this embodiment may be implemented as a terminal device such as a desktop computer, a laptop computer, a mobile phone, or an IoT device; or it may be various server devices such as a traditional server, a cloud server, or a server cluster.

[0213] In an embodiment of the present application, the memory is used to store a computer program and can be configured to store various other data to support operations on the device where it is located. Among them, the processor can execute the computer program stored in the memory to implement the corresponding control logic. The memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random-Access Memory, SRAM), electrically erasable programmable read only memory (Electrically Erasable Programmable Read Only Memory, EEPROM), erasable programmable read only memory (Electrical Programmable Read Only Memory, EPROM), programmable read only memory (Programmable Read Only Memory, PROM), read only memory (Read Only Memory, ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0214] In the embodiment of the present application, the processor can be any hardware processing device that can execute the logic of the above method. Optionally, the processor can be a central processing unit (CPU), a graphics processing unit (GPU) or a microcontroller unit (MCU); it can also be a field programmable gate array (FPGA), a programmable array logic device (PAL), a general array logic device (GAL), a complex programmable logic device (CPLD) and other programmable devices; or it can be an advanced reduced instruction set (RISC) processor (Advanced RISC Machines, ARM) or a system on chip (System on Chip, SoC), etc., but not limited to this.

[0215] In an embodiment of the present application, the communication component is configured to facilitate wired or wireless communication between the device in which it is located and other devices. The device in which the communication component is located can access a wireless network based on a communication standard, such as Wireless Fidelity (WiFi), 2G or 3G, 4G, 5G or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component can also be implemented based on Near Field Communication (NFC) technology, Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra Wide Band (UWB) technology, Bluetooth (BT) technology or other technologies.

[0216] In an embodiment of the present application, the display component may include a liquid crystal display (LCD) and a touch panel (TP). If the display component includes a touch panel, the display component may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.

[0217] In an embodiment of the present application, a power supply component is configured to provide power to various components of the device in which it is located. The power supply component may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device in which the power supply component is located.

[0218] In an embodiment of the present application, the audio component may be configured to output and / or input audio signals. For example, the audio component includes a microphone (Microphone, MIC), and when the device where the audio component is located is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal may be further stored in a memory or sent via a communication component. In some embodiments, the audio component also includes a speaker for outputting an audio signal. For example, for a device with a language interaction function, voice interaction with a user may be achieved through an audio component.

[0219] It should be noted that the descriptions such as “first” and “second” in this article are used to distinguish different messages, devices, modules, etc., and do not represent the order of precedence, nor do they limit “first” and “second” to different types.

[0220] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, compact disc read-only memory (CD-ROM), optical storage, etc.) containing computer-usable program codes.

[0221] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0222] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0223] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0224] In a typical configuration, a computing device includes one or more processors (CPU, etc.), input / output interfaces, network interfaces, and memory.

[0225] Memory may include non-permanent storage in a computer-readable medium, in the form of random-access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0226] Computer storage media is readable storage media, also known as readable media. Readable storage media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical storage, magnetic cassettes, disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.

[0227] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of further restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the above elements.

[0228] The above contents are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A time series prediction system, characterized in that: include: A plurality of timing prediction modules, a token router and an aggregation module; the weight matrix of the token router is pre-learned and used to determine the routing probability of the plurality of timing prediction modules; The token router is used to determine the contribution of the multiple time series prediction modules to the time series prediction result according to the original time series data and the weight matrix of the token router, and input the contribution of the multiple time series prediction modules to the time series prediction result to the aggregation module; The multiple time series prediction modules correspond one-to-one to the multiple time scales, and are used to obtain time series segments of corresponding time scales obtained by segmenting the original time series data; and perform time series prediction according to the time series segments of the corresponding time scales to obtain initial time series prediction data output by the multiple time series prediction modules; The aggregation module is used to aggregate the initial time series prediction data output by the multiple time series prediction modules according to the contribution of the multiple time series prediction modules to the time series prediction result, so as to obtain the time series prediction data.

2. The system according to claim 1, characterized in that The time series prediction system further includes: a plurality of segmentation modules; the plurality of segmentation modules correspond one to one with the plurality of time series prediction modules; The multiple segmentation modules correspond one-to-one to the multiple time scales, and are used to segment the original time series data into time series segments with corresponding time scales; and input the time series segments with corresponding time scales into the corresponding time series prediction modules.

3. The system according to claim 1, characterized in that The time series prediction system also includes: an instance normalization module; The instance normalization module is used to perform normalization processing on the original time series data to obtain normalized time series data as the original time series data.

4. The system according to any one of claims 1 to 3, characterized in that: The time series prediction system further includes: a prompt router and a global prompt pool; the global prompt information in the global prompt pool is pre-learned using historical time series data as training samples; the monitoring objects and monitoring indicators corresponding to the historical time series data and the original time series data are the same; The weight matrix of the prompt router is pre-learned and used to determine the correspondence between the global prompt information in the global prompt pool and the multiple time scales; The prompt router is used to determine the weights of the global prompt information in the global prompt pool on the multiple time scales according to the weight matrix of the prompt router and the time series segments with the multiple time scales; and input the weights of the global prompt information in the global prompt pool on the multiple time scales into the global prompt pool; The global prompt pool is used to aggregate the global prompt information in the global prompt pool according to the weights of the global prompt information in the global prompt pool on the multiple time scales to obtain the target global prompt information of the multiple timing prediction modules; and output the target global prompt information of the multiple timing prediction modules to the corresponding timing prediction modules respectively.

5. The system according to any one of claims 1 to 3, characterized in that: The time series prediction module includes: a first fully connected layer, a first encoder and a prediction unit; the time series prediction system also includes: a local prompt learner; the local prompt learner includes: a second encoder and a second fully connected layer; The second encoder is used to encode the original time series data to obtain a hidden state of the original time series data; The second fully connected layer is used to map the hidden state to the embedding dimension supported by the multiple time series prediction modules to obtain local prompt information of the multiple time series prediction modules, and output the local prompt information of the multiple time series prediction modules to the corresponding time series prediction modules; The first fully connected layer of the multiple time series prediction modules is specifically used to map the input time series segment to the embedding dimension supported by the encoder to obtain a first embedding space representation of the input time series segment; concatenate the received local prompt information with the first embedding space representation to obtain a second embedding space representation; and input the second embedding space representation into the first encoder; The first encoder is specifically configured to encode the second embedding space representation to obtain an encoding result of the second embedding space representation; The prediction unit is used to perform time series prediction using the encoding result represented by the second embedding space to obtain initial time series prediction data output by the multiple time series prediction modules.

6. The system according to claim 4, characterized in that The time series prediction module includes: a first fully connected layer, a first encoder and a prediction unit; the time series prediction system also includes: a local prompt learner; the local prompt learner includes: a second encoder and a second fully connected layer; The second encoder is used to encode the original time series data to obtain a hidden state of the original time series data; The second fully connected layer is used to map the hidden state to the embedding dimension supported by the multiple time series prediction modules to obtain local prompt information of the multiple time series prediction modules, and output the local prompt information of the multiple time series prediction modules to the corresponding time series prediction modules; The first fully connected layer of the multiple time series prediction modules is used to map the input time series segment to the embedding dimension supported by the encoder to obtain a first embedding space representation of the input time series segment; concatenate the target global prompt information, the local prompt information and the first embedding space representation to obtain a third embedding space representation; and input the third embedding space representation into the first encoder; The first encoder is used to encode the third embedding space representation to obtain an encoding result of the third embedding space representation; The prediction unit is used to perform time series prediction using the encoding result represented by the third embedding space to obtain initial time series prediction data output by the multiple time series prediction modules.

7. A time series prediction method, characterized in that: include: Obtaining time series segments with multiple time scales obtained by segmenting the original time series data and the pre-learned weight matrix of the token router; The weight matrix of the token router is used to determine the routing probabilities of multiple timing prediction modules; The time series segments with multiple time scales are obtained by segmenting the original time series data; Determining the contribution of multiple timing prediction modules to the timing prediction result according to the original timing data and the weight matrix of the token router; Using the multiple time series prediction modules to perform time series prediction according to the time series segments of the corresponding time scales, respectively, to obtain initial time series prediction data output by the multiple time series prediction modules; the multiple time series prediction modules correspond to the multiple time scales one by one; According to the contribution of the multiple time series prediction modules to the time series prediction result, the initial time series prediction data output by the multiple time series prediction modules are aggregated to obtain the time series prediction data.

8. The method according to claim 7, characterized in that Determining the contribution of the plurality of timing prediction modules to the timing prediction result according to the original timing data and the weight matrix of the token router includes: Mapping the original time series data into first time series data having a data length of a target data length to be predicted; Determining routing scores of the plurality of timing prediction modules according to the first timing data and the weight matrix of the token router; The routing scores of the multiple timing prediction modules are normalized to obtain the contribution of the multiple timing prediction modules to the timing prediction result.

9. The method according to claim 8, characterized in that Determining the routing scores of the plurality of timing prediction modules according to the first timing data and the weight matrix of the token router includes: Performing matrix multiplication of the first timing data and the weight matrix of the token router to obtain initial routing scores of the multiple timing prediction modules; A random noise score is added to the initial routing scores of the multiple timing prediction modules to obtain the routing scores of the multiple timing prediction modules.

10. The method according to claim 9, characterized in that Before adding the random noise scores to the initial routing scores of the plurality of timing prediction modules, the method further comprises: Acquire the pre-learned noise weights of the routing of the plurality of time series prediction modules; Normalizing a result of matrix multiplication of the first time series data and the noise weight by using a first activation function to obtain noise scores of the multiple time series prediction modules; The product of the coefficients satisfying the preset probability distribution and the noise scores of the multiple time series prediction modules is calculated to obtain the random noise scores of the multiple time series prediction modules.

11. The method according to claim 8, characterized in that The normalizing the routing scores of the multiple time series prediction modules to obtain the contribution of the multiple time series prediction modules to the time series prediction result includes: The routing scores of the multiple time series prediction modules are normalized by using a second activation function to obtain the contribution of the multiple time series prediction modules to the time series prediction result.

12. The method according to any one of claims 7 to 11, characterized in that: The step of obtaining time series segments with multiple time scales obtained by segmenting the original time series data includes: Get the original time series data; The original time series data is segmented according to the multiple time scales corresponding to the multiple time series prediction modules to obtain time series segments having the multiple time scales.

13. The method according to claim 12, characterized in that The obtaining of original time series data includes: Acquire input time series data; and perform normalization processing on the input time series data to obtain the original time series data.

14. The method according to claim 12, characterized in that The step of segmenting the original time series data according to the multiple time scales corresponding to the multiple time series prediction modules to obtain time series segments having the multiple time scales includes: For any time scale, the original time series data is divided into a plurality of time series segments having any time scale by using a sliding window method; The length of the sliding window used by the sliding window method is equal to the any time scale, and the step size of the sliding window is smaller than the any time scale.

15. The method according to claim 12, characterized in that Before using the multiple time series prediction modules to perform time series prediction according to the time series segments of corresponding time scales respectively, the method further includes: Acquire a pre-learned weight matrix of a prompt router; the weight matrix of the prompt router is used to determine the correspondence between the global prompt information in the global prompt pool and the multiple time scales; wherein the global prompt information in the global prompt pool is pre-learned using historical time series data as training samples; the time scale corresponding to the historical time series data includes the multiple time scales, and the number of time scales corresponding to the historical time series data is greater than the number of the multiple time scales; determining weights of the global prompt information in the global prompt pool on the multiple time scales according to the weight matrix of the prompt router and the time series segments having the multiple time scales; According to the weights of the global prompt information in the global prompt pool on the multiple time scales, weighted processing is performed on the global prompt information in the global prompt pool to obtain target global prompt information for the multiple time series prediction modules.

16. The method according to claim 15, characterized in that Determining the weights of the global prompt information in the global prompt pool on the multiple time scales according to the weight matrix of the prompt router and the time sequence segments having the multiple time scales includes: For a plurality of time series segments having any time scale, reshape the plurality of time series segments having any time scale into a three-dimensional tensor; Mapping the three-dimensional tensor to the embedding space of the prompt router to obtain an embedding representation corresponding to any time scale; Performing average pooling on the embedding representation corresponding to any time scale in the time dimension to obtain an embedding matrix corresponding to any time scale; A third activation function is used to normalize the matrix multiplication results of the embedding matrices corresponding to the multiple time scales and the weight matrix of the prompt router to obtain the weights of the global prompt information in the global prompt pool on the multiple time scales.

17. The method according to claim 15, characterized in that The using the multiple time series prediction modules to perform time series prediction according to time series segments of corresponding time scales respectively includes: Taking the target global prompt information of the target timing prediction module as the prompt information of the target timing prediction module, the target global prompt information of the target timing prediction module and a plurality of timing segments with any time scale are input into the target timing prediction module; the target timing prediction module is a timing prediction module corresponding to the any time scale; In the target timing prediction module, under the prompt of the target global prompt information of the target timing prediction module, timing prediction is performed according to the multiple timing segments to obtain initial timing prediction data output by the target timing prediction module.

18. The method according to claim 12, characterized in that Before using the multiple time series prediction modules to perform time series prediction according to the time series segments of corresponding time scales respectively to obtain initial time series prediction data output by the multiple time series prediction modules, the method further includes: Encoding the original time series data to obtain a hidden state of the original time series data; Mapping the hidden state to an embedding dimension supported by the multiple time series prediction modules to obtain local prompt information of the multiple time series prediction modules; The using the multiple time series prediction modules to perform time series prediction according to time series segments of corresponding time scales respectively includes: For a plurality of time series segments corresponding to any time scale, using local prompt information of a target time series prediction module as prompt information, the local prompt information of the target time series prediction module and the plurality of time series segments are input into the target time series prediction module; the target time series prediction module is a time series prediction module corresponding to any time scale; In the target timing prediction module, under the prompt of the local prompt information of the target timing prediction module, timing prediction is performed according to the multiple timing segments to obtain initial timing prediction data output by the target timing prediction module.

19. The method according to claim 12, characterized in that Before using the multiple time series prediction modules to perform time series prediction according to the time series segments of corresponding time scales respectively, the method further includes: Encoding the original time series data to obtain a hidden state of the original time series data; Mapping the hidden state to an embedding dimension supported by the multiple time series prediction modules using a fully connected layer to obtain local prompt information of the multiple time series prediction modules; The using the multiple time series prediction modules to perform time series prediction according to time series segments of corresponding time scales respectively includes: For multiple time series segments corresponding to any time scale, calculating the sum of the target global prompt information of the target time series prediction module and the vector of the local prompt information of the target time series prediction module as the prompt information of the target time series prediction module; Inputting the prompt information of the target time series prediction module and the multiple time series segments into the target time series prediction module; the target time series prediction module is a time series prediction module corresponding to any time scale; In the target timing prediction module, under the prompt of the prompt information of the target timing prediction module, timing prediction is performed according to the multiple timing segments to obtain initial timing prediction data output by the target timing prediction module.

20. An electronic device, characterized in that: include: A memory and a processor; wherein the memory is used to store a computer program; The processor is coupled to the memory and configured to execute the computer program for performing the steps of the method according to any one of claims 7 to 19.

21. A computer-readable storage medium storing computer instructions, characterized in that: When the computer instructions are executed by one or more processors, the one or more processors are caused to execute the steps in the method according to any one of claims 7 to 19.

22. A computer program product, characterized in that The method comprises a computer program which, when executed by one or more processors, causes the one or more processors to execute the steps of the method according to any one of claims 7 to 19.

Citation Information

Patent Citations

  • Commodity sales volume prediction method, system and equipment based on multi-scale time sequence model

    CN117788041A