A trajectory accompanying relationship mining method and system based on secondary spatiotemporal index

By constructing a trajectory companion relationship mining method based on a secondary spatiotemporal index, the problems of trajectory information loss and low computational efficiency are solved, and efficient and accurate trajectory query is achieved. It is suitable for scenarios with high timeliness requirements such as public security management and epidemic prevention and control.

CN116361327BActive Publication Date: 2025-09-19XI AN JIAOTONG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310329481.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-30
Publication Date
2025-09-19
Estimated Expiration
2043-03-30

AI Technical Summary

Technical Problem

When processing massive trajectory data, existing technologies suffer from problems such as trajectory information loss, low computational efficiency, and reduced accuracy of similarity-accompanying queries. This is especially true when temporal similarity is not taken into account, resulting in low trajectory query efficiency.

Method used

A trajectory adjoint relationship mining method based on secondary spatiotemporal index is adopted. Through preprocessing, fuzzification, clustering and merging steps, a temporal and spatial index structure is constructed. The double pointer method is used to intercept sub-trajectories and cluster them using hash values. The prefix tree is combined to save the results to improve the query efficiency.

Benefits of technology

It improves the accuracy and efficiency of trajectory query, reduces memory consumption, and can quickly complete the query of accompanying trajectory pairs, meeting application scenarios with high timeliness requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116361327B_ABST
    Figure CN116361327B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for mining trajectory adjoint relationships based on a secondary spatiotemporal index. The method comprises: preprocessing trajectory data to obtain subtrajectories meaningful for adjoint query; fuzzifying the subtrajectories meaningful for adjoint query to obtain subtrajectories that improve query accuracy; clustering the fuzzified subtrajectories in time and space to obtain a clustered index structure; and merging the index items of the clustered index structure to obtain a complete adjoint result between trajectories. In the present invention, by clustering the fuzzified subtrajectories in time and space to obtain a clustered index structure, the index structure can directly obtain adjoint trajectory pairs, avoiding similarity calculations between trajectory pairs and significantly improving the efficiency of adjoint trajectory queries.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the application field of efficient query of similar adjoint pairs of spatiotemporal data, and in particular to a trajectory adjoint relationship mining method and system based on a secondary spatiotemporal index. Background Art

[0002] Massive spatial trajectory datasets contain the mobility of various moving objects. Recent techniques have mostly combined the Fréchet distance calculation method or the longest common subsequence calculation method with the LSH method. The LSH method performs a coarse classification and clustering of trajectories. However, when LSH is used to segment trajectories into several segments, trajectory information is lost, resulting in reduced accuracy in accompanying trajectory queries. Some methods also use index structures to cluster trajectories based on individual trajectory locations. However, these methods do not consider temporal similarity when constructing the trajectory index structure. The Fréchet distance calculation method also does not consider temporal similarity in its calculations, resulting in similar trajectories generated at different times than the query trajectory. While the longest common subsequence method does not have a time constraint for trajectory similarity, its computational complexity is quadratic, making it inefficient when dealing with large amounts of long trajectories. This results in inefficient computation of similar accompanying pairs, making it unsuitable for applications requiring high query efficiency. Summary of the Invention

[0003] In response to the shortcomings of the existing technology, the present invention proposes a trajectory companion relationship mining method and system based on a secondary spatiotemporal index, which can mine trajectory pairs with companion relationships as efficiently as possible and quickly complete the task tracing in scenarios with high timeliness requirements.

[0004] A trajectory accompanying relationship mining method based on a secondary spatiotemporal index includes the following steps:

[0005] Obtain trajectory data, preprocess the trajectory data, and obtain sub-trajectories with accompanying query significance;

[0006] Fuzzify the sub-trajectory with accompanying query meaning to obtain the sub-trajectory that makes the query result more accurate;

[0007] Cluster the fuzzified sub-trajectories in time and space to obtain a clustered index structure;

[0008] The index items of the clustered index structure are merged to obtain the complete adjoint results between the trajectories.

[0009] Furthermore, the trajectory data is preprocessed to obtain sub-trajectories with accompanying query significance, including the following process: reading trajectory data from a given data file, compressing the trajectory data and storing it in a memory array, dividing the trajectory data into sub-trajectories of the same length, and filtering sub-trajectories without movement features to obtain sub-trajectories with accompanying query significance.

[0010] Furthermore, the trajectory data is preprocessed to obtain sub-trajectories with accompanying query meaning, including the following steps:

