Time sequence data prediction method and apparatus, and storage medium

Through the many-to-one hierarchical link architecture and long-period attention mechanism, the efficiency and accuracy problems of fine-grained long-period time series data prediction are solved, and efficient prediction of cloud platform container scheduling and traffic signal optimization is achieved.

WO2024183565A1PCT designated stage expired Publication Date: 2024-09-12HUAWEI TECH CO LTD

Patent Information

Application Number
PCT/CN2024/078898
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-03
Filing Date
2024-02-28
Publication Date
2024-09-12

AI Technical Summary

Technical Problem

Existing time series data prediction technology is difficult to effectively process fine-grained long-period time series data, resulting in low prediction efficiency and low accuracy. Especially in scenarios used to schedule the number of containers in cloud platforms, future request traffic cannot be accurately predicted, resulting in The number of cold starts increases and computing resources are wasted.

Method used

It adopts a many-to-one hierarchical link architecture of multiple encoders and decoders to extract relative position information and change trend information by encoding historical time series data, and uses Fourier transform convolution operations to process the time series data into a flexible and variable sequence. Length, combined with the long-period attention mechanism, reduces cumulative errors and achieves efficient and accurate timing prediction.

Benefits of technology

It achieves efficient and accurate prediction of fine-grained long-period time series data, reduces the number of cold starts of the cloud platform, reduces the waste of computing resources, improves processing efficiency and accuracy, and is suitable for scenarios such as cloud platforms and traffic signal dispatching.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024078898_12092024_PF_FP_ABST
    Figure CN2024078898_12092024_PF_FP_ABST
Patent Text Reader

Abstract

A time sequence data prediction method and apparatus, and a storage medium. The method comprises: acquiring current time sequence data acquired in an adjacent current time window before a prediction time window in a current time period, and acquiring a plurality of groups of historical time sequence data respectively acquired in the same target time window of a plurality of historical time periods; using a plurality of encoders to respectively encode the plurality of groups of historical time sequence data to obtain a plurality of historical time sequence features respectively corresponding to the plurality of groups of historical time sequence data, each historical time sequence feature representing relative position information and change trend information of each group of historical time sequence data in the target time window; and using a decoder to determine, according to the plurality of historical time sequence features and the current time sequence data, predicted time sequence data corresponding to a target object in the prediction time window. Fine-grained time sequence prediction for a long period is efficiently and accurately achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Time series data prediction method, device and storage medium

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on March 3, 2023, with application number 202310238123.8 and application name “Time Series Data Prediction Method, Device and Storage Medium”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of computer technology, and in particular to a time series data prediction method, device, and storage medium. Background Art

[0003] With the development of cloud computing, more and more developers are deploying their applications to cloud platforms (such as the serverless computing architecture of cloud platforms). This saves a lot of computing resource operation and maintenance costs, allowing developers to focus more on the business code logic without having to worry about the complex configuration of underlying computing resources. In this scenario, because cloud platforms typically use virtual machines or containers to deploy function instances and application code, cloud platforms usually continue to maintain and run related computing resources (containers, code, etc.) for a period of time to process user requests from the client. If the container waits for a period of time without receiving any user requests, the container and the related code and instances within the container will be cleared. Subsequent user requests will need to wait for the new container to be initialized and the related code to be loaded. This period is called a cold start. Cold starts significantly increase the execution latency of function instances and applications, and also significantly affect the overall performance of the cloud platform.

[0004] Therefore, it is necessary to schedule the number of containers running in the cloud platform to improve the processing performance of the cloud platform while reducing operating costs. This is because if the number of configured containers is too small, the number of cold starts will increase, thereby reducing the overall processing performance (that is, increasing the request response delay). If too many containers are configured, it will lead to a waste of computing resources because these excess computing resources will not provide services for received user requests and will increase energy usage and operation and maintenance costs. Taking into account that the applications deployed on the cloud platform are usually oriented to user clients or IoT device services, with human participation, some request traffic for user services will show obvious periodic characteristics. Therefore, the traffic data collected historically can be used to predict the request traffic that may occur in the future, and this can be used to infer the number of containers that the cloud platform needs to maintain in the future, and then the container resources of the cloud platform can be scheduled in advance to adapt to the request traffic in the future.

[0005] In the aforementioned traffic forecasting scenario, the granularity of data collection may be far lower than the data's cyclical trend. For example, the data collection granularity is one piece of data per second, while the data has a daily cyclical trend. Since there are 86,400 seconds in a day, the amount of data collected over multiple days is very large. This fine-grained, long-periodic sequence data arranged according to time is called time series data. However, existing time series forecasting technologies are not suitable for forecasting scenarios involving such large amounts of fine-grained, long-periodic time series data, resulting in low forecasting efficiency and accuracy.

[0006] Summary of the Invention

[0007] In view of this, a time series data prediction method, device and storage medium are proposed.

[0008] In a first aspect, an embodiment of the present application provides a time series data prediction method, which includes: for a prediction time window set for a target object to be predicted within a current time period, obtaining current time series data collected within a current time window adjacent to the prediction time window within the current time period, and obtaining multiple groups of historical time series data collected respectively within the same target time window of multiple historical time periods, wherein the target time window includes the prediction time window and the current time window, and the time series data includes behavior data of the target object occurring at multiple time points within the time window; using multiple encoders to encode the multiple groups of historical time series data respectively to obtain multiple historical time series features corresponding to each of the multiple groups of historical time series data, each historical time series feature characterizing the relative position information and change trend information of each group of historical time series data within the target time window; using a decoder to determine the predicted time series data corresponding to the target object in the prediction time window based on the multiple historical time series features and the current time series data, the predicted time series data including the predicted behavior data of the target object at multiple time points within the prediction time window.

[0009] According to an embodiment of the present application, based on the prediction time window and the current time window, it is possible to a priori know which time series data in the historical time period are important; then, multiple encoders are used to respectively use the historical time series data of the target time windows of multiple historical time periods as input, and after encoding, the relative position information and change trend information of the historical time series data are output to different coding layers of the decoder, so as to provide the decoder with an effective basis for time series prediction for a period of time in the future, that is, to use the important historical sequence data in each past target time window to predict the sequence trend of the prediction time window in the current time period, so that there is no need to use all the historical time series data in multiple historical time periods, and fine-grained long-period time series prediction can be achieved efficiently and accurately.

[0010] According to the first aspect, in a first possible implementation of the time series data prediction method, the decoder includes J decoding layers, each historical time series feature includes J sub-time series features, J is a positive integer, and the decoder is used to determine the predicted time series data corresponding to the target object in the prediction time window based on the multiple historical time series features and the current time series data, including: inputting the current time series data and the first sub-time series feature of each historical time series feature into the first decoding layer of the decoder, and outputting the first predicted time series feature; inputting the j-1th predicted time series feature output by the j-1th decoding layer and the jth sub-time series feature of each historical time series feature into the jth decoding layer of the decoder, and outputting the jth predicted time series feature, j∈[2,J]; determining the predicted time series data based on the Jth predicted time series feature output by the Jth decoding layer of the decoder and the prediction time window.

[0011] According to an embodiment of the present application, by providing the sub-time series features of multiple historical time series features to the corresponding decoding layers respectively, that is, the encoder outputs part of the feature information of the historical time series data to different encoding layers of the decoder respectively, thereby providing an effective basis for the decoder to predict the time series for a period of time in the future, being able to retain the sequential information of the historical time series data, perceive the changing trend of long-term time series data, and reduce the impact of cumulative errors.

[0012] According to a first possible implementation method of the first aspect, the current time series data and the first sub-time series feature of each historical time series feature are input into the first decoding layer of the decoder, and the first predicted time series feature is output, including: encoding the current time series data to obtain the first encoded time series feature; determining the attention weight corresponding to the first sub-time series feature of each historical time series feature according to the similarity between the first sub-time series feature of each historical time series feature and the first encoded time series feature; and performing weighted summation of the first sub-time series features of each historical time series feature according to the attention weight corresponding to the first sub-time series feature of each historical time series feature to obtain the first predicted time series feature.

[0013] According to the embodiments of the present application, the decoder can use historical time series data of shorter lengths for reasoning without using historical time series data of a complete time period as input; it can retain the relative position information and change trend information on the historical time series data, greatly reducing the impact of cumulative errors and making more accurate predictions. It can search and learn the similarity between the current time series data of the current time period and the historical time series data of the historical time period, and predict the size of future time series data on a larger scale.

[0014] According to a first possible implementation method of the first aspect, the j-1th predicted time series feature output by the j-1th decoding layer and the j-th sub-time series feature of each historical time series feature are input into the j-th decoding layer of the decoder to output the j-th predicted time series feature, including: encoding the j-1th predicted time series feature to obtain the j-th encoded time series feature; determining the attention weights corresponding to the j-th sub-time series features of each historical time series feature according to the similarity between the j-th sub-time series features of each historical time series feature and the j-th encoded time series feature; and performing weighted summation of the j-th sub-time series features of each historical time series feature according to the attention weights corresponding to the j-th sub-time series features of each historical time series feature to obtain the j-th predicted time series feature.

[0015] According to the embodiments of the present application, the decoder can use historical time series data of shorter lengths for reasoning without using historical time series data of a complete time period as input; it can retain the relative position information and change trend information on the historical time series data, greatly reducing the impact of cumulative errors and making more accurate predictions. It can search and learn the similarity between the current time series data of the current time period and the historical time series data of the historical time period, and predict the size of future time series data on a larger scale.

[0016] According to the first aspect, in a second possible implementation of the time series data prediction method, the encoder includes a feedforward network module and a multi-head self-attention mechanism module, the feedforward network module includes a Fourier transform convolution unit, the Fourier transform convolution unit is used to perform Fourier transform and convolution processing on the input features, and the multi-head self-attention mechanism module is used to generate historical time series features using the multi-head self-attention mechanism; wherein, the use of multiple encoders to respectively encode the multiple groups of historical time series data to obtain multiple historical time series features corresponding to the multiple groups of historical time series data includes: for the encoder corresponding to any group of historical time series data, the historical time series data is input into the feedforward network module of the encoder, and the intermediate time series features are output; the intermediate time series features and the historical time series data are input into the multi-head self-attention mechanism module, and the historical time series features corresponding to the historical time series data are output.

[0017] According to an embodiment of the present application, the use of a Fourier transform convolution unit in the encoder can make the sequence length of the input time series data flexible and variable, while extracting the characteristic information of the input data in the frequency domain and still maintaining the sequence information of the input time series data; in particular, the frequency information of the input time series data in the frequency domain can be used to establish connections between similar frequency components, thereby breaking through the limitation of the traditional convolution model that requires fixed input and output sizes.

