Trajectory processing method and device based on diffusion model

Through the trajectory processing method based on the diffusion model, using mask rules and noise processing technology to extract trajectory features, the problem of insufficient generalization ability in trajectory processing by existing deep learning models is solved, and the flexibility and accuracy of multi-task processing are achieved sex.

CN118760731BActive Publication Date: 2024-11-05TSINGHUA UNIVERSITY

Patent Information

Application Number
CN202411249233.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-06
Publication Date
2024-11-05
Estimated Expiration
2044-09-06

AI Technical Summary

Technical Problem

The existing deep learning models lack generalization capabilities in trajectory processing tasks and cannot be applied to multiple tasks. Individual models designed for specific tasks cannot flexibly respond to different application scenarios.

Method used

Using a trajectory processing method based on the diffusion model, the trajectory data of the target user is obtained, and the preset mask rules and diffusion model are used for noise processing, the location features and movement mode features are extracted, and a general model is generated to process trajectory prediction, completion and Generate a task.

Benefits of technology

It realizes efficient processing of multiple trajectory processing tasks, improves the generalization ability of the model, can adapt to different application scenarios and generate accurate task results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118760731B_ABST
    Figure CN118760731B_ABST
Patent Text Reader

Abstract

The present disclosure relates to the field of trajectory processing technology, and in particular to a trajectory processing method and device based on a diffusion model, the method comprising obtaining a trajectory processing task for a target user, determining the task type and the current trajectory and historical trajectory; determining a target mask based on a mask rule, and extracting a location feature vector from the current trajectory; determining a task target vector and a conditional observation vector based on the target mask and the location feature vector, adding noise to the task target vector using a diffusion model to obtain a noisy task target vector; extracting a historical trajectory to obtain a pattern feature vector; processing the noisy task target vector, conditional observation vector, target mask, and pattern feature vector based on a diffusion model to obtain a target result. The trajectory processing method and device of the embodiment of the present disclosure can efficiently process trajectory prediction or trajectory completion tasks and generate accurate task results using a general model formed based on a diffusion model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of trajectory processing, and in particular to a trajectory processing method and device based on a diffusion model. Background Art

[0002] Trajectory data records human mobility patterns and activity ranges, and plays a vital role in many applications such as urban planning, traffic management, and network optimization. In recent years, in order to better support these downstream applications, more and more researchers have begun to focus on using trajectory data to simulate human mobility and have developed many typical tasks such as trajectory generation, trajectory completion, and trajectory prediction.

[0003] With the continuous development of deep learning technology, related technologies have proposed the use of deep learning technology to solve specific tasks. However, the related methods still have many limitations. For example, the deep learning model is a separate model designed for specific tasks and cannot be applied to other tasks, and the generalization ability is insufficient. Summary of the invention

[0004] In view of this, the present disclosure proposes a trajectory processing method and device based on a diffusion model, which can efficiently process a variety of different trajectory processing tasks and generate accurate task results.

[0005] According to one aspect of the present disclosure, a trajectory processing method based on a diffusion model is provided, comprising: obtaining a trajectory processing task for a target user, determining a task type and a current trajectory of the target user in a current time period and a historical trajectory of the target user in a historical time period required for executing the trajectory processing task according to the trajectory processing task, wherein the task type is trajectory prediction or trajectory completion, and the current trajectory and the historical trajectory both include the movement trajectory of the target user in the city; determining a target mask corresponding to the task type based on a preset mask rule, and extracting location features from the current trajectory to obtain a location feature of the target user in the current time period; point feature vector, wherein the mask rule is determined based on multiple mask strategies; a task target vector and a conditional observation vector corresponding to the task type are determined according to the target mask and the location feature vector, noise is added to the task target vector using a diffusion model to obtain a noisy task target vector; feature extraction is performed on the historical trajectory for the movement pattern of the target user to obtain a pattern feature vector corresponding to the target user in the historical time period; the noisy task target vector, the conditional observation vector, the target mask, and the pattern feature vector are processed based on the diffusion model to obtain a target result corresponding to the trajectory processing task.

[0006] In a possible implementation, the noisy task target vector, the conditional observation vector, the target mask, and the pattern feature vector are processed based on the diffusion model to obtain a target result corresponding to the trajectory processing task, including: processing the noisy task target vector, the conditional observation vector, and the encoding result of the time step used in the diffusion model calculation based on the diffusion model to obtain a spatiotemporal feature vector; processing the spatiotemporal feature vector, the target mask, and the pattern feature vector based on the diffusion model to obtain a target result corresponding to the trajectory processing task.

[0007] In one possible implementation, a task target vector and a conditional observation vector corresponding to the task type are determined based on the target mask and the location feature vector, including: performing element-by-element multiplication operations on the target mask and the location feature vector to obtain the conditional observation vector; determining a target vector based on the target mask, and performing element-by-element multiplication operations on the target vector and the location feature vector to obtain the task target vector.

[0008] In a possible implementation, the multiple mask strategies include a terminal mask strategy for trajectory prediction, a random mask strategy for trajectory completion, and a complete mask strategy for trajectory generation; determining a target mask corresponding to the task type based on a preset mask rule, including: constructing the mask rule based on the terminal mask strategy, the random mask strategy, and the complete mask strategy; determining a target mask corresponding to the task type based on the trajectory processing task and the mask rule.

[0009] In a possible implementation, the multiple masking strategies also include a sequence masking strategy for simulating a user's continuous movement pattern and a circadian rhythm masking strategy for capturing the user's day and night activity patterns; the masking rules are constructed based on the terminal masking strategy, the random masking strategy, and the complete masking strategy, including: assigning a corresponding ratio to each of the masking strategies, and constructing the masking rules based on each of the masking strategies and the corresponding ratios of each of the masking strategies.

[0010] In a possible implementation, the method also includes a training process of the diffusion model, which includes: constructing a sample set based on historical trajectories of multiple users in a preset time period, wherein the historical trajectories include the trajectories of the corresponding users in the city; determining multiple sample masks representing trajectory prediction, trajectory completion, and trajectory generation from multiple preset mask strategies, wherein the multiple mask strategies include at least one of a terminal mask strategy for trajectory prediction, a random mask strategy for trajectory completion, a complete mask strategy for trajectory generation, a sequence mask strategy for simulating a user's continuous movement pattern, and a complete mask strategy for capturing the user's diurnal activity pattern; based on the sample set and the multiple sample masks, training a preset unconditional diffusion model and a conditional diffusion model to obtain the diffusion model.

[0011] According to another aspect of the present disclosure, a trajectory processing method based on a diffusion model is provided, including: obtaining a trajectory processing task for a target user, determining a task type and a historical trajectory of the target user in a historical time period required to execute the trajectory processing task according to the trajectory processing task, wherein the task type is trajectory generation, and the historical trajectory includes the movement trajectory of the target user in the city; determining a target mask corresponding to the task type based on a preset mask rule, wherein the mask rule is determined based on multiple mask strategies; determining a task target vector corresponding to the task type according to the target mask, adding noise to the task target vector using a diffusion model to obtain a noisy task target vector; performing feature extraction on the historical trajectory for the target user's movement pattern to obtain a pattern feature vector corresponding to the target user in the historical time period; processing the noisy task target vector, the target mask, and the pattern feature vector based on the diffusion model to obtain a target result corresponding to the trajectory processing task.

[0012] In a possible implementation, the noisy task target vector, the target mask, and the pattern feature vector are processed based on the diffusion model to obtain a target result corresponding to the trajectory processing task, including: processing the noisy task target vector and the encoding result of the time step used in the calculation of the diffusion model based on the diffusion model to obtain a spatiotemporal feature vector; processing the spatiotemporal feature vector, the target mask, and the pattern feature vector based on the diffusion model to obtain a target result corresponding to the trajectory processing task.

