Track coincidence detection method, device and electronic equipment

By compressing the original trajectory data at different granularities and calculating the similarity using a twin neural network, the problems of low efficiency and accuracy in identifying user trajectory overlap in existing technologies are solved, achieving more efficient and accurate trajectory matching.

CN117009678BActive Publication Date: 2025-10-03CHINA MOBILE COMM LTD RES INST +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211280745.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-19
Publication Date
2025-10-03
Estimated Expiration
2042-10-19

AI Technical Summary

Technical Problem

Existing methods for identifying user trajectory overlap have low efficiency and accuracy, mainly due to problems such as inconsistent sampling rates of trajectory data, noise in the sampling process, and huge computational complexity.

Method used

By compressing the original trajectory data at different granularities and combining it with a twin neural network for similarity calculation, including coarse-grained and fine-grained compression, the LSTM model and periodic feature extraction module are used to determine similar trajectory data sets and recommend target information for similar user groups.

Benefits of technology

The efficiency and accuracy of user trajectory overlap detection are significantly improved, the amount of data and calculation is reduced, and the errors caused by noise and inconsistent sampling rates are alleviated.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117009678B_ABST
    Figure CN117009678B_ABST
Patent Text Reader

Abstract

The present application discloses a trajectory coincidence detection method, device and electronic device, which relates to the field of communication technology, in order to solve the problem of low efficiency and accuracy of related technologies. The method includes: obtaining an original trajectory data set; compressing the original trajectory data set according to a first compression granularity to obtain a first-granularity trajectory data set; determining a candidate trajectory data set based on the similarity between every two trajectory data in the first-granularity trajectory data set; obtaining a second-granularity trajectory data set obtained by compressing the target trajectory data set according to a second compression granularity, the target trajectory data set including the original trajectory data set, or including the original trajectory data corresponding to the candidate trajectory data set in the original trajectory data set, the second compression granularity being smaller than the first compression granularity; determining a similar trajectory data set based on the similarity between every two trajectory data in the second-granularity trajectory data set. The embodiments of the present application can improve the efficiency and accuracy of user trajectory coincidence detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a trajectory coincidence detection method, device and electronic equipment. Background Art

[0002] With the rapid growth of mobile location data, extracting useful information from this massive amount of spatiotemporal data has become crucial. By analyzing the movement trajectories of large numbers of users, we can identify behavioral similarities between them. This information can then be used to classify users or perform similarity analysis, providing guidance for precision marketing and intelligent recommendations.

[0003] At present, it is difficult to identify the overlap of user trajectories based on spatiotemporal data. In the existing technology, the distance-based user trajectory overlap identification method is mainly used, that is, the distance between two trajectories is calculated by methods such as Longest Common Subsequence (LCSS), Dynamic Time Warping (DTW), and edit distance. However, this method has the following problems: on the one hand, due to the inconsistent sampling rates of different trajectory data and the noise in the sampling process, it is difficult to directly match the trajectories, which leads to errors in the results; on the other hand, it is easy to cause huge calculations and low efficiency due to the large number of users and trajectory data points. It can be seen that the existing user trajectory overlap identification method has the problem of low efficiency and accuracy. Summary of the Invention

[0004] The embodiments of the present application provide a trajectory overlap detection method, device, and electronic device to address the low efficiency and accuracy issues of existing user trajectory overlap recognition methods.

[0005] In a first aspect, an embodiment of the present application provides a trajectory coincidence detection method, comprising:

[0006] Get the original trajectory dataset;

[0007] Compress each piece of original trajectory data in the original trajectory dataset according to a first compression granularity to obtain a first-granularity trajectory dataset;

[0008] Determining a candidate trajectory dataset according to a similarity between every two trajectory data in the first granularity trajectory dataset and a first similarity threshold;

[0009] Obtaining a second-granularity trajectory dataset corresponding to the candidate trajectory dataset, wherein the second-granularity trajectory dataset is obtained by compressing the target trajectory dataset according to a second compression granularity, the target trajectory dataset including each piece of original trajectory data in the original trajectory dataset, or including each piece of original trajectory data in the original trajectory dataset corresponding to each piece of candidate trajectory data in the candidate trajectory dataset, and the second compression granularity is smaller than the first compression granularity;

[0010] A similar trajectory dataset is determined according to the similarity between every two trajectory data in the second granularity trajectory dataset and a second similarity threshold.

[0011] Optionally, each piece of original trajectory data in the original trajectory data set includes a plurality of position points and a timestamp corresponding to each position point;

[0012] The compressing each piece of original trajectory data in the original trajectory dataset according to the first compression granularity to obtain the first granularity trajectory dataset includes:

[0013] Merging multiple position points whose corresponding timestamps in the first original trajectory data are in the same time interval of N time intervals to obtain first granularity trajectory data corresponding to the first original trajectory data, wherein the first original trajectory data is any original trajectory data in the original trajectory dataset, the time unit of the N time intervals is a first time unit, and N is an integer greater than 1;

[0014] The obtaining of a second granularity trajectory dataset corresponding to the candidate trajectory dataset includes:

[0015] Merge multiple position points in the second original trajectory data whose corresponding timestamps are in the same time interval of M time intervals to obtain second granularity trajectory data corresponding to the second original trajectory data, where the second original trajectory data is any original trajectory data in the target trajectory dataset, the time unit of the M time intervals is a second time unit, the second time unit is smaller than the first time unit, and M is an integer greater than N.

[0016] Optionally, merging a plurality of position points whose corresponding timestamps in the first original trajectory data are in the same time interval of N time intervals to obtain first granularity trajectory data corresponding to the first original trajectory data includes:

[0017] Determining a plurality of first position points in the first original trajectory data whose corresponding timestamps are in the same time interval among the N time intervals; determining a grid in which each of the plurality of first position points is located based on a grid obtained by pre-rasterizing a map; merging the grids in which each of the first position points is located to obtain first granular trajectory data including the plurality of merged grids;

[0018] and / or,

[0019] The step of merging a plurality of position points whose corresponding timestamps in the second original trajectory data are in the same time interval of the M time intervals to obtain second granularity trajectory data corresponding to the second original trajectory data includes:

[0020] Determine a plurality of second position points in the second original trajectory data whose corresponding timestamps are in the same time interval of the M time intervals; determine a grid in which each of the plurality of second position points is located based on a grid obtained by pre-rasterizing a map; and merge the grids in which each of the second position points is located to obtain second granular trajectory data including the plurality of merged grids.

[0021] Optionally, determining the similar trajectory dataset according to the similarity between every two trajectory data in the second granularity trajectory dataset and a second similarity threshold includes:

[0022] Inputting every two second-granularity trajectory data in the second-granularity trajectory data set into a pre-trained first Siamese neural network to perform similarity calculation, thereby obtaining the similarity of every two second-granularity trajectory data output by the first Siamese neural network, wherein the first Siamese neural network is trained based on the trajectory data sample set of the second compressed granularity;

[0023] In a case where the similarity between each two pieces of trajectory data of the second granularity is greater than the second similarity threshold, it is determined that each two pieces of trajectory data of the second granularity are similar trajectory data.

[0024] Optionally, the first twin neural network includes a long short-term memory network (LSTM) model and a periodic feature extraction module;

[0025] Inputting every two second granularity trajectory data in the second granularity trajectory data set into a pre-trained first twin neural network to perform similarity calculation, and obtaining the similarity of every two second granularity trajectory data output by the first twin neural network, includes:

[0026] Mapping the first input trajectory data and the second input trajectory data into first feature vectors respectively through the LSTM model, wherein the first input trajectory data and the second input trajectory data are every two second-granularity trajectory data in the second-granularity trajectory dataset;

[0027] extracting periodic feature vectors from the first input trajectory data and the second input trajectory data respectively according to at least one date type by the periodic feature extraction module;

[0028] fusing the first feature vector and the periodic feature vector of the first input trajectory data to obtain a first fused feature vector, and fusing the first feature vector and the periodic feature vector of the second input trajectory data to obtain a second fused feature vector;

[0029] The similarity between the first fused feature vector and the second fused feature vector is calculated to obtain the similarity between the first input trajectory data and the second input trajectory data.

[0030] Optionally, the periodic feature extraction module includes a first feature extraction submodule, a second feature extraction submodule, a third feature extraction submodule and a feature fusion module;

[0031] The extracting periodic feature vectors from the first input trajectory data and the second input trajectory data according to at least one date type by the periodic feature extraction module includes:

[0032] extracting feature values ​​from the first input trajectory data and the second input trajectory data according to a first date type by the first feature extraction submodule, respectively, to obtain a first period feature vector of the first input trajectory data and a first period feature vector of the second input trajectory data, wherein the first date type includes working days and non-working days;

[0033] Extracting feature values ​​from the first input trajectory data and the second input trajectory data respectively according to a second date type by the second feature extraction submodule to obtain a second periodic feature vector of the first input trajectory data and a second periodic feature vector of the second input trajectory data, wherein the second date type includes Monday to Sunday;

[0034] Extracting feature values ​​from the first input trajectory data and the second input trajectory data according to a third date type using the third feature extraction submodule to obtain a third period feature vector of the first input trajectory data and a third period feature vector of the second input trajectory data, wherein the third date type includes the first to the thirty-first day;

[0035] The feature fusion module fuses the first periodic feature vector, the second periodic feature vector, and the third periodic feature vector of the first input trajectory data to obtain a fused periodic feature vector of the first input trajectory data, and fuses the first periodic feature vector, the second periodic feature vector, and the third periodic feature vector of the second input trajectory data to obtain a fused periodic feature vector of the second input trajectory data.

[0036] Optionally, determining the candidate trajectory dataset according to the similarity between every two trajectory data in the first granularity trajectory dataset and a first similarity threshold includes:

