A distributed semantic trajectory similarity join method
By optimizing distributed semantic trajectory similarity connections through global indexing and pruning algorithms, the problems of similarity function selection and complex index structure are solved, achieving efficient trajectory similarity judgment and connection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- DALIAN MARITIME UNIVERSITY
- Filing Date
- 2022-11-16
- Publication Date
- 2026-06-05
AI Technical Summary
In existing distributed environments, semantic trajectory similarity connection methods face difficulties in selecting similarity functions and have complex index structure designs. They are particularly inefficient when connecting segmented trajectories, making it difficult to effectively determine the similarity of the entire trajectory.
A global indexing method is adopted, which combines text, time and spatial dimensions to locate trajectories. Trajectory pairs that do not meet the similarity threshold are quickly removed by pruning algorithm. A distributed multi-level index structure is designed, and spatial partitioning is performed using R tree variants and time slicing technology. Inverted index and local index are constructed to optimize trajectory similarity calculation.
It improves the efficiency and scalability of semantic trajectory similarity connections in distributed environments, significantly outperforming baseline methods, reducing computational latency and resource consumption, and improving connection accuracy.
Smart Images

Figure CN116050421B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of trajectory big data analysis and relates to a distributed semantic trajectory similarity connection method. Background Technology
[0002] Many existing studies focus on defining semantic trajectory similarity metrics, primarily including textual relevance and spatial relevance, such as STSJoin and Strain-Join. However, some research on semantic trajectory pattern mining suggests that adding the measurement and judgment of temporal proximity, in addition to measuring spatial or textual relevance, can enable more granular user (or object of interest) identification and classification. More importantly, to our knowledge, previous studies have not investigated how to perform semantic trajectory similarity connections in a distributed environment.
[0003] The main challenges of semantic trajectory similarity joins in existing distributed environments are as follows: **Similarity function selection:** The similarity function plays a crucial role in semantic trajectory similarity joins because it defines the semantics of the join and significantly influences subsequent indexing and join methods. An attractive idea for finding similar semantic trajectory pairs is to consider the time of semantic occurrence. Therefore, in addition to spatial and textual factors, we need to incorporate temporal metrics into the similarity function. **Index structure design:** Compared to index structures based on the overall semantic trajectory, the main difficulty of segment-based index structures lies in the storage of semantic trajectories. That is, when the entire semantic trajectory is stored in multiple partitions, we must consider not only their spatial proximity but also the trajectories they belong to and how to "touch" the entire trajectory through segment information. **Distributed join efficiency:** Joining trajectories through segments is expensive because trajectory similarity is usually influenced by multiple points. Therefore, when we find segments, we need to find more points to determine the similarity of the entire trajectory. Summary of the Invention
[0004] To address the above problems, the present invention provides the following technical solution: a distributed semantic trajectory similarity connection method, characterized by comprising the following steps:
[0005] Establish a global index for locating semantically similar trajectories in two datasets from textual, temporal, and spatial dimensions;
[0006] Based on the given similarity threshold and the similarity weight values of each dimension, the trimming boundaries for text similarity, temporal similarity and spatial similarity are selected;
[0007] The global indexing process is pruned, and trajectories that lack common text items, have a lower bound on time distance greater than the time boundary, or have a spatial distance greater than the spatial boundary are pruned in batches.
[0008] For the local index space node pairs after batch trimming, the trajectory pairs are trimmed again based on the trajectory summary;
[0009] For the candidate trajectory pairs after further trimming, reconstruct all trajectories and calculate the exact similarity between trajectories to obtain trajectory pairs that satisfy the similarity threshold constraint.
[0010] Furthermore: the process of establishing a global index for locating semantically similar trajectories in two datasets from the textual, temporal, and spatial dimensions is as follows:
[0011] Read two trajectory datasets and build inverted indexes for each, then create an inverted trajectory list for each text item.
[0012] A set of samples is randomly selected from the trajectory list and stored in memory. The time slicing technique is used to divide the samples in memory into time periods of equal size.
[0013] The trajectory segmentation algorithm extracts trajectory segments from the semantic trajectory and spatially partitions the trajectory segments according to the centroid of the smallest parallel rectangle of the trajectory segments.
[0014] In each spatial partition, an R-tree variant is built as a local index, and each internal node in the tree contains a set of trajectory IDs for all segments contained in its subtree;
[0015] The cluster master node will collect statistics from each spatial partition to build a global index.
[0016] Furthermore, the process of pruning the global indexing process, specifically the batch pruning of trajectory pairs that do not lack common text items, have a lower bound on time distance greater than the time boundary, and have a spatial distance greater than the spatial boundary, is as follows:
[0017] Given trajectory sets P and Q and a similarity threshold θ, any trajectory pair <T,tr> that satisfies Sim(T,tr)<θ can be effectively pruned.
[0018] In the inverted trajectory list stage, the batch modification of the text dimension involves selecting partitions with common terms to join, and batch pruning trajectory pairs that do not share any terms, according to Definition 6.
[0019] The batch modification of the time dimension occurs during the time slice stage. A lower limit between time slices is proposed, denoted by TS_LB. If TS_LB is less than... in If the global temporal similarity threshold is used, then the semantic trajectories contained in the two time slices must be different.
[0020] The spatial dimension batch modification occurs during the spatial partitioning stage. Given two spatial partitions, identified by R and S, and a spatial distance threshold ε, a distributed index is used to prune long-distance trajectory pairs. Any partition pair that satisfies sd(R,S)>ε is effectively pruned.
[0021] Furthermore: the batch-pruned local index space node pairs are further pruned based on the trajectory summary, using a text summary upper limit (TS). UB ;
[0022] if Therefore, the two trajectories must be dissimilar;
[0023] if The two trajectories are then output as candidate trajectory pairs.
[0024] Furthermore, the specific process for selecting the trimming boundary is as follows:
[0025] Based on Equations 1 and 2, the lower limits of text similarity and time similarity between trajectories T and tr are calculated respectively. The expressions for Equations 1 and 2 are as follows:
[0026]
[0027]
[0028] in and It is the global lower bound of the temporal and textual similarity of all qualified trajectory pairs, and UB represents the global upper bound of the similarity of the measurement space;
[0029] Since all similarities are normalized to the range [0,1],
[0030] According to equation 3 and have
[0031]
[0032] in: It is the global lower bound of spatial similarity;
[0033] Therefore, when the user sets λ1 and θ, if λ1 + λ2 < θ ≤ 1, let The expression for equation 3 is as follows.
[0034]
[0035] Furthermore, the formula for the lower limit TS_LB of the time slice is as follows:
[0036]
[0037] Theorem 1: If Then time slice ts i and ts j The semantic trajectories they contain must be different;
[0038] Proof: Assume Time slice ts i and ts j The semantic trajectories contained are similar, for trajectories T and tr,
[0039] so Equation (6) above contradicts the assumption.
[0040] Furthermore: the upper limit of the text summary TS UB The formula is as follows:
[0041]
[0042] Theorem 2: Given two semantic trajectories And tr and a spatial distance threshold ε, if a fragment exists Make So there is
[0043] Proof: For the trajectory and will be with at least one fragment Match, if it exists Make Equations (8) and (9) are given below.
[0044]
[0045]
[0046] Furthermore, the process of pruning trajectory pairs in the local index space node pairs is as follows:
[0047] An approximate upper limit for text, Aub, is defined. TE If Aub TE Less than Therefore, the two trajectories must be dissimilar;
[0048]
[0049] in: TS tr A summary of the text representing tr;
[0050] Lemma 1: Given a semantic trajectory and tr; if but It must not be similar to tr;
[0051] Proof: Assume and Similar to tr, according to I(o i The definition of ·χ,tr), I(o i ·χ,tr) UE ≥(o i ·χ,tr), therefore, This contradicts the assumption.
[0052] Lemma 2: Given any two semantic trajectories And tr, there is equation 10,
[0053]
[0054] Proof: Assume td(o i ,tr)=|o i ·t,o′.t|,where o′ is the sampling point in tr that is closest to o in time. i The sampling points, according to By definition, for point o', we have:
[0055]
[0056] Therefore, there is
[0057] By substituting Equation 10 into Equation 2, the upper bound of time similarity is estimated. as follows:
[0058]
[0059]
[0060] Based on the above equation, we calculate half of the exact temporal similarity to obtain the upper limit. Then directly trim a pair of trajectories;
[0061] Based on equations 1 and 2, the following is obtained: and The formula is as follows.
[0062]
[0063]
[0064] This invention provides a novel distributed semantic trajectory similarity connection method that combines text similarity, temporal similarity, and spatial similarity into a semantic trajectory similarity metric. It designs a distributed multi-level index structure and combines a pruning algorithm to quickly prune unqualified trajectory pairs, rather than directly indexing all trajectory pairs.
[0065] The method of this invention comprises the following five processes: First, inverted list construction is performed, creating an inverted trajectory list for each term. The list consists of one or more complete semantic trajectories, and the trajectories within the list share at least one term. Second, time slicing is performed. In this stage, a set of random samples is first extracted from the trajectory group. Then, time-slicing technology is used to divide the samples in memory to a level where all sub-segments have the same data size, and the time boundary of each sub-segment is output. Next, spatial partitioning is performed. In this stage, trajectory segments are extracted from the semantic trajectories based on the trajectory segmentation algorithm, and these segments are partitioned according to the centroids of their MBRs. Then, local indexing is performed, and an R-tree variant is built as a local index in each spatial partition. Finally, global indexing is performed, and the master node collects statistical information from each partition to build a global index.
[0066] This paper proposes a semantic trajectory similarity connection framework based on distributed indexing. The indexing method utilizes trajectory-based and segmentation-based approaches, and various pruning techniques are designed accordingly. The challenges of instantiating this framework in Apache Spark are investigated. Extensive experimental studies on real-world semantic trajectory sets demonstrate that this proposed method significantly outperforms baselines in terms of efficiency and scalability. Attached Figure Description
[0067] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0068] Figure 1 This is a flowchart of a method for implementing distributed semantic trajectory similarity connections;
[0069] Figure 2 It is an index construction graph that implements distributed semantic trajectory similarity connections;
[0070] Figure 3 (a) is a comparison chart of join methods in terms of join latency, (b) is a comparison chart of join methods in terms of selectivity, (c) is a comparison chart of join methods in terms of indexing time, and (d) is a comparison chart of join methods in terms of index size.
[0071] Figure 4 (a) is a comparison of the join method and the baseline method in terms of join latency; (b) is a comparison of the join method and the baseline method in terms of selectivity; (c) is a comparison of the join method and the baseline method in terms of indexing time; and (d) is a comparison of the join method and the baseline method in terms of index size.
[0072] Figure 5 (a) Scalability relative to data size: Connection latency graph; (b) Scalability relative to data size: Selectivity graph; (c) Scalability relative to data size: Index time graph; (d) Scalability relative to data size: Index size graph.
[0073] Figure 6 (a) is a comparison of scalability relative to cluster size: connection latency graph; (b) is a comparison of scalability relative to cluster size: indexing time graph.
[0074] Figure 7 (a) is a graph showing the effect of threshold θ on the connection delay of the connection method and the baseline method; (b) is a graph showing the effect of threshold θ on the selectivity of the connection method and the baseline method.
[0075] Figure 8 (a) is a graph showing the effect of weight value λ1 on the connection delay of the connection method and the baseline method; (b) is a graph showing the effect of weight value λ1 on the selectivity of the connection method and the baseline method.
[0076] Figure 9 (a) is a graph showing the effect of weight value λ2 on the connection delay of the connection method and the baseline method, and (b) is a graph showing the effect of weight value λ2 on the selectivity of the connection method and the baseline method. Detailed Implementation
[0077] It should be noted that, unless otherwise specified, the embodiments and features in the embodiments of the present invention can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and embodiments.
[0078] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit the present invention or its application or use. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0079] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.
[0080] Unless otherwise specifically stated, the relative arrangement, numerical expressions, and values of the components and steps described in these embodiments do not limit the scope of the invention. It should also be understood that, for ease of description, the dimensions of the various parts shown in the drawings are not drawn to actual scale. Techniques, methods, and devices known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and devices should be considered part of the specification. In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not as limitations. Therefore, other examples of exemplary embodiments may have different values. It should be noted that similar reference numerals and letters in the following figures denote similar items; therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0081] In the description of this invention, it should be understood that the orientation or positional relationship indicated by directional terms such as "front, back, up, down, left, right", "horizontal, vertical, horizontal" and "top, bottom" is generally based on the orientation or positional relationship shown in the accompanying drawings, and is only for the convenience of describing this invention and simplifying the description. Unless otherwise stated, these directional terms do not indicate or imply that the device or element referred to must have a specific orientation or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation on the scope of protection of this invention. The directional terms "inner" and "outer" refer to the inner and outer contours relative to the outline of each component itself.
[0082] For ease of description, spatial relative terms such as "above," "over," "on the upper surface of," "above," etc., are used herein to describe the spatial positional relationship of a device or feature as shown in the figures to other devices or features. It should be understood that spatial relative terms are intended to encompass different orientations in use or operation besides the orientation of the device as described in the figures. For example, if the device in the figures is inverted, a device described as "above" or "above" other devices or structures would subsequently be positioned as "below" or "under" other devices or structures. Thus, the exemplary term "above" can include both "above" and "below." The device may also be positioned in other different ways (rotated 90 degrees or in other orientations), and the spatial relative descriptions used herein will be interpreted accordingly.
[0083] Furthermore, it should be noted that the use of terms such as "first" and "second" to define components is merely for the purpose of distinguishing the corresponding components. Unless otherwise stated, the above terms have no special meaning and therefore should not be construed as limiting the scope of protection of this invention.
[0084] Figure 1 This is a flowchart of a method for implementing distributed semantic trajectory similarity connections;
[0085] A distributed semantic trajectory similarity connection method includes the following steps:
[0086] S1: Establish a global index for locating semantically similar trajectories in two datasets from the textual, temporal, and spatial dimensions;
[0087] S2: Select the trimming boundaries for text similarity, temporal similarity, and spatial similarity based on the given similarity threshold and the similarity weight values of each dimension;
[0088] S3: Prune the global indexing process, and perform batch pruning on trajectory pairs that lack common text items, have a lower bound of time distance greater than the time boundary, or have a spatial distance greater than the spatial boundary;
[0089] S4: For the local index space node pairs after batch trimming, trim the trajectory pairs again based on the trajectory summary;
[0090] S5: For the candidate trajectory pairs after further trimming, reconstruct all trajectories and calculate the exact similarity between trajectories to obtain trajectory pairs that satisfy the similarity threshold constraint.
[0091] Furthermore, the process of establishing a global index for locating semantically similar trajectories in two datasets from the textual, temporal, and spatial dimensions is as follows:
[0092] S11: Read the two trajectory datasets and build inverted indexes for each, and build an inverted trajectory list for each text item;
[0093] The list consists of one or more complete semantic trajectories, and the trajectories within the list share at least one text item;
[0094] S12: Randomly select a set of samples from the trajectory list and store them in memory. Use time slicing technology to divide the samples in memory into time periods of equal size.
[0095] The time slice is [t] s , t e A list of time periods in the form of ], t s and t e It consists of the start and end times of the time period; then, spatial partitioning is performed.
[0096] S13: Extract trajectory segments from semantic trajectories based on trajectory segmentation algorithms, and spatially partition the trajectory segments according to the centroid of the smallest parallel rectangle of the trajectory segments;
[0097] We employ any partitioning strategy that provides strong spatial locality and good load balancing. We choose R-Grove partitioning because it has proven to provide more efficient partitioning. Specifically, R-Grove partitioning first takes a set of random samples (typically 10% of the records) from the set of input segments, then runs the R-Grove partitioning algorithm on the centroid of the minimum bounding rectangle of the sampled segments to determine the initial partition boundaries. The remaining segments are then assigned to the spatial region containing the centroid.
[0098] S14: In each spatial partition, an R-tree is built as a local index; each internal node n in the tree contains the set of trajectory IDs (represented as the TID set of n) of all segments contained in its subtree;
[0099] The TID set identifies all traces that pass through the spatial region (the node's MBR) of any node in the local index. Note that we typically have far more segments in a local index subtree than the number of traces passing through that subtree. Therefore, preserving the TID set allows us to prune all traces passing through a node without traversing the child nodes in the local index;
[0100] S15: The cluster master node will collect statistics from each spatial partition to build a global index.
[0101] The partition boundaries, root node TID set, and partition time period are collected from all local indexes. The global index allows us to prune trajectories within the spatial region and time range of a specific partition without invoking any task to view that partition.
[0102] Furthermore, the process of pruning the global indexing process, specifically the batch pruning of trajectory pairs that do not lack common text items, have a lower bound on time distance greater than the time boundary, and have a spatial distance greater than the spatial boundary, is as follows:
[0103] Given trajectory sets P and Q and a similarity threshold θ, any pair of trajectories satisfying Sim(T,tr)<θ<T,tr> All of them can be effectively removed;
[0104] In the inverted trajectory list stage, the batch modification of the text dimension involves selecting partitions with common terms to join, and batch pruning trajectory pairs that do not share any terms, according to Definition 6.
[0105] The batch modification of the time dimension occurs during the time slice stage. A lower limit between time slices is proposed, denoted by TS_LB. If TS_LB is less than... Where 〖LB〗_T is the global temporal similarity threshold, then the semantic trajectories contained in the two time slices must be different.
[0106] The spatial dimension batch modification occurs during the spatial partitioning stage. Given two spatial partitions, identified by R and S, and a spatial distance threshold ε, a distributed index is used to prune long-distance trajectory pairs. Any partition pair that satisfies sd(R,S)>ε is effectively pruned.
[0107] Furthermore: the step of further pruning the local index space node pairs after batch pruning based on the trajectory summary uses a text summary upper limit (TS). UB ;
[0108] if Therefore, the two trajectories must be dissimilar;
[0109] if The two trajectories are then output as candidate trajectory pairs.
[0110] Furthermore, the specific process for selecting the trimming boundary is as follows:
[0111] Based on Equations 1 and 2, the lower limits of text similarity and time similarity between trajectories T and tr are calculated respectively. The expressions for Equations 1 and 2 are as follows:
[0112]
[0113]
[0114] in and It is the global lower bound of the temporal and textual similarity of all “qualified” trajectory pairs, and UB represents the global upper bound of the similarity in the measurement space.
[0115] Since all similarities are normalized to the range [0,1],
[0116] According to equation 3 and have:
[0117]
[0118] in: It is the global lower bound of spatial similarity;
[0119] Therefore, when the user sets λ1 and θ, if λ1 + λ2 < θ ≤ 1, let
[0120] The expression for equation 3 is as follows.
[0121]
[0122] Furthermore, the formula for the lower limit TS_LB of the time slice is as follows:
[0123]
[0124] Theorem 1: If Then time slice ts i and ts j The semantic trajectories they contain must be different;
[0125] Proof: Assume Time slice ts i and ts j The semantic trajectories contained are similar, for trajectories T and tr,
[0126] so
[0127] Equation (6) above contradicts the assumption.
[0128] Furthermore, the upper limit of the text summary TS UB The formula is as follows:
[0129]
[0130] Theorem 2: Given two semantic trajectories And tr and a spatial distance threshold ε, if a fragment exists Make So there are
[0131] Proof: For the trajectory and will be with at least one fragment Match, if it exists Make have
[0132]
[0133]
[0134] Furthermore, the method also includes the following process for pruning trajectory pairs in the local index space node pairs: an approximate upper bound for the text, Aub, is defined. TE If Aub TE Less than Therefore, the two trajectories must be dissimilar;
[0135]
[0136] in: TS tr A summary of the text representing tr;
[0137] Lemma 1: Given a semantic trajectory and tr; if but It must not be similar to tr;
[0138] Proof: Assume and Similar to tr, according to I(o i The definition of ·χ,tr), I(o i ·χ,tr) UB ≥I(o i ·χ,tr), therefore, This contradicts the assumption.
[0139] Lemma 2: Given any two semantic trajectories And tr, there is equation 10,
[0140]
[0141] Proof: Assume td(o i ,tr)=|o i ·t,o′.t|,where o′ is the sampling point in tr that is closest to o in time. i The sampling points, according to td(o j By definition of T), for point o', we have:
[0142]
[0143] Therefore, there is
[0144] By substituting Equation 10 into Equation 2, the upper bound of time similarity is estimated. as follows:
[0145]
[0146]
[0147] Based on the above equation, we calculate half of the exact temporal similarity to obtain the upper limit. Then directly trim a pair of trajectories;
[0148] Based on equations 1 and 2, the following is obtained: and The formula is as follows:
[0149] The and The formula is as follows:
[0150]
[0151]
[0152] Definition 6 is as follows:
[0153] Definition 6 (DSTS-Join): Given two sets of semantic trajectories and The similarity threshold θ, DSTS-Join returns the set A of all trajectory pairs in two sets that satisfy the semantic trajectory similarity constraint, i.e. This ensures that T and tr share at least one text word, and
[0154] Furthermore, if fragments exist Make We only trim the trajectory tr;
[0155] In this embodiment, a cluster consisting of nine servers with quad-core Intel Xeon E5-2620 processors and 2.10GHz processors was built as the test environment for the method of this invention. All experiments were conducted on the cluster with one master node and nine slave nodes. Specific hardware configuration information is shown in Table 1.
[0156] Table 1 Server Hardware Configuration
[0157]
[0158]
[0159] This embodiment uses Eclipse as the development environment for the method of the present invention and Java as the programming language to complete the method design and development. The software environment for running the method in this embodiment includes: operating system Ubuntu 16.04.01, JDK version 1.8.0_111. The runtime environment includes Hadoop and Spark. Specific software environments are shown in Table 2.
[0160] Table 2 Software Environment
[0161] Software environment Version operating system Ubuntu 16.04.01 Hadoop version Hadoop 2.7.2 Spark version Spark 2.1.0 JDK version 1.8.0_111 Development Environment Eclipse language Java
[0162] In this embodiment, a method for implementing distributed semantic trajectory similarity connections under Spark is described, such as... Figure 2 The main steps shown are as follows:
[0163] Step 1: Inverted List Construction. We build an inverted track list for each term. The list consists of one or more complete semantic tracks, and the tracks within the list share at least one term; (corresponding to...) Figure 2 Phase 1)
[0164] Step 2: Time Slicing. In this stage, we first extract a set of random samples from the trajectory group. Then, we use time-slicing technology to divide the samples in memory to a level where all sub-slices have the same data size, and output the time boundary of each sub-slice; (corresponding to...) Figure 2 Phase 2)
[0165] Step 3: Spatial Partitioning. In this stage, we extract trajectory segments from the semantic trajectory based on the trajectory segmentation algorithm and partition them according to the centroids of the MBRs of these segments; (corresponding to...) Figure 2 Phase 3)
[0166] Step 4: Local Indexing. In each spatial partition, we built an R-tree variant as a local index; (corresponding to...) Figure 2 Phase 4)
[0167] Step 5: Global Indexing. The master node will collect statistics from each partition to build a global index. (Corresponding to...) Figure 2 Phase 5)
[0168] This embodiment uses two datasets to verify the effectiveness, robustness, and scalability of the invention: 1) BTTD, the Beijing taxi trajectory dataset, collected from the T-drive project. The original trajectories in BTTD are very long because each trajectory contains all trips within a specific time period, potentially spanning several days. We divide these trajectories into sub-trajectories based on a dwell time threshold (default set to half an hour) to create trips with actual durations; 2) NYCT, this dataset covers New York City taxi operation data from 2010 to 2013. Each taxi trip is a pair of origin and destination. We consider the shortest path from origin to destination as the trajectory of a trip. Furthermore, to add text descriptions to each trajectory point, we select tweets from the New York City tweet dataset that are closer to the trajectory and associate the tweet's text description with the trajectory point. Evaluation metrics: Join latency: end-to-end runtime of join; Selectivity: set It is the result calculated by method M and the dataset The number of candidate trajectories with precise similarity distances. Method M in The selectivity on is defined as Index size: The total memory usage of the index structure; Indexing time: The time required to create the index.
[0169] Experimental Results: The effectiveness of the design method in DFST is demonstrated in the following experimental results. Figure 3 As shown, Figure 3 (a) is a comparison chart of join methods in terms of join latency, (b) is a comparison chart of join methods in terms of selectivity, (c) is a comparison chart of join methods in terms of indexing time, and (d) is a comparison chart of join methods in terms of index size.
[0170] The comparison between DFST and the baseline method, with specific experimental results as follows: Figure 4 As shown, Figure 4 (a) is a comparison of the join method and the baseline method in terms of join latency; (b) is a comparison of the join method and the baseline method in terms of selectivity; (c) is a comparison of the join method and the baseline method in terms of indexing time; and (d) is a comparison of the join method and the baseline method in terms of index size.
[0171] Regarding the scalability of data size, specific experimental results are as follows: Figure 5 As shown, Figure 5 (a) Scalability relative to data size: Connection latency graph; (b) Scalability relative to data size: Selectivity graph; (c) Scalability relative to data size: Index time graph; (d) Scalability relative to data size: Index size graph.
[0172] Regarding the scalability of cluster size, specific experimental results are as follows: Figure 6 As shown, Figure 6(a) is a comparison of scalability relative to cluster size: connection latency graph; (b) is a comparison of scalability relative to cluster size: indexing time graph.
[0173] The effect of θ, specific experimental results are as follows Figure 7 As shown, Figure 7 (a) is a graph showing the effect of threshold θ on the connection delay of the connection method and the baseline method; (b) is a graph showing the effect of threshold θ on the selectivity of the connection method and the baseline method.
[0174] The effect of λ1, specific experimental results are as follows: Figure 8 As shown, Figure 8 (a) is a graph showing the effect of weight value λ1 on the connection delay of the connection method and the baseline method; (b) is a graph showing the effect of weight value λ1 on the selectivity of the connection method and the baseline method.
[0175] The effect of λ2, specific experimental results are as follows Figure 9 As shown, Figure 9 (a) is a graph showing the effect of weight value λ2 on the connection delay of the connection method and the baseline method, and (b) is a graph showing the effect of weight value λ2 on the selectivity of the connection method and the baseline method.
[0176] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A distributed semantic trajectory similarity connection method, characterized in that: Includes the following steps: Establish a global index for locating semantically similar trajectories in two datasets from textual, temporal, and spatial dimensions; Based on the given similarity threshold and the similarity weight values of each dimension, the trimming boundaries for text similarity, temporal similarity and spatial similarity are selected; The global indexing process is pruned, and trajectories that lack common text items, have a lower bound on time distance greater than the time boundary, or have a spatial distance greater than the spatial boundary are pruned in batches. For the local index space node pairs after batch trimming, the trajectory pairs are trimmed again based on the trajectory summary; For the candidate trajectory pairs after further trimming, reconstruct all trajectories and calculate the similarity between trajectories to obtain trajectory pairs that satisfy the similarity threshold constraint.
2. The distributed semantic trajectory similarity connection method according to claim 1, characterized in that: The process of establishing a global index for locating semantically similar trajectories in two datasets from the textual, temporal, and spatial dimensions is as follows: Read two trajectory datasets and build inverted indexes for each, then create an inverted trajectory list for each text item. A set of samples is randomly selected from the trajectory list and stored in memory. The time slicing technique is used to divide the samples in memory into time periods of equal size. The trajectory segmentation algorithm extracts trajectory segments from the semantic trajectory and spatially partitions the trajectory segments according to the centroid of the smallest parallel rectangle of the trajectory segments. In each spatial partition, an R-tree variant is built as a local index, and each internal node in the tree contains a set of trajectory IDs for all segments contained in its subtree; The cluster master node will collect statistics from each spatial partition to build a global index.
3. The distributed semantic trajectory similarity connection method according to claim 1, characterized in that: The process of pruning the global indexing process, specifically the batch pruning of trajectory pairs that do not lack common text items, have a lower bound on time distance greater than the time boundary, and have a spatial distance greater than the spatial boundary, is as follows: Given trajectory sets P and Q and a similarity threshold θ, any pair of trajectories satisfying Sim(T, tr) < θ is a valid pair of trajectories. T, tr All of them can be effectively removed; In the inverted trajectory list stage, the batch modification of the text dimension involves selecting partitions with common terms to join, and batch pruning trajectory pairs that do not share any terms, according to Definition 6. The batch modification of the time dimension during the time slice stage proposes a lower limit between time slices, using... It means that if Less than ,in If the global temporal similarity threshold is used, then the semantic trajectories contained in the two time slices must be different. The spatial dimension batch modification occurs during the spatial partitioning stage. Given two spatial partitions, identified by R and S, and a spatial distance threshold ε, a distributed index is used to prune long-distance trajectory pairs. Any partition pair that satisfies sd(R,S)>ε is effectively pruned.
4. The distributed semantic trajectory similarity connection method according to claim 1, characterized in that: The batch-pruned local index space node pairs are then further pruned based on the trajectory summary, using the upper limit of the text summary. ; if < If the two trajectories are dissimilar, then they must be dissimilar. if ≥ Then the two trajectories are output as candidate trajectory pairs.
5. The distributed semantic trajectory similarity connection method according to claim 1, characterized in that: The specific process for selecting the trimming boundary is as follows: Based on Equations 1 and 2, the lower limits of text similarity and time similarity between trajectories T and tr are calculated respectively. The expressions for Equations 1 and 2 are as follows: (1) (2) in and It is the global lower bound of the temporal and textual similarity of all qualified trajectory pairs, and UB represents the global upper bound of the similarity of the measurement space; Since all similarities are normalized to the range [0,1], ; According to equation 3 and ,have (3) in: It is the global lower bound of spatial similarity; Therefore, when the user sets and At that time, if ,make The expression for equation 3 is as follows: (4)。 6. The distributed semantic trajectory similarity connection method according to claim 3, characterized in that: The lower limit of the time slice The formula is as follows: (5) Theorem 1: If Then time slice j and The semantic trajectories they contain must be different; Proof: Assume Time slice and The semantic trajectories contained are similar, for trajectories T and tr, , so (6) Equation (6) above contradicts the assumption.
7. The distributed semantic trajectory similarity connection method according to claim 4, characterized in that: The upper limit of the text summary The formula is as follows: (7) Theorem 2: Given two semantic trajectories and And a spatial distance threshold If there exists a fragment Make So there are ; Proof: For the trajectory and will be with at least one fragment Match, if it exists Make There are the following equations (8) and (9). (8) (9)。 8. The distributed semantic trajectory similarity connection method according to claim 1, characterized in that: The process of pruning trajectory pairs in the local index space node pairs is as follows: An approximate upper limit for text was defined. ,if Less than If the two trajectories are dissimilar, then they must be dissimilar. (10) in: , represent A summary of the text; Lemma 1: Given a semantic trajectory and ;if ,but and They are definitely not similar; Proof: Assume and and Similar, according to Definition, ,so, This contradicts the assumption. Lemma 2: Given any two semantic trajectories and There is equation 10. , (11) Proof: Assume Where o' is the time closest among all sampling points in tr. The sampling points, according to By definition, for point o', we have: (12) Therefore, there is ; By substituting Equation 10 into Equation 2, the upper bound of time similarity is estimated. as follows: (13) (14) Based on the above equation, we calculate half of the exact temporal similarity to obtain the upper limit. If so, then directly trim a pair of trajectories; Based on equations 1 and 2, the following is obtained: and The formula is as follows: (15) (16)。