[0011] S11: For the user, the trajectory data composed of the three-dimensional location points represented by time, longitude, and latitude is sorted by time information. The storage method of the trajectory data in the memory is compressed into a one-dimensional representation pos_id using a spatial index method to obtain a trajectory vector sorted by time information;

[0012] S12: For the trajectory vector obtained in step S11, an array of the same length is initialized for each user to store the trajectory data information;

[0013] S13: For arrays of the same length, use the double pointer method to set the distance l between the left and right pointers. The initial position of the left pointer starts from the first subscript 0 of the array, and the initial position of the right pointer is 0+1. The trajectory array [0, 0+1) between the left and right pointers of the array is intercepted to form a sub-trace, and the left and right pointers are moved one position to the right at the same time until all sub-trajectories are intercepted.

[0014] S14: Perform data analysis on all intercepted sub-trajectories, monitor the number of trajectory position point changes and vector movement distance in the sub-trajectory, and if the set requirements are not met, the sub-trajectory movement is judged to be abnormal and does not meet the real movement information. The sub-trajectory with abnormal movement is discarded to prevent erroneous accompanying results.

[0015] Furthermore, the method for judging abnormal sub-trajectory movement is as follows: for a sub-trajectory composed of trajectory position points arranged in sequence according to time information, the number of changes in the position point pos_id and the vector movement distance in the sub-trajectory are counted. For a trajectory that has not moved in the same area or a false movement trajectory caused by position drift of the position acquisition device, which causes spatial information to jump back and forth in multiple areas, it is judged that the sub-trajectory movement is abnormal. If the trajectory position points in the sub-trajectory meet the requirements of the number of changes, but the vector movement distance does not meet the set length, the sub-trajectory movement is judged to be abnormal.

[0016] Furthermore, the sub-trajectory with accompanying query significance is fuzzified to obtain a sub-trajectory that makes the query result more accurate, including the following steps:

[0017] For each sub-trajectory with accompanying query significance, all position points except the start and end position points are sampled and blurred evenly on the remaining l-2 trajectory position points in the sub-trajectory. The number of trajectory position points sampled each time is set to o. For each o position points sampled each time, the sampled position points are replaced with wildcards. Each sub-trajectory derives sub-trajectory obsSubTra, where l is the length of the sub-trajectory with accompanying query significance.

[0018] Furthermore, the fuzzified sub-trajectories are clustered in time and space to obtain a clustered index structure, which includes the following process:

[0019] The sub-trajectories that make the query results more accurate are clustered in time, and the trajectories with temporal accompanying relationships are clustered into the same index item to obtain the first-level temporal index structure; then the sub-trajectories with spatial accompanying relationships are clustered on the same index item of the second-level spatial index structure to obtain the index structure that clusters all trajectories.

[0020] Furthermore, the fuzzified sub-trajectories are clustered in time and space to obtain a clustered index structure, which specifically includes the following process:

[0021] S31: Divide a day into several time slots with the same time coverage. When the time slot width is slot, a day is divided into 24 time slots / slot. Use the startTime of the first position point of the sub-trajectory that is meaningful to the query and the sub-trajectory that makes the query more accurate to perform first-level clustering. Map the sub-trajectory that is meaningful to the query and the sub-trajectory that makes the query more accurate to the query to the startTime / slot time slot to obtain the first-level time index structure.

[0022] S32: For all sub-trajectories in the same time slot in the first-level time index structure, calculate the hash value of the spatial information of the sub-trajectories and use the hash value to cluster them spatially to obtain the second-level spatial index structure;

[0023] S33: Traverse all index items of the second-level spatial index structure in step S32. For each sub-trajectory subTra, fuzzify the trajectory position points in the sub-trajectory to obtain the derived sub-trajectory. Merge the trajectory ID in the index item of the second-level spatial index structure derived from each sub-trajectory into the index item of the second-level spatial index structure where the sub-trajectory subTra is located. During the merging, add an identifier ID_o to the trajectory ID in the index item of the second-level trajectory index structure where the derived sub-trajectory is located. Delete any index items in the merged index item where the number of trajectory IDs is less than 2, and obtain a clustered index structure.

[0024] The hash value calculation formula is:

[0025]

[0026] Where n is the length of subTra, and s[i] is the ASCII code of the i-th character of subTra.

[0027] Furthermore, the fuzzified sub-trajectories are clustered in time and space to obtain a clustered index structure, which includes the following steps:

[0028] S41: Each index item of the second-level spatial index structure stores a set of trajectory IDs, and extracts between a marked trajectory ID and an unmarked trajectory ID, and between two unmarked trajectory IDs in the set, to obtain trajectory pairs with accompanying relationships;