[0018] According to the first aspect, in a third possible implementation of the time series data prediction method, the obtaining of the current time series data collected in the current time window adjacent to the prediction time window in the current time period includes: obtaining the current original time series data collected in the current time window, and folding the current original time series data into at least two-dimensional current time series data based on a preset folding rate, wherein the folding rate is used to indicate the scale of the folded sequence data in different dimensions, and the dimension of the current time series data is larger than the current original time series data; the obtaining of multiple groups of historical time series data collected in the same target time window of multiple historical time periods includes: obtaining each group of historical original time series data collected in the same target time window in each historical time period, and folding each group of historical original time series data into at least two-dimensional historical time series data based on the preset folding rate, and the dimension of the historical time series data is larger than the historical original time series data.

[0019] According to the embodiments of the present application, the memory footprint of the entire prediction model (including the encoder and decoder) can be improved, enabling the encoder and decoder to process longer time series data and increasing the sequence length that the model can consume, which is equivalent to increasing the parallel computing capacity of the model, that is, having a larger data throughput, thereby improving the processing efficiency of subsequent encoders and decoders. At the same time, no downsampling operations are required, which is conducive to ensuring the accuracy of time series prediction.

[0020] According to the first aspect, in a fourth possible implementation of the time series data prediction method, the target object includes a user request; the behavior data includes the request traffic of the user request, and the predicted time series data includes the request traffic predicted for the user request at multiple time points within the prediction time window; after obtaining the predicted time series data, the method further includes: scheduling the computing resources used to process the user request based on the request traffic predicted for the user request at multiple time points within the prediction time window, so that the scheduled computing resources adapt to the predicted request traffic.

[0021] According to the embodiments of the present application, predictions can be made on the request traffic of user requests, and the changing trends of traffic can be considered in three dimensions: long time series (weeks, months), periodicity (days), and real-time, to achieve more accurate fine-grained long-period time series predictions, which can reduce the number of cold starts of the cloud platform, bring low response latency to user requests, and reduce the waste of computing resources on the platform side.

[0022] According to the first aspect, in a fifth possible implementation of the time series data prediction method, the target object includes a traffic area; the behavior data includes the traffic flow in the traffic area; the predicted time series data includes the traffic flow predicted for the traffic area at multiple time points within the prediction time window; after obtaining the predicted time series data, the method further includes: adjusting the traffic signal timing scheme of the traffic lights in the traffic area within the prediction time window according to the traffic flow predicted for the traffic area at multiple time points within the prediction time window, so that the adjusted traffic signal timing scheme adapts to the predicted traffic flow.

[0023] According to the embodiments of the present application, the traffic flow in the traffic area can be predicted and the traffic signal configuration plan can be adjusted based on the predicted traffic flow, so that the adjusted traffic signal timing plan adapts to the predicted traffic flow, which can make the traffic in the entire traffic area smooth, increase the traffic flow rate and reduce traffic congestion.

[0024] In a second aspect, an embodiment of the present application provides a time series data prediction device, which includes: an acquisition module, which acquires current time series data collected in a current time window adjacent to the prediction time window in the current time period set for a target object to be predicted, and acquires multiple groups of historical time series data collected in the same target time window of multiple historical time periods, wherein the target time window includes the prediction time window and the current time window, and the time series data includes behavior data of the target object at multiple time points in the time window; an encoding module, which uses multiple encoders to encode the multiple groups of historical time series data respectively to obtain multiple historical time series features corresponding to each of the multiple groups of historical time series data, each historical time series feature representing the relative position information and change trend information of each group of historical time series data in the target time window; a decoding module, which uses a decoder to determine the predicted time series data corresponding to the target object in the prediction time window based on the multiple historical time series features and the current time series data, and the predicted time series data includes the predicted behavior data of the target object at multiple time points in the prediction time window.

[0025] According to the second aspect, in a first possible implementation of the time series data prediction device, the decoder includes J decoding layers, each historical time series feature includes J sub-time series features, J is a positive integer, and the decoder is used to determine the predicted time series data corresponding to the target object in the prediction time window based on the multiple historical time series features and the current time series data, including: inputting the current time series data and the first sub-time series feature of each historical time series feature into the first decoding layer of the decoder, and outputting the first predicted time series feature; inputting the j-1th predicted time series feature output by the j-1th decoding layer and the jth sub-time series feature of each historical time series feature into the jth decoding layer of the decoder, and outputting the jth predicted time series feature, j∈[2,J]; determining the predicted time series data based on the Jth predicted time series feature output by the Jth decoding layer of the decoder and the prediction time window.

[0026] According to a first possible implementation method of the second aspect, the current time series data and the first sub-time series feature of each historical time series feature are input into the first decoding layer of the decoder, and the first predicted time series feature is output, including: encoding the current time series data to obtain the first encoded time series feature; determining the attention weight corresponding to the first sub-time series feature of each historical time series feature according to the similarity between the first sub-time series feature of each historical time series feature and the first encoded time series feature; and performing weighted summation of the first sub-time series features of each historical time series feature according to the attention weight corresponding to the first sub-time series feature of each historical time series feature to obtain the first predicted time series feature.

[0027] According to a first possible implementation method of the second aspect, the j-1th predicted time series feature output by the j-1th decoding layer and the j-th sub-time series feature of each historical time series feature are input into the j-th decoding layer of the decoder to output the j-th predicted time series feature, including: encoding the j-1th predicted time series feature to obtain the j-th encoded time series feature; determining the attention weights corresponding to the j-th sub-time series features of each historical time series feature according to the similarity between the j-th sub-time series features of each historical time series feature and the j-th encoded time series feature; and performing weighted summation of the j-th sub-time series features of each historical time series feature according to the attention weights corresponding to the j-th sub-time series features of each historical time series feature to obtain the j-th predicted time series feature.

[0028] According to the second aspect, in a second possible implementation of the time series data prediction device, the encoder includes a feedforward network module and a multi-head self-attention mechanism module, the feedforward network module includes a Fourier transform convolution unit, the Fourier transform convolution unit is used to perform Fourier transform and convolution processing on the input features, and the multi-head self-attention mechanism module is used to generate historical time series features using the multi-head self-attention mechanism; wherein, the use of multiple encoders to respectively encode the multiple groups of historical time series data to obtain multiple historical time series features corresponding to the multiple groups of historical time series data includes: for the encoder corresponding to any group of historical time series data, the historical time series data is input into the feedforward network module of the encoder, and the intermediate time series features are output; the intermediate time series features and the historical time series data are input into the multi-head self-attention mechanism module, and the historical time series features corresponding to the historical time series data are output.

[0029] According to the second aspect, in a third possible implementation of the time series data prediction device, the obtaining of the current time series data collected in the current time window adjacent to the current time window before the prediction time window in the current time period includes: obtaining the current original time series data collected in the current time window, and folding the current original time series data into at least two-dimensional current time series data based on a preset folding rate, wherein the folding rate is used to indicate the scale of the folded sequence data in different dimensions, and the dimension of the current time series data is larger than the current original time series data; the obtaining of multiple groups of historical time series data collected in the same target time window of multiple historical time periods includes: obtaining each group of historical original time series data collected in the same target time window in each historical time period, and folding each group of historical original time series data into at least two-dimensional historical time series data based on the preset folding rate, and the dimension of the historical time series data is larger than the historical original time series data.

[0030] According to the second aspect, in a fourth possible implementation of the time series data prediction device, the target object includes a user request; the behavior data includes the request traffic of the user request, and the predicted time series data includes the request traffic predicted for the user request at multiple time points within the prediction time window; after obtaining the predicted time series data, the device further includes: a scheduling module for scheduling computing resources for processing the user request based on the request traffic predicted for the user request at multiple time points within the prediction time window, so that the scheduled computing resources adapt to the predicted request traffic.

[0031] According to the second aspect, in a fifth possible implementation of the time series data prediction device, the target object includes a traffic area; the behavior data includes the traffic flow in the traffic area; the predicted time series data includes the traffic flow predicted for the traffic area at multiple time points within the prediction time window; after obtaining the predicted time series data, the device further includes: an adjustment module for adjusting the traffic signal timing scheme of the traffic lights in the traffic area within the prediction time window according to the traffic flow predicted for the traffic area at multiple time points within the prediction time window, so that the adjusted traffic signal timing scheme adapts to the predicted traffic flow.

[0032] In a third aspect, an embodiment of the present application provides a time series data prediction device, which includes: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to implement the time series data prediction method of the above-mentioned first aspect or one or more of the multiple possible implementation methods of the first aspect when executing instructions.

[0033] In a fourth aspect, an embodiment of the present application provides a non-volatile computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the method for predicting time series data of the above-mentioned first aspect or one or more of the multiple possible implementation methods of the first aspect is implemented.

[0034] In a fifth aspect, an embodiment of the present application provides a terminal device that can execute the time series data prediction method of the above-mentioned first aspect or one or more of the multiple possible implementation methods of the first aspect.

[0035] In the sixth aspect, an embodiment of the present application provides a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying a computer-readable code. When the computer-readable code runs in an electronic device, the processor in the electronic device executes the time series data prediction method of the above-mentioned first aspect or one or more of the multiple possible implementation methods of the first aspect.

[0036] These and other aspects of the present application will become more readily apparent from the following description of the embodiment(s). BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the application and, together with the description, serve to explain the principles of the application.

[0038] FIG1( a ), FIG1( b ) and FIG1( c ) are schematic diagrams showing application scenarios according to an embodiment of the present application.

[0039] FIG2 shows a flowchart of a time series data prediction method according to an embodiment of the present application.

[0040] FIG3 is a schematic diagram showing the changing trends of multiple sets of historical time series data according to an embodiment of the present application.

[0041] FIG4 shows a schematic structural diagram of an encoder according to an embodiment of the present disclosure.

[0042] FIG5 is a schematic diagram showing a processing process of a Fourier transform convolution unit according to an embodiment of the present application.

[0043] FIG6 shows a schematic structural diagram of an encoder and a decoder according to an embodiment of the present application.

[0044] Figure 7 shows a schematic diagram of the processing process of the long-term attention mechanism module according to one embodiment of the present application.

[0045] FIG8 shows a schematic diagram of a framework of a time series data prediction system according to an embodiment of the present application.

[0046] FIG9 shows a structural diagram of a time series data prediction device according to an embodiment of the present application.

[0047] FIG10 shows a structural diagram of an electronic device 1300 according to an embodiment of the present application. DETAILED DESCRIPTION

[0048] Various exemplary embodiments, features, and aspects of the present application will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise indicated.

[0049] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.

[0050] In addition, numerous specific details are provided in the detailed description below to better illustrate the present application. Those skilled in the art will appreciate that the present application can be practiced without certain specific details. In some instances, methods, means, components, and circuits well known to those skilled in the art are not described in detail in order to highlight the main purpose of the present application.

[0051] In order to better understand the solutions of the embodiments of the present application, the relevant terms and concepts that may be involved in the embodiments of the present application are first introduced below.

