A trajectory similarity query method and device based on data federation

By numbering mobile devices and building a federated index in a data federated environment, using dynamic branch reduction algorithm and similarity upper bound pruning, the high overhead problem in mobile trajectory data query is solved, and efficient and privacy-protected trajectory similarity query is achieved.

CN116521803BActive Publication Date: 2025-08-15WUHAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310222854.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-09
Publication Date
2025-08-15
Estimated Expiration
2043-03-09

AI Technical Summary

Technical Problem

In the data federated environment, similarity query of mobile trajectory data faces the problems of large communication overhead and high local computing overhead, especially when it is difficult to efficiently conduct trajectory similarity query under the premise of protecting data privacy.

Method used

By numbering mobile devices in the data federation and building a federated index based on the spatial grid, using the dynamic branch reduction algorithm to find the preset number of mobile devices with the most similar trajectory to be queried, using the similarity upper bound pruning to filter out the devices that do not meet the query conditions, reducing communication overhead, and pruning the query trajectory data based on the spatiotemporal characteristics of the trajectory data. The central server terminates the query process in advance according to the dynamic pruning conditions.

Benefits of technology

It effectively reduces the overhead of communication and local computing, improves the efficiency of trajectory similarity query, and protects data privacy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116521803B_ABST
    Figure CN116521803B_ABST
Patent Text Reader

Abstract

The present invention discloses a trajectory similarity query method and device based on data federation, relating to the fields of trajectory data mining and information retrieval. The query method comprises: numbering mobile devices within the data federation; constructing a federated index based on a spatial grid via a central server; and using a dynamic pruning algorithm to find a preset number of mobile devices that are most similar to the trajectory to be queried, based on the federated index and the numbering. The present invention utilizes the spatiotemporal characteristics of the trajectory to construct the federated index, filtering out mobile devices that do not meet the query criteria through similarity upper bound pruning, thereby reducing communication overhead. Simultaneously, the trajectory data to be queried is pruned based on the spatiotemporal characteristics of the trajectory data, reducing local computational overhead. The central server terminates the query process prematurely based on the dynamic pruning criteria, further improving query efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of trajectory data mining and information retrieval, and in particular to a trajectory similarity query method and device based on data federation. Background Art

[0002] Trajectory similarity query is an important tool for analyzing spatiotemporal trajectory data. Using predefined trajectory similarity, we can quickly retrieve the trajectory data that is most similar to the target trajectory. Similarity query is crucial for subsequent trajectory data analysis, including trajectory clustering and trajectory recommendation. Furthermore, trajectory similarity query is widely used in fields such as transportation logistics (route planning) and sociology. Trajectory similarity query has significant application value.

[0003] Data federation is a mature data integration method. Under a unified data model, data owners within the federation hold a portion of the data, interact with a central server, and provide external query services. During a federated query, the central server receives the user's query request and forwards it to the relevant data owner. The data owner processes the query request and returns the query results to the central server, which then compiles and returns the final results to the user. During this process, users do not directly interact with the data owners within the federation, which protects the data privacy of the data owners to a certain extent.

[0004] Traditional data federation is primarily based on enterprise-level applications, primarily used in server-side programs, resulting in large data volumes. With the advancement of mobile technology, the computing power and capacity of mobile devices, such as mobile phones, have gradually increased, leading to a growing volume of managed data. Furthermore, the application of positioning technology on mobile phones has enabled the collection and management of people's daily trajectory data. Analysis of this trajectory data, particularly trajectory similarity queries, can be applied to areas such as infectious disease contact tracing and traffic route planning, improving social governance. However, daily trajectory data often involves personal privacy, making it difficult for researchers to directly access and analyze this data, a major challenge in analyzing mobile trajectory data. Summary of the Invention

[0005] To address the shortcomings of the existing technology, the present invention aims to provide a trajectory similarity query method and device based on data federation. This method uses upper similarity pruning to filter out mobile devices that do not meet the query criteria, reducing communication overhead. Furthermore, the method prunes the trajectory data to be queried based on its spatiotemporal characteristics, reducing local computational overhead. The central server terminates the query process prematurely based on dynamic pruning conditions, further improving query efficiency.

[0006] In order to achieve the above purpose, the technical solution adopted by the present invention is:

[0007] Numbering mobile devices within the data federation;

[0008] Build a federated index based on a spatial grid through a central server;

