A spatio-temporal trajectory clustering method based on federated learning

By combining federated learning and differential privacy technology, efficient and secure clustering of trajectory data is achieved, solving the bandwidth consumption and privacy issues in federated learning of trajectory data. It is suitable for anomaly trajectory investigation and commercial trajectory analysis.

CN117056755BActive Publication Date: 2026-07-03UNIV OF ELECTRONICS SCI & TECH OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311052471.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-21
Publication Date
2026-07-03
Estimated Expiration
2043-08-21

Smart Images

  • Figure CN117056755B_ABST
    Figure CN117056755B_ABST
Patent Text Reader

Abstract

This invention relates to the field of big data mining technology, and discloses a spatiotemporal trajectory clustering method based on federated learning, which saves communication bandwidth and improves the privacy of data processing. In this invention, the client first samples trajectory points from the preprocessed trajectory; then, the trajectory is segmented based on these points, and spline functions are used to fit each segment. Finally, the start and end position information, start and end time sequence information, and parameter information of the corresponding spline function for each trajectory segment are encoded and sent to the server according to their respective trajectories and segments. During server processing, the decoded spline functions with the same trajectory number are concatenated according to time sequence and position to obtain the reconstructed trajectory. Then, cluster analysis is performed on the reconstructed trajectories to identify normal and abnormal trajectories.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of big data mining technology, specifically to a spatiotemporal trajectory clustering method based on federated learning. Background Technology

[0002] In recent years, with the development of big data technology and the advancement of computer technology, machine learning has received increasing attention and has played an important role in many areas such as recommendation algorithms, autonomous driving, and human-computer interaction. However, due to the growth of the machine learning and big data industries, as well as the complexity of real-world environments, a situation has arisen where the total amount of data is enormous, the amount of usable data is limited, and the data quality is poor. Furthermore, due to security concerns, data exchange and sharing are restricted, affecting the research and application of big data and machine learning technologies. This phenomenon is known as "data silos."

[0003] In 2016, Google took a different approach, proposing the concept of Federated Learning (FL). Simply put, Federated Learning requires that the datasets involved in the learning process remain stationary, while model training is performed independently on the client that owns the dataset. A trusted virtual center then collects the trained models from the clients, aggregates them, and sends them back to the clients for further training, repeating this process until a usable global model is generated. This method of moving computation to the data greatly avoids the security risks that might arise from data movement. It indirectly addresses the "data silo" problem in big data and machine learning, attracting increasing research and attention. However, in real-world scenarios, federated learning of data such as trajectories has limitations; bandwidth consumption and privacy issues hinder this type of processing. Summary of the Invention

[0004] The technical problem to be solved by this invention is to propose a spatiotemporal trajectory clustering method based on federated learning, which saves communication bandwidth and improves the privacy of data processing.

[0005] The technical solution adopted by the present invention to solve the above-mentioned technical problems is as follows:

[0006] A spatiotemporal trajectory clustering method based on federated learning is applied to a distributed system employing a federated learning architecture, wherein the distributed system includes a server and multiple clients. The method includes:

[0007] A. Client-side processing:

[0008] A1. Iterate through and sample the local trajectory of the client to obtain a set of trajectories with the same starting point and ending point;

[0009] A2. For each trajectory obtained by sampling in step A1, take points at equal intervals according to a preset interval to obtain its trajectory point sequence in the trajectory space.

[0010] A3. For each trajectory obtained by sampling in step A1, and based on the trajectory point sequence of each trajectory obtained in step A2, use spline functions to perform piecewise fitting;

[0011] A4. For each trajectory obtained by sampling in step A1, according to the segmentation in step A3, the start and end position information, start and end timing information, and parameter information of the corresponding spline function of each trajectory segment are encoded according to the trajectory and trajectory segment to which they belong, and sent to the server.

[0012] B. Server processing procedure:

[0013] B1. The server decodes the received information, restores the corresponding trajectory segments of spline functions belonging to the same trajectory according to the parameters of the spline functions, and sequentially splices them according to the start and end position information and start and end time sequence information of the corresponding trajectory segments to obtain the restored trajectory of the corresponding trajectory.

[0014] B2. Perform cluster analysis on the restored trajectory obtained in step B1.