[0037] Inputting every two first-granularity trajectory data in the first-granularity trajectory data set into a pre-trained second Siamese neural network to perform similarity calculation, and obtaining the similarity of the every two first-granularity trajectory data output by the second Siamese neural network, wherein the second Siamese neural network is trained based on the trajectory data sample set of the first compressed granularity;

[0038] In a case where the similarity between each two first-granularity trajectory data is greater than the first similarity threshold, each two first-granularity trajectory data are determined as candidate trajectory data.

[0039] Optionally, after determining the similar trajectory datasets based on the similarity between every two trajectory data in the second granularity trajectory dataset and the second similarity threshold, the method further includes:

[0040] Determine the user ID corresponding to each trajectory data in the similar trajectory data set to obtain a similar user group;

[0041] Target information related to user characteristics of the similar user group is obtained, and the target information is recommended to the similar user group.

[0042] In a second aspect, an embodiment of the present application further provides a track coincidence detection device, comprising:

[0043] The first acquisition module is used to obtain the original trajectory data set;

[0044] a processing module, configured to compress each piece of original trajectory data in the original trajectory dataset according to a first compression granularity to obtain a first-granularity trajectory dataset;

[0045] a first determining module, configured to determine a candidate trajectory data set based on a similarity between every two trajectory data in the first granularity trajectory data set and a first similarity threshold;

[0046] a second acquisition module, configured to acquire a second-granularity trajectory dataset corresponding to the candidate trajectory dataset, wherein the second-granularity trajectory dataset is obtained by compressing the target trajectory dataset according to a second compression granularity, the target trajectory dataset including each piece of original trajectory data in the original trajectory dataset, or including each piece of original trajectory data in the original trajectory dataset corresponding to each piece of candidate trajectory data in the candidate trajectory dataset, and the second compression granularity is smaller than the first compression granularity;

[0047] The second determining module is configured to determine a similar trajectory dataset according to the similarity between every two trajectory data in the second granularity trajectory dataset and a second similarity threshold.

[0048] Optionally, each piece of original trajectory data in the original trajectory data set includes a plurality of position points and a timestamp corresponding to each position point;

[0049] The processing module is configured to merge a plurality of position points in the first original trajectory data whose corresponding timestamps are in the same time interval of N time intervals to obtain first granularity trajectory data corresponding to the first original trajectory data, wherein the first original trajectory data is any original trajectory data in the original trajectory dataset, the time unit of the N time intervals is a first time unit, and N is an integer greater than 1;

[0050] The second acquisition module is configured to merge multiple position points in the second original trajectory data whose corresponding timestamps are in the same time interval of M time intervals to obtain second granularity trajectory data corresponding to the second original trajectory data, wherein the second original trajectory data is any original trajectory data in the target trajectory dataset, the time unit of the M time intervals is a second time unit, the second time unit is smaller than the first time unit, and M is an integer greater than N.

[0051] Optionally, the processing module is configured to determine a plurality of first position points in the first original trajectory data whose corresponding timestamps are in the same time interval among N time intervals; determine a grid in which each of the plurality of first position points is located based on a grid obtained by pre-rasterizing a map; and merge the grids in which each of the first position points is located to obtain first granular trajectory data comprising the plurality of merged grids;

[0052] and / or,

[0053] The second acquisition module is configured to determine, in the second original trajectory data, a plurality of second position points whose corresponding timestamps are within the same time interval of the M time intervals; determine, based on a grid obtained by pre-rasterizing a map, a grid in which each of the plurality of second position points is located; and merge the grids in which each of the second position points is located to obtain second granular trajectory data comprising the plurality of merged grids.

[0054] Optionally, the second determining module includes:

[0055] a first similarity calculation unit, configured to input each two second-granularity trajectory data in the second-granularity trajectory data set into a pre-trained first Siamese neural network for similarity calculation, and obtain the similarity of each two second-granularity trajectory data output by the first Siamese neural network, wherein the first Siamese neural network is trained based on the trajectory data sample set of the second compressed granularity;

[0056] The first determining unit is configured to determine that each two pieces of second granularity trajectory data are similar trajectory data if the similarity between each two pieces of second granularity trajectory data is greater than the second similarity threshold.

[0057] Optionally, the first twin neural network includes a long short-term memory network LSTM model and a periodic feature extraction module;

[0058] The first similarity calculation unit is used to:

[0059] Mapping the first input trajectory data and the second input trajectory data into first feature vectors respectively through the LSTM model, wherein the first input trajectory data and the second input trajectory data are every two second-granularity trajectory data in the second-granularity trajectory dataset;

[0060] extracting periodic feature vectors from the first input trajectory data and the second input trajectory data respectively according to at least one date type by the periodic feature extraction module;

[0061] fusing the first feature vector and the periodic feature vector of the first input trajectory data to obtain a first fused feature vector, and fusing the first feature vector and the periodic feature vector of the second input trajectory data to obtain a second fused feature vector;

[0062] The similarity between the first fused feature vector and the second fused feature vector is calculated to obtain the similarity between the first input trajectory data and the second input trajectory data.

[0063] Optionally, the periodic feature extraction module includes a first feature extraction submodule, a second feature extraction submodule, a third feature extraction submodule and a feature fusion module;

[0064] The first similarity calculation unit is used to:

[0065] extracting feature values ​​from the first input trajectory data and the second input trajectory data according to a first date type by the first feature extraction submodule, respectively, to obtain a first period feature vector of the first input trajectory data and a first period feature vector of the second input trajectory data, wherein the first date type includes working days and non-working days;

[0066] Extracting feature values ​​from the first input trajectory data and the second input trajectory data respectively according to a second date type by the second feature extraction submodule to obtain a second periodic feature vector of the first input trajectory data and a second periodic feature vector of the second input trajectory data, wherein the second date type includes Monday to Sunday;

[0067] Extracting feature values ​​from the first input trajectory data and the second input trajectory data according to a third date type using the third feature extraction submodule to obtain a third period feature vector of the first input trajectory data and a third period feature vector of the second input trajectory data, wherein the third date type includes the first to the thirty-first day;

[0068] The feature fusion module fuses the first periodic feature vector, the second periodic feature vector, and the third periodic feature vector of the first input trajectory data to obtain a fused periodic feature vector of the first input trajectory data, and fuses the first periodic feature vector, the second periodic feature vector, and the third periodic feature vector of the second input trajectory data to obtain a fused periodic feature vector of the second input trajectory data.

[0069] Optionally, the first determining module includes:

[0070] a second similarity calculation unit, configured to input each two first-granularity trajectory data in the first-granularity trajectory data set into a pre-trained second twin neural network for similarity calculation, and obtain the similarity of each two first-granularity trajectory data output by the second twin neural network, wherein the second twin neural network is trained based on the trajectory data sample set of the first compressed granularity;

[0071] The second determining unit is configured to determine, when the similarity between each two pieces of first granularity trajectory data is greater than the first similarity threshold, that the each two pieces of first granularity trajectory data are candidate trajectory data.

[0072] Optionally, the track overlap detection device further includes:

[0073] A third determination module is used to determine the user ID corresponding to each trajectory data in the similar trajectory data set to obtain a similar user group;

[0074] The recommendation module is configured to obtain target information related to user characteristics of the similar user group and recommend the target information to the similar user group.

[0075] In a third aspect, an embodiment of the present application further provides an electronic device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps in the trajectory coincidence detection method as described above are implemented.

[0076] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the trajectory coincidence detection method as described above are implemented.

[0077] In an embodiment of the present application, an original trajectory dataset is obtained; each piece of original trajectory data in the original trajectory dataset is compressed according to a first compression granularity to obtain a first granularity trajectory dataset; a candidate trajectory dataset is determined based on the similarity between each pair of trajectory data in the first granularity trajectory dataset and a first similarity threshold; a second granularity trajectory dataset corresponding to the candidate trajectory dataset is obtained, wherein the second granularity trajectory dataset is obtained by compressing a target trajectory dataset according to the second compression granularity, the target trajectory dataset including each piece of original trajectory data in the original trajectory dataset, or including each piece of original trajectory data in the original trajectory dataset corresponding to each candidate trajectory data in the candidate trajectory dataset, the second compression granularity being smaller than the first compression granularity; and a similar trajectory dataset is determined based on the similarity between each pair of trajectory data in the second granularity trajectory dataset and the second similarity threshold. In this way, by compressing the original trajectory data in the original trajectory dataset at different granularities and then performing similarity analysis on the compressed trajectory data at different granularities, not only can the amount of data and the amount of computation be greatly reduced, but errors caused by trajectory noise, inconsistent sampling rates, etc. can also be alleviated to a certain extent, thereby improving the efficiency and accuracy of user trajectory coincidence detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0078] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments of the present application. 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.

[0079] Figure 1 This is one of the flow charts of the trajectory coincidence detection method provided in an embodiment of the present application;

[0080] Figure 2 This is one of the structural diagrams of the twin neural network provided in the embodiment of the present application;

[0081] Figure 3 This is the second structural diagram of the twin neural network provided in the embodiment of the present application;

[0082] Figure 4 Schematic diagram of the structure of the periodic feature extraction module provided in the embodiment of the present application;

[0083] Figure 5 This is the second flow chart of the trajectory coincidence detection method provided in an embodiment of the present application;

[0084] Figure 6 A structural diagram of a track overlap detection device provided in an embodiment of the present application;

[0085] Figure 7 This is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0086] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0087] See also Figure 1 , Figure 1 is a flow chart of the trajectory coincidence detection method provided by the embodiment of the present application, such as Figure 1 As shown, the following steps are included:

[0088] Step 101: Obtain the original trajectory dataset.

