CN112686327A - Method for clustering based on trajectory triple features - Google Patents

Method for clustering based on trajectory triple features Download PDF

Info

Publication number
CN112686327A
CN112686327A CN202110008501.4A CN202110008501A CN112686327A CN 112686327 A CN112686327 A CN 112686327A CN 202110008501 A CN202110008501 A CN 202110008501A CN 112686327 A CN112686327 A CN 112686327A
Authority
CN
China
Prior art keywords
track
clustering
data
vector
type
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110008501.4A
Other languages
Chinese (zh)
Inventor
秦红星
郭育宁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chongqing University of Post and Telecommunications
Original Assignee
Chongqing University of Post and Telecommunications
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chongqing University of Post and Telecommunications filed Critical Chongqing University of Post and Telecommunications
Priority to CN202110008501.4A priority Critical patent/CN112686327A/en
Publication of CN112686327A publication Critical patent/CN112686327A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention relates to a method for clustering triple features based on a track, and belongs to the technical field of data mining and visualization. The method comprises the following steps: s1, preprocessing the track data; s2, converting the preprocessed track data into a high-dimensional vector by using a Doc2Vec method; s3, clustering the obtained vectors by using k-means; and S4, visually displaying the obtained clustering result, and analyzing the time, space and attribute characteristics of the track to finally obtain the rule of each type of track. The invention improves the defect that the track space-time clustering ignores the attribute constraint, ensures that the track clustering is more rigorous, the result is more detailed, and the travel characteristic is more obvious.

Description