[0009] Based on the federated index and number, a dynamic branch reduction algorithm is used to find a preset number of mobile devices that are most similar to the query trajectory.

[0010] Based on the above technical solution, the steps of numbering the mobile devices in the data federation include:

[0011] The mobile device sends registration information to the central server, and the central server numbers all mobile devices in the order in which they are received.

[0012] Based on the above technical solution, the federated index is constructed through a central server and based on a spatial grid. The specific steps include:

[0013] The central server sends the spatial grid parameters to all mobile devices;

[0014] After receiving the grid parameters, the mobile device anonymizes the spatial position in the trajectory data using the spatial grid and sends the anonymized trajectory information to the central server;

[0015] The central server receives anonymized trajectory information and builds a time index on each square of the spatial grid to record the stay information of each device in that square.

[0016] Based on the above technical solution, the spatial grid parameters include the spatial range of the grid and the side length of the squares in the grid.

[0017] Based on the above technical solution, the method uses a dynamic branch reduction algorithm based on federated indexes and numbers to find a preset number of mobile devices that are most similar to the trajectory to be queried. The specific steps include:

[0018] The central server initializes a priority queue with a similarity upper bound, whose size is the total number of mobile devices in the data federation. It is used to record the upper bound of the similarity between the data trajectory of each mobile device and the trajectory to be queried and sort them from large to small.

[0019] The central server uses the federated index to calculate the upper bound of similarity of the mobile device trajectory data and adds all the upper bound values of similarity to the priority queue;

[0020] Remove the devices with a similarity upper limit of 0 in the priority queue, and the remaining mobile devices calculate the similarity value with the trajectory to be queried locally. The calculation method is:

[0021]

[0022] Among them, Sim is the similarity, T1 is the trajectory to be queried, T2 is the local trajectory of the mobile device, π i is the i-th stop point in trajectory T1, π j is the jth stop point in trajectory T2, τ is the time spent at the stop point, ρ is the point of interest corresponding to the stop point, π i .τ is the dwell time of the i-th dwell point in trajectory T1, π j .τ is the dwell time of the jth dwell point in trajectory T2, |π i .τ∩π j .τ| is the common stay time at the same point of interest;

[0023] The central server receives the similarity value sent by the mobile terminal and updates the upper similarity limit value in the priority list to the similarity value of the corresponding device. Based on the received similarity value:

[0024] If the received similarity value is greater than the maximum similarity upper limit, the query is terminated and a preset number of most similar mobile devices are returned;

[0025] If the received similarity value is not greater than the similarity upper bound, it is determined whether the similarity values of all mobile devices have been received. If so, the query is terminated and a preset number of most similar devices are returned. If not, the execution returns to the central server to receive the similarity value sent by the mobile terminal, and the similarity upper bound value in the priority list is updated to the similarity value of the corresponding device.

[0026] Based on the above technical solution, the central server calculates the upper similarity bound of the mobile device trajectory data using the federated index and adds all the upper similarity bound values to the priority queue. The specific steps include:

[0027] The central server maintains a list of similarity upper bound values;

[0028] Traverse all the stop points in the query trajectory, calculate the grid where each stop point is located, and find the corresponding interval tree in the federated index;

[0029] According to the interval information of the stay point, find all the leaf nodes that intersect with it, and update the upper limit of similarity on the corresponding device based on each leaf node. The upper limit of similarity is calculated as follows:

[0030] UB i =UB i +|π.τ∩N leaf .τ|

[0031] Among them, UB i is the upper bound of the similarity of the i-th mobile device, π is the stay point, τ is the stay time, π.τ is the stay time of the stay point, Nleaf is a leaf node, N leaf .τ is the residence time of a leaf node;

[0032] After the traversal is completed, all similarity upper bound values in the similarity upper bound value list are added to the priority list.

[0033] Based on the above technical solution, after removing the devices with a similarity upper limit of 0 from the priority queue, the method further includes:

[0034] According to the trajectory data characteristics of the mobile device, irrelevant parts of the query data are removed to improve the efficiency of similarity calculation of the mobile device.

[0035] Based on the above technical solution, after the central server sends the spatial grid parameters to all mobile devices, the method further includes:

[0036] The central server initializes the root node of the federated index. The root node stores m*n pointers, each of which points to an interval tree. The calculation method of m and n is:

[0037]