[0089] The raw trajectory dataset can be obtained by obtaining uncompressed trajectory data from a large number of users through the operator, thereby obtaining a collection of raw trajectory data for each user. In other words, each piece of raw trajectory data in the raw trajectory dataset can correspond to a single user. When a user uses a terminal, they communicate with a base station covering the terminal's location, allowing the base station to obtain the terminal's location information. By obtaining the user terminal's location information over a period of time (e.g., a week, a month, a quarter, etc.) from the base station, the user's raw trajectory data can be obtained.

[0090] Each piece of original trajectory data in the original trajectory data set may be a sequence of position points sorted in chronological order.

[0091] Step 102 : compress each piece of original trajectory data in the original trajectory dataset according to a first compression granularity to obtain a first-granularity trajectory dataset.

[0092] In the embodiments of the present application, two problems arise when directly processing the raw trajectory data: First, the raw trajectory data will be too long due to the large number of trajectory points, resulting in a surge in data space. Direct use of the data increases the processing time of the trajectory data, placing high demands on computing performance and storage space. Second, different discrete trajectory sequences have problems such as inconsistent sampling rates and noise in the sampling process. Therefore, different trajectory sequences typically contain different numbers of trajectory points, and the number of these points may vary. Directly using this data will make it difficult to directly match the trajectory, resulting in errors in the results. To address this problem, the embodiments of the present application propose to first compress the raw trajectory data, and then use different compression granularities to compress the raw trajectory data to different degrees, so as to reduce the number while ensuring the accuracy of the calculation.

[0093] Therefore, in this step, each piece of original trajectory data in the original trajectory dataset can be compressed according to the first compression granularity to obtain a first-granularity trajectory dataset including the first-granularity trajectory data corresponding to each piece of original trajectory data. The first compression granularity can be a coarse compression granularity, that is, each piece of original trajectory data in the original trajectory dataset can be compressed with coarse granularity to obtain a coarse-granularity trajectory dataset.

[0094] The data compression method used in the embodiments of the present application may include compressing each piece of original trajectory data in the original trajectory data set into a single piece of data, compressing the original trajectory data set by rasterization, compressing multiple pieces of data within the same grid in each piece of original trajectory data into a single piece of data, or compressing the original trajectory data set by time quantization, compressing multiple pieces of data within a period of time in each piece of original trajectory data into a single piece of data, etc. The specific compression method is not limited. The first compression granularity can be set according to actual needs.

[0095] Step 103: Determine a candidate trajectory dataset based on the similarity between every two trajectory data in the first granularity trajectory dataset and a first similarity threshold.

[0096] After obtaining the first granular trajectory dataset, the first granular trajectory dataset may be preliminarily screened, and trajectory data with similar trajectories in the first granular trajectory dataset may be used as candidate trajectory data to obtain a candidate trajectory dataset including similar trajectory data.

[0097] Specifically, a similarity comparison can be performed between each pair of first-granularity trajectory data in the first-granularity trajectory dataset to obtain the similarity between each pair of first-granularity trajectory data. This similarity is then compared with a preset first similarity threshold. If the similarity between two pairs of first-granularity trajectory data exceeds the first similarity threshold, the two pairs of first-granularity trajectory data are selected as candidate trajectory data and added to the candidate trajectory dataset. The first similarity threshold can be set as needed. Typically, the similarity threshold for preliminary screening can be set slightly lower, such as 60%, 70%, etc.

[0098] More specifically, a similarity calculation model such as a twin neural network can be used to perform similarity calculation on the first granularity trajectory data set to complete the preliminary screening of similar trajectory data. Other methods can also be used, such as selecting several first granularity trajectory data with basically the same number of trajectories, analyzing the position change speed of each first granularity trajectory data to determine the corresponding motion state, such as walking, cycling, etc., so as to determine the first granularity trajectory data with similar motion states as similar trajectory data and add them to the candidate trajectory data set.

[0099] Step 104: Obtain a second-granularity trajectory dataset corresponding to the candidate trajectory dataset, wherein the second-granularity trajectory dataset is obtained by compressing the target trajectory dataset according to a second compression granularity. The target trajectory dataset includes each original trajectory data in the original trajectory dataset, or includes each original trajectory data in the original trajectory dataset corresponding to each candidate trajectory data in the candidate trajectory dataset. The second compression granularity is smaller than the first compression granularity.

[0100] In the embodiments of this application, it is considered that if coarse-grained compressed trajectories are directly used for calculation, although the number of trajectory points can reduce the amount of calculation, it cannot well capture the characteristics of the trajectory, resulting in errors in recognition accuracy; if fine-grained compressed trajectories are directly used for calculation, the data volume will be too large, resulting in a serious waste of computing resources. Therefore, this application uses a combination of coarse and fine granularity compressed trajectory data for calculation, which can reduce the amount of data while ensuring calculation accuracy, saving computing time and resources.

[0101] Specifically, in an embodiment of the present application, each piece of raw trajectory data in the raw trajectory dataset may be directly compressed at different compression granularities to obtain trajectory datasets of different granularities. For example, each piece of raw trajectory data in the raw trajectory dataset may be compressed at coarse compression granularity and fine compression granularity to obtain a coarse-grained trajectory dataset and a fine-grained trajectory dataset, respectively. Alternatively, to reduce the amount of data processing and avoid unnecessary compression processing, each piece of raw trajectory data in the raw trajectory dataset may be first compressed at coarse compression granularity to obtain a coarse-grained trajectory dataset, and the coarse-grained trajectory dataset may be preliminarily screened to obtain a candidate trajectory dataset including similar trajectory data. Then, fine-grained compression processing may be performed only on the portion of raw trajectory data corresponding to the candidate trajectory dataset to obtain a fine-grained trajectory dataset corresponding to the candidate trajectory dataset.

[0102] The first compression granularity is a coarse compression granularity, and the second compression granularity is a fine compression granularity, which is smaller than the first compression granularity. In other words, the trajectory data in the second-granularity trajectory dataset is compressed at a finer granularity than the trajectory data in the first-granularity trajectory dataset, and the second-granularity trajectory dataset has a higher precision than the first-granularity trajectory dataset.

[0103] In this embodiment of the present application, the compression processing method for performing the second compression granularity on each piece of raw trajectory data in the target trajectory dataset can be similar to the compression processing method for performing the first compression granularity on each piece of raw trajectory data in the raw trajectory dataset, with the difference being the compression granularity. Both the first compression granularity and the second compression granularity can be set according to actual needs, as long as the second compression granularity is smaller than the first compression granularity.

[0104] Optionally, each piece of original trajectory data in the original trajectory data set includes a plurality of position points and a timestamp corresponding to each position point;

[0105] The step 102 includes:

[0106] Merging multiple position points whose corresponding timestamps in the first original trajectory data are in the same time interval of N time intervals to obtain first granularity trajectory data corresponding to the first original trajectory data, wherein the first original trajectory data is any original trajectory data in the original trajectory dataset, the time unit of the N time intervals is a first time unit, and N is an integer greater than 1;

[0107] The step 104 includes:

[0108] Merge multiple position points in the second original trajectory data whose corresponding timestamps are in the same time interval of M time intervals to obtain second granularity trajectory data corresponding to the second original trajectory data, where the second original trajectory data is any original trajectory data in the target trajectory dataset, the time unit of the M time intervals is a second time unit, the second time unit is smaller than the first time unit, and M is an integer greater than N.

[0109] In one embodiment, the original trajectory dataset can be compressed using a time quantization method, and different time quantization levels can be used to perform coarse-grained compression and fine-grained compression on the original trajectory data in the original trajectory dataset to obtain the corresponding coarse-grained trajectory dataset, i.e., the first granularity trajectory dataset, and the fine-grained trajectory dataset, i.e., the second granularity trajectory dataset.

[0110] Each piece of original trajectory data in the original trajectory dataset may include multiple location points and a timestamp corresponding to each location point, that is, a trajectory sequence with latitude, longitude and time information, which can be specifically expressed as follows:

[0111] S pid ={L0,…,L k}, where L i =(lng i ,lat i ,t i );

[0112] Among them, pid represents the user, S pid Represents the user's path, i.e., the original trajectory data, L i Representative path S pid The i-th position point in lng i Represents the longitude of the i-th location point, lat i Represents the latitude of the i-th location point, t i represents the timestamp corresponding to the i-th position point, and k+1 represents the total number of position points in the trajectory sequence.

[0113] In this embodiment, time can be quantified, such as dividing 24 hours into several time intervals with two minutes as the minimum unit, and merging all position points in the same time interval. For example, the average of the longitude and latitude of all position points in the same time interval is calculated again as the merged position point, so as to obtain a compressed trajectory sequence.

[0114] Due to the large amount of trajectory data and high computational cost, this application performs coarse-grained compression and fine-grained compression on the original trajectory data according to different time quantization levels, that is, different minimum time units are selected to represent the original trajectory data into sequences composed of different numbers of trajectory points. For example, if the minimum time unit for coarse-grained compression is selected as 10 minutes, then the trajectory points for one day after compression are 144; if the minimum time unit for fine-grained compression is selected as 1 minute, then the trajectory points for one day after compression are 1440. It can be seen that trajectory compression of different granularities has a great influence on the magnitude of the trajectory sequence. In this way, the original trajectory sequence can be converted into a trajectory sequence composed of a series of merged position points, that is, an original trajectory sequence S pid It can be compressed into trajectory sequences of two different granularities.

[0115] Specifically, the target duration can be divided into N time intervals using the first time unit, such as dividing 24 hours a day into 144 time intervals using 10-minute units. For any original trajectory data in the original trajectory dataset, such as the first original trajectory data, multiple location points in the first original trajectory data whose corresponding timestamps are the same day and the same time interval are merged, such as calculating the average longitude and latitude of these location points as the merged location point, thereby compressing the first original trajectory data into a first-granularity trajectory data, i.e., coarse-grained trajectory data.

