Training grouping model, and method and device for grouping time series data

By training the grouping model to discover rules from microscopic timing data and perform intelligent grouping, the problem of difficulty in predicting macroscopic timing data is solved, and prediction accuracy and efficiency are improved.

CN113822371BActive Publication Date: 2024-11-22ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111163343.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-30
Publication Date
2024-11-22
Estimated Expiration
2041-09-30

AI Technical Summary

Technical Problem

There are difficulties in predicting macro time series data. Directly establishing a timing prediction model will lose micro data information, and the aggregation cannot capture macro changes after directly establishing a prediction model for micro data, resulting in poor prediction results.

Method used

By training the grouping model, discover rules from the microscopic timing data, group them intelligently, and use the hybrid model to split and aggregate to improve the performance of macroscopic timing prediction.

Benefits of technology

Through intelligent grouping and splitting, more micro timing laws are used to assist prediction, avoid macro change capture problems, reduce timing modeling costs, and improve macro prediction accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113822371B_ABST
    Figure CN113822371B_ABST
Patent Text Reader

Abstract

The embodiments of this specification provide a training grouping model and a method for grouping time series data. The method for training the grouping model includes the following steps: obtaining a time series sample set, wherein any sample includes a sequence of n indicator values ​​of a single business object in n time periods. The above sample is input into the grouping model to obtain the predicted probability distribution of the sample belonging to K groups. In addition, the sample is also input into the K decoding networks corresponding to the K groups to obtain K reconstructed samples. Therefore, the total distribution loss can be determined based on the predicted probability distribution of each sample in the sample set and the preset prior distribution; and the total reconstruction loss can be determined based on the K reconstructed samples corresponding to each sample, and the predicted probability distribution. Then, according to the total distribution loss and the total reconstruction loss, the grouping model and K decoding networks are trained. After training, the trained grouping model can be used to group the micro time series samples.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] One or more embodiments of this specification relate to the field of machine learning, and in particular, to a grouping model for training time series data, a method for grouping time series data using the grouping model, and a corresponding device. Background Art

[0002] With the development of computer technology, machine learning has been applied to a variety of technical fields to analyze and predict various business data. In the Internet environment, time series data is a common source of analysis.

[0003] Time series data is a sequence of data that occurs and is recorded over time. In many scenarios, the time series data of interest is the result of aggregating finer-grained data. For example, the time series of a store's total sales over time can be the aggregation of the time series data of all product sales under the store; the time series of a website's total traffic (or visits) over time can be the aggregation of the time series data of all user visits to the website. In such cases, this fine-grained time series data can be called micro-time series data, and the aggregation of these fine-grained time series data is called macro-time series data.

[0004] In many cases, macro-level time series data needs to be predicted for macro-level deployment. For example, some network platforms need to predict visits and traffic at different time periods in the future, so that server clusters can be better deployed in advance to address traffic changes. Some social platforms need to predict the popularity or number of comments on certain review items, such as songs, movies, and books, so that business strategies can be better implemented, such as page layout, user diversion, and user traffic diversion.

[0005] However, due to the complexity of macro-level time series data, its time series forecasting presents some difficulties. The most straightforward forecasting approach is to directly build a time series forecasting model for the macro-level time series data. Because micro-level time series data is aggregated, this approach loses a significant amount of micro-level information, such as the underlying patterns within the micro-level data. This lack of information can make it difficult to build a suitable macro-level time series model. However, while directly building a forecasting model for micro-level data and aggregating it to generate macro-level forecasts takes into account micro-level information, it often fails to achieve better forecasting results because it fails to capture the data characteristics of macro-level changes.

[0006] Therefore, we hope to have an improved solution that can better process time series data and thus better predict macro time series data. Summary of the Invention

[0007] One or more embodiments of this specification describe a training grouping model, as well as a method and device for grouping time series data, which directly starts from the micro time series data itself, discovers the rules of different micro time series data through a hybrid model, and intelligently implements the grouping of micro time series data.

[0008] According to a first aspect, a method for training a grouping model is provided, comprising:

[0009] Obtain a time series sample set, wherein any first time series sample includes a sequence consisting of n indicator values ​​of a single business object in n time periods;

[0010] Inputting the first time series sample into the grouping model to obtain a predicted probability distribution of the sample belonging to K groups;

[0011] Inputting the first time series samples into K decoding networks corresponding to the K groups respectively to obtain K reconstructed samples;

[0012] Determining a total distribution loss based on the predicted probability distribution of each sample in the time series sample set and a preset prior distribution of the sample among the K groups;

[0013] Determine the total reconstruction loss based on the K reconstructed samples corresponding to each sample and the predicted probability distribution;

[0014] The grouping model and the K decoding networks are trained according to the total distribution loss and the total reconstruction loss.

[0015] In different embodiments, a single business object may be one of the following: a single user, a single commodity, a single store, a single service item, or a single product; and the indicator value may be one of the following: click volume, sales volume, or traffic volume.

[0016] According to one embodiment, the above method further includes preprocessing the first time series sample according to the average of the n indicator values.

[0017] According to one embodiment, the above-mentioned grouping model includes a coding network and a grouping network; the step of inputting the first time series sample into the grouping model to obtain the predicted probability distribution of the sample belonging to K groups includes: inputting the first time series sample into the coding network to obtain the coding feature of the first time series sample; and inputting the coding feature into the grouping network to obtain the predicted probability distribution.

[0018] Furthermore, in an embodiment of the above-mentioned implementation manner, the encoding network is a time series-based neural network; inputting the first time series sample into the encoding network to obtain the encoding feature of the first time series sample specifically includes: inputting the n indicator values ​​into the time series-based neural network in sequence to obtain the encoding feature.

[0019] In one embodiment of the above implementation manner, the grouping network is implemented as a multi-layer perceptron MLP; inputting the coding features into the grouping network to obtain the predicted probability distribution specifically includes: processing the coding features through a multi-layer perceptron MLP to obtain the predicted probability distribution.

[0020] In one implementation, the K decoding networks have the same network structure but different network parameters.

[0021] According to one embodiment, the K decoding networks include an arbitrary first decoding network; the first time series samples are respectively input into the K decoding networks corresponding to the K groups to obtain K reconstructed samples, including: inputting a first time series segment of the first time series sample into the first decoding network, the first decoding network predicting a second time series segment based on the first time series segment, and forming a first reconstructed sample based on the second time series segment.