[0029] S42: For the trajectory pairs with the accompanying relationship, all the trajectory pairs with the accompanying relationship are stored in the prefix tree to obtain a clustered index structure.

[0030] Furthermore, the method of saving the trajectory pairs with accompanying relationships into the prefix tree is as follows: using the trajectory pair ID with accompanying relationships to query whether the trajectory pair already has accompanying information in the prefix tree, and judging whether the existing accompanying information and the accompanying information of the trajectory pair with accompanying relationships to be saved have any duplicate parts. If there are no duplicate parts, the trajectory pair with accompanying relationships is saved; if there are duplicate parts, they are merged to obtain the clustered index structure.

[0031] A trajectory adjoint relationship mining system based on a secondary spatiotemporal index includes:

[0032] The sub-trajectory fuzzification module is used to fuzzify the sub-trajectory with accompanying query meaning to obtain a sub-trajectory that makes the query result more accurate;

[0033] The trajectory clustering module is used to cluster the fuzzified sub-trajectories in time and space to obtain the clustered index structure;

[0034] The trajectory merging module is used to merge the index items of the index structure completed by clustering to obtain the complete accompanying results between trajectories.

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

[0036] In the present invention, the fuzzified sub-trajectories are clustered in time and space to obtain a clustered index structure, so that the index structure can directly obtain the accompanying trajectory pairs, avoiding the similarity calculation between the trajectory pairs and greatly improving the efficiency of the accompanying trajectory query.

[0037] Furthermore, for the accompanying results obtained from the index structure, the present invention observes that the trajectory ID is a mobile phone number, and uses a prefix tree data structure in combination with the characteristics of the mobile phone number to save the accompanying results, and reuses the nodes in the logarithm, which not only reduces the memory consumption of the accompanying results, but also because the query time complexity of the prefix tree is O(n), n is the depth of the prefix tree, and the depth of the prefix tree in the present invention is 6, which makes the query of the accompanying results efficient and stable.

[0038] Furthermore, the present invention constructs a two-layer trajectory index structure in time and space to cluster trajectories in a more fine-grained manner. The sub-trajectories intercepted by the double-pointer method solve the problem of trajectory information loss in the existing methods when constructing the index structure. The sub-trajectory fuzzification method is used to BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 Schematic diagram of the structure of a trajectory adjoint relationship mining system based on a secondary spatiotemporal index provided by an embodiment of the present invention.

[0040] Figure 2 This is a flow chart of a trajectory accompanying relationship mining method based on a secondary spatiotemporal index provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0041] The following describes the technical solutions in the embodiments of the present invention in detail in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0042] See also Figure 2 ,A trajectory accompanying relationship mining method based on secondary spatiotemporal index, comprising the following steps:

[0043] 1) Trajectory data preprocessing:

[0044] Read trajectory data from a file storing user movement data information, compress the trajectory data and save it in a memory array, divide the trajectory data into sub-trajectories of the same length, filter out sub-trajectories without movement features, and obtain sub-trajectories with accompanying query significance;

[0045] Specifically, the specific implementation method of the trajectory data preprocessing module is:

[0046] S11: For users, the trajectory data composed of location points represented by three dimensions of time (time), longitude (lon), and latitude (lat) are sorted by time information. The storage method of the trajectory data in memory is compressed. For the spatial information represented by two dimensions of (lon, lat), it is compressed into a one-dimensional representation pos_id using the spatial index method, and each location point is represented as (time, pos_id). Therefore, each trajectory is compressed in memory into a trajectory vector composed of two-dimensional location points (time, pos_id) sorted by time information.

[0047] The spatial indexing method is: divide the map range into several squares of equal area and assign an integer ID to each square. For each longitude and latitude, it will be mapped to the corresponding square, and the representation of this longitude and latitude is the ID of the square.

[0048] S12: For each user's trajectory vector, an array of the same length is initialized to store the trajectory data. The array length, Len, depends on the frequency θ of the trajectory location point acquisition. If θ = 5 minutes, the location acquisition device collects location information for the user every 5 minutes. Since there are 24*60 minutes in a day, the array length is 24*60 / 5 = 288. The array stores the one-dimensional representation of the spatial information of the trajectory location point, pos_id. The position of the trajectory location point in the array stores the time of the trajectory location point, time. The array subscript subS represents the time information as subS*θ.

[0049] S13: For arrays of the same length, use the double pointer method to set the distance l between the left and right pointers. The initial position of the left pointer starts from the first subscript of the array, i.e. 0, so the initial position of the right pointer is 0+1. The trajectory array [0, 0+1) between the left and right pointers of the array is intercepted to form a sub-trajectory, and the left and right pointers are simultaneously moved one position to the right until all sub-trajectories are intercepted.