[0116] Similarly, the target duration can be divided into M time intervals using a second time unit, such as dividing a 24-hour day into 1440 time intervals using a 1-minute unit. For any original trajectory data in the target trajectory dataset, such as the second original trajectory data, multiple location points in the second original trajectory data whose timestamps are the same day and the same time interval are merged, such as by calculating the average longitude and latitude of these location points as the merged location point. This allows the second original trajectory data to be compressed into a second-granularity trajectory data, i.e., fine-grained trajectory data.

[0117] Thus, through this implementation, it is possible to compress raw trajectory data into trajectory data of different granularities at different time quantization levels, and ensure that each piece of compressed trajectory data of the same granularity has the same length, thereby overcoming the problem of difficulty in matching and resulting in error in the results caused by inconsistent sampling rates. In other words, through the compression method in this implementation, it is possible to ensure that the number of trajectory points within the same time length of the compressed trajectory data is the same. For example, for each user's raw trajectory data for one day, after compression in 10-minute units, 144 trajectory points are obtained, and after compression in 1-minute units, 1440 trajectory points are obtained. For each user's raw trajectory data for two days, after compression in 10-minute units, 288 trajectory points are obtained, and after compression in 1-minute units, 2880 trajectory points are obtained, and so on.

[0118] Optionally, merging a plurality of position points whose corresponding timestamps in the first original trajectory data are in the same time interval of N time intervals to obtain first granularity trajectory data corresponding to the first original trajectory data includes:

[0119] Determining a plurality of first position points in the first original trajectory data whose corresponding timestamps are in the same time interval among the N time intervals; determining a grid in which each of the plurality of first position points is located based on a grid obtained by pre-rasterizing a map; merging the grids in which each of the first position points is located to obtain first granular trajectory data including the plurality of merged grids;

[0120] and / or,

[0121] The step of merging a plurality of position points whose corresponding timestamps in the second original trajectory data are in the same time interval of the M time intervals to obtain second granularity trajectory data corresponding to the second original trajectory data includes:

[0122] Determine a plurality of second position points in the second original trajectory data whose corresponding timestamps are in the same time interval of the M time intervals; determine a grid in which each of the plurality of second position points is located based on a grid obtained by pre-rasterizing a map; and merge the grids in which each of the second position points is located to obtain second granular trajectory data including the plurality of merged grids.

[0123] In one implementation, the original trajectory data may be compressed by combining multi-dimensional map rasterization and time quantization.

[0124] Specifically, the map can be rasterized, that is, the map is divided into multiple equally spaced grids, each small grid has its own identifier, and the trajectory points falling into the same grid can be represented by the identifier of the grid; and time can be quantified, such as dividing the 24 hours of a day into several time intervals with two minutes as the minimum unit, and all grid points in the same time interval are merged again, such as calculating the average longitude and latitude of each grid point, so as to obtain a compressed version of the grid trajectory sequence.

[0125] This application performs coarse-grained compression and fine-grained compression on the original trajectory data according to different time quantization levels, that is, different minimum time units are selected to represent the original trajectory data into sequences consisting of different numbers of trajectory points. For example, if the minimum time unit of coarse-grained compression is selected as 10 minutes, then the trajectory points of one day after compression are 144; if the minimum time unit of fine-grained compression is selected as 1 minute, then the trajectory points of one day after compression are 1440. In this way, the original trajectory sequence can be converted into a trajectory sequence consisting of a series of grid points, that is, each trajectory S pid Can be compressed into two grid trajectory sequences Z with different granularity pid , that is:

[0126] Among them G i =(Φlng i ,Φlat i ,Φt i );

[0127] in, They represent coarse-grained compression and fine-grained compression respectively. Represents the user's grid path, i.e., the compressed trajectory sequence, G i Represents a grid path The i-th grid point in the grid path, n+1 is the total number of grid points in the grid path; Φlng i Represents the average longitude of all locations in the i-th grid, Φlat i Represents the average latitude of all locations in the i-th grid, Φt i Represents the timestamp after time quantization. It can be the average of the timestamps in the same time interval, or the first timestamp in the same time interval.

[0128] In this implementation, gridding is equivalent to enlarging the smallest unit in the trajectory data space from an infinitesimal real-valued point to a grid of a custom size, compressing the data space. This not only preserves the original characteristics of the trajectory data but also mitigates errors caused by trajectory noise to a certain extent. It also alleviates matching errors caused by inconsistent and low trajectory sampling rates.

[0129] Step 105 : Determine a similar trajectory dataset based on the similarity between every two trajectory data in the second granularity trajectory dataset and a second similarity threshold.

[0130] Finally, the second granularity trajectory dataset may be finely screened again, and trajectory data with similar trajectories in the second granularity trajectory dataset may be used as target similar trajectory data to obtain a similar trajectory dataset including the target similar trajectory data.

[0131] Specifically, a similarity comparison can be performed between each two pieces of second-granularity trajectory data in the second-granularity trajectory data set, and the similarity between each two pieces of second-granularity trajectory data can be calculated and compared with a preset second similarity threshold. If the similarity between two pieces of second-granularity trajectory data is greater than the second similarity threshold, the two pieces of second-granularity trajectory data are used as target similar trajectory data and added to the similar trajectory data set. The second similarity threshold can be set as needed, and to ensure the accuracy of the final result, the second similarity threshold can be greater than the first similarity threshold, that is, the second similarity threshold can be set higher, such as 80%, 90%, etc.

[0132] To ensure the accuracy of the similarity calculation results, a neural network model can be trained using fine-grained trajectory data samples to perform similarity calculation on the second granularity trajectory data set. That is, optionally, step 105 includes:

[0133] Inputting every two second-granularity trajectory data in the second-granularity trajectory data set into a pre-trained first Siamese neural network to perform similarity calculation, thereby obtaining the similarity of every two second-granularity trajectory data output by the first Siamese neural network, wherein the first Siamese neural network is trained based on the trajectory data sample set of the second compressed granularity;

[0134] In a case where the similarity between each two pieces of trajectory data of the second granularity is greater than the second similarity threshold, it is determined that each two pieces of trajectory data of the second granularity are similar trajectory data.

[0135] That is, in one embodiment, the twin neural network can be pre-trained using the trajectory data sample set of the second compression granularity to obtain the first twin neural network, that is, the fine-grained trajectory data sample set is used to train the fine-grained twin neural network for similarity comparison of the fine-grained trajectory data.

[0136] Among them, the twin neural network can be used to measure the similarity between two inputs, and its "twin" is achieved by sharing weights. The twin neural network structure can be as follows Figure 2As shown in the figure, there are two inputs, Input1 and Input2, which are fed into two networks, Network1 and Network2, respectively. These two networks map their respective inputs to a new space, forming a representation of the input in the new space. Finally, the similarity between the two inputs is evaluated by calculating the loss value.

[0137] In this embodiment, the two inputs Input1 and Input2 of the first twin neural network are trajectory sequences Z1 and Z2 composed of fine-grained compressed grid points, that is, every two second-granularity trajectory data in the second-granularity trajectory data set can be used as model inputs Input1 and Input2 respectively, and input into the first twin neural network, and the similarity of the two second-granularity trajectory data input is calculated by the first twin neural network.

[0138] In this way, by training a fine-grained twin neural network to calculate the similarity between fine-grained trajectory data, the accuracy and reliability of the calculation results can be guaranteed.

[0139] Optionally, step 103 includes:

[0140] Inputting every two first-granularity trajectory data in the first-granularity trajectory data set into a pre-trained second Siamese neural network to perform similarity calculation, and obtaining the similarity of the every two first-granularity trajectory data output by the second Siamese neural network, wherein the second Siamese neural network is trained based on the trajectory data sample set of the first compressed granularity;

[0141] In a case where the similarity between each two first-granularity trajectory data is greater than the first similarity threshold, each two first-granularity trajectory data are determined as candidate trajectory data.

[0142] In one embodiment, the twin neural network can also be pre-trained using a trajectory data sample set of the first compression granularity to obtain a second twin neural network, that is, a coarse-grained trajectory data sample set is used to train a coarse-grained twin neural network for screening the coarse-grained trajectory data to obtain similar candidate trajectory data.

[0143] In this embodiment, the two inputs Input1 and Input2 of the second twin neural network are trajectory sequences Z1′ and Z2′ composed of coarse-grained compressed grid points, that is, every two first-granularity trajectory data in the first-granularity trajectory data set can be used as model inputs Input1 and Input2 respectively, and input into the second twin neural network. The similarity of the two first-granularity trajectory data input is calculated by the second twin neural network, and when the similarity of two first-granularity trajectory data output by the second twin neural network is greater than the first similarity threshold, the two first-granularity trajectory data can be determined as candidate trajectory data.

[0144] In this way, by training the coarse-grained twin neural network to calculate the similarity between coarse-grained trajectory data, the accuracy and reliability of the calculation results can be guaranteed.

[0145] That is, in one implementation of an embodiment of the present application, the overlap of user trajectories can be calculated through a secondary twin neural network model structure. First, a coarse-grained twin neural network model is trained based on the coarse-grained trajectory compression results to reduce the number of candidate sets and retain a portion of trajectories with relatively high similarity as secondary candidate sets. Secondly, a fine-grained twin neural network model is trained based on the fine-grained trajectory compression results of the secondary candidate sets to make the final judgment on the overlap of user trajectories.

[0146] Among them, the design purpose of the two-level twin neural network model structure is to solve the problem of huge amount of long-period trajectory sequence data. If the coarse-grained compressed trajectory is directly used for model training, although the number of trajectory points can reduce the model volume, it cannot capture the characteristics of the trajectory well, resulting in errors in model recognition accuracy; if the fine-grained compressed trajectory is directly used for model training, the data volume is too large, resulting in poor model convergence and serious waste of computing resources. Therefore, the embodiment of the present application adopts a two-level twin neural network model that combines coarse and fine granularity to reduce the model volume while ensuring calculation accuracy, saving time, resources and other computing costs.