[0022] Furthermore, in one embodiment, the first time sequence segment includes the first s indicator values ​​of the n indicator values; the second time sequence segment includes the last s indicator values; wherein s is greater than n / 2.

[0023] According to one embodiment, each indicator value in the first time sequence segment may be sequentially input into the first decoding network, and the first decoding network may perform rolling prediction on the next indicator value to form a second time sequence segment.

[0024] According to another embodiment, the first time sequence segment may be input as a whole into the first decoding network, and the first decoding network obtains a segment representation vector of the first time sequence segment, and predicts the second time sequence segment based on the segment representation vector.

[0025] According to one embodiment, the above-mentioned determination of the total distribution loss specifically includes: obtaining the overall posterior distribution of each sample in the K groups based on the predicted probability distribution of each sample in the time series sample set; and determining the total distribution loss based on the distribution difference between the preset prior distribution and the overall posterior distribution.

[0026] According to another embodiment, determining the total distribution loss specifically includes: obtaining the sample distribution loss corresponding to the first time series sample based on the distribution difference between the predicted probability distribution of the first time series sample and the preset prior distribution; and obtaining the total distribution loss based on the sample distribution losses of each sample.

[0027] In one embodiment, the distribution difference is the KL divergence between the distributions.

[0028] According to one embodiment, determining the total reconstruction loss includes: for any first decoding network among the K decoding networks, determining the single-network single-sample reconstruction loss of the first decoding network for the first time series sample; using the K probabilities corresponding to the K decoding networks in the predicted probability distribution of the first time series sample as weights, summing the single-network single-sample reconstruction losses of the K decoding networks for the first time series sample to obtain the single-sample reconstruction loss of the first time series sample; summing the single-sample reconstruction losses of each sample in the time series sample set to obtain the total reconstruction loss.

[0029] In one embodiment of the above-mentioned implementation manner, the single-network single-sample reconstruction loss is determined as follows: a first reconstructed sample of the first decoding network for the first time series sample is obtained; and the single-network single-sample reconstruction loss is determined based on the difference between the predicted value of each time period in the first reconstructed sample and the indicator value of the corresponding time period in the first time series sample.

[0030] In another embodiment of the above-mentioned implementation manner, the single-network single-sample reconstruction loss is determined as follows: for multiple target time periods covered by the reconstructed sample, the mean and variance of the index value distribution predicted by the first decoding network for each target time period are obtained; based on the mean and variance of each target time period and the index value of the target time period in the first time series sample, the distribution deviation of the target time period is determined; and the single-network single-sample reconstruction loss is determined based on the sum of the distribution deviations of the multiple target time periods.

[0031] According to one embodiment, the grouping model and the K decoding networks are trained based on the total distribution loss and the total reconstruction loss, specifically including: combining the total distribution loss and the total reconstruction loss according to preset weights to obtain a total loss; and adjusting the parameters in the grouping model and the K decoding networks in the direction of reducing the total loss.

[0032] According to a second aspect, a method for grouping time series data is provided, comprising:

[0033] Obtain the time series sample to be tested, which includes a sequence of n indicator values ​​of a single business object in n time periods;

[0034] Input the time series sample to be tested into a grouping model and output the predicted probability distribution of the sample belonging to K groups, wherein the grouping model is trained according to the method of the first aspect;

[0035] Determine a target group with the highest probability value in the predicted probability distribution, and classify the time series samples to be tested into the target group.

[0036] According to a third aspect, a method for predicting macro time series data is provided, comprising:

[0037] Obtain N time series samples, where each time series sample includes a sequence of n indicator values ​​of a single business object in n time periods;

[0038] Input each time series sample into a grouping model and output its predicted probability distribution of belonging to K groups, wherein the grouping model is trained according to the method of the first aspect;

[0039] Divide each time series sample into the group with the highest probability value in its corresponding predicted probability distribution, thereby obtaining K groups of time series samples;

[0040] For each group of the K groups of time series samples, aggregating the time series samples in the group to obtain a fused time series sample corresponding to the group;

[0041] Based on the fused time series samples, determine the prediction index value of the business object subgroup corresponding to the group in the target period;

[0042] Based on the prediction index values ​​corresponding to the K groups, the macro-index value of the total group of business objects in the target period is determined.

[0043] According to a fourth aspect, there is provided an apparatus for training a grouping model, comprising:

[0044] an acquisition unit configured to acquire a time series sample set, wherein any first time series sample includes a sequence consisting of n indicator values ​​of a single business object in n time periods;

[0045] a grouping processing unit configured to input the first time series sample into a grouping model to obtain a predicted probability distribution of the sample belonging to K groups;

[0046] a reconstruction processing unit configured to input the first time series samples into K decoding networks corresponding to the K groups, respectively, to obtain K reconstructed samples;

[0047] a distribution loss determining unit configured to determine a total distribution loss based on a predicted probability distribution of each sample in the time series sample set and a preset prior distribution of the samples among the K groups;

[0048] a reconstruction loss determining unit configured to determine a total reconstruction loss based on the K reconstructed samples corresponding to each sample and the predicted probability distribution;

[0049] A training unit is configured to train the grouping model and the K decoding networks according to the total distribution loss and the total reconstruction loss.

[0050] According to a fifth aspect, a device for grouping time series data is provided, comprising:

[0051] an acquisition unit configured to acquire a time series sample to be tested, including a sequence consisting of n indicator values ​​of a single business object in n time periods;

[0052] a model processing unit configured to input the time series sample to be tested into a grouping model and output a predicted probability distribution of the time series sample belonging to K groups, wherein the grouping model is trained according to the apparatus of the fourth aspect;

[0053] The grouping unit is configured to determine a target group with the highest probability value in the predicted probability distribution, and classify the time series samples to be tested into the target group.

[0054] According to a sixth aspect, a device for predicting macro time series data is provided, comprising:

[0055] an acquisition unit configured to acquire N time series samples, wherein each time series sample includes a sequence consisting of n indicator values ​​of a single business object in n time periods;

[0056] a model processing unit configured to input each time series sample into a grouping model and output a predicted probability distribution of the sample belonging to K groups, wherein the grouping model is trained according to the apparatus of the fourth aspect;

[0057] a grouping unit configured to group each time series sample into a group with the highest probability value in its corresponding prediction probability distribution, thereby obtaining K groups of time series samples;

[0058] an aggregation unit configured to aggregate, for each group of the K groups of time series samples, the individual time series samples in the group to obtain a fused time series sample corresponding to the group;

