Anomaly detection methods, systems, and electronic devices driven by big data of mobile trajectories

By constructing ASM-CF and Hidden Markov Models and combining them with the Spark parallel processing framework, the problems of low efficiency and insufficient accuracy in detecting taxi detour behavior in existing technologies are solved, achieving more efficient and accurate abnormal trajectory detection.

CN115205086BActive Publication Date: 2025-12-02GUIZHOU MINZU UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210527151.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-16
Publication Date
2025-12-02
Estimated Expiration
2042-05-16

AI Technical Summary

Technical Problem

Existing technologies fail to adequately consider the correlation between actual travel distance and duration and the detour route when detecting taxi detour behavior, resulting in low detection efficiency and insufficient accuracy.

Method used

An ASM-CF model is constructed to calculate the actual driving distance and duration of a vehicle's trajectory under passenger conditions. Trajectory matching is performed by combining a Hidden Markov Model and the Viterbi algorithm. Data preprocessing is carried out using the Spark parallel processing framework. A cost factor based on the actual driving distance and duration is constructed, and an ASM-CF model is built to detect abnormal trajectories.

Benefits of technology

It improves the accuracy and efficiency of abnormal trajectory detection, reduces the amount of computation, lowers the false alarm rate, and can more accurately identify abnormal trajectories of drivers' detour behavior.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115205086B_ABST
    Figure CN115205086B_ABST
Patent Text Reader

Abstract

This invention discloses an abnormal trajectory detection method driven by big data of vehicle movement trajectories, comprising the following steps: S1: acquiring vehicle movement trajectory data and preprocessing the movement trajectory data; S2: extracting vehicle driving trajectory dataset under passenger-carrying conditions, and performing trajectory map matching, gridding, extraction of trajectory pairs with the same starting point, and trajectory enhancement processing; S3: calculating the actual driving distance and duration features of vehicle driving trajectory under passenger-carrying conditions; S4: defining abnormal trajectories of taxi drivers taking detours; S5: constructing a cost factor based on actual driving distance and duration, and constructing an ASM-CF model through the cost factor to improve the accuracy of abnormal trajectory detection; S6: using the ASM-CF model to detect real taxi movement trajectory big data, solving the problem that traditional abnormal trajectory detection methods cannot accurately identify abnormal trajectories of drivers taking detours, and improving the accuracy of abnormal trajectory detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of abnormal trajectory detection technology driven by mobile trajectory big data, and particularly to an abnormal trajectory detection method, system and electronic device driven by mobile trajectory big data. Background Technology

[0002] Trajectory anomalies typically refer to spatial deviations from other trajectories or unexpected behaviors, such as taxis taking detours, hurricanes with sudden changes in wind direction, aircraft circling and maneuvering, and fishing boats frequently changing course. Taxis, as one of the main modes of transportation in cities, bring great convenience to travelers. However, some taxi drivers, in order to gain more profit, maliciously choose routes that are longer than normal, causing chaos in the service market and infringing on the interests of passengers. Therefore, detecting anomalies in passenger travel trajectories based on mobile trajectory big data has important guiding significance and practical application value for improving taxi service quality and protecting the basic interests of passengers.

[0003] Currently, most existing research on abnormal trajectory detection only analyzes spatial anomalies. However, in real life, abnormal trajectories resulting from detours are not only spatially abnormal but also costly anomalies in terms of duration and actual distance traveled, defining passenger travel trajectory anomalies. Therefore, existing detection methods still have limitations in terms of detection efficiency and accuracy in identifying detours. They do not fully consider the correlation between actual travel distance and duration and detours, leading to low accuracy in abnormal trajectory detection. Summary of the Invention

[0004] To address the aforementioned issues, this invention proposes an abnormal trajectory detection method, system, and electronic device driven by big data on mobile trajectories. This method can solve problems such as low detection efficiency and inability to accurately identify abnormal trajectories involving detours, as well as identify abnormal behaviors such as not following normal routes and taking detours.

[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0006] An abnormal trajectory detection method driven by big data on mobile trajectories, characterized by the following steps:

[0007] S1: Acquire vehicle movement trajectory data and preprocess the movement trajectory data;

[0008] S2: Extract the vehicle driving trajectory dataset under passenger-carrying conditions, and perform trajectory map matching, gridding, extraction of trajectory pairs with the same starting point, and enhancement processing on the trajectory in the trajectory pairs;

[0009] S3: Calculate the actual travel distance and duration characteristics of the vehicle's trajectory under passenger-carrying conditions;

[0010] S4: Redefine abnormal trajectories for taxi drivers to detour, defining abnormal trajectories as those that are different in shape and have a longer actual driving distance and duration;