[0013] In a possible implementation, the multiple mask strategies include a terminal mask strategy for trajectory prediction, a random mask strategy for trajectory completion, and a complete mask strategy for trajectory generation; determining a target mask corresponding to the task type based on a preset mask rule, including: constructing the mask rule based on the terminal mask strategy, the random mask strategy, and the complete mask strategy; determining a target mask corresponding to the task type based on the trajectory processing task and the mask rule.

[0014] In a possible implementation, the multiple masking strategies also include a sequence masking strategy for simulating a user's continuous movement pattern and a circadian rhythm masking strategy for capturing the user's day and night activity patterns; the masking rules are constructed based on the terminal masking strategy, the random masking strategy, and the complete masking strategy, including: assigning a corresponding ratio to each of the masking strategies, and constructing the masking rules based on each of the masking strategies and the corresponding ratios of each of the masking strategies.

[0015] In a possible implementation, the method also includes a training process of the diffusion model, which includes: constructing a sample set based on historical trajectories of multiple users in a preset time period, wherein the historical trajectories include the trajectories of the corresponding users in the city; determining multiple sample masks representing trajectory prediction, trajectory completion, and trajectory generation from multiple preset mask strategies, wherein the multiple mask strategies include at least one of a terminal mask strategy for trajectory prediction, a random mask strategy for trajectory completion, a complete mask strategy for trajectory generation, a sequence mask strategy for simulating a user's continuous movement pattern, and a complete mask strategy for capturing the user's diurnal activity pattern; based on the sample set and the multiple sample masks, training a preset unconditional diffusion model and a conditional diffusion model to obtain the diffusion model.

[0016] According to another aspect of the present disclosure, a trajectory processing device based on a diffusion model is provided, comprising: a first acquisition module, used to acquire a trajectory processing task for a target user, and determine, according to the trajectory processing task, a task type and a current trajectory of the target user in a current time period and a historical trajectory of the target user in a historical time period required to perform the trajectory processing task, wherein the task type is trajectory prediction or trajectory completion, and the current trajectory and the historical trajectory both include the movement trajectory of the target user in the city; a first determination module, used to determine a target mask corresponding to the task type based on a preset mask rule, and perform location feature extraction on the current trajectory to obtain a location feature orientation corresponding to the target user in the current time period; wherein the masking rule is determined based on a plurality of masking strategies; a first noise adding module is used to determine a task target vector and a conditional observation vector corresponding to the task type according to the target mask and the location feature vector, and to add noise to the task target vector using a diffusion model to obtain a noisy task target vector; a first extraction module is used to perform feature extraction on the historical trajectory for the movement pattern of the target user to obtain a pattern feature vector corresponding to the target user in the historical time period; a first processing module is used to process the noisy task target vector, the conditional observation vector, the target mask, and the pattern feature vector based on the diffusion model to obtain a target result corresponding to the trajectory processing task.

[0017] In a possible implementation, the noisy task target vector, the conditional observation vector, the target mask, and the pattern feature vector are processed based on the diffusion model to obtain a target result corresponding to the trajectory processing task, including: processing the noisy task target vector, the conditional observation vector, and the encoding result of the time step used in the diffusion model calculation based on the diffusion model to obtain a spatiotemporal feature vector; processing the spatiotemporal feature vector, the target mask, and the pattern feature vector based on the diffusion model to obtain a target result corresponding to the trajectory processing task.

[0018] In one possible implementation, a task target vector and a conditional observation vector corresponding to the task type are determined based on the target mask and the location feature vector, including: performing element-by-element multiplication operations on the target mask and the location feature vector to obtain the conditional observation vector; determining a target vector based on the target mask, and performing element-by-element multiplication operations on the target vector and the location feature vector to obtain the task target vector.

[0019] In a possible implementation, the multiple mask strategies include a terminal mask strategy for trajectory prediction, a random mask strategy for trajectory completion, and a complete mask strategy for trajectory generation; determining a target mask corresponding to the task type based on a preset mask rule, including: constructing the mask rule based on the terminal mask strategy, the random mask strategy, and the complete mask strategy; determining a target mask corresponding to the task type based on the trajectory processing task and the mask rule.

[0020] In a possible implementation, the multiple masking strategies also include a sequence masking strategy for simulating a user's continuous movement pattern and a circadian rhythm masking strategy for capturing the user's day and night activity patterns; the masking rules are constructed based on the terminal masking strategy, the random masking strategy, and the complete masking strategy, including: assigning a corresponding ratio to each of the masking strategies, and constructing the masking rules based on each of the masking strategies and the corresponding ratios of each of the masking strategies.

[0021] In a possible implementation, the device also includes a first training module, which is used to execute a training process of the diffusion model, and the training process includes: constructing a sample set based on historical trajectories of multiple users in a preset time period, wherein the historical trajectories include the trajectories of the corresponding users in the city; determining multiple sample masks representing trajectory prediction, trajectory completion, and trajectory generation from multiple preset mask strategies, wherein the multiple mask strategies include at least one of a terminal mask strategy for trajectory prediction, a random mask strategy for trajectory completion, a complete mask strategy for trajectory generation, a sequence mask strategy for simulating a user's continuous movement mode, and a complete mask strategy for capturing the user's diurnal activity pattern; based on the sample set and the multiple sample masks, training a preset unconditional diffusion model and a conditional diffusion model to obtain the diffusion model.

[0022] According to another aspect of the present disclosure, a trajectory processing device based on a diffusion model is provided, comprising: a second acquisition module, used to acquire a trajectory processing task for a target user, and determine the task type and the historical trajectory of the target user in a historical time period required to execute the trajectory processing task according to the trajectory processing task, wherein the task type is trajectory generation, and the historical trajectory includes the movement trajectory of the target user in the city; a second determination module, used to determine a target mask corresponding to the task type based on a preset mask rule, wherein the mask rule is determined based on multiple mask strategies; a second noise addition module, used to determine a task target vector corresponding to the task type according to the target mask, and add noise to the task target vector using a diffusion model to obtain a noisy task target vector; a second extraction module, used to perform feature extraction on the historical trajectory for the movement mode of the target user to obtain a pattern feature vector corresponding to the target user in the historical time period; a second processing module, used to process the noisy task target vector, the target mask, and the pattern feature vector based on the diffusion model to obtain a target result corresponding to the trajectory processing task.

[0023] In a possible implementation, the noisy task target vector, the target mask, and the pattern feature vector are processed based on the diffusion model to obtain a target result corresponding to the trajectory processing task, including: processing the noisy task target vector and the encoding result of the time step used in the calculation of the diffusion model based on the diffusion model to obtain a spatiotemporal feature vector; processing the spatiotemporal feature vector, the target mask, and the pattern feature vector based on the diffusion model to obtain a target result corresponding to the trajectory processing task.

[0024] In a possible implementation, the multiple mask strategies include a terminal mask strategy for trajectory prediction, a random mask strategy for trajectory completion, and a complete mask strategy for trajectory generation; determining a target mask corresponding to the task type based on a preset mask rule, including: constructing the mask rule based on the terminal mask strategy, the random mask strategy, and the complete mask strategy; determining a target mask corresponding to the task type based on the trajectory processing task and the mask rule.

[0025] In a possible implementation, the multiple masking strategies also include a sequence masking strategy for simulating a user's continuous movement pattern and a circadian rhythm masking strategy for capturing the user's day and night activity patterns; the masking rules are constructed based on the terminal masking strategy, the random masking strategy, and the complete masking strategy, including: assigning a corresponding ratio to each of the masking strategies, and constructing the masking rules based on each of the masking strategies and the corresponding ratios of each of the masking strategies.