[0050] S14: Perform data analysis on all intercepted sub-trajectories, monitor the number of trajectory position point changes and vector movement distance in the sub-trajectory, and if the set requirements are not met, the sub-trajectory movement is judged to be abnormal and does not meet the real movement information. The sub-trajectory with abnormal movement is discarded to prevent erroneous accompanying results.

[0051] In step S14, the method for determining abnormal sub-trajectory movement is as follows: for a sub-trajectory composed of trajectory position points sequentially according to time information subS*θ, the number of changes in the position point pos_id and the vector movement distance in the sub-trajectory are counted. Trajectories that have not moved in the same area or false movement trajectories caused by position drift of the position acquisition device, resulting in spatial information jumping back and forth in multiple areas, are determined to be abnormal sub-trajectory movement. At the same time, if the trajectory position points in the sub-trajectory meet the requirement of the number of changes, but the vector movement distance does not meet the set length, the sub-trajectory movement is still determined to be abnormal.

[0052] 2) Fuzzy sub-trajectory:

[0053] Fuzzifying sub-trajectory information. Because position acquisition devices can drift when collecting location data, they can collect erroneous location information, making it impossible to calculate the associated results for the originally associated sub-trajectories. Therefore, using a position point fuzzification operation to process the sub-trajectories, we restore the associated results between the sub-trajectories and obtain sub-trajectories that provide more accurate query results.

[0054] Specifically, for each sub-trajectory with a length of l obtained by the trajectory preprocessing module, all position points except the start and end position points are uniformly sampled and blurred on the remaining l-2 trajectory position points in the sub-trajectory, and the number of trajectory position points sampled each time is set to o. For each sampling of o position points, the extracted position points are replaced with wildcards, that is, each sub-trajectory can be derived Sub-trajectory obsSubTra.

[0055] 3) Clustering trajectory:

[0056] The fuzzified sub-trajectories are clustered in time and space to obtain a clustered index structure. First, a first-level temporal index structure is constructed to cluster the trajectories in time, clustering trajectories with temporal associations into the same index item. Then, based on the first-level temporal index structure, a second-level spatial index structure is constructed for trajectories within the same time range. Sub-trajectories with spatial associations are clustered into the same index item in the second-level spatial index structure, resulting in an index structure that clusters all trajectories.

[0057] For each sub-trajectory, the temporal and spatial accompanying information between sub-trajectories are calculated in time and space, and a secondary index structure is constructed. The accompanying relationship between sub-trajectories is used to cluster the sub-trajectories with accompanying relationships together. The specific clustering process includes:

[0058] S31: First, construct the first-level temporal index structure: divide a day into several time slots with equal coverage. When the time slot width is slot, a day is divided into 24 time slots / slot. First-level clustering is performed using the startTime time information of the first location of sub-trajectories that are relevant to the query and that contribute to more accurate query results. These sub-trajectories that are relevant to the query and that contribute to more accurate query results are mapped to the startTime / slot time slot.

[0059] S32: Construct the second-level spatial index structure: For all sub-trajectories in the same time slot, calculate the hash value for the spatial information of the sub-trajectory and use the calculated hash value to cluster them in space. Since the sub-trajectory is represented as a string (subTra) composed of position points in sequence, the hash value of the sub-trajectory is calculated using the hash method, and the sub-trajectory is clustered according to the hash value. The specific hash value calculation formula is:

[0060]

[0061] Where n is the length of subTra, and s[i] is the ASCII code of the i-th character of subTra.

[0062] After the second-level spatial index structure is constructed, for the complete trajectory index structure with a two-level index, all trajectories in each second-level spatial index item have a temporal and spatial adjacency relationship. The temporal adjacency relationship is determined by the time slot in the first-level temporal index structure and the length of the sub-trajectory in the second-level spatial index structure. The length of the sub-trajectory is a hyperparameter determined by the distance l between the left and right pointers. At the i-th time slot, the temporal adjacency information between the sub-trajectories is (i*slot, i*slot+l*θ).

[0063] S33: Traverse all index items of the second-level spatial index structure in step S32, and for each sub-trajectory subTra, fuzzify the trajectory position points in the sub-trajectory to obtain The derived sub-trajectories Merge the trajectory IDs of the subtrajectory derived from each subtrajectory into the second-level spatial index structure's index entry for subTra. During the merge, add an identifier, ID_o, to the trajectory ID (phone number) in the second-level spatial index structure's index entry for the derived subtrajectory, indicating that the trajectory ID is derived from the derived subtrajectory index entry. Delete any index entries with fewer than two trajectory IDs in the merged index entry, resulting in a clustered index structure.