[0147] Optionally, the first twin neural network includes a long short-term memory network LSTM model and a periodic feature extraction module;

[0148] Inputting every two second granularity trajectory data in the second granularity trajectory data set into a pre-trained first twin neural network to perform similarity calculation, and obtaining the similarity of every two second granularity trajectory data output by the first twin neural network, includes:

[0149] Mapping the first input trajectory data and the second input trajectory data into first feature vectors respectively through the LSTM model, wherein the first input trajectory data and the second input trajectory data are every two second-granularity trajectory data in the second-granularity trajectory dataset;

[0150] extracting periodic feature vectors from the first input trajectory data and the second input trajectory data respectively according to at least one date type by the periodic feature extraction module;

[0151] fusing the first feature vector and the periodic feature vector of the first input trajectory data to obtain a first fused feature vector, and fusing the first feature vector and the periodic feature vector of the second input trajectory data to obtain a second fused feature vector;

[0152] The similarity between the first fused feature vector and the second fused feature vector is calculated to obtain the similarity between the first input trajectory data and the second input trajectory data.

[0153] In one embodiment, the first twin neural network model may adopt an improved twin neural network model that integrates periodic features, that is, the first twin neural network model includes an LSTM model and a periodic feature extraction module.

[0154] Specifically, the embodiment of the present application selects an LSTM model suitable for processing sequence data based on the fact that the input trajectory sequence is a time series sequence. However, considering that the LSTM model cannot solve the periodic problem well, such as the user's behavior trajectory is periodic and different on weekdays and weekends, the embodiment of the present application extracts periodic features of the trajectory sequence based on the LSTM model, and extracts periodic features of the trajectory sequence according to at least one date type, such as day folding, week folding, month folding, etc., to make up for the fact that the LSTM model cannot solve the periodic problem well. The overall model structure of the first twin neural network model can be as follows: Figure 3 shown.

[0155] like Figure 3 As shown, the inputs Input1 and Input2 of the first twin neural network model are fine-grained compressed trajectory sequences Z1 and Z2; the network structures of the two networks Network1 and Network2 include two parts: LSTM and periodic feature extraction modules.

[0156] The LSTM model, a type of recurrent neural network (RNN), is suitable for processing time series data. It overcomes the vanishing and exploding gradient issues that traditional RNNs often face when processing long sequences. The output of the LSTM model can be represented by F(Z), where Z represents the fine-grained compressed trajectory sequence, or the second-granularity trajectory data. That is,

[0157]

[0158] in, Represents the vector output by LSTM encoding of the i-th trajectory sequence. The output of this step is two fixed-length representation vectors, namely in represents the output vector of trajectory sequence Z1, Represents the output vector of trajectory sequence Z2.

[0159] At the same time, because the LSTM model cannot effectively handle periodicity, the embodiments of this application add a periodic feature extraction module to extract periodic feature vectors from the input trajectory sequence according to at least one date type to enrich the trajectory sequence. For example, periodic features can be extracted for weekdays and weekends respectively, resulting in a two-dimensional feature vector that represents the characteristics of the user's trajectory on weekdays and weekends.

[0160] Finally, the trajectory sequence encoded by the LSTM model and the periodic feature extraction module can be expressed as follows:

[0161]

[0162] Or it can be expressed as:

[0163]

[0164] in, is the feature vector obtained by encoding the i-th trajectory sequence through the LSTM model, is the periodic feature vector obtained by the periodic feature extraction module for the i-th trajectory sequence, and α is the weight coefficient, which can take a value between 0 and 1 as needed.

[0165] In this way, through this implementation, not only can the trajectory sequence be well extracted, but the periodicity problem can also be well solved, thereby ensuring that rich and comprehensive features are extracted from the input trajectory sequence, and then the similarity of the input trajectory sequence can be accurately calculated based on the extracted features.

[0166] Optionally, the periodic feature extraction module includes a first feature extraction submodule, a second feature extraction submodule, a third feature extraction submodule and a feature fusion module;

[0167] The extracting periodic feature vectors from the first input trajectory data and the second input trajectory data according to at least one date type by the periodic feature extraction module includes:

[0168] extracting feature values ​​from the first input trajectory data and the second input trajectory data according to a first date type by the first feature extraction submodule, respectively, to obtain a first period feature vector of the first input trajectory data and a first period feature vector of the second input trajectory data, wherein the first date type includes working days and non-working days;

[0169] Extracting feature values ​​from the first input trajectory data and the second input trajectory data respectively according to a second date type by the second feature extraction submodule to obtain a second periodic feature vector of the first input trajectory data and a second periodic feature vector of the second input trajectory data, wherein the second date type includes Monday to Sunday;

[0170] Extracting feature values ​​from the first input trajectory data and the second input trajectory data according to a third date type using the third feature extraction submodule to obtain a third period feature vector of the first input trajectory data and a third period feature vector of the second input trajectory data, wherein the third date type includes the first to the thirty-first day;

[0171] The feature fusion module fuses the first periodic feature vector, the second periodic feature vector, and the third periodic feature vector of the first input trajectory data to obtain a fused periodic feature vector of the first input trajectory data, and fuses the first periodic feature vector, the second periodic feature vector, and the third periodic feature vector of the second input trajectory data to obtain a fused periodic feature vector of the second input trajectory data.

[0172] In a specific implementation, in order to ensure comprehensive periodic feature extraction of the input trajectory sequence, the periodic feature extraction module can be designed to include a first feature extraction submodule, a second feature extraction submodule and a third feature extraction submodule, which are respectively used to extract daily features, weekly features and monthly features of the input trajectory sequence, that is, to perform daily folding, weekly folding and monthly folding respectively. The periodic feature extraction module also includes a feature fusion module for fusing the extracted daily features, weekly features and monthly features. The network structure of the periodic feature extraction module can be as follows: Figure 4 shown.

[0173] The first feature extraction submodule is configured to extract feature values ​​from the input trajectory data according to the first date type to obtain a first periodic feature vector. For example, workday features and non-workday features are extracted from the input trajectory sequence according to workdays and non-workdays to obtain a two-dimensional periodic feature vector composed of workday features and non-workday features. Specifically, each trajectory point in the input trajectory data can be divided into workday trajectory points and non-workday trajectory points according to the timestamp. The workday trajectory points are then subjected to computational processing such as weighted averaging to obtain the corresponding workday feature values, and the non-workday trajectory points are subjected to computational processing such as weighted averaging to obtain the corresponding non-workday feature values, thereby obtaining a two-dimensional periodic feature vector composed of these two feature values.

[0174] The second feature extraction submodule is used to extract eigenvalues ​​from the input trajectory data according to the second date type to obtain a second periodic feature vector. For example, the Monday feature to the Sunday feature are extracted from the input trajectory sequence from Monday to Sunday to obtain a seven-dimensional periodic feature vector composed of the Monday feature to the Sunday feature. Specifically, each trajectory point in the input trajectory data can be divided into Monday trajectory points, Tuesday trajectory points, Wednesday trajectory points, Thursday trajectory points, Friday trajectory points, Saturday trajectory points, and Sunday trajectory points according to the timestamp. The Monday trajectory points are then subjected to computational processing such as weighted averaging to obtain the corresponding Monday eigenvalue. Similarly, the Tuesday to Sunday trajectory points are subjected to computational processing such as weighted averaging to obtain the corresponding Tuesday eigenvalue to Sunday eigenvalue, and then a seven-dimensional periodic feature vector composed of these seven eigenvalues ​​can be obtained.

[0175] The third feature extraction submodule is used to extract feature values ​​from the input trajectory data according to the third date type to obtain a third periodic feature vector. For example, features 1 to 31 are extracted from the input trajectory sequence according to the dates 1 to 31, respectively, to obtain a 31-dimensional periodic feature vector composed of features 1 to 31. Specifically, each trajectory point in the input trajectory data can be divided into trajectory point 1, trajectory point 2, ..., and trajectory point 31 according to the timestamp. Trajectory point 1 is then subjected to computational processing such as weighted averaging to obtain the corresponding feature value 1. Similarly, computational processing such as weighted averaging is performed on trajectory points 2 to 31 to obtain the corresponding feature values ​​2 to 31. Furthermore, a 31-dimensional periodic feature vector composed of these 31 feature values ​​can be obtained.

[0176] The feature fusion module is used to fuse the first periodic feature vector, the second periodic feature vector and the third periodic feature vector, such as splicing the two-dimensional periodic feature vector, the seven-dimensional periodic feature vector and the thirty-one-dimensional periodic feature vector extracted above to obtain a fused forty-dimensional periodic feature vector.

[0177] The periodic feature vector of the trajectory sequence extracted by the periodic feature extraction module can be expressed as follows:

[0178]

[0179] in, It represents the periodic feature vector obtained after the i-th trajectory sequence is characterized by the periodic feature extraction module. It represents the two-dimensional periodic feature vector after daily feature extraction, i.e., daily folding. It represents the seven-dimensional periodic feature vector after week feature extraction, i.e. week folding. Represents the thirty-one-dimensional feature vector after monthly feature extraction, i.e., monthly folding.

[0180] The trajectory sequence encoded by the LSTM model and the periodic feature extraction module can be expressed as follows:

[0181]

[0182] in, is the feature vector obtained by encoding the i-th trajectory sequence through the LSTM model, is the periodic feature vector obtained by the periodic feature extraction module of the i-th trajectory sequence.

[0183] Finally, the similarity calculation result can be output by the first twin neural network. For example, the cosine loss function can be selected to compare the similarity of the feature vectors corresponding to the two trajectory sequences. The calculation formula can be as follows:

[0184]

