Trajectory embedding to prevent leakage

By combining similarity calculation, multi-label classification, and recurrent neural networks, this method attacks trajectory embedding to obtain privacy information and improve the model, thus solving the problem of trajectory embedding leakage and achieving effective privacy protection and model improvement.

CN115563652BActive Publication Date: 2026-05-29SHANGHAI JIAOTONG UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANGHAI JIAOTONG UNIV
Filing Date
2022-10-31
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

The lack of effective attack techniques to prevent leakage of trajectory embedding data in existing technologies makes it difficult to detect and prevent the leakage of privacy information in trajectory embedding models.

Method used

We employ a method based on similarity calculation, multi-label classification, and recurrent neural networks to attack trajectory embeddings, obtain privacy information, and improve trajectory embedding models to prevent leakage.

Benefits of technology

By using attack methods to obtain trajectory privacy information, we can evaluate the privacy protection effectiveness of the model, improve the model to prevent three types of privacy leaks, and enhance the model's usability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115563652B_ABST
    Figure CN115563652B_ABST
Patent Text Reader

Abstract

The application provides a trajectory embedding leakage prevention method and system, including the following: in a test environment, based on similarity calculation, multi-label classification, and recurrent neural network attack trajectory embedding to be attacked, any region in the space region that the original trajectory may pass through is obtained as the predicted privacy information of the original trajectory; a model improvement step: the trajectory embedding model is investigated, evaluated, and improved through the predicted privacy information of the original trajectory; a leakage prevention step: the improved trajectory embedding model is used to prevent trajectory embedding leakage. The application obtains the privacy information of the trajectory in the test environment, achieves good attack effect, overcomes the lack of attack technology in this aspect, and can prevent embedding trajectory leakage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of trajectory representation under trajectory data mining and processing, and specifically to a trajectory embedding method and system for preventing leakage. Background Technology

[0002] With the development of mobile internet and location-based services, massive amounts of spatiotemporal data are collected and stored, such as GPS data of pedestrians or vehicles, user check-in records on social media, and user call records recorded by telecom operators. A sequence of spatiotemporal data points representing a user's data can be called a trajectory, reflecting information such as the user's travel patterns and daily habits. Large-scale trajectory datasets make it possible to mine and analyze human movement patterns, and can be applied to downstream tasks such as traffic monitoring, route planning, and infectious disease transmission prediction. However, the heterogeneity of trajectories presents many challenges for trajectory data mining. For example, different trajectories often have different sampling rates and lengths, and may suffer from missing data and data sparsity. This makes it difficult for downstream tasks to utilize common data mining and machine learning models, as such models often require standardized inputs. Furthermore, as a fundamental task in trajectory data mining, calculating similarity using traditional similarity metrics leads to high computational complexity. To address these challenges, trajectory embedding methods have become a new technological hotspot in the field of trajectory data mining and processing in recent years. The trajectory embedding method uses deep learning models based on frameworks such as Seq2Seq (Sequence to Sequence), LSTM (Long Short-Term Memory), and Transformer (a deep learning model based on self-attention mechanism) to convert the trajectory of the input model into a trajectory embedding vector of a specified size, which is simply called trajectory embedding. Using trajectory embedding for trajectory data mining tasks or trajectory similarity calculation can effectively alleviate the above difficulties. Trajectory data is often highly private, and the information contained therein can reveal the user's frequently visited locations, personal movement patterns, and other privacy information. In real-world applications, it is often necessary to share trajectory embeddings with different downstream tasks or to make trajectory embeddings public, which may naturally lead to the leakage of user privacy information contained in the trajectory. Such information leakage problems can be summarized into the following three categories: (1) leakage of any area within the spatial region that the original trajectory may pass through; (2) leakage of some popular areas within the spatial region that the original trajectory may pass through; (3) the original trajectory is recovered to a certain extent.

[0003] Chinese invention patent document CN115062703A discloses a trajectory similarity measurement method based on trajectory embedding. First, the base station trajectory points in user call records are preprocessed, and the preprocessed trajectory data is clustered into spatiotemporal trajectory points. Then, based on the user's spatiotemporal trajectory cluster information, a relationship graph between users is constructed, and different strongly connected subgraphs of users are mined. Next, the prior similarity of user trajectories within each connected subgraph is calculated. Based on this, a training set is constructed using user trajectory sequences and the co-occurrence relationship of trajectories between users. The trajectory2vec model within different connected subgraphs is trained using the prior similarity of user trajectories to obtain the user's trajectory embedding vector. Finally, the cosine similarity between user trajectory embedding vectors is calculated to represent the spatiotemporal similarity of user trajectories.

[0004] Regarding the aforementioned technologies, the inventors believe that in a testing environment, attacking trajectory embedding and determining the degree of leakage of user privacy information caused by trajectory embedding generated by different trajectory embedding models is of great significance for examining and evaluating trajectory embedding models, as well as for subsequent improvements and applications. However, in testing techniques, there are currently no targeted attack techniques against trajectory embedding. This lack of attack techniques significantly hinders the examination, evaluation, improvement, and application of trajectory embedding models, making it difficult to prevent embedded trajectory leakage. Summary of the Invention