[0038]

[0039] Among them, R is the spatial range of the grid, and the spatial range R is represented by longitude and latitude. min is the minimum value of latitude, lat max is the maximum value of latitude, R.lat max is the maximum latitude of the grid space, R.lat min is the minimum latitude of the grid space, lon min is the minimum value of longitude, lon max is the maximum value of longitude, R.lon max is the maximum longitude of the grid space, R.lon min is the minimum longitude of the grid space, δ d is the side length of a square.

[0040] Based on the above technical solution, the mobile device receives the grid parameters and anonymizes the spatial position in the trajectory data using the grid. The specific steps include:

[0041] The mobile device receives the grid parameters and determines the grid division;

[0042] Traverse all the stop points in the local trajectory data and convert them into corresponding footprint information in the grid, that is, The conversion is as follows:

[0043]

[0044] Among them, π is the stay point, τ is the stay time, ρ is the point of interest of the stay point π, R is the spatial grid range, δ d is the side length of the grid in the spatial grid, lon is the longitude, ρ.lon is the longitude of the interest point ρ, lat is the latitude, ρ.lat is the latitude of the interest point ρ, x is the offset of the interest point in longitude, y is the offset of the interest point in latitude, t is the spatial grid number, c t is the square numbered t, and v is the total number of mobile devices in the data federation.

[0045] The present invention also provides a trajectory similarity query device based on data federation, comprising:

[0046] An execution module, configured to number mobile devices within the data federation and construct a federation index based on a spatial grid;

[0047] The query module is configured to query a preset number of mobile devices that are most similar to the trajectory to be queried using a dynamic branch pruning algorithm based on the federated index constructed by the execution module.

[0048] Compared with existing technologies, the advantages of the present invention are as follows: It uses the spatiotemporal characteristics of trajectories to construct a federated index and uses similarity upper bound pruning to filter out mobile devices that do not meet the query criteria, reducing communication overhead. Furthermore, it prunes the trajectory data to be queried based on its spatiotemporal characteristics, reducing local computing overhead. The central server terminates the query process early based on dynamic pruning conditions, further improving query efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0050] Figure 1 Schematic diagram of a flow chart of a trajectory similarity query method based on data federation in an embodiment of the present invention;

[0051] Figure 2 A schematic diagram of a specific process for creating a federated index in an embodiment of the present invention;

[0052] Figure 3 This is a schematic diagram of an index structure in an embodiment of the present invention;

[0053] Figure 4 Schematic diagram of the root node structure of a federated index in an embodiment of the present invention;

[0054] Figure 5This is a sample diagram of the anonymization of trajectory data locations in an embodiment of the present invention;

[0055] Figure 6 Schematic diagram of the specific process of the dynamic pruning algorithm in an embodiment of the present invention. DETAILED DESCRIPTION

[0056] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments.

[0057] See also Figure 1 As shown, an embodiment of the present invention provides a trajectory similarity query method based on data federation, comprising the following steps:

[0058] S1: Number the mobile devices in the data federation;

[0059] S2: Build a federated index based on the spatial grid through a central server;

[0060] S3: Based on the federated index and number, a dynamic branch reduction algorithm is used to find a preset number of mobile devices that are most similar to the query trajectory.

[0061] That is, the trajectory similarity query method based on data federation provided by the present invention has the following steps: first, the mobile devices in the data federation are recorded and numbered; the mobile devices send registration information to the central server; the central server numbers all mobile devices according to the order of the received information; then the central server sends spatial grid parameters to all mobile devices and initializes the root node N of the federation index. root After receiving the spatial grid parameters, the mobile device traverses all the stay points in the local trajectory data and converts them into footprint information corresponding to the spatial grid. After the conversion is completed, the mobile device uploads all footprint information to the central server. The central server receives the footprint information sent by the mobile device and finds the corresponding interval tree in the root node of the federated index according to the spatial grid information where it is located. It inserts the time interval in the footprint information into the leaf node of the interval tree and records the corresponding device number in the leaf node. At this point, the federated index is constructed. Then, based on the federated index and the device number, a dynamic pruning algorithm is used to find the k mobile devices most similar to the query trajectory Q, where k is a preset number and k is an integer.

[0062] In the present invention, the steps of numbering the mobile devices in the data federation include:

[0063] The mobile device sends registration information to the central server, and the central server numbers all mobile devices in the order in which they are received.