[0052] (1) Serverless computing Serverless, also known as Function as a Service (FaaS), is a cloud computing model based on Platform as a Service (PaaS). Serverless computing provides a micro-architecture where end users do not need to deploy, configure, or manage servers. The servers required for program operation are all provided by the cloud platform.

[0053] (2) Recurrent Neural Network (RNN) is a type of recursive neural network that takes sequence data as input, recursively in the direction of sequence evolution, and all nodes (recurrent units) are connected in a chain.

[0054] (3) Time series data (also known as time series data) refers to sequential data ordered by time. It is generally obtained by sampling at preset time intervals and can reflect the changes in data over time. The prediction task of time series data is to predict future observations based on the patterns inherent in the time series data itself.

[0055] (4) Fine-grained time series data with long periodicity: The granularity of time series data collection is much lower than the periodic trend in the time series data (for example, 1 data per second with a daily period, and 86,400 seconds in a day). That is, the prediction task is fine-grained time series data with long periodic characteristics.

[0056] (5) Seq2seq is a variant of a recurrent neural network, consisting of an encoder and a decoder. Seq2seq is an important model in natural language processing and can be used in scenarios such as machine translation, dialogue systems, and automatic summarization.

[0057] (6) Transformer is a classic model for natural language processing (NLP). It uses a self-attention mechanism and does not adopt the sequential structure of RNN, which allows the model to be trained in parallel and has global information.

[0058] (7) Self-Attention Mechanism: This mechanism mainly consists of three values: K, V, and Q, belonging to each minimum unit in the input sequence (for example, a single value at a certain time point in the time series). The dot product of Q and K represents the similarity between Q and K. The similarity between Q and K is then normalized using the softmax function. The normalized result is a weight matrix with all values ​​between 0 and 1 (which can be understood as an attention score matrix). V represents the features after the linear transformation of the input. Multiplying the weight matrix by V will yield the filtered V features. In short, the introduction of Q and K is to obtain a weight matrix with all values ​​between 0 and 1, and the introduction of V is to preserve the features of the input. That is, Q, K, and V represent the input information, key information, and return information, respectively. The weight of the key information is obtained from the input information through the vector product, and the weight matrix of the key information is multiplied by the return information mapped by the key information to obtain the final result.

[0059] (8) Multi-head Self-attention mechanism: Compared with the Self-Attention mechanism, multiple groups of Q, K, and V are used to perform multiple calculations according to the above self-attention mechanism, that is, multiple heads are obtained. Then, the multiple calculation results are spliced ​​together and a linear transformation is performed to obtain the value as the result of the multi-head self-attention mechanism.

[0060] As mentioned above, in traffic forecasting scenarios, the granularity of data collection may be far lower than the data's cyclical trend. For example, the data collection granularity is one piece of data per second, while the data has a cyclical trend of "days." Since there are 86,400 seconds in a day, the amount of data collected over multiple days is very large. This fine-grained, long-periodic sequence data arranged according to time is called time series data. However, existing time series forecasting technologies are not suitable for forecasting scenarios involving such large amounts of fine-grained, long-periodic time series data, resulting in low forecasting efficiency and accuracy.

[0061] For example, the Transformer model described above can be used for time series prediction in existing technologies. However, the Transformer is primarily suitable for coarse-grained data (e.g., data points per period of 10s or 100s). Because the complexity of the Transformer's internal attention mechanism is generally positively correlated with the square of the sequence length, the long sequence length (i.e., large data volume) of fine-grained, long-period time series data significantly increases the effective input sequence length, affecting the Transformer's processing efficiency. Another shortcoming of Transformer-based prediction models is the temporal invariance of the Transformer's internal self-attention mechanism. Temporal invariance means that the inherent order of the input sequence is not preserved when calculating attention. This property can be used in natural language processing or computer vision, but for time series data prediction scenarios, temporal invariance is a critical issue. This is because the value of a time series at a certain point in the future is often more correlated with the value in the most recent period. Therefore, significant improvements to the self-attention model are needed to adapt it to long-term prediction scenarios.

[0062] Another existing technology can also use the AutoFormer model. The AutoFormer is an improved version of the Transformer model. It mainly performs a series of model optimizations for the prediction problem of periodic time series data. It mainly uses the periodicity of the autocorrelation learning time series and combines long-term trend prediction to accurately predict the series within a window of a certain period in the future. Although AutoFormer has made certain optimizations for time series data with periodicity, AutoFormer still requires continuous and complete sequence data within multiple periods as input. The amount of training and inference data is huge, which undoubtedly increases the complexity of the model and the delay of training and inference. Therefore, the AutoFormer solution is not applicable in the traffic prediction scenario of the above-mentioned cloud platform, because periodic traffic prediction requires the concurrent prediction of traffic data of several functions. If the inference delay of the model is too high, the effective prediction data length that can be used by the scheduler will be shorter (because some time needs to be reserved for network data communication, function instance cold start and data aggregation time), and the accuracy will be lower. One potential solution is to use downsampling to further aggregate the data. For example, by aggregating second-level traffic data into minute-level or hour-level data, the original data accuracy can be restored after the prediction is completed. However, downsampling is lossy and will inevitably produce lower-quality prediction results.

[0063] In summary, current time series forecasting technologies are not suitable for fine-grained, long-period time series data, which includes the prediction of long-term data trends, and cannot strike a balance between prediction efficiency and prediction accuracy. For this type of time series data, existing end-to-end models cannot consider long-term trends, periodicity, and short-term fluctuation details in a unified model. Existing technologies either maintain sequence order through a fixed-length seq2seq model (not suitable for fine-grained, long-term data), use RNNs (which are prone to error accumulation), or use transformers based on attention mechanisms. Although transformers have shown superior performance on many tasks (including some prediction tasks), their inherent time invariance is not suitable for continuous or ordered time series data.

[0064] In view of this, the embodiment of the present application provides a time series data prediction method, which can be applied to fine-grained long-period time series data prediction scenarios. According to the time series data prediction method of the embodiment of the present application, the periodic characteristics of the time series data can be used to calculate the correlation between different historical time periods and the current time period that needs to be predicted. Based on the different weight values ​​of different historical time periods, the traffic trend of a long time span is perceived and the traffic size of a period of time in the future is predicted; a multi-to-one layered link architecture of multiple encoders and decoders is adopted, wherein the multiple encoders respectively use the historical time series data of the target time window in multiple historical time periods as input, and after encoding, output part of the time series information of the historical time series data to different coding layers of the decoder, thereby providing the decoder with an effective basis for predicting the time series data of a period of time in the future; the low-dimensional time series data is folded into high-dimensional time series data to increase the data throughput of the encoder and decoder and speed up the calculation and reasoning speed; the Fourier transform convolution (FFT) is also used. CONV) operation to process the historical time series data in the target time window in the past several historical time periods and the current time series data in the current time window in the current time period (such as the real-time traffic of the day), thereby extracting the time series features in the frequency domain dimension without fixed restrictions on the input and output sizes.

[0065] The time series data prediction method of the embodiment of the present application can be adapted to, but not limited to, the prediction of various time series data with periodic characteristics, such as the request flow of user requests and the vehicle flow in a traffic area. It can accurately and efficiently predict the request flow and vehicle flow within a certain period of time in the future. The following briefly introduces several application scenarios of the time series data prediction method of the embodiment of the present application. Figures 1(a), 1(b), and 1(c) show schematic diagrams of application scenarios according to an embodiment of the present application.

[0066] Among them, Figure 1 (a) represents a prediction scenario of request traffic in a certain cloud platform. As shown in Figure 1 (a), the cloud platform includes: a request-level load balancing scheduler, a data storage and aggregation system, a time series data prediction system, and a computing resource-level load balancing scheduler; the time series data prediction method of the embodiment of the present application can be applied to the time series data prediction system of the cloud platform; wherein, the request-level load balancing scheduler is used to distribute user requests to the containers (pods) of each computing node (node) in the computing resource cluster for user requests in the user request queue, generate traffic log data of user requests, etc., the data storage and aggregation system is equivalent to a big data processing platform, which is used to store and aggregate traffic log data of user requests, that is, to store and aggregate historical request traffic at each time point; the time series data prediction system can trigger request traffic prediction at regular intervals, When triggering request traffic prediction, the relevant interface can be called to query the historical request traffic in the target time period for several historical days from the data storage and aggregation system, as well as the current request traffic generated in real time in the current time window. Then, based on the historical request traffic in the past few days and the current request traffic, the request traffic in the future time window can be predicted. For example, the request traffic per second in the next 20 minutes can be predicted; the time series data prediction system can send the predicted request traffic to the load balancing scheduler at the computing resource level. The load balancing scheduler at the computing resource level is used to schedule the number of containers running in the computing node based on the request traffic predicted by the time series data prediction system. For example, if the predicted request traffic increases, more containers can be started in advance to reduce the service response time of user requests. If the predicted requests decrease, some containers can be shut down in advance to reduce the waste of computing resources on the cloud platform.

[0067] Figure 1(b) represents a prediction scenario of request traffic in another cloud platform. As shown in Figure 1(b), the cloud platform includes: a load balancing system, a data plane cluster system, and a time series data prediction system; in addition, the cloud platform can communicate with the storage systems and big data processing systems of other platforms; the time series data prediction method of the embodiment of the present application can be applied to the time series data prediction system of the cloud platform; wherein, the load balancing system is used to record the traffic logs of user requests, the data plane cluster system is used to manage the life cycle of the function instances corresponding to the user requests, the cloud storage system is used to store the traffic logs of user requests, and the big data processing system is used to aggregate the traffic logs stored in the cloud storage module and the traffic data after cache processing.

[0068] The request traffic prediction process of the cloud platform based on the above Figure 1(b) may include: after the user request reaches the load balancing system of the cloud platform, the load balancing system records the traffic data of the function instance corresponding to the user request in the traffic log (for example, the request traffic per second), and after collecting the traffic data in the traffic log, writes the traffic log into the cloud storage system; the time series data prediction system regularly calls the relevant interface of the big data processing module to query and obtain the time series data within a certain time window in the past few days (including the historical request traffic of the target time window and the current request traffic of the current time window). The big data processing system can aggregate the time series data to be queried by the time series data prediction system and send the aggregated time series data to the time series data prediction system; the time series data prediction system can also further call the relevant interface of the big data processing module based on the aggregated time series data. According to the analysis of the periodic characteristics of the request traffic, function instances whose request traffic does not have periodic characteristics are filtered out, that is, user requests that do not have periodic characteristics are filtered out; the time series data prediction system then uses the time series characteristic prediction method of the embodiment of the present application to predict the request traffic data of a future time window based on the time series data of user requests with periodic characteristics. For example, the request traffic per second in the next 10 minutes can be predicted, and the predicted request traffic data is pushed to the load balancing system. The load balancing system sends a scheduling instruction to the data plane cluster system based on the peak traffic in the future period indicated in the predicted request traffic data to schedule the function instance corresponding to the user request, such as pre-pulling the function instance to reduce the service response time of the user request, or pre-shrinking the function instance to reduce the waste of computing resources of the cloud platform.