[0005] To address the shortcomings of existing technologies, the purpose of this invention is to provide a method and system for preventing leakage through trajectory embedding.

[0006] A trajectory embedding method for preventing leakage according to the present invention includes the following steps:

[0007] Attack steps based on similarity calculation: In the test environment, the trajectory embedding to be attacked is calculated based on similarity calculation, and any area within the spatial region that the original trajectory may pass through is obtained as the privacy information of the predicted original trajectory.

[0008] Model improvement steps: Examine, evaluate, and improve the trajectory embedding model by using the privacy information of the predicted original trajectory;

[0009] Leakage prevention steps: Use the improved trajectory embedding model to prevent the resulting trajectory embedding leakage.

[0010] Preferably, the method further includes a multi-label classification step: in a test environment, based on the multi-label classification attack on the trajectory to be attacked, multiple popular areas within the spatial region that the original trajectory may pass through are obtained as privacy information of the predicted original trajectory.

[0011] Preferably, the method further includes a recurrent neural network step: in a test environment, the original trajectory corresponding to the trajectory embedding to be attacked is recovered to a predetermined extent based on the recurrent neural network attack on the trajectory embedding to be attacked, and used as privacy information of the predicted original trajectory.

[0012] Preferably, the attack steps based on similarity calculation include the following steps:

[0013] The process of dividing a large spatial area into multiple smaller areas with similar shapes, according to a predetermined method.

[0014] Embedding vector acquisition steps: Treat each small region as a trajectory composed of points, input it into the trajectory embedding model, and obtain the embedding vector corresponding to the small region;

[0015] Similarity calculation steps: Using cosine similarity, calculate the similarity between the embedding vector of each small region and the embedding vector of the trajectory to be attacked;

[0016] Coordinate clustering steps: Sort all calculated similarities and retain the top k small regions that are most similar to the trajectory to be attacked; obtain the center coordinates of the k small regions and use density clustering to cluster the center coordinates;

[0017] Region determination steps: After clustering is completed, select the predetermined clusters, calculate the average value of the coordinates of all center points in the clusters, and use it as the center point coordinates of the possible traversed regions; select the predetermined radius value to define the spatial range of the possible traversed regions; based on the center point coordinates and radius value, determine the region within the spatial region as a region that the original trajectory may pass through.

[0018] Preferably, the multi-label classification step includes the following steps:

[0019] Steps for obtaining popular areas: Prepare a predetermined amount of auxiliary trajectory data to form an auxiliary trajectory dataset. Use density clustering to cluster all points contained in the auxiliary trajectory. After the clustering is completed, the obtained clusters are used as popular areas that are frequently visited in the spatial region.

[0020] Steps for obtaining the trajectory embedding corresponding to the auxiliary trajectory: Input the auxiliary trajectory data into the trajectory embedding model and obtain the trajectory embedding corresponding to the auxiliary trajectory data;

[0021] Labeling steps: For each auxiliary trajectory in the auxiliary trajectory dataset, label the popular areas traversed by the auxiliary trajectory. All popular areas obtained in the acquisition step are labeled, and all labels constitute the labels of the auxiliary trajectory.

[0022] Network construction steps: Build a neural network containing an input layer, an output layer and multiple hidden layers. The size of the input layer is the same as the size of the trajectory embedding to be attacked. The size of the hidden layer is determined according to the size of the input layer. The size of the output layer corresponds to the number of hot regions obtained in the hot region acquisition step. The loss function used during neural network training is cross-entropy loss L, as shown in equation (1).

[0023]

[0024] Among them, y R This indicates whether the original trajectory passed through the popular area R; This represents the probability that the original trajectory predicted by the neural network passes through the popular region R; A collection comprised of popular areas;

[0025] Model training steps: Using the trajectory embedding and label of the auxiliary trajectory, based on Equation (1), train the neural network so that the loss in Equation (1) continuously decreases until it converges, which means that the attack model training is complete.

[0026] After the popular area judgment step: the trajectory to be attacked is embedded into the pre-trained attack model, and the corresponding label is obtained for the trajectory to be attacked. If the position of the label is the first predetermined value, it means that the trajectory to be attacked has passed through the corresponding popular area. If the position is the second predetermined value, it means that the trajectory to be attacked has not passed through the corresponding popular area.

[0027] Preferably, the recurrent neural network step includes the following steps:

[0028] The steps for dividing the large spatial region are as follows: Divide the large spatial region into multiple smaller regions with similar shapes according to a predetermined method, and number each smaller region to construct a region set;

[0029] Steps for obtaining the trajectory embedding corresponding to the auxiliary trajectory: Prepare a predetermined number of auxiliary trajectory data to form an auxiliary trajectory dataset; input the auxiliary trajectory data into the trajectory embedding model to obtain the trajectory embedding corresponding to the auxiliary trajectory data;