[0026] In a possible implementation, the device also includes a second training module, which is used to execute a training process of the diffusion model, and the training process includes: constructing a sample set based on historical trajectories of multiple users in a preset time period, wherein the historical trajectories include the trajectories of the corresponding users in the city; determining multiple sample masks representing trajectory prediction, trajectory completion, and trajectory generation from multiple preset mask strategies, wherein the multiple mask strategies include at least one of a terminal mask strategy for trajectory prediction, a random mask strategy for trajectory completion, a complete mask strategy for trajectory generation, a sequence mask strategy for simulating a user's continuous movement mode, and a complete mask strategy for capturing the user's diurnal activity pattern; based on the sample set and the multiple sample masks, training a preset unconditional diffusion model and a conditional diffusion model to obtain the diffusion model.

[0027] According to another aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to implement the above method when executing the instructions stored in the memory.

[0028] According to another aspect of the present disclosure, a non-volatile computer-readable storage medium is provided, on which computer program instructions are stored, wherein the computer program instructions implement the above method when executed by a processor.

[0029] According to another aspect of the present disclosure, a computer program product is provided, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above method.

[0030] Further features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the disclosure and, together with the description, serve to explain the principles of the disclosure.

[0032] Figures 1 to 5 A schematic diagram of a trajectory processing method based on a diffusion model provided according to an embodiment of the present disclosure is shown.

[0033] Figures 6 to 8 A block diagram of a trajectory processing device based on a diffusion model provided according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0034] Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.

[0035] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.

[0036] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present disclosure.

[0037] In order to facilitate those skilled in the art to understand the technical solution provided by the embodiments of the present disclosure, the technical environment in which the technical solution is implemented is described below.

[0038] In recent years, existing research on typical tasks such as trajectory generation, trajectory completion, and trajectory prediction can be divided into rule-based methods and data-driven methods. Rule-based methods effectively use temporal and spatial regularities to simulate human mobility. For example, some studies consider home as a special location in human mobility to simulate the circadian rhythm of human mobility to generate trajectories, and some studies use the spatial relationship of neighboring Global Positioning System (GPS) points to guide trajectory completion based on group intelligence.

[0039] With the great progress of deep generative model technology, human mobility research based on data-driven methods is developing rapidly. Some studies use generative adversarial networks (GANs) to learn the spatial distribution of raw trajectory data and use deep learning models Seq2Seq to sort the generated spatial points to generate trajectories. In addition, some innovative studies combine rule-based methods and data-driven methods to simulate human mobility, combining the interpretability of rule-based methods with the efficient processing capabilities of data-driven methods for complex and multi-dimensional data.

[0040] However, both rule-based and data-driven methods have many shortcomings. For example, the deep learning model in the relevant technology is a separate model designed for a specific task and cannot be applied to other tasks. Another example is that the generalization ability of the deep learning model is insufficient and it only shows good performance for users who have appeared in the training data.

[0041] In order to solve the above technical problems, the embodiment of the present disclosure provides a trajectory processing method based on a diffusion model. A general model formed based on the diffusion model can be used to complete a variety of different trajectory-related tasks. In other words, the general model formed based on the diffusion model can process trajectory prediction, trajectory completion, and trajectory generation. The processing process may include obtaining a trajectory processing task for a target user, determining a target mask corresponding to the task type based on a preset mask rule, determining a task target vector corresponding to the task type according to the target mask, extracting a pattern feature vector of the target user from features in the historical trajectory, and obtaining a target result of the corresponding trajectory processing task based on the diffusion model. In this way, a general model can be used to flexibly process different types of trajectory processing tasks and adapt to different application scenarios. In the processing process of the general model, more accurate task results can be obtained by combining the pattern feature vector used to indicate the personalized features of the user, thereby improving the generalization ability of the general model.

[0042] The process of processing the two tasks of trajectory prediction and trajectory completion using a general model formed based on a diffusion model is slightly different from the process of processing the task of trajectory generation. The difference in the processing process is mainly determined by the nature of the task itself. Trajectory prediction needs to determine the conditional observation vector based on the current trajectory of the target user to participate in the subsequent prediction process. Similarly, trajectory completion also needs to determine the conditional observation vector based on the current trajectory of the target user to participate in the subsequent completion process. Trajectory generation does not need to input the current trajectory as the input of the entire trajectory generation task processing process, so there is no need to perform subsequent generation tasks based on the conditional observation vector, but the specific processing processes of these three tasks are all implemented based on the general model formed by the diffusion model, as described below. The general model for the trajectory processing method provided in the embodiment of the present disclosure may include a mask condition module, a user characterization module, and a noise predictor, wherein the user characterization module can be formed based on a long short-term memory (LSTM, Long Short-Term Memory, LSTM) network, and the noise predictor can be formed based on a diffusion model, a transformer (Transformer) model, and a multilayer perceptron (Multilayer Perceptron, MLP), as described below. For the sake of brevity, this article focuses on how to use these models to cope with different types of trajectory processing tasks, and does not go into detail about the specific processing processes of LSTM, Transformer, MLP, and LINE in the following text. In fact, the specific structures of LSTM, Transformer, MLP, and LINE in the following text can be flexibly selected according to actual needs, so their respective processing processes are also determined according to actual conditions.

[0043] Figures 1 to 5A schematic diagram of a trajectory processing method based on a diffusion model provided according to an embodiment of the present disclosure is shown. Figures 1 to 5 The trajectory processing method for trajectory prediction or trajectory completion provided by the embodiment of the present disclosure is schematically described. In order to better illustrate the trajectory processing process corresponding to the three tasks of trajectory prediction, trajectory completion, and trajectory generation, this article describes the trajectory processing method based on the diffusion model for trajectory prediction or trajectory completion and the trajectory processing method based on the diffusion model for trajectory generation respectively.

[0044] The disclosed embodiment provides a trajectory processing method based on a diffusion model, which obtains a trajectory processing task for a target user, determines the task type and the current trajectory of the target user in the current time period and the historical trajectory of the target user in the historical time period required to execute the trajectory processing task according to the trajectory processing task, wherein the task type is trajectory prediction or trajectory completion, and the current trajectory and the historical trajectory both include the movement trajectory of the target user in the city; determines a target mask corresponding to the task type based on a preset mask rule, extracts location features from the current trajectory, and obtains a location feature vector corresponding to the target user in the current time period, wherein the mask rule is determined based on multiple mask strategies. Determined; determine the task target vector and conditional observation vector of the corresponding task type according to the target mask and the location feature vector, use the diffusion model to add noise to the task target vector, and obtain the noisy task target vector; extract the features of the target user's mobile mode for the historical trajectory, and obtain the pattern feature vector corresponding to the target user in the historical time period; based on the diffusion model, process the noisy task target vector, conditional observation vector, target mask, and pattern feature vector to obtain the target result of the corresponding trajectory processing task, so that the general model formed based on the diffusion model can be used to efficiently process trajectory prediction or trajectory completion tasks and generate accurate task results.

[0045] like Figure 1 As shown, the trajectory processing method for trajectory prediction or trajectory completion may include the following steps S101 to S105.

[0046] Step S101: Acquire a trajectory processing task for a target user, and determine the task type and the current trajectory of the target user in the current time period and the historical trajectory of the target user in the historical time period required to execute the trajectory processing task according to the trajectory processing task.

[0047] The trajectory processing task may be a trajectory prediction task or a trajectory completion task. Correspondingly, the task type of the trajectory processing task is trajectory prediction or trajectory completion. Both the current trajectory and the historical trajectory may include the movement trajectory of the target user in the city, and may also include the movement trajectory outside the city. The city division boundary here is determined according to the actual situation. In addition, it should be noted that the current time period and historical time period used in processing the trajectory prediction task and the trajectory completion task can be flexibly set, and the embodiments of the present disclosure do not limit this.

[0048] Step S102: Determine a target mask corresponding to the task type based on a preset mask rule, and extract location features of the current trajectory to obtain a location feature vector corresponding to the target user in the current time period.