[0064] That is, the mobile device sends registration information to the central server, and the central server numbers all mobile devices in the order of receiving the information, for example, using S1-S v Number the mobile devices.

[0065] In the present invention, the steps of constructing a federated index based on a spatial grid through a central server include:

[0066] The central server sends the spatial grid parameters to all mobile devices;

[0067] After receiving the grid parameters, the mobile device anonymizes the spatial position in the trajectory data using the spatial grid and sends the anonymized trajectory information to the central server;

[0068] The central server receives anonymized trajectory information and builds a time index on each square of the spatial grid to record the stay information of each device in that square.

[0069] That is, the central server sends the spatial grid parameters to all mobile devices in the data federation. The spatial grid parameters include the spatial range R of the spatial grid and the side length δ of the grid in the spatial grid. d , spatial range R = <lat min ,lat max ,lon min ,lon max >, the mobile device receives the grid parameters and anonymizes the spatial position in the trajectory data of the mobile device using the grid, where the trajectory data T consists of several stay points π, that is, T = <π1,π2,...,π x >, each stop point π=<ρ,τ> records the target's stop information at the point of interest, including the point of interest ρ and the stay time τ. The spatiotemporal grid consists of multiple squares of the same size, that is, G= <c1,c2,...,c m*n >, anonymization processing is to convert the stay point π=<ρ,τ> into the footprint information σ= <c i ,τ>, where c i The grid corresponding to the point of interest in the stop point is sent to the server; the central server receives the anonymized trajectory information and builds a time index on each square of the spatial grid to record the stop information of each device in the square.

[0070] In the present invention, the spatial grid parameters include the spatial range of the grid and the side lengths of the squares in the grid.

[0071] That is, the spatial grid parameters include the spatial range R of the grid = <lat min ,lat max ,lon min ,lon max > and the side length δ of the squares in the grid d .

[0072] In the present invention, the method of using a dynamic branch reduction algorithm based on the federated index and number to find a preset number of mobile devices that are most similar to the trajectory to be queried includes the following specific steps:

[0073] The central server initializes a priority queue with a similarity upper bound, whose size is the total number of mobile devices in the data federation. It is used to record the upper bound of the similarity between the data trajectory of each mobile device and the trajectory to be queried and sort them from large to small.

[0074] The central server uses the federated index to calculate the upper bound of similarity of the mobile device trajectory data and adds all the upper bound values of similarity to the priority queue;

[0075] Remove the devices with a similarity upper limit of 0 in the priority queue, and the remaining mobile devices calculate the similarity value with the trajectory to be queried locally. The calculation method is:

[0076]

[0077] Among them, Sim is the similarity, T1 is the trajectory to be queried, T2 is the local trajectory of the mobile device, π i is the i-th stop point in the T1 trajectory, π j is the jth stop point in trajectory T2, τ is the time spent at the stop point, ρ is the point of interest corresponding to the stop point, |π i .τ∩π j .τ| is the common stay time at the same point of interest;

[0078] The central server receives the similarity value sent by the mobile terminal and updates the upper similarity limit value in the priority list to the similarity value of the corresponding device. Based on the received similarity value:

[0079] If the received similarity value is greater than the maximum similarity upper limit, the query is terminated and a preset number of most similar mobile devices are returned;

[0080] If the received similarity value is not greater than the similarity upper bound, it is determined whether the similarity values of all mobile devices have been received. If so, the query is terminated and a preset number of most similar devices are returned. If not, the execution returns to the central server to receive the similarity value sent by the mobile terminal, and the similarity upper bound value in the priority list is updated to the similarity value of the corresponding device.

[0081] That is, the central server initializes a priority queue L with a similarity upper bound, whose size is the total number v of mobile devices in the data federation. The priority queue L records the similarity upper bound between the trajectory data in each mobile device and the trajectory to be queried, and sorts them from large to small according to the value. The queue head L.top retains the maximum similarity upper bound in the mobile device; the central server uses the federation index to calculate the similarity upper bound of the mobile device trajectory data, and adds all similarity upper bound values to the priority queue. For mobile devices with a similarity upper bound of 0, it can be determined that they do not meet the query requirements and are removed from the priority queue. For mobile devices with a similarity upper bound greater than 0, the central server sends the query data of the trajectory to be queried to the corresponding mobile device, and the mobile device calculates the similarity value locally and sends it to the central server; the central server receives the similarity value Sim sent by the mobile device, and updates the upper bound value in the priority list of the similarity upper bound value to the corresponding similarity value received. When the received similarity value is greater than the maximum similarity upper bound in the priority queue, that is, Sim i When L.top, the similarity values of subsequent mobile devices do not meet the query conditions, and the query can be directly terminated. The central server returns the final query result, that is, the k mobile devices with the largest similarity.