[0059] A prediction unit configured to determine a prediction index value of a business object subgroup corresponding to the group in a target period based on the fused time series samples;

[0060] The determining unit is configured to determine the macro-index value of the total group of business objects in the target time period based on the prediction index values ​​corresponding to the K groups.

[0061] According to a seventh aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed in a computer, the computer is caused to execute the method described in any one of the first to third aspects.

[0062] According to a fourth aspect, a computing device is provided, comprising a memory and a processor, wherein executable code is stored in the memory, and when the processor executes the executable code, the method of any one of the first to third aspects is implemented.

[0063] In the embodiments of this specification, a grouping model is trained to group micro-time series data. Furthermore, a hybrid model is trained synchronously with the grouping model. By analyzing the distribution of micro-time series data within the hybrid model, the underlying patterns of the micro-time series data are discovered, and micro-time series data with similar distributions and patterns are grouped together. This allows for intelligent and automated splitting of macro-time series data based on the micro-behavioral patterns revealed by the hybrid model, rather than relying solely on obvious attributes, thereby improving macro-forecasting performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0065] Figure 1 Schematic diagram of an implementation process for grouping micro time series data according to one embodiment;

[0066] Figure 2 A flow chart of a method for training a grouping model according to one embodiment is shown;

[0067] Figure 3 A schematic diagram illustrating a process of training a grouping model according to one embodiment is shown;

[0068] Figure 4 A flow chart of a method for grouping time series data according to one embodiment is shown;

[0069] Figure 5 A flow chart of a method for predicting macro time series data according to one embodiment is shown;

[0070] Figure 6 A schematic diagram of the structure of an apparatus for training a grouping model according to one embodiment is shown;

[0071] Figure 7 A schematic diagram of the structure of an apparatus for grouping time series data according to one embodiment is shown;

[0072] Figure 8 A schematic diagram of the structure of a device for predicting macro data according to one embodiment is shown. DETAILED DESCRIPTION

[0073] The solution provided in this specification is described below in conjunction with the accompanying drawings.

[0074] As mentioned above, macro-time series data presents some difficulties in time series forecasting due to its complex structure. Whether forecasting directly on macro data or forecasting micro data and then aggregating them, it is difficult to achieve the desired accuracy and effect.

[0075] To this end, one implementation approach, based on the granularity of the prediction, splits time series forecasting into two approaches: directly forecasting macro data and forecasting micro data. In other words, a strategy can be used to split macro time series data into multiple sub-series, each forecasted separately, and then aggregated to produce a macro forecast. Compared to directly forecasting macro data, this approach leverages more useful information, mining the diverse patterns of micro time series to aid forecasting. Furthermore, compared to directly forecasting micro data, this approach avoids the problem of failing to capture macro time series variations and significantly reduces the cost of time series modeling.

[0076] In the above implementation, appropriately segmenting macro-time series data is crucial to the ultimate prediction results. Intuitively, macro-time series data can be segmented based on obvious attributes or indicators, such as geographic location and product type. However, these obvious attributes or indicators typically do not contain much micro-time series information, and there are hundreds or even thousands of attributes / indicators that can be used as the basis for segmentation. Finding the right indicators requires strong expert knowledge and a significant amount of trial and error, which is time-consuming and labor-intensive.

[0077] In view of this, a time series splitting method for macro time series prediction is provided in the embodiments of this specification. The technical concept is to start directly from the micro time series data itself, discover the laws of different micro time series data through a hybrid model, classify the data that obey the same micro behavior laws into one category, and intelligently realize the splitting of macro time series, thereby helping to improve the prediction performance of macro time series.

[0078] Figure 1 This is a schematic diagram of the implementation process of grouping micro-time series data according to an embodiment. It can be understood that splitting the macro time series is equivalent to grouping the micro-time series data. According to the embodiment of this specification, a grouping model is trained with the help of a hybrid model composed of multiple decoding networks, and then the grouping model can be used to group the micro-time series data. Therefore, Figure 1 The implementation process can be divided into the training phase and the use phase of the grouping model, which are described below respectively.

[0079] During the training phase, the desired number of groups K can be set. In other words, the macro time series data can be split into K sub-time series, or the micro time series data can be divided into K groups. In addition, a prior distribution of a large number of micro time series samples between these K groups can be assumed. Based on this, an auxiliary hybrid model can be constructed, which includes multiple decoding networks for reconstructing micro time series samples. The number of decoding networks is equal to the desired number of groups K. That is, the hybrid model includes K decoding networks, corresponding to K groups.

[0080] During the training process, as shown in the figure above, for a single micro-series sample x in the sample set, it is input into the grouping model to be trained, and the probability distribution P of the sample x belonging to K groups (corresponding to K decoding networks) predicted by the grouping model can be obtained. In addition, the micro-series sample x is input into the K decoding networks for decoding and reconstruction. Each decoding network i reconstructs the sample x and outputs the reconstructed sample x (i) , so the K decoding networks each get K reconstructed samples x (1) to x (K) .

[0081] After performing the above probability prediction and sample reconstruction for each sample in the sample set, the overall prediction loss can be determined based on the predicted probability distribution P of each sample, the reconstructed sample, and the aforementioned prior distribution. This includes the distribution loss between the predicted probability distribution and the prior distribution, as well as the reconstruction loss associated with sample reconstruction. Based on this overall prediction loss, the parameters of the grouping model and the K decoding networks can be tuned to achieve their training.

[0082] After the grouping model is trained, it can be used to group micro-time series data. As shown in the figure below, for a single micro-time series sample y to be grouped, it is input into the trained grouping model. This yields the probability distribution of K groups predicted by the grouping model. The group with the highest probability from this probability distribution is selected as the target group, and sample y is assigned to this target group. This achieves grouping of each micro-time series sample. Furthermore, macro-time series predictions can be made based on this grouping of micro-time series data.

[0083] In the above implementation process, the hybrid model is trained synchronously with the grouping model. By analyzing the distribution of micro-time series data within the hybrid model, the underlying patterns of the micro-time series data are discovered, and micro-time series data with similar distributions and patterns are grouped together. This allows for intelligent and automated splitting of macro-time series data based on the micro-behavioral patterns revealed by the hybrid model, rather than relying solely on obvious attributes, thereby improving macro-forecasting performance.

[0084] The above implementation process is described in detail below.

