A method, device and medium for tracking and predicting trajectory data
The meta-learning method is used to cluster initialize and parameter update mobile trajectory data, which solves the problem of cold-start user and path prediction, improves the accuracy of trajectory tracking and prediction, and is suitable for base station scheduling and resource management in mobile communications.
Patent Information
- Application Number
- CN202210779490.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-04
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2042-07-04
AI Technical Summary
Existing mobile trajectory data tracking and prediction models cannot effectively support the prediction of cold-start users and cold-start paths, resulting in reduced tracking and prediction accuracy.
The meta-learning method is used to perform cluster initialization by obtaining the current user's trajectory data to be predicted, obtain network initialization parameters, and input the trajectory data in the support set to the base model for parameter update, generate initialization results and prediction results, and use the loss results Loss handling is performed to improve forecast accuracy.
It effectively solves the problem of cold start user and path prediction, improves the accuracy of trajectory tracking and prediction, and is suitable for base station scheduling and resource management in mobile communications.
Smart Images

Figure CN115098613B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of trajectory tracking technology, and in particular to a method, device and medium for tracking and predicting trajectory data. Background Art
[0002] With the widespread use of mobile smart devices and location services, a large amount of signaling trajectory data has been adopted and persistently stored. This data contains the driving trajectories of a large number of moving objects, which not only depicts the real-time status of each trajectory movement, but also contains rich patterns and laws of trajectory movement, providing unprecedented opportunities for tracking and predicting mobile trajectories. Therefore, more and more applications analyze the behavioral preferences and characteristics of their movement process from trajectory data, explore movement patterns and laws, and thus track and predict mobile trajectories.
[0003] The existing tracking and prediction of mobile trajectory data usually faces cold start users or cold start paths due to data sparsity. For example, cold start users may have very few historical trajectories, while other users may face mobile trajectories in unfamiliar areas. Existing models require a large amount of training data for tracking and prediction. It becomes a serious challenge to discover sequence patterns and user preferences in small sample data such as cold start users or cold start paths. Therefore, they are ineffective in supporting cold start prediction, resulting in reduced accuracy of trajectory tracking and prediction.
[0004] Therefore, it is urgent for those skilled in the art to find a method for tracking and predicting trajectory data. Summary of the invention
[0005] The purpose of the present invention is to provide a method, device and medium for tracking and predicting trajectory data, which solves the problem that the existing model for tracking and prediction cannot support the prediction of cold start users and cold start paths, and at the same time improves the accuracy of trajectory tracking and prediction.
[0006] In order to solve the above technical problems, the present invention provides a method for tracking and predicting trajectory data, comprising:
[0007] Get the trajectory data to be predicted for the current user;
[0008] Initialize the trajectory data to be predicted by clustering to obtain the network initialization parameters;
[0009] The parameters of the first base model are updated according to the network initialization parameters, and the trajectory data in the support set is input into the first base model after the parameter update to obtain an initialization result, and the initialization result is subjected to loss processing to obtain a loss result, wherein the trajectory data in the support set is determined by the relationship between the trajectory data to be predicted and the historical trajectory data corresponding to the user;
[0010] The parameters of the second base model are updated according to the loss result, and the predicted trajectory data in the query set is input into the second base model after parameter update to obtain the prediction result, wherein the data in the query set is the trajectory data to be predicted.
[0011] Preferably, clustering and initializing the trajectory data to be predicted to obtain network initialization parameters includes:
[0012] Get the historical trajectory data of the current user;
[0013] The historical trajectory data is used to construct the spatial distribution of the current user through a weighted strategy;
[0014] The spatial distribution is transformed through the fully connected layer to obtain the current user's travel preference vector;
[0015] The travel preference vector is linearly mapped through the fully connected layer to obtain the query vector;
[0016] The cosine similarity between the query vector and multiple clustering parameters is used to obtain the corresponding similarity scores, and then combined into a similarity matrix;
[0017] Obtain the original parameter memory vector and the network parameters and prediction layer global parameters corresponding to the previous trajectory data to be predicted, where the first parameter memory vector is the original parameter memory vector, the network parameters are obtained by the loss result corresponding to the previous trajectory data to be predicted, and the prediction layer global parameters are obtained by the loss result obtained by the second base model corresponding to the previous trajectory data to be predicted, and the parameters are obtained by processing according to the loss result obtained by the second base model;
[0018] Determine the current parameter memory vector according to the relationship between the network parameters and the original parameter memory vector;
[0019] Determine the network parameter bias based on the relationship between the current parameter memory vector and the similarity matrix;
[0020] The network initialization parameters are obtained according to the relationship between the global parameters of the prediction layer and the network parameter bias.
[0021] Preferably, the trajectory data in the support set is determined by the relationship between the trajectory data to be predicted and the historical trajectory data of the current user, including:
[0022] Get the historical trajectory data of other users except the current user;
[0023] Determine first target trajectory data similar to the trajectory data to be predicted in the historical trajectory data of the current user by using a trajectory similarity strategy;
[0024] Determine second target trajectory data related to the trajectory data to be predicted from the historical trajectory data of other users through a travel preference related strategy;
[0025] The first target trajectory data, the second target trajectory data and the to-be-predicted trajectory subsequence data of the to-be-predicted trajectory data are stored in the support set as trajectory data in the support set.
[0026] Preferably, the process of determining the network parameters corresponding to the loss result includes the following steps:
[0027] Input the trajectory data in the support set into the first base model to obtain the corresponding spatiotemporal prediction vector;
[0028] Determine the corresponding connection vector based on the relationship between multiple spatiotemporal prediction vectors and travel preference vectors;
[0029] Determine the correlation between multiple connection vectors through cosine similarity, and determine the corresponding weight value through the fully connected layer;
[0030] The network parameters corresponding to the loss result are determined according to the relationship between the loss result and the weight value corresponding to the trajectory data in the support set.
[0031] Preferably, the first base model has the same structure as the second base model, wherein the establishment of the first base model comprises the following steps:
[0032] Divide the geographical area corresponding to the trajectory data to be predicted into a plurality of access grids, and convert the access points in the trajectory to be predicted into trajectory data consisting of the plurality of access grids according to the positions of the access points;
[0033] Convert the trajectory data of multiple access grids into corresponding dense vectors;
[0034] Get the time interval and real geographical distance between two adjacent access grids;
[0035] The dense vector, time interval and true geographic distance are input into the spatiotemporal prediction learning model to output the hidden state corresponding to each access point;
[0036] The connection vector is converted into the probability distribution of the next access grid through the FCN fully connected network, and the maximum probability distribution is obtained as the initialization result corresponding to the first basis model, where the connection vector is determined by the relationship between the spatiotemporal prediction vector and the travel preference vector, and the spatiotemporal prediction vector is obtained by the hidden state corresponding to the last access point.
[0037] Preferably, performing loss processing according to the initialization result to obtain a loss result includes:
[0038] Get the one-hot vector of the actual position of the initialization result;
[0039] The corresponding loss result is obtained according to the probability distribution of the one-hot vector and the next access grid.
[0040] Preferably, it also includes:
[0041] Perform loss processing on the prediction results to obtain the final loss result;
[0042] Get the global parameters of the prediction layer corresponding to the final loss result to facilitate the tracking and prediction of the next trajectory data to be predicted.
[0043] In order to solve the above technical problems, the present invention also provides a tracking and prediction device for trajectory data, comprising:
[0044] An acquisition module is used to obtain the trajectory data to be predicted of the current user;
[0045] The initialization module is used to cluster and initialize the trajectory data to be predicted to obtain the network initialization parameters;
[0046] A first input module is used to update the parameters of the first base model according to the network initialization parameters, and input the trajectory data in the support set into the first base model after the parameter update to obtain an initialization result, and perform loss processing on the initialization result to obtain a loss result, wherein the trajectory data in the support set is determined by the relationship between the trajectory data to be predicted and the historical trajectory data corresponding to the user;
[0047] The second input module is used to update the parameters of the second base model according to the loss result, and input the predicted trajectory data in the query set into the second base model after parameter update to obtain the prediction result, wherein the data in the query set is the trajectory data to be predicted.
[0048] In order to solve the above technical problems, the present invention also provides a tracking and prediction device for trajectory data, comprising:
[0049] Memory for storing computer programs;
[0050] A processor is used to implement the steps of the above-mentioned trajectory data tracking and prediction method when executing a computer program.
[0051] In order to solve the above technical problems, the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned trajectory data tracking and prediction method are implemented.
[0052] The present invention provides a method for tracking and predicting trajectory data, including: obtaining the trajectory data to be predicted of the current user; clustering and initializing the trajectory data to be predicted to obtain network initialization parameters; updating the parameters of the first base model according to the network initialization parameters, and inputting the trajectory data in the support set into the first base model after the parameter update to obtain the initialization result, and performing loss processing on the initialization result to obtain the loss result, wherein the trajectory data in the support set is determined by the relationship between the trajectory data to be predicted and the historical trajectory data corresponding to the user; updating the parameters of the second base model according to the loss result, and inputting the predicted trajectory data in the query set into the second base model after the parameter update to obtain the prediction result, wherein the data in the query set is the trajectory data to be predicted. The method obtains the trajectory data to be predicted of the current user, the current user may be a cold start user, and the trajectory data to be predicted may be the trajectory data corresponding to the cold start path, and tracks and predicts the trajectory data to be predicted based on the meta-learning model. Since meta-learning can solve the problem of few samples of mobile signaling trajectories, it solves the problem that the existing model cannot support the prediction of cold start users and cold start paths for tracking and prediction, and at the same time improves the accuracy of trajectory tracking and prediction.
[0053] In addition, the present invention also provides a trajectory data tracking and prediction device and medium, which have the same beneficial effects as the above-mentioned trajectory data tracking and prediction method. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in 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 creative work.
[0055] Figure 1 A flow chart of a method for tracking and predicting trajectory data provided by an embodiment of the present invention;
[0056] Figure 2 A schematic diagram of an application of a trajectory data tracking and prediction method provided by an embodiment of the present invention;
[0057] Figure 3 A schematic diagram of an application of a base model provided by an embodiment of the present invention;
[0058] Figure 4 A structural diagram of a trajectory data tracking and prediction device provided by an embodiment of the present invention;
[0059] Figure 5 A structural diagram of another trajectory data tracking and prediction device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0060] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0061] The core of the present invention is to provide a method, device and medium for tracking and predicting trajectory data, which solves the problem that the existing model for tracking and prediction cannot support the prediction of cold start users and cold start paths, and at the same time improves the accuracy of trajectory tracking and prediction.
[0062] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0063] As people's demand for unimpeded, ubiquitous, high-quality communication services increases, mobile communication providers need to effectively and timely schedule base stations based on user locations. In this context, accurately tracking and predicting mobile trajectories is crucial to determining how to schedule user data between base stations. Therefore, the present invention provides a method for tracking and predicting mobile trajectories to provide high-quality communication services and ensure efficient resource allocation and management in mobile communications. Figure 1 A flow chart of a method for tracking and predicting trajectory data provided by an embodiment of the present invention, such as Figure 1 As shown, the method includes:
[0064] S11: Obtain the trajectory data to be predicted of the current user;
[0065] Specifically, the trajectory data to be predicted of the user is obtained from the historical trajectory data of the user. The user here may be a cold start user, and the trajectory data to be predicted may be trajectory data corresponding to the cold start path, without making a specific distinction.
[0066] Taking the trajectory data T of user A as an example, the trajectory data to be predicted here is partial data of the trajectory data T. Each access point in the trajectory data T is a base station or other special point, for example, divided into l1, l2...lc.
[0067] S12: Initialize the clustering of the trajectory data to be predicted to obtain network initialization parameters;
[0068] The clustering-based network initialization method provides personalized network initialization parameters for each trajectory, so that shared knowledge can be transferred between users with similar travel preferences. This process requires two processes: task clustering and cluster-aware parameter memory.
[0069] Task clustering takes into account the influence of differences between different travel preferences. Shared knowledge should be transferred between similar users according to their travel preferences. Since the user's historical trajectory can not only reflect the starting and ending information of the user's trajectory, but also reflect the user's common path choices, the spatial distribution obtained from the user's historical data can be used to learn the user's travel preferences. We adopt a clustering-based method to group users with similar travel preferences into the same cluster to better transfer shared knowledge between similar users.
[0070] Cluster-aware parameter memory To capture and transfer the potential user preferences and mobility patterns in clusters, we design a cluster-aware parameter memory To store the parameters of the prediction layer in the base model of different clusters. Parameter memory provides personalized network parameters in the initialization step to drive knowledge transfer among users with similar travel preferences.
[0071] S13: updating the parameters of the first base model according to the network initialization parameters, inputting the trajectory data in the support set into the first base model after the parameter update to obtain an initialization result, and performing loss processing on the initialization result to obtain a loss result;
[0072] The trajectory data in the support set is determined by the relationship between the trajectory data to be predicted and the historical trajectory data corresponding to the user;
[0073] A truly effective trajectory sampling method is used to generate a meaningful support set, which can be used to fine-tune the initial network in a personalized way by combining user and trajectory-related knowledge. In order to further adapt the initial network to the current task, it is necessary to use a support set consisting of task-related trajectories to locally update the model. In order to provide sufficient personalized information, the support set is determined based on the relationship between the trajectory data to be predicted and the user's historical trajectory data, and the user-related knowledge and trajectory-related knowledge are combined for fine-tuning.
[0074] It should be noted that the purpose of generating the support set is to provide task-related information to fine-tune the initial network, that is, the first base model, to achieve personalized model adaptation. Since personalization in trajectory tracking and prediction is not only user-oriented but also trajectory-oriented, the support set is expected to contain user (current user and other users) and trajectory-related content.
[0075] The parameters of the first base model are updated according to the network initialization parameters in step S13, and the trajectory data in the support set is input into the first base model after the parameter update to obtain the initialization result. The trajectory data in the support set includes the trajectory data to be predicted of the current user and the historical trajectory data of the user. The initialization result obtained here is obtained for the trajectory data in the support set, wherein the initialization result obtained for the trajectory subsequence data to be predicted of the user's trajectory data to be predicted is also included. It should be noted that the trajectory subsequence data to be predicted of the trajectory data to be predicted in the support set needs to find the trajectory closest to the T trajectory data.
[0076] At the same time, the parameters of the first base model are updated according to the network initialization parameters obtained in step S12, and prediction is continued according to each trajectory in the support set through the first base model with updated parameters to obtain the initialization result, and then the loss result is obtained based on the initialization result. The loss function in the loss processing is the negative log-likelihood value of the true future position.
[0077] S14: updating the parameters of the second base model according to the loss result, and inputting the predicted trajectory data in the query set into the second base model after the parameter update to obtain the prediction result;
[0078] The data in the query set is the trajectory data to be predicted.
[0079] Considering that the generated support set contains the trajectory data of the current user and other users at the same time, and each trajectory has a different spatial distribution, suboptimal results may result if the weights are the same. Therefore, a reasonable weight is adaptively assigned to each trajectory in the support set. The weight can be generated based on the correlation between the trajectories in the support set, or based on the correlation between the preferred movement trajectories of the current user and other users, or both. The network parameters obtained by weighted summation of the loss results according to the weight values are used for parameter update of the second base model to achieve local update.
[0080] At the same time, the trajectory data of user T in the query set, that is, the trajectory data to be predicted and the network parameters are input into the second base model to obtain the prediction result of the current user, that is, the trajectory data of lc+1 to complete the current prediction content.
[0081] The present invention provides a method for tracking and predicting trajectory data, including: obtaining the trajectory data to be predicted of the current user; clustering and initializing the trajectory data to be predicted to obtain network initialization parameters; updating the parameters of the first base model according to the network initialization parameters, and inputting the trajectory data in the support set into the first base model after the parameter update to obtain the initialization result, and performing loss processing on the initialization result to obtain the loss result, wherein the trajectory data in the support set is determined by the relationship between the trajectory data to be predicted and the historical trajectory data corresponding to the user; updating the parameters of the second base model according to the loss result, and inputting the predicted trajectory data in the query set into the second base model after the parameter update to obtain the prediction result, wherein the data in the query set is the trajectory data to be predicted. The method obtains the trajectory data to be predicted of the current user, the current user may be a cold start user, and the trajectory data to be predicted may be the trajectory data corresponding to the cold start path, and tracks and predicts the trajectory data to be predicted based on the meta-learning model. Since meta-learning can solve the problem of few samples of mobile signaling trajectories, it solves the problem that the existing model cannot support the prediction of cold start users and cold start paths for tracking and prediction, and at the same time improves the accuracy of trajectory tracking and prediction.
[0082] Based on the above embodiment, the step S12 of clustering and initializing the trajectory data to be predicted to obtain network initialization parameters includes:
[0083] Get the historical trajectory data of the current user;
[0084] The historical trajectory data is used to construct the spatial distribution of the current user through a weighted strategy;
[0085] The spatial distribution is transformed through the fully connected layer to obtain the current user's travel preference vector;
[0086] The travel preference vector is linearly mapped through the fully connected layer to obtain the query vector;
[0087] The cosine similarity between the query vector and multiple clustering parameters is used to obtain the corresponding similarity scores, and then combined into a similarity matrix;
[0088] Obtain the original parameter memory vector and the network parameters and prediction layer global parameters corresponding to the previous trajectory data to be predicted, where the first parameter memory vector is the original parameter memory vector, the network parameters are obtained by the loss result corresponding to the previous trajectory data to be predicted, and the prediction layer global parameters are obtained by the loss result obtained by the second base model corresponding to the previous trajectory data to be predicted, and the parameters are obtained by processing according to the loss result obtained by the second base model;
[0089] Determine the current parameter memory vector according to the relationship between the network parameters and the original parameter memory vector;
[0090] Determine the network parameter bias based on the relationship between the current parameter memory vector and the similarity matrix;
[0091] The network initialization parameters are obtained according to the relationship between the global parameters of the prediction layer and the network parameter bias.
[0092] Specifically, obtain the historical trajectory data of the current user, Figure 2 A schematic diagram of an application of a trajectory data tracking and prediction method provided by an embodiment of the present invention, such as Figure 2 As shown in Figure 1, the spatial distribution of the current user is constructed by weighting the historical trajectory data. Since each user has his or her own familiar areas and path choices, the user's travel preferences are of great significance for tracking and predicting mobile trajectories. Personal historical data can not only indicate the starting and ending information of his or her path and the areas he or she frequently visits, but also his or her common movement paths. Therefore, by constructing the spatial distribution of the user's historical trajectory, his or her travel preferences can be learned. The spatial distribution of user u is defined as , where m represents the total number of grids, Representation Grid In order to represent the access frequency of each grid and its unique importance to the user, the TF-IDF weighting strategy is used to construct the spatial distribution of users. The formula is as follows:
[0093]
[0094]
[0095] in, for Grid in user history track The frequency in express Appear in The number of times in All grids in The total number of occurrences in ; for For the distinguishing ability of user u, is the total number of users, The historical trajectory includes The number of users.
[0096] In order to obtain the spatial distribution of user u The user travel preference is learned by two fully connected layers connected by activation function. Converted into a low-dimensional vector representing the current user's travel preference .
[0097] In order to realize the cluster allocation of each historical trajectory data to its users, according to the obtained travel preference vector , linearly map it through the fully connected layer to obtain the query vector , the formula is as follows:
[0098]
[0099] in, is the weight, is the preset parameter;
[0100] Based on the query vector and the clustering parameters of each learned cluster center Perform cosine similarity to get the corresponding similarity score , the formula is as follows:
[0101]
[0102] in, The query vector With cluster center The cosine similarity between them, K is the number of clusters. It should be noted that the centers of all clusters are randomly initialized before training and are continuously updated during training. Based on the obtained similarity scores, the similarity matrix is combined , which is the query vector The similarity matrix consists of the similarity scores between different cluster centers.
[0103] The current cluster-aware parameter memory is used to store the parameters of the prediction layer in the base model of different clusters, so the network parameters corresponding to the previous trajectory data to be predicted are obtained. , prediction layer global parameters And the current original parameter memory vector , wherein the global parameters of the prediction layer are obtained by processing the loss result obtained by the second base model corresponding to the previous trajectory data to be predicted, and the loss result obtained by the second model.
[0104] The current parameter memory vector is determined based on the relationship between the network parameters and the original parameter memory vector for updating. The formula is as follows:
[0105]
[0106] in, is the tensor product, for The update rate, are the parameters of the prediction layer after learning on the support set.
[0107] Memory vector according to current parameters With the similarity matrix The relationship between the network parameters and the bias is determined by , the formula is as follows:
[0108]
[0109] in, The d in it is the input vector dimension of the prediction layer, and m is the total number of all grids.
[0110] The network parameter bias is regarded as a personalized bias term. The trajectory can learn the shared knowledge in each cluster based on the generalized knowledge. Based on the network parameter bias, the personalized initial parameters of the prediction layer are obtained, that is, the network initialization parameters. According to the global parameters of the prediction layer and network parameter bias The relationship between the network initialization parameters is obtained , the formula is as follows:
[0111]
[0112] in, is the global parameter of the prediction layer, Used to control initialization parameters How much to consider Personalized update rate.
[0113] In summary, cluster-aware parameter memory has two structures: a read head for retrieving memory and a write head for updating memory. The read head retrieves network parameters from memory based on the similarity score between the trajectory and each cluster. ; The write head is the cluster-aware parameter memory vector that will be updated during training.
[0114] The embodiment of the present invention provides personalized network initialization parameters for each task. Compared with traditional cloud learning, which learns a global shared initial network for all tasks, different users may have different travel preferences and mobility patterns, which can be reflected in different trajectory start and end information and path selection in historical trajectory data. This avoids ignoring individual travel preferences, mixing irrelevant mobility patterns, and producing suboptimal results, so that shared knowledge can be transferred between users with similar travel preferences, and personalized network initialization parameters can be provided.
[0115] On the basis of the above embodiment, the trajectory data in the support set in step S13 is determined by the relationship between the trajectory data to be predicted and the historical trajectory data of the current user, including:
[0116] Get the historical trajectory data of other users except the current user;
[0117] Determine first target trajectory data similar to the trajectory data to be predicted in the historical trajectory data of the current user by using a trajectory similarity strategy;
[0118] Determine second target trajectory data related to the trajectory data to be predicted from the historical trajectory data of other users through a travel preference related strategy;
[0119] The first target trajectory data, the second target trajectory data and the to-be-predicted trajectory subsequence data of the to-be-predicted trajectory data are stored in the support set as trajectory data in the support set.
[0120] Specifically, considering that the trajectories in the support set come from different users and have different spatial distributions, a weight generator is designed to assign different weights to different trajectories to achieve effective model adaptation.
[0121] In order to combine user-related knowledge, the user's own data should be used to learn the user's travel preferences. First, query the subsequence of the trajectory data to be predicted Usually follows the travel preferences of the query user and has the same sequence pattern as the query trajectory, so it should be included in the support set. In addition, the user's historical data can reflect their familiar areas and common route choices, thus indicating personal travel preferences. However, the support set should be small enough to avoid excessive computational costs, so the support set only needs to contain a portion of the most relevant personal data.
[0122] The support set is generated based on trajectory similarity and preference proximity. Trajectory similarity, since related trajectories are usually Subsequences with high similarity are selected from the user's historical trajectory The most similar trajectories Fine-tune, that is, the first target trajectory data, where the similarity According to The longest common subsequence (LCSS) is calculated using the following formula:
[0123]
[0124]
[0125] in, yes The trajectory subsequence consisting of the first t visited grids, yes The tth visited grid, yes and The length of the longest common subsequence of .
[0126] Since the support set also needs to contain knowledge related to the trajectory, more related trajectories should be further utilized to learn the sequential pattern of the query trajectory. Since trajectories with high spatial similarity tend to have similar movement patterns, the most similar trajectories should be used to provide knowledge related to the trajectory. However, trajectories with different user preferences may have completely different subsequent movements even if they are spatially similar. Therefore, not only the spatial similarity of the trajectories but also the proximity of user preferences are considered to measure the relevance of the trajectories.
[0127] Select from other users' history tracks Most relevant tracks , that is, the second target trajectory data is fine-tuned, and its travel preference correlation The formula is as follows:
[0128]
[0129] in, is the similarity calculated by the longest common subsequence, is the cosine similarity of user preferences.
[0130] The first target trajectory data, the second target trajectory data and the to-be-predicted trajectory subsequence data of the to-be-predicted trajectory data are stored in the support set as the trajectory data in the support set, which is expressed as follows: .
[0131] in, is the to-be-predicted trajectory subsequence data of the to-be-predicted trajectory data, is the first target trajectory data, that is, the user's relevant historical data, is the second target trajectory data, which is spatially similar trajectory data.
[0132] The data generation of the support set provided in this embodiment provides task-related information to fine-tune the initial network to achieve personalized model adaptation. In addition to personal data, the support set should also contain spatially similar trajectories to include trajectory-related information for model adaptation, which enables more accurate predictions even when the user is in an unfamiliar area.
[0133] Based on the above embodiment, all samples in the existing support set use the same weight to fine-tune the initial network, which is based on the assumption that all samples are equally important for the model to adapt to the current task. However, in reality, the trajectories in the support set come from users with different travel preferences and have different spatial distributions. They have different degrees of importance for model adaptation. Therefore, different trajectories should have different weights. However, the existing methods ignore the differences in trajectories in the support set and their different importance for model fine-tuning. The process of determining the network parameters corresponding to the loss result includes the following steps:
[0134] Input the trajectory data in the support set into the first base model to obtain the corresponding spatiotemporal prediction vector;
[0135] Determine the corresponding connection vector based on the relationship between multiple spatiotemporal prediction vectors and travel preference vectors;
[0136] Determine the correlation between multiple connection vectors through cosine similarity, and determine the corresponding weight value through the fully connected layer;
[0137] The network parameters corresponding to the loss result are determined according to the relationship between the loss result and the weight value corresponding to the trajectory data in the support set.
[0138] Specifically, considering that the generated support set contains both personal and other users' knowledge, and each trajectory has a different spatial distribution, their equal weights may lead to suboptimal results. Therefore, it is necessary to design a weight generator to adaptively assign a reasonable weight to each trajectory in the support set to achieve effective model adaptation. In order to reasonably assign weights to different trajectories, the correlation between trajectories should be fully considered. Intuitively, trajectories with highly similar spaces can more accurately reflect the sequential pattern of the query trajectory, so they are expected to obtain higher weights.
[0139] Similarly, mobile trajectories with similar user preferences should also be given higher weights. Therefore, the weight distribution should consider both the spatial similarity of trajectories and the closeness between user preferences. The spatiotemporal prediction vector representation learned by STLSTM and the user's travel preference vector representation concatenate to take both factors into account, i.e. concatenate the vector Then, the correlation between trajectories is measured by calculating their cosine similarity, and a fully connected layer is used to obtain the weights, which is formulated as follows:
[0140]
[0141] in, Represents the generated support set The jth track in, T is a singleton query set The query trajectory in yes and The cosine similarity between .
[0142] The network parameters corresponding to the loss results are determined according to the relationship between the loss results and the weight values corresponding to the trajectory data in the support set, and the network parameters are obtained by weighted sum.
[0143] Specifically, in traditional neural networks, parameters are randomly initialized and converge to a good local optimum under a large amount of training data. Similarly, local updates aim to fine-tune the initial network to pass a meaningful support set. To adapt to each task. First, the local network parameters Initial parameters shared globally It is deduced that: In particular, the parameters of the prediction layer of the base model are memorized according to the cluster-aware parameter memory. A personalized initialization is performed to transfer the shared knowledge in each cluster. Then, the generated support set is minimized. Each track The prediction loss , using the generated weights Update the local network weightedly, the formula is as follows:
[0144]
[0145] Among them, β is the learning rate of local update, Denote the generated support set The trajectory in The generated weights.
[0146] The embodiment of the present invention provides a method for allocating a reasonable weight to each track in the adaptive support set by setting a weight generator, thereby avoiding suboptimal results and obtaining a network parameter to be updated.
[0147] On the basis of the above embodiment, the base model tracks and predicts the trajectory based on the partial trajectory that has been traveled, which includes trajectory modeling, modeling of user travel preferences and final trajectory tracking and prediction. The first base model and the second base model mentioned in the present invention have the same structure, and the establishment of the first model includes the following steps:
[0148] Divide the geographical area corresponding to the trajectory data to be predicted into a plurality of access grids, and convert the access points in the trajectory to be predicted into trajectory data consisting of the plurality of access grids according to the positions of the access points;
[0149] Convert the trajectory data of multiple access grids into corresponding dense vectors;
[0150] Get the time interval and real geographical distance between two adjacent access grids;
[0151] The dense vector, time interval and true geographic distance are input into the spatiotemporal prediction learning model to output the hidden state corresponding to each access point;
[0152] The connection vector is converted into the probability distribution of the next access grid through the FCN fully connected network, and the maximum probability distribution is obtained as the initialization result corresponding to the first basis model, where the connection vector is determined by the relationship between the spatiotemporal prediction vector and the travel preference vector, and the spatiotemporal prediction vector is obtained by the hidden state corresponding to the last access point.
[0153] Specifically, Figure 3 A schematic diagram of an application of a base model provided by an embodiment of the present invention, such as Figure 3 As shown, given a trajectory T of user u, the driving part of the trajectory , that is, the geographical area corresponding to the trajectory data to be predicted is divided into multiple access grids, according to the access points in the trajectory to be predicted c The position is converted into trajectory data composed of multiple access grids. The trajectory data of multiple access grids are further converted into corresponding dense vectors, that is, the search layer is applied to convert each access grid in the sequence The one-hot vector is converted to a dense vector representation , so that the travel part of the trajectory can be Expressed as .
[0154] Then, the time interval and real geographical distance between two adjacent access grids are obtained, and the dense vector, time interval and real geographical distance are further input into the spatiotemporal prediction learning model to output the hidden state corresponding to each access point. Therefore, the spatial-temporal long-short term memory model (Spatial-Temporal Long-Short Term Memory, STLSTM) is used to model the sequence information of the driving trajectory, and the formula is as follows:
[0155]
[0156] in, , and is 0, represents the hidden state of STLSTM at step j, is the dimension of the hidden state vector; and Represents consecutive access points and The time interval and real geographical distance between them.
[0157] In trajectory tracking and prediction, trajectory sequence information and user travel preferences are combined to complete the tracking and prediction tasks. The connection vector is converted into the probability distribution of the next access grid through the FCN fully connected network, and the formula is as follows:
[0158]
[0159]
[0160] in, Represents the probability distribution of the grid. FCN is a fully connected network consisting of two fully connected layers. It is determined by the parameters The prediction layer (i.e., fully connected layer) is composed of , which maps the vector obtained by FCN to the probability distribution. is the maximum probability distribution.
[0161] It should be noted that the maximum probability distribution is obtained as the initialization result corresponding to the first base model, wherein the connection vector in this example is determined by the relationship between the spatiotemporal prediction vector and the appearance preference vector, which has been described in detail in the above embodiment and will not be described here. The spatiotemporal prediction vector is obtained based on the hidden state corresponding to the last access point.
[0162] The base model provided by the embodiment of the present invention is aimed at few-sample learning. By learning a generalized initial network for all tasks and then fine-tuning the network using a small number of instances of the new task, rapid adaptation to new tasks can be achieved.
[0163] Based on the above embodiment, the step S13 of performing loss processing according to the initialization result to obtain the loss result includes:
[0164] Get the one-hot vector of the actual position of the initialization result;
[0165] The corresponding loss result is obtained according to the probability distribution of the one-hot vector and the next access grid.
[0166] Specifically, using cross entropy as the loss function is a multi-class logarithmic loss function that often corresponds to the softmax classifier. Its specific formula is as follows:
[0167]
[0168] in, is the one-hot representation of the true position and m is the number of target grids.
[0169] The loss result obtained in the embodiment of the present invention facilitates the subsequent updating of the base model parameters.
[0170] In a specific embodiment, the network is globally updated using query sets of multiple tasks to learn a globally shared initial network. Therefore, the method further includes:
[0171] Perform loss processing on the prediction results to obtain the final loss result;
[0172] Get the global parameters of the prediction layer corresponding to the final loss result to facilitate the tracking and prediction of the next trajectory data to be predicted.
[0173] Specifically, according to each training trajectory Query set The sum of the losses on the , one-step gradient descent is used to update the global parameters , the formula is as follows.
[0174]
[0175] in, is the learning rate for global update, is the training set, is the query set of trajectory T Both local and global updates are calculated via back-propagation.
[0176] The parameters of the global update model provided by the embodiment of the present invention are used for updating the parameters of subsequent tasks, thereby improving the tracking and prediction accuracy of the model.
[0177] The above describes in detail various embodiments corresponding to the method for tracking and predicting trajectory data. On this basis, the present invention also discloses a device for tracking and predicting trajectory data corresponding to the above method. Figure 4 The structure diagram of a trajectory data tracking and prediction device provided by an embodiment of the present invention. Figure 4 As shown, the tracking and prediction device of trajectory data includes:
[0178] An acquisition module 11 is used to acquire the trajectory data to be predicted of the current user;
[0179] Initialization module 12, used to cluster and initialize the trajectory data to be predicted to obtain network initialization parameters;
[0180] The first input module 13 is used to update the parameters of the first base model according to the network initialization parameters, and input the trajectory data in the support set to the first base model after the parameter update to obtain an initialization result, and perform loss processing on the initialization result to obtain a loss result, wherein the trajectory data in the support set is determined by the relationship between the trajectory data to be predicted and the historical trajectory data corresponding to the user;
[0181] The second input module 14 is used to update the parameters of the second base model according to the loss result, and input the predicted trajectory data in the query set into the second base model after parameter update to obtain the prediction result, wherein the data in the query set is the trajectory data to be predicted.
[0182] Since the embodiments of the device part correspond to the above embodiments, please refer to the description of the embodiments of the method part for the embodiments of the device part, and will not be repeated here.
[0183] For an introduction to a trajectory data tracking and prediction device provided by the present invention, please refer to the above method embodiment, and the present invention will not be repeated here. It has the same beneficial effects as the above trajectory data tracking and prediction method.
[0184] Figure 5 A structural diagram of another trajectory data tracking and prediction device provided by an embodiment of the present invention, such as Figure 5 As shown, the device comprises:
[0185] A memory 21, used for storing computer programs;
[0186] The processor 22 is used to implement the steps of the trajectory data tracking and prediction method when executing the computer program.
[0187] The trajectory data tracking and prediction device provided in this embodiment may include but is not limited to a tablet computer, a laptop computer, or a desktop computer.
[0188] Among them, the processor 22 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 22 may be implemented in at least one hardware form of a digital signal processor (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The processor 22 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 22 may be integrated with a graphics processing unit (GPU), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 22 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.
[0189] The memory 21 may include one or more computer-readable storage media, which may be non-transitory. The memory 21 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 21 is at least used to store the following computer program 211, wherein, after the computer program is loaded and executed by the processor 22, it can implement the relevant steps of the tracking and prediction method of trajectory data disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 21 may also include an operating system 212 and data 213, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 212 may include Windows, Unix, Linux, etc. Data 213 may include, but is not limited to, data involved in the tracking and prediction method of trajectory data, etc.
[0190] In some embodiments, the trajectory data tracking and prediction device may further include a display screen 23 , an input and output interface 24 , a communication interface 25 , a power supply 26 , and a communication bus 27 .
[0191] Those skilled in the art can understand that Figure 5 The structure shown in the figure does not constitute a limitation on the apparatus for tracking and predicting trajectory data, and may include more or fewer components than those shown in the figure.
[0192] The processor 22 implements the trajectory data tracking and prediction method provided by any of the above embodiments by calling the instructions stored in the memory 21 .
[0193] For an introduction to a trajectory data tracking and prediction device provided by the present invention, please refer to the above method embodiment, and the present invention will not be repeated here. It has the same beneficial effects as the above trajectory data tracking and prediction method.
[0194] Furthermore, the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by the processor 22, the steps of the above-mentioned trajectory data tracking and prediction method are implemented.
[0195] It is understandable that if the method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc. Various media that can store program codes.
[0196] For an introduction to a computer-readable storage medium provided by the present invention, please refer to the above method embodiment, which will not be described in detail herein. The computer-readable storage medium has the same beneficial effects as the above trajectory data tracking and prediction method.
[0197] As a specific embodiment, the proposed model is implemented based on the Pytorch framework and trained using the Adam optimizer. For the real-world trajectory dataset, all trajectories are randomly divided into 70% for training, 10% for validation, and the remaining 20% for testing. The network is trained according to the following parameter settings: the embedding vector size of the grid is 100, the dimension of the user preference vector is 10, the input vector dimension of the prediction layer is 64. The initial learning rates β and λ for local and global updates are 0.01 and 0.0001 respectively. The personalization update rate τ is 0.05, and the update rate γ for parameter memory is 0.01.
[0198] To evaluate the effectiveness of their approach, the base model PTP is compared with state-of-the-art trajectory tracking and prediction models (DespPD, Flashback, DeepMove, STLSTM, HST-LSTM). The MetaPTP model adopted by the selected method is compared with methods for handling the cold start problem, namely, the transfer learning-based model PTP-FT and the meta-learning-based model MAML. The same base model PTP is used for PTP-FT, MAML and MetaPTP. In addition, the model is further compared with several of its variants to evaluate the effectiveness of each module in MetaPTP, including MetaPTP-I, which removes the soft clustering-based initialization method and uses the same initial network for all tasks, MetaPTP-US, which only uses the query trajectory subsequence as the support set for fine-tuning, MetaPTP-U, which only uses the query trajectory subsequence and spatially similar trajectories as the support set for fine-tuning, MetaPTP-S, which only uses the query trajectory subsequence and the user's historical data as the support set for fine-tuning, and MetaPTP-W, which removes the adaptive weight generator and uses the same weights for all trajectories in the support set. The specific experimental results are shown in Table 1:
[0199] Table 1: Comparison of experimental results
[0200]
[0201] As can be seen from the table above, the base model PTP performs better than all existing trajectory tracking and prediction methods. Among them, STLSTM is the best method among the existing methods except for the hierarchical expansion model HST-LSTM. This is because STLSTM adopts a good method to fuse spatiotemporal information and sequence information. Therefore, STLSTM is continued to be used for trajectory modeling. PTP further models user preferences based on the spatial distribution of users, thereby improving all indicators.
[0202] The base model PTP is the most effective meta-learning base model for trajectory tracking and prediction. In addition, the performance of the transfer learning-based model (PTP-FT) and the meta-learning-based model (MAML and MetaPTP) are better than the base model, indicating that both transfer learning and meta-learning can alleviate the cold start problem to a certain extent. However, the performance of PTP-FT is not as good as MAML, which proves that meta-learning performs better than transfer learning in the few-shot problem of trajectory prediction because it can capture generalized knowledge between different trajectories. Finally, MetaPTP further improves the performance of MAML, demonstrating the superiority of the model. This can be explained by the fact that MetaPTP can not only provide personalized network initialization through soft clustering methods, but also support effective model adaptation through meaningful support sets and weight generators.
[0203] By experimental comparison with the model variants, it can be seen that MetaPTP-I performs worse than MetaPTP because a global shared network is directly used to initialize the models for all tasks, which proves that the soft clustering-based approach helps to obtain a suitable initial network for each trajectory and transfer shared knowledge between users with similar travel preferences. MetaPTP-US performs worse than MetaPTP, which confirms that the generated support set is useful for personalized adaptation. In addition, both MetaPTP-S and MetaPTP-U perform better than MetaPTP-US, which further proves that users' own data and spatially similar trajectories can provide meaningful user- and trajectory-related knowledge for discovering users' travel preferences and sequential patterns of trajectories. For the weight generator, MetaPTP-W performs worse than MetaPTP, which shows that the trajectories in the support set are expected to obtain reasonable weights, which effectively adapts the initial network to each task. Finally, MetaPTP successfully achieves the best performance over all variants.
[0204] The network initialization method based on soft clustering is necessary to obtain a personalized initialized network for each task. In addition, the generated support set is also important for model fine-tuning by combining user and trajectory related knowledge, and the weight generator contributes to effective model adaptation by assigning reasonable weights to each trajectory in the support set.
[0205] The above is a detailed introduction to a method, device and medium for tracking and predicting trajectory data provided by the present invention. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the embodiments can refer to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can refer to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.
[0206] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises", "comprising" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
Claims
1. A method for tracking and predicting trajectory data, characterized in that: include: Get the trajectory data to be predicted for the current user; Initialize the trajectory data to be predicted by clustering to obtain network initialization parameters; updating the parameters of the first base model according to the network initialization parameters, inputting the trajectory data in the support set into the first base model after the parameter update to obtain an initialization result, and performing loss processing on the initialization result to obtain a loss result, wherein the trajectory data in the support set is determined by the relationship between the trajectory data to be predicted and the historical trajectory data corresponding to the user; The parameters of the second base model are updated according to the loss result, and the predicted trajectory data in the query set is input into the second base model after parameter update to obtain a prediction result, wherein the data in the query set is the trajectory data to be predicted.
2. The method for tracking and predicting trajectory data according to claim 1, characterized in that: The clustering initialization of the trajectory data to be predicted to obtain network initialization parameters includes: Obtaining the historical trajectory data of the current user; Constructing the spatial distribution of the current user from the historical trajectory data through a weighted strategy; The spatial distribution is converted through a fully connected layer to obtain the travel preference vector of the current user; Linearly mapping the travel preference vector through the fully connected layer to obtain a query vector; Performing cosine similarity test on the query vector and multiple clustering parameters to obtain corresponding similarity scores, and combining them into a similarity matrix; Obtaining an original parameter memory vector and network parameters and prediction layer global parameters corresponding to the previous trajectory data to be predicted, wherein the first parameter memory vector is the original parameter memory vector, the network parameters are obtained by the loss result corresponding to the previous trajectory data to be predicted, and the prediction layer global parameters are obtained by the loss result obtained by the second base model corresponding to the previous trajectory data to be predicted, and the parameters are obtained by processing according to the loss result obtained by the second base model; Determine a current parameter memory vector according to the relationship between the network parameter and the original parameter memory vector; Determining a network parameter bias according to a relationship between the current parameter memory vector and the similarity matrix; The network initialization parameter is obtained according to the relationship between the prediction layer global parameter and the network parameter bias.
3. The method for tracking and predicting trajectory data according to claim 2, characterized in that: The trajectory data in the support set is determined by the relationship between the trajectory data to be predicted and the historical trajectory data of the current user, including: Obtain historical trajectory data of other users except the current user; Determining first target trajectory data similar to the trajectory data to be predicted from the historical trajectory data of the current user by using a trajectory similarity strategy; Determining second target trajectory data related to the trajectory data to be predicted from the historical trajectory data of the other users by using a travel preference related strategy; The first target trajectory data, the second target trajectory data, and the to-be-predicted trajectory subsequence data of the to-be-predicted trajectory data are stored in the support set as trajectory data in the support set.
4. The method for tracking and predicting trajectory data according to claim 3, characterized in that: The process of determining the network parameters corresponding to the loss result includes the following steps: Inputting the trajectory data in the support set into the first base model to obtain a corresponding spatiotemporal prediction vector; Determine a corresponding connection vector based on the relationship between the plurality of spatiotemporal prediction vectors and the travel preference vector; Determine the correlation between the plurality of connection vectors by means of cosine similarity, and determine the corresponding weight value by means of the fully connected layer; The network parameter corresponding to the loss result is determined according to the relationship between the loss result corresponding to the trajectory data in the support set and the weight value.
5. The method for tracking and predicting trajectory data according to claim 4, characterized in that: The first base model has the same structure as the second base model, wherein the establishment of the first base model comprises the following steps: Dividing the geographical area corresponding to the trajectory data to be predicted into a plurality of access grids, and converting into trajectory data consisting of a plurality of the access grids according to the positions of the access points in the trajectory to be predicted; Converting the trajectory data of the plurality of access grids into corresponding dense vectors; Obtaining the time interval and the real geographical distance between two adjacent access grids; Inputting the dense vector, the time interval and the real geographical distance into a spatiotemporal prediction learning model to output a hidden state corresponding to each of the access points; The connection vector is converted into a probability distribution of the next access grid through an FCN fully connected network, and the maximum probability distribution is obtained as the initialization result corresponding to the first base model, wherein the connection vector is determined by the relationship between the spatiotemporal prediction vector and the travel preference vector, and the spatiotemporal prediction vector is obtained by the hidden state corresponding to the last access point.
6. The method for tracking and predicting trajectory data according to claim 5, characterized in that: Performing loss processing according to the initialization result to obtain a loss result includes: Obtaining a one-hot vector of the actual position of the initialization result; The corresponding loss result is obtained according to the probability distribution of the one-hot vector and the next access grid.
7. The method for tracking and predicting trajectory data according to any one of claims 2 to 6, characterized in that: Also includes: Performing loss processing on the prediction result to obtain a final loss result; The prediction layer global parameters corresponding to the final loss result are obtained to facilitate tracking and prediction of the next trajectory data to be predicted.
8. A trajectory data tracking and prediction device, characterized in that: include: An acquisition module is used to obtain the trajectory data to be predicted of the current user; An initialization module, used to cluster and initialize the trajectory data to be predicted to obtain network initialization parameters; a first input module, configured to update the parameters of the first base model according to the network initialization parameters, input the trajectory data in the support set into the first base model after the parameter update to obtain an initialization result, and perform loss processing on the initialization result to obtain a loss result, wherein the trajectory data in the support set is determined by the relationship between the trajectory data to be predicted and the historical trajectory data corresponding to the user; A second input module is used to update the parameters of the second base model according to the loss result, and input the predicted trajectory data in the query set into the second base model after parameter update to obtain a prediction result, wherein the data in the query set is the trajectory data to be predicted.
9. A device for tracking and predicting trajectory data, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the trajectory data tracking and prediction method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the trajectory data tracking and prediction method according to any one of claims 1 to 7 are implemented.