[0082] The present invention uses the spatiotemporal characteristics of trajectories to construct a federated index. Mobile devices that do not meet the query criteria are filtered out through similarity upper bound pruning, reducing communication overhead. Simultaneously, the trajectory data to be queried is pruned based on its spatiotemporal characteristics, reducing local computational overhead. The central server terminates the query process early based on dynamic pruning conditions, further improving query efficiency.

[0083] In the present invention, the central server calculates the upper similarity bound of the mobile device trajectory data using the federated index and adds all the upper similarity bound values to the priority queue. The specific steps include:

[0084] The central server maintains a list of similarity upper bound values;

[0085] Traverse all the stop points in the query trajectory, calculate the grid where each stop point is located, and find the corresponding interval tree in the federated index;

[0086] According to the interval information of the stay point, find all the leaf nodes that intersect with it, and update the upper limit of similarity on the corresponding device based on each leaf node. The upper limit of similarity is calculated as follows:

[0087] UB i =UB i +|π.τ∩N leaf .τ|

[0088] Among them, UB iis the upper bound of the similarity of the i-th mobile device, π is the stay point, τ is the stay time, π.τ is the stay time of the stay point, N leaf is a leaf node, N leaf .τ is the residence time of a leaf node;

[0089] After the traversal is completed, all similarity upper bound values in the similarity upper bound value list are added to the priority list.

[0090] That is, the central server uses the federated index to calculate the upper bound of similarity of the mobile device trajectory data and adds all the upper bound values of similarity to the priority queue. The specific steps are as follows: the central server maintains a similarity upper bound value list UB = {UB1, UB2, ..., UB v} and a query data list QL = {Q1, Q2, ..., Q r}, traverse all the stay points in the query trajectory Q, for the stay point π=<ρ,τ>, calculate the square where it is located and find the corresponding interval tree in the federated index, find all the leaf nodes that have intersections with it according to the interval information τ of the stay point, for each leaf node N leaf =<i,τ> , update the similarity upper bound UB of the corresponding device i =UB i +|π.τ∩N leaf .τ|, and update the query data Q of the corresponding mobile device at the same time i =Q i ∪{π}. After the traversal is completed, all upper bound values in the list UB are added to the priority queue L.

[0091] In the present invention, after removing the devices with a similarity upper limit value of 0 in the priority queue, the method further includes:

[0092] According to the trajectory data characteristics of the mobile device, irrelevant parts of the query data are removed to improve the efficiency of similarity calculation of the mobile device.

[0093] That is, after removing devices with a similarity upper limit of 0 from the priority queue, the central server will also remove irrelevant parts of the query data based on the trajectory data characteristics of the mobile device to improve the efficiency of the mobile device's local similarity calculation.

[0094] In the present invention, after the central server sends the spatial grid parameters to all mobile devices, the method further includes:

[0095] The central server initializes the root node of the federated index. The root node stores m*n pointers, each of which points to an interval tree. The calculation method of m and n is:

[0096]

[0097]

[0098] That is, after the central server sends the spatial grid parameters to all mobile devices, the central server initializes the root node N of the federated index. root , the root node stores m*n pointers, each pointer points to an interval tree, where m and n are calculated as follows:

[0099]

[0100]

[0101] Among them, R is the spatial range of the grid, and the spatial range R is represented by longitude and latitude. min is the minimum value of latitude, lat max is the maximum value of latitude, R.lat max is the maximum latitude of the grid space, R.lat min is the minimum latitude of the grid space, lon min is the minimum value of longitude, lon max is the maximum value of longitude, R.lon max is the maximum longitude of the grid space, R.lon min is the minimum longitude of the grid space, δ d is the side length of a square.

[0102] In the present invention, the mobile device receives grid parameters and anonymizes the spatial positions in the trajectory data using the grid. The specific steps include:

[0103] The mobile device receives the grid parameters and determines the grid division;

