Spatial trajectory differential privacy enhancement method based on spatio-temporal context and GAN
By using a spatiotemporal context and GAN-based approach, trajectory node embeddings are learned and a gradient penalty generation model is constructed. This solves the reverse engineering risks and insufficient data utility of traditional trajectory privacy protection methods, generating more realistic and highly usable trajectory data.
Patent Information
- Application Number
- CN202511531666.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-24
- Publication Date
- 2026-03-03
AI Technical Summary
Traditional trajectory privacy protection methods are subject to reverse engineering risks, and it is difficult to balance data utility and privacy protection. Existing generative models do not capture trajectory characteristics well enough, and the generated data space has poor rationality and practicality.
A spatial trajectory differential privacy enhancement method based on spatiotemporal context and GAN is adopted. Node embeddings are learned through a spatiotemporal graph attention network, privacy budget is dynamically allocated, a gradient-penalized Wasserstein GAN generation model is constructed, and trajectory semantic preservation loss is introduced to generate synthetic trajectory data.
While ensuring differential privacy, more realistic and practical trajectory data is generated, improving data utility and geographical rationality, resisting privacy attacks, and significantly enhancing stability and data availability.
Smart Images

Figure CN121598417A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of data privacy and security and artificial intelligence technology, and in particular to a spatial trajectory differential privacy enhancement method based on spatiotemporal context and GAN. Background Technology
[0002] With the widespread adoption of mobile internet and IoT technologies, user trajectory data is being collected and used extensively. However, traditional methods for protecting trajectory privacy have significant limitations: 1) Failure of point privacy protection based on independent perturbation: Adding noise independently to each location point in the trajectory (such as based on k-anonymity or differential privacy) makes it extremely vulnerable to reverse engineering and inference attacks. Attackers can use the spatiotemporal correlation of the trajectory (such as road networks and movement patterns) to infer the true location of the perturbation and even identify the user's identity.
[0003] 2) The dilemma of balancing data utility and privacy protection: Simple perturbations can cause a sharp decline in the spatial utility of trajectory data, making the published data unusable for meaningful analysis, such as traffic flow prediction or urban planning.
[0004] 3) Existing generative models are insufficient in capturing trajectory characteristics: Although some studies have tried to synthesize trajectories using generative adversarial networks, they often ignore the complex spatiotemporal context of the trajectory (such as the user's travel purpose, periodicity, and road constraints). Although the generated data meets privacy requirements, its spatial rationality and practicality are poor. Summary of the Invention
[0005] The technical solution adopted in this invention is to generate more realistic and practically valuable trajectory data while providing strict differential privacy protection. In view of this, this invention provides a spatial trajectory differential privacy enhancement method based on spatiotemporal context and GAN.
[0006] The present invention proposes a spatial trajectory differential privacy enhancement method based on spatiotemporal context and GAN, comprising: Step S1: Convert the original trajectory dataset into a spatiotemporal graph structure, wherein the nodes in the spatiotemporal graph represent location units with spatiotemporal attributes, and the edges represent the spatiotemporal transition relationships between locations; Step S2: Using a graph attention network, aggregate the spatiotemporal neighbor information of the nodes and learn the low-dimensional embedding vector of each node; Step S3: Based on the low-dimensional embedding vector, dynamically evaluate the privacy sensitivity of different regions and trajectory segments, and non-uniformly allocate differential privacy budgets according to the privacy sensitivity; Step S4: Construct a GAN generative model with gradient penalty; Step S5: In the loss function of the GAN generation model, a loss term based on the overall semantic features of the trajectory is introduced; Step S6: Train the GAN generative model, wherein during the model training process, calibrated Gaussian noise is added to the gradient of the generator, and after training is completed, the generator is used to generate synthetic trajectory datasets in batches. Step S7: Perform smoothing and connectivity post-processing on the generated trajectory, and verify the usability of the generated data using a preset utility evaluation index.
[0007] In one implementation, in step S2, the low-dimensional embedding vector encodes the node's geographical location, access frequency, and time pattern features.
[0008] In one embodiment, step S4 includes: A Wasserstein GAN generative model with gradient penalty is constructed, in which the generator receives random noise and noisy node embeddings and outputs synthetic trajectories; the discriminator is used to distinguish between real trajectories and synthetic trajectories, and the Wasserstein distance and gradient penalty mechanism are used to ensure the stability of training and the quality of generation.
[0009] In one implementation, the loss term in step S5 includes: trajectory shape loss, movement speed consistency loss, and access point distribution loss.
[0010] In one implementation, the utility evaluation metrics in step S7 include: retention of frequent patterns and distribution similarity.
[0011] Another aspect of the present invention provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to process the computer program to implement the spatial trajectory differential privacy enhancement method based on spatiotemporal context and GAN as described in any of the preceding claims.
[0012] Another aspect of the present invention provides a computer-readable storage medium storing a computer program that is executed to implement the spatial trajectory differential privacy enhancement method based on spatiotemporal context and GAN as described in any of the preceding claims.
[0013] By adopting the above technical solution, the present invention has at least the following advantages: This invention provides a spatial trajectory differential privacy enhancement method based on spatiotemporal context and Wasserstein GAN. By introducing a spatiotemporal graph attention network, gradient-penalized Wasserstein GAN, and trajectory semantic preservation loss, this invention significantly improves the data utility and geographical rationality of generated trajectories while ensuring differential privacy. Attached Figure Description
[0014] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings: Figure 1 This is a schematic diagram of the spatial trajectory differential privacy enhancement method based on spatiotemporal context and GAN according to an embodiment of the present invention. Detailed Implementation
[0015] To further illustrate the technical means and effects of the present invention in achieving its intended purpose, the present invention will be described in detail below with reference to the accompanying drawings and preferred embodiments.
[0016] While exemplary embodiments of the invention are shown in the accompanying drawings, it should be understood that the invention can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the invention and to fully convey its scope to those skilled in the art. The invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0017] The first embodiment of the present invention provides a method and apparatus for enhancing privacy through spatial trajectory differential based on spatiotemporal context and GAN, such as... Figure 1 As shown, it includes the following steps: Step S1: Trajectory preprocessing and spatiotemporal graph construction.
[0018] Input the original trajectory dataset First, GPS points are subjected to map matching and noise reduction. Then, the geographic space is divided into uniformly sized grid cells. Unlike the simple density grid in the comparison files, this step constructs a spatiotemporal... : : A set of nodes, each node For a given grid cell, its node characteristics include the number of visits to that cell, the average dwell time, and the visit distribution over time slices (such as weekdays / weekends, daytime / nighttime).
[0019] Edge set: If two grid cells appear consecutively in at least one true trajectory, then there is an edge between them.
[0020] Adjacency matrix, and further assign weights to edges based on trajectory transition frequency. .
[0021] Step S2: Node embedding learning based on spatiotemporal graph attention network.
[0022] In this embodiment, a multi-layer spatiotemporal graph attention network is used to learn the embedding representation of nodes. .
[0023] -For each node Its initial characteristics are .
[0024] - At each layer, nodes aggregate their neighbor information through an attention mechanism: Among them, attention coefficient The calculation is as follows: here, It is a learnable weight matrix. It is an attention vector. Let i be the set of neighbors of node i, and || represents the concatenation operation.
[0025] By stacking multiple layers of networks, the final embedding of each node... It captured rich spatiotemporal context information of its multi-hop neighbors.
[0026] Step S3: Adaptive allocation of privacy budget and sensitivity calculation.
[0027] In this embodiment of the invention, the privacy budget is dynamically allocated based on node embedding.
[0028] Calculate the privacy sensitivity score for each node. (A larger norm usually indicates that the node is more central or more unique.)
[0029] The sensitivity scores are normalized and mapped to the privacy budget for each node or trajectory segment. : in It is a temperature parameter, which allows for a smaller [temperature range] in highly sensitive areas. (i.e., stronger noise protection).
[0030] For query functions that require adding noise (Such as node access count), its sensitivity Calibration is performed based on the spatiotemporal graph structure.
[0031] Step S4: Construct a Wasserstein GAN generative model with gradient penalty.
[0032] Model structure as follows Figure 1 As shown.
[0033] Generator This is a sequence generation model based on LSTM or Transformer. The input is a random noise vector. and the initial node embedding after Laplace noise perturbation The generator outputs a synthesized trajectory. .
[0034] Discriminator : is a convolutional neural network used to map the entire trajectory to a real number (i.e., an estimate of the Wasserstein distance). It evaluates the distributional differences between the real and synthetic trajectories.
[0035] Objective function: The loss function adopted is that of Wasserstein GAN with Gradient Penalty (WGAN-GP). in, It is the actual data distribution. It generates data distribution. It is a random interpolation of real and generated data points. It is the gradient penalty coefficient.
[0036] Step S5: Introduce the trajectory semantic preservation loss function.
[0037] To ensure the reasonableness of the generated trajectories, a semantic preservation loss is added to the total loss of the generator. : in, - The shape similarity between the generated trajectory and the nearest real trajectory is measured using a dynamic time warping distance metric.
[0038] - The speed changes of the constrained generated trajectory segments conform to the statistical laws of real data.
[0039] - The distribution of visit points in the trajectory generated using the maximum mean difference constraint is consistent with the actual distribution.
[0040] Step S6: Model training and trajectory generation that satisfy differential privacy.
[0041] To ensure the entire method meets - Differential privacy: During training, we do not add noise to the discriminator, but perturb the gradient of the generator. Specifically, we use the DP-SGD algorithm: 1) Calculate the generator loss gradient with respect to parameters .
[0042] 2) Clip the gradient so that its L2 norm does not exceed the threshold. .
[0043] 3) Add Gaussian noise to the clipped gradient: .
[0044] 4) Use noise gradient Update generator parameters.
[0045] Track privacy consumption throughout the training process using privacy accounting methods such as Matrix accounting. Once trained, the generator can produce any number of synthetic trajectories without consuming additional privacy budget.
[0046] Step S7: Post-processing and utility evaluation of generated trajectories.
[0047] The generated trajectories are then subjected to map matching to constrain them to the actual road network, improving their geographical plausibility. Finally, the utility of the generated trajectories is evaluated from multiple dimensions: Statistical utility: Comparing the distribution of real and generated data in terms of statistical quantities such as trajectory length and radius.
[0048] Semantic utility: Compare the degree of overlap between the two in frequent path patterns and point of interest access patterns.
[0049] Application utility: Performance on specific downstream tasks (such as traffic prediction).
[0050] In summary, compared with the prior art, the present invention has at least the following advantages: 1) The embodiments of the present invention have stronger privacy protection capabilities: through adaptive privacy budget allocation and strict differential privacy training mechanism, sensitive location information can be protected more effectively and resisted by a variety of privacy attacks, including member inference attacks.
[0051] 2) The embodiments of the present invention have higher data utility: by using spatiotemporal graph attention network and semantic preservation loss, the generated trajectory can better maintain the spatiotemporal pattern, geographical constraints and semantic features of the original trajectory, and the data availability is significantly higher than that of traditional methods.
[0052] 3) The embodiments of the present invention have better model stability: By using Wasserstein GAN and gradient penalty, the problems of mode collapse and non-convergence that are prone to occur in traditional GAN during training are solved, making model training more stable and reliable.
[0053] 4) The embodiments of the present invention have a strong ability to capture complex movement patterns: abandoning the strong independence assumption of Markov chains, the complex joint distribution of trajectories is directly learned through deep generative models, which can model the long-range, nonlinear movement behavior of users.
[0054] The second embodiment of the present invention corresponds to the first embodiment. This embodiment introduces an electronic device including a memory and a processor. The memory stores a computer program, and the processor is used to process the computer program to implement the spatial trajectory differential privacy enhancement method based on spatiotemporal context and GAN as described in the first embodiment.
[0055] It should be noted that, in the embodiments of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0056] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0057] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0058] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims. All of these forms are within the protection scope of this application.
Claims
1. A spatial trajectory differential privacy enhancement method based on spatiotemporal context and GAN, characterized in that, include: Step S1: Convert the original trajectory dataset into a spatiotemporal graph structure, wherein the nodes in the spatiotemporal graph represent location units with spatiotemporal attributes, and the edges represent the spatiotemporal transition relationships between locations; Step S2: Using a graph attention network, aggregate the spatiotemporal neighbor information of the nodes and learn the low-dimensional embedding vector of each node; Step S3: Based on the low-dimensional embedding vector, dynamically evaluate the privacy sensitivity of different regions and trajectory segments, and non-uniformly allocate differential privacy budgets according to the privacy sensitivity; Step S4: Construct a GAN generative model with gradient penalty; Step S5: In the loss function of the GAN generation model, a loss term based on the overall semantic features of the trajectory is introduced; Step S6: Train the GAN generative model, wherein during the model training process, calibrated Gaussian noise is added to the gradient of the generator, and after training is completed, the generator is used to generate synthetic trajectory datasets in batches. Step S7: Perform smoothing and connectivity post-processing on the generated trajectory, and verify the usability of the generated data using a preset utility evaluation index.
2. The spatial trajectory differential privacy enhancement method based on spatiotemporal context and GAN according to claim 1, characterized in that, In step S2, the low-dimensional embedding vector encodes the node's geographical location, access frequency, and time pattern features.
3. The spatial trajectory differential privacy enhancement method based on spatiotemporal context and GAN according to claim 2, characterized in that, Step S4 includes: A Wasserstein GAN generative model with gradient penalty is constructed, in which the generator receives random noise and noisy node embeddings and outputs synthetic trajectories; the discriminator is used to distinguish between real trajectories and synthetic trajectories, and the Wasserstein distance and gradient penalty mechanism are used to ensure the stability of training and the quality of generation.
4. The spatial trajectory differential privacy enhancement method based on spatiotemporal context and GAN according to claim 3, characterized in that, In step S5, the loss terms include: trajectory shape loss, movement speed consistency loss, and access point distribution loss.
5. The spatial trajectory differential privacy enhancement method based on spatiotemporal context and GAN according to claim 4, characterized in that, In step S7, the utility evaluation indicators include: retention of frequent patterns and distribution similarity.
6. An electronic device, characterized in that, The system includes a memory and a processor, wherein the memory stores a computer program and the processor processes the computer program to implement the spatial trajectory differential privacy enhancement method based on spatiotemporal context and GAN as described in any one of claims 1 to 5.
7. A computer-readable storage medium, characterized in that, The medium stores a computer program that is executed to implement the spatial trajectory differential privacy enhancement method based on spatiotemporal context and GAN as described in any one of claims 1 to 5.