[0064] 4) Merge tracks:

[0065] The index items of the clustered index structure are merged to obtain the complete accompanying results between the trajectories and achieve positioning. The specific process includes the following steps:

[0066] S41: For the index structure completed by the clustering, a set of trajectory IDs is stored in the index item of each second-level spatial index structure. The trajectory IDs in the set are divided into two categories: the trajectory ID set in the original sub-trajectory subTra index item and the trajectory ID set in the derived sub-trajectory obsSubTra index item. The trajectory ID set is merged into the trajectory ID set of the index item where the original sub-trajectory is located. The marked trajectory ID_o. When the set is (id1, id2, idO_1, idO_2), in order to make the number of correct position points between the obtained sub-trajectories with accompanying relationships greater than lo, the trajectory pairs with accompanying relationships are extracted between the marked mobile phone numbers and the unmarked mobile phone numbers in the set, and between two unmarked mobile phone numbers, namely (id1, id2), (id1, idO_1), (id1, idO_2), (id2, idO_1), (id2, idO_2). For the mobile phone numbers without marks, it is considered that the number of position point errors between the trajectory pairs represented by their mobile phone numbers is higher than the o position points sampled each time, such as (idO_1, idO_2).

[0067] S42: For the trajectory pairs with accompanying relationships obtained in step S41, all the trajectory pairs with accompanying relationships are stored in a prefix tree.

[0068] According to the composition characteristics of mobile phone numbers, the first three digits carry the operator information, the next four digits represent the geographical information of the mobile phone number, and the last four digits are composed of random and irregular numbers. Therefore, a prefix tree with a depth of 6 is constructed, and all the layers of the root node are set to the first layer, and the layer where the leaf node is located is the sixth layer. The first layer of the prefix tree contains the first three digits of the mobile phone number, that is, the operator to which the mobile phone number belongs. The second layer contains the next four digits of the mobile phone number, that is, the geographical information described by the mobile phone number. Each of the next four layers identifies the remaining four digits of the mobile phone number. Therefore, the path from the root node of the prefix to each leaf node constitutes a mobile phone number, and the leaf node stores the accompanying trajectory information of the trajectory represented by the mobile phone number, mainly including the accompanying time period and accompanying spatial information between the trajectory pairs.

[0069] The method of saving a trajectory pair with a companion relationship to a prefix tree is as follows: first, the trajectory pair ID with a companion relationship, i.e., the mobile phone number, is used to query the prefix tree to see if the trajectory pair already has accompanying information. Since the prefix tree stores the trajectory pair with accompanying information in a unidirectional manner, when inserting a trajectory pair with a companion relationship, both mobile phone numbers in the trajectory pair with the companion relationship are queried to determine whether the existing accompanying information and the accompanying information in the trajectory pair with the companion relationship to be saved have duplicate parts. If there are no duplicate parts, the trajectory pair with the companion relationship is saved; if there are duplicate parts, it is merged to obtain a complete accompanying knot between the trajectories. The specific process of merging is as follows: the accompanying information stored in the leaf node of the prefix tree includes the accompanying time period and the accompanying trajectory of the trajectory pair. For the trajectory pair in step S41, the accompanying start time s_t of the trajectory pair can be determined according to the time slot in the first-level time index structure of the index structure, and the accompanying end time e_t of the trajectory pair can be determined according to the number of position points in the sub-trajectory and the sampling frequency of the position points, to obtain the accompanying time period (s_t, e_t) of the trajectory pair. It is determined whether the time period has an intersection with the time period stored in the leaf node. If there is an intersection, the minimum and maximum values ​​of the time period are taken to form a new accompanying time period, and the extra trajectory segments are intercepted and added to the original accompanying trajectory, and the results are saved in the prefix tree.

[0070] See also Figure 1 , a trajectory adjoint relationship mining system based on secondary spatiotemporal indexing of the present invention includes a trajectory data preprocessing module, a sub-trajectory fuzzification module, a trajectory clustering module and a trajectory merging module;

[0071] A trajectory accompanying relationship mining system based on a secondary spatiotemporal index, characterized by comprising:

[0072] The sub-trajectory fuzzification module is used to fuzzify the sub-trajectory with accompanying query meaning to obtain a sub-trajectory that makes the query result more accurate;