[0011] S5: Construct a cost factor based on actual driving distance and duration, build an ASM-CF model through the cost factor, and use the ASM-CF model to detect abnormal trajectories in real taxi movement trajectory big data.

[0012] S6: Output the abnormal trajectory detection results.

[0013] Furthermore, within the Hadoop distributed computing platform, based on the Spark parallel processing framework, the specific operation steps of S2 include:

[0014] S201: Extract the preprocessed mobile trajectory big data to obtain trajectory data with continuous operating status of 111…10, where the passenger-carrying status is recorded as 1 and the empty status is recorded as 0;

[0015] S202: Remove the trajectory data with continuous operating states of 111…10, and retain only the latitude, longitude and time data of each vehicle driving trajectory in the passenger-carrying state;

[0016] S203: Based on the vehicle driving trajectory data under passenger-carrying status processed in S202, perform map matching to obtain the vehicle's driving trajectory on the actual road network.

[0017] S204: Based on the vehicle driving trajectory data under the matched passenger-carrying state obtained in S203, the road network is rasterized to obtain grid sequence trajectories, the number of starting points in the grid is counted, and trajectory pairs with the same starting point are extracted.

[0018] S205: Enhance the driving trajectory within the trajectory pair with the same starting point to obtain the grid-mapped trajectory represented by the continuous grid sequence.

[0019] Furthermore, the specific steps in S201 include:

[0020] S2011: Read large data of movement trajectories from HDFS files and transform them into a Spark RDD resilient distribution dataset;

[0021] S2012: The RDD elastic distribution dataset is fragmented and the invalid trajectory points with GPS status of 0 are filtered out to obtain the first retained data, which includes vehicle ID, operating status, time and latitude and longitude information;

[0022] S2013: Sort the first retained data according to vehicle ID, and find trajectory data with the same vehicle ID and consecutive operating status of 111...10;

[0023] S2014: Retain trajectory data with continuous operation status of 111…10, that is, vehicle driving trajectory data in passenger-carrying status.

[0024] Furthermore, the specific steps in S203 include:

[0025] S2031: Read the trajectory data under passenger-carrying status described in S2014, then read the map data and perform raster processing on the map, match the GPS observation point to the nearest raster, and take the GPS observation point as the center and a circular area with a radius of 50 meters as the error area, project the road segment within the error area to obtain matching candidate road segments and candidate points.

[0026] S2032: Based on the characteristics of trajectory data and road network data under passenger-carrying conditions, calculate the observation probability and transition probability, construct a Hidden Markov Model, and the formulas for calculating the observation probability and transition probability are as follows:

[0027] The formula for calculating the probability of observation is:

[0028] ,

[0029] in, In the driving trajectory under the passenger-carrying state The trajectory points to be matched at each moment. For trajectory points The One candidate road segment, For trajectory points In candidate road sections Candidate points on, The distance between two points on the Earth's surface. The standard deviation of the trajectory points to be matched. ;

[0030] The formula for calculating the transition probability is:

[0031] ,

[0032] in, trajectory points With trajectory points For adjacent trajectory points, For trajectory points In candidate road sections Candidate points on, , The distance between two points in the road network;

[0033] S2033: Using the Viterbi algorithm and the model formula of observation probability and transition probability, the matching trajectory with the highest probability is calculated, thus obtaining the optimal matching path and the latitude and longitude of the trajectory points of each matching trajectory.

[0034] Furthermore, the specific steps in S204 include:

[0035] S2041: Extract the latitude and longitude information of the boarding and alighting points of the driving trajectory under passenger conditions;

[0036] S2042: Transform the road network The grid is divided into m-sized grids, and the starting point of the driving trajectory is mapped to the grid road network. The number of starting points in each grid is counted to obtain multiple trajectory pairs with the same starting point.

[0037] Furthermore, the specific steps in S205 include:

[0038] S2051: Map each driving trajectory in the trajectory pair to a grid with a size of [missing information]. In a road network of size m, the grid-mapped trajectory is obtained;

[0039] S2052: Enhance the grid mapping trajectory of S2051 by recording all the grids traversed by the trajectory to obtain a continuous grid mapping trajectory.

[0040] Furthermore, the specific steps of S3 include:

[0041] S301: Based on the driving trajectory under the passenger-carrying state, calculate the actual driving distance of the driving trajectory according to the semi-versus formula. and driving duration and longitude and latitude :

[0042] ;

[0043] ;

[0044] ;

[0045] ;

[0046] in, The total number of trajectory points in each driving trajectory. These are the longitude and latitude of the current trajectory point and the next trajectory point, respectively. and These are the timestamps of the starting point of the trajectory, and R is the Earth's radius, which is 6371 kilometers.

[0047] S302: Eliminate driving trajectories with actual driving distance and duration less than 3 kilometers and 5 minutes, respectively.