[0049] The mask rule is determined based on multiple mask strategies, which are used to generate a mask corresponding to the trajectory processing task.

[0050] The multiple masking strategies may include strategies related to trajectory prediction, trajectory completion, and trajectory generation, for generating masks that match the trajectory processing task. In one possible implementation, the multiple masking strategies include a terminal masking strategy for trajectory prediction, a random masking strategy for trajectory completion, and a full masking strategy for trajectory generation. The terminal masking strategy is specifically designed for trajectory prediction tasks, because the missing trajectory part or pattern in the trajectory prediction task is fixed at a given future time point, so this strategy directly masks the future part of the trajectory to form a corresponding mask. For details, see Figure 2 The random mask strategy is designed for the task of trajectory completion. In the training process of the general model, due to the uncertainty of the missing trajectory part, the percentage between 0-100% can be selected to adjust the recovery target of different proportions to adapt to the different missing proportions in the test set, where the proportion refers to the proportion of the missing trajectory part in the complete trajectory, and the recovery target refers to the missing trajectory part. The full mask strategy is designed for the task of trajectory generation. Because no part of the trajectory is required as an observation value in the task of trajectory generation (that is, there is no need to form a conditional observation vector), this strategy directly masks the entire trajectory to form the corresponding mask. For details, see Figure 2 .

[0051] In this implementation, determining the target mask of the corresponding task type based on the preset mask rule in step S102 may include: constructing the mask rule based on the terminal mask strategy, the random mask strategy, and the complete mask strategy, wherein different proportions may be allocated to the three strategies of the terminal mask strategy, the random mask strategy, and the complete mask strategy to construct the mask rule; determining the target mask of the corresponding task type based on the trajectory processing task and the mask rule, for example, if the trajectory processing task is a trajectory prediction task at this time, then based on the trajectory prediction task and the mask rule, the following may be generated Figure 2 The mask corresponding to the terminal mask strategy in the middle indicates that the task objective of the trajectory processing task is the last part of the predicted trajectory.

[0052] In this way, by introducing three different masking strategies, namely the terminal masking strategy, the random masking strategy and the complete masking strategy, the trajectory processing method can adaptively generate suitable target masks according to different trajectory processing task requirements, can better adapt to different application scenarios and task requirements, and improve the flexibility and adaptability of trajectory processing.

[0053] Since the general model provided by the embodiments of the present disclosure is used to model human movement trajectories, in addition to the above-mentioned strategies related to trajectory prediction, trajectory completion, and trajectory generation, multiple mask strategies may also include strategies related to human trajectories to capture human movement patterns. In one possible implementation, the multiple mask strategies also include a sequence mask strategy for simulating the user's continuous movement pattern and a circadian rhythm mask strategy for capturing the user's day and night activity patterns. The design motivation of the sequence mask strategy comes from the inherent pattern of people's movement in the real world, that is, daily movement is a continuous position transfer, so this strategy continuously masks a certain proportion of the trajectory. For details, please refer to Figure 2 The circadian masking strategy aims to capture the circadian rhythm of human activity, which is mainly characterized by daytime work and nighttime rest, so that, for example Figure 2 As shown, it can mask the tracks of the hours between midnight and 6 a.m. when people are not moving around much.

[0054] In this implementation, constructing mask rules based on terminal mask strategy, random mask strategy, and complete mask strategy may further include: assigning corresponding proportions to each of the mask strategies of terminal mask strategy, random mask strategy, complete mask strategy, sequence mask strategy, and circadian rhythm mask strategy, and constructing mask rules based on each mask strategy and the proportions corresponding to each mask strategy. The proportions corresponding to each mask strategy may be set according to actual needs, and the embodiments of the present disclosure do not limit this.

[0055] In this way, by introducing the sequence masking strategy and the circadian rhythm masking strategy, the generated task results are closer to the characteristics of actual human movement, the authenticity and credibility of the trajectory are improved, and by combining different masking strategies with corresponding proportions to construct masking rules, the contribution of different strategies in the trajectory processing process can be balanced, which helps to cope with different types of trajectory processing tasks and can better adapt to complex and changing environments and tasks.

[0056] It should be noted that although the trajectory processing method introduced here is for trajectory prediction or trajectory completion, no matter which task is being dealt with, the mask rules used are determined based on a variety of mask strategies.

[0057] In order to represent the spatiotemporal dependency of the trajectory, the trajectory processing method represents the trajectory into a dense representation to form the input of other modules, wherein the dense representation can refer to learning the input data through the model to determine the potential representation of the input data, i.e., the features. In some embodiments, the current trajectory can be processed by a Large-scale Information Network Embedding (LINE) model to obtain a location feature vector. For example, the location representation vector of each timestamp in the current time period can be obtained by connecting the location representation vectors of each timestamp in the current time period. l To obtain the location feature vector e for the target user in the current time period all , where the location represents l The trained LINE model can be used to process the current input trajectory to obtain l =LINE θ (G), e l represents the location representation for location l, LINE θ (G) means that the input G is processed by a LINE model with a parameter θ to obtain e l , G represents the spatial graph constructed based on the trajectories of multiple sample users in a preset time period in order to improve the geographical continuity of the trajectory during training. G=(V,E), V represents the set of nodes corresponding to all locations visited by all sample users, E represents the set of edges indicating the relationship between location pairs, and each edge in E is denoted by e, which consists of an unordered pair (u,v) and a positive weight w uv Related, w uv >0,w uv Represents the Euclidean distance between location u and location v.

[0058] It should be noted that although LINE is used as an example to introduce the method of determining the location feature vector, those skilled in the art will appreciate that the present disclosure should not be limited thereto. In fact, the user can flexibly set the method of determining the location feature vector according to the actual application scenario.

[0059] Step S103: Determine the task target vector and conditional observation vector of the corresponding task type according to the target mask and the location feature vector, and use the diffusion model to add noise to the task target vector to obtain the noisy task target vector.

[0060] In a possible implementation, determining the task target vector and the conditional observation vector of the corresponding task type according to the target mask and the location feature vector in step S103 may include: performing element-by-element multiplication operation according to the target mask and the location feature vector to obtain the conditional observation vector, for example, co =e all ⊙m calculates the conditional observation vector e co , where e all represents the location feature vector, ⊙ represents the element-wise product, and m represents the target mask. The target vector is determined based on the target mask, and the task target vector is obtained by performing element-by-element multiplication on the target vector and the location feature vector. For example, 0 ta =e all ⊙(1-m) calculates the task target vector e 0 ta , where e all represents the location feature vector, (1-m) represents the target vector, ⊙ represents the element-wise product, and m represents the target mask.

[0061] like Figure 3 As shown, based on multiple mask strategies, the target mask of the corresponding trajectory processing task can be obtained, wherein the portion obscured in the target mask is the portion that is expected to be determined by the trajectory processing task, and the conditional observation vector can be determined based on the location feature vector and the target mask corresponding to the current trajectory. The relationship between the conditional observation vector and the portion that is expected to be determined by the trajectory processing task can be understood as follows: the portion that is expected to be determined is the target result of the trajectory processing task determined under the condition of meeting the observation condition vector. In this way, by designing a mask condition module for determining the location feature vector, the target mask, the task target vector, and the conditional observation vector, part of the trajectory is masked into the task target vector of various tasks, and multiple mask strategies are used to unify multiple tasks in a common framework, a single common model can be used to solve multiple mobile modeling tasks, namely, trajectory prediction tasks and trajectory completion tasks.

[0062] After determining the task target vector and conditional observation vector, the noise predictor based on the diffusion model, Transformer, and MLP can be used to add noise to the task target vector, which is the diffusion process. Figure 3 As shown, the diffusion process may include determining a noisy task target vector based on the task target vector and the noise during the diffusion step number. The diffusion process may be implemented based on a diffusion model, which is specifically determined according to the actual structure of the diffusion model, and the embodiments of the present disclosure do not limit this.