[0073] The trajectory clustering module is used to cluster the fuzzified sub-trajectories in time and space to obtain the clustered index structure;

[0074] The trajectory merging module is used to merge the index items of the index structure completed by clustering to obtain the complete accompanying results between trajectories.

[0075] The present invention proposes a trajectory accompanying relationship mining method and system based on a secondary spatiotemporal index, which mines trajectory pairs with accompanying relationships as efficiently as possible. In scenarios with high timeliness requirements such as public security management and epidemic prevention and control, it can quickly complete the task tracing.

[0076] Simulation example:

[0077] To verify the effectiveness of the proposed method, we simulated user companionship in various real-world scenarios. We constructed an index structure for a dataset containing 45 million trajectories in Province XX on that day, clustered the trajectories, and then queried the companionship results to verify the effectiveness of the proposed method. We used multiple testers who traveled together using various modes of transportation between October 20, 2022, and November 20, 2022, to form a companion trajectory pair. The test results were measured using coverage, which is defined as:

[0078]

[0079] Where findCount is the number of companion trajectory pairs found from the companion results, and existCount is the number of companion trajectory pairs known to exist in the simulation.

[0080] Table 1 Trajectory accompanying validity experiment of range sampling method

[0081]

[0082]

[0083] The experimental results are shown in Table 1. The results show that the index term fuzzification method achieves over 85% coverage in accompanying trajectory query results for different travel modes. To verify the accuracy of the query results, the accompanying trajectory data of the queried accompanying pairs was analyzed. The results show that the movement paths of the user trajectory pairs all start from Chenjiazhuang Community in Xi'an and travel along Keji Road, Jixiang Road, Xiaozhai West Road, and Chang'an Middle Road to reach the destination Xiaozhai. The analysis results indicate that there is indeed an accompanying relationship between the user trajectory pairs.

[0084] We analyzed trajectory pair data with low accompanying result coverage. When trajectory pairs with accompanying relationships existed during simulation but no accompanying results were found in the accompanying results, we analyzed the reasons why these trajectory pairs did not receive accompanying results. The actual movement paths of the user trajectory pairs all started from the Yan'an Affiliated Hospitals (large and small) in Yan'an City, and traveled along Hebei Road, Gaoxin Avenue, National Highway 520, and Dangguo Road to the destination, Yan'an Bus Station. However, due to errors in the collected trajectory data and the switching of multiple base station signals during location collection, the trajectory data contained multiple erroneous locations, making it impossible to conclude from the trajectory information that there was an accompanying relationship between the trajectories. The data of one trajectory in the trajectory pair shows that the path is along Hebei Road, Gaoxin Avenue, Yanhebei Road, National Highway 520, Dangguo Road, National Highway 520, Dangguo Road, and finally arrives at the destination Yan'an Bus Station. Compared with the actual movement path, it is quite different. From the perspective of trajectory information, it is impossible to conclude that there is a companion relationship between the trajectories. Therefore, the index structure fails to query the companion result, which shows the effectiveness of the index item fuzzification method of the present invention. For trajectories with companion relationships in trajectory data, the method of the present invention can derive companion result relationships. For such cases where trajectories have no companions due to acquisition errors, the trajectory data can be preprocessed before clustering, and such trajectories that drift between multiple base stations can be corrected to further improve the coverage of the companion results.

[0085] In terms of efficiency, for 45,560,248 trajectories of length 1,440, the proposed method took 7.92 hours to obtain all accompanying trajectory pairs and obtain accompanying results. For accompanying result queries, the proposed method's result query time is less than 1 second, meeting the time-sensitive application scenario of accompanying trajectory query.

[0086] The present invention constructs a two-layer trajectory index structure in time and space to perform more fine-grained clustering of trajectories. The sub-trajectories intercepted by the present invention based on the dual-pointer method solve the problem of trajectory information loss when constructing the index structure in existing methods. The sub-trajectory fuzzification method is used to enable the index structure to directly obtain the accompanying trajectory pairs, avoiding the similarity calculation between the trajectory pairs and greatly improving the efficiency of the accompanying trajectory query. At the same time, for the accompanying results obtained by the index structure, the present invention observes that the trajectory ID is a mobile phone number. Combined with the characteristics of the mobile phone number, the accompanying results are stored using a prefix tree data structure, and the nodes in the logarithm are reused. This not only reduces the memory consumption of the accompanying results, but also makes the query of the accompanying results efficient and stable because the query time complexity of the prefix tree is O(n), where n is the depth of the prefix tree. The prefix tree depth in the present invention is 6.

Claims