[0048] Furthermore, the specific steps of S5 include:

[0049] S501: Calculate the trajectory distance between the continuous grid-mapped trajectories. The smaller the trajectory distance, the greater the similarity between the two trajectories; conversely, the larger the trajectory distance, the less similar the two trajectories. The trajectory distance calculation formula is as follows:

[0050] (1)

[0051] in, Represents a continuous grid mapping trajectory Mapping trajectory with continuous grid The length of the grid difference set, and , The total number of trajectories for each trajectory pair. express and The length of the grid union;

[0052] S502: Actual driving distance as described in S301 and duration Obtain cost factors The cost factor is then regularized to obtain a value in [0,1].

[0053] (4)

[0054] (5)

[0055] in, , The total number of trajectories for each trajectory pair;

[0056] S503: Obtain the shape-based trajectory score of the continuous grid-mapped trajectory through difference and union. ;

[0057] (3)

[0058] in, Represents a continuous grid mapping trajectory Mapping trajectory with continuous grid The length of the grid difference set, and , The total number of trajectories for each trajectory pair. express and The length of the grid union;

[0059] S504: Based on the cost factor regularized in S502 and the shape-based trajectory score in S503. Construct an ASM-CF model and obtain anomaly scores for the trajectory based on the ASM-CF model. ;

[0060] (6)

[0061] S505: Sort the anomaly scores of each trajectory pair in descending order, and take the first anomaly score of each trajectory pair. Each anomaly score is a threshold. ,in The number of abnormal trajectories in each trajectory pair;

[0062] S506: The aforementioned abnormal scores With the threshold The comparison is performed. If the abnormal score is greater than or equal to the threshold, it indicates that the driving trajectory is abnormal; otherwise, it indicates that the driving trajectory is normal.

[0063] An abnormal trajectory detection system driven by mobile trajectory big data is characterized by comprising a trajectory data acquisition module, a trajectory data preprocessing module, a model building module, and a trajectory detection module.

[0064] The trajectory data acquisition module is used to acquire driving trajectory data under passenger-carrying conditions and send it to the trajectory data preprocessing module;

[0065] The trajectory data preprocessing module is used to preprocess the driving trajectory data under the passenger-carrying state, obtain grid-mapped driving trajectory data, and send it to the model building module.

[0066] The model building module is used to build an ASM-CF model based on the driving trajectory data mapped by the grid, and to use the ASM-CF model for trajectory detection.

[0067] The trajectory detection module is used to calculate the abnormal trajectory score of the extracted trajectory pair data and judge the abnormality of the trajectory according to the set threshold.

[0068] An electronic device includes a memory and a processor, wherein the memory stores a computer program, characterized in that: when the processor executes the computer program, it implements an abnormal trajectory detection method driven by big data of mobile trajectories.

[0069] The beneficial effects of this invention are:

[0070] First, this invention constructs an ASM-CF model and uses the ASM-CF model for trajectory detection to determine whether there are abnormal behaviors such as detours in the trajectory. This solves the problem of abnormal trajectory detection that cannot accurately identify detours, improves the processing efficiency of large-scale mobile trajectory data, and enhances the accuracy of abnormal trajectory detection.

[0071] Secondly, this invention, based on the Spark parallel processing framework within the Hadoop distributed computing platform, performs preprocessing such as data extraction, data filtering, and deduplication on the mobile trajectory big data, ensuring the quality of the extracted driving trajectory data. It selects trajectory data with states 111…10 instead of all driving trajectory data, primarily detecting abnormal detour behavior based on driving trajectory data under passenger-carrying conditions, and maps the trajectory data to improve the accuracy of abnormal trajectory detection. Because it removes driving trajectory data from when the vehicle is not carrying passengers, it reduces the computational load and accelerates computational efficiency.

[0072] Third, in traditional abnormal trajectory detection, abnormal trajectories are mainly defined as spatial deviations from other trajectories or behaviors that deviate from expectations. However, abnormal trajectories based on drivers' malicious detours are not limited to spatial anomalies. Therefore, defining abnormal trajectories as driving trajectories that are different in shape and have a longer actual driving distance and duration can more accurately explain the problem of abnormal trajectories caused by taxi drivers' detours.

[0073] Fourth, by setting a model threshold, this invention can quickly and easily obtain the abnormal threshold that meets the conditions, thus avoiding the high false alarm rate caused by using the same threshold for different trajectory pairs.