[0063] Step S104: extract the features of the target user's mobility pattern from the historical trajectory to obtain a pattern feature vector corresponding to the target user in the historical time period.

[0064] For example, the method of obtaining the location feature vector corresponding to the target user in the current time period in step S102 (i.e., using the LINE model) can be used to obtain the historical location feature vector h corresponding to the target user in the historical time period. u , then Figure 3 As shown, the target user’s historical location feature vector h is transformed into u Mapped to user representation p u That is, the pattern feature vector, the mapping process can be It indicates that, represents the parameters of the LSTM network, Indicates that a parameter is The LSTM network is used to input the historical location feature vector h u Processing is performed to obtain the pattern feature vector p u The pattern feature vector determined by the user characterization module is introduced into the noise predictor to assist the trajectory processing process.

[0065] It should be noted that although the method of determining the pattern feature vector by the user characterization module is introduced by taking LSTM as an example, those skilled in the art will appreciate that the present disclosure should not be limited thereto. In fact, the user can flexibly set the method of determining the pattern feature vector according to the actual application scenario.

[0066] Step S105: Process the noisy task target vector, conditional observation vector, target mask, and pattern feature vector based on the diffusion model to obtain the target result of the corresponding trajectory processing task.

[0067] In a possible implementation, step S105 may include: processing the noisy task target vector, the conditional observation vector, and the encoding result of the time step used in the diffusion model calculation based on the diffusion model to obtain a spatiotemporal feature vector. For example, in the denoising process of the diffusion model, the Transformer model may be combined to capture the spatiotemporal dependency of the trajectory, such as Figure 3 As shown in , the task target vector, conditional observation vector, and position encoding result of the time step or diffusion step after adding noise can be used as the input of the transformer model. After processing, the spatiotemporal feature vector that can reflect the spatiotemporal characteristics of the trajectory is obtained; the spatiotemporal feature vector, target mask, and pattern feature vector are processed based on the diffusion model to obtain the target result of the corresponding trajectory processing task. For example, in the denoising process of the diffusion model, as shown in Figure 3 As shown, the predicted noise corresponding to each time step can be determined in combination with the multi-layer perceptron model, so that in each time step of the denoising process, denoising processing can be performed based on the predicted noise until the final target result corresponding to the trajectory processing task is obtained.

[0068] For example, in the process of noise prediction, Transformer is used to capture the spatiotemporal dependencies of the trajectory. Specifically, each time step in the denoising process uses the noise prediction vector of the previous time step , diffusion steps t with position encoding, conditional observation vector e co , target mask m and pattern feature vector p u To achieve conditional denoising. For the diffusion step number t, position encoding can be used to obtain a 128-dimensional representation, the specific form of which is not limited, and the conditional observation vector e is used co and target mask m as additional inputs to the noise predictor, and then introduce the pattern feature vector p from the user representation module based on historical trajectories u , so that the noise prediction vector , diffusion step number t, conditional observation vector e co , target mask m and pattern feature vector p u is the input of the noise predictor, and after processing, the output is the predicted noise , that is, the noise to be subtracted at each time step in the denoising process until the final target result. In which, similarly to the diffusion process, the denoising process can be determined according to the actual structure of the diffusion model, and the embodiments of the present disclosure do not limit this.

[0069] In the case where the trajectory processing task is a trajectory prediction task, the target result may represent the predicted trajectory. In the case where the trajectory processing task is a trajectory completion task, the target result may represent the missing part of the trajectory. In this way, through the above steps S101 to S105, the trajectory prediction or trajectory completion task can be efficiently processed and an accurate task result can be generated.

[0070] The disclosed embodiment also provides a trajectory processing method based on a diffusion model, which obtains a trajectory processing task for a target user, determines the task type and the historical trajectory of the target user in a historical time period required to execute the trajectory processing task according to the trajectory processing task, wherein the task type is trajectory generation, and the historical trajectory includes the movement trajectory of the target user in the city; determines a target mask corresponding to the task type based on a preset mask rule, wherein the mask rule is determined based on multiple mask strategies; determines a task target vector corresponding to the task type according to the target mask, adds noise to the task target vector using a diffusion model, and obtains a noisy task target vector; extracts features of the target user's mobile mode from the historical trajectory, and obtains a pattern feature vector corresponding to the target user in the historical time period; processes the noisy task target vector, the target mask, and the pattern feature vector based on the diffusion model to obtain a target result of the corresponding trajectory processing task, so that the trajectory generation task can be efficiently processed using a general model formed based on the diffusion model and accurate task results can be generated.

[0071] like Figure 4 As shown, the trajectory processing method for trajectory generation may include the following steps S501 to S505.

[0072] Step S501: Acquire a trajectory processing task for a target user, and determine the task type and the historical trajectory of the target user in a historical time period required to execute the trajectory processing task according to the trajectory processing task.

[0073] The trajectory processing task is a trajectory generation task, and correspondingly, the task type of the trajectory processing task is trajectory generation. Unlike the trajectory prediction task and the trajectory completion task, the trajectory required to perform the trajectory generation task only includes the historical trajectory. The historical trajectory may include the movement trajectory of the target user in the city, and may also include the movement trajectory outside the city. The city division boundary here is determined according to the actual situation. The historical time period used when processing the trajectory generation task can be flexibly set, and the embodiments of the present disclosure do not limit this.

[0074] Step S502: Determine a target mask corresponding to the task type based on a preset mask rule.

[0075] The masking rules are determined based on multiple masking strategies. The masking rules used in processing the trajectory generation task are the same as those used in processing the trajectory prediction task and the trajectory completion task. For details, please refer to the previous article and will not be repeated here.

[0076] Step S503: determine a task target vector corresponding to the task type according to the target mask, and add noise to the task target vector using a diffusion model to obtain a noisy task target vector.

[0077] The method of determining the task target vector in step S503 is similar to the method of determining the task target vector in step S103 . Please refer to the above text for details, which will not be repeated here.

[0078] After determining the task target vector corresponding to the trajectory generation, a noise predictor based on the diffusion model, Transformer, and MLP can be used to add noise to the task target vector, that is, the diffusion process. The diffusion process used for trajectory generation can be determined according to the actual structure of the diffusion model, and the embodiments of the present disclosure are not limited to this.

[0079] Step S504: extract the features of the target user's mobility pattern from the historical trajectory to obtain a pattern feature vector corresponding to the target user in the historical time period.

[0080] Step S504 is similar to step S104, please refer to the above text for details, which will not be repeated here.

[0081] Step S505: Process the noisy task target vector, target mask, and pattern feature vector based on the diffusion model to obtain the target result of the corresponding trajectory processing task.

[0082] In a possible implementation, step S505 may include: processing the noisy task target vector and the encoding result of the time step used in the calculation of the diffusion model based on the diffusion model to obtain a spatiotemporal feature vector. For example, in the denoising process of the diffusion model, the noisy task target vector and the position encoding result of the time step or diffusion step number may be used as the input of the Transformer model based on the Transformer model and processed by the Transformer model to obtain a spatiotemporal feature vector that can reflect the spatiotemporal characteristics of the trajectory; processing the spatiotemporal feature vector, the target mask, and the pattern feature vector based on the diffusion model to obtain the target result of the corresponding trajectory processing task. For example, in the denoising process of the diffusion model, the predicted noise corresponding to each time step may be determined in combination with the MLP model, so that in each time step of the denoising process, denoising processing may be performed based on the predicted noise until the final target result corresponding to the trajectory processing task is obtained. The denoising process corresponding to trajectory generation is different from the denoising process corresponding to trajectory prediction / completion in that there is no participation of the conditional observation vector. The remaining processing can be similar to the denoising process in the previous text, and will not be repeated here.