1. A trajectory accompanying relationship mining method based on secondary spatiotemporal index, characterized by: The following steps are involved: Obtain trajectory data, preprocess the trajectory data, and obtain sub-trajectories with accompanying query significance; Fuzzify the sub-trajectory with accompanying query meaning to obtain the sub-trajectory that makes the query result more accurate; Cluster the fuzzified sub-trajectories in time and space to obtain a clustered index structure; Merge the index items of the clustered index structure to obtain the complete adjoint results between the trajectories; The trajectory data is preprocessed to obtain sub-trajectories with accompanying query significance, including the following steps: reading trajectory data from a given data file, compressing the trajectory data and storing it in a memory array, dividing the trajectory data into sub-trajectories of the same length, filtering sub-trajectories without movement features, and obtaining sub-trajectories with accompanying query significance; Fuzzifying the sub-trajectory with accompanying query meaning to obtain a sub-trajectory that makes the query result more accurate includes the following steps: For each sub-track with query meaning, for all the position points except the start and end position points, the remaining l -2 trajectory position points are sampled and blurred, and the number of trajectory position points sampled each time is set to o, For each sampling o Position points are extracted and replaced with wildcards. Each sub-trajectory is derived Strip track obsSubTra ;in, l is the length of the sub-trajectory with accompanying query meaning; The fuzzified sub-trajectories are clustered in time and space to obtain a clustered index structure. The specific process includes the following: S31: Divide a day into several time slots with the same time coverage. When the time slot width is slot Hours, a day is divided into 24 / slot time slots, using the time information of the first position point of the sub-trajectory that has the meaning of accompanying the query and the sub-trajectory that makes the query result more accurate startTime Perform the first level of clustering and map the sub-trajectories that have the meaning of accompanying the query and the sub-trajectories that make the query results more accurate to the first level. startTime / slot In the time slots, the first-level time index structure is obtained; S32: For all sub-trajectories in the same time slot in the first-level time index structure, calculate the hash value of the spatial information of the sub-trajectories and use the hash value to cluster them spatially to obtain the second-level spatial index structure; S33: Traverse all index items of the second-level spatial index structure in step S32, and for each sub-track subTra After fuzzifying the trajectory position points in the sub-trajectory, the derived sub-trajectory is obtained; the trajectory ID in the index item in the second-level spatial index structure of each sub-trajectory derived from the sub-trajectory is merged into the sub-trajectory subTra In the index item of the second-level spatial index structure, when merging, add an identifier ID_o to the trajectory ID in the index item of the second-level trajectory index structure where the derived sub-trajectory is located; delete the index items with less than 2 trajectory IDs in the merged index items to obtain the clustered index structure; The hash value calculation formula is: in n for subTra The length of , s[i] is subTra The ASCII code of the i-th character.

2. The method for mining trajectory accompanying relationships based on secondary spatiotemporal indexing according to claim 1, characterized in that: Preprocess the trajectory data to obtain sub-trajectories with accompanying query meaning. The following processes are included: S11: For users, by time time ,longitude lon ,latitude lat The trajectory data is composed of three-dimensional position points sorted by time information, and the storage method of trajectory data in memory is compressed into a one-dimensional representation using a spatial index method. pos_ id , get the trajectory vector sorted by time information; S12: For the trajectory vector obtained in step S11, an array of the same length is initialized for each user to store the trajectory data information; S13: For arrays of the same length, use the double pointer method to set the distance between the left and right pointers l The initial position of the left pointer starts from the first subscript of the array 0 At the beginning, the initial position of the right pointer is 0 + l , intercept the trajectory array between the left and right pointers of the array [ 0,0+l ) forms a sub-track, and the left and right pointers move one position to the right at the same time until all sub-tracks are intercepted; S14: Perform data analysis on all intercepted sub-trajectories, monitor the number of trajectory position point changes and vector movement distance in the sub-trajectory, and if the set requirements are not met, the sub-trajectory movement is judged to be abnormal and does not meet the real movement information. The sub-trajectory with abnormal movement is discarded to prevent erroneous accompanying results.

3. The method for mining trajectory accompanying relationships based on secondary spatiotemporal indexing according to claim 2, characterized in that: The method for judging abnormal movement of sub-trajectory is as follows: for the sub-trajectory composed of trajectory position points in time sequence, the position points in the sub-trajectory are counted. pos_id The number of changes and vector movement distance of the sub-trajectory are used to determine the sub-trajectory movement abnormality. For a trajectory that has not moved in the same area or a false movement trajectory caused by the position acquisition device drifting, which causes the spatial information to jump back and forth in multiple areas, it is determined to be a sub-trajectory movement abnormality. If the trajectory position point in the sub-trajectory meets the number of changes requirements but the vector movement distance does not meet the set length, the sub-trajectory movement is determined to be abnormal.