Method for clustering based on trajectory triple features
Technical Field
The invention belongs to the technical field of data mining and visualization, and relates to a method for clustering based on trajectory triple features.
Background
In recent years, with the vigorous development of global positioning technology, various positioning devices are generally applied to daily life of people, so that the travel track of people is easier to obtain, and a better suggestion can be provided for the travel of people by mining the behavior pattern implied by track data. However, the track data volume is large, the value density is low, and the track data needs to be analyzed and processed in order to search the implicit value information. In data mining, clustering analysis is an important means, objects in a space can be divided and classified according to differences and similarities of distances, attributes, characteristics and the like by utilizing clustering, original scattered data are made to be neat, and therefore the relevance between spatial distribution characteristics and attributes implicit after data background is better found. The method just meets the requirements of people on trajectory data analysis, namely under the condition of no prior knowledge, data are firstly aggregated into different classes, and then modes represented by the classes are decoded to obtain valuable information.
Disclosure of Invention
In view of this, the present invention provides a method for clustering based on triple features of a track, which can divide and classify objects in a space according to differences and similarities of distances, attributes, features, and the like, so that original scattered data becomes orderly, and thus, correlations between spatial distribution features and attributes implicit after data backing can be better found
In order to achieve the purpose, the invention provides the following technical scheme:
a method for clustering based on track triple features comprises the following steps:
s1, preprocessing the track data;
s2, converting the preprocessed track data into a high-dimensional vector by using a Doc2Vec method;
s3, clustering the obtained vectors by using k-means;
and S4, displaying the clustering result.
Optionally, step S1 includes the steps of:
s11, firstly, intercepting trajectory data through geographic coordinates, and preprocessing the extracted trajectory;
s12, checking whether the track data of each vehicle has repeated time stamps, reserving the points appearing for the first time, and deleting other points;
s13, checking the passenger carrying state value contained in the track data, wherein 0 is no load, 1 is passenger carrying, and deleting the track data with the passenger carrying state value of not 0 but not 1;
s14, deleting the track with the null value and the track without departure;
and S15, finally, deleting the micro tracks with the track sampling points of each vehicle being less than or equal to 5 or the track length being less than 500 m.
Optionally, step S2 specifically includes:
transforming the preprocessed track data into a high-dimensional vector by using a Doc2Vec method, mapping each track segment text obtained in the step S1 into a vector space, and representing the vector space by using a column of a matrix D;
mapping each track point to a vector space, and representing by using a column of a matrix W;
and then averaging the track segment vectors and the track point vectors to obtain characteristics, predicting the next word in the sentence, and finally forming a series of high-dimensional vectors.
Optionally, in step S3, clustering the obtained vectors by using k-means, including the following steps:
s31: obtaining the optimal clustering number by using SSE comparison, wherein SSE is the error generated by the sample in the clustering process, and CiIs the ith cluster, p is CiSample point of (1), miIs CiThe smaller the error is, the better the clustering effect is, and the specific calculation formula is as follows:
Figure BDA0002884423060000021
s32: and calculating the distance from each vector to the clustering center, and classifying each vector under the nearest clustering center cluster according to the distance.
Optionally, step S4 includes the steps of:
s41: displaying tracks before and after clustering by using a map, wherein the tracks before clustering are displayed in a dynamic particle form, each moving point represents the running track of one vehicle, and the tracks after clustering are displayed on the map in different colors for distinguishing the categories;
s42: displaying multi-dimensional data information by adopting parallel coordinates, wherein each type of track has different colors, the displayed attributes have time, passenger carrying, speed and driving direction, and the characteristic distribution of each type of track is observed according to the attribute information displayed by the parallel coordinates;
s43: displaying key information of each type of track by adopting a word cloud picture, wherein the word cloud picture needs to display key words of each type of track, including time, interval, passenger carrying, speed and driving direction, and performing textualization on track data to obtain data of the word cloud picture;
s44: finally, the information displayed by the three parts is analyzed in a linkage manner, and rules and value information implied by each type of track are analyzed.
Alternatively, the Doc2Vec method is defined as the conversion of a sentence into a high-dimensional vector.
The invention has the beneficial effects that: the invention provides a clustering method based on the integration of three characteristics of track time, space and attribute, which creatively combines the attribute characteristic with other two characteristics, restricts the moving track data in multiple dimensions and optimizes the clustering result; a set of system based on track triple feature clustering is developed by combining vehicle data, and in the system, a visualization technology is used for analyzing the vehicle track from three aspects of a track graph, an attribute graph and a word cloud graph, so that the value information implied by the data is visually shown. The system reduces the pressure of analyzing and processing the track data by the urban traffic department and relieves the road congestion condition.
Additional advantages, objects, and features of the invention will be set forth in part in the description which follows and in part will become apparent to those having ordinary skill in the art upon examination of the following or may be learned from practice of the invention. The objectives and other advantages of the invention may be realized and attained by the means of the instrumentalities and combinations particularly pointed out hereinafter.
Drawings
For the purposes of promoting a better understanding of the objects, aspects and advantages of the invention, reference will now be made to the following detailed description taken in conjunction with the accompanying drawings in which:
FIG. 1 is a flow chart of a method for trajectory-based triple feature clustering in accordance with the present invention;
FIG. 2 is a diagram illustrating the selection of the optimal cluster number by SSE.
Detailed Description
The embodiments of the present invention are described below with reference to specific embodiments, and other advantages and effects of the present invention will be easily understood by those skilled in the art from the disclosure of the present specification. The invention is capable of other and different embodiments and of being practiced or of being carried out in various ways, and its several details are capable of modification in various respects, all without departing from the spirit and scope of the present invention. It should be noted that the drawings provided in the following embodiments are only for illustrating the basic idea of the present invention in a schematic way, and the features in the following embodiments and examples may be combined with each other without conflict.
Wherein the showings are for the purpose of illustrating the invention only and not for the purpose of limiting the same, and in which there is shown by way of illustration only and not in the drawings in which there is no intention to limit the invention thereto; to better illustrate the embodiments of the present invention, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the size of an actual product; it will be understood by those skilled in the art that certain well-known structures in the drawings and descriptions thereof may be omitted.
The same or similar reference numerals in the drawings of the embodiments of the present invention correspond to the same or similar components; in the description of the present invention, it should be understood that if there is an orientation or positional relationship indicated by terms such as "upper", "lower", "left", "right", "front", "rear", etc., based on the orientation or positional relationship shown in the drawings, it is only for convenience of description and simplification of description, but it is not an indication or suggestion that the referred device or element must have a specific orientation, be constructed in a specific orientation, and be operated, and therefore, the terms describing the positional relationship in the drawings are only used for illustrative purposes, and are not to be construed as limiting the present invention, and the specific meaning of the terms may be understood by those skilled in the art according to specific situations.
Please refer to fig. 1-2, which illustrate a method for triple feature clustering based on tracks.
The invention provides a method for clustering based on triple features of tracks, which is characterized in that tracks comprise time, space and various attribute information and cannot be analyzed by a single clustering method, so that the method takes track data as texts, converts the text data into high-dimensional vectors by using a Doc2Vec algorithm in the field of natural language processing, and then clusters the high-dimensional vectors by using a k-means algorithm, thereby realizing triple feature clustering based on the tracks, namely time, space and attributes, finally displaying clustering results in a visual form and analyzing clustering rules, as shown in figure 1, the method for clustering based on triple features of tracks specifically comprises the following steps:
step 1: attribute information of time, coordinates, speed, driving direction and passenger carrying state of the vehicle track is taken, and then the data are preprocessed, as shown in table 1;
TABLE 1 vehicle trajectory data preprocessing
Figure BDA0002884423060000041
Step 101: preprocessing the extracted Shenzhen market taxi track, and intercepting track data in the Shenzhen market through the coordinates of the Shenzhen market;
step 102: for each vehicle, the time is gradually increased, and no repeated timestamp occurs, so that whether the repeated timestamp exists in the track data of each vehicle needs to be checked, and then only the point which appears for the first time is reserved to delete other points;
step 103: the track data comprises a passenger carrying state, 0 is no load, 1 is passenger carrying, and the value which is not 0 and not 1 is set for protecting privacy information and is deleted;
step 104: due to the fact that the null value occurs in data collection caused by some external factors, the track with the null value needs to be deleted so as to avoid influencing the overall analysis;
step 105: collecting the track of the taxis in one day, wherein some taxis are in a rest state and are not sent out in the day, and deleting the track;
step 2: the processed track data is regarded as a text and then converted into a high-dimensional vector by using a Doc2Vec algorithm;
step 201: mapping each track segment text obtained in the step S1 into a vector space, and representing the track segment text by using a column of a matrix D;
step 202: each track point is also mapped into a vector space and is represented by one column of a matrix W;
step 203: averaging the track segment vectors and the track point vectors to obtain characteristics, predicting the next word in the sentence, and finally forming a series of high-dimensional vectors;
and step 3: clustering the obtained high-dimensional vectors by using k-means;
step 301: and obtaining the optimal cluster number by SSE comparison. Wherein, CiIs the ith cluster, p is CiSample point of (1), miIs CiThe SSE is an error generated by the sample in the clustering process, the smaller the error is, the better the clustering effect is, and the specific calculation formula is as follows:
Figure BDA0002884423060000051
the results of SSE are shown in FIG. 2, where 10 is the optimal cluster number;
step 302: calculating the distance from each vector to the clustering center, and classifying each vector under the nearest clustering center cluster according to the distance;
and 4, step 4: performing visual display on the obtained clustering result, and analyzing the time, space and attribute characteristics of the track to finally obtain the rule of each type of track;
step 401: and displaying tracks before and after clustering by using the Baidu map. The track before clustering is displayed in a dynamic particle mode, and each moving point represents the running track of a taxi. Displaying the clustered tracks on a map in different colors for distinguishing the categories;
step 402: and displaying the attribute information of the track by adopting a parallel coordinate graph. Each type of track has a different color, and the displayed attributes are time, passenger, speed, and direction of travel. Observing the characteristic distribution of each type of track according to the attribute information displayed by the parallel coordinates;
step 403: and displaying key information of each type of track by adopting a word cloud picture. The word cloud picture needs to show keywords (time interval, passenger carrying, speed, driving direction) of each type of track. In order to obtain the data of the word cloud picture, the track data needs to be converted into text, and the specific method is shown in table 2;
table 2 track data textualization
Figure BDA0002884423060000061
Step 404: finally, the information displayed by the three parts is analyzed in a linkage manner, and rules and value information implied by each type of track are analyzed. Observing all feature graphs of the tenth type of track, according to the track graphs, it can be seen that the tracks are mostly distributed in northwest (airport) and northeast (shenzhen east station), it can be seen from the attribute graph that most of the travel time is 12:00 later (early shift), and the main features of the tenth type of track can be clearly seen from the word cloud graph are as follows: carrying passengers, low speed and driving to the east. In summary, the tenth category of trajectories is mostly early shift taxis of the airport, carrying passengers from the airport, then traveling eastward to the northeast of Shenzhen (including the Dongting of Shenzhen), and traveling at low speed (not at high speed).
Finally, the above embodiments are only intended to illustrate the technical solutions of the present invention and not to limit the present invention, and although the present invention has been described in detail with reference to the preferred embodiments, it will be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions, and all of them should be covered by the claims of the present invention.