[0030] Label construction steps: For each auxiliary trajectory in the auxiliary trajectory dataset, each point on the auxiliary trajectory is mapped to a small region in the region partitioning step: if a point on the auxiliary trajectory is in a small region, the point is replaced with the small region number; if a point on the auxiliary trajectory is not in any region, the point is replaced with the small region number at a predetermined distance from the point, converting the auxiliary trajectory into a number sequence; the number sequence is compressed to obtain the compressed number sequence, which is the label of the auxiliary trajectory;

[0031] Network construction steps: Build a recurrent neural network containing an input layer, an output layer and multiple hidden layers. The size of the input layer is the same as the size of the trajectory embedding being attacked. The size of the hidden layer is determined according to the size of the input layer. The size of the output layer is the number of small regions in the region set. The loss function used during training of the recurrent neural network is the cross-entropy loss L, as shown in equation (2).

[0032]

[0033] Among them, h t Let O be the hidden state of the neural network at step t. t It is the t-th number in the original trajectory number sequence, P(O t |h t ) represents the hidden state h based on step t. t The predicted number sequence of the original trajectory is the t-th number O. t The probability, where l is the sequence length;

[0034] Network training steps: Using the trajectory embedding and label of the auxiliary trajectory, based on Equation (2), train the recurrent neural network so that the loss in Equation (2) continuously decreases until it converges, which means that the attack model training is complete.

[0035] Trajectory recovery steps: Embed the trajectory to be attacked into the pre-trained attack model to obtain the corresponding label of the trajectory to be attacked; obtain the corresponding number sequence based on the obtained label, and connect the center coordinates of the small region corresponding to each number in sequence to obtain the recovered trajectory.

[0036] A trajectory embedding leak prevention system according to the present invention includes the following modules:

[0037] Similarity-based attack module: In the test environment, the trajectory embedding to be attacked is attacked based on similarity calculation, and any area within the spatial region that the original trajectory may pass through is obtained as the privacy information of the predicted original trajectory.

[0038] Model improvement module: The trajectory embedding model is examined, evaluated, and improved by using the privacy information of the predicted original trajectory;

[0039] Leakage Prevention Module: Prevents generated trajectory embedding leaks using an improved trajectory embedding model.

[0040] Preferably, the system also includes a multi-label classification module: in a test environment, based on the embedding of the trajectory to be attacked by multi-label classification, multiple popular areas within the spatial area that the original trajectory may pass through are obtained as privacy information of the predicted original trajectory.

[0041] Preferably, the system further includes a recurrent neural network module: in a test environment, based on the recurrent neural network attack on the trajectory embedding to be attacked, the original trajectory corresponding to the trajectory embedding to be attacked is recovered to a predetermined extent, which serves as the privacy information of the predicted original trajectory.

[0042] Preferably, the attack module based on similarity calculation includes the following modules:

[0043] Region division module: Divides a large spatial area into multiple smaller regions with similar shapes according to a predetermined division system;

[0044] Embedding vector acquisition module: Treat each small region as a trajectory composed of points, input the trajectory embedding model, and obtain the embedding vector corresponding to the small region;

[0045] Similarity calculation module: Utilizes cosine similarity to calculate the similarity between the embedding vector of each small region and the embedding vector of the trajectory to be attacked;

[0046] Coordinate clustering module: Sort all calculated similarities and retain the top k small regions that are most similar to the trajectory to be attacked; obtain the center coordinates of the k small regions and use density clustering to cluster the center coordinates;

[0047] Region Determination Module: After clustering is completed, a predetermined cluster is selected, and the average value of the coordinates of all center points in the cluster is calculated as the center point coordinates of the possible traversed region; a predetermined radius value is selected to define the spatial range of the possible traversed region; based on the center point coordinates and radius value, a region within the spatial region is determined as a region that the original trajectory may traverse.

[0048] Compared with the prior art, the present invention has the following beneficial effects:

[0049] 1. In the test environment, this invention obtains any area within the spatial region traversed by the trajectory by using a similarity calculation method, obtains popular areas within the spatial region traversed by the trajectory by using a multi-label classification method, and recovers the original trajectory corresponding to the trajectory embedding to a certain extent by using a recurrent neural network method, thereby obtaining privacy information about the trajectory and achieving a good attack effect. It overcomes the lack of attack techniques in this area and can prevent the leakage of embedded trajectories.

[0050] 2. In a test environment, this invention can be used to examine and evaluate the privacy protection effect of trajectory embedding models, and to verify whether there is a risk of privacy leakage in trajectory embedding models.

[0051] 3. In the test environment, the three types of privacy information obtained by this invention can serve as a reference for improving the trajectory embedding model. The training objective is to avoid these three types of privacy leakage problems, so that the improved trajectory embedding model can prevent the leakage of the three types of privacy information as much as possible, thereby improving the usability of the trajectory embedding model. Attached Figure Description

[0052] Other features, objects, and advantages of the present invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:

[0053] Figure 1 This is a diagram showing the clustering results from step one;

[0054] Figure 2 This is the popular area map obtained in step two;

[0055] Figure 3 This is a diagram showing the actual attack effect of step two;