[0085] Figure 2 A flow chart of a method for training a grouping model according to one embodiment is shown. The method can be executed by any device, equipment, platform, or device cluster with computing and processing capabilities. Figure 3 A schematic diagram of the process of training a grouping model according to an embodiment is shown. Figure 2 and Figure 3 , describes in detail the specific execution methods of each step in the group model training process.

[0086] like Figure 2 As shown, first, in step 21, a time series sample set is obtained. It can be understood that the time series sample set includes a batch, for example, N micro time series samples. A single micro time series sample is a sequence of n indicator values ​​of a single business object in n time periods in chronological order. For the sake of clarity and convenience, it is also referred to as the first time series sample in the following text. Figure 3 In the example, a single microscopic time series sample is recorded as x = [x1, x2, ..., x n ], where x i Indicates the indicator value of the corresponding business object in time period i.

[0087] Depending on the macro-object to be analyzed, a single business object can be a single user, a single commodity, a single store, a single service item, a single product, etc. The aforementioned indicator values ​​can be, for example, click count, visit duration, sales volume, traffic volume, etc.; and n time periods can be 24 hours a day, 7 days a week, 30 days a month, etc. Accordingly, in different embodiments, a single micro-time series sample can have different meanings. For example, in one example, the macro object to be analyzed is the total sales of a store, then a single micro time series sample can be the sales sequence of a single commodity in the store in each time period; in another example, the macro object to be analyzed is the total sales of an e-commerce platform, then a single micro time series sample can be the sales sequence of a single store in the e-commerce platform in each time period; in another example, the macro object to be analyzed is the number of reviews on a review website, then a single micro time series sample can be the number of reviews of a single product on the website in each time period; in another example, the macro object to be analyzed is the flow of service products involving mobile resources (for example, the transfer of funds out and in of service products involving payment), then a single micro time series sample can be the resource flow of a single user in each time period. It can be understood that those skilled in the art can set the corresponding micro time series sample according to the macro object to be analyzed, and there can be more examples for the specific implementation of the micro time series sample, which are not listed here one by one.

[0088] According to one embodiment, each micro-time series sample x is preprocessed before model processing. Specifically, in one embodiment, the sample can be preprocessed based on the mean of n indicator values ​​in a single micro-time series sample, so that the numerical range of the processed indicator value is smaller than the original numerical range. In one example, the micro-time series sample x can be preprocessed according to the following formula (1):

[0089]

[0090] Among them, x i Indicates the original indicator value of the business object in time period i, represents the mean of n original index values ​​in sample x, is the index value of time period i after preprocessing. Through the preprocessing shown in formula (1), the numerical range of the index value can be narrowed to avoid the training difficulties caused by excessively large values.

[0091] In another example, other preprocessing methods may be used, for example, a normalization method to normalize all indicator values ​​to a predetermined range.

[0092] For the above various microscopic time series samples x, or called the first time series samples, such as Figure 2 As shown, in step 22, the first time series sample is input into the grouping model to obtain a predicted probability distribution of the sample belonging to K groups. The number of groups K can be a pre-set value as needed. Let any group among the K groups be denoted as z, and the predicted probability distribution output by the grouping model can be denoted as q(z|x), that is, the probability that sample x belongs to each group z.

[0093] In one embodiment, the above-mentioned grouping model is implemented as an overall neural network model, which processes various features in the input time series sample x and outputs the above-mentioned predicted probability distribution.

[0094] In another embodiment, Figure 3 As shown, the above grouping model includes an encoding network and a grouping network. Accordingly, the grouping model's processing of the first time series sample x may include inputting the first time series sample x into the encoding network to obtain the encoding feature u of the first time series sample x, where u=f enc (x), f enc Represents the encoding function of the encoding network; then the encoding feature u is input into the above-mentioned grouping network to obtain the aforementioned predicted probability distribution q(z|x).

[0095] In one example, the encoding network is a time-series-based neural network, such as a recurrent neural network (RNN), a long short-term memory (LSTM), etc. In this case, the n indicator values ​​in the first time series sample are sequentially input into the time-series-based neural network according to their chronological order. The neural network encodes the input sample based on time series accumulation to obtain an encoding feature u.

[0096] In another example, the encoding network can also be a non-temporal neural network that can be used to process multi-dimensional inputs, such as a convolutional neural network (CNN) or an attention-based neural network, such as a Transformer. In such a case, the n indicator values ​​in the first time series sample can be input into the encoding network as multi-dimensional inputs; the encoding network processes the multi-dimensional inputs based on an attention mechanism, for example, to obtain encoding features u.

[0097] The encoded feature u is then input into the grouping network to predict the grouping probability. In one embodiment, the grouping network is implemented as a multi-layer perceptron (MLP). Thus, the encoded feature u is processed by the multi-layer perceptron (MLP) to obtain the predicted probability distribution q(z|x), that is:

[0098] q(z|x)=MLP(u) (2)

[0099] In other examples, the grouping network may also be implemented by a more complex neural network, which is not limited here.

[0100] On the other hand, Figure 2 In step 23, the first time series sample x is input into K decoding networks corresponding to the K groups, respectively, to obtain K reconstructed samples. As previously described, the K decoding networks are constructed corresponding to the preset K groups to form a hybrid model. Typically, the K decoding networks have the same network structure but different network parameters. The following describes the process of sample reconstruction by the decoding network for the first time series sample x, taking any one of the decoding networks z as an example.

[0101] In one embodiment, a portion of a first time series sample x, referred to as a first time series segment, can be input into a decoding network z. The decoding network z predicts another portion of a time series segment, referred to as a second time series segment, based on the first time series segment. A reconstructed sample x' is thus formed based on the predicted second time series segment. Therefore, the reconstructed sample x' generally includes predicted values ​​for a portion of the n time periods.

[0102] For example, in Figure 3 In the example, the first time segment is from x1 to x n-m ; The second time segment is from x2 to x n, where m is generally selected to be less than n / 2. More typically, m can be set to 1. In this case, the decoding network z is based on the first time segment x1 to x n-1 Predict the second time segment x2-x n , predicted x2-x n Constitute the reconstructed sample x'.

[0103] In other examples, the first and second time series segments can be configured in other ways. For example, in one specific example, the first time series segment can include the first s indicator values ​​of the n indicator values ​​corresponding to the n time periods, and the second time series segment can include the last s indicator values, where s is greater than n / 2. For example, if the n time periods are 12 months, s can be set to 9. In this case, the encoding network predicts the indicator values ​​for April to December based on the indicator values ​​for January to September.

[0104] The encoding network can predict the second time sequence segment in a variety of ways.