[0069] In actual applications, the request traffic prediction function in the cloud platform can be displayed in the form of a traffic prediction switch on the configuration page of the cloud platform. Users can choose whether to set the traffic prediction to be enabled. It should be understood that if the user enables the traffic prediction, the traffic prediction can be performed according to the prediction process of Figure 1(a) and Figure 1(b) above. When the traffic prediction is enabled, the time series data prediction system deployed in the above cloud platform can be used to make predictions on the request traffic of the user's request. At the same time, the traffic change trend is considered in three dimensions: long time series (such as weeks and months), periodicity (days), and real-time, to achieve more accurate and fine-grained long-term time series prediction, thereby reducing the number of cold starts of the cloud platform, bringing low response latency to users, and reducing the waste of computing resources on the cloud platform side.

[0070] FIG1(c) represents a prediction scenario of traffic flow in a certain traffic area. As shown in FIG1(c), the time series data prediction system 100 of the embodiment of the present application can be deployed on a terminal device (such as a personal computer) or a server (such as a cloud server); when a user expects to predict the traffic flow at multiple time points in a certain future time window, for example, the traffic flow per minute within 1 hour after the current time point (such as 8:00), that is, the traffic flow per minute from 8:00 to 9:00, the current traffic flow collected in real time within 1 hour before the current time point, that is, the traffic flow per minute between 7:00 and 8:00, and the historical traffic flow per minute from 7:00 to 9:00 for several days can be input into the time series data prediction system 100; the time series data prediction system 100 The time series data prediction method of the embodiment of the present application can be used to predict traffic flow based on the above-mentioned current traffic flow and historical traffic flow, and output the traffic flow prediction for each minute between 8:00 and 9:00 on the same day; then, based on the predicted traffic flow, the traffic signal timing scheme of the traffic lights in the traffic area within the predicted time window can be adjusted. The traffic signal timing scheme is used to control the change timing of different traffic signals in the traffic lights, so that the traffic signal configuration scheme can adapt to the traffic flow changes in the traffic area. For example, for intersections with a large predicted traffic flow, the green light duration of these intersections can be increased (that is, the passage time can be increased), and / or the red light duration can be shortened (that is, the waiting time can be shortened), etc., so that the traffic in the entire traffic area is smooth, the traffic flow rate is improved, and traffic congestion is reduced.

[0071] The time series data prediction method of the embodiment of the present application can be deployed on various terminal devices through software or hardware modification. The terminal device involved in the present application may refer to a device with a wireless connection function. The wireless connection function refers to the ability to connect to other terminal devices through wireless connection methods such as wifi and Bluetooth. The terminal device of the present application may also have the function of communicating through a wired connection. The terminal device of the present application may be a touch screen, a non-touch screen, or a screenless terminal device. The touch screen terminal device can be controlled by clicking, sliding, etc. on the display screen with a finger or a stylus. The non-touch screen device can be connected to an input device such as a mouse, keyboard, touch panel, etc., and the terminal device can be controlled by the input device. For example, a device without a screen can be a Bluetooth speaker without a screen. For example, the terminal device of the present application can be a smart phone, a netbook, a tablet computer, a laptop computer, a wearable electronic device (such as a smart bracelet, a smart watch, etc.), a TV, a virtual reality device, an audio system, an electronic ink, and the like.

[0072] The time series data prediction method of the embodiment of the present application can also be deployed on a server, which can be located in the cloud or locally, and can be a physical device or a virtual device, such as a virtual machine, a container, etc., with a wireless communication function, wherein the wireless communication function can be set in the chip (system) or other parts or components of the server. It can refer to a device with a wireless connection function, and the function of wireless connection means that it can be connected to other servers or terminal devices through wireless connection methods such as Wi-Fi and Bluetooth. The server of this application can also have the function of communicating with a wired connection. For example, the server of this application can be located in the cloud, communicate with the terminal device, receive the traffic flow data (including the above-mentioned historical traffic flow and current traffic flow) sent by the terminal device, and use the time series data prediction method deployed on the server to output the predicted traffic flow, and return it to the terminal device, so that the user of the terminal device can adjust the traffic signal configuration plan based on the predicted traffic flow.

[0073] The following is a detailed introduction to the time series data prediction method provided in the embodiment of the present application through Figures 2 to 8.

[0074] FIG2 shows a flow chart of a time series data prediction method according to an embodiment of the present application. The method can be used in the above-mentioned time series data prediction system and can be executed by the above-mentioned terminal device or server. As shown in FIG2 , the method includes:

[0075] Step S201, for the prediction time window set for the target object to be predicted in the current time period, obtain the current time series data collected in the current time window adjacent to the current time window in the current time period, and obtain multiple groups of historical time series data collected in the same target time window of multiple historical time periods, wherein the target time window includes the prediction time window and the current time window.

[0076] Among them, the target object can be understood as the object of the time series data to be predicted, such as the user request and traffic area in the above-mentioned application scenario, and this embodiment of the present application is not limited to this. The time series data includes the behavior data of the target object at multiple time points within the time window, such as the request flow of user requests per second within 10 minutes, the traffic flow per minute in the traffic area within 1 hour, etc. It should be understood that the embodiment of the present application does not limit the collection granularity of time series data and the statistical method of time series data. For example, the traffic flow can be collected and counted at the minute level, and the request flow can be collected and counted at the second level.

[0077] Among them, the current time period is also the latest time period. For example, the current time period with "day" as the period unit can be the current day. It should be understood that the embodiment of the present application does not limit the period unit of the time period, which depends on the periodic characteristics of the time series data of the target object. For example, if the request traffic requested by the user shows a periodic change trend in units of "days", then the period unit is "day". If the traffic flow in the traffic area shows a periodic change trend in units of "12 hours", then the period unit is "12 hours". The current time period is also the latest 12 hours.

[0078] Among them, the prediction time window can be understood as the upcoming future time window. In actual applications, the user can pre-set the length of the prediction time window according to actual needs. The specific range of the prediction time window depends on the current time point to be predicted. For example, the length of the prediction time window can be set to 10 minutes. If the current time point is 8:00, the prediction time window can be 8:00 to 8:10.

[0079] Among them, the current time window is the time window adjacent to the predicted time window in the current time period, that is, the current time window and the predicted time window are in the same current time period. The length of the current time window can also be pre-set. It should be understood that the length of the current time window and the length of the predicted time window can be the same or different. For example, the length of the current time window can be set to 1 hour. If the predicted time window is 8:00 to 8:10, the current time window can be 7:00 to 8:00. It should be understood that the current time series data collected in the current time window can be understood as the behavior data that has occurred in the current time window, or the behavior data that has occurred in the time window adjacent to the predicted time window. The current time series data can be used to more accurately predict the time series data in any predicted time window.

[0080] The specific number of the multiple historical time periods can be set according to actual needs. For example, it can be set to any value between 3 and 10, and this embodiment of the present application does not limit this. It should be understood that the period unit of the historical time period is the same as the period unit of the current time period. For example, if the period unit is "day", multiple sets of historical time series data collected within the same target time window over the past three days can be obtained.

[0081] The length and range of the target time window depend on the length and range of the prediction time window and the total length and range of the forecast time window. For example, if the prediction time window is 8:00 to 8:10 and the current time window is 7:00 to 8:00, then the target time window is 7:00 to 8:10. Three groups of historical request traffic collected from 7:00 to 8:10 in the past three days can be obtained. Each group of historical request traffic can include the request traffic generated every minute from 7:00 to 8:10 every day.

[0082] Taking into account that the original time series data actually collected is usually a one-dimensional sequence, the sequence length of each time series data to be processed is relatively long, which will affect the processing efficiency of the subsequent encoder and decoder. In a possible implementation, the obtaining of the current time series data collected in the current time window adjacent to the prediction time window in the current time period includes: obtaining the current original time series data collected in the current time window, and folding the current original time series data into at least two-dimensional current time series data based on a preset folding rate, where the dimension of the current time series data is larger than that of the current original time series data; and

[0083] The method of obtaining multiple sets of historical time series data collected within the same target time window of multiple historical time periods includes obtaining each set of historical original time series data collected within the same target time window in each historical time period, and folding each set of historical original time series data into at least two-dimensional historical time series data based on a preset folding ratio, wherein the dimension of the historical time series data is greater than that of the historical original time series data. In this way, the encoder and decoder can process longer time series data, i.e., have a higher data throughput, thereby improving the processing efficiency of subsequent encoders and decoders. At the same time, no downsampling operation is required, which is beneficial to ensuring the accuracy of time series prediction.

[0084] Among them, the folding rate is used to indicate the scale of the converted sequence data in different dimensions, for example, it can indicate the length or height in a two-dimensional scale, and can also indicate the length, height and / or width in a three-dimensional scale; folding means using a preset folding rate to convert low-dimensional data into higher-dimensional data, for example, converting one-dimensional data into two-dimensional data, or three-dimensional data, etc.

[0085] For example, if one-dimensional original sequence data is folded into two-dimensional sequence data at a folding rate F, the scale of the original sequence data can be converted from [original_length] to [original_length / F,F]. For example, if the one-dimensional sequence data {1,2,3,4,5,6} is folded at a folding rate of 3, a two-dimensional sequence data (i.e., a two-dimensional matrix) of [[1,2,3],[4,5,6]] can be obtained. The length of the one-dimensional sequence data is 6, the length of the two-dimensional sequence data is 6 / 3=2, and the height is 3.

[0086] It should be understood that the above-mentioned folding operation can improve the memory footprint of the entire prediction model (including the encoder and decoder), thereby allowing the entire prediction model to allow longer time series data as input. This is because the model includes an attention mechanism based on dot product operations, and the attention mechanism based on dot product operations is positively correlated with the square of the sequence length. Therefore, the folding operation can increase the sequence length that the model can consume without losing time series data, which is equivalent to increasing the parallel computing capacity of the model, and will also speed up the training and reasoning speed of the entire prediction model.

[0087] Optionally, if the folded time series data still does not meet the dimension that the encoder can process, the folded time series data can be further encoded into a model dimension that the encoder can process, which is not limited in this embodiment of the present application.

[0088] In step S202, multiple encoders are used to encode multiple groups of historical time series data respectively to obtain multiple historical time series features corresponding to each group of historical time series data. Each historical time series feature represents the relative position information and change trend information of each group of historical time series data within the target time window.

[0089] The number of encoders can depend on the number of groups of historical time series data. Using multiple encoders to simultaneously encode multiple groups of historical time series data can improve encoding efficiency, thereby improving the prediction efficiency of time series data. The encoders can extract and preserve the relative position information and change trend information in the historical time series data. This allows the decoder to comprehensively utilize the relative position information and change trend information from multiple historical time series features for prediction, resulting in more accurate prediction results for long-term time series prediction tasks.