[0056] Figure 4 This is a diagram showing the actual attack effect of step three;

[0057] Figure 5 This is a flowchart of the present invention. Detailed Implementation

[0058] The present invention will now be described in detail with reference to specific embodiments. These embodiments will help those skilled in the art to further understand the present invention, but do not limit the invention in any way. It should be noted that those skilled in the art can make several changes and improvements without departing from the concept of the present invention. These all fall within the protection scope of the present invention.

[0059] Embodiment 1 of the present invention discloses a trajectory embedding method for preventing leakage, such as Figure 5 As shown, it includes the following steps:

[0060] Step 1: In the test environment, attack trajectory embedding using a similarity calculation method to obtain any area that the original trajectory may pass through.

[0061] Step 2: In the test environment, a multi-label classification-based method is used to attack trajectory embedding and obtain multiple popular areas within the spatial region that the original trajectory may pass through.

[0062] Step 3: In the test environment, a method based on recurrent neural networks is used to attack the trajectory embedding, which to some extent restores the original trajectory corresponding to the trajectory embedding.

[0063] Model improvement steps: Examine, evaluate, and improve the trajectory embedding model by using the privacy information of the predicted original trajectory;

[0064] Leakage prevention steps: Use the improved trajectory embedding model to prevent the resulting trajectory embedding leakage.

[0065] Step one employs a non-machine learning method; similarity calculation is a classic and relatively simple method for processing trajectory data. Steps two and three, however, utilize machine learning-based methods. The multi-label classifier in step two and the recurrent neural network in step three are typical neural network learning models, more complex to implement, but yielding better results than the non-machine learning method. Combining these two approaches maximizes the extraction of implicit user privacy information from trajectory embeddings while maintaining attack efficiency.

[0066] Step one includes the following sub-steps:

[0067] (1) Divide the spatial region into multiple small regions with similar shapes according to a certain division method, and number each small region to construct a region set.

[0068] (2) Treat each small region as a trajectory consisting of only a single point, input it into the trajectory embedding model, and obtain the embedding vector corresponding to the small region.

[0069] (3) Using cosine similarity, calculate the similarity between the embedding vector of each region and the embedding vector of the trajectory to be attacked.

[0070] (4) Sort all the calculated similarities and retain the top k small regions that are most similar to the trajectory to be attacked. Obtain the coordinates of the center points of the k small regions and use density clustering to cluster these coordinates.

[0071] (5) After clustering, select the largest cluster and calculate the average coordinates of all points in the cluster as the center point coordinates of the possible traversed area. Select an appropriate radius value to define the spatial range of the possible traversed area. Based on the center point coordinates and the radius value, a circular area in the spatial region can be determined, which is the area that the original trajectory may pass through.

[0072] Step two includes the following sub-steps:

[0073] (1) Prepare a certain amount of auxiliary trajectory data to form an auxiliary trajectory dataset, and use density clustering to cluster all points contained in these trajectories. After the clustering is completed, the obtained clusters are the frequently visited popular areas in the spatial region.

[0074] (2) Input the auxiliary trajectory data into the trajectory embedding model to obtain the trajectory embedding corresponding to the auxiliary trajectory data.

[0075] (3) For each auxiliary trajectory, mark all the popular areas in sub-step (1) that the auxiliary trajectory passes through, and all the marks constitute the label of the auxiliary trajectory.

[0076] (4) Construct a neural network consisting of one input layer, three hidden layers, and one output layer. The size of the input layer is the same as the size of the trajectory embedding being attacked. The size of the hidden layers is determined based on the size of the input layer and should be greater than or equal to the size of the input layer. The size of the output layer corresponds to the number of hot regions obtained in sub-step (1). The loss function used during neural network training is cross-entropy loss, as shown in equation (1).

[0077]

[0078] Among them, y R This indicates whether the original trajectory passed through the popular area R. If it did, the value is 1; otherwise, it is 0. This represents the probability that the original trajectory predicted by the neural network passes through the popular region R; A collection of popular areas.

[0079] (5) Using the embedding and label of the auxiliary trajectory in sub-steps (2) and (3), the neural network in (4) is trained based on Equation (1) so that the loss in Equation (1) continuously decreases until it converges, which means that the attack model training is complete.

[0080] (6) Embed the trajectory to be attacked into the attack model trained in input (5) and obtain the corresponding label of the trajectory. If a certain position in the label is 1, it means that the trajectory has passed through the corresponding popular area. If a certain position is 0, it means that the trajectory has not passed through the corresponding popular area.

[0081] Step 3 includes the following sub-steps:

[0082] (1) Divide the spatial region into multiple small regions with similar shapes according to a certain division method, and number each small region to construct a region set.

[0083] (2) Prepare a certain amount of auxiliary trajectory data to form an auxiliary trajectory dataset. Input the auxiliary trajectory data into the trajectory embedding model to obtain the trajectory embedding corresponding to the auxiliary trajectory data.