[0185] Among them, V1 represents the output vector of the trajectory sequence Z1 after being encoded by the LSTM model and the periodic feature extraction module, V2 represents the output vector of the trajectory sequence Z2 after being encoded by the LSTM model and the periodic feature extraction module, and x i The eigenvalues ​​in V1, y i Belongs to the eigenvalues ​​in V2.

[0186] In this way, through this implementation, it is possible to ensure that the periodic features of the input trajectory sequence are fully extracted, thereby ensuring the accuracy of the similarity calculation of the input trajectory sequence.

[0187] It should be noted that the second twin neural network can be a network structure similar to the first twin neural network. The only difference is that the training data are coarse-grained trajectory data sample sets and fine-grained trajectory data sample sets, and the model inputs are coarse-grained trajectory data and fine-grained trajectory data, respectively. The specific structure will not be repeated here.

[0188] Optionally, after step 105, the method further includes:

[0189] Determine the user ID corresponding to each trajectory data in the similar trajectory data set to obtain a similar user group;

[0190] Target information related to user characteristics of the similar user group is obtained, and the target information is recommended to the similar user group.

[0191] In one embodiment, after determining similar trajectory datasets, the user groups corresponding to the similar trajectory datasets can be further determined to uniformly manage user groups with high trajectory overlap, thereby facilitating subsequent user classification and similarity analysis, providing guidance for precision marketing and intelligent recommendations.

[0192] Specifically, based on the original trajectory data corresponding to each trajectory data in the similar trajectory dataset, the user ID corresponding to the original trajectory data can be obtained, and these user IDs can be determined as similar user groups. In view of the high trajectory similarity of these similar user groups, similar information can be recommended to the similar user groups, such as recommending the same product, or pushing similar news, traffic conditions information, etc. More specifically, based on the user characteristics of the similar user groups, such as behavioral trajectory, gender, age, occupation, etc., target information related to the user characteristics of the similar user groups can be obtained, so as to recommend the target information to the similar user groups, such as pushing the target information to each user ID corresponding to the similar user groups.

[0193] In this way, through this implementation, relevant information can be recommended to similar user groups based on the similarity of user trajectories, thereby achieving precision marketing and intelligent recommendations.

[0194] The embodiment of the present application provides a method for detecting user overlap based on spatiotemporal data in a big data environment. The method adopts a two-level twin neural network architecture. First, the twin neural network is a type of neural network. The neural network learns the overall vector representation of its potential space, taking into account the global information of the user trajectory. Secondly, the present application can reduce trajectory noise while reducing the model volume and computing costs such as time and resources in terms of trajectory compression technology and the design of the two-level twin neural network model. In order to make up for the shortcoming that the LSTM model cannot handle the periodicity of the trajectory well, a periodic feature extraction module parallel to the LSTM is added to the two-level twin neural network architecture to retain the periodic characteristics of the trajectory. In addition, the trajectory data is compressed at two granularities by using the methods of map rasterization and time quantization. Under the premise of retaining the original characteristics of the trajectory, it not only reduces the magnitude of the trajectory data, but also effectively alleviates the errors caused by problems such as trajectory noise and inconsistent trajectory sampling.

[0195] The specific implementation process of the embodiment of this application can be as follows Figure 5 As shown in the figure, user trajectory information collected by base stations is first compressed using map rasterization and time quantization methods, respectively, at coarse and fine granularity. This minimizes the amount of trajectory data and trajectory noise while ensuring similarity between the compressed and original trajectories. A two-level twin neural network model combining coarse and fine granularity is then used to determine user trajectory overlap. Initially, the coarse-grained twin neural network model filters the original data, selecting relatively similar trajectory sequences as a second-level candidate set. This second-level candidate set is then fed into the fine-grained twin neural network for final user trajectory overlap determination. Both networks in the twin neural network utilize LSTMs, which are suitable for processing time series data. A periodic feature extraction module is added to extract periodic features of trajectories, compensating for the LSTM's inability to handle trajectory periodicity. Finally, the user trajectory overlap identification results obtained by the twin neural network are managed to facilitate subsequent user classification and similarity analysis, providing guidance for precision marketing and intelligent recommendations.

[0196] A trajectory coincidence detection method according to an embodiment of the present application comprises: obtaining an original trajectory dataset; compressing each piece of original trajectory data in the original trajectory dataset according to a first compression granularity to obtain a first-granularity trajectory dataset; determining a candidate trajectory dataset based on a similarity between two pieces of trajectory data in the first-granularity trajectory dataset and a first similarity threshold; obtaining a second-granularity trajectory dataset corresponding to the candidate trajectory dataset, wherein the second-granularity trajectory dataset is obtained by compressing a target trajectory dataset according to a second compression granularity, the target trajectory dataset including each piece of original trajectory data in the original trajectory dataset, or including each piece of original trajectory data in the original trajectory dataset corresponding to each piece of candidate trajectory data in the candidate trajectory dataset, the second compression granularity being smaller than the first compression granularity; and determining a similar trajectory dataset based on the similarity between two pieces of trajectory data in the second-granularity trajectory dataset and the second similarity threshold. In this way, by compressing the original trajectory data in the original trajectory dataset at different granularities and then performing similarity analysis on the compressed trajectory data of different granularities, not only can the amount of data and computation be greatly reduced, but errors caused by trajectory noise, inconsistent sampling rates, etc. can also be alleviated to a certain extent, thereby improving the efficiency and accuracy of user trajectory overlap detection.

[0197] The present application also provides a track overlap detection device. Figure 6 , Figure 6: This is a structural diagram of the track coincidence detection device provided in the embodiment of the present application. Since the principle of solving the problem of the track coincidence detection device is similar to that of the track coincidence detection method in the embodiment of the present application, the implementation of the track coincidence detection device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0198] like Figure 6 As shown, the track coincidence detection device 600 includes:

[0199] A first acquisition module 601 is used to acquire an original trajectory dataset;

[0200] A processing module 602 is configured to compress each piece of original trajectory data in the original trajectory dataset according to a first compression granularity to obtain a first-granularity trajectory dataset;

[0201] A first determining module 603 is configured to determine a candidate trajectory dataset based on the similarity between each two trajectory data in the first granularity trajectory dataset and a first similarity threshold;

[0202] a second acquisition module 604 configured to acquire a second granularity trajectory dataset corresponding to the candidate trajectory dataset, wherein the second granularity trajectory dataset is obtained by compressing the target trajectory dataset according to a second compression granularity, the target trajectory dataset including each piece of original trajectory data in the original trajectory dataset, or each piece of original trajectory data in the original trajectory dataset corresponding to each piece of candidate trajectory data in the candidate trajectory dataset, and the second compression granularity is smaller than the first compression granularity;

[0203] The second determining module 605 is configured to determine a similar trajectory dataset according to the similarity between every two trajectory data in the second granularity trajectory dataset and a second similarity threshold.

[0204] Optionally, each piece of original trajectory data in the original trajectory data set includes a plurality of position points and a timestamp corresponding to each position point;

[0205] The processing module 602 is configured to merge multiple position points in the first original trajectory data whose corresponding timestamps are in the same time interval of N time intervals to obtain first-granularity trajectory data corresponding to the first original trajectory data, where the first original trajectory data is any original trajectory data in the original trajectory dataset, the time unit of the N time intervals is a first time unit, and N is an integer greater than 1;

[0206] The second acquisition module 604 is configured to merge multiple position points in the second original trajectory data whose corresponding timestamps are in the same time interval of the M time intervals to obtain second-granularity trajectory data corresponding to the second original trajectory data, where the second original trajectory data is any original trajectory data in the target trajectory dataset, the time unit of the M time intervals is a second time unit, the second time unit is smaller than the first time unit, and M is an integer greater than N.

[0207] Optionally, the processing module 602 is configured to determine a plurality of first location points in the first original trajectory data whose corresponding timestamps are in the same time interval among the N time intervals; determine a grid in which each of the plurality of first location points is located based on a grid obtained by pre-rasterizing the map; and merge the grids in which each of the first location points is located to obtain first granular trajectory data including the plurality of merged grids;

[0208] and / or,

[0209] The second acquisition module 604 is configured to determine, in the second original trajectory data, a plurality of second location points whose corresponding timestamps fall within the same time interval of the M time intervals; determine, based on a grid obtained by pre-rasterizing the map, a grid in which each of the plurality of second location points is located; and merge the grids in which each second location point is located to obtain second granular trajectory data comprising the plurality of merged grids.

[0210] Optionally, the second determining module 605 includes:

[0211] a first similarity calculation unit, configured to input each two second-granularity trajectory data in the second-granularity trajectory data set into a pre-trained first Siamese neural network for similarity calculation, and obtain the similarity of each two second-granularity trajectory data output by the first Siamese neural network, wherein the first Siamese neural network is trained based on the trajectory data sample set of the second compressed granularity;

[0212] The first determining unit is configured to determine that each two pieces of second granularity trajectory data are similar trajectory data if the similarity between each two pieces of second granularity trajectory data is greater than the second similarity threshold.

[0213] Optionally, the first twin neural network includes a long short-term memory network LSTM model and a periodic feature extraction module;

[0214] The first similarity calculation unit is used to:

[0215] Mapping the first input trajectory data and the second input trajectory data into first feature vectors respectively through the LSTM model, wherein the first input trajectory data and the second input trajectory data are every two second-granularity trajectory data in the second-granularity trajectory dataset;

[0216] extracting periodic feature vectors from the first input trajectory data and the second input trajectory data respectively according to at least one date type by the periodic feature extraction module;

[0217] fusing the first feature vector and the periodic feature vector of the first input trajectory data to obtain a first fused feature vector, and fusing the first feature vector and the periodic feature vector of the second input trajectory data to obtain a second fused feature vector;