[0105] In one embodiment, the encoding network z is a time-series-based neural network, such as an RNN or LSTM, and is configured to perform rolling predictions for each time period. Specifically, each indicator value in the first time series segment can be sequentially input into the decoding network z, which then rolls over and predicts the next indicator value to form a second time series segment.

[0106] For example, in a specific example, x1 is input into the decoding network z implemented by LSTM. The LSTM network obtains the hidden state h1 based on the initial state and the input x1, and predicts the index value x2 at the next moment based on the hidden state h1; then the real x2 is input into the LSTM network. The LSTM network obtains the current hidden state h2 based on the hidden state h1 at the previous moment and the current input x2, and predicts the index value x3 at the next moment based on the current hidden state h2. This continues, based on the first time series segment x1 to x n-1 Predict the second time segment x2-x n , forming the reconstructed sample x'. In another example, the first time segment is x1 to x n-m , then we can follow the above method based on x1 to x n-m Predict x2 to x n-m+1 , then, from x n-m+1 First, input the predicted values ​​into the LSTM network one by one, and continue to predict the subsequent indicator values ​​until x n , thus forming the reconstructed sample x'.

[0107] In another embodiment, the decoding network z predicts the second time sequence segment based on the overall representation of the first time sequence segment. At this time, the first time sequence segment can be input into the decoding network z as a whole, and the decoding network z obtains the segment representation vector h of the first time sequence segment, and then predicts the second time sequence segment based on the segment representation vector h. In a specific example, the decoding network z can be implemented as a transformer network, which obtains the overall segment representation vector h of the first time sequence segment based on the attention mechanism. Then, through the decoding stage, the second time sequence segment is predicted based on the vector h to form a reconstructed sample x'. In another example, the decoding network z can be implemented as a seq2seq network, which predicts the elements in the second time sequence segment one by one based on the segment representation vector h of the first time sequence segment to form a reconstructed sample x'.

[0108] In more embodiments, the decoding network z may also form reconstructed samples through other methods, such as an autoencoding network. This specification does not limit the method and process of reconstructing samples by the decoding network.

[0109] In addition, it should be noted that the processing of the first time series sample x by the grouping model in step 22 and the processing of the sample x by the K decoding networks in step 23 can be performed in any relative order, such as sequentially or in parallel, and this is not limited here.

[0110] After executing steps 22 and 23 for each of the N micro-time series samples in the sample set, the loss during the entire prediction process can be determined, and the grouping model and the K decoding networks can be fine-tuned and trained accordingly. The details are as follows.

[0111] In step 24 , the total distribution loss L1 is determined based on the predicted probability distribution q(z|x) of each sample in the time series sample set and the preset prior distribution of the sample among the K groups.

[0112] As mentioned above, on the basis of setting the desired number of groups K, we can also set the prior distribution of a large number of micro-time series samples among these K groups, denoted as p(z). In relatively simple scenarios, we can assume that the prior distribution is uniformly distributed among the K groups. In the case of more expert knowledge of the scene characteristics, we can also set other forms of prior distributions based on the scene characteristics, for example, setting the distribution of samples among the K groups to conform to a certain non-uniform distribution, etc. Thus, based on the prior distribution p(z) and the predicted probability distribution q(z|x) of each sample by the grouping model, the total distribution loss related to the sample distribution is determined.

[0113] In one embodiment, the predicted probability distributions of N samples in the sample set can be aggregated first to obtain the overall predicted distribution of these N samples in K groups, or called the overall posterior distribution, denoted as q(z), and then the total distribution loss L1 is determined based on the distribution difference between the preset prior distribution p(z) and the overall posterior distribution q(z).

[0114] In an example, the predicted probability distributions of N samples can be averaged to obtain the overall posterior distribution q(z), that is:

[0115]

[0116] There are many ways to calculate the difference in distribution between the prior distribution p(z) and the overall posterior distribution q(z). For example, the KL divergence between p(z) and q(z) can be calculated as follows:

[0117]

[0118] In another example, cross entropy can also be used to calculate the distribution difference between p(z) and q(z).

[0119] According to another embodiment, the sample distribution loss corresponding to a single microscopic time series sample x can be calculated based on the distribution difference between the predicted probability distribution q(z|x) and the prior distribution p(z). Then, the sample distribution losses of each sample in the sample set are combined to obtain the total distribution loss L1. When determining the distribution difference between the predicted probability distribution q(z|x) and the prior distribution p(z), similar calculation methods such as cross entropy and KL divergence can be used.

[0120] In this way, the total distribution loss L1 associated with the sample distribution is determined in various ways.

[0121] On the other hand, in step 25, the total reconstruction loss L2 is determined based on the K reconstructed samples corresponding to each sample and the predicted probability distribution.

[0122] In one embodiment, the total reconstruction loss L2 can be obtained by multiple summation. Specifically, for any decoding network z among the K decoding networks, the single-network single-sample reconstruction loss L of the decoding network z for the first time series sample x is determined. x ; Taking the K probabilities corresponding to the K decoding networks in the predicted probability distribution of the first time series sample x as weights, the single network single sample reconstruction loss L of the K decoding networks for the first time series sample x is calculated. xSum up to get the single sample reconstruction loss of the first time series sample x; then sum up the single sample reconstruction losses of each of the N samples in the time series sample set, and get the total reconstruction loss L2 based on the summation result. This calculation process can be expressed by the following formula:

[0123] L2=∑ x ∑ z q(z|x)*L X (5)

[0124] Among them, L x represents the single-network single-sample reconstruction loss of a single decoding network z for the first time series sample x. The single-network single-sample reconstruction loss can be determined in many ways.

[0125] In one example, a first reconstructed sample x' of the decoding network z for the first time series sample x is obtained; the single network single sample reconstruction loss L is determined based on the difference between the predicted value of each time period in the first reconstructed sample x' and the index value of the corresponding time period in the first time series sample x. Specifically, the single network single sample reconstruction loss L can be determined by the following formula (6): x :

[0126] L X =∑ i (x′ I -x I ) 2 (6)

[0127] Among them, x i ′ is the predicted value of the decoding network z for time period i, x i is the true value of time period i in the first time series sample x. The sum of time period i in the formula depends on the length of the time series segment covered by the reconstructed sample. For example, Figure 3 Reconstruct samples from x2 to x n In the example, the time period i ranges from 2 to n.