[0084] (3) For each trajectory in the auxiliary dataset, map each point on the trajectory to a small region in (1): if a point is in a small region, replace the point with the region number; if a point is not in any region, replace the point with the region number closest to it. Thus, the trajectory is converted into a sequence of numbers. Compress this sequence to a length of l. If the original length is less than l, pad with zeros; if the length exceeds l, downsample the sequence. The compressed sequence of numbers is the label of the auxiliary trajectory.

[0085] (4) Construct a recurrent neural network with one input layer, three hidden layers, and one output layer, with a step count of l. The size of the input layer is the same as the size of the trajectory embedding being attacked. The size of the hidden layers is determined based on the size of the input layer and should be greater than or equal to the size of the input layer. The size of the output layer is the number of regions in the region set. The recurrent neural network outputs a region number at each step. The loss function used during the training of the recurrent neural network is the cross-entropy loss, as shown in equation (2):

[0086]

[0087] Among them, h t Let O be the hidden state of the neural network at step t. t It is the t-th number in the original trajectory number sequence, P(O t |h t ) represents the hidden state h based on step t. t The predicted number sequence of the original trajectory is the t-th number O. t The probability of , where l is the sequence length.

[0088] (5) Using the embedding and label of the auxiliary trajectory in sub-steps (2) and (3), the recurrent neural network in (4) is trained based on Equation (2), so that the loss in Equation (2) continuously decreases until it converges, which means that the attack model training is complete.

[0089] (6) Embed the trajectory to be attacked into the attack model trained in the input sub-step (5) and obtain the corresponding label for the trajectory embedding. Each obtained label corresponds to a number sequence. Connect the center coordinates of the small regions corresponding to each number in order to obtain the recovered trajectory.

[0090] Embodiment 2 of this invention also discloses a trajectory embedding leakage prevention method. Taking the trajectory embedding generated by the t2vec trajectory embedding model in Porto, Portugal as an example, this embodiment provides a method for attacking trajectory embedding, involving similarity-based attack methods, multi-label classification-based attack methods, and recurrent neural network-based attack methods. It includes the following steps:

[0091] Step 1: In the test environment, attack trajectory embedding using a similarity calculation method to obtain any area that the original trajectory may pass through.

[0092] Step 2: In the test environment, a multi-label classification-based method is used to attack trajectory embedding and obtain multiple popular areas within the spatial region that the original trajectory may pass through.

[0093] Step 3: In the test environment, a method based on recurrent neural networks is used to attack the trajectory embedding, which to some extent restores the original trajectory corresponding to the trajectory embedding.

[0094] Model improvement steps: Examine, evaluate, and improve the trajectory embedding model by using the privacy information of the predicted original trajectory;

[0095] Leakage prevention steps: Use the improved trajectory embedding model to prevent the resulting trajectory embedding leakage.

[0096] Specifically, step one includes the following sub-steps:

[0097] (1) Divide the latitude and longitude range of Porto into 18,866 identical square grids, number each small area, and construct the area set V = {C}. i} i=1:18866 C i This represents the number of the i-th sub-region.

[0098] (2) Divide each small area C i As a trajectory consisting of only a single point, inputting the t2vec trajectory embedding model Φ yields the embedding vector e corresponding to that small region. i =Φ(C i ).

[0099] (3) Using cosine similarity, calculate the embedding vector e for each region. i The similarity between the target trajectory embedding vector e and the target trajectory embedding vector e.

[0100] (4) Sort all the calculated similarities and retain the top 20 small regions {C} that are most similar to the trajectory to be attacked. top1 C top2 ,…,C topk}. Obtain the center point coordinates of 20 small regions {P top1 ,P top2 ,…,P topk The density-based clustering algorithm DBSCAN (Density-Based Spatial Clustering of Applications with Noise) is used to cluster these coordinates. topk P represents the k-th small region number that is most similar to the trajectory to be attacked. topk This represents the coordinates of the center point of the k-th smallest region most similar to the trajectory to be attacked. The clustering results are shown in the attached image. Figure 1 As shown.

[0101] (5) After clustering, select the largest cluster and calculate the average coordinates of all points in the cluster as the center point coordinates of the possible traversed area. Select a radius of 1 km to define the spatial range of the possible traversed area. Based on the center point coordinates and the radius value, a circular area in the spatial region can be determined, which is the area that the original trajectory may pass through.

[0102] Specifically, step two includes the following sub-steps:

[0103] (1) Prepare 100,000 auxiliary trajectory data generated in Porto to form the auxiliary trajectory dataset D. aux ={T i aux} i=1:100000 T i aux Let represent the i-th auxiliary trajectory. The density-based clustering method DBSCAN is used to cluster all points contained in these trajectories. After clustering, each cluster represents a frequently visited hot region R in the spatial domain. The final list of all hot regions is shown in the attached figure. Figure 2 As shown.

[0104] (2) Input the auxiliary trajectory data into a 256-dimensional t2vec trajectory embedding model to obtain the trajectory embedding E corresponding to the auxiliary trajectory data. aux ={Φ(T) i aux )} i=1:100000 .