[0218] The similarity between the first fused feature vector and the second fused feature vector is calculated to obtain the similarity between the first input trajectory data and the second input trajectory data.

[0219] Optionally, the periodic feature extraction module includes a first feature extraction submodule, a second feature extraction submodule, a third feature extraction submodule and a feature fusion module;

[0220] The first similarity calculation unit is used to:

[0221] extracting feature values ​​from the first input trajectory data and the second input trajectory data according to a first date type by the first feature extraction submodule, respectively, to obtain a first period feature vector of the first input trajectory data and a first period feature vector of the second input trajectory data, wherein the first date type includes working days and non-working days;

[0222] Extracting feature values ​​from the first input trajectory data and the second input trajectory data respectively according to a second date type by the second feature extraction submodule to obtain a second periodic feature vector of the first input trajectory data and a second periodic feature vector of the second input trajectory data, wherein the second date type includes Monday to Sunday;

[0223] Extracting feature values ​​from the first input trajectory data and the second input trajectory data according to a third date type using the third feature extraction submodule to obtain a third period feature vector of the first input trajectory data and a third period feature vector of the second input trajectory data, wherein the third date type includes the first to the thirty-first day;

[0224] The feature fusion module fuses the first periodic feature vector, the second periodic feature vector, and the third periodic feature vector of the first input trajectory data to obtain a fused periodic feature vector of the first input trajectory data, and fuses the first periodic feature vector, the second periodic feature vector, and the third periodic feature vector of the second input trajectory data to obtain a fused periodic feature vector of the second input trajectory data.

[0225] Optionally, the first determining module 603 includes:

[0226] a second similarity calculation unit, configured to input each two first-granularity trajectory data in the first-granularity trajectory data set into a pre-trained second twin neural network for similarity calculation, and obtain the similarity of each two first-granularity trajectory data output by the second twin neural network, wherein the second twin neural network is trained based on the trajectory data sample set of the first compressed granularity;

[0227] The second determining unit is configured to determine, when the similarity between each two pieces of first granularity trajectory data is greater than the first similarity threshold, that the each two pieces of first granularity trajectory data are candidate trajectory data.

[0228] Optionally, the track coincidence detection device 600 further includes:

[0229] A third determination module is used to determine the user ID corresponding to each trajectory data in the similar trajectory data set to obtain a similar user group;

[0230] The recommendation module is configured to obtain target information related to user characteristics of the similar user group and recommend the target information to the similar user group.

[0231] The trajectory coincidence detection device 600 provided in the embodiment of the present application can execute the above method embodiment, and its implementation principle and technical effects are similar, which will not be repeated in this embodiment.

[0232] The trajectory coincidence detection device 600 of an embodiment of the present application obtains an original trajectory dataset; compresses each piece of original trajectory data in the original trajectory dataset according to a first compression granularity to obtain a first-granularity trajectory dataset; determines a candidate trajectory dataset based on a similarity between every two pieces of trajectory data in the first-granularity trajectory dataset and a first similarity threshold; obtains a second-granularity trajectory dataset corresponding to the candidate trajectory dataset, wherein the second-granularity trajectory dataset is obtained by compressing a target trajectory dataset according to a second compression granularity, the target trajectory dataset including every piece of original trajectory data in the original trajectory dataset, or including every piece of original trajectory data in the original trajectory dataset corresponding to each candidate trajectory data in the candidate trajectory dataset, and the second compression granularity is smaller than the first compression granularity; and determines a similar trajectory dataset based on the similarity between every two pieces of trajectory data in the second-granularity trajectory dataset and the second similarity threshold. In this way, by compressing the original trajectory data in the original trajectory dataset at different granularities and then performing similarity analysis on the compressed trajectory data of different granularities, not only can the amount of data and computation be greatly reduced, but errors caused by trajectory noise, inconsistent sampling rates, etc. can also be alleviated to a certain extent, thereby improving the efficiency and accuracy of user trajectory overlap detection.

[0233] The embodiment of the present application also provides an electronic device. Since the principle of solving the problem by the electronic device is similar to the trajectory coincidence detection method in the embodiment of the present application, the implementation of the electronic device can refer to the implementation of the method, and the repeated parts will not be repeated. Figure 7 As shown, the electronic device according to an embodiment of the present application includes:

[0234] The processor 700 is configured to read the program in the memory 720 and execute the following process:

[0235] Get the original trajectory dataset;

[0236] Compress each piece of original trajectory data in the original trajectory dataset according to a first compression granularity to obtain a first-granularity trajectory dataset;

[0237] Determining a candidate trajectory dataset according to a similarity between every two trajectory data in the first granularity trajectory dataset and a first similarity threshold;

[0238] Obtaining a second-granularity trajectory dataset corresponding to the candidate trajectory dataset, wherein the second-granularity trajectory dataset is obtained by compressing a target trajectory dataset according to a second compression granularity, the target trajectory dataset including each piece of original trajectory data in the original trajectory dataset, or including each piece of original trajectory data in the original trajectory dataset corresponding to each candidate trajectory data in the candidate trajectory dataset, and the second compression granularity is smaller than the first compression granularity;

[0239] A similar trajectory dataset is determined according to the similarity between every two trajectory data in the second granularity trajectory dataset and a second similarity threshold.

[0240] Among them, Figure 7 In the present invention, the bus architecture can include any number of interconnected buses and bridges, specifically linking various circuits such as one or more processors represented by processor 700 and memory represented by memory 720. The bus architecture can also link various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore not further described herein. The bus interface provides an interface. Processor 700 is responsible for managing the bus architecture and general processing, and memory 720 can store data used by processor 700 when performing operations.

[0241] Optionally, each piece of original trajectory data in the original trajectory data set includes a plurality of position points and a timestamp corresponding to each position point;

[0242] The processor 700 is further configured to read the program in the memory 720 and execute the following steps:

[0243] Merging multiple position points whose corresponding timestamps in the first original trajectory data are in the same time interval of N time intervals to obtain first granularity trajectory data corresponding to the first original trajectory data, wherein the first original trajectory data is any original trajectory data in the original trajectory dataset, the time unit of the N time intervals is a first time unit, and N is an integer greater than 1;

[0244] Merge multiple position points in the second original trajectory data whose corresponding timestamps are in the same time interval of M time intervals to obtain second granularity trajectory data corresponding to the second original trajectory data, where the second original trajectory data is any original trajectory data in the target trajectory dataset, the time unit of the M time intervals is a second time unit, the second time unit is smaller than the first time unit, and M is an integer greater than N.

[0245] Optionally, the processor 700 is further configured to read a program in the memory 720 and execute the following steps:

[0246] Determining a plurality of first position points in the first original trajectory data whose corresponding timestamps are in the same time interval among the N time intervals; determining a grid in which each of the plurality of first position points is located based on a grid obtained by pre-rasterizing a map; merging the grids in which each of the first position points is located to obtain first granular trajectory data including the plurality of merged grids;

[0247] and / or,

[0248] Determine a plurality of second position points in the second original trajectory data whose corresponding timestamps are in the same time interval of the M time intervals; determine a grid in which each of the plurality of second position points is located based on a grid obtained by pre-rasterizing a map; and merge the grids in which each of the second position points is located to obtain second granular trajectory data including the plurality of merged grids.

[0249] Optionally, the processor 700 is further configured to read a program in the memory 720 and execute the following steps:

[0250] Inputting every two second-granularity trajectory data in the second-granularity trajectory data set into a pre-trained first Siamese neural network to perform similarity calculation, thereby obtaining the similarity of every two second-granularity trajectory data output by the first Siamese neural network, wherein the first Siamese neural network is trained based on the trajectory data sample set of the second compressed granularity;

[0251] In a case where the similarity between each two pieces of trajectory data of the second granularity is greater than the second similarity threshold, it is determined that each two pieces of trajectory data of the second granularity are similar trajectory data.

[0252] Optionally, the first twin neural network includes a long short-term memory network LSTM model and a periodic feature extraction module;

[0253] The processor 700 is further configured to read the program in the memory 720 and execute the following steps:

[0254] Mapping the first input trajectory data and the second input trajectory data into first feature vectors respectively through the LSTM model, wherein the first input trajectory data and the second input trajectory data are every two second-granularity trajectory data in the second-granularity trajectory dataset;

[0255] extracting periodic feature vectors from the first input trajectory data and the second input trajectory data respectively according to at least one date type by the periodic feature extraction module;

[0256] fusing the first feature vector and the periodic feature vector of the first input trajectory data to obtain a first fused feature vector, and fusing the first feature vector and the periodic feature vector of the second input trajectory data to obtain a second fused feature vector;

[0257] The similarity between the first fused feature vector and the second fused feature vector is calculated to obtain the similarity between the first input trajectory data and the second input trajectory data.

[0258] Optionally, the periodic feature extraction module includes a first feature extraction submodule, a second feature extraction submodule, a third feature extraction submodule and a feature fusion module;

[0259] The processor 700 is further configured to read the program in the memory 720 and execute the following steps:

[0260] extracting feature values ​​from the first input trajectory data and the second input trajectory data according to a first date type by the first feature extraction submodule, respectively, to obtain a first period feature vector of the first input trajectory data and a first period feature vector of the second input trajectory data, wherein the first date type includes working days and non-working days;

[0261] Extracting feature values ​​from the first input trajectory data and the second input trajectory data respectively according to a second date type by the second feature extraction submodule to obtain a second periodic feature vector of the first input trajectory data and a second periodic feature vector of the second input trajectory data, wherein the second date type includes Monday to Sunday;

[0262] Extracting feature values ​​from the first input trajectory data and the second input trajectory data according to a third date type using the third feature extraction submodule to obtain a third period feature vector of the first input trajectory data and a third period feature vector of the second input trajectory data, wherein the third date type includes the first to the thirty-first day;