[0083] In the case where the trajectory processing task is a trajectory generation task, the target result may represent the generated trajectory of a certain time period. In this way, through the above steps S501 to S505, the trajectory generation task can be efficiently processed and accurate task results can be generated. Therefore, the trajectory processing method provided by the embodiment of the present disclosure can solve a variety of mobile modeling tasks, namely, trajectory prediction tasks, trajectory completion tasks, and trajectory generation tasks, using a single general model.

[0084] The trajectory processing method provided by the embodiment of the present disclosure also includes a diffusion model training process. In one possible implementation, the training process may include: constructing a sample set based on the historical trajectories of multiple users in a preset time period, wherein the historical trajectory includes the trajectory of the corresponding user in the city, and multiple users can choose whether to include the target user according to actual conditions, and the LINE model mentioned above can be used to determine the location feature vectors for multiple users for training the model; determining multiple sample masks representing trajectory prediction, trajectory completion, and trajectory generation from multiple preset mask strategies, wherein the multiple mask strategies include a terminal mask strategy for trajectory prediction, a random mask strategy for trajectory completion, a full mask strategy for trajectory generation, At least one of the sequential masking strategy for simulating the user's continuous movement pattern and the complete masking strategy for capturing the user's diurnal activity pattern is used. The masking rule is obtained by mixing these five masking strategies. In other words, a mask distribution is constructed based on the five masking strategies and their respective proportions, and a specific mask is obtained by sampling from the mask distribution. In this way, the input forms of the trajectory prediction task and the trajectory completion task are unified into the location feature vector and mask of the corresponding sample set, and the input form of the trajectory generation task is unified into the mask of the corresponding sample set; the preset unconditional diffusion model and the conditional diffusion model are trained based on the sample set and multiple sample masks to obtain a diffusion model.

[0085] For example, during the training process, different masks can be extracted from the constructed mask distribution, and these masks can be used to obtain different conditional observation vectors as conditions for the conditional diffusion model. Then, the model is trained using the classifier-free bootstrapping. Specifically, an unconditional diffusion model and a conditional diffusion model can be trained simultaneously, and a neural network can be used to parameterize the two models. For the unconditional model, an empty label is used in the noise prediction process. As user representation. By randomly setting the user representation to an unconditional class identifier with a certain probability to jointly train the unconditional and conditional models, where the unconditional class identifier can be considered as a hyperparameter. A simplified loss function can be used Training model, where A measure of the difference between the actual noise and the predicted noise, represents the actual noise, represents the prediction noise, represents the noise prediction vector, t represents the number of diffusion steps, e co represents the conditional observation vector, p u The representation pattern feature vector is the user representation.

[0086] After training, for the test process of the diffusion model, the following linear combination of conditional and unconditional models can be used for sampling, which can be expressed as , where A vector that represents all conditional information as 0, essentially encoding no information, is the weight, and the other parameters are described in the previous text and will not be repeated here. = 0, the model is conditioned on the user representation p u The related conditional diffusion model. By adding , the model will be more inclined to the unconditional diffusion model and make a trade-off between sample quality and diversity. =1, the model is an unconditional diffusion model.

[0087] By comparing with the existing methods, the advancement and effectiveness of the trajectory processing method are obtained. For the trajectory data used in the experiment, users with less than 10 records per day are filtered out, and the time interval is set to 30 minutes, that is, the trajectory is converted into an equally spaced trajectory. Then, the location is preprocessed, and the GPS points are mapped to a predefined grid with a granularity of 1km×1km. Evaluation is performed using evaluation indicators that take into account temporal and spatial statistical characteristics, such as turning radius, dwell time, recall rate, accuracy, etc. Table 1 shows the model evaluation results of the trajectory generation task, Table 2 shows the model evaluation results of the trajectory completion task, and Table 3 shows the model evaluation results of the trajectory prediction task. According to Tables 1 to 3, the general model proposed in the embodiments of the present disclosure has achieved superior performance.

[0088] Table 1 Model evaluation results for trajectory generation tasks

[0089]

[0090] Table 2 Model evaluation results for trajectory completion tasks

[0091]

[0092] Table 3 Model evaluation results of trajectory prediction task

[0093]

[0094] The trajectory processing method provided by the embodiment of the present disclosure uses a general model of human mobility modeling based on a diffusion model to perform diffusion and denoising on the trajectory representation. The trained model can complete different trajectory-related tasks, such as trajectory generation, trajectory prediction and trajectory completion. First, the mask condition module unifies the formats of different tasks to unify multiple tasks in a general framework using a masking strategy, thereby achieving task generality. Specifically, the trajectory processing method masks different trajectory parts as task targets of various tasks through a variety of masking strategies, so that a single model can solve the mobile modeling tasks or trajectory processing tasks such as trajectory generation, prediction and completion. In addition, in order to achieve user generalization of the general system, a user representation module is also designed to capture the personalized information of the user, that is, the mobility pattern, from the historical trajectory, thereby achieving user generalization, so that users with similar mobility patterns have similar user representations, and the obtained user representations will then be introduced into the noise predictor, so that when the current trajectory of a certain user is input, the user representation of the mobility pattern similar to it can be used to assist the trajectory modeling process, thereby generalizing to new users that have not been seen before. Finally, the output of the mask condition module and the output of the history-based user representation module serve as conditions to support the noise predictor. The proposed trajectory processing method models the spatiotemporal distribution of trajectories associated with the execution process of the noise predictor as a denoising process and a diffusion process, e.g. Figure 5 As shown, during the diffusion process, noise is gradually added to the trajectory until it is completely transformed into random noise. During the denoising process, the mask condition module and the history-based user representation module are used as conditions to guide the denoising process and gradually restore the trajectory from the noise.

[0095] The disclosed embodiment also provides a trajectory processing device based on a diffusion model. Figure 6 FIG. 2 is a block diagram of a trajectory processing device based on a diffusion model according to an embodiment of the present disclosure. Figure 6 As shown, the trajectory processing device 100 may include the following first acquisition module 101 , first determination module 102 , first noise adding module 103 , first extraction module 104 , and first processing module 105 .

[0096] The first acquisition module 101 is used to acquire a trajectory processing task for a target user, and determine a task type and a current trajectory of the target user in a current time period and a historical trajectory of the target user in a historical time period required to execute the trajectory processing task according to the trajectory processing task, wherein the task type is trajectory prediction or trajectory completion, and both the current trajectory and the historical trajectory include the movement trajectory of the target user in the city.

[0097] The first determination module 102 is used to determine a target mask corresponding to the task type based on a preset mask rule, and extract location features of the current trajectory to obtain a location feature vector corresponding to the target user in the current time period, wherein the mask rule is determined based on multiple mask strategies.

[0098] The first noise adding module 103 is used to determine the task target vector and the conditional observation vector corresponding to the task type according to the target mask and the location feature vector, and add noise to the task target vector using a diffusion model to obtain a noisy task target vector.

[0099] The first extraction module 104 is used to extract features of the target user's mobility pattern from the historical trajectory to obtain a pattern feature vector corresponding to the target user in the historical time period.

[0100] The first processing module 105 is used to process the noisy task target vector, the conditional observation vector, the target mask, and the pattern feature vector based on the diffusion model to obtain a target result corresponding to the trajectory processing task.

[0101] In a possible implementation, the noisy task target vector, the conditional observation vector, the target mask, and the pattern feature vector are processed based on the diffusion model to obtain a target result corresponding to the trajectory processing task, including: processing the noisy task target vector, the conditional observation vector, and the encoding result of the time step used in the diffusion model calculation based on the diffusion model to obtain a spatiotemporal feature vector; processing the spatiotemporal feature vector, the target mask, and the pattern feature vector based on the diffusion model to obtain a target result corresponding to the trajectory processing task.

