Track user association method based on semantic perception and space-time coding
By combining semantic enhancement and multi-frequency sinusoidal spatiotemporal coding with dual-stream transfer learning, the problem of insufficient prediction accuracy and generalization ability of trajectory user association technology in cross-city scenarios is solved, realizing efficient trajectory user association service, which is suitable for large-scale location services and complex dynamic scenarios.
Patent Information
- Application Number
- CN202511682625.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-17
- Publication Date
- 2026-02-13
AI Technical Summary
Existing trajectory user association technologies struggle to simultaneously achieve prediction accuracy, cross-city generalization capability, and computational efficiency in large-scale location services and complex dynamic scenarios, primarily due to their narrow spatiotemporal insight and insufficient cross-city generalization capability.
A semantic enhancement module is used to encode POI categories, and a multi-frequency sinusoidal spatiotemporal coding module is used to encode check-in timestamps and geographic coordinates. Cross-city trajectory user association is achieved through a dual-stream transfer learning network, including learning protocols in the pre-training and fine-tuning stages.
It significantly improves the prediction accuracy and generalization ability of trajectory user association, reduces computational overhead, is suitable for large-scale cross-city trajectory data scenarios, and has good scalability and commercial potential.
Smart Images

Figure CN121524746A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of location services and user behavior analysis technology, and more specifically to a trajectory user association method based on semantic perception and spatiotemporal coding. Background Technology
[0002] With the rapid development of location-based services (LBS) and geotagging systems, platforms such as Weibo and WeChat have generated a large amount of check-in data, which provides an important foundation for understanding human mobility patterns. Utilizing check-in data to understand human mobility patterns has made rapid progress in downstream applications such as point-of-interest (POI) recommendation, crime prediction, and route recommendation. As a fundamental task, trajectory-user linking (TUL) aims to accurately associate trajectories with their generators (users) and has become an important research direction in the field of human mobility behavior mining.
[0003] In addressing the TUL problem, early methods such as similarity-based methods (Ying et al. 2011) and Markov-based methods (Rendle et al. 2010) have proven effective in clustering or aligning trajectories for specific users. In recent years, methods utilizing deep neural networks, such as recurrent networks (Gao et al. 2017), have significantly advanced the field. Furthermore, employing variational autoencoders (VAEs) (Zhou et al. 2018) or generative adversarial networks (GANs) (Zhou et al. 2021b) through probabilistic structure modeling has improved the ability to handle incomplete trajectories.
[0004] To enrich the semantic context of individual trajectories, several studies have advanced spatiotemporal knowledge modeling through temporal embedding (Miao et al. 2020) and geographic mapping (Li et al. 2024). Furthermore, employing graph structures in the context of dependency learning has proven to be an effective method for capturing spatial interactions. For example, GNNTUL (Zhou et al. 2021a) effectively integrates geographic and temporal information through graph learning, while GraphTUL (Gao et al. 2022) combines spatial associations and user preferences through contextual graph definitions. AttnTUL (Chen et al. 2024) and TULMGAT (Li et al. 2025) enrich graph modeling to capture complex spatial dependencies through grid mapping and attention mechanisms. MainTUL (Chen et al. 2022) is the first model to jointly integrate POI identifiers, access times, and POI categories, using RNNs and Transformers to extract historical knowledge.
[0005] However, existing solutions face two main challenges: (1) narrow spatiotemporal insights; and (2) insufficient cross-city generalization. Specifically, they often rely excessively on POI identifiers in check-in data and extensively explore the dynamic characteristics of POI sequences (i.e., typical time-series tasks). Even those methods that integrate POI category / activity semantics learn information representations only from task-specific training data, limiting check-in embeddings to the context of specific cities (city level), training tasks (task level), and access order (trajectory level). Therefore, these trajectory representations fail to capture the inherent characteristics of POIs as geographic entities, thus ignoring important real-world spatiotemporal insights. This limitation hinders the model's ability to capture cross-city semantic relevance and significantly impairs transferability. In particular, in terms of temporal semantic representation, relying solely on timestamp encoding or fixed-period assumptions cannot effectively capture multi-scale periodic patterns. Spatially, raw latitude and longitude coordinates cause the model to be overly sensitive to small location changes, while fixed grid partitioning sacrifices fine-grained details and introduces discontinuous encoding artifacts at grid boundaries.
[0006] Existing technologies struggle to simultaneously balance prediction accuracy, cross-city generalization capability, and computational efficiency, limiting the application of trajectory user association technology in large-scale location services and complex dynamic scenarios.
[0007] Therefore, it is necessary to propose a trajectory user association method based on semantic perception and spatiotemporal coding to solve the above problems. Summary of the Invention
[0008] The purpose of this invention is to solve the problem that existing technologies cannot simultaneously achieve prediction accuracy, cross-city generalization ability, and computational efficiency, which limits the application of trajectory user association technology in large-scale location services and complex dynamic scenarios.
[0009] To achieve the above objectives, the present invention specifically adopts the following technical solution:
[0010] The trajectory user association method based on semantic awareness and spatiotemporal coding includes the following steps:
[0011] a. Construct a semantic enhancement module to semantically encode the POI categories in the trajectory to obtain POI category vectors;
[0012] b. Construct a multi-frequency sinusoidal spatiotemporal coding module to encode the check-in timestamps and geographic coordinates in the trajectory to obtain time vectors and spatial vectors;
[0013] c. Integrate the POI category vector, time vector, and spatial vector to form a check-in feature vector;
[0014] d. Encode the check-in feature vector sequence using a shared trajectory encoder to obtain a trajectory representation;
[0015] e. Construct a two-stream transfer learning network, including independent source domain classifiers and target domain classifiers, to classify the trajectory representations in order to achieve cross-city trajectory user association.
[0016] Furthermore, in step a, the specific methods for constructing the semantic enhancement module include:
[0017] a1. Use the POI category text as natural language input to pre-train a large language model to generate high-dimensional semantic embeddings;
[0018] a2. Train an autoencoder to reduce the dimensionality of the high-dimensional semantic embedding to obtain a compact and expressive POI category vector.
[0019] Furthermore, in step a2, the autoencoder includes an encoder and a decoder, the encoder maps the high-dimensional semantic embedding from the original dimension to the target low-dimensional space, and the decoder reconstructs the low-dimensional representation back to the original dimension.
[0020] Furthermore, in step b, the specific method for constructing the multi-frequency sinusoidal spatiotemporal coding module includes:
[0021] b1. Align the check-in timestamps to a preset time interval and standardize them within a preset period;
[0022] b2. Encode the standardized timestamp using a multi-frequency sine function to generate a multi-scale time vector;
[0023] b3. The latitude and longitude of the geographic coordinates are encoded using a multi-frequency sine function to generate a multi-scale spatial vector.
[0024] Furthermore, in step b2, the preset time interval of the timestamp is 10 minutes, and the preset period is one week.
[0025] Furthermore, in step d, the shared trajectory encoder uses a gated loop unit to encode the check-in feature vector sequence and uses the final hidden state of the sequence as the trajectory representation.
[0026] Furthermore, in step e, the specific method for constructing the two-stream transfer learning network includes:
[0027] e1. Employs a two-stage learning protocol of pre-training and fine-tuning;
[0028] e2. In the pre-training phase, the model is jointly trained on source and target domain data. It learns domain-invariant trajectory representations through a shared trajectory encoder and optimizes them through source domain cross-entropy loss, target domain cross-entropy loss, and adaptive entropy loss.
[0029] e3. In the fine-tuning phase, all parameters except the shared trajectory encoder and the target domain classifier are frozen, and the model is trained only on the target domain data to adapt to the user identification task in the target domain.
[0030] Furthermore, in step e2, the adaptive entropy loss is achieved by measuring the uncertainty of the model prediction and adjusting the loss contribution according to the entropy weight to prioritize the optimization of hard-to-classify samples.
[0031] Furthermore, the POI category vector, time vector, and spatial vector are integrated through a concatenation operation to form the check-in feature vector.
[0032] Furthermore, the method ultimately inputs the trajectory representation into the classification module to obtain the user category corresponding to the trajectory.
[0033] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0034] 1. The method of this invention effectively solves the problems of POI identifier dependence, limited spatiotemporal representation capabilities, and insufficient cross-domain generalization ability in trajectory user association by introducing three innovative mechanisms: semantically enhanced pre-trained large language model, multi-frequency sinusoidal spatiotemporal coding, and two-stream transfer learning. It optimizes feature representation learning and significantly improves prediction accuracy and generalization ability. This method dynamically optimizes feature representation during the training phase while maintaining the prediction process of a standard sequence model during the inference phase. It can be deployed in real-world large-scale location service environments without additional computational overhead, and has broad application potential.
[0035] 2. This invention constructs an end-to-end joint optimization framework that dynamically adjusts trajectory user association and cross-domain feature learning simultaneously, achieving dual optimization of feature representation and prediction accuracy. Through a semantic enhancement strategy based on a pre-trained large language model, the model can learn more generalizable POI category representations during training, reducing reliance on specific city data. Simultaneously, by introducing a two-stream transfer learning mechanism during training, the model's generalization ability is effectively improved in scenarios with inter-domain differences, data scarcity, or cross-city scenarios, making the prediction results more robust and reliable.
[0036] 3. This invention possesses excellent scalability and commercial deployment potential. The semantically enhanced pre-trained large language model, multi-frequency sinusoidal spatiotemporal coding, and dual-stream transfer learning module dynamically adjust feature representations only during the model training phase. The inference phase utilizes the standard sequence model propagation mechanism, requiring no additional computational resources or complex post-processing. It can be directly integrated into existing location service platforms and user behavior analysis systems to achieve real-time or near-real-time trajectory user association services. This framework not only provides accurate user association information support for scenarios such as personalized recommendation, user profile construction, and mobility pattern analysis, but can also be applied to high-value areas such as abnormal behavior detection and cross-city user migration analysis, possessing broad commercial application prospects and technology transfer value. Attached Figure Description
[0037] Figure 1 The diagram below illustrates the principle of a trajectory user association method based on semantic awareness and spatiotemporal coding, as provided in this embodiment of the invention. Detailed Implementation
[0038] The technical solutions of the present invention will be clearly and completely described below with reference to the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0039] One object of the present invention is to provide a trajectory user association method based on semantic awareness and spatiotemporal coding, the method comprising the following steps:
[0040] The first step is to construct a semantic enhancement module to semantically encode POI categories. This module uses a pre-trained large language model to semantically embed POI category texts and performs dimensionality reduction on the high-dimensional embeddings through an autoencoder, thereby obtaining compact and expressive category vectors.
[0041] The second step involves constructing a multi-frequency sinusoidal spatiotemporal coding module to encode the check-in timestamp and geographic coordinates. This module uses a multi-frequency sine function to encode the timestamp and latitude / longitude coordinates respectively, generating multi-scale spatiotemporal embeddings to capture periodic temporal patterns and continuous spatial relationships in the trajectory.
[0042] The third step involves constructing a two-stream transfer learning network to achieve cross-city trajectory user association. This network comprises a shared trajectory encoder and two independent classifiers, employing a two-stage learning protocol of pre-training and fine-tuning. In the pre-training stage, the model is jointly trained on source and target domain data, learning domain-invariant trajectory representations through the shared encoder while utilizing adaptive entropy loss to enhance generalization. In the fine-tuning stage, the model is trained only on target domain data to adapt to the target domain user identification task.
[0043] By organically combining the above three modules, the method of this invention can effectively improve the prediction accuracy and generalization ability of trajectory user association, reduce computational overhead, and is suitable for large-scale cross-city trajectory data scenarios. The specific method is as follows:
[0044] 1. Multi-frequency sinusoidal spatiotemporal coding
[0045] To effectively handle trajectory user association tasks, obtaining the contextual embedding of each visited POI is a crucial prerequisite. Unlike earlier methods that relied on random initialization or narrow spatiotemporal correlation learning (e.g., exploring geographical correlations in a priori manner), this invention focuses on the dynamic characteristics of spatiotemporal features in check-in data, rather than forming relationships at the POI level.
[0046] 1.1. Time Encoding
[0047] In practical applications, the time preferences behind check-in behavior often exhibit significant periodic patterns, revealing diverse human mobility patterns. The inherent subjectivity and unpredictability of check-in behavior frequently lead to variable intervals between these events. To mitigate the impact of fine-grained fluctuations on the model, this invention aligns each timestamp to the nearest 10-minute interval and then normalizes these timestamps within a periodic cycle. Inspired by the location encoding concept proposed by Vaswani et al. in 2017, this method employs multi-frequency sinusoidal encoding to model periodic patterns.
[0048] Specifically, regarding timestamps , No. The time encoding of a dimension is defined as follows:
[0049]
[0050] in , The dimension representing the time encoding. This represents a cycle. Each pair of dimensions corresponds to a specific frequency, increasing exponentially with higher dimensions. This allows lower dimensions to capture long-term cyclical trends, while higher dimensions focus on short-term fluctuations.
[0051] In this invention, a week is typically used to capture weekly cyclical patterns. With this design, each pair of dimensions corresponds to a specific frequency, as... The frequency increases exponentially with the increase in dimensionality. This allows lower dimensions to capture long-term cyclical trends, such as overall weekly preferences, while higher dimensions focus on short-term fluctuations, such as preferences for specific time periods within a day. This multi-scale encoding approach enables the model to understand time patterns more comprehensively, avoiding the limitations of the single-cycle assumption in traditional methods.
[0052] 1.2. Spatial Coding
[0053] To encode the geographic details of each POI, this invention similarly employs multi-frequency sine coding to map two-dimensional latitude and longitude coordinates to a high-dimensional vector space. Considering that the latitude and longitude span of most major global cities is typically less than one degree, this method uses this range as a periodic parameter for coding, which helps the model capture both local and global spatial quality. By utilizing sine and cosine functions of different frequencies to capture multi-scale spatial variations, this method enhances the effective representation of geographic locations.
[0054] Specifically, given the spatial encoding dimension ( (It is a multiple of 4), sequentially encoding the sine and cosine components of latitude and longitude for each dimension. For POI The first encoding vector element It can be defined as follows:
[0055]
[0056] in , The periodic parameter is optional. This method captures relative spatial relationships at different scales through combinations of periodic functions, exhibiting stronger feature expressiveness than traditional one-thermal or simple numerical representations.
[0057] In this way, latitude and longitude are encoded alternately, and each coordinate is represented by sine and cosine functions of multiple frequencies. This method captures relative spatial relationships at different scales through a combination of periodic functions, exhibiting stronger feature expressiveness compared to traditional one-hot encoding or simple numerical representations, and is able to capture subtle differences and complex relationships in geographical locations more precisely.
[0058] 2. Semantic Enhancement Pre-trained Large Language Model
[0059] To enhance the model's generalization ability in cross-city tasks, this invention abandons check-in encoding schemes that overly rely on specific POI identifiers. Instead, this method integrates POI categories into the check-in embeddings, as POI categories exhibit greater consistency across different cities and provide motion-derived insights. Therefore, this invention uses a pre-trained Large Language Model (LLM) to generate semantic embeddings for category text, a stark contrast to techniques that rely on randomly initialized embeddings or are specific to check-in datasets. By acquiring rich semantic knowledge from a large-scale corpus, the pre-trained Large Language Model can more effectively capture cross-category semantic relationships, improving the model's understanding and generalization ability of POI category semantics.
[0060] Specifically, this invention operates a pre-trained LLM to generate fixed-length semantic embeddings by taking each category's text as natural language input. For the category set... Each of them Represented as a word or phrase (e.g., 'Bar', 'Seafood Restaurant'). Input the pre-trained LLM sequentially to obtain the corresponding representations. ,in The embedding dimension is represented by the formula:
[0061]
[0062] in, The output corresponds to The hidden state of the token express The length of the tokenized sequence.
[0063] Because LLM outputs have extremely high dimensionality, This hinders the model from learning compact representations and results in an excessively large proportion of the final embedding. To address this issue, this invention trains a simple autoencoder (AE) to reduce dimensionality and reconstruct the initial class embedding. Specifically, a symmetric autoencoder model is designed, including an encoder... and decoder ,in This represents the dimension of the target's low-dimensional space. The encoder compresses the original embedding into a low-dimensional representation:
[0064]
[0065] Ultimately, the trained encoder maps the category embeddings into a compact and expressive low-dimensional space, which serves as the input representation for subsequent tasks.
[0066] 3. Two-stream transfer learning network
[0067] To enhance the ability of the trajectory user association solution to handle trajectories from different cities, this invention elaborates on the city-level transfer learning mechanism.
[0068] 3.1. Shared Track Encoder
[0069] This method employs a shared trajectory encoder to construct a unified feature space for city-level transfer learning. Consistent with common practices, this method uses a gated recurrent unit (GRU) as the core of this module. A GRU is a neural network suitable for sequence data processing, capable of effectively capturing temporal dependencies within sequences.
[0070] Given trajectory Each sign-in With category vectors Time vector and space vectors They are related and integrated in the following ways:
[0071]
[0072] in It is a unified representation; ';' refers to the concatenation operation. Next, the trajectory Sign-in Hidden state The calculation is as follows:
[0073]
[0074] in Final state As a trajectory The representation is noteworthy. This module is shared between the subsequent pre-training and fine-tuning stages, ensuring that the trajectories of the source and target domains are represented in the same feature space. This design facilitates effective knowledge transfer across domains.
[0075] 3.2. Formulation of Dual-Stream Formula
[0076] To achieve cross-domain alignment and knowledge transfer, this invention employs a two-stream formulaic design.
[0077] (1) Domain definition:
[0078] Source domain: refers to cities with abundant trajectory data, primarily providing sufficient spatiotemporal knowledge during pre-training to support feature representation learning. Source domain data is typically large and diverse.
[0079] Target domain: This refers to the city the model needs to adapt to. Its trajectory data is relatively sparse and may differ in distribution from the source domain data. The target domain is the actual application scenario where the model needs to perform user association tasks. It is worth noting that the POIs and users in the source and target domains are usually different, but the POI categories are shared or similar, which provides a basis for cross-domain semantic transfer.
[0080] (2) Two-stream operation: This method achieves cross-domain alignment through a shared encoder and a dual-classifier architecture, namely two-stream transfer learning (DSTL). The shared encoder is responsible for projecting the trajectories of the source and target domains into a unified feature space, aiming to jointly learn domain-invariant trajectory representations and latent human movement patterns. Based on this, two independent classifiers are assigned to the source and target domains to handle the class differences of users in their respective domains. This design allows the model to learn from data in both domains simultaneously and adapt to their respective user distributions.
[0081] 3.3 Learning Agreement
[0082] To facilitate trajectory learning in a dual-flow context, this method provides a two-stage learning protocol, including pre-training and fine-tuning.
[0083] (1) Pre-training: Pre-training aims to enhance the cross-domain representation consistency and generalization ability of the encoder through joint training of the source and target domains. Specifically, for trajectories from each domain, the model generates predicted user categories by sharing the encoder and the corresponding classifier. Both domains are optimized using cross-entropy loss.
[0084] Source domain loss and target domain loss Defined as:
[0085]
[0086] in and These represent the number of trajectories in the source and target domains, respectively. and This indicates the corresponding number of users. Indicates the first in each field Real user tags for each trajectory It is an indicator function, if Corresponding to user tags Output 1 if the condition is met, otherwise output 0. Indicates the first One sample was assigned to the user tag. The predicted probability.
[0087] Furthermore, to facilitate the encoder learning more generalized representations, an adaptive entropy loss is introduced. This loss measures the uncertainty of the model's predictions through information entropy and adjusts the loss contribution using adaptive weighting. The entropy of the source domain prediction distribution is calculated as follows:
[0088]
[0089] in It is a custom decimal number used to avoid The calculation of adaptive entropy loss is defined as follows:
[0090]
[0091] in, The entropy weights impose a greater penalty on high-entropy samples in the source domain, enhancing generalization performance by prioritizing the optimization of key samples (those that are harder to classify and carry more information). At this stage, the total loss is given by:
[0092]
[0093] This ingenious design enables initial target domain adaptation during pre-training, while the two-stream mechanism reduces cross-domain label conflicts, further improving transfer feasibility.
[0094] (2) Fine-tuning: In the fine-tuning stage, the model is trained only on the target domain data to accurately adapt the encoder's transfer representation capabilities to the user recognition task in the target domain. During this stage, all encoder parameters are frozen except for the shareable trajectory encoder and the target domain classifier. This partially unfrozen strategy helps mitigate overfitting of the model to source domain knowledge while enhancing the learning of target domain representations. The optimization objective in the fine-tuning stage remains the cross-entropy loss in the target domain. .
[0095] In this embodiment, the present invention proposes a trajectory user association method based on semantic awareness and spatiotemporal coding, aiming to solve the problems of excessive reliance on POI identifiers, limited spatiotemporal representation capabilities, and insufficient cross-city generalization ability of existing TUL methods in practical applications. By introducing a pre-trained large language model for POI category semantic encoding, multi-frequency sinusoidal spatiotemporal coding, and a two-stream transfer learning mechanism, this method can effectively improve prediction accuracy and model generalization ability.
[0096] First, model the check-in data and its characteristics. Each check-in... This indicates a visit to a Point of Interest (POI), where Specify the latitude and longitude coordinates of the POI. Indicates semantic category (such as restaurant, transportation hub or shopping mall). This is the access timestamp. (User) Generated trajectory Defined as a check-in sequence ordered by time, where each Indicates user In time The This is the first time I've checked in.
[0097] Subsequently, a semantically aware trajectory representation is constructed based on these features. In this representation, POI categories are semantically encoded using a pre-trained large language model, temporal information captures periodic patterns through multi-frequency sinusoidal coding, and spatial information represents geographical relationships through periodic coding. However, raw trajectory data often contains a large amount of noise and redundant information, which not only increases computational overhead but also interferes with the prediction process during information propagation, leading to distorted prediction results.
[0098] To address this, this invention proposes a dual-stream transfer learning mechanism. This mechanism achieves cross-domain alignment through a shared encoder and a dual-classifier architecture, employing a two-stage learning protocol of pre-training and fine-tuning. In the pre-training stage, the model is jointly trained on source and target domain data, learning domain-invariant trajectory representations. In the fine-tuning stage, the model is trained only on target domain data, adapting to the target domain user recognition task. Through this design, the model can effectively utilize the rich data from the source domain to improve performance in the target domain.
[0099] Based on the optimized feature representation, this invention employs gated recurrent units to perform sequence modeling of the trajectory. Each layer integrates the current check-in features with historical information to learn a high-dimensional embedding representation. Finally, these embeddings are input into the classification module to obtain the user category corresponding to the trajectory.
[0100] The training objectives of this invention include not only minimizing the error between the predicted and true classes, but also constraining the model's generalization ability in cross-domain scenarios. This joint optimization strategy can improve prediction accuracy while enabling the model to learn more generalizable representations during training, reducing the impact of inter-domain differences.
[0101] Validated on two large-scale real-world datasets in Tokyo and New York, the method of this invention significantly outperforms existing methods in terms of prediction accuracy, cross-city generalization ability, and computational efficiency. Especially in scenarios with scarce data and significant inter-domain differences, this invention effectively utilizes source domain data, learns stable representations, and improves prediction accuracy, demonstrating strong generalization ability and practical application value.
[0102] In summary, this invention achieves high-precision and robust user association of trajectories in complex cross-city environments through the synergistic optimization of three modules: semantically enhanced pre-trained large language model, multi-frequency sinusoidal spatiotemporal coding, and dual-stream transfer learning network. This provides highly reliable technical support for various application scenarios such as location services, user behavior analysis, and personalized recommendations.
[0103] The effectiveness of the trajectory user association method based on semantic awareness and spatiotemporal coding provided by this invention will be verified below using a specific dataset.
[0104] (a) Dataset
[0105] This invention was validated on two large-scale real-world trajectory user association datasets, covering the Tokyo (TKY) and New York (NYC) regions respectively. These datasets contain hundreds of thousands of check-in records and their corresponding spatiotemporal features and POI category information, comprehensively reflecting the diversity and complexity of human movement patterns in different cities. The datasets are all from publicly available data on the Foursquare platform, containing check-in records, POI geographic information, and category labels from different users, thus realistically presenting the characteristics of human movement behavior.
[0106] To ensure the reliability of the evaluation results, each dataset is divided into training and test sets at an 80% to 20% ratio. In the training set, the top 209 and top 400 active users with the most trajectories for each city are selected to evaluate the model's performance. The test set consists of trajectories not encountered during training and is used solely to verify the model's generalization ability. Each dataset contains the following information:
[0107] POI information: includes static features such as the geographic location (latitude and longitude) and category label of the POI, which are used for semantic and spatial encoding.
[0108] Check-in records: contain dynamic features such as timestamps of user visits to POIs and user identifiers, which are used for time encoding and trajectory modeling.
[0109] User set: A different number of active users are selected from each city to evaluate the model performance at different scales.
[0110] (II) Comparison Method
[0111] To verify the superiority of the method in this invention, we selected the most representative trajectory user association methods in existing research as a comparative baseline, including TULER, TULVAE, MainTUL, S2TUL, AttnTUL, TULMGAT, and ScaleTUL. These methods are somewhat similar to this invention, but they lack the semantically enhanced pre-trained large language model, multi-frequency sinusoidal spatiotemporal coding, and two-stream transfer learning mechanism proposed in this invention, thus exhibiting shortcomings in cross-city generalization ability.
[0112] TULER:
[0113] The first RNN-based TUL model includes three variants: TULER-G based on GRU, TULER-L based on LSTM, and bidirectional TULER-B.
[0114] TULVAE: A generative model based on VAE that learns latent representations from associated and unassociated trajectories.
[0115] MainTUL: The first model to achieve mutual distillation between an RNN encoder and a time-aware Transformer encoder.
[0116] S2TUL: Proposes a semi-supervised framework that integrates GCN and a greedy reconnection algorithm for time constraints.
[0117] AttnTUL: Models intra-trajectory temporal and inter-trajectory spatial dependencies using hierarchical attention and GNN.
[0118] TULMGAT: Applying masked self-attention GNN and multi-scale attention to trajectory check-in.
[0119] ScaleTUL: Applying contrastive learning with spatiotemporal augmentation and two-stage training.
[0120] The semantically aware trajectory user association method proposed in this invention further innovates by introducing a pre-trained large language model, multi-frequency sinusoidal spatiotemporal coding, and a two-stream transfer learning strategy. By enhancing semantic representation, optimizing spatiotemporal coding, and improving cross-domain generalization ability, it enhances the stability and computational efficiency of prediction.
[0121] TULER: [5] Gao, Q.; Zhou, F.; Zhang, K.; Trajcevski, G.; Luo, X.; andZhang, F. 2017. Identifying Human Mobility via Trajectory Embeddings. InIJCAI, volume 17, 1689-1695.
[0122] TULVAE:
[12] Zhou, F.; Gao, Q.; Trajcevski, G.; Zhang, K.; Zhong, T.; and Zhang, F. 2018. Trajectory-User Linking via Variational AutoEncoder. InIJCAI, 3212-3218.
[0123] MainTUL:[3] Chen, W.; Li, S.; Huang, C.; Yu, Y.; Jiang, Y.; and Dong,J. 2022. Mutual Distillation Learning Network for Trajectory-User Linking. InProceedings of the Thirty-First International Joint Conference on ArtificialIntelligence, IJCAI-22, 1973-1979. International Joint Conferences onArtificial Intelligence Organization.
[0124] S2TUL:[4] Deng, L.; Sun, H.; Zhao, Y.; Liu, S.; and Zheng, K. 2023.S2tul: A semi-supervised framework for trajectory- user linking. In Proceedings of the sixteenth ACM internationalconference on web search and data mining, 375-383.
[0125] AttnTUL:[2] Chen, W.; Huang, C.; Yu, Y.; Jiang, Y.; and Dong, J.2024. Trajectory-user linking via hierarchical spatio-temporal attentionnetworks. ACM Transactions on Knowledge Discovery from Data, 18(4): 1-22.
[0126] TULMGAT: [6] Li, Y.; Sun, T.; Shao, Z.; Zhen, Y.; Xu, Y.; and Wang, F.2025. Trajectory-User Linking via Multi-Scale Graph Attention Network. Pattern Recognition, 158: 110978.
[0127] ScaleTUL:
[11] Zhang, H.; Chen, W.; Zhao, X.; Qi, J.; Jiang, G.;
[0128] (III) Evaluation Indicators
[0129] To comprehensively evaluate the predictive performance of different methods, the following metrics are used for comparison:
[0130] Accuracy@K (ACC@K): Calculates the proportion of real users among the top K candidate users in the prediction results. It is used to measure the overall prediction accuracy. The higher the value, the more accurate the prediction.
[0131] Macro-average precision (Macro-P): Calculates the average precision across all user categories, reflecting the overall accuracy of the model's predictions.
[0132] Macro-R: Calculates the average recall across all user categories, reflecting the model's ability to identify users.
[0133] Macro-F1 score: Calculates the harmonic mean of precision and recall, which comprehensively reflects the overall performance of the model.
[0134] The comparative experimental results show that the method of this invention outperforms the existing methods on all datasets. In particular, in the cross-city transfer learning scenario, this method reduces the dependence on POI identifiers through semantic enhancement, improves the representation ability through multi-frequency spatiotemporal coding, and enhances the cross-domain generalization ability through the two-stream transfer learning mechanism, which significantly improves the prediction accuracy and shows higher stability and generalization ability.
[0135] (iv) Analysis of experimental results
[0136] Table 1 presents a performance comparison of various trajectory user association methods on different datasets. All metrics are presented as percentages (%). Table 1 lists the prediction accuracy of each method; higher values indicate more accurate predictions. To highlight optimal performance, the best results for each metric in Table 1 are marked in bold, with underlined results representing the next best.
[0137]
[0138]
[0139] (V) Results Analysis
[0140] We selected Llama-3.2-3B and Vicuna-7B as pre-trained LLMs to generate semantic representations for POI categories, and developed SATULL and SATUL-V variants respectively. Experimental results are shown in the table. The SATUL model achieved statistically significant improvements on all evaluation metrics. Specifically, on the TKY-209 dataset, the SATUL model achieved relative improvements of 6.24%, 9.51%, and 8.07% over the second-best model in ACC@1, ACC@5, and Macro-F1 metrics, respectively. Similar improvements were also observed on the TKY-400 (5.34%, 11.11%, 9.46%), NYC-209 (3.34%, 6.51%, 3.43%), and NYC-400 (5.37%, 9.07%, 7.90%) datasets. For the NYC dataset, although the S2TUL model scored slightly higher than our model on the Macro-P metric, our model's superior performance on the Macro-F1 metric fully demonstrates its ability to more accurately reflect the true distribution characteristics of trajectories. Furthermore, when switching to a large language model for semantic encoding, only minor differences were observed in the results. This stems from the fact that the large language model itself possesses sufficient classification semantic capabilities, making it a modular component that supports seamless replacement.
[0141] Those skilled in the art should understand that the embodiments described herein are merely illustrative of the principles and advantages of the invention and do not constitute a limitation on the scope of protection. Any functional module combination, parameter optimization, or system integration extension based on the technical solutions of this invention constitutes a reasonable variation and improvement of this invention and is subject to the scope of protection of this patent.
[0142] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. The scope of patent protection of the present invention shall be determined by the claims. Similarly, any equivalent structural changes made based on the content of the present invention's specification shall also be included within the scope of protection of the present invention.
Claims
1. A trajectory user association method based on semantic perception and spatio-temporal coding, characterized in that, The method comprises the following steps: a. Constructing a semantic enhancement module to encode the POI categories in the trajectory to obtain a POI category vector; b. Constructing a multi-frequency sinusoidal spatiotemporal coding module to encode the check-in time stamp and geographic coordinates in the trajectory to obtain a time vector and a space vector; c. Integrating the POI category vector, the time vector and the space vector to form a check-in feature vector; d. Using a shared trajectory encoder to encode the check-in feature vector sequence to obtain a trajectory representation; e. Constructing a dual-flow transfer learning network including an independent source domain classifier and a target domain classifier to classify the trajectory representation to realize cross-city trajectory user association. 2.The trajectory user association method based on semantic perception and spatio-temporal coding according to claim 1, characterized in that, In step a, the specific way of constructing the semantic enhancement module comprises: a1. Inputting the POI category text as natural language into a pre-trained large language model to generate a high-dimensional semantic embedding; a2. Training an autoencoder to reduce the dimension of the high-dimensional semantic embedding to obtain a compact and expressive POI category vector. 3.The trajectory user association method based on semantic perception and spatio-temporal coding according to claim 2, characterized in that, In step a2, the autoencoder comprises an encoder and a decoder, the encoder maps the high-dimensional semantic embedding from the original dimension to the target low-dimensional space, and the decoder reconstructs the low-dimensional representation back to the original dimension.
4. The trajectory user association method based on semantic perception and spatio-temporal coding according to claim 1, characterized in that, In step b, the specific way of constructing the multi-frequency sinusoidal spatiotemporal coding module comprises: b1. Aligning the check-in time stamp to a preset time interval and normalizing it within a preset period; b2. Using a multi-frequency sinusoidal function to encode the normalized time stamp to generate a multi-scale time vector; b3. Using a multi-frequency sinusoidal function to encode the longitude and latitude of the geographic coordinates to generate a multi-scale space vector.
5. The trajectory user association method based on semantic perception and spatio-temporal coding according to claim 4, characterized in that, In step b2, the preset time interval of the time stamp is 10 minutes, and the preset period is one week.
6. The trajectory user association method based on semantic perception and spatio-temporal coding according to claim 1, characterized in that, In step d, the shared trajectory encoder uses a gated recurrent unit to encode the check-in feature vector sequence, and takes the final hidden state of the sequence as the trajectory representation.
7. The trajectory user association method based on semantic perception and spatio-temporal coding according to claim 1, characterized in that, In step e, the specific way of constructing the dual-flow transfer learning network comprises: e1. Using a two-stage learning protocol of pre-training and fine-tuning; e2. In the pre-training stage, the model is jointly trained on source domain and target domain data, learns domain-invariant trajectory representation through the shared trajectory encoder, and is optimized through source domain cross-entropy loss, target domain cross-entropy loss and adaptive entropy loss; e3. In the fine-tuning stage, all parameters except the shared trajectory encoder and the target domain classifier are frozen, and the model is only trained on the target domain data to adapt to the user identification task of the target domain.
8. The trajectory user association method based on semantic perception and spatio-temporal coding according to claim 7, characterized in that, In step e2, the adaptive entropy loss measures the uncertainty of the model prediction and adjusts the loss contribution according to the entropy weight to preferentially optimize difficult classification samples.
9. The trajectory user association method based on semantic perception and spatio-temporal coding according to claim 1, characterized in that, The POI category vector, the time vector and the space vector are integrated to form the check-in feature vector through a connection operation.
10. The trajectory user association method based on semantic perception and spatio-temporal coding according to claim 1, characterized in that, The method finally inputs the trajectory representation into a classification module to obtain the user category corresponding to the trajectory.
Citation Information
Cited By
Cross-user wearable activity identification method based on group specific concept perception representation learning
CN121996934A
User area dynamic characterization method, device, equipment, medium and product
CN122155130A