[0104] Traverse all the stop points in the local trajectory data and convert them into corresponding footprint information in the grid, that is, The conversion is as follows:

[0105]

[0106] That is, the mobile device receives the grid parameters and anonymizes the spatial position in the trajectory data using the grid. The specific steps are as follows: the mobile device receives the spatial grid parameters R and δ d , traverse all the stay points in the local trajectory data, convert them into the footprint information corresponding to the grid, and convert π=<ρ,τ> through the grid parameters R and δ d Converted to σ= <c i ,τ>, that is The specific conversion method is as follows:

[0107]

[0108] Among them, π is the stay point, τ is the stay time, ρ is the point of interest of the stay point π, R is the spatial grid range, δ d is the side length of the grid in the spatial grid, lon is the longitude, ρ.lon is the longitude of the interest point ρ, lat is the latitude, ρ.lat is the latitude of the interest point ρ, x is the offset of the interest point in longitude, y is the offset of the interest point in latitude, t is the spatial grid number, c t is the square numbered t, and v is the total number of mobile devices in the data federation.

[0109] An embodiment of the present invention further provides a trajectory similarity query device based on data federation, comprising:

[0110] An execution module, configured to number mobile devices within the data federation and construct a federation index based on a spatial grid;

[0111] The query module is configured to query a preset number of mobile devices that are most similar to the trajectory to be queried using a dynamic branch pruning algorithm based on the federated index constructed by the execution module.

[0112] An embodiment of the present invention also provides a trajectory similarity query device based on data federation, comprising an execution module and a query module. The execution module is configured to number mobile devices within the data federation and construct a federation index based on a spatial grid. The query module is configured to use a dynamic pruning algorithm to query a preset number of mobile devices that are most similar to the trajectory being queried, based on the federation index constructed by the execution module.

[0113] The embodiment of the present invention provides a trajectory similarity query method for mobile device data federation. Each mobile device holds a local trajectory data. Given a trajectory Q to be queried and an integer k, the k mobile devices most similar to Q are found. To improve query efficiency, the present invention designs a spatiotemporal federated index to efficiently prune the query data. The query method process of the present invention is as follows: Figure 1 As shown, it is mainly divided into three steps:

[0114] Federation initialization: all mobile devices send registration information to the central server, which records and numbers it;

[0115] To build a federated index, the central server sends spatial grid parameters to all mobile devices. The mobile devices anonymize the location of local trajectory data based on the grid parameters, convert the points of interest in the stop points into corresponding spatial grids, and upload them to the central server to build a federated index. The specific process is described in Example 1.

[0116] During query execution, the central server uses the federated index to perform similarity upper bound pruning, filtering out devices that do not meet the query conditions. It then uses the dynamic pruning algorithm to dynamically calculate the similarity upper bound and return the final query result. The detailed process of the dynamic pruning algorithm will be described in Example 2.

[0117] The present invention will be described in more detail below through a number of embodiments.

[0118] Example 1: Federation index creation, the specific flow chart is as follows Figure 2 As shown, the index structure is as follows Figure 3 As shown, the detailed steps are:

[0119] S201: The central server sends grid parameters to all mobile devices and initializes the root node.

[0120] A federated index consists of a root node and multiple interval tree indexes of its records. Figure 4 It is the root node structure diagram of the federated index, which consists of index header information and a list of child nodes. The index header information includes grid parameter information, namely the range R of the grid and the side length δ of the grid. d The total number of squares in the grid is m*n. The child node list includes multiple list items, each of which stores the corresponding square ID and a pointer to the root node of the corresponding interval tree. The internal nodes of the interval tree store interval information, and the leaf nodes store the ID number of the corresponding mobile device in addition to the interval information.

[0121] S202: The mobile device receives the grid parameters, anonymizes them, and then uploads them to the central server.

[0122] The mobile device traverses the local trajectory data, anonymizes the location of the stop points, and uploads the corresponding footprint information to the central server.

[0123] S203: The central server receives the converted trajectory data and updates the federated index.

[0124] The central server receives the incoming trajectory data, parses the footprint information, and finds the grid and interval tree corresponding to the footprint. If the root node does not contain the corresponding interval tree node information, a new interval tree is created and its root node is recorded in the root node pointer of the federated index. The server then finds the lowest internal node containing the footprint and adds a leaf node to this internal node. The leaf node records the device ID and time interval corresponding to the footprint. Once the trajectory data of all mobile devices has been processed, the federated index is complete.