[0090] Among them, the relative position information represents the relative position relationship of the historical time series data at each time point in the target time window, or in other words, the contextual relationship between the historical time series data at each time point; the change trend information represents the change trend of the historical time series data at each time point in the target time window, for example, the change trends of multiple groups of historical time series data shown by the curve in Figure 3 within the target time window, that is, the change trend information corresponding to each group of historical time series data can represent the change trend shown by the curve in each target time window in Figure 3.

[0091] Figure 4 shows a structural schematic diagram of an encoder according to an embodiment of the present application. As shown in Figure 4, the encoder may include multiple encoding layers, each encoding layer may include a feedforward network module and a multi-head self-attention mechanism module, wherein the feedforward network module may include at least one of the following: a convolution (CONV) unit, a fully connected unit (also known as dense projection), a Fourier transform convolution (FFT CONV) unit, an inverse Fourier transform (iFFT, also known as inverse Fourier transform) unit, a random deactivation (dropout) unit and multiple activation function units; the multi-head self-attention mechanism module may include at least one of the following: a skip connection unit, i.e., "+", a normalization (layer norm) unit, and a multi-head self-attention mechanism (Multi-head Self-attention) unit.

[0092] Among them, the convolution unit is used to perform convolution processing on the input, the fully connected unit is used to perform dense mapping processing on the input, the Fourier transform convolution unit is used to perform Fourier transform and convolution processing on the input features, the inverse Fourier transform unit is used to perform inverse Fourier transform on the input, the random deactivation unit is used to randomly deactivate some nodes in the encoder to optimize the encoder to prevent the encoder from overfitting, and the activation function unit is used to activate the input using an activation function (such as Gelu function, Relu function, etc.). It should be understood that other units in the feedforward network module except the Fourier transform convolution unit may be optional units. Those skilled in the art can adaptively adjust the model structure of the feedforward network module under the guidance of the embodiments of the present application, for example, they can remove the random deactivation unit, etc., or add any processing unit known in the art, and the embodiments of the present application are not limited to this.

[0093] The use of FFT CONV in the encoder can make the sequence length of the input time series data flexible and variable, and at the same time enable the FFT CONV structure to extract the feature information of the input data in the frequency domain, while still maintaining the order information of the original time series data; among them, the Fourier transform of FFT CONV can convert the input data from the time domain to the frequency domain, and then the one-dimensional convolution operator (including the parameters obtained through training) integrates, enhances and other convolution processes on the data in the frequency domain space, and then the inverse Fourier transform (iFFT) unit can be used to restore the frequency domain features to time domain features. The feedforward network module using FFT CONV can use the frequency information of the input data in the frequency domain to establish connections between similar frequency components, thereby breaking through the limitation of the traditional convolution model that requires fixed input and output sizes.

[0094] As shown in FIG5 , the processing process of the FFT CONV unit may include: first, performing Fourier transform FFT processing on the input time domain data, and then inputting the transformed data into a standard one-dimensional convolution kernel. The convolution operator using the one-dimensional convolution kernel can achieve flexible and variable input and output sequence lengths. Due to the nature of convolution, the FFT CONV unit can be used to capture the relationship between similar frequency signal intensities in the frequency domain while still maintaining the order information of the original time series data. Of course, standard time-based convolution can also be used to extract the correlation of the time series within each cycle, so that the correlation information is not lost in the subsequent processing process.

[0095] It should be noted that the Fourier transform mentioned in the embodiments of the present application may include but is not limited to various Fourier transform operations such as discrete Fourier transform (such as fast Fourier transform) and continuous Fourier transform. Those skilled in the art can design the Fourier transform operation used in the encoder according to actual needs, and the embodiments of the present application do not limit this.

[0096] Among them, the multi-head self-attention mechanism module is used to generate historical time series features using the multi-head self-attention mechanism. Specifically, the first jump connection in the module is used to add the input of the encoding layer to the features output by the feedforward network module, and then input the features after the jump connection to the first normalization unit. The second jump connection is used to add the features output by the first normalization unit to the features output by the multi-head self-attention mechanism unit, and then input the features after the jump connection to the second normalization unit; each normalization unit is used to normalize the input; and the multi-head self-attention mechanism unit is used to perform multi-head self-attention processing on the input. It should be understood that other units in the multi-head self-attention mechanism module except the multi-head self-attention mechanism unit may be optional units. Those skilled in the art can adaptively adjust the model structure of the multi-head self-attention mechanism module based on the enlightenment of the embodiments of the present application, for example, they can remove the jump connection unit, or add any processing unit known in the art, and the embodiments of the present application are not limited to this.

[0097] It should be understood that the first coding layer input of each encoder is historical time series data, the second coding layer input is the output of the first coding layer, and so on. The i-th coding layer input is the output of the i-1-th coding layer, and i is greater than or equal to 2 and less than the total number of coding layers; wherein, the encoding processing process of each coding layer is similar, and the features output by the last coding layer of the encoder can be used as historical time series features.

[0098] Based on the encoder shown in FIG3 above, multiple encoders are used to encode multiple groups of historical time series data respectively to obtain multiple historical time series features corresponding to each group of historical time series data, including: for the encoder corresponding to any group of historical time series data, the historical time series data is input into the feedforward network module of the encoder, and the intermediate time series features are output; the intermediate time series features and the historical time series data are input into the multi-head self-attention mechanism module, and the historical time series features corresponding to the historical time series data are output. It should be understood that the encoding process can include the encoding process of the first encoding layer. For other encoding layers, the output features of the i-1th encoding layer can be used as the historical time series data input to the i-th encoding layer, and at least one round of the above encoding process can be performed, and the output features of the last encoding are used as the historical time series features output by the encoder. In this way, the encoder can be used to effectively extract relative position information and change trend information in the historical time series data.

[0099] It should be noted that the encoder shown in Figure 4 is a possible implementation method provided by the embodiment of the present application. In fact, those skilled in the art can also use other encoders known in the art to encode historical time series data, as long as the above-mentioned historical time series features can be extracted. This embodiment of the present application does not limit this.

[0100] Step S203: Use the decoder to determine the predicted time series data corresponding to the target object in the prediction time window based on multiple historical time series features and current time series data. The predicted time series data includes the predicted behavior data of the target object at multiple time points within the prediction time window.

[0101] In practical applications, a structure in which one decoder corresponds to multiple encoders can be adopted, and one decoder is used to determine the predicted time series data corresponding to the target object in the prediction time window based on multiple historical time series features and current time series data; alternatively, a structure in which multiple decoders correspond to multiple encoders can be adopted, that is, each decoder can be responsible for the prediction of part of the time series data, and this embodiment of the present application does not limit this.

[0102] Among them, the decoder may include multiple decoding layers, and the historical time series features output by each of the above encoders may include multiple sub-time series features, or multiple projections, wherein the total number of sub-time series features in each historical time series feature = the total number of decoding layers in the decoder, and the sub-time series features in the multiple historical time series features can be provided to the corresponding decoding layers respectively, that is, the encoder outputs part of the feature information of the historical time series data to different encoding layers of the decoder respectively, thereby providing an effective basis for the decoder to predict the time series for a period of time in the future, and can retain the sequential information of the time series data, perceive the changing trend of long-term time series data, and reduce the impact of cumulative errors. For example, if 4 encoders are used to encode the historical time series data of the past D = 4 days, and the decoder has J = 8 decoder layers, then all 4 encoders will output a total of 4*8 = 32 dense projections (that is, sub-time series features).

[0103] Based on this, in one possible implementation, if the encoder is set to include J decoding layers, each historical time series feature includes J sub-time series features, where J is a positive integer, and the decoder is used to determine the predicted time series data corresponding to the target object in the prediction time window based on multiple historical time series features and current time series data, including:

[0104] Input the current time series data and the first sub-time series feature of each historical time series feature into the first decoding layer of the decoder, and output the first predicted time series feature;

[0105] Input the j-1th predicted time series feature output by the j-1th decoding layer and the j-th sub-time series feature of each historical time series feature into the j-th decoding layer of the decoder, and output the j-th predicted time series feature, j∈[2,J];

[0106] The predicted time series data is determined according to the J-th predicted time series feature output by the J-th decoding layer of the decoder and the prediction time window.

[0107] The above determination process is explained with the decoder shown in FIG6 . As shown in FIG6 , the decoder may include multiple decoding layers, each decoding layer including a feedforward network module, a multi-head self-attention mechanism module and a long-cycle attention mechanism module; wherein, the structure of the feedforward network module and the multi-head self-attention mechanism module in the decoder may be the same as that of the encoder shown in FIG4 , and will not be described in detail here; wherein, the feedforward network module and the multi-head self-attention mechanism module of the first decoding layer of the decoder input the current time series data, and starting from the second decoding layer, the feedforward network module and the multi-head self-attention mechanism of the jth decoding layer input the features output by the j-1th decoding layer; And, the long-term attention mechanism module of each decoding layer inputs the features output by the multi-head self-attention mechanism module and the multiple sub-time series features corresponding to each decoding layer in the multiple historical time series features. For example, the long-term attention mechanism module of the first decoding layer inputs the features output by the multi-head self-attention mechanism module of the first decoding layer (equivalent to Q) and the first sub-time series features of the multiple historical time series features (equivalent to K and V). And so on. For example, the various sub-time series features of the historical time series features output by the last decoding layer of a decoder in Figure 6 will be densely mapped (that is, fully connected) and projected to each corresponding decoding layer of the decoder.

[0108] Figure 7 shows a schematic diagram of the processing process of the long-term attention mechanism module according to an embodiment of the present application. As shown in Figure 7, t represents the current time period, T represents the period unit (for example, "day"), tT to t-5T represent 5 historical time periods, and the sub-time series features of the historical sequence features corresponding to each historical time period are used as the key K (key) and value V (value) of the attention mechanism. The encoded time series features obtained after the feedforward network module and the multi-head self-attention mechanism module encode the current time series data corresponding to the current time period t are used for query Q (query). The similarity between the query Q and each key K is then calculated using the dot product method, and each similarity is normalized using the softmax function to output the attention score (that is, attention weight) corresponding to each key K. Then, based on the attention weight corresponding to each key K, multiple sub-time series features (that is, multiple values ​​V = key K) are weighted and summed to obtain the predicted time series features output by the long-term attention mechanism module.