[0074] In summary, this invention utilizes the Resilient Distribution Dataset (RDD) in Spark to preprocess large-scale mobile trajectory data under the Hadoop distributed computing platform, obtaining vehicle trajectories under passenger-carrying conditions. It then extracts pairs of vehicle trajectories with the same starting point, constructs cost factors based on temporal and spatial features, and combines these cost factors with shape-based anomaly scores to build the anomaly scoring model of this invention—the ASM-CF model. This model fully considers the spatial differences in driving trajectories and the cost differences in passenger travel, making it well-suited for anomaly trajectories caused by drivers taking detours out of a sense of complacency. It effectively improves the accuracy and robustness of anomaly trajectory detection, solving the problems of low processing efficiency for large-scale mobile trajectory data, low anomaly trajectory detection efficiency, and the inability to accurately identify anomaly trajectories involving detours. Attached Figure Description

[0075] Figure 1 This invention provides a flowchart of an abnormal trajectory detection method and system driven by big data of mobile trajectory.

[0076] Figure 2 This is a flowchart of trajectory data preprocessing provided in an embodiment of the present invention;

[0077] Figure 3 A flowchart of trajectory data map matching provided in an embodiment of the present invention;

[0078] Figures 4(a)-4(e) are example diagrams of trajectory pairs provided in the embodiments of the present invention;

[0079] Figure 5 A trajectory mapping illustration provided for an embodiment of the present invention;

[0080] Figure 6 This is a diagram illustrating the definition of the abnormal trajectory in this invention;

[0081] Figure 7 This is a framework diagram of an abnormal trajectory detection system driven by big data of mobile trajectory according to the present invention;

[0082] Figure 8 This is a schematic diagram of an abnormal trajectory detection system driven by big data of mobile trajectory, provided in an embodiment of the present invention. Detailed Implementation

[0083] To enable those skilled in the art to better understand the technical solutions of the present invention, the technical solutions of the present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0084] See attached document Figure 1 An abnormal trajectory detection method driven by big data on mobile trajectories includes the following steps:

[0085] S1: Acquire vehicle movement trajectory data and perform preprocessing operations such as data filtering, data missing data, and data redundancy on the movement trajectory data;

[0086] S2: Extract the vehicle driving trajectory dataset under passenger-carrying conditions, and perform trajectory map matching, gridding, extraction of trajectory pairs with the same starting point, and enhancement processing on the trajectory in the trajectory pairs;

[0087] S3: Calculate the actual driving distance and duration characteristics of the vehicle's trajectory under passenger-carrying conditions;

[0088] S4: Redefine the abnormal trajectories of taxi drivers taking detours;

[0089] S5: Construct cost factors based on actual driving distance and duration, and build an ASM-CF model using cost factors;

[0090] S6: Use the ASM-CF model to detect abnormal trajectories in real taxi movement trajectory big data.

[0091] In this embodiment, taxi GPS trajectory big data is used to extract passenger driving trajectory data. Based on the actual driving distance and duration characteristics of the extracted driving trajectory, a cost factor is constructed. Through the strong correlation between the cost factor and the trajectory driving, an abnormal score model based on cost factor (ASM-CF) is constructed. The ASM-CF model is used to detect abnormal trajectories and obtain abnormal scores. The abnormality and normality of the trajectory are output through threshold.

[0092] Reference Appendix Figure 2 Under the Hadoop distributed computing platform, based on the Spark parallel processing framework, the specific steps of S2 include:

[0093] S201: Since the present invention mainly detects whether the driver has detoured during the passenger-carrying process, the driving trajectory data extracted by the present invention should be the vehicle driving trajectory dataset under passenger-carrying conditions, that is, extracting the trajectory data of continuous operation status 111...10 from the preprocessed mobile trajectory data, where passenger-carrying status is recorded as 1 and empty vehicle status is recorded as 0.

[0094] S202: Remove the trajectory data with continuous operating states of 111…10, and retain only the latitude, longitude and time data of each vehicle driving trajectory in the passenger-carrying state;

[0095] S203: Based on the vehicle's driving trajectory data under the passenger-carrying state, perform map matching to obtain its driving trajectory on the actual road network, i.e., the matched vehicle driving trajectory data under the passenger-carrying state.

[0096] S204: Based on the matched vehicle trajectory data under passenger-carrying conditions, the road network is rasterized to obtain a grid sequence trajectory, the number of starting points in the grid is counted, and trajectory pairs with the same starting point are extracted.

[0097] S205: Based on the extracted trajectory pairs, enhance the driving trajectory within the trajectory pairs to obtain the mapped trajectory represented by the continuous grid sequence.

[0098] Furthermore, step S201 specifically includes:

[0099] S2011: Reads movement trajectory data from HDFS files and converts it into a Spark RDD Resilient Distribution Dataset;

[0100] S2012: The RDD elastic distribution dataset is fragmented and data with GPS status of 0 is filtered out, and invalid data is removed to obtain the first retained data. The first retained data includes vehicle ID, operating status, time and latitude and longitude information.