[0105] (3) For each auxiliary trajectory T i aux Mark all popular areas traversed in sub-step (1) by the auxiliary trajectory, and all marks constitute the label of the auxiliary trajectory. i aux All tags constitute tag set L axu ={Label i aux} i=1:100000 .

[0106] (4) Construct a neural network containing one input layer, three hidden layers, and one output layer. The input layer size is 256, the hidden layer size is 512, and the output layer size corresponds to the number of hot regions obtained in (1). The cross-entropy loss in equation (1) is used during neural network training.

[0107] (5) Utilize the embedding E of the auxiliary trajectory in sub-steps (2) and (3) aux and label L axu Based on equation (1), the neural network in (4) is trained so that the loss in equation (1) continuously decreases until it converges.

[0108] (6) Input the trajectory embedding e under the t2vec embedding model to be attacked into the attack model trained in (5), and obtain the label corresponding to the trajectory embedding. If a position in the label is 1, it means that the trajectory has passed through the corresponding popular area; if a position is 0, it means that the trajectory has not passed through the corresponding popular area. Finally, the attack method was repeated on 10,000 trajectories, and an average of 82% of the popular areas were accurately inferred. This shows that the method can effectively recover the popular areas passed through by the original trajectory. The attack effect of this method on a certain trajectory is shown in the appendix. Figure 3 As shown, the light-colored line segments represent the original trajectory, and the circles represent the inferred popular areas.

[0109] Specifically, step three includes the following sub-steps:

[0110] (1) Divide the latitude and longitude range of Porto into 18,866 identical square grids, number each small area, and construct the area set V = {C}. i} i=1:18866 .

[0111] (2) Prepare 100,000 auxiliary trajectory data T generated in Porto. i This constitutes the auxiliary trajectory dataset D. aux ={T i aux} i=1:100000 Input the auxiliary trajectory data into a 256-dimensional t2vec trajectory embedding model to obtain the trajectory embedding E corresponding to the auxiliary trajectory data. aux ={Φ(T) i aux )} i=1:100000 .

[0112] (3) For each trajectory T in the auxiliary dataset i aux Each point on the trajectory is mapped to a small region in (1): if a point is in a small region, it is replaced with the region number; if a point is not in any region, it is replaced with the region number closest to it. Thus, the trajectory is converted into a numbered sequence. This numbered sequence is compressed to a length of 20. If the original length is less than 20, zeros are added; if the length exceeds 20, the sequence is downsampled. The compressed numbered sequence is the label of the auxiliary trajectory. i aux All tags constitute tag set L axu ={Label i aux} i=1:100000 .

[0113] (4) Construct a recurrent neural network with one input layer, three hidden layers and one output layer, and a step count of 20. The input layer size is 256, the hidden layer size is 512, and the output layer size is 18866. The loss function is the loss in equation (2).

[0114] (5) Utilize the embedding E of the auxiliary trajectory in sub-steps (2) and (3) aux and label L axu Based on equation (2), the recurrent neural network in (4) is trained, so that the loss in equation (1) continuously decreases until convergence, which means that the attack model training is complete.

[0115] (6) Input the trajectory embedding e under the t2vec embedding model to be attacked into the attack model trained in (5) to obtain the label corresponding to the trajectory embedding. Each label corresponds to a number sequence. Connect the center coordinates of the small regions corresponding to each number in sequence to obtain the recovered trajectory. Repeat the attack method on 10,000 trajectories and consider two indicators to measure the recovery effect. The first indicator is that about 70% of the actual number sequence is recovered; the second indicator is that the average Friesian distance between the recovered trajectory and the original trajectory is 770 meters. These two indicators show that the recovered trajectory is very close to the original trajectory. The attack effect of this attack method on a certain trajectory is shown in the appendix. Figure 4 As shown, the light color represents the original trajectory, and the dark color represents the recovered trajectory.

[0116] The present invention also provides a trajectory embedding leakage prevention system, which can be implemented by executing the process steps of the trajectory embedding leakage prevention method. That is, those skilled in the art can understand the trajectory embedding leakage prevention method as a preferred embodiment of the trajectory embedding leakage prevention system.

[0117] The system includes the following modules:

[0118] Similarity-based attack module: In the test environment, the attack module embeds the trajectory to be attacked based on similarity calculation, and obtains any area within the spatial region that the original trajectory may pass through as the privacy information of the predicted original trajectory.

[0119] Multi-label classification module: In the test environment, based on the embedding of the trajectory to be attacked by multi-label classification attack, multiple popular areas in the spatial area that the original trajectory may pass through are obtained as privacy information of the predicted original trajectory.

[0120] Recurrent Neural Network Module: In the test environment, based on the recurrent neural network attack on the trajectory embedding to be attacked, the original trajectory corresponding to the trajectory embedding to be attacked is recovered to a predetermined extent, which serves as the privacy information of the predicted original trajectory.

[0121] Model improvement module: The trajectory embedding model is examined, evaluated and improved by using the privacy information of the predicted original trajectory.

[0122] Leakage Prevention Module: Prevents generated trajectory embedding leaks using an improved trajectory embedding model.