[0015] Furthermore, step A2 also includes:

[0016] Based on the client's preset differential privacy budget ε and the number of trajectory points on each trajectory, a trajectory differential privacy parameter ε is assigned to each trajectory in proportion to the number of trajectory points. k ; where k is the sequence number of the trajectory;

[0017] Then, for each trajectory, the following noise reduction process is performed:

[0018] The trajectory space is initially divided into grids to determine if each grid contains at most one trajectory point. For grids that do not meet the condition, a second grid is created to ensure that each grid contains at most one trajectory point.

[0019] Based on the grid corresponding to each trajectory point, a differential privacy budget is allocated to each trajectory point. It is inversely proportional to the side length of the grid it belongs to; where i is the index of the trajectory point;

[0020] For each trajectory point on that trajectory, based on its differential privacy budget Perform differential noise addition.

[0021] Further, in step A2, the trajectory space of the trajectory is initially divided into grids to determine whether each grid contains at most one trajectory point; for grids that do not meet the condition, a second grid division is performed to ensure that each grid contains at most one trajectory point, specifically including:

[0022] A21. Based on the set value N, the entire trajectory space is divided into an N×N uniform grid, with each grid having a grid level of N×N. And obtain the grid set;

[0023] A22. Each grid in the computational grid set Grid count

[0024]

[0025] Among them, D k This represents the k-th trajectory. This represents the i-th trajectory point on the k-th trajectory. This represents the nth grid obtained by dividing the trajectory space corresponding to the kth trajectory into grids. This indicates that the k-th trajectory is located in the grid. The number of trajectory points within the range, |D k | represents the total number of trajectory points for the k-th trajectory;

[0026] A23. Traverse the grid set and count the grid of each grid, determining whether it meets the judgment condition, wherein the judgment condition is: the grid count of the grid is 0 or 1 / |D k |; and for meshes that do not meet the judgment conditions, execute step A24;

[0027] A24. Calculate the secondary meshing parameter M of the corresponding mesh using the following formula:

[0028]

[0029] Where β is a predefined mesh constant. This represents the grid count of the grid before the secondary partitioning. It is the floor function;

[0030] Based on the secondary partitioning parameter M, the corresponding grid is divided into M×M uniform subgrids, and the grid set is updated according to the grids obtained from the secondary partitioning; the grid level of the subgrids is set to...

[0031] A25. Repeat steps A23-A24 until the traversal is complete.

[0032] Furthermore, in step A21, N is set to len(D)k ) / R, where R is the interval length for trajectory point sampling in step A2, len(D k ) represents the length of the k-th trajectory.

[0033] Furthermore, in step A24, β is 80 / ε k , ε k This is the privacy budget for the k-th trajectory.

[0034] Furthermore, in step A2, based on the grid corresponding to each trajectory point, a differential privacy budget is allocated to each trajectory point according to the following formula: the differential privacy budget for each trajectory point... It is inversely proportional to the side length of the grid it belongs to:

[0035]

[0036] in, This represents the differential privacy parameter of the i-th trajectory point on the k-th trajectory; and Let |D| represent the grid levels of the i-th and s-th trajectory points on the k-th trajectory, respectively, with the grid level inversely proportional to the side length of the grid; k | represents the number of all trajectory points on the k-th trajectory.

[0037] Furthermore, in step A2, for each trajectory point on the trajectory, the differential privacy budget is calculated according to the following formula. Perform differential noise addition:

[0038]

[0039] Where, on the left side of the equation This represents the i-th trajectory point on the k-th trajectory after differential noise addition, expressed on the right side of the equation. This represents the i-th trajectory point on the k-th trajectory before differential noise addition. Indicates conformity Random numbers from a Laplace distribution This indicates the grid to which the i-th trajectory point on the k-th trajectory belongs. The side length.

[0040] Furthermore, in step A3, for each trajectory obtained in step A1, and based on the trajectory point sequence of each trajectory obtained in step A2, a spline function is used for piecewise fitting, specifically including:

[0041] A31. Divide the trajectory into multiple trajectory segments according to the rate of change of curvature of the trajectory;