Claims (6)

1. A method for clustering features based on trajectory triples, the method comprising the steps of:
s1, preprocessing the track data;
s2, converting the preprocessed track data into a high-dimensional vector by using a Doc2Vec method;
s3, clustering the obtained vectors by using k-means;
and S4, displaying the clustering result.
2. The method of claim 1, wherein the method comprises: the step S1 includes the steps of:
s11, firstly, intercepting trajectory data through geographic coordinates, and preprocessing the extracted trajectory;
s12, checking whether the track data of each vehicle has repeated time stamps, reserving the points appearing for the first time, and deleting other points;
s13, checking the passenger carrying state value contained in the track data, wherein 0 is no load, 1 is passenger carrying, and deleting the track data with the passenger carrying state value of not 0 but not 1;
s14, deleting the track with the null value and the track without departure;
and S15, finally, deleting the micro tracks with the track sampling points of each vehicle being less than or equal to 5 or the track length being less than 500 m.
3. The method of claim 1, wherein the method comprises: the step S2 specifically includes:
transforming the preprocessed track data into a high-dimensional vector by using a Doc2Vec method, mapping each track segment text obtained in the step S1 into a vector space, and representing the vector space by using a column of a matrix D;
mapping each track point to a vector space, and representing by using a column of a matrix W;
and then averaging the track segment vector and the track point vector respectively to obtain features, predicting the next word in the sentence, and finally forming a series of high-dimensional vectors.
4. The method of claim 1, wherein the method comprises: in step S3, clustering the obtained vectors by using k-means includes the following steps:
s31: obtaining the optimal clustering number by using SSE comparison, wherein SSE is the error generated by the sample in the clustering process, and CiIs the ith cluster, p is CiSample point of (1), miIs CiThe smaller the error is, the better the clustering effect is, and the specific calculation formula is as follows:
Figure FDA0002884423050000011
s32: and calculating the distance from each vector to the clustering center, and classifying each vector under the nearest clustering center cluster according to the distance.
5. The method of claim 1, wherein the method comprises: the step S4 includes the steps of:
s41: displaying tracks before and after clustering by using a map, wherein the tracks before clustering are displayed in a dynamic particle form, each moving point represents the running track of one vehicle, and the tracks after clustering are displayed on the map in different colors for distinguishing the categories;
s42: displaying multi-dimensional data information by adopting parallel coordinates, wherein each type of track has different colors, the displayed attributes have time, passenger carrying, speed and driving direction, and the characteristic distribution of each type of track is observed according to the attribute information displayed by the parallel coordinates;
s43: displaying key information of each type of track by adopting a word cloud picture, wherein the word cloud picture needs to display key words of each type of track, including time, interval, passenger carrying, speed and driving direction, and performing textualization on track data to obtain data of the word cloud picture;
s44: finally, the information displayed by the three parts is analyzed in a linkage manner, and rules and value information implied by each type of track are analyzed.
6. The method of claim 1, wherein the method comprises: the Doc2Vec method is defined as the conversion of sentences into high-dimensional vectors.
CN202110008501.4A 2021-01-05 2021-01-05 Method for clustering based on trajectory triple features Pending CN112686327A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110008501.4A CN112686327A (en) 2021-01-05 2021-01-05 Method for clustering based on trajectory triple features

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110008501.4A CN112686327A (en) 2021-01-05 2021-01-05 Method for clustering based on trajectory triple features