[0128] In another example, it is assumed that for each time period i, the index value of each sample conforms to a certain distribution, and the single network single sample reconstruction loss is determined based on the distribution. Specifically, it can be assumed that for each time period i, the index value of each sample conforms to a Gaussian distribution; accordingly, the reconstructed sample output by the decoding network z is set to indicate the mean μ of the index value distribution for each time period i, and the decoding network z also predicts the variance σ of the index value distribution. On the basis of obtaining the mean and variance predicted by the decoding network z for time period i, according to the mean and variance, and the index value x of the time period i in the first time series sample x i , determine the distribution deviation of the time period i; then, according to the sum of the distribution deviations of each time period covered by the reconstructed sample, determine the single network single sample reconstruction loss L x .

[0129] In a specific example, the single-network single-sample reconstruction loss L is determined by the following formula (7): x :

[0130]

[0131] Among them, x I is the true value of time period i in the first time series sample x, μ i is the predicted mean value of the decoding network z for time period i based on the first time series sample, σ i is the prediction variance of period i. The summation range of period i is the length of the time series segment covered by the reconstructed samples.

[0132] Substituting the method of determining the single-network single-sample reconstruction loss in formula (7) into formula (5), we can obtain the calculation process of determining the total reconstruction loss L2 in a specific example as follows:

[0133]

[0134] In other embodiments, the calculation method in the above example can be modified and altered. For example, the order of summation in formula (5) can be adjusted, and L can be changed. x The total reconstruction loss L2 can be determined by more calculation methods, and the specific calculation process for determining L2 is not limited here.

[0135] It should also be noted that the determination of the total distribution loss in step 24 and the determination of the total reconstruction loss in step 25 can be performed in any relative order, such as sequentially or in parallel, and this is not limited here.

[0136] Based on the above, in step 26, the grouping model and the K decoding networks can be trained based on the total distribution loss L1 and the total reconstruction loss L2. In one embodiment, the total distribution loss L1 and the total reconstruction loss L2 can be combined according to a preset weight α to obtain a total loss L. The total loss L can be expressed as:

[0137] L=L1+α*L2 (9)

[0138] Then, the parameters of the grouping model and the K decoding networks are adjusted in the direction of reducing the total loss. In this process, the grouping model and the K decoding networks are jointly trained.

[0139] In this way, after training on several batches of samples, a trained grouping model and K decoding networks are obtained. The training of the K decoding networks is to assist in training the grouping model. After training, the decoding networks can be discontinued or used for other purposes. The trained grouping model can then be used directly to group microscopic time series samples.

[0140] Figure 4 A flow chart of a method for grouping time series data according to an embodiment is shown. The method can be executed by any device, equipment, platform, or equipment cluster with computing and processing capabilities. Figure 4 As shown, the method may include the following steps. A method for grouping time series data, comprising:

[0141] In step 41, a time series sample to be tested is obtained, which includes a sequence of n indicator values ​​of a single business object in n time periods. The time series sample to be tested can be recorded as sample y.

[0142] In step 42, the time series sample to be tested is input into the grouping model, and the predicted probability distribution of the sample belonging to K groups is output. Figure 2 trained using the described method.

[0143] Then, in step 43, the group with the highest probability value in the above-mentioned predicted probability distribution is determined as the target group, and the time series sample y to be tested is classified into the target group.

[0144] Through the above method, a single micro-time series sample y is grouped. Each of the large number of micro-time series samples to be processed can be processed in the same way as above, thereby dividing them into K groups. Because the grouping model and the hybrid model composed of K decoding networks are trained synchronously, the output of the grouping model reflects the distribution of the input micro-time series sample among the K components of the hybrid model. Samples with similar distributions have similar deep-level regularities in their microscopic features. Therefore, through the above process, micro-time series data with similar deep-level regularities can be grouped together.

[0145] The above grouping of micro-time series data can be used in a variety of scenarios and purposes. For example, grouping each micro-time series sample can be used to divert the corresponding business objects, such as diverting to K processing units corresponding to K groups (which can be K groups of customer service personnel, K sub-servers), etc. Grouping a large number of micro-time series samples can facilitate further analysis and processing of the grouped data. Typically, the above grouping can be used to split macro-time series data, thereby predicting macro indicators based on the grouped data.

[0146] Figure 5A flow chart of a method for predicting macro time series data according to an embodiment is shown. The method can be executed by any device, equipment, platform, or equipment cluster with computing and processing capabilities. Figure 5 As shown, the method includes the following steps.

[0147] In step 51 , N time series samples are obtained, where each time series sample includes a sequence consisting of n indicator values ​​of a single business object in n time periods.

[0148] In step 52, each time series sample is input into the grouping model, and the grouping model outputs the predicted probability distribution of its belonging to K groups; wherein, the grouping model is based on the above combination Figure 2 trained using the described method.

[0149] Next, in step 53, each time series sample is divided into a group with the highest probability value in its corresponding predicted probability distribution, thereby obtaining K groups of time series samples. In this way, the N time series samples are divided into K groups.

[0150] Next, in step 54, for each group j in the K groups of time series samples, the time series samples in group j are aggregated to obtain a fused time series sample corresponding to group j. In one embodiment, the aggregation may be performed by summing the time series samples in a group to obtain the fused time series sample. In another example, the average of the time series samples in a group may be calculated to obtain the fused time series sample corresponding to the group.

[0151] Then, in step 55, the predicted index value for the business object subgroup corresponding to the group during the target period can be determined based on the fused time series samples. This prediction process can be implemented using a time series prediction model. The algorithm structure, construction method, and training method of the time series prediction model are not limited here.

[0152] Finally, in step 56, based on the prediction index values ​​corresponding to the K groups, the macro index value of the total group of business objects in the target period is determined, thereby achieving macro prediction.

[0153] Since the grouping of micro-time series samples is based on the deep laws of the micro-samples, macro-prediction based on such grouped subsequences can better explore the laws of micro-time series as an aid, thereby improving the prediction performance.

[0154] According to another embodiment, an apparatus for training a grouping model is provided. Figure 6 A schematic diagram of the structure of a device for training a grouping model according to an embodiment is shown. The device can be deployed in any device, platform or device cluster with data storage, computing and processing capabilities. Figure 6 As shown, the training device 600 includes:

[0155] An acquisition unit 61 is configured to acquire a time series sample set, wherein any first time series sample includes a sequence consisting of n indicator values ​​of a single business object in n time periods;

[0156] The grouping processing unit 62 is configured to input the first time series sample into the grouping model to obtain a predicted probability distribution of the sample belonging to K groups;