[0102] In one possible implementation, a task target vector and a conditional observation vector corresponding to the task type are determined based on the target mask and the location feature vector, including: performing element-by-element multiplication operations on the target mask and the location feature vector to obtain the conditional observation vector; determining a target vector based on the target mask, and performing element-by-element multiplication operations on the target vector and the location feature vector to obtain the task target vector.

[0103] In a possible implementation, the multiple mask strategies include a terminal mask strategy for trajectory prediction, a random mask strategy for trajectory completion, and a complete mask strategy for trajectory generation; determining a target mask corresponding to the task type based on a preset mask rule, including: constructing the mask rule based on the terminal mask strategy, the random mask strategy, and the complete mask strategy; determining a target mask corresponding to the task type based on the trajectory processing task and the mask rule.

[0104] In a possible implementation, the multiple masking strategies also include a sequence masking strategy for simulating a user's continuous movement pattern and a circadian rhythm masking strategy for capturing the user's day and night activity patterns; the masking rules are constructed based on the terminal masking strategy, the random masking strategy, and the complete masking strategy, including: assigning a corresponding ratio to each of the masking strategies, and constructing the masking rules based on each of the masking strategies and the corresponding ratios of each of the masking strategies.

[0105] In a possible implementation, the device also includes a first training module, which is used to execute a training process of the diffusion model, and the training process includes: constructing a sample set based on historical trajectories of multiple users in a preset time period, wherein the historical trajectories include the trajectories of the corresponding users in the city; determining multiple sample masks representing trajectory prediction, trajectory completion, and trajectory generation from multiple preset mask strategies, wherein the multiple mask strategies include at least one of a terminal mask strategy for trajectory prediction, a random mask strategy for trajectory completion, a complete mask strategy for trajectory generation, a sequence mask strategy for simulating a user's continuous movement mode, and a complete mask strategy for capturing the user's diurnal activity pattern; based on the sample set and the multiple sample masks, training a preset unconditional diffusion model and a conditional diffusion model to obtain the diffusion model.

[0106] In some embodiments, the functions or modules included in the trajectory processing device provided in the embodiments of the present disclosure can be used to execute the method described in the above method embodiment. The specific implementation can refer to the description of the above trajectory processing method embodiment, and for the sake of brevity, it will not be repeated here.

[0107] The disclosed embodiment also provides a trajectory processing device based on a diffusion model. Figure 7 FIG. 2 is a block diagram of a trajectory processing device based on a diffusion model according to an embodiment of the present disclosure. Figure 7 As shown, the trajectory processing device 500 may include the following second acquisition module 501 , second determination module 502 , second noise adding module 503 , second extraction module 504 , and second processing module 505 .

[0108] The second acquisition module 501 is used to acquire a trajectory processing task for a target user, and determine a task type and a historical trajectory of the target user in a historical time period required to execute the trajectory processing task according to the trajectory processing task, wherein the task type is trajectory generation, and the historical trajectory includes the movement trajectory of the target user in the city.

[0109] The second determination module 502 is configured to determine a target mask corresponding to the task type based on a preset mask rule, wherein the mask rule is determined based on a plurality of mask strategies.

[0110] The second noise adding module 503 is used to determine the task target vector corresponding to the task type according to the target mask, and add noise to the task target vector using a diffusion model to obtain a noisy task target vector.

[0111] The second extraction module 504 is used to extract the features of the target user's movement pattern from the historical trajectory to obtain a pattern feature vector corresponding to the target user in the historical time period.

[0112] The second processing module 505 is used to process the noisy task target vector, the target mask, and the pattern feature vector based on the diffusion model to obtain a target result corresponding to the trajectory processing task.

[0113] In a possible implementation, the noisy task target vector, the target mask, and the pattern feature vector are processed based on the diffusion model to obtain a target result corresponding to the trajectory processing task, including: processing the noisy task target vector and the encoding result of the time step used in the calculation of the diffusion model based on the diffusion model to obtain a spatiotemporal feature vector; processing the spatiotemporal feature vector, the target mask, and the pattern feature vector based on the diffusion model to obtain a target result corresponding to the trajectory processing task.

[0114] In a possible implementation, the multiple mask strategies include a terminal mask strategy for trajectory prediction, a random mask strategy for trajectory completion, and a complete mask strategy for trajectory generation; determining a target mask corresponding to the task type based on a preset mask rule, including: constructing the mask rule based on the terminal mask strategy, the random mask strategy, and the complete mask strategy; determining a target mask corresponding to the task type based on the trajectory processing task and the mask rule.

[0115] In a possible implementation, the multiple masking strategies also include a sequence masking strategy for simulating a user's continuous movement pattern and a circadian rhythm masking strategy for capturing the user's day and night activity patterns; the masking rules are constructed based on the terminal masking strategy, the random masking strategy, and the complete masking strategy, including: assigning a corresponding ratio to each of the masking strategies, and constructing the masking rules based on each of the masking strategies and the corresponding ratios of each of the masking strategies.

[0116] In a possible implementation, the device also includes a second training module, which is used to execute a training process of the diffusion model, and the training process includes: constructing a sample set based on historical trajectories of multiple users in a preset time period, wherein the historical trajectories include the trajectories of the corresponding users in the city; determining multiple sample masks representing trajectory prediction, trajectory completion, and trajectory generation from multiple preset mask strategies, wherein the multiple mask strategies include at least one of a terminal mask strategy for trajectory prediction, a random mask strategy for trajectory completion, a complete mask strategy for trajectory generation, a sequence mask strategy for simulating a user's continuous movement mode, and a complete mask strategy for capturing the user's diurnal activity pattern; based on the sample set and the multiple sample masks, training a preset unconditional diffusion model and a conditional diffusion model to obtain the diffusion model.

[0117] In some embodiments, the functions or modules included in the trajectory processing device provided in the embodiments of the present disclosure can be used to execute the method described in the above method embodiment. The specific implementation can refer to the description of the above trajectory processing method embodiment, and for the sake of brevity, it will not be repeated here.

[0118] The embodiment of the present disclosure also provides a computer-readable storage medium on which computer program instructions are stored, and the computer program instructions implement the above method when executed by a processor. The computer-readable storage medium can be a volatile or non-volatile computer-readable storage medium.

[0119] An embodiment of the present disclosure further proposes an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to implement the above method when executing the instructions stored in the memory.

[0120] The embodiments of the present disclosure also provide a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above method.

[0121] Figure 81900 is a block diagram of a trajectory processing device based on a diffusion model according to an embodiment of the present disclosure. For example, the device 1900 may be provided as a server or a terminal device. Figure 8 , the apparatus 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions, such as an application, that can be executed by the processing component 1922. The application stored in the memory 1932 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above method.

[0122] The device 1900 may also include a power supply component 1926 configured to perform power management of the device 1900, a wired or wireless network interface 1950 configured to connect the device 1900 to a network, and an input / output interface 1958 (I / O interface). The device 1900 may operate based on an operating system stored in the memory 1932, such as Windows Server 2000. TM , MacOS X TM , Unix TM , Linux TM , FreeBSD TM or similar.

[0123] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 1932 including computer program instructions, which can be executed by the processing component 1922 of the device 1900 to perform the above method.

[0124] The present disclosure may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.

[0125] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the above. More specific examples (a non-exhaustive list) of computer-readable storage media include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the above. The computer-readable storage medium used herein is not to be interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.

[0126] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0127] The computer program instructions for performing the operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect through the Internet). In some embodiments, by using the state information of the computer-readable program instructions to personalize an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), the electronic circuit may execute the computer-readable program instructions, thereby implementing various aspects of the present disclosure.