4. The method for mining trajectory accompanying relationships based on secondary spatiotemporal indexing according to claim 1, characterized in that: The fuzzified sub-trajectories are clustered in time and space to obtain the clustered index structure, which includes the following process: The sub-trajectories that make the query results more accurate are clustered in time, and the trajectories with temporal accompanying relationships are clustered into the same index item to obtain the first-level temporal index structure; then the sub-trajectories with spatial accompanying relationships are clustered on the same index item of the second-level spatial index structure to obtain the index structure that clusters all trajectories.

5. The method for mining trajectory accompanying relationships based on secondary spatiotemporal indexing according to claim 1, characterized in that: Clustering the fuzzified sub-trajectories in time and space to obtain a clustered index structure includes the following steps: S41: Each index item of the second-level spatial index structure stores a set of trajectory IDs, and extracts between a marked trajectory ID and an unmarked trajectory ID, and between two unmarked trajectory IDs in the set, to obtain trajectory pairs with accompanying relationships; S42: For the trajectory pairs with the accompanying relationship, all the trajectory pairs with the accompanying relationship are stored in the prefix tree to obtain a clustered index structure.

6. The method for mining trajectory accompanying relationships based on secondary spatiotemporal indexing according to claim 5, characterized in that: The method of saving trajectory pairs with accompanying relationships into the prefix tree is as follows: using the trajectory pair ID with accompanying relationships to query whether the trajectory pair already has accompanying information in the prefix tree, and judging whether the existing accompanying information has any duplicate parts with the accompanying information of the trajectory pair with accompanying relationships to be saved. If there are no duplicate parts, the trajectory pair with accompanying relationships will be saved; if there are duplicate parts, they will be merged to obtain the index structure with clustering completed.

7. A trajectory accompanying relationship mining system based on secondary spatiotemporal index, characterized by: include: The sub-trajectory fuzzification module is used to fuzzify the sub-trajectory with accompanying query meaning to obtain a sub-trajectory that makes the query result more accurate; The trajectory clustering module is used to cluster the fuzzified sub-trajectories in time and space to obtain the clustered index structure; The trajectory merging module is used to merge the index items of the index structure completed by clustering to obtain the complete adjacency results between trajectories; Fuzzifying the sub-trajectory with accompanying query meaning to obtain a sub-trajectory that makes the query result more accurate includes the following steps: For each sub-track with query meaning, for all the position points except the start and end position points, the remaining l -2 trajectory position points are sampled and blurred, and the number of trajectory position points sampled each time is set to o, For each sampling o Position points are extracted and replaced with wildcards. Each sub-trajectory is derived Strip track obsSubTra ;in, l is the length of the sub-trajectory with accompanying query meaning; The fuzzified sub-trajectories are clustered in time and space to obtain a clustered index structure. The specific process includes the following: S31: Divide a day into several time slots with the same time coverage. When the time slot width is slot Hours, a day is divided into 24 / slot time slots, using the time information of the first position point of the sub-trajectory that has the meaning of accompanying the query and the sub-trajectory that makes the query result more accurate startTime Perform the first level of clustering and map the sub-trajectories that have the meaning of accompanying the query and the sub-trajectories that make the query results more accurate to the first level. startTime / slot In the time slots, the first-level time index structure is obtained; S32: For all sub-trajectories in the same time slot in the first-level time index structure, calculate the hash value of the spatial information of the sub-trajectories and use the hash value to cluster them spatially to obtain the second-level spatial index structure; S33: Traverse all index items of the second-level spatial index structure in step S32, and for each sub-track subTra After fuzzifying the trajectory position points in the sub-trajectory, the derived sub-trajectory is obtained; the trajectory ID in the index item in the second-level spatial index structure of each sub-trajectory derived from the sub-trajectory is merged into the sub-trajectory subTra In the index item of the second-level spatial index structure, when merging, add an identifier ID_o to the trajectory ID in the index item of the second-level trajectory index structure where the derived sub-trajectory is located; delete the index items with less than 2 trajectory IDs in the merged index items to obtain the clustered index structure; The hash value calculation formula is: in n for subTra The length of , s[i] is subTra The ASCII code of the i-th character.

Citation Information

Patent Citations

  • Road network-based spatio-temporal trajectory clustering method

    CN106383868A

  • Whole-network accompanying method based on space-time grid data compression

    CN115712782A