[0123] The attack module based on similarity calculation includes the following modules:

[0124] Region division module: Divides a large spatial area into multiple smaller regions with similar shapes according to a predetermined division system.

[0125] Embedding Vector Acquisition Module: Treat each small region as a trajectory composed of points, input the trajectory embedding model, and obtain the embedding vector corresponding to the small region.

[0126] Similarity calculation module: Utilizes cosine similarity to calculate the similarity between the embedding vector of each small region and the embedding vector of the trajectory to be attacked.

[0127] Coordinate clustering module: Sort all calculated similarities and retain the top k small regions that are most similar to the trajectory to be attacked; obtain the center coordinates of the k small regions and use density clustering to cluster the center coordinates.

[0128] Region Determination Module: After clustering is completed, a predetermined cluster is selected, and the average value of the coordinates of all center points in the cluster is calculated as the center point coordinates of the possible traversed region; a predetermined radius value is selected to define the spatial range of the possible traversed region; based on the center point coordinates and radius value, a region within the spatial region is determined as a region that the original trajectory may traverse.

[0129] This invention addresses the lack of trajectory embedding attack techniques by providing a method for attacking trajectory embedding.

[0130] Those skilled in the art will understand that, besides implementing the system and its various devices, modules, and units provided by this invention in the form of purely computer-readable program code, the same functions can be achieved entirely through logical programming of the method steps, making the system and its various devices, modules, and units of this invention function in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers. Therefore, the system and its various devices, modules, and units provided by this invention can be considered as a hardware component, and the devices, modules, and units included therein for implementing various functions can also be considered as structures within the hardware component; alternatively, the devices, modules, and units for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.

[0131] Specific embodiments of the present invention have been described above. It should be understood that the present invention is not limited to the specific embodiments described above, and those skilled in the art can make various changes or modifications within the scope of the claims, which do not affect the essence of the present invention. Unless otherwise specified, the embodiments and features described in this application can be arbitrarily combined with each other.

Claims

1. A trajectory embedding method for preventing leakage, characterized in that, Includes the following steps: Attack steps based on similarity calculation: In the test environment, the trajectory embedding to be attacked is calculated based on similarity calculation, and any area within the spatial region that the original trajectory may pass through is obtained as the privacy information of the predicted original trajectory. Model improvement steps: Examine, evaluate, and improve the trajectory embedding model by using the privacy information of the predicted original trajectory; Leakage prevention steps: Use the improved trajectory embedding model to prevent the resulting trajectory embedding leakage; The method also includes a multi-label classification step: in the test environment, based on the multi-label classification attack trajectory embedding, multiple popular areas in the spatial area that the original trajectory may pass through are obtained as privacy information of the predicted original trajectory. The method also includes a recurrent neural network step: in a test environment, the original trajectory corresponding to the trajectory embedding to be attacked is recovered to a predetermined extent based on the recurrent neural network attack on the trajectory embedding to be attacked, and used as privacy information of the predicted original trajectory.

2. The trajectory embedding method for preventing leakage according to claim 1, characterized in that, The attack steps based on similarity calculation include the following steps: The process of dividing a large spatial area into multiple smaller areas with similar shapes, according to a predetermined method. Embedding vector acquisition steps: Treat each small region as a trajectory composed of points, input it into the trajectory embedding model, and obtain the embedding vector corresponding to the small region; Similarity calculation steps: Using cosine similarity, calculate the similarity between the embedding vector of each small region and the embedding vector of the trajectory to be attacked; Coordinate clustering steps: Sort all calculated similarities and retain the top k small regions that are most similar to the trajectory to be attacked; obtain the center coordinates of the k small regions and use density clustering to cluster the center coordinates; Region determination steps: After clustering is completed, select the predetermined clusters, calculate the average value of the coordinates of all center points in the clusters, and use it as the center point coordinates of the possible traversed regions; select the predetermined radius value to define the spatial range of the possible traversed regions; based on the center point coordinates and radius value, determine the region within the spatial region as a region that the original trajectory may pass through.

3. The trajectory embedding method for preventing leakage according to claim 1, characterized in that, The multi-label classification process includes the following steps: Steps for obtaining popular areas: Prepare a predetermined amount of auxiliary trajectory data to form an auxiliary trajectory dataset. Use density clustering to cluster all points contained in the auxiliary trajectory. After the clustering is completed, the obtained clusters are used as popular areas that are frequently visited in the spatial region. Steps for obtaining the trajectory embedding corresponding to the auxiliary trajectory: Input the auxiliary trajectory data into the trajectory embedding model and obtain the trajectory embedding corresponding to the auxiliary trajectory data; Labeling steps: For each auxiliary trajectory in the auxiliary trajectory dataset, label the popular areas traversed by the auxiliary trajectory. All popular areas obtained in the acquisition step are labeled, and all labels constitute the labels of the auxiliary trajectory. Network setup steps: Build a neural network containing an input layer, an output layer, and multiple hidden layers. The input layer size is the same as the size of the trajectory embedding being attacked. The hidden layer size is determined based on the input layer size. The output layer size corresponds to the number of hot regions obtained in the hot region acquisition step. The loss function used during neural network training is cross-entropy loss. As shown in equation (1); in, This indicates whether the original trajectory passed through popular areas. ; The original trajectory, as predicted by the neural network, passes through a popular area. The probability of; A collection comprised of popular areas; Model training steps: Using the trajectory embedding and label of the auxiliary trajectory, based on Equation (1), train the neural network so that the loss in Equation (1) continuously decreases until convergence, which means that the attack model training is complete; After the popular area judgment step: the trajectory to be attacked is embedded into the pre-trained attack model, and the corresponding label is obtained for the trajectory to be attacked. If the position of the label is the first predetermined value, it means that the trajectory to be attacked has passed through the corresponding popular area. If the position is the second predetermined value, it means that the trajectory to be attacked has not passed through the corresponding popular area.