[0157] The reconstruction processing unit 63 is configured to input the first time series samples into K decoding networks corresponding to the K groups respectively to obtain K reconstructed samples;

[0158] a distribution loss determination unit 64 configured to determine a total distribution loss based on the predicted probability distribution of each sample in the time series sample set and a preset prior distribution of the samples among the K groups;

[0159] A reconstruction loss determining unit 65 is configured to determine a total reconstruction loss based on the K reconstructed samples corresponding to each sample and the predicted probability distribution;

[0160] The training unit 66 is configured to train the grouping model and the K decoding networks according to the total distribution loss and the total reconstruction loss.

[0161] The specific implementation of the training device can refer to the Figure 2 The training method described.

[0162] According to yet another embodiment, a device for grouping time series data is provided. Figure 7 A schematic diagram of a device structure for grouping time series data according to an embodiment is shown. The device can be deployed in any device, platform or device cluster with data storage, computing and processing capabilities. Figure 7 As shown, the grouping device 700 includes:

[0163] The acquisition unit 71 is configured to acquire a time series sample to be tested, which includes a sequence consisting of n indicator values ​​of a single business object in n time periods;

[0164] The model processing unit 72 is configured to input the time series sample to be tested into the grouping model and output the predicted probability distribution of the sample belonging to K groups. The grouping model is based on Figure 6 The device shown is trained;

[0165] The grouping unit 73 is configured to determine a target group with the highest probability value in the predicted probability distribution, and classify the time series samples to be tested into the target group.

[0166] The specific implementation of the training device can refer to the Figure 4The grouping method described.

[0167] According to another embodiment, a device for predicting macro time series data is provided. Figure 8 A schematic diagram of a device structure for predicting macro data according to an embodiment is shown. The device can be deployed in any device, platform or device cluster with data storage, computing and processing capabilities. Figure 8 As shown, the prediction device 800 includes:

[0168] An acquisition unit 81 is configured to acquire N time series samples, where each time series sample includes a sequence consisting of n indicator values ​​of a single business object in n time periods;

[0169] The model processing unit 82 is configured to input each time series sample into the grouping model and output the predicted probability distribution of the sample belonging to K groups. The grouping model is based on Figure 6 The device shown is trained to obtain;

[0170] A grouping unit 83 is configured to group each time series sample into a group with the highest probability value in its corresponding predicted probability distribution, thereby obtaining K groups of time series samples;

[0171] an aggregation unit 84 configured to aggregate, for each group of the K groups of time series samples, the individual time series samples in the group to obtain a fused time series sample corresponding to the group;

[0172] The prediction unit 85 is configured to determine the prediction index value of the business object subgroup corresponding to the group in the target time period based on the fused time series samples;

[0173] The determining unit 86 is configured to determine the macro-index value of the total group of business objects in the target period based on the prediction index values ​​corresponding to the K groups.

[0174] The specific implementation of the prediction device can refer to the Figure 5 The prediction method described.

[0175] Through the aforementioned devices, the hybrid model is trained synchronously with the grouping model. The distribution of micro-time series data within the hybrid model reveals underlying patterns within the micro-time series data, allowing micro-time series data with similar distributions and patterns to be grouped together. This allows for intelligent and automated splitting of macro-time series data based on the micro-behavioral patterns revealed by the hybrid model, rather than relying solely on obvious attributes, thereby improving macro-forecasting performance.

[0176] According to another embodiment, there is also provided a computer readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute a combination of Figure 2 , Figure 4 ,or Figure 5 The method described.

[0177] According to another embodiment, a computing device is provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the system realizes the combination of Figure 2 , Figure 4 ,or Figure 5 The method described.

[0178] Those skilled in the art will appreciate that, in one or more of the above examples, the functions described herein may be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these functions may be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.

[0179] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for training a grouping model, include: Acquire a time series sample set, wherein any first time series sample includes a sequence consisting of n indicator values ​​of a single business object in n time periods; Inputting the first time series sample into the grouping model to obtain a predicted probability distribution of the sample belonging to K groups; Inputting the first time series samples into K decoding networks corresponding to the K groups respectively for reconstruction to obtain K reconstructed samples; Determine the total distribution loss according to the predicted probability distribution of each sample in the time series sample set and the preset prior distribution of the sample among the K groups; Determine a total reconstruction loss according to the K reconstructed samples corresponding to each sample and the predicted probability distribution; The grouping model and the K decoding networks are trained according to the total distribution loss and the total reconstruction loss.

2. The method according to claim 1, in, A single business object is one of the following: a single user, a single commodity, a single store, a single service item, a single product; the indicator value is one of the following: click volume, sales volume, and flow volume. 3 . The method according to claim 1 , further comprising preprocessing the first time series sample according to an average of the n indicator values.

4. The method according to claim 1, in, The grouping model includes a coding network and a grouping network; the step of inputting the first time series sample into the grouping model to obtain a predicted probability distribution of the sample belonging to K groups includes: Inputting the first time series sample into a coding network to obtain a coding feature of the first time series sample; The encoded features are input into the grouping network to obtain the predicted probability distribution.

5. The method according to claim 4, in, The encoding network is a time-series based neural network; Inputting the first time series sample into a coding network to obtain coding features of the first time series sample specifically includes: The n index values ​​are sequentially input into the time series-based neural network to obtain the coding features.

6. The method according to claim 4, in, The grouping network is implemented as a multi-layer perceptron MLP; the encoding features are input into the grouping network to obtain the predicted probability distribution, specifically including: The encoded features are processed by a multi-layer perceptron MLP to obtain the predicted probability distribution.

7. The method according to claim 1, in, The K decoding networks have the same network structure but different network parameters.

8. The method according to claim 1, in, The K decoding networks include any first decoding network; Inputting the first time series samples into K decoding networks corresponding to the K groups respectively for reconstruction to obtain K reconstructed samples, including: A first time segment of the first time segment sample is input into a first decoding network, and the first decoding network predicts a second time segment according to the first time segment, and forms a first reconstructed sample based on the second time segment.

9. The method according to claim 8, in, The first time sequence segment includes the first s indicator values ​​among the n indicator values; the second time sequence segment includes the last s indicator values; wherein s is greater than n / 2.

10. The method according to claim 8, in, Inputting a first time sequence segment of the first time sequence sample into a first decoding network, and the first decoding network predicting a second time sequence segment according to the first time sequence segment, specifically includes: Each indicator value in the first time sequence segment is sequentially input into the first decoding network, and the first decoding network rollingly predicts the next indicator value to form a second time sequence segment.