[0109] The long-term attention mechanism described above allows each encoded historical time series feature to be used as the K and V of the attention mechanism, while the encoded time series features of the current time series data serve as the query V. Therefore, the output of this long-term attention can be understood as a weighted sum of multiple historical time series features. Each decoding layer of the decoder receives the key K and value V from the encoder as the projection basis, and the attention is calculated based on the historical sequence features of the past few days, rather than the time series features of each past time point. This undoubtedly preserves the orderliness of the original time series data. In other words, under the premise that the data periodicity is known (for example, periodic data related to people's diurnal activities), by extracting historical time series feature information of the past several historical periods, the traffic trend over a long period of several days or weeks can be obtained. The key K and value V of each historical time series data can be output, and the effective feature information of the current time period (that is, the time period to be predicted) after FFT convolution is used as the Q value to query the K value in all historical time periods, and the similarity between the historical time period and the current time period is calculated by dot product. After normalization processing by the softmax function, different attention weights based on different historical time periods are obtained, and the values ​​V of multiple historical time periods are weighted and summed using different attention weights to obtain the predicted time series data of a prediction time window in the current time period. By utilizing the above-mentioned long-period attention mechanism, the decoder can use only shorter-length time series for reasoning during inference, without having to use the time series of the entire time period as input; unlike the traditional attention mechanism, this long-period attention mechanism retains the relative position information on the time series; unlike the traditional autoregressive model, this long-period attention mechanism will greatly reduce the impact of cumulative errors and make more accurate predictions; this long-period attention mechanism can search and learn the similarities between the current time series data sequence of the current time period and the historical time series data of the historical time period, and predict the size of future time series data on a larger scale.

[0110] Based on Figures 6 and 7 above, the current time series data and the first sub-time series feature of each historical time series feature are input into the first decoding layer of the decoder, and the first predicted time series feature is output, including: encoding the current time series data to obtain the first encoded time series feature; determining the attention weight corresponding to the first sub-time series feature of each historical time series feature according to the similarity between the first sub-time series feature of each historical time series feature and the first encoded time series feature; and performing weighted summation on the first sub-time series feature of each historical time series feature according to the attention weight corresponding to the first sub-time series feature of each historical time series feature to obtain the first predicted time series feature.

[0111] And, the above-mentioned input of the j-1th predicted time series feature output by the j-1th decoding layer and the jth sub-time series feature of each historical time series feature into the j-th decoding layer of the decoder, and outputting the j-th predicted time series feature, includes: encoding the j-1th predicted time series feature to obtain the j-th encoded time series feature; determining the attention weight corresponding to the j-th sub-time series feature of each historical time series feature according to the similarity between the j-th sub-time series feature of each historical time series feature and the j-th encoded time series feature; and performing weighted summation of the j-th sub-time series features of each historical time series feature according to the attention weight corresponding to the j-th sub-time series feature of each historical time series feature to obtain the j-th predicted time series feature.

[0112] Among them, the current time series data can be encoded using the feedforward network module and the multi-head self-attention mechanism module of the first decoding layer of the decoder to obtain the first encoded time series feature; and the j-1th predicted time series feature can be encoded using the feedforward network module and the multi-head self-attention mechanism module of the jth decoding layer to obtain the jth encoded time series feature. It should be understood that the encoding of the current time series data and the j-1th predicted time series feature can be achieved by referring to the specific encoding method in the feedforward network module and the multi-head self-attention mechanism module in the above-mentioned encoder, which will not be repeated here.

[0113] Among them, each decoding layer can refer to the specific implementation method of the long-term attention mechanism module shown in Figure 7 to realize the determination of the attention weights corresponding to the sub-time series features of each historical time series feature according to the similarity between the sub-time series features of each historical time series feature and the encoding time series feature; according to the attention weights corresponding to the sub-time series features of each historical time series feature, the sub-time series features of each historical time series feature are weighted and summed to obtain the predicted time series feature. It should be understood that those skilled in the art can adopt the similarity calculation method known in the art to calculate the similarity between the encoding time series feature and each sub-time series feature, and this embodiment of the present application is not limited to this. After calculating the similarity between the encoding time series feature and each sub-time series feature, the softmax function can be used to normalize the similarity to the [0,1] interval to obtain the attention weight corresponding to each sub-time series feature, and then based on the attention weight, each sub-time series feature is weighted and summed to obtain the predicted time feature.

[0114] It should be understood that since the attention weight is equivalent to being calculated based on the sub-time series features of the past few days, this retains the orderliness of the historical time series data, so that only shorter-length historical time series data can be used to predict behavioral data in a certain time period in the future, without the need to use the complete historical time series data in the entire historical time period as input. At the same time, it can reduce the impact of cumulative errors, and can search for the similarity between the current time series of the current time period and the historical time series of the historical time period, so that the time series data in a certain time period in the future can be predicted on a larger time scale.

[0115] In practical applications, since the periodic prediction of long-period time series data inevitably requires the extraction of historical time series features in the past few periods, it is also possible to use methods such as variance mean and multi-layer perceptron (MLP) to predict the trend direction of the next period on a large scale. The long-period attention module of the embodiment of the present application uses the attention mechanism to learn the similarity of several time series data in the historical period, which can obtain better time series prediction accuracy compared with the above methods.

[0116] Taking into account that the size (including scale, dimension, etc.) of the Jth predicted time series feature output by the Jth decoding layer of the decoder may be inconsistent with the original time series data, the Jth predicted time series feature output by the Jth decoding layer can be mapped back to a predicted time series feature of the same size as the historical time series data, for example, the high-dimensional predicted time feature is mapped back to a two-dimensional predicted time series feature, and then based on the above-mentioned preset folding rate, the mapped predicted time series feature is expanded into a predicted time series feature of the same dimension as the original time series data, for example, the two-dimensional predicted time series feature is expanded to a one-dimensional predicted time series feature to match the data format of the original time series data.

[0117] Also, since the historical time series data is selected based on the target time window, the predicted time series features determined using the historical time series features are converted into a one-dimensional sequence, and the sequence length may be the same as the historical time series data, and the user may only need the predicted time series features within the predicted time window as the predicted time series data. Therefore, based on the above-mentioned prediction time window, the time series features in the predicted time series features that are within the above-mentioned prediction time window can be selected as the predicted time series data.

[0118] Based on this, the above-mentioned determination of the predicted time series data based on the J-th predicted time series feature output by the J-th decoding layer of the decoder and the predicted time window may include: mapping the J-th predicted time series feature back to a predicted time series feature of the same size as the historical time series data; based on the above-mentioned preset folding rate, expanding the mapped predicted time series feature into a predicted time series feature of the same dimension as the original time series data; based on the predicted time window, selecting part of the predicted time series features within the above-mentioned prediction time window from the expanded predicted time series features as the predicted time series data. It should be understood that if the original time series data is not folded with the folding rate in the above-mentioned step S201, part of the predicted time series features within the above-mentioned prediction time window may be directly selected from the mapped predicted time series features as the predicted time series data based on the prediction time window.

[0119] Based on the above steps S201 to S203, the embodiment of the present application further provides a framework diagram of a time series data prediction system as shown in FIG8 . As shown in FIG8 , it is assumed that three encoders are used, three decoding layers are used in the decoder, and the current original time series data of today t and the historical original time series data of the past three days (including the data from the t-1 day to the t-3 day) are used; first, based on a preset folding rate, the original time series data (including the historical original time series data of the past three days and the current original time series data of today) are folded respectively to obtain the folded time series data (including the historical time series data of the past three days and the current time series data); the folded time series data can also be encoded in advance into After the encoder has the model dimensions that can be processed, each group of historical time series data with the model dimensions is input into the corresponding encoder. Each encoder encodes each historical time series data and outputs the sub-time series features in the encoded historical time series features to different decoding layers of the decoder respectively. The sub-time series features are used as the input of the long-term attention mechanism model in the above-mentioned decoder, and the current time series data is input into the decoder at the same time, and the decoder is used to complete the prediction of the time series data within the prediction time window; after obtaining the predicted time features output by the decoder, the predicted time series features can also be expanded to predicted time series features of the same dimension as the original time series data based on the above-mentioned folding rate to match the data format of the original time series data.

[0120] As shown in Figure 8, the encoder and decoder form a many-to-one layered link architecture, meaning multiple encoders correspond to one decoder and one encoder layer in the decoder. Each encoder uses folded historical time series data from a target time window across multiple historical time periods as input. The encoder extracts historical time series features through at least Fourier transform convolution (FFT CONV) in the encoder, a process known as encoding. After encoding, each encoder outputs a portion of the historical time series features to different decoding layers of the decoder as input to the long-term attention mechanism of each decoding layer. After the historical time series feature information is provided to the decoder, the current time series data sequence within the current time window is input to the decoder to complete the prediction of time series data for a period of time in the future. Multiple encoders can learn and retain the local relative position information and global change trend information of historical time series data from several days. The decoder can then perform a comprehensive assessment of the historical time series features of historical time series data from the same historical period over multiple days, making the prediction of fine-grained time series data over long periods (e.g., days or weeks) more accurate and efficient.

[0121] As described above, the target object includes user requests; the behavior data includes the request traffic of the user requests, and the predicted time series data includes the request traffic predicted by the user requests at multiple time points within the prediction time window; in one possible implementation, after obtaining the predicted time series data, the method further includes: scheduling the computing resources used to process the user requests according to the request traffic predicted by the user requests at multiple time points within the prediction time window, so that the scheduled computing resources adapt to the predicted request traffic. Among them, the computing resources can be scheduled in advance before the arrival of the prediction time window. In this way, the request traffic of the user requests can be predicted, and the changing trend of the traffic can be considered in three dimensions: long time series (weeks, months), periodicity (days), and real-time, to achieve more accurate fine-grained long-term time series prediction, which can reduce the number of cold starts of the cloud platform, bring low response latency to user requests, and reduce the waste of computing resources on the platform side.

[0122] As described above, the target object includes the traffic area; the behavior data includes the traffic volume in the traffic area; the predicted time series data includes the traffic volume predicted for the traffic area at multiple time points within the prediction time window; after obtaining the predicted time series data, the method further includes: adjusting the traffic signal timing scheme of the traffic lights in the traffic area within the prediction time window in advance according to the traffic volume predicted for the traffic area at multiple time points within the prediction time window, so that the adjusted traffic signal timing scheme adapts to the predicted traffic volume. Among them, the traffic signal timing scheme of the traffic lights can be adjusted in advance before the arrival of the prediction time window. In this way, the traffic volume in the traffic area can be predicted and the traffic signal configuration scheme can be adjusted according to the predicted traffic volume, so that the adjusted traffic signal timing scheme adapts to the predicted traffic volume, which can make the traffic in the entire traffic area smooth, increase the traffic flow rate and reduce traffic congestion.

[0123] According to an embodiment of the present application, based on the prediction time window and the current time window, it is possible to a priori know which time series data in the historical time period are important; then, multiple encoders are used to respectively use the historical time series data of the target time windows of multiple historical time periods as input, and after encoding, the relative position information and change trend information of the historical time series data are output to different coding layers of the decoder, so as to provide the decoder with an effective basis for time series prediction for a period of time in the future, that is, to use the important historical sequence data in each past target time window to predict the sequence trend of the prediction time window in the current time period, so that fine-grained long-period time series prediction can be achieved efficiently and accurately without using all the historical time series data in the historical time period.

[0124] According to the time series data prediction method of the embodiment of the present application, it is equivalent to using the historical time series data in the same target time window in multiple historical time periods in the past to predict a time window in the future; wherein, the folding technology of time series data can significantly reduce the training time of the entire prediction model (including the encoder and decoder), and improve the data throughput and reasoning efficiency of the entire prediction model in the reasoning process. This means that the time series data folded at a preset folding rate (for example, F = 60 of data per second converts a period of 86,400 days in length into a period of 1,440 days) may not be able to support the entire prediction model to ingest all the historical time series data of the past several historical time periods, so the prediction model can receive short time series data centered on the current time point, and at the same time use the historical time series data in the same target time window of several historical days as the reasoning input of the model.

[0125] According to the time series data prediction method of the embodiment of the present application, the upcoming time series data such as request traffic and vehicle traffic are predicted through the historical time series data of multiple historical time periods within the same target time window. Among them, folding the original time series data can increase the amount of data (throughput) that can be input to the entire prediction model and speed up the training speed; secondly, multiple encoders are used to encode the historical period data, and the obtained local sequence feature information is transmitted to the different encoding layers of the decoder in a dispersed manner; the FFT convolution structure is used inside the encoder and decoder to make the input time series length flexible and variable, and at the same time, the FFT convolution structure can extract all the feature information of the input data; finally, the long-term attention mechanism is used to enable the decoder to retain the order information of the input sequence, perceive the long-term traffic trend, and reduce the cumulative error compared to the traditional autoregressive model.

[0126] According to the time series data prediction method of the embodiment of the present application, it can be used for user traffic prediction of various user-oriented cloud platforms. When user requests have a certain periodic pattern, such as the traffic trend is consistent with the human activity schedule, the time series data prediction method of the embodiment of the present application can be used to more accurately predict the traffic size of a future prediction time window, and more accurately prepare function instances, containers and other computing resources based on this data, and can return the processing results required by the user with lower processing latency, while reducing the waste of resources caused by multiple container expansions.

[0127] According to the time series data prediction method of the embodiment of the present application, it can also be applied to various container management platforms (such as Kubernetes): considering that the platform is user-oriented and the traffic has a periodicity with "days" as the unit, various management platforms with functions as the minimum granularity or containers as the minimum granularity can deploy the time series data prediction method of the embodiment of the present application, so as to achieve the effect of pulling up function instances in advance to avoid container cold start and reduce platform reserved instances.

[0128] FIG9 shows a structural diagram of a time series data prediction device according to an embodiment of the present application. The device can be used in the time series data prediction system 100 described above. As shown in FIG9 , the device includes:

[0129] Acquisition module 901 is used to acquire, for a prediction time window set for a target object to be predicted within a current time period, current time series data collected within a current time window adjacent to the prediction time window within the current time period, and multiple groups of historical time series data collected within the same target time window of multiple historical time periods, wherein the target time window includes the prediction time window and the current time window, and the time series data includes behavior data of the target object occurring at multiple time points within the time window;

[0130] The encoding module 902 is configured to respectively encode the multiple groups of historical time series data using multiple encoders to obtain multiple historical time series features corresponding to each of the multiple groups of historical time series data, where each historical time series feature represents the relative position information and change trend information of each group of historical time series data within the target time window;

[0131] The decoding module 903 is used to use the decoder to determine the predicted time series data corresponding to the target object in the predicted time window based on the multiple historical time series features and the current time series data. The predicted time series data includes the predicted behavior data of the target object at multiple time points within the prediction time window.

[0132] According to an embodiment of the present application, based on the prediction time window and the current time window, it is possible to a priori know which time series data in the historical time period are important; then, multiple encoders are used to respectively use the historical time series data of the target time windows of multiple historical time periods as input, and after encoding, the relative position information and change trend information of the historical time series data are output to different coding layers of the decoder, so as to provide the decoder with an effective basis for time series prediction for a period of time in the future, that is, to use the important historical sequence data in each past target time window to predict the sequence trend of the prediction time window in the current time period, so that there is no need to use all the historical time series data in multiple historical time periods, and fine-grained long-period time series prediction can be achieved efficiently and accurately.

[0133] In one possible implementation, the decoder includes J decoding layers, each historical time series feature includes J sub-time series features, J is a positive integer, and the decoder is used to determine the predicted time series data corresponding to the target object in the predicted time window based on the multiple historical time series features and the current time series data, including: inputting the current time series data and the first sub-time series feature of each historical time series feature into the first decoding layer of the decoder, and outputting the first predicted time series feature; inputting the j-1th predicted time series feature output by the j-1th decoding layer and the jth sub-time series feature of each historical time series feature into the jth decoding layer of the decoder, and outputting the jth predicted time series feature, j∈[2,J]; determining the predicted time series data based on the Jth predicted time series feature output by the Jth decoding layer of the decoder and the prediction time window.

[0134] According to an embodiment of the present application, by providing the sub-time series features of multiple historical time series features to the corresponding decoding layers respectively, that is, the encoder outputs part of the feature information of the historical time series data to different encoding layers of the decoder respectively, thereby providing an effective basis for the decoder to predict the time series for a period of time in the future, being able to retain the sequential information of the historical time series data, perceive the changing trend of long-term time series data, and reduce the impact of cumulative errors.

[0135] In one possible implementation, the current time series data and the first sub-time series feature of each historical time series feature are input into the first decoding layer of the decoder, and the first predicted time series feature is output, including: encoding the current time series data to obtain the first encoded time series feature; determining the attention weight corresponding to the first sub-time series feature of each historical time series feature based on the similarity between the first sub-time series feature of each historical time series feature and the first encoded time series feature; and performing weighted summation of the first sub-time series features of each historical time series feature based on the attention weight corresponding to the first sub-time series feature of each historical time series feature to obtain the first predicted time series feature.

[0136] According to the embodiments of the present application, the decoder can use only a shorter length of time series for reasoning, without using a time series of a complete time period as input; it can retain the relative position information on the time series, greatly reduce the impact of cumulative errors, and make more accurate predictions. It can search and learn the similarity between the current time series data sequence of the current time period and the historical time series data of the historical time period, and predict the size of future time series data on a larger scale.

[0137] In one possible implementation, the j-1th predicted time series feature output by the j-1th decoding layer and the j-th sub-time series feature of each historical time series feature are input into the j-th decoding layer of the decoder to output the j-th predicted time series feature, including: encoding the j-1th predicted time series feature to obtain the j-th encoded time series feature; determining the attention weights corresponding to the j-th sub-time series features of each historical time series feature according to the similarity between the j-th sub-time series features of each historical time series feature and the j-th encoded time series feature; and performing weighted summation of the j-th sub-time series features of each historical time series feature according to the attention weights corresponding to the j-th sub-time series features of each historical time series feature to obtain the j-th predicted time series feature.

[0138] According to the embodiments of the present application, the decoder can use only a shorter length of time series for reasoning, without using a time series of a complete time period as input; it can retain the relative position information on the time series, greatly reduce the impact of cumulative errors, and make more accurate predictions. It can search and learn the similarity between the current time series data sequence of the current time period and the historical time series data of the historical time period, and predict the size of future time series data on a larger scale.

[0139] In one possible implementation, the encoder includes a feedforward network module and a multi-head self-attention mechanism module, the feedforward network module includes a Fourier transform convolution unit, the Fourier transform convolution unit is used to perform Fourier transform and convolution processing on the input features, and the multi-head self-attention mechanism module is used to generate historical time series features using the multi-head self-attention mechanism; wherein, the use of multiple encoders to respectively encode the multiple groups of historical time series data to obtain multiple historical time series features corresponding to each of the multiple groups of historical time series data includes: for the encoder corresponding to any group of historical time series data, the historical time series data is input into the feedforward network module of the encoder, and the intermediate time series features are output; the intermediate time series features and the historical time series data are input into the multi-head self-attention mechanism module, and the historical time series features corresponding to the historical time series data are output.

[0140] According to an embodiment of the present application, the use of Fourier transform convolution processing in the encoder can make the sequence length of the input time series data flexible and variable, while extracting the characteristic information of the input data in the frequency domain and still maintaining the sequence information of the input time series data; in particular, the frequency information of the input time series data in the frequency domain can be used to establish connections between similar frequency components, thereby breaking through the limitation of the traditional convolution model that requires fixed input and output sizes.

[0141] In a possible implementation, the obtaining of the current time series data collected in the current time window adjacent to the current time window before the prediction time window in the current time period includes: obtaining the current original time series data collected in the current time window, and folding the current original time series data into at least two-dimensional current time series data based on a preset folding rate, wherein the folding rate is used to indicate the scale of the folded sequence data in different dimensions, and the dimension of the current time series data is larger than the current original time series data; the obtaining of multiple groups of historical time series data collected in the same target time window of multiple historical time periods includes: obtaining each group of historical original time series data collected in the same target time window in each historical time period, and folding each group of historical original time series data into at least two-dimensional historical time series data based on the preset folding rate, and the dimension of the historical time series data is larger than the historical original time series data.

[0142] According to the embodiments of the present application, the memory footprint of the entire prediction model (including the encoder and decoder) can be improved, enabling the encoder and decoder to process longer time series data and increasing the sequence length that the model can consume, which is equivalent to increasing the parallel computing capacity of the model, that is, having a larger data throughput, thereby improving the processing efficiency of subsequent encoders and decoders. At the same time, no downsampling operations are required, which is conducive to ensuring the accuracy of time series prediction.

[0143] In one possible implementation, the target object includes a user request; the behavior data includes the request traffic of the user request, and the predicted time series data includes the request traffic predicted for the user request at multiple time points within the prediction time window; after obtaining the predicted time series data, the device also includes: a scheduling module for scheduling computing resources for processing the user request based on the request traffic predicted for the user request at multiple time points within the prediction time window, so that the scheduled computing resources adapt to the predicted request traffic.

[0144] According to the embodiments of the present application, predictions can be made on the request traffic of user requests, and the changing trends of traffic can be considered in three dimensions: long time series (weeks, months), periodicity (days), and real-time, to achieve more accurate fine-grained long-period time series predictions, which can reduce the number of cold starts of the cloud platform, bring low response latency to user requests, and reduce the waste of computing resources on the platform side.

[0145] In one possible implementation, the target object includes a traffic area; the behavior data includes the traffic flow in the traffic area; the predicted time series data includes the traffic flow predicted for the traffic area at multiple time points within the prediction time window; after obtaining the predicted time series data, the device further includes: an adjustment module for adjusting the traffic signal timing scheme of the traffic lights in the traffic area within the prediction time window according to the traffic flow predicted for the traffic area at multiple time points within the prediction time window, so that the adjusted traffic signal timing scheme adapts to the predicted traffic flow.

[0146] According to the embodiments of the present application, the traffic flow in the traffic area can be predicted and the traffic signal configuration plan can be adjusted based on the predicted traffic flow, so that the adjusted traffic signal timing plan adapts to the predicted traffic flow, which can make the traffic in the entire traffic area smooth, increase the traffic flow rate and reduce traffic congestion.

[0147] An embodiment of the present application provides a time series data prediction device, comprising: a processor and a memory for storing processor-executable instructions; wherein the processor is configured to implement the above method when executing the instructions.

[0148] An embodiment of the present application provides a non-volatile computer-readable storage medium having computer program instructions stored thereon, wherein the computer program instructions implement the above method when executed by a processor.

[0149] An embodiment of the present application provides a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above method.

[0150] Figure 10 shows a block diagram of an electronic device 1300 according to an embodiment of the present application. As shown in Figure 10 , the electronic device 1300 can be a server or a terminal device, performing the functions of the time series data prediction method shown in any of Figures 2-8 above. The electronic device 1300 includes at least one processor 1801, at least one memory 1802, and at least one communication interface 1803. In addition, the electronic device may also include common components such as an antenna, which will not be described in detail here.

[0151] The following is a detailed introduction to the various components of the electronic device 1300 with reference to FIG. 10 .

[0152] Processor 1801 may be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the above program. Processor 1801 may include one or more processing units. For example, processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors.

[0153] The communication interface 1803 is used to communicate with other electronic devices or communication networks, such as Ethernet, Radio Access Network (RAN), core network, Wireless Local Area Networks (WLAN), etc.

[0154] The memory 1802 may be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, an optical disc storage (including a compact disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory may exist independently and be connected to the processor via a bus. The memory may also be integrated with the processor.

[0155] The memory 1802 is used to store application code for executing the above solution, and the execution is controlled by the processor 1801. The processor 1801 is used to execute the application code stored in the memory 1802.

[0156] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0157] A computer-readable storage medium may be a tangible device that can hold and store instructions for use by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disc (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination thereof.

[0158] The computer-readable program instructions or codes described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions to be stored in the computer-readable storage medium in each computing / processing device.

[0159] The computer program instructions for performing the operations of the present application may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, by utilizing the state information of computer-readable program instructions to personalize an electronic circuit, such as a programmable logic circuit, a field-programmable gate array (FPGA), or a programmable logic array (PLA), the electronic circuit can execute the computer-readable program instructions, thereby implementing various aspects of the present application.

[0160] Various aspects of the present application are described herein with reference to flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present application. It should be understood that each block of the flowcharts and / or block diagrams, and combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer-readable program instructions.

[0161] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device is generated that implements the functions / actions specified in one or more blocks in the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium, where these instructions cause the computer, programmable data processing device, and / or other device to operate in a specific manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing various aspects of the functions / actions specified in one or more blocks in the flowchart and / or block diagram.

[0162] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device, so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more blocks in the flowchart and / or block diagram.

[0163] The flow charts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, systems, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a part for a module, program segment or instruction, and the part for the module, program segment or instruction comprises one or more executable instructions for realizing the logical function of the specification. In some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous boxes can actually be performed substantially in parallel, and they can sometimes also be performed in the opposite order, depending on the function involved.

[0164] It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart, can be implemented by hardware (such as a circuit or ASIC (Application Specific Integrated Circuit)) that performs the corresponding function or action, or can be implemented by a combination of hardware and software, such as firmware.

[0165] Although the present invention is described herein in conjunction with various embodiments, in the process of implementing the claimed invention, those skilled in the art can understand and implement other variations of the disclosed embodiments by reviewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude multiple situations. A single processor or other unit can implement several functions listed in the claims. Certain measures are recorded in different dependent claims, but this does not mean that these measures cannot be combined to produce good results.

[0166] The embodiments of the present application have been described above. The above description is illustrative and not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope of the described embodiments. The terminology used herein is selected to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons skilled in the art to understand the embodiments disclosed herein.

Claims

1. A time series data prediction method, It is characterized in that include: For a prediction time window set for a target object to be predicted within a current time period, obtain current time series data collected within a current time window located before and adjacent to the prediction time window within the current time period, and obtain multiple groups of historical time series data collected respectively within the same target time window of multiple historical time periods, wherein the target time window includes the prediction time window and the current time window, and the time series data includes behavior data of the target object at multiple time points within the time window; Using multiple encoders to encode the multiple groups of historical time series data respectively, to obtain multiple historical time series features corresponding to the multiple groups of historical time series data, each historical time series feature represents the relative position information and change trend information of each group of historical time series data within the target time window; The decoder is used to determine the predicted time series data corresponding to the target object in the predicted time window based on the multiple historical time series features and the current time series data. The predicted time series data includes the predicted behavior data of the target object at multiple time points within the predicted time window.

2. The method according to claim 1, It is characterized in that The decoder includes J decoding layers, each historical time series feature includes J sub-time series features, J is a positive integer, and the decoder is used to determine the predicted time series data corresponding to the target object in the predicted time window according to the multiple historical time series features and the current time series data, including: Inputting the current time series data and the first sub-time series feature of each historical time series feature into the first decoding layer of the decoder, and outputting the first predicted time series feature; Input the j-1th predicted time series feature output by the j-1th decoding layer and the j-th sub-time series feature of each historical time series feature into the j-th decoding layer of the decoder, and output the j-th predicted time series feature, j∈[2,J]; The predicted time series data is determined according to the J-th predicted time series feature output by the J-th decoding layer of the decoder and the prediction time window.

3. The method according to claim 2, It is characterized in that The step of inputting the current time series data and the first sub-time series feature of each historical time series feature into the first decoding layer of the decoder and outputting the first predicted time series feature comprises: Encode the current time series data to obtain a first encoded time series feature; Determining the attention weights corresponding to the first sub-temporal features of each historical temporal feature according to the similarities between the first sub-temporal features of each historical temporal feature and the first encoded temporal feature; According to the attention weights corresponding to the first sub-time series features of each of the historical time series features, the first sub-time series features of each of the historical time series features are weighted summed to obtain the first predicted time series feature.

4. The method according to claim 2, It is characterized in that The step of inputting the j-1th predicted time series feature output by the j-1th decoding layer and the j-th sub-time series feature of each historical time series feature into the j-th decoding layer of the decoder, and outputting the j-th predicted time series feature, comprises: Encoding the j-1th predicted time series feature to obtain a jth encoded time series feature; Determine the attention weight corresponding to each j-th sub-time series feature of each historical time series feature according to the similarity between the j-th sub-time series feature of each historical time series feature and the j-th encoding time series feature; According to the attention weights corresponding to the j-th sub-time series features of the various historical time series features, the j-th sub-time series features of the various historical time series features are weighted summed to obtain the j-th predicted time series feature.

5. The method according to claim 1, It is characterized in that The encoder includes a feedforward network module and a multi-head self-attention mechanism module, the feedforward network module includes a Fourier transform convolution unit, the Fourier transform convolution unit is used to perform Fourier transform and convolution processing on input features, and the multi-head self-attention mechanism module is used to generate historical time series features using the multi-head self-attention mechanism; The method of encoding the multiple sets of historical time series data using multiple encoders to obtain multiple historical time series features corresponding to the multiple sets of historical time series data includes: For an encoder corresponding to any set of historical time series data, the historical time series data is input into a feedforward network module of the encoder, and intermediate time series features are output; The intermediate time series features and the historical time series data are input into the multi-head self-attention mechanism module, and the historical time series features corresponding to the historical time series data are output.

6. The method according to claim 1, It is characterized in that The acquiring the current time series data collected in the current time window adjacent to the prediction time window in the current time period includes: Acquire the current original time series data collected within the current time window, and fold the current original time series data into at least two-dimensional current time series data based on a preset folding ratio, wherein the folding ratio is used to indicate the scale of the folded sequence data in different dimensions, and the dimension of the current time series data is greater than that of the current original time series data; The step of obtaining multiple groups of historical time series data collected respectively in the same target time window of multiple historical time periods includes: Acquire each group of historical original time series data collected within the same target time window in each historical time period, and based on the preset folding rate, fold each group of historical original time series data into at least two-dimensional historical time series data, wherein the dimension of the historical time series data is greater than that of the historical original time series data.

7. The method according to any one of claims 1 to 6, It is characterized in that The target object includes a user request; the behavior data includes the request flow of the user request, and the predicted time series data includes the predicted request flow of the user request at multiple time points within the predicted time window; After obtaining the predicted time series data, the method further includes: According to the request flow predicted by the user request at multiple time points within the prediction time window, the processing The computing resources requested by the user are scheduled so that the scheduled computing resources adapt to the predicted request traffic.

8. The method according to any one of claims 1 to 6, It is characterized in that The target object includes a traffic area; the behavior data includes the traffic volume in the traffic area; the predicted time series data includes the predicted traffic volume of the traffic area at multiple time points within the prediction time window; after obtaining the predicted time series data, the method further includes: According to the traffic volume predicted in the traffic area at multiple time points in the prediction time window, the traffic signal timing scheme of the traffic lights in the traffic area in the prediction time window is adjusted so that the adjusted traffic signal timing scheme adapts to the predicted traffic volume.

9. A time series data prediction device, It is characterized in that The device comprises: An acquisition module, for acquiring, for a prediction time window set for a target object to be predicted within a current time period, current time series data collected within a current time window adjacent to the prediction time window within the current time period, and multiple groups of historical time series data collected respectively within the same target time window of multiple historical time periods, wherein the target time window includes the prediction time window and the current time window, and the time series data includes behavior data of the target object at multiple time points within the time window; An encoding module, used to encode the multiple groups of historical time series data using multiple encoders to obtain multiple historical time series features corresponding to the multiple groups of historical time series data, each of which represents the relative position information and change trend information of each group of historical time series data within the target time window; A decoding module is used to use a decoder to determine the predicted time series data corresponding to the target object in the predicted time window based on the multiple historical time series features and the current time series data, and the predicted time series data includes the predicted behavior data of the target object at multiple time points within the predicted time window.

10. A time series data prediction device, It is characterized in that include: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to implement the method according to any one of claims 1 to 8 when executing the instructions.

11. A non-volatile computer-readable storage medium having computer program instructions stored thereon, It is characterized in that When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 8 is implemented.

12. A computer program product, comprising a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code, wherein when the computer-readable code is executed in an electronic device, a processor in the electronic device executes the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Time series data prediction method and device and storage medium

    CN118586536A

  • Service prediction method and device

    CN113469399A

  • High-precision long-term time series prediction method based on multivariate time series data analysis

    CN114239718A

  • Time sequence prediction method and device, electronic equipment and medium

    CN115423080A

  • Process monitoring system and method

    US20130338964A1

Cited By

  • Method, device and equipment for determining power distribution strategy of medium-and-long-term regional users

    CN119151243A

  • Network slice resource optimization method, device, system and product

    CN119629181A

  • Cloud resource prediction method and device, equipment and medium

    CN119788540A

  • Land space resource planning system based on big data

    CN119809281A

  • Tap water loss detection method and device based on Internet of Things

    CN119939228A