Publications (1)

Publication Number Publication Date
CN112686327A true CN112686327A (en) 2021-04-20

Family

ID=75457411

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110008501.4A Pending CN112686327A (en) 2021-01-05 2021-01-05 Method for clustering based on trajectory triple features

Country Status (1)

Country Link
CN (1) CN112686327A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115952364A (en) * 2023-03-07 2023-04-11 之江实验室 Route recommendation method and device, storage medium and electronic equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103593430A (en) * 2013-11-11 2014-02-19 胡宝清 Clustering method based on mobile object spatiotemporal information trajectory subsections
CN107577725A (en) * 2017-08-22 2018-01-12 长安大学 A kind of urban taxi passenger trip characteristicses visual analysis method
CN108959466A (en) * 2018-06-20 2018-12-07 淮阴工学院 Taxi hot spot method for visualizing and system based on BCS-DBSCAN
US20190050875A1 (en) * 2017-06-22 2019-02-14 NewVoiceMedia Ltd. Customer interaction and experience system using emotional-semantic computing
EP3675008A1 (en) * 2018-12-31 2020-07-01 Kofax, Inc. Systems and methods for identifying processes for robotic automation and building models therefor
US20200379958A1 (en) * 2013-03-15 2020-12-03 Locus Lp Dynamic syntactic affinity group formation in a high-dimensional functional information system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200379958A1 (en) * 2013-03-15 2020-12-03 Locus Lp Dynamic syntactic affinity group formation in a high-dimensional functional information system
CN103593430A (en) * 2013-11-11 2014-02-19 胡宝清 Clustering method based on mobile object spatiotemporal information trajectory subsections
US20190050875A1 (en) * 2017-06-22 2019-02-14 NewVoiceMedia Ltd. Customer interaction and experience system using emotional-semantic computing
CN107577725A (en) * 2017-08-22 2018-01-12 长安大学 A kind of urban taxi passenger trip characteristicses visual analysis method
CN108959466A (en) * 2018-06-20 2018-12-07 淮阴工学院 Taxi hot spot method for visualizing and system based on BCS-DBSCAN
EP3675008A1 (en) * 2018-12-31 2020-07-01 Kofax, Inc. Systems and methods for identifying processes for robotic automation and building models therefor

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
李伟娜等: "疫情防控常态化下高校数据共享及可视化研究与应用——以北方工业大学为例", 《中国会议》 *
李致昊等: "一个基于基站轨迹数据的城市移动模式可视分析系统", 《计算机辅助设计与图形学学报》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115952364A (en) * 2023-03-07 2023-04-11 之江实验室 Route recommendation method and device, storage medium and electronic equipment