[0263] The feature fusion module fuses the first periodic feature vector, the second periodic feature vector, and the third periodic feature vector of the first input trajectory data to obtain a fused periodic feature vector of the first input trajectory data, and fuses the first periodic feature vector, the second periodic feature vector, and the third periodic feature vector of the second input trajectory data to obtain a fused periodic feature vector of the second input trajectory data.

[0264] Optionally, the processor 700 is further configured to read a program in the memory 720 and execute the following steps:

[0265] Inputting every two first-granularity trajectory data in the first-granularity trajectory data set into a pre-trained second Siamese neural network to perform similarity calculation, and obtaining the similarity of the every two first-granularity trajectory data output by the second Siamese neural network, wherein the second Siamese neural network is trained based on the trajectory data sample set of the first compressed granularity;

[0266] In a case where the similarity between each two first-granularity trajectory data is greater than the first similarity threshold, each two first-granularity trajectory data are determined as candidate trajectory data.

[0267] Optionally, the processor 700 is further configured to read a program in the memory 720 and execute the following steps:

[0268] Determine the user ID corresponding to each trajectory data in the similar trajectory data set to obtain a similar user group;

[0269] Target information related to user characteristics of the similar user group is obtained, and the target information is recommended to the similar user group.

[0270] The electronic device provided in the embodiment of the present application can execute the above method embodiment, and its implementation principle and technical effects are similar, which will not be repeated in this embodiment.

[0271] In addition, the computer-readable storage medium of the embodiment of the present application is used to store a computer program, which can be executed by a processor to implement Figure 1 The various steps in the method embodiment are shown.

[0272] In the several embodiments provided in this application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection of some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0273] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may be physically included separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0274] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to execute some steps of the sending and receiving methods described in various embodiments of the present application. The aforementioned storage medium includes: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program code.

[0275] The above is a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles described in the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A trajectory coincidence detection method, characterized in that: include: Get the original trajectory dataset; Compress each piece of original trajectory data in the original trajectory dataset according to a first compression granularity to obtain a first-granularity trajectory dataset; Determining a candidate trajectory dataset according to a similarity between every two trajectory data in the first granularity trajectory dataset and a first similarity threshold; Obtaining a second-granularity trajectory dataset corresponding to the candidate trajectory dataset, wherein the second-granularity trajectory dataset is obtained by compressing the target trajectory dataset according to a second compression granularity, the target trajectory dataset including each piece of original trajectory data in the original trajectory dataset, or including each piece of original trajectory data in the original trajectory dataset corresponding to each piece of candidate trajectory data in the candidate trajectory dataset, and the second compression granularity is smaller than the first compression granularity; Determine a similar trajectory dataset according to the similarity between each two trajectory data in the second granularity trajectory dataset and a second similarity threshold; The determining of the candidate trajectory data set according to the similarity between each two trajectory data in the first granularity trajectory data set and a first similarity threshold includes: Inputting every two first-granularity trajectory data in the first-granularity trajectory data set into a pre-trained second Siamese neural network to perform similarity calculation, and obtaining the similarity of the every two first-granularity trajectory data output by the second Siamese neural network, wherein the second Siamese neural network is trained based on the trajectory data sample set of the first compressed granularity; In a case where the similarity between each two first-granularity trajectory data is greater than the first similarity threshold, determining each two first-granularity trajectory data as candidate trajectory data; The determining of a similar trajectory dataset according to the similarity between each two trajectory data in the second granularity trajectory dataset and a second similarity threshold includes: Inputting every two second-granularity trajectory data in the second-granularity trajectory data set into a pre-trained first Siamese neural network to perform similarity calculation, thereby obtaining the similarity of every two second-granularity trajectory data output by the first Siamese neural network, wherein the first Siamese neural network is trained based on the trajectory data sample set of the second compressed granularity; In a case where the similarity between each two pieces of trajectory data of the second granularity is greater than the second similarity threshold, it is determined that each two pieces of trajectory data of the second granularity are similar trajectory data.

2. The method according to claim 1, characterized in that Each piece of original trajectory data in the original trajectory data set includes a plurality of location points and a timestamp corresponding to each location point; The compressing each piece of original trajectory data in the original trajectory dataset according to the first compression granularity to obtain the first granularity trajectory dataset includes: Merging multiple position points whose corresponding timestamps in the first original trajectory data are in the same time interval of N time intervals to obtain first granularity trajectory data corresponding to the first original trajectory data, wherein the first original trajectory data is any original trajectory data in the original trajectory dataset, the time unit of the N time intervals is a first time unit, and N is an integer greater than 1; The obtaining of a second granularity trajectory dataset corresponding to the candidate trajectory dataset includes: Merge multiple position points in the second original trajectory data whose corresponding timestamps are in the same time interval of M time intervals to obtain second granularity trajectory data corresponding to the second original trajectory data, where the second original trajectory data is any original trajectory data in the target trajectory dataset, the time unit of the M time intervals is a second time unit, the second time unit is smaller than the first time unit, and M is an integer greater than N.

3. The method according to claim 2, characterized in that The step of merging a plurality of position points whose corresponding timestamps in the first original trajectory data are in the same time interval of the N time intervals to obtain first granularity trajectory data corresponding to the first original trajectory data includes: Determining a plurality of first position points in the first original trajectory data whose corresponding timestamps are in the same time interval among the N time intervals; determining a grid in which each of the plurality of first position points is located based on a grid obtained by pre-rasterizing a map; merging the grids in which each of the first position points is located to obtain first granular trajectory data including the plurality of merged grids; and / or, The step of merging a plurality of position points whose corresponding timestamps in the second original trajectory data are in the same time interval of the M time intervals to obtain second granularity trajectory data corresponding to the second original trajectory data includes: Determine a plurality of second position points in the second original trajectory data whose corresponding timestamps are in the same time interval of the M time intervals; determine a grid in which each of the plurality of second position points is located based on a grid obtained by pre-rasterizing a map; and merge the grids in which each of the second position points is located to obtain second granular trajectory data including the plurality of merged grids.

4. The method according to claim 1, wherein The first twin neural network includes a long short-term memory network LSTM model and a periodic feature extraction module; Inputting every two second granularity trajectory data in the second granularity trajectory data set into a pre-trained first twin neural network to perform similarity calculation, and obtaining the similarity of every two second granularity trajectory data output by the first twin neural network, includes: Mapping the first input trajectory data and the second input trajectory data into first feature vectors respectively through the LSTM model, wherein the first input trajectory data and the second input trajectory data are every two second-granularity trajectory data in the second-granularity trajectory dataset; extracting periodic feature vectors from the first input trajectory data and the second input trajectory data respectively according to at least one date type by the periodic feature extraction module; fusing the first feature vector and the periodic feature vector of the first input trajectory data to obtain a first fused feature vector, and fusing the first feature vector and the periodic feature vector of the second input trajectory data to obtain a second fused feature vector; The similarity between the first fused feature vector and the second fused feature vector is calculated to obtain the similarity between the first input trajectory data and the second input trajectory data.

5. The method according to claim 1, wherein After determining the similar trajectory dataset based on the similarity between each two trajectory data in the second granularity trajectory dataset and the second similarity threshold, the method further includes: Determine the user ID corresponding to each trajectory data in the similar trajectory data set to obtain a similar user group; Target information related to user characteristics of the similar user group is obtained, and the target information is recommended to the similar user group.

6. A track coincidence detection device, characterized in that: include: The first acquisition module is used to obtain the original trajectory data set; a processing module, configured to compress each piece of original trajectory data in the original trajectory dataset according to a first compression granularity to obtain a first-granularity trajectory dataset; a first determining module, configured to determine a candidate trajectory data set based on a similarity between every two trajectory data in the first granularity trajectory data set and a first similarity threshold; a second acquisition module, configured to acquire a second-granularity trajectory dataset corresponding to the candidate trajectory dataset, wherein the second-granularity trajectory dataset is obtained by compressing the target trajectory dataset according to a second compression granularity, the target trajectory dataset including each piece of original trajectory data in the original trajectory dataset, or including each piece of original trajectory data in the original trajectory dataset corresponding to each piece of candidate trajectory data in the candidate trajectory dataset, and the second compression granularity is smaller than the first compression granularity; a second determining module, configured to determine a similar trajectory dataset according to the similarity between every two trajectory data in the second granularity trajectory dataset and a second similarity threshold; The first determining module includes: a second similarity calculation unit, configured to input each two first-granularity trajectory data in the first-granularity trajectory data set into a pre-trained second twin neural network for similarity calculation, and obtain the similarity of each two first-granularity trajectory data output by the second twin neural network, wherein the second twin neural network is trained based on the trajectory data sample set of the first compressed granularity; a second determining unit, configured to determine, when the similarity between each pair of first granularity trajectory data is greater than the first similarity threshold, that each pair of first granularity trajectory data is candidate trajectory data; The second determining module includes: a first similarity calculation unit, configured to input each two second-granularity trajectory data in the second-granularity trajectory data set into a pre-trained first Siamese neural network for similarity calculation, and obtain the similarity of each two second-granularity trajectory data output by the first Siamese neural network, wherein the first Siamese neural network is trained based on the trajectory data sample set of the second compressed granularity; The first determining unit is configured to determine that each two pieces of second granularity trajectory data are similar trajectory data if the similarity between each two pieces of second granularity trajectory data is greater than the second similarity threshold.

7. An electronic device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor; wherein the processor is configured to read the program in the memory to implement the steps of the trajectory coincidence detection method as described in any one of claims 1 to 5.

8. A computer-readable storage medium for storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the trajectory coincidence detection method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Urban Internet of Vehicles Sybil attack detection method based on coarse and fine granularity trajectory

    CN114339766A

  • Offline optimization of sensor data for agent trajectories

    US20220284619A1