[0125] Example 2: Anonymization of trajectory data location, as shown in the sample figure Figure 5 As shown, the specific steps are:

[0126] Step 1: The mobile device receives grid parameters and determines the grid division.

[0127] After receiving the grid parameters, the mobile device calculates the grid divisions in the longitude and latitude directions respectively. Figure 5 The spatial range in is divided into 4*4 grids, each grid is encoded according to the scan line type, and the grid corresponding to each point of interest in the trajectory stop point is calculated. Figure 5 The trajectory data in contains 5 stop points, a total of 5 points of interest ρ1-ρ5, corresponding to 5 squares c2, c6, c7, c 12 、c 16 .

[0128] Step 2: Traverse the trajectory data and use the spatial grid to achieve location anonymization.

[0129] The basic idea of location anonymization is to replace the precise location information with a spatial range to hide the real spatial location. Figure 5 The location of the point of interest in the trajectory stop point is replaced by the square obtained in step 1, and the time interval remains unchanged to obtain the converted trajectory. The mobile device sends the converted trajectory to the central server to build a federated index.

[0130] Example 3: Dynamic pruning algorithm, the specific steps are:

[0131] Step 1: Initialize the similarity priority queue.

[0132] For a data federation with v mobile devices, the central server initializes a priority queue L of the same length, and puts the trajectory similarity upper bound of each mobile device into L in order of size. The head of the queue L.top stores the largest similarity upper bound.

[0133] Step 2: Receive the similarity value sent by the mobile terminal.

[0134] The mobile device calculates the similarity value locally and then calculates the result Sim i It is sent to the central server. After receiving it, the central server uses the similarity value to update the corresponding similarity value in L, and dynamically adjusts the upper bound of the maximum similarity of L.top at the head of the queue to facilitate subsequent judgment on whether the query termination condition is met.

[0135] Step 3: Determine whether the dynamic pruning conditions are met.

[0136] When the received similarity value is greater than the upper bound of the maximum similarity, Sim iWhen >L.top, it indicates that the subsequent similarity value received cannot be higher than the similarity value of the currently received device, and the process goes to step 4. Otherwise, it is determined whether the similarity values of all mobile devices have been received. If so, the query is completed and the process goes to step 4. Otherwise, the process goes to step 2 to continue the query operation.

[0137] Step 4: Return the final query results.

[0138] When the query is completed, the central server sends a query end message to all mobile devices and returns the last k most similar devices to the user.

[0139] The specific process of the dynamic pruning algorithm of Example 3 can be found in Figure 6 shown.

[0140] The foregoing is merely a list of specific embodiments of the present application, intended to enable those skilled in the art to understand or implement the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the broadest scope consistent with the principles and novel features of the present application.

[0141] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

Claims

1. A trajectory similarity query method based on data federation, characterized in that: The following steps are involved: Numbering mobile devices within the data federation; Build a federated index based on a spatial grid through a central server; Based on the federated index and number, a dynamic branch reduction algorithm is used to find a preset number of mobile devices that are most similar to the query trajectory. The method uses a dynamic branch reduction algorithm based on the federated index and number to find a preset number of mobile devices that are most similar to the trajectory to be queried. The specific steps include: The central server initializes a priority queue with a similarity upper bound, whose size is the total number of mobile devices in the data federation. It is used to record the upper bound of the similarity between the data trajectory of each mobile device and the trajectory to be queried and sort them from large to small. The central server uses the federated index to calculate the upper bound of similarity of the mobile device trajectory data and adds all the upper bound values of similarity to the priority queue; Remove the devices with a similarity upper limit of 0 in the priority queue, and the remaining mobile devices calculate the similarity value with the trajectory to be queried locally. The calculation method is: in, is the similarity, is the trajectory to be queried, is the local trajectory of the mobile device, For the trajectory The A stopover point, For the trajectory Middle A stopover point, is the time spent at the stop point, There are many points of interest corresponding to the stop points. For the trajectory The The duration of stay at a stop point, For the trajectory Middle The duration of stay at a stop point, The time spent together at the same point of interest; The central server receives the similarity value sent by the mobile terminal and updates the upper similarity limit value in the priority list to the similarity value of the corresponding device. Based on the received similarity value: If the received similarity value is greater than the maximum similarity upper limit, the query is terminated and a preset number of most similar mobile devices are returned; If the received similarity value is not greater than the similarity upper bound, it is determined whether the similarity values of all mobile devices have been received. If so, the query is terminated and a preset number of most similar devices are returned. If not, the execution returns to the central server to receive the similarity value sent by the mobile terminal, and the similarity upper bound value in the priority list is updated to the similarity value of the corresponding device.