[0042] A32. Use spline functions to fit each trajectory segment separately, with the fitting objective being to minimize the following loss function:

[0043]

[0044] Among them, f l (·) represents the spline function of the l-th trajectory segment. and and are the x and y coordinates of the m-th trajectory point in the l-th trajectory segment, respectively; For calculated values Compared with actual value The loss is M, where M is the number of trajectory points contained in the l-th trajectory segment, C is a constant parameter, and J(f l f is a spline function l The number of terms in a polynomial (·).

[0045] Specifically, the calculated value f l (x m ) and actual value y m The loss is calculated using the following formula:

[0046]

[0047] Among them, f l (·) represents the spline function of the l-th trajectory segment. and and are the x and y coordinates of the m-th trajectory point of the l-th trajectory segment, respectively.

[0048] Furthermore, in step A31, the rate of change of curvature of the trajectory is determined based on the velocity angle, and the trajectory is divided into multiple trajectory segments, specifically including:

[0049] A311. Calculate the velocity angle of each point on the trajectory.

[0050]

[0051] in, This represents the velocity angle of the i-th trajectory point on the k-th trajectory; and These represent the time information of the i-th and (i+1)-th trajectory points on the k-th trajectory, respectively; Let x and y represent the x and y coordinates of the i-th trajectory point on the k-th trajectory, respectively. Let x and y represent the x and y coordinates of the (i+1)th trajectory point on the k-th trajectory, respectively.

[0052] A312. According to the following constraints:

[0053]

[0054] The trajectory is divided into trajectory segments, and each trajectory segment is ensured to meet the constraints. p and q represent the sequence numbers of the trajectory points at both ends of the trajectory segment, respectively.

[0055] Furthermore, in step B2, the restored trajectory obtained in step B1 is resampled to obtain the resampled trajectory point sequence of each trajectory, and cluster analysis is performed based on the resampled trajectory point sequence of each trajectory. The resampled trajectory point sequence of each trajectory includes the start and end points of each trajectory segment of the trajectory, as well as the trajectory points obtained by sampling at equal time intervals based on the spline function of each trajectory segment of the trajectory. The number of samples of each trajectory segment is proportional to the proportion of its time to the overall time of the trajectory.

[0056] The beneficial effects of this invention are:

[0057] Based on the solution of this invention, the trajectory is fitted using a spline function, changing the transmission of location data to the transmission of parameters, which greatly saves communication bandwidth. Furthermore, through fitting, no data movement occurs, thus ensuring the overall accuracy of the trajectory while eliminating the sensitivity of location data and improving the privacy of data processing. Finally, through cluster analysis, it is easy to identify which trajectories in the trajectory dataset are abnormal and which trajectories have high repetition. Distributed trajectory clustering can be performed without avoiding security and privacy risks, for the purpose of screening abnormal trajectories and discovering core trajectories. It can be used in various scenarios such as abnormal trajectory screening in confidential fields and trajectory retrieval for important commercial clients.

[0058] Furthermore, a gridding method is used to divide the trajectory space, and differential privacy parameters are assigned to the trajectory points based on the grid level of the grid where the sampled trajectory points are located. This differential privacy approach is used to add noise to the trajectory point data, thereby improving data privacy. Attached Figure Description

[0059] Figure 1 This is a schematic diagram of a distributed system scenario employing a federated learning architecture in this invention;

[0060] Figure 2 This is a flowchart of the spatiotemporal trajectory clustering method based on federated learning in an embodiment of the present invention;

[0061] Figure 3 This is a schematic diagram of grid division of the trajectory space in an embodiment of the present invention. Detailed Implementation

[0062] This invention aims to propose a spatiotemporal trajectory clustering method based on federated learning, which saves communication bandwidth and improves data processing privacy. This method is applied to distributed systems employing a federated learning architecture, and its application scenarios include... Figure 1As shown, the participants include both client and server roles, as well as system users. The client is the node holding the data, responsible for processing local data and using it for model training or parameter calculation. The server is the node organizing the training, responsible for coordinating client-side collaborative training and aggregating model parameters. In the client-side processing, the sampled trajectory data is first preprocessed, and then trajectory points are sampled from the preprocessed trajectory. Next, the trajectory is segmented based on these points, and spline functions are used to fit each segment. Finally, the spline functions are encoded and sent to the server. During server-side processing, the server decodes the received encoded data from the client, concatenates the decoded spline functions with the same trajectory number according to time sequence, and reconstructs the complete trajectory based on the spline function parameters. Then, cluster analysis is performed on the reconstructed trajectories to identify normal and abnormal trajectories.

[0063] Example:

[0064] like Figure 2 As shown, the spatiotemporal trajectory clustering method based on federated learning in this embodiment includes two main parts: client processing and server processing. These are described in detail below:

[0065] The client-side processing procedure is as follows:

[0066] A1. Data Preprocessing:

[0067] A11. Obtain sample data: The sample data mainly consists of local trajectories with time-series relationships, such as a public dataset of shopping mall customer trajectories.

[0068] A12. Data processing: Remove data that does not conform to the format or contains empty values; thereby ensuring data accuracy and reducing the amount of subsequent data processing.

[0069] A13. Track Alignment: Iterate and sample the client's local track to obtain a set of tracks with the same starting point. and the end point The trajectory, that is, first extracting the path that passes through and The local trajectory, and extract it. and The portion between these points is used as the trajectory for subsequent processing, where k is the trajectory number. After alignment, all trajectories have the same start and end points, which are both k. and Taking shopping mall customer trajectories as an example, trajectory alignment can unify the starting and ending points of customer visits, discarding data outside these points and thus ensuring spatial consistency in subsequent data processing.

[0070] A2. Mesh processing:

[0071] A21. Trajectory Point Selection: For each trajectory obtained after trajectory alignment, points are selected at equal intervals according to a preset interval R, thereby obtaining a sequence of trajectory points for each trajectory in its trajectory space (the space contained by the maximum and minimum ordinates and the maximum and minimum abscissas of the trajectory).

[0072] A22. Mesh Generation: Based on the set number of meshes N, for each trajectory, the corresponding trajectory space is divided into N×N uniform meshes to obtain a mesh set. Set the grid level for each grid. It represents the nth grid obtained by dividing the trajectory space corresponding to the kth trajectory into grids.

[0073] In practice, since the setting of N is not sensitive to the algorithm's performance, N can be set as the number of points len(D) for each trajectory. k ) / R, which reduces the number of iterations, where len(D) k ) represents the length of the k-th trajectory.

[0074] A23. Grid Count Calculation:

[0075] Calculate each grid Grid count

[0076]

[0077] Where Dk represents the k-th trajectory, This represents the i-th trajectory point on the k-th trajectory. This represents the nth grid obtained by dividing the trajectory space corresponding to the kth trajectory into grids. This indicates that the k-th trajectory is located in the grid. The number of trajectory points within the range, |D k | represents the total number of trajectory points for the k-th trajectory.

[0078] A24. Mesh subdivision: Iterate through the mesh counts obtained in A22. If the mesh count is 0, it means there are no trajectory points in that mesh, and no further subdivision is needed; if the mesh count is 1 / |D k If |, it means there is only one trajectory point in the grid, and no further subdivision is needed; for values ​​that are neither 0 nor 1 / |D k The grid of type | is then divided into M×M uniform subgrids according to the secondary partitioning parameter M, and the grid set is updated based on the grids obtained from the secondary partitioning; the grid level of the subgrids is set to |. Further subdividing the grid into grids containing more than one trajectory point can avoid confusion during trajectory point fitting caused by multiple trajectory points appearing in the same grid, thereby improving the subsequent trajectory fitting effect.

[0079] The quadratic partitioning parameter M is defined as follows:

[0080]

[0081] Where β is a predefined grid constant. The larger β is, the finer the trajectory division and the better the trajectory fitting, but the greater the computational and communication burden. In this embodiment, β is taken as 80 / ε. k , where ε k This is the privacy budget for the k-th trajectory. It is the floor function.

[0082] Figure 3 This illustrates an example of a two-level grid division. After dividing the original trajectory into a 2x2 grid, it is found that there are two trajectory points in the grid in the upper right corner. Therefore, the grid is further divided into 2x2 grids to ensure that a grid either has no trajectory points or only one trajectory point.

[0083] A25. Check if the grid count for each grid is 0 or 1 / |D. k If not, proceed to step A24 to continue the traversal; otherwise, proceed to step A3 for the privacy budget decomposition process.

[0084] After the above gridding process, each grid contains at most one trajectory point. Furthermore, the more times the grid is divided, the smaller the side length of the newly divided grid and the higher the grid level. This provides a basis for subsequently assigning corresponding differential privacy parameters based on the grid level of the grid where the trajectory point is located.

[0085] A3. Breakdown of Privacy Budget:

[0086] A31. Assign trajectory differential privacy parameters to each trajectory:

[0087] Assume the client's total differential privacy budget is ε, where ε is set according to the privacy protection requirements. A larger value can be set for high privacy protection requirements, and a relatively smaller value can be set for low privacy protection requirements. Then, a proportional differential privacy parameter ε is assigned to each trajectory based on the number of trajectory points on each trajectory. k That is, the more trajectory points a trajectory has, the larger the trajectory differential privacy parameter it is assigned; the fewer trajectory points a trajectory has, the smaller the trajectory differential privacy parameter it is assigned. The ratio of the trajectory differential privacy parameter between trajectory a and trajectory b is equal to the ratio of the number of trajectory points on trajectory a to the number of trajectory points on trajectory b.

[0088] A32. Assign differential privacy parameters to trajectory points:

[0089] This step involves obtaining the trajectory differential privacy parameter ε for each trajectory. k Further subdivision is performed to suit each trajectory point. Since a higher density of trajectory points in the trajectory space indicates greater user attention to the corresponding area, these points require more privacy protection. A higher density of trajectory points necessitates more grid subdivisions to ensure that each grid contains at most one trajectory point, and the higher the grid level of a trajectory point, the more privacy budget needs to be set for each trajectory point. It is inversely proportional to the side length of the grid it belongs to, that is, directly proportional to its grid level. Specifically, in this embodiment, it is defined as follows:

[0090]

[0091] in, This represents the differential privacy parameter of the i-th trajectory point on the k-th trajectory; and Let |D| represent the grid levels of the i-th and s-th trajectory points on the k-th trajectory, respectively, with the grid level inversely proportional to the side length of the grid; k | represents the number of all trajectory points on the k-th trajectory.

[0092] A4. Adding Noise to Privacy Budgets:

[0093] This step involves differential noise addition to each trajectory point based on the privacy budget obtained for that point, thereby updating the trajectory point. The formula is as follows:

[0094]

[0095] Where, on the left side of the equation This represents the i-th trajectory point on the k-th trajectory after differential noise addition, expressed on the right side of the equation. This represents the i-th trajectory point on the k-th trajectory before differential noise addition. Indicates conformity Random numbers from a Laplace distribution This indicates the grid to which the i-th trajectory point on the k-th trajectory belongs. The side length.

[0096] By employing differential noise addition and allocating a privacy budget, sensitivity is limited to reduce noise perturbation levels. This achieves a smaller impact with a tighter budget, ensuring privacy while avoiding excessive changes to the trajectory that could lead to errors in subsequent clustering analysis.

[0097] A5. Spline function fitting:

[0098] The spline function fitting employs piecewise fitting; therefore, trajectory segmentation is the first step. The segmentation method can be arbitrary, but to ensure a good fitting result, in this invention, the trajectory is divided into multiple segments based on the rate of change of its curvature. Specifically, in this embodiment, the rate of change of the trajectory's curvature is determined based on the velocity angle, and the trajectory is divided into multiple segments, specifically including:

[0099] A51. Calculate the velocity angle of each point on the trajectory.

[0100]

[0101] in, This represents the velocity angle of the i-th trajectory point on the k-th trajectory; and These represent the time information of the i-th and (i+1)-th trajectory points on the k-th trajectory, respectively; Let x and y represent the x and y coordinates of the i-th trajectory point on the k-th trajectory, respectively. Let x and y represent the x and y coordinates of the (i+1)th trajectory point on the k-th trajectory, respectively.

[0102] A52. Based on the following constraints:

[0103]

[0104] The trajectory is divided into trajectory segments, and each trajectory segment is ensured to meet the constraints. p and q represent the sequence numbers of the trajectory points at both ends of the trajectory segment, respectively.

[0105] The above constraints reflect the constraints to avoid overfitting of spline functions. That is, only trajectory segments with the same trend can be merged and fitted with a single spline function. Therefore, the above three constraints are actually used to determine the trajectory trend between trajectory points p and q through the velocity angle. A trajectory that satisfies the condition that the trend between trajectory points p and q is the same, and the trend before trajectory point p is different from the trend after trajectory point q, is considered as a trajectory segment.

[0106] A53. Use spline functions to fit each trajectory segment separately, with the fitting objective being to minimize the following loss function:

[0107]

[0108] Among them, f l (·) represents the spline function of the l-th trajectory segment. and and are the x and y coordinates of the m-th trajectory point in the l-th trajectory segment, respectively; For calculated values Compared with actual value The loss is denoted by M, where M is the number of trajectory points contained in the l-th trajectory segment, and C is a constant parameter used to control the influence of the constraint on the loss function. In this embodiment, it is set to 0.3. J(f l f is a spline function l In practice, the number of polynomial terms in (·) can be determined by using terms with the highest degree of quadratic, cubic, or quartic order for fitting. A higher polynomial number increases the likelihood of overfitting, while a lower polynomial number results in a worse fit. Considering all factors, a formula with the highest degree of cubic can be used for fitting. In this case, J(f) l The value is 3.

[0109] And the calculated value f l (x m ) and actual value y m The loss is calculated according to the following formula.

[0110]

[0111] A6. Encoded transmission:

[0112] For each trajectory, this step encodes the start and end position information, start and end timing information, and corresponding spline function parameter information of each trajectory segment according to its segmentation, and sends them to the server.

[0113] The server processing procedure is as follows:

[0114] B1. Trajectory Restoration:

[0115] The server decodes the received information, reconstructs the corresponding trajectory segments of spline functions belonging to the same trajectory based on the parameters of the spline functions, and sequentially splices them together according to the start and end position information and start and end time sequence information of the corresponding trajectory segments to obtain the reconstructed trajectory of the corresponding trajectory.

[0116] B2. Trajectory Analysis:

[0117] This step performs cluster analysis on the restored trajectory obtained in step B1, which can be done using any existing method.

[0118] In this embodiment, the restored trajectory obtained in step B1 is resampled to obtain a resampled trajectory point sequence for each trajectory, and cluster analysis is performed based on the resampled trajectory point sequence for each trajectory. The resampled trajectory point sequence for each trajectory includes the start and end points of each trajectory segment, as well as the trajectory points obtained by sampling at equal time intervals based on the spline function of each trajectory segment. The number of samples for each trajectory segment is proportional to the proportion of its time to the total time of the trajectory.

[0119] Then, the density-based clustering algorithm DBSCAN was used for cluster analysis.

[0120] The DBSCAN algorithm works as follows: By traversing all points, if the number of points less than the cluster radius eps is greater than the cluster density e, then that point should belong to a certain cluster. In this case, if the point is less than the cluster radius eps of a given cluster, it is assigned to that cluster; if it belongs to multiple clusters, the clusters are merged; if it does not fit into any cluster, it creates its own new cluster.

[0121] In this embodiment, the specific process of the DBSCAN algorithm is as follows:

[0122] B31. Randomly select an unvisited trajectory k, and in its corresponding resampled trajectory point sequence S... k Find all elements that satisfy the radius distance l. k,u The trajectory u is obtained and added to the trajectory set U, where,

[0123]

[0124] Among them, S k S is a sequence of complex-sampled trajectory points for trajectory k; |S k |for S k The number of midpoints; For S k The i-th point in;

[0125] B32. If trajectory u in trajectory set U belongs to cluster C, then the trajectory is included in cluster C and the trajectory is marked as the core trajectory. At the same time, if the number of trajectories |U| in trajectory set U is greater than or equal to the preset trajectory density e, then a new cluster C is created and step B33 is executed. If not, step B34 is executed.

[0126] B33. If the trajectory is a core trajectory and belongs to multiple clusters, then these clusters are connected to each other, the connected clusters are merged to form a single cluster, and all trajectories in the cluster are marked as cluster C trajectories.

[0127] B34. Determine whether all trajectories have been visited. If not, return to step B31; otherwise, mark the trajectories not in the cluster as noise points, output the noise points as abnormal trajectories, and the remaining trajectories as normal trajectories.

[0128] The spatiotemporal clustering method proposed in this invention can be applied to various scenarios. For example, in confidential scenarios, it can distinguish normal and abnormal flight paths among many flight paths; in commercial scenarios, it can analyze customer tour routes to identify tour routes that are well-received by customers and tour routes that are less popular.

[0129] Finally, it should be noted that the above embodiments are merely preferred embodiments and are not intended to limit the present invention. It should be pointed out that those skilled in the art can make various modifications, equivalent substitutions, and improvements without departing from the spirit and scope of the claims, and all such modifications, substitutions, and improvements should be included within the scope of protection of the present invention.

Claims

1. A spatiotemporal trajectory clustering method based on federated learning, applied to a distributed system employing a federated learning architecture, the distributed system comprising a server and multiple clients, characterized in that, The method includes: A. Client-side processing: A1. Iterate through and sample the local trajectory of the client to obtain a set of trajectories with the same starting point and ending point; A2. For each trajectory obtained by sampling in step A1, take points at equal intervals according to a preset interval to obtain its trajectory point sequence in the trajectory space; A3. For each trajectory obtained by sampling in step A1, and based on the trajectory point sequence of each trajectory obtained in step A2, use spline functions to perform piecewise fitting. A4. For each trajectory obtained by sampling in step A1, according to the segmentation in step A3, the start and end position information, start and end timing information, and parameter information of the corresponding spline function of each trajectory segment are encoded according to the trajectory and trajectory segment to which they belong, and sent to the server. B. Server processing procedure: B1. The server decodes the received information, restores the corresponding trajectory segments of spline functions belonging to the same trajectory according to the parameters of the spline functions, and sequentially splices them according to the start and end position information and start and end time sequence information of the corresponding trajectory segments to obtain the restored trajectory of the corresponding trajectory. B2. Perform cluster analysis on the restored trajectory obtained in step B1; Step A2 also includes: Based on the client's preset differential privacy budget In addition to the number of trajectory points on each trajectory, a trajectory differential privacy parameter is assigned to each trajectory in proportion to the number of trajectory points. The The sequence number of the trajectory; Then, for each trajectory, the following noise reduction process is performed: The trajectory space is initially divided into grids to determine if each grid contains at most one trajectory point. For grids that do not meet the condition, a second grid is created to ensure that each grid contains at most one trajectory point. Based on the grid corresponding to each trajectory point, a differential privacy budget is allocated to each trajectory point. It is inversely proportional to the side length of the grid it belongs to; the The index of the trajectory point; For each trajectory point on that trajectory, based on its differential privacy budget Perform differential noise addition; In step A2, based on the grid corresponding to each trajectory point, a differential privacy budget is allocated to each trajectory point according to the following formula: The differential privacy budget for each trajectory point... It is inversely proportional to the side length of the grid it belongs to: in, Indicates the first The first on the trajectory Differential privacy parameters for each trajectory point; and They represent the first The first on the trajectory The and the first The grid level to which each trajectory point belongs, and the grid level is inversely proportional to the side length of the grid; Indicates the first The number of all trajectory points on the trajectory.

2. The spatiotemporal trajectory clustering method based on federated learning as described in claim 1, characterized in that, In step A2, the trajectory space of the trajectory is initially divided into grids to determine whether each grid contains at most one trajectory point. For grids that do not meet the condition, a second grid division is performed to ensure that each grid contains at most one trajectory point. This includes: A21. According to the set value The entire trajectory space is divided into A uniform grid, with each grid having a grid level of [missing information]. and obtain the grid set; A22. Each grid in the computational grid set Grid count : in, Indicates the first A trajectory, Indicates the first The first on the trajectory A trajectory point, Indicates the first The trajectory space corresponding to the trajectory is obtained by meshing. One grid, Indicates the first Trajectory located in the grid The number of trajectory points within the range, Indicates the first The total number of all trajectory points in the trajectory; A23. Traverse the grid set and count the grid of each grid, determining whether it meets the judgment condition, wherein the judgment condition is: the grid count of the grid is 0 or... For meshes that do not meet the judgment criteria, proceed to step A24. A24. Calculate the secondary meshing parameters of the corresponding grid using the following formula. : in, For predefined mesh constants, This represents the grid count before the secondary partitioning. It is the floor function; Based on the secondary partitioning parameters The corresponding grid is divided into secondary subdivisions. A uniform subgrid is generated, and the grid set is updated based on the grid obtained from the secondary partitioning; the grid level of the subgrid is set to... = +1; A25. Repeat steps A23-A24 until the traversal is complete.

3. The spatiotemporal trajectory clustering method based on federated learning as described in claim 2, characterized in that, In step A21, the Set as ,in, The interval length for sampling trajectory points in step A2. Indicates the first The length of the trajectory.

4. The spatiotemporal trajectory clustering method based on federated learning as described in claim 2, characterized in that, In step A24, the For 80 , It is the first Privacy budget for each trajectory.

5. A spatiotemporal trajectory clustering method based on federated learning as described in any one of claims 2 to 4, characterized in that, In step A2, for each trajectory point on the trajectory, the differential privacy budget is calculated according to the following formula. Perform differential noise addition: Wherein, the left side of the equation sign Indicates the first differential noise addition The first on the trajectory A trajectory point, the right side of the equation. Indicates the first differential noise addition The first on the trajectory A trajectory point, Indicates conformity Random numbers from a Laplace distribution Indicates the first The first on the trajectory The grid to which each trajectory point belongs The side length.

6. The spatiotemporal trajectory clustering method based on federated learning as described in claim 1, characterized in that, In step A3, for each trajectory obtained in step A1, and based on the trajectory point sequence of each trajectory obtained in step A2, a spline function is used for piecewise fitting, specifically including: A31. Divide the trajectory into multiple trajectory segments according to the rate of change of curvature of the trajectory; A32. Use spline functions to fit each trajectory segment separately, with the fitting objective being to minimize the following loss function: in, For the first spline functions for trajectory segments, and The first The first trajectory segment The horizontal and vertical coordinates of each trajectory point; For calculated values Compared with actual value The loss, For the first The number of trajectory points contained in each trajectory segment. It is a constant parameter. It is a spline function The number of terms in a polynomial.

7. The spatiotemporal trajectory clustering method based on federated learning as described in claim 6, characterized in that, The calculated value Compared with actual value The loss is calculated using the following formula: in, For the first spline functions for trajectory segments, and The first The first trajectory segment The horizontal and vertical coordinates of the trajectory points.

8. The spatiotemporal trajectory clustering method based on federated learning as described in claim 6, characterized in that, In step A31, the rate of change of curvature of the trajectory is determined based on the velocity angle, and the trajectory is divided into multiple trajectory segments, specifically including: A311. Calculate the velocity angle of each point on the trajectory. : in, Indicates the first The first on the trajectory The velocity angle of each trajectory point; and They represent the first The first on the trajectory The and the first Time information of each trajectory point; , They represent the first The first on the trajectory The horizontal and vertical coordinates of each trajectory point; , They represent the first The first on the trajectory The horizontal and vertical coordinates of each trajectory point; A312. According to the following constraints: The trajectory is divided into trajectory segments, and each trajectory segment is ensured to satisfy the constraints. and These represent the serial numbers of the trajectory points at both ends of the trajectory segment.

9. The spatiotemporal trajectory clustering method based on federated learning as described in claim 1, characterized in that, In step B2, the restored trajectory obtained in step B1 is resampled to obtain the resampled trajectory point sequence of each trajectory, and cluster analysis is performed based on the resampled trajectory point sequence of each trajectory. The resampled trajectory point sequence of each trajectory includes the start and end points of each trajectory segment of the trajectory, as well as the trajectory points obtained by sampling at equal time intervals based on the spline function of each trajectory segment of the trajectory. The number of samples of each trajectory segment is proportional to the proportion of its time to the total time of the trajectory.

Citation Information

Patent Citations

  • Track data processing method, device and system

    CN112800152A

  • Track data protection method, device and equipment

    CN115270183A