A method for identifying abnormal taxi orders based on density clustering method
Through the abnormal order identification method based on density clustering method, combined with data preprocessing and grid processing, abnormal taxi orders are identified and analyzed, which solves the problem of low detection efficiency and accuracy in the existing technology and realizes the detection of taxis. The accurate identification of abnormal orders and the analysis of spatiotemporal distribution characteristics provide a basis for law enforcement.
Patent Information
- Application Number
- CN202110829406.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-22
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2041-07-22
AI Technical Summary
In the existing technology, the clustering algorithm and the anomaly identification algorithm are separated, resulting in low detection efficiency and accuracy of taxi order data, and the inability to effectively identify abnormal orders.
Adopt an abnormal order identification method based on density clustering method, including data preprocessing, grid processing, abnormal sample point identification and spatiotemporal distribution feature analysis. Automatic identification and aggregation are realized through the DBSCAN algorithm and grid division, improving the accuracy of the algorithm. .
It achieves automatic and accurate identification of abnormal taxi orders, provides analysis results of spatiotemporal distribution characteristics, provides law enforcement basis for relevant departments, and significantly improves detection efficiency and accuracy.
Smart Images

Figure CN113673571B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of traffic big data applications, and in particular to an abnormal order recognition method based on a density clustering method. Background Art
[0002] In real life, taxi drivers may take detours to increase their income. This behavior is usually discovered through active reports from passengers, but some abnormal behaviors cannot be handled in a timely manner because passengers may not be familiar with the route. With the continuous improvement of informatization, the popularity of vehicle-mounted GPS devices is also increasing. Therefore, relevant features can be extracted from vehicle order information to identify possible abnormal orders and provide them for further analysis and processing by relevant departments.
[0003] The clustering algorithm and the anomaly recognition algorithm in the existing technology are separate, and a secondary judgment of the order data is required. The detection efficiency and accuracy are not high. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide an abnormal order identification method based on the density clustering method, so as to identify possible abnormal orders in the taxi operation process, identify abnormal behaviors, and provide data support for further processing by relevant departments.
[0005] In order to solve the above technical problems, the present invention provides an abnormal order identification method based on density clustering method, comprising the following steps:
[0006] Step 1: Preprocess the original data, including data coordinate system conversion and data cleaning;
[0007] Step 2: Grid the preprocessed data;
[0008] Step 3: Identify abnormal sample points in each similar order cluster using a density-based clustering method;
[0009] Step 4: Analyze the anomaly recognition results to obtain the spatiotemporal distribution characteristics of possible abnormal orders.
[0010] An abnormal order identification system based on density clustering method includes the following modules:
[0011] Data preprocessing module: used to preprocess the original data, including data coordinate system conversion and data cleaning;
[0012] Gridding module: used to grid the preprocessed data;
[0013] Abnormal order identification module: used to identify abnormal sample points in each similar order cluster;
[0014] Abnormal order analysis module: used to analyze the abnormal identification results and obtain the spatiotemporal distribution characteristics of possible abnormal orders.
[0015] Compared with the prior art, the invention has the following beneficial effects:
[0016] (1) Based on the clustering algorithm, the present invention can realize the automatic identification of possible abnormal orders, aggregate similar orders through grid division, and correct the results, which can significantly improve the accuracy of the algorithm;
[0017] (2) After identifying abnormal vehicle orders, the present invention performs result analysis and analyzes the temporal and spatial distribution characteristics of abnormal orders, which can provide basic analysis results and law enforcement basis for relevant departments.
[0018] The present invention will be further described below through specific implementation modes and accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 The figure is a flow chart of the method of the present invention.
[0020] Figure 2 This is a sample distribution diagram of orders with similar start and end points in an embodiment of the present invention.
[0021] Figure 3 This is a cluster distribution diagram of the clustering results in the embodiment of the present invention.
[0022] Figure 4 This is a diagram of possible abnormal order identification results in an embodiment of the present invention.
[0023] Figure 5 This is a distribution diagram of possible abnormal orders on different days in an embodiment of the present invention.
[0024] Figure 6 The information of the driver who may have more abnormal orders in the embodiment of the present invention
[0025] Figure 7 This is the possible abnormal order distribution on different characteristic days and characteristic times in the embodiment of the present invention. DETAILED DESCRIPTION
[0026] A method for identifying abnormal taxi orders based on density clustering method comprises the following steps:
[0027] Step 1: The original data has been processed for the convenience of storage. At the same time, there are also erroneous data, so the original data needs to be preprocessed, including data coordinate system conversion and data cleaning, specifically:
[0028] Step 1-1: In the original data, longitude and latitude are stored in string form, and the decimal point is omitted. Therefore, according to the characteristics of the study area, the longitude and latitude are restored and converted into numerical types;
[0029] Convert the longitude and latitude stored in the original data as strings into numerical values;
[0030] Step 1-2: Eliminate erroneous data and duplicate data. The erroneous data includes data with missing longitude and latitude and data with longitude and latitude exceeding the target research area. The duplicate data refers to data that appears repeatedly in the same travel order.
[0031] Step 2: The original order data contains the POI information of the starting and ending points of the order. However, due to the small POI granularity, we consider using grid processing to aggregate the orders according to the grids where the starting and ending points are located to obtain statistically significant information of larger granularity. At the same time, by reasonably setting the grid size, we ensure the rationality of the results.
[0032] Therefore, the preprocessed data is gridded, specifically:
[0033] Step 2-1: Since the WGS-84 geodetic coordinate system belongs to the spherical coordinate system, directly performing a linear offset loading grid on the WGS-84 coordinate system will cause a nonlinear offset, which is different from the actual situation;
[0034] This method adopts UTM plane coordinates, projects WGS-84 geodetic coordinates onto the UTM plane, and linearly offsets the grid to complete grid loading;
[0035] Step 2-2: According to the boundaries of the selected area, determine the grid numbers of the start and end points of each order in the data:
[0036]
[0037] where x i and i Indicates the coordinates of the order start or end point, y up and x left Indicates the latitude of the northern boundary and the longitude of the southern boundary of the selected area, and gridsize indicates the grid size.
[0038] Step 3: Identify abnormal sample points in each similar order cluster using a density-based clustering method, which specifically includes the following steps:
[0039] Step 3-1: Extract order features, including:
[0040] Travel time: Get the time taken for an order based on the start time of the order;
[0041] Start-end distance: After grid division, the actual boarding and alighting coordinates in the same grid may be different, so this parameter is added to make a more refined distinction between different orders;
[0042] Euclidean speed: The Euclidean speed of an order is obtained based on the straight-line distance between the start and end points of the order and the travel time of the order. This speed does not represent the actual travel speed, but it can characterize the vehicle speed to a certain extent.
[0043] Whether the order is placed during peak hours. Since the traffic conditions during peak hours are significantly different from those during off-peak hours, this has a significant impact on the time it takes to place an order and is also a factor that needs to be considered.
[0044] The order period is a weekday or a weekend. For the same period, the traffic conditions on weekdays and weekends may be quite different, so this factor also needs to be considered.
[0045] Step 3-2: Aggregate orders. Based on the grid division method, aggregate the orders with the same starting and ending grid numbers in the target area. For orders with close straight-line distances between the starting and ending points (characterized by the straight-line distances between the starting and ending points), their order durations are similar, so the sample distribution is clustered.
[0046] Step 3-3: Cluster the orders based on the density clustering method (DBSCAN) and the features extracted in step 3-1, specifically:
[0047] Based on the density clustering method, the orders are clustered according to the parameters extracted in step 3-1, and the sample points in different areas are separated;
[0048] Since abnormal orders are far away from normal sample points, the different clusters identified are distinguished according to the order duration;
[0049] For each cluster, the median of its order duration and the set threshold are used for judgment, as shown in the following formula:
[0050]
[0051] Among them, l i is the label value of cluster i, 1 represents a normal sample, -1 represents an abnormal sample, t m,i is the median order duration of cluster i, T m is the median order duration of all samples;
[0052] Since some normal samples are far away from densely populated areas in the sample space (such as uncommon boarding and alighting points), their clusters are marked as -1 after the DBSCAN algorithm. For orders with a cluster marked as -1, their order durations are compared with the set threshold one by one.
[0053] Step 4: Analyze the anomaly recognition results to obtain the spatiotemporal distribution characteristics of possible abnormal orders. The specific analysis indicators are:
[0054] Overall order ratio: refers to the ratio of potentially abnormal orders to the total number of orders;
[0055] Distribution on different dates: used to monitor the absolute number and proportion of abnormal orders on different dates, and then to find out the cause when the indicator fluctuates abnormally;
[0056] Possible number of abnormal orders for different drivers: Count the number of possible abnormal orders for different drivers, and then conduct further investigation on drivers with higher number;
[0057] Distribution of abnormal orders on different characteristic days and during different characteristic time periods: By counting abnormal orders on different characteristic days and during different characteristic time periods.
[0058] An abnormal order identification system based on density clustering method includes the following modules:
[0059] Data preprocessing module: used to preprocess the original data, including data coordinate system conversion and data cleaning;
[0060] Gridding module: used to grid the preprocessed data;
[0061] Abnormal order identification module: used to identify abnormal sample points in each similar order cluster;
[0062] Abnormal order analysis module: used to analyze the abnormal identification results and obtain the spatiotemporal distribution characteristics of possible abnormal orders.
[0063] A computer device comprises 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 following steps are implemented:
[0064] Step 1: Preprocess the original data, including data coordinate system conversion and data cleaning;
[0065] Step 2: Grid the preprocessed data;
[0066] Step 3: Identify abnormal sample points in each similar order cluster using a density-based clustering method;
[0067] Step 4: Analyze the anomaly recognition results to obtain the spatiotemporal distribution characteristics of possible abnormal orders.
[0068] A computer storable medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0069] Step 1: Preprocess the original data, including data coordinate system conversion and data cleaning;
[0070] Step 2: Grid the preprocessed data;
[0071] Step 3: Identify abnormal sample points in each similar order cluster using a density-based clustering method;
[0072] Step 4: Analyze the anomaly recognition results to obtain the spatiotemporal distribution characteristics of possible abnormal orders.
[0073] The present invention will be further described below by way of examples.
[0074] Example
[0075] Combination Figure 1 ,A taxi abnormal order recognition method based on density clustering method, comprises the following steps:
[0076] Step 1: The original data has been processed for the convenience of storage. At the same time, there are also erroneous data, so the original data needs to be preprocessed, including data coordinate system conversion and data cleaning, specifically:
[0077] Step 1-1: In the original data, longitude and latitude are stored in string form, and the decimal point is omitted. Therefore, according to the characteristics of the study area, the longitude and latitude are restored and converted into numerical types;
[0078] Convert the longitude and latitude stored in the original data as strings into numerical values;
[0079] Step 1-2: Eliminate erroneous data and duplicate data. The erroneous data includes data with missing longitude and latitude and data with longitude and latitude exceeding the target research area. The duplicate data refers to data that appears repeatedly in the same travel order.
[0080] Step 2: The original order data contains the POI information of the starting and ending points of the order. However, due to the small POI granularity, we consider using grid processing to aggregate the orders according to the grids where the starting and ending points are located to obtain statistically significant information of larger granularity. At the same time, by reasonably setting the grid size, we ensure the rationality of the results.
[0081] Therefore, the preprocessed data is gridded, specifically:
[0082] Step 2-1: Since the WGS-84 geodetic coordinate system belongs to the spherical coordinate system, directly performing a linear offset loading grid on the WGS-84 coordinate system will cause a nonlinear offset, which is different from the actual situation;
[0083] This method adopts UTM plane coordinates, projects WGS-84 geodetic coordinates onto the UTM plane, and linearly offsets the grid to complete grid loading;
[0084] Step 2-2: According to the boundaries of the selected area, determine the grid numbers of the start and end points of each order in the data:
[0085]
[0086] where x i and i Indicates the coordinates of the order start or end point, y up and x left Indicates the latitude of the northern boundary and the longitude of the southern boundary of the selected area, and gridsize indicates the grid size.
[0087] Step 3: Identify abnormal sample points in each similar order cluster using a density-based clustering method, which specifically includes the following steps:
[0088] Step 3-1: Extract order features, including:
[0089] Travel time: Get the time taken for an order based on the start time of the order;
[0090] Start-end distance: After grid division, the actual boarding and alighting coordinates in the same grid may be different, so this parameter is added to make a more refined distinction between different orders;
[0091] Euclidean speed: The Euclidean speed of an order is obtained based on the straight-line distance between the start and end points of the order and the travel time of the order. This speed does not represent the actual travel speed, but it can characterize the vehicle speed to a certain extent.
[0092] Whether the order is placed during peak hours. Since the traffic conditions during peak hours are significantly different from those during off-peak hours, this has a significant impact on the time it takes to place an order and is also a factor that needs to be considered.
[0093] The order period is a weekday or a weekend. For the same period, the traffic conditions on weekdays and weekends may be quite different, so this factor also needs to be considered.
[0094] Step 3-2: Aggregate orders. Based on the grid division method, aggregate the orders with the same starting and ending grid numbers in the target area. For orders with close straight-line distances between the starting and ending points (characterized by the straight-line distances between the starting and ending points), their order durations are close, so the sample distribution has clustering, such as Figure 2 As shown in Figure 1, the sample point distribution of some orders with similar starting and ending points has obvious cluster distribution characteristics.
[0095] Step 3-3: Cluster the orders based on the density clustering method (DBSCAN) and the features extracted in step 3-1, specifically:
[0096] Based on the density clustering method, the orders are clustered according to the parameters extracted in step 3-1, and the sample points in different areas are separated;
[0097] Figure 3 This is the clustering result. The points of different sizes in the circle represent different clusters.
[0098] Since abnormal orders are far away from normal sample points, the different clusters identified are distinguished according to the order duration;
[0099] For each cluster, the median of its order duration and the set threshold are used for judgment, as shown in the following formula:
[0100]
[0101] Among them, l i is the label value of cluster i, 1 represents a normal sample, -1 represents an abnormal sample, t m,i is the median order duration of cluster i, T m is the median order duration of all samples;
[0102] Since some normal samples are far away from densely populated areas in the sample space (such as uncommon boarding and alighting points), their clusters are marked as -1 after the DBSCAN algorithm. For orders with a cluster marked as -1, their order durations are compared with the set threshold one by one.
[0103] like Figure 4 As shown, the points in the circle are possible abnormal order identification results.
[0104] Step 4: Analyze the anomaly recognition results to obtain the spatiotemporal distribution characteristics of possible abnormal orders. The specific analysis indicators are:
[0105] Overall order ratio: refers to the ratio of potentially abnormal orders to the total number of orders;
[0106] We now analyze the top 100 hot ODs in December 2019, with a total of 190,855 orders, of which 9,198 were identified as possible abnormal orders, accounting for about 5%, which also shows that the generation of abnormal orders is a low-probability event. At the same time, there may be multiple reasons for these abnormal orders, which require further investigation by relevant departments.
[0107] Distribution on different dates: used to monitor the absolute number and proportion of abnormal orders on different dates, and then to find the cause when the indicator fluctuates abnormally; Figure 5The figure shows the number and proportion of possible abnormal orders in December 2019. The absolute number fluctuates greatly, while the proportion of possible abnormal orders is relatively stable. Among them, the abnormal fluctuation on November 29, 2019 was due to data problems, and there was less data on that day.
[0108] Possible number of abnormal orders for different drivers: Count the number of possible abnormal orders for different drivers, and then conduct further investigation on drivers with higher number; Figure 6 The top ten drivers with the most abnormal orders are shown. Since the order duration is also affected by the driver's driving habits, road congestion conditions, etc., further investigation of the vehicle can be carried out based on this preliminary result.
[0109] Distribution of abnormal orders on different characteristic days and during different characteristic time periods: By counting abnormal orders on different characteristic days and during different characteristic time periods.
[0110] Figure 7 It shows that there is no significant difference in the proportion of abnormal orders on different characteristic days and characteristic time periods. Therefore, it can be determined that the incidence rate of abnormal orders has little correlation with time characteristics.
[0111] The present invention is based on a clustering algorithm, which can realize automatic identification of possible abnormal orders, aggregate similar orders through grid division, and correct the results, which can significantly improve the accuracy of the algorithm; after identifying abnormal vehicle orders, the results are analyzed, and the temporal and spatial distribution characteristics of abnormal orders are analyzed, which can provide basic analysis results and law enforcement basis for relevant departments.
[0112] The above embodiments are only preferred implementation modes of the present invention. It should be pointed out that ordinary technicians in this technical field can make several improvements and equivalent substitutions without departing from the principles of the present invention. These technical solutions after improvements and equivalent substitutions to the claims of the present invention all fall within the protection scope of the present invention.
Claims
1. A method for identifying abnormal taxi orders based on density clustering method, characterized in that: The following steps are involved: Step 1: Preprocess the original data, including data coordinate system conversion and data cleaning, specifically: Step 1-1: Convert the longitude and latitude stored in the original data as strings into numerical values; Step 1-2: Eliminate erroneous data and duplicate data. The erroneous data includes data with missing longitude and latitude and data with longitude and latitude beyond the target research area. The duplicate data refers to data that appears repeatedly in the same travel order. Step 2: Grid the preprocessed data; Step 3: Identify abnormal sample points in each similar order cluster using a density-based clustering method: Step 3-1: Extract order features: Travel time: Get the time taken for an order based on the start time of the order; Start-end distance: After grid division, the actual boarding and alighting coordinates in the same grid may be different, so this parameter is added to make a more refined distinction between different orders; Euclidean speed: The Euclidean speed of an order is obtained based on the straight-line distance between the start and end points of the order and the travel time of the order. Whether the order is during peak hours; The order period is a working day or a rest day; Step 3-2: Aggregate orders. Based on the grid division method, aggregate the orders with the same starting and ending grid numbers in the target area. For orders with close straight-line distances between the starting and ending points, their order durations are similar, so the sample distribution is clustered. Step 3-3: Cluster the orders based on the density clustering method and the features extracted in step 3-1: Based on the density clustering method, the orders are clustered according to the parameters extracted in step 3-1, and the sample points in different areas are separated; Since abnormal orders are far away from normal sample points, the different clusters identified are distinguished according to the order duration; For each cluster, the median of its order duration and the set threshold are used for judgment, as shown in the following formula: Among them, l i is the label value of cluster i, 1 represents a normal sample, -1 represents an abnormal sample, t m,i is the median order duration of cluster i, T m is the median order duration of all samples; For clusters marked as -1, the order duration is compared with the set threshold one by one; Step 4: Analyze the anomaly recognition results to obtain the spatiotemporal distribution characteristics of possible abnormal orders. The specific analysis indicators are: Overall order ratio: refers to the ratio of potentially abnormal orders to the total number of orders; Distribution on different dates: used to monitor the absolute number and proportion of abnormal orders on different dates, and then to find out the cause when the indicator fluctuates abnormally; Possible number of abnormal orders for different drivers: Count the number of possible abnormal orders for different drivers, and then conduct further investigation on drivers with higher number; Distribution of abnormal orders on different characteristic days and during different characteristic time periods: By counting abnormal orders on different characteristic days and during different characteristic time periods.
2. The method for identifying abnormal taxi orders based on density clustering method according to claim 1 is characterized in that: The gridding process of the pre-processed data in step 2 is specifically as follows: Step 2-1: Project the WGS-84 geodetic coordinates onto the UTM plane and perform linear offset on the grid to complete grid loading; Step 2-2: According to the boundaries of the selected area, determine the grid numbers of the start and end points of each order in the data: where x i and i Indicates the coordinates of the order start or end point, y up and x left Indicates the latitude of the northern boundary and the longitude of the southern boundary of the selected area, and gridsize indicates the grid size.
3. An abnormal order identification system based on density clustering method, characterized in that: Includes the following modules: Data preprocessing module: used to preprocess the original data, including data coordinate system conversion and data cleaning, including: Convert the longitude and latitude stored in the original data as strings into numerical values; Eliminate erroneous data and duplicate data. The erroneous data includes data with missing longitude and latitude and data with longitude and latitude outside the target research area. The duplicate data refers to data that appears repeatedly in the same travel order. Gridding module: used to grid the preprocessed data; Abnormal order identification module: used to identify abnormal sample points in each similar order cluster, including: Extract order features: Travel time: Get the time taken for an order based on the start time of the order; Start-end distance: After grid division, the actual boarding and alighting coordinates in the same grid may be different, so this parameter is added to make a more refined distinction between different orders; Euclidean speed: The Euclidean speed of an order is obtained based on the straight-line distance between the start and end points of the order and the travel time of the order. Whether the order is during peak hours; The order period is a working day or a rest day; Aggregate orders. Based on the grid division method, the orders with the same starting and ending grid numbers in the target area are aggregated. For orders with close straight-line distances between the starting and ending points, their order durations are similar, so the sample distribution is clustered. Cluster the orders based on the density clustering method and the extracted features: Based on the density clustering method, the orders are clustered according to the extracted parameters, and the sample points in different areas are separated; Since abnormal orders are far away from normal sample points, the different clusters identified are distinguished according to the order duration; For each cluster, the median of its order duration and the set threshold are used for judgment, as shown in the following formula: Among them, l i is the label value of cluster i, 1 represents a normal sample, -1 represents an abnormal sample, t m,i is the median order duration of cluster i, T m is the median order duration of all samples; For clusters marked as -1, the order duration is compared with the set threshold one by one; Abnormal order analysis module: used to analyze the abnormal identification results and obtain the spatiotemporal distribution characteristics of possible abnormal orders. The analysis indicators include: Overall order ratio: refers to the ratio of potentially abnormal orders to the total number of orders; Distribution on different dates: used to monitor the absolute number and proportion of abnormal orders on different dates, and then to find out the cause when the indicator fluctuates abnormally; Possible number of abnormal orders for different drivers: Count the number of possible abnormal orders for different drivers, and then conduct further investigation on drivers with higher number; Distribution of abnormal orders on different characteristic days and during different characteristic time periods: By counting abnormal orders on different characteristic days and during different characteristic time periods.
4. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 2 are implemented.
5. A computer storable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 2 are implemented.
Citation Information
Patent Citations
Expressway road condition identification and prediction method based on floating vehicle data
CN109871876A