Similar Documents

Publication Publication Date Title
Havens et al. Scalable single linkage hierarchical clustering for big data
CN113378891B (en) Urban area relation visual analysis method based on track distribution representation
Yang et al. Analysis of traffic state variation patterns for urban road network based on spectral clustering
US11092443B2 (en) Method, apparatus, and system for categorizing a stay point based on probe data
CN110088778B (en) System, method and computer readable medium for scenario memory of automation platform
CN113159105B (en) Driving behavior unsupervised mode identification method and data acquisition monitoring system
CN113763712B (en) Regional traffic jam tracing method based on travel event knowledge graph
CN110990661B (en) Region of interest access extraction method based on road network constraint and density clustering
US20220148184A1 (en) Method, apparatus, and system using a machine learning model to segment planar regions
US20230066501A1 (en) Method, apparatus, and system for traffic estimation based on anomaly detection
Yang et al. Classification and evaluation of driving behavior safety levels: A driving simulation study
CN116257681B (en) Civil aviation event investigator recommendation method based on portrait technology
Wang et al. Unsupervised learning trajectory anomaly detection algorithm based on deep representation
CN113988476A (en) Dynamic assessment prediction method for road transportation safety risk
CN112686327A (en) Method for clustering based on trajectory triple features
CN110716925A (en) Cross-border behavior recognition method based on trajectory analysis
CN113821702A (en) Urban multidimensional space multivariate heterogeneous information data processing method
KR102085161B1 (en) System and method for visualization of graph data and computer program for the same
Chakrabarti et al. Clustering Aircraft Trajectories According to Air Traffic Controllers' Decisions
CN114492544B (en) Model training method and device and traffic incident occurrence probability evaluation method and device
CN113240265B (en) Urban space division method based on multi-mode traffic data
CN115982309A (en) Rail transit data analysis method based on big data
CN112559909A (en) Business area discovery method based on GCN embedded spatial clustering model
JP2022136885A (en) Information processing device, information processing method, and information processing program
Portugal et al. A Graph-based Analysis Approach to Cluster Lifetime Dynamics

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210420