[0101] S2013: Sort the first retained data according to vehicle ID, and find trajectory data with the same vehicle ID and consecutive operating status of 111...10;

[0102] S2014: Retain trajectory data with continuous operational status of 111…10.

[0103] The above method utilizes Spark's Resilient Distribution Dataset (RDD) to process large-scale mobile trajectory data, thereby improving the processing efficiency of such data.

[0104] Further, see Appendix Figure 3 S203 specifically includes the following steps:

[0105] S2031: Read the trajectory data under passenger-carrying status retained in S202, then read the map data to perform raster processing on the map, match the GPS observation point to the nearest raster, and take the GPS observation point as the center and a circular area with a radius of 50 meters as the error area, project the road segments within the error area to obtain matching candidate road segments and candidate points.

[0106] S2032: Analyze the characteristics of trajectory data and road network data (map data) under passenger-carrying conditions, calculate the observation probability and transfer probability, and construct a hidden Markov model;

[0107] The formula for calculating the probability of observation is:

[0108] ,

[0109] in, In the driving trajectory under the passenger-carrying state The trajectory points to be matched at each moment. For trajectory points The One candidate road segment, For trajectory points In candidate road sections Candidate points on, The distance between two points on the Earth's surface. The standard deviation of the trajectory points to be matched. ;

[0110] The formula for calculating the transition probability is:

[0111] ,

[0112] in, trajectory points With trajectory points For adjacent trajectory points, For trajectory points In candidate road sections Candidate points on, , The distance between two points in the road network;

[0113] S2033: The optimal matching path is obtained using the Viterbi algorithm, and the latitude and longitude of the trajectory points of each matching driving trajectory are obtained. The Viterbi algorithm mainly uses the observation probability and transition probability to calculate the matching trajectory with the highest probability.

[0114] Furthermore, the specific operational steps of S204 include:

[0115] S2041: Extract the latitude and longitude of the boarding and alighting points of each passenger-carrying trajectory, that is, the latitude and longitude information of the first operational state 1 and the first operational state 0 of the trajectory data with continuous operational states of 111…10.

[0116] S2042: Transform the road network The grid is divided into m grids, and the starting point of the driving trajectory in the passenger state is mapped to the grid road network. The number of starting points in each grid is counted to obtain the trajectory pairs with a large number of the same starting points. The extracted trajectory pairs are shown in Figures 4(a) to 4(e).

[0117] Further, see Appendix Figure 5 The specific steps in S205 include:

[0118] S2051: Divide the map into The optimal mesh size was determined by comparing experiments with different mesh sizes. m, mapping the trajectory pairs to a grid size of In a road network of size m, a grid mapping trajectory based on a set of grid sequences is obtained. , For the grid number, , The number of trajectory points in the trajectory where the operating state is continuously 111…10;

[0119] S2052: Enhance the mesh mapping trajectory described in S2051, that is, when mapping the trajectory to a mesh, not only record the mesh of the trajectory points, but also record all the meshes that the trajectory has traveled through, such as... Figure 5 As shown, the gray grid represents the enhancement processing applied to the trajectory in this invention, while the black and purple grids represent the grids actually traversed by the trajectory points. This invention records all the grids traversed by the trajectory to obtain the enhanced trajectory of the grid-mapped trajectory. , For the grid number, , This represents the number of grid lines traversed by the vehicle's trajectory while carrying passengers, and .

[0120] Furthermore, the specific steps for S3 to calculate the actual travel distance and duration characteristics of the vehicle's trajectory under passenger-carrying conditions include:

[0121] S301: Based on the driving trajectory under the passenger-carrying state, calculate the actual driving distance of the driving trajectory using the semi-versus formula. and driving duration and longitude and latitude ,in These are the longitudes of the current trajectory point and the next trajectory point, respectively. These are the latitudes of the current trajectory point and the next trajectory point, respectively. and These are the timestamps of the starting and ending points of the trajectory. The Earth's radius is taken as 6371 kilometers.

[0122] ;

[0123] ;

[0124] S302: Eliminate driving trajectories with actual driving distance and duration less than 3 kilometers and 5 minutes, respectively.

[0125] See attached document Figure 6S4 provides a new definition for abnormal trajectories taken by taxi drivers: abnormal trajectories are driving trajectories that are different in shape and have a longer distance and duration.

[0126] Given a pair of trajectories , Let be the logarithm of the extracted trajectory pairs. For each trajectory pair, the total number of trajectories is defined as the frequently traveled trajectories in the original definition of abnormal trajectories. Other trajectories and These are all considered abnormal because very few people travel these routes. However, in reality, it is clear that... It is a shortcut, and and Compared to the normal trajectory While the distance may be slightly longer, if the travel time is less than that of a normal route, it should not be considered a detour. Therefore, in this invention, based on the taxi driver's detour behavior, an abnormal route is defined as a travel trajectory that is different in shape and has a longer distance and duration.