4. The trajectory embedding method for preventing leakage according to claim 1, characterized in that, The recurrent neural network steps include the following steps: The steps for dividing the large spatial region are as follows: Divide the large spatial region into multiple smaller regions with similar shapes according to a predetermined method, and number each smaller region to construct a region set; Steps for obtaining the trajectory embedding corresponding to the auxiliary trajectory: Prepare a predetermined number of auxiliary trajectory data to form an auxiliary trajectory dataset; input the auxiliary trajectory data into the trajectory embedding model to obtain the trajectory embedding corresponding to the auxiliary trajectory data; Label construction steps: For each auxiliary trajectory in the auxiliary trajectory dataset, each point on the auxiliary trajectory is mapped to a small region in the region partitioning step: if a point on the auxiliary trajectory is in a small region, the point is replaced with the small region number; if a point on the auxiliary trajectory is not in any region, the point is replaced with the small region number at a predetermined distance from the point, converting the auxiliary trajectory into a number sequence; the number sequence is compressed to obtain the compressed number sequence, which is the label of the auxiliary trajectory; Network setup steps: Build a recurrent neural network containing an input layer, an output layer, and multiple hidden layers. The input layer size is the same as the size of the trajectory embedding being attacked. The hidden layer size is determined based on the input layer size. The output layer size is the number of small regions in the region set. The loss function used during recurrent neural network training is cross-entropy loss. As shown in equation (2); in, For the neural network Hidden state during step, It is the number sequence of the original trajectory. One number, Indicates based on the first Hidden state during step The predicted sequence of the original trajectory numbering is obtained. Number The probability, The sequence length; Network training steps: Using the trajectory embedding and label of the auxiliary trajectory, based on Equation (2), train the recurrent neural network so that the loss in Equation (2) continuously decreases until it converges, which means that the attack model training is complete; Trajectory recovery steps: Embed the trajectory to be attacked into the pre-trained attack model to obtain the corresponding label of the trajectory to be attacked; obtain the corresponding number sequence based on the obtained label, and connect the center coordinates of the small region corresponding to each number in sequence to obtain the recovered trajectory.

5. A trajectory embedding leak prevention system, characterized in that, Includes the following modules: Similarity-based attack module: In the test environment, the trajectory embedding to be attacked is attacked based on similarity calculation, and any area within the spatial region that the original trajectory may pass through is obtained as the privacy information of the predicted original trajectory. Model improvement module: The trajectory embedding model is examined, evaluated, and improved by using the privacy information of the predicted original trajectory; Leakage prevention module: Prevents trajectory embedding leakage by using an improved trajectory embedding model; The system also includes a multi-label classification module: in the test environment, based on the embedding of the trajectory to be attacked by multi-label classification, multiple popular areas in the spatial area that the original trajectory may pass through are obtained as privacy information of the predicted original trajectory. The system also includes a recurrent neural network module: in a test environment, based on the recurrent neural network attack on the trajectory embedding to be attacked, the original trajectory corresponding to the trajectory embedding to be attacked is recovered to a predetermined extent, which serves as the privacy information of the predicted original trajectory.

6. The trajectory embedding leakage prevention system according to claim 5, characterized in that, The attack module based on similarity calculation includes the following modules: Region division module: Divides a large spatial area into multiple smaller regions with similar shapes according to a predetermined division system; Embedding vector acquisition module: Treat each small region as a trajectory composed of points, input the trajectory embedding model, and obtain the embedding vector corresponding to the small region; Similarity calculation module: Utilizes cosine similarity to calculate the similarity between the embedding vector of each small region and the embedding vector of the trajectory to be attacked; Coordinate clustering module: Sort all calculated similarities and retain the top k small regions that are most similar to the trajectory to be attacked; obtain the center coordinates of the k small regions and use density clustering to cluster the center coordinates; Region Determination Module: After clustering is completed, a predetermined cluster is selected, and the average value of the coordinates of all center points in the cluster is calculated as the center point coordinates of the possible traversed region; a predetermined radius value is selected to define the spatial range of the possible traversed region; based on the center point coordinates and radius value, a region within the spatial region is determined as a region that the original trajectory may traverse.