[0128] Various aspects of the present disclosure are described herein with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of boxes in the flowchart and / or block diagram can be implemented by computer-readable program instructions.

[0129] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0130] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0131] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.

[0132] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A trajectory processing method based on a diffusion model, characterized in that: include: Acquire a trajectory processing task for a target user, and determine, according to the trajectory processing task, a task type and a current trajectory of the target user in a current time period and a historical trajectory of the target user in a historical time period required for executing the trajectory processing task, wherein the task type is trajectory prediction or trajectory completion, and both the current trajectory and the historical trajectory include the movement trajectory of the target user in the city; Determine a target mask corresponding to the task type based on a preset mask rule, and extract location features of the current trajectory to obtain a location feature vector corresponding to the target user in the current time period, wherein the mask rule is determined based on multiple mask strategies; Determine a task target vector and a conditional observation vector corresponding to the task type according to the target mask and the location feature vector, and add noise to the task target vector using a diffusion model to obtain a noisy task target vector; Extracting features of the target user's mobility pattern from the historical trajectory to obtain a pattern feature vector corresponding to the target user in the historical time period; The noisy task target vector, the conditional observation vector, the target mask, and the pattern feature vector are processed based on the diffusion model to obtain a target result corresponding to the trajectory processing task.

2. The method according to claim 1, characterized in that The noisy task target vector, the conditional observation vector, the target mask, and the pattern feature vector are processed based on the diffusion model to obtain a target result corresponding to the trajectory processing task, including: Based on the diffusion model, the noisy task target vector, the conditional observation vector, and the encoding result of the time step used in the diffusion model calculation are processed to obtain a spatiotemporal feature vector; The spatiotemporal feature vector, the target mask, and the pattern feature vector are processed based on the diffusion model to obtain a target result corresponding to the trajectory processing task.

3. The method according to claim 1, characterized in that Determining a task target vector and a conditional observation vector corresponding to the task type according to the target mask and the location feature vector includes: Performing an element-by-element multiplication operation on the target mask and the location feature vector to obtain the conditional observation vector; A target vector is determined based on the target mask, and an element-by-element multiplication operation is performed on the target vector and the location feature vector to obtain the task target vector.

4. A trajectory processing method based on a diffusion model, characterized in that: include: Acquire a trajectory processing task for a target user, and determine, according to the trajectory processing task, a task type and a historical trajectory of the target user in a historical time period required to execute the trajectory processing task, wherein the task type is trajectory generation, and the historical trajectory includes the movement trajectory of the target user in the city; Determining a target mask corresponding to the task type based on a preset mask rule, wherein the mask rule is determined based on a plurality of mask strategies; Determine a task target vector corresponding to the task type according to the target mask, and add noise to the task target vector using a diffusion model to obtain a noisy task target vector; Extracting features of the target user's mobility pattern from the historical trajectory to obtain a pattern feature vector corresponding to the target user in the historical time period; The noisy task target vector, the target mask, and the pattern feature vector are processed based on the diffusion model to obtain a target result corresponding to the trajectory processing task.

5. The method according to claim 4, characterized in that The noisy task target vector, the target mask, and the pattern feature vector are processed based on the diffusion model to obtain a target result corresponding to the trajectory processing task, including: Based on the diffusion model, the noisy task target vector and the encoding result of the time step used in the diffusion model calculation are processed to obtain a spatiotemporal feature vector; The spatiotemporal feature vector, the target mask, and the pattern feature vector are processed based on the diffusion model to obtain a target result corresponding to the trajectory processing task.

6. The method according to claim 4 or 5, characterized in that: The multiple masking strategies include a terminal masking strategy for trajectory prediction, a random masking strategy for trajectory completion, and a complete masking strategy for trajectory generation; Determining a target mask corresponding to the task type based on a preset mask rule includes: Constructing the masking rule based on the terminal masking strategy, the random masking strategy, and the complete masking strategy; A target mask corresponding to the task type is determined based on the trajectory processing task and the mask rule.

7. The method according to claim 6, characterized in that The multiple masking strategies also include a sequence masking strategy for simulating a user's continuous movement pattern and a circadian rhythm masking strategy for capturing the user's daily activity pattern; The masking rule is constructed based on the terminal masking strategy, the random masking strategy, and the complete masking strategy, including: A corresponding ratio is allocated to each of the mask strategies, and the mask rule is constructed based on each of the mask strategies and the ratio corresponding to each of the mask strategies.

8. The method according to claim 4 or 5, characterized in that: The method also includes a training process of the diffusion model, the training process comprising: Constructing a sample set according to the historical trajectories of multiple users in a preset time period, wherein the historical trajectories include the trajectories of the corresponding users in the city; Determine a plurality of sample masks representing trajectory prediction, trajectory completion, and trajectory generation from a plurality of preset mask strategies, wherein the plurality of mask strategies include at least one of a terminal mask strategy for trajectory prediction, a random mask strategy for trajectory completion, a complete mask strategy for trajectory generation, a sequence mask strategy for simulating a user's continuous movement mode, and a complete mask strategy for capturing a user's diurnal activity pattern; The preset unconditional diffusion model and the conditional diffusion model are trained based on the sample set and the multiple sample masks to obtain the diffusion model.

9. A trajectory processing device based on a diffusion model, characterized in that: include: A first acquisition module is used to acquire a trajectory processing task for a target user, and determine a task type and a current trajectory of the target user in a current time period and a historical trajectory of the target user in a historical time period required to execute the trajectory processing task according to the trajectory processing task, wherein the task type is trajectory prediction or trajectory completion, and both the current trajectory and the historical trajectory include the movement trajectory of the target user in the city; A first determination module is used to determine a target mask corresponding to the task type based on a preset mask rule, and extract location features of the current trajectory to obtain a location feature vector corresponding to the target user in the current time period, wherein the mask rule is determined based on multiple mask strategies; A first noise adding module is used to determine a task target vector and a conditional observation vector corresponding to the task type according to the target mask and the location feature vector, and to add noise to the task target vector using a diffusion model to obtain a noisy task target vector; A first extraction module is used to extract features of the target user's mobility pattern from the historical trajectory to obtain a pattern feature vector corresponding to the target user in the historical time period; The first processing module is used to process the noisy task target vector, the conditional observation vector, the target mask, and the pattern feature vector based on the diffusion model to obtain a target result corresponding to the trajectory processing task.

10. A trajectory processing device based on a diffusion model, characterized in that: include: A second acquisition module is used to acquire a trajectory processing task for a target user, and determine a task type and a historical trajectory of the target user in a historical time period required to execute the trajectory processing task according to the trajectory processing task, wherein the task type is trajectory generation, and the historical trajectory includes a movement trajectory of the target user in a city; A second determination module, configured to determine a target mask corresponding to the task type based on a preset mask rule, wherein the mask rule is determined based on a plurality of mask strategies; A second noise adding module is used to determine a task target vector corresponding to the task type according to the target mask, and add noise to the task target vector using a diffusion model to obtain a noisy task target vector; A second extraction module is used to extract features of the target user's mobility pattern from the historical trajectory to obtain a pattern feature vector corresponding to the target user in the historical time period; The second processing module is used to process the noisy task target vector, the target mask, and the pattern feature vector based on the diffusion model to obtain a target result corresponding to the trajectory processing task.

Citation Information

Patent Citations

  • Group trajectory prediction method for large scene

    CN117634723A

  • Infrared target tracking method based on diffusion model joint association mechanism

    CN117671522A

  • Human body moving track recovery method and device

    CN117992916A

  • Methods for the automated driving of a vehicle, as well as methods for generating a machine learning model capable of this, and processor circuitry and vehicle.

    DE102022131178B3

  • Trajectory prediction using diffusion models

    US20240157979A1

Cited By

  • Trajectory generation method based on diffusion model

    CN120123770A