[0127] Furthermore, the specific operation steps of S5 are as follows:

[0128] S501: Obtain the trajectory distance between the continuous grid-mapped trajectories:

[0129] Since the driving trajectory is a set of mapped grid sequences, the distance between the trajectories can be calculated based on the difference and union of the sets. The larger the trajectory distance, the smaller the similarity between the two trajectories; conversely, the smaller the trajectory distance, the greater the similarity between the two trajectories. The specific calculation is shown in equation (1):

[0130] (1)

[0131] in, Represents a continuous grid mapping trajectory Mapping trajectory with continuous grid The length of the grid difference set, and , Let be the total number of trajectories for each trajectory pair, and express and The length of the grid difference set, express and The length of the grid union, for example, , , , , ,but ;

[0132] S502: Obtain the cost factor based on the actual driving distance and duration extracted in S3. And regularize the cost factors;

[0133] (4)

[0134] (5)

[0135] Formula (5) will use cost factors Regularization yields a value between [0,1], which is called the correlation coefficient of the shape anomaly score. The larger the coefficient, the higher the cost to the passenger.

[0136] S503: Obtain the shape-based trajectory score of the mapped trajectory through difference and union. ;

[0137] (3)

[0138] In each trajectory pair, the trajectory pair Composed of multiple trajectories, Let be the logarithm of the extracted trajectory pairs. Let be the total number of trajectories for each trajectory pair. Therefore, by combining the distances of multiple trajectories, the distance between a trajectory and other trajectories can be obtained, as shown in formula (2):

[0139] (2)

[0140] This model is susceptible to extreme values. Although the two trajectories share the same starting point, the grid size used to divide the trajectory pairs differs from the grid size of the final mapped trajectory, potentially leading to a situation where the two trajectories have no intersection. In this case, the denominator of formula (1) is 0. Therefore, if the trajectory is directly... and The trajectory is obtained by averaging the distances. The score given is inappropriate; instead, the ratio of the sum of the differences to the sum of the unions is used directly as the score. The distance to other trajectories, which is directly related to the position of the trajectory, is defined as the shape score of the trajectory, as shown in formula (3).

[0141] S504: Based on the regularized cost factor and shape-based trajectory score. Construct an ASM-CF model and obtain anomaly scores for the trajectory based on the ASM-CF model. ;

[0142] (6)

[0143] S505: Set the threshold for the ASM-CF model: anomaly scores for trajectories. After sorting in descending order, the score of the first... The abnormal score is used as a threshold. For each trajectory pair, specify the number of outlier trajectories; for example... If 20 of the trajectories are abnormal, then the abnormal score of the 20th trajectory is the threshold. This method can quickly and easily obtain the abnormal threshold that meets the conditions, avoiding the high false alarm rate caused by using the same threshold for different trajectories.

[0144] S506: The abnormal score of the trajectory obtained in S504 is used to judge the trajectory by applying the threshold set in S505. If the abnormal score is greater than the threshold, it indicates that the trajectory is abnormal; otherwise, it indicates that the trajectory is normal.

[0145] In summary, combined with the appendix Figure 7 The implementation principle of this invention is as follows: First, data preprocessing: After preprocessing steps such as data filtering, data missing data, and data redundancy, a driving trajectory dataset under passenger-carrying conditions is extracted based on the operational status; and the driving trajectory is matched to the actual road network using a map matching algorithm based on a Hidden Markov Model, reducing the latitude and longitude errors generated when GPS collects trajectory points, and extracting trajectory pairs with the same starting point based on the statistical analysis of the number of starting points within the grid. Second, a mapped trajectory is obtained through gridded trajectory and enhancement processing, reducing the probability of high false alarms caused by different trajectory point records due to different driving paths. Third, a cost factor is constructed based on distance and time, and an ASM-CF model is proposed based on the cost factor to improve the detection of abnormal trajectory behavior caused by drivers deliberately detouring in the moving trajectory. This model mainly detects abnormal trajectories by combining the cost factor with the trajectory shape score, and performs detouring analysis on the detected abnormal trajectories. Finally, the abnormality of the trajectory is judged based on a threshold, and the abnormality status of the trajectory is output.

[0146] This invention also discloses an abnormal trajectory detection system driven by big data on mobile trajectories, combined with the attached... Figure 6 It can be seen that the abnormal trajectory detection system includes: a trajectory data acquisition module, a trajectory data preprocessing module, a model building module, and a trajectory detection module;

[0147] The trajectory data acquisition module is used to acquire and extract driving trajectory data under passenger-carrying conditions and send it to the trajectory data preprocessing module.