11. The method according to claim 8, in, Inputting a first time sequence segment of the first time sequence sample into a first decoding network, and the first decoding network predicting a second time sequence segment according to the first time sequence segment, specifically includes: The first time sequence segment is input as a whole into the first decoding network, and the first decoding network obtains a segment representation vector of the first time sequence segment, and predicts a second time sequence segment based on the segment representation vector.

12. The method according to claim 1, in, Determine the total distributed loss, including: According to the predicted probability distribution of each sample in the time series sample set, the overall posterior distribution of each sample in the K groups is obtained; The total distribution loss is determined according to a distribution difference between the preset prior distribution and the overall posterior distribution.

13. The method according to claim 1, in, Determine the total distributed loss, including: Obtaining a sample distribution loss corresponding to the first time series sample according to a distribution difference between the predicted probability distribution of the first time series sample and the preset prior distribution; The total distribution loss is obtained according to the sample distribution losses of the individual samples.

14. A method according to claim 12 or 13, in, The distribution difference is the KL divergence between the distributions.

15. The method according to claim 1, in, Determine the total reconstruction loss, including: For any first decoding network among the K decoding networks, determining a single-network single-sample reconstruction loss of the first decoding network for a first time series sample; Taking K probabilities corresponding to the K decoding networks in the predicted probability distribution of the first time series sample as weights, summing the single-network single-sample reconstruction losses of the K decoding networks for the first time series sample to obtain the single-sample reconstruction loss of the first time series sample; The single sample reconstruction loss of each sample in the time series sample set is summed to obtain the total reconstruction loss.

16. The method according to claim 15, in, Determining a single-network single-sample reconstruction loss of a first decoding network for a first time series sample includes: Obtain a first reconstructed sample of the first time series sample by the first decoding network; The single-network single-sample reconstruction loss is determined according to the difference between the predicted value of each time period in the first reconstructed sample and the indicator value of the corresponding time period in the first time series sample.

17. The method according to claim 15, in, Determining a single-network single-sample reconstruction loss of a first decoding network for a first time series sample includes: For multiple target time periods covered by the reconstructed samples, obtaining a mean and a variance of the distribution of the index value predicted by the first decoding network for each target time period; Determine the distribution deviation of each target period according to the mean and variance of the target period and the index value of the target period in the first time series sample; The single-network single-sample reconstruction loss is determined according to the sum of the distribution deviations of the multiple target time periods.

18. The method according to claim 1, in, According to the total distribution loss and the total reconstruction loss, training the grouping model and the K decoding networks comprises: Combining the total distribution loss and the total reconstruction loss according to a preset weight to obtain a total loss; The parameters in the grouping model and the K decoding networks are adjusted in a direction in which the total loss decreases.

19. A method for grouping time series data. include: Obtain the time series sample to be tested, which includes a sequence consisting of n indicator values ​​of a single business object in n time periods; Input the time series sample to be tested into a grouping model, and output the predicted probability distribution of the time series sample belonging to K groups, wherein the grouping model is trained according to the method of claim 1; Determine a target group with the highest probability value in the predicted probability distribution, and classify the time series samples to be tested into the target group.

20. A method for predicting macro time series data. include: Obtain N time series samples, where each time series sample includes a sequence of n indicator values ​​of a single business object in n time periods; Input each time series sample into a grouping model and output its predicted probability distribution belonging to K groups, wherein the grouping model is trained according to the method of claim 1; Divide each time series sample into the group with the highest probability value in its corresponding prediction probability distribution, thereby obtaining K groups of time series samples; For each group in the K groups of time series samples, aggregating the time series samples in the group to obtain a fused time series sample corresponding to the group; Based on the fused time series samples, determine the prediction index value of the business object subgroup corresponding to the group in the target period; Based on the prediction index values ​​corresponding to the K groups, the macro index value of the total group of business objects in the target time period is determined.

21. A device for training a grouping model, include: An acquisition unit is configured to acquire a time series sample set, wherein any first time series sample includes a sequence consisting of n indicator values ​​of a single business object in n time periods; A grouping processing unit, configured to input the first time series sample into a grouping model to obtain a predicted probability distribution of the sample belonging to K groups; A reconstruction processing unit, configured to input the first time series samples into K decoding networks corresponding to the K groups respectively for reconstruction, to obtain K reconstructed samples; a distribution loss determination unit configured to determine a total distribution loss according to a predicted probability distribution of each sample in the time series sample set and a preset prior distribution of the sample among the K groups; A reconstruction loss determination unit, configured to determine a total reconstruction loss according to the K reconstructed samples corresponding to each sample and the predicted probability distribution; A training unit is configured to train the grouping model and the K decoding networks according to the total distribution loss and the total reconstruction loss.

22. A device for grouping time series data, include: An acquisition unit is configured to acquire a time series sample to be tested, including a sequence consisting of n indicator values ​​of a single business object in n time periods; A model processing unit, configured to input the time series sample to be tested into a grouping model and output a predicted probability distribution of the time series sample belonging to K groups, wherein the grouping model is trained according to the device of claim 21; The grouping unit is configured to determine a target group with the highest probability value in the predicted probability distribution, and classify the time series samples to be tested into the target group.

23. A device for predicting macro time series data, include: An acquisition unit is configured to acquire N time series samples, wherein each time series sample includes a sequence consisting of n indicator values ​​of a single business object in n time periods; a model processing unit configured to input each time series sample into a grouping model and output a predicted probability distribution of the sample belonging to K groups, wherein the grouping model is trained according to the apparatus of claim 21; A grouping unit, configured to group each time series sample into a group with the highest probability value in its corresponding prediction probability distribution, thereby obtaining K groups of time series samples; an aggregation unit configured to aggregate, for each group in the K groups of time series samples, the respective time series samples in the group to obtain a fused time series sample corresponding to the group; A prediction unit, configured to determine a prediction index value of a business object subgroup corresponding to the group in a target time period based on the fused time series samples; The determination unit is configured to determine the macro index value of the total group of business objects in the target time period based on the prediction index values ​​corresponding to the K groups respectively.

24. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the method according to any one of claims 1 to 20.

25. A computing device comprising a memory and a processor, It is characterized in that The memory stores executable codes, and when the processor executes the executable codes, the method according to any one of claims 1 to 20 is implemented.