2. The trajectory similarity query method based on data federation according to claim 1, characterized in that: The specific steps of numbering the mobile devices in the data federation include: The mobile device sends registration information to the central server, and the central server numbers all mobile devices in the order in which they are received.

3. The trajectory similarity query method based on data federation according to claim 1, characterized in that: The federated index is constructed based on the spatial grid through the central server, and the specific steps include: The central server sends the spatial grid parameters to all mobile devices; After receiving the grid parameters, the mobile device anonymizes the spatial position in the trajectory data using the spatial grid and sends the anonymized trajectory information to the central server; The central server receives anonymized trajectory information and builds a time index on each square of the spatial grid to record the stay information of each device in that square.

4. The trajectory similarity query method based on data federation according to claim 3, characterized in that: The spatial grid parameters include the spatial extent of the grid and the side lengths of the cells within the grid.

5. The trajectory similarity query method based on data federation according to claim 1, characterized in that: The central server calculates the upper bound of similarity of the mobile device trajectory data using the federated index and adds all the upper bound values of similarity to the priority queue. The specific steps include: The central server maintains a list of similarity upper bound values; Traverse all the stop points in the query trajectory, calculate the grid where each stop point is located, and find the corresponding interval tree in the federated index; According to the interval information of the stay point, find all the leaf nodes that intersect with it, and update the upper limit of similarity on the corresponding device based on each leaf node. The upper limit of similarity is calculated as follows: in, For the The upper bound of similarity of mobile devices, For the stopover point, is the residence time, is the dwell time at the stop point, is a leaf node, is the residence time of the leaf node; After the traversal is completed, all similarity upper bound values in the similarity upper bound value list are added to the priority list.

6. The trajectory similarity query method based on data federation according to claim 1, characterized in that: After removing the devices with a similarity upper limit of 0 from the priority queue, the following are also included: According to the trajectory data characteristics of the mobile device, irrelevant parts of the query data are removed to improve the efficiency of similarity calculation of the mobile device.

7. The trajectory similarity query method based on data federation according to claim 4 is characterized in that: After the central server sends the spatial grid parameters to all mobile devices, it also includes: The central server initializes the root node of the federated index, which stores pointers, each pointer points to an interval tree, and The calculation method is: in, is the spatial extent of the grid, spatial extent Expressed by longitude and latitude, is the minimum value of latitude, is the maximum value of latitude, is the maximum latitude of the grid space, is the minimum latitude of the grid space, is the minimum value of longitude, is the maximum value of longitude, is the maximum longitude of the grid space, is the minimum longitude of the grid space, is the side length of a square.

8. The trajectory similarity query method based on data federation according to claim 4 is characterized in that: The mobile device receives the grid parameters and anonymizes the spatial position in the trajectory data using the grid, and the specific steps include: The mobile device receives the grid parameters and determines the grid division; Traverse all the stop points in the local trajectory data and convert them into corresponding footprint information in the grid, that is, , the conversion is as follows: in, For the stopover point, is the residence time, For stopping point Points of interest, is the spatial grid range, is the side length of a cell in the spatial grid, is the longitude, Points of interest Longitude, is the latitude, Points of interest Latitude, is the offset of the point of interest in longitude, is the latitude offset of the point of interest, is the spatial grid number, For the number The grid, The total number of mobile devices in the data federation.

9. A trajectory similarity query device based on data federation using the trajectory similarity query method based on data federation according to any one of claims 1 to 8, characterized in that: include: An execution module, configured to number mobile devices within the data federation and construct a federation index based on a spatial grid; The query module is configured to query a preset number of mobile devices that are most similar to the trajectory to be queried using a dynamic branch pruning algorithm based on the federated index constructed by the execution module.

Citation Information

Patent Citations

  • Inquiring method of best matching with fuzzy trajectory problems

    CN102567497A

  • Track similarity connection query method adopting time-first search

    CN107766406A