[0148] The trajectory data preprocessing module is used to preprocess the driving trajectory data under the passenger-carrying state, obtain grid-mapped driving trajectory data, and send it to the model building module.

[0149] The model building module is used to construct an abnormal trajectory detection method (ASM-CF model) based on the cost factor anomaly score model according to the driving trajectory data of the grid mapping, and to use the ASM-CF model to perform trajectory detection;

[0150] The trajectory detection module is used to calculate the abnormal trajectory score of the extracted trajectory pair data and judge the abnormality of the trajectory according to the set threshold.

[0151] The trajectory data acquisition module obtains trajectory data with continuous operating status of 111…10 through step S201;

[0152] The trajectory data preprocessing module obtains the driving trajectory that matches the actual road network through step S203; obtains trajectory pairs with the same starting point through step 204; and obtains the mapped trajectory with the grid sequence as a set through step 205.

[0153] The model building module obtains the trajectory distance between driving trajectories through formula (1), obtains the score of driving trajectory based on spatial location through formulas (2)-(3), obtains the cost factor of driving trajectory through formula (4), and obtains the abnormal score model based on cost factor shown in formula (6).

[0154] The trajectory detection module obtains the threshold for judging whether the trajectory is abnormal through S505, and judges whether the driving trajectory is abnormal or normal through the judgment method of S506.

[0155] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications are included within the scope of the present invention as claimed. The scope of protection of the present invention is defined by the appended claims and their equivalents.

Claims

1. A method for detecting abnormal trajectories driven by big data on mobile trajectories, characterized in that, Includes the following steps: S1: Acquire vehicle movement trajectory data and preprocess the movement trajectory data; S2: Extract the vehicle driving trajectory dataset under passenger-carrying conditions, and perform trajectory map matching, gridding, extraction of trajectory pairs with the same starting point, and enhancement processing on the trajectory in the trajectory pairs; S3: Calculate the actual travel distance and duration characteristics of the vehicle's trajectory under passenger-carrying conditions; S4: Redefine abnormal trajectories for taxi drivers to detour, defining abnormal trajectories as those that are different in shape and have a longer actual driving distance and duration; S5: Construct a cost factor based on actual driving distance and duration, build an ASM-CF model through the cost factor, and use the ASM-CF model to detect abnormal trajectories in real taxi movement trajectory big data. S6: Output the abnormal trajectory detection results; Specifically, within the Hadoop distributed computing platform, based on the Spark parallel processing framework, the specific operation steps of S2 include: S201: Extract the preprocessed mobile trajectory big data to obtain trajectory data with continuous operating status of 111…10, where the passenger-carrying status is recorded as 1 and the empty status is recorded as 0; S202: Remove the trajectory data with continuous operating states of 111…10, and retain only the latitude, longitude and time data of each vehicle driving trajectory in the passenger-carrying state; S203: Based on the vehicle driving trajectory data under passenger-carrying status processed in S202, perform map matching to obtain the vehicle's driving trajectory on the actual road network. S204: Based on the vehicle driving trajectory data under the matched passenger-carrying state obtained in S203, the road network is rasterized to obtain grid sequence trajectories, the number of starting points in the grid is counted, and trajectory pairs with the same starting point are extracted. S205: Enhance the driving trajectory within the trajectory pair with the same starting point to obtain the grid-mapped trajectory represented by the continuous grid sequence; The specific steps in S205 include: S2051: Map each driving trajectory in the trajectory pair to a grid with a size of [missing information]. In a road network of size m, the grid-mapped trajectory is obtained; S2052: Enhance the grid mapping trajectory of S2051 by recording all the grids traversed by the trajectory to obtain a continuous grid mapping trajectory; The specific steps of S3 include: S301: Based on the driving trajectory under the passenger-carrying state, calculate the actual driving distance of the driving trajectory according to the semi-versus formula. and driving duration and longitude and latitude : ; ; ; ; in, The total number of trajectory points in each driving trajectory. These are the longitude and latitude of the current trajectory point and the next trajectory point, respectively. and These are the timestamps of the starting point of the trajectory, and R is the Earth's radius, which is 6371 kilometers. S302: Eliminate driving trajectories with actual driving distance and duration less than 3 kilometers and 5 minutes, respectively; The specific steps of S5 include: S501: Calculate the trajectory distance between the continuous grid-mapped trajectories. The smaller the trajectory distance, the greater the similarity between the two trajectories; conversely, the larger the trajectory distance, the less similar the two trajectories. The trajectory distance calculation formula is as follows: (1) in, Represents a continuous grid mapping trajectory Mapping trajectory with continuous grid The length of the grid difference set, and , The total number of trajectories for each trajectory pair. express and The length of the grid union; S502: Actual driving distance as described in S301 and duration Obtain cost factors The cost factor is then regularized to obtain a value in [0,1]. (4) (5) in, , The total number of trajectories for each trajectory pair; S503: Obtain the shape-based trajectory score of the continuous mesh mapping trajectory based on the difference and union. ; (3) in, Represents a continuous grid mapping trajectory Mapping trajectory with continuous grid The length of the grid difference set, and , The total number of trajectories for each trajectory pair. express and The length of the grid union; S504: Based on the cost factor regularized in S502 and the shape-based trajectory score in S503. Construct an ASM-CF model and obtain anomaly scores for the trajectory based on the ASM-CF model. ; (6) S505: Sort the anomaly scores of each trajectory pair in descending order, and take the first anomaly score of each trajectory pair. Each anomaly score is a threshold. ,in The number of abnormal trajectories in each trajectory pair; S506: The aforementioned abnormal scores With the threshold The comparison is performed. If the abnormal score is greater than or equal to the threshold, it indicates that the driving trajectory is abnormal; otherwise, it indicates that the driving trajectory is normal.

2. The abnormal trajectory detection method driven by big data of mobile trajectory according to claim 1, characterized in that, The specific steps in S201 include: S2011: Read large data of movement trajectories from HDFS files and transform them into a Spark RDD resilient distribution dataset; S2012: The RDD elastic distribution dataset is fragmented and the invalid trajectory points with GPS status of 0 are filtered out to obtain the first retained data, which includes vehicle ID, operating status, time and latitude and longitude information; S2013: Sort the first retained data according to vehicle ID, and find trajectory data with the same vehicle ID and consecutive operating status of 111...10; S2014: Retain trajectory data with continuous operation status of 111…10, that is, vehicle driving trajectory data in passenger-carrying status.

3. The abnormal trajectory detection method driven by big data of mobile trajectory according to claim 2, characterized in that, The specific steps in S203 include: S2031: Read the trajectory data under passenger-carrying status described in S2014, then read the map data and perform raster processing on the map, match the GPS observation point to the nearest raster, and take the GPS observation point as the center and a circular area with a radius of 50 meters as the error area, project the road segment within the error area to obtain matching candidate road segments and candidate points. S2032: Based on the characteristics of trajectory data and road network data under passenger-carrying conditions, calculate the observation probability and transition probability, construct a Hidden Markov Model, and the formulas for calculating the observation probability and transition probability are as follows: The formula for calculating the probability of observation is: , in, In the driving trajectory under the passenger-carrying state The trajectory points to be matched at each moment. For trajectory points The One candidate road segment, For trajectory points In candidate road sections Candidate points on, The distance between two points on the Earth's surface. The standard deviation of the trajectory points to be matched. ; The formula for calculating the transition probability is: , in, trajectory points With trajectory points For adjacent trajectory points, For trajectory points In candidate road sections Candidate points on, The distance between two points in the road network; S2033: Using the Viterbi algorithm and the model formula of observation probability and transition probability, the matching trajectory with the highest probability is calculated, thus obtaining the optimal matching path and the latitude and longitude of the trajectory points of each matching trajectory.

4. The abnormal trajectory detection method driven by big data of mobile trajectory according to claim 3, characterized in that, The specific steps in S204 include: S2041: Extract the latitude and longitude information of the boarding and alighting points of the driving trajectory under passenger conditions; S2042: Transform the road network The grid is divided into m-sized grids, and the starting point of the driving trajectory is mapped to the grid road network. The number of starting points in each grid is counted to obtain multiple trajectory pairs with the same starting point.

5. An abnormal trajectory detection system driven by big data on mobile trajectories, characterized in that, The method for detecting abnormal trajectories driven by big data of mobile trajectory as described in claim 1 includes a trajectory data acquisition module, a trajectory data preprocessing module, a model building module, and a trajectory detection module. The trajectory data acquisition module is used to acquire driving trajectory data under passenger-carrying conditions and send it to the trajectory data preprocessing module; The trajectory data preprocessing module is used to preprocess the driving trajectory data under the passenger-carrying state, obtain grid-mapped driving trajectory data, and send it to the model building module. The model building module is used to build an ASM-CF model based on the driving trajectory data mapped by the grid, and to use the ASM-CF model for trajectory detection. The trajectory detection module is used to calculate the abnormal trajectory score of the extracted trajectory pair data and judge the abnormality of the trajectory according to the set threshold.

6. An electronic device comprising a memory and a processor, the memory storing a computer program, characterized in that; When the processor executes the computer program, it implements the abnormal trajectory detection method driven by big data of mobile trajectory as described in any one of claims 1-4.

Citation Information

Patent Citations

  • Vehicle GPS data map matching method based on hidden markov model

    CN106595680A

  • Passenger-carrying hotspot parallel prediction method and system, terminal and computer storage medium

    CN112070529A