CN109033011B - Method and device for calculating track frequency, storage medium and electronic equipment - Google Patents

Method and device for calculating track frequency, storage medium and electronic equipment Download PDF

Info

Publication number
CN109033011B
CN109033011B CN201810631890.4A CN201810631890A CN109033011B CN 109033011 B CN109033011 B CN 109033011B CN 201810631890 A CN201810631890 A CN 201810631890A CN 109033011 B CN109033011 B CN 109033011B
Authority
CN
China
Prior art keywords
track
track point
points
preset neighborhood
neighborhood
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.)
Active
Application number
CN201810631890.4A
Other languages
Chinese (zh)
Other versions
CN109033011A (en
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.)
Neusoft Corp
Original Assignee
Neusoft Corp
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 Neusoft Corp filed Critical Neusoft Corp
Priority to CN201810631890.4A priority Critical patent/CN109033011B/en
Publication of CN109033011A publication Critical patent/CN109033011A/en
Application granted granted Critical
Publication of CN109033011B publication Critical patent/CN109033011B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Computational Mathematics (AREA)
  • Pure & Applied Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Algebra (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The disclosure relates to a method and device for calculating track frequency, a storage medium and an electronic device. The method can comprise the following steps: acquiring a track point set of a moving object; performing density-based clustering division on track points in the track point set by using a preset neighborhood radius and a preset neighborhood track point density threshold to obtain a plurality of cluster sets; and measuring the trend of the data center of the cluster sets to obtain the track frequency of the moving object, wherein the track frequency of the moving object in a frequent region can be accurately calculated by the method, and a new quantitative index is provided for behavior analysis, safety risk evaluation and the like of the moving object.

Description

Method and device for calculating track frequency, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of data processing, and in particular, to a method and an apparatus for calculating trajectory frequency, a storage medium, and an electronic device.
Background
With the rapid development of the internet of things technology, a large amount of travel data of the mobile object is accumulated. For example, in the field of car networking, a large amount of driving data of users is accumulated. At present, the behavior analysis and the safety risk assessment of the user are generally performed through the travel time, the mileage, the speed and the road state in the driving data.
For a mobile object such as a private car owner or a fleet of vehicles, as data is accumulated, the distribution of the trajectories is concentrated in certain areas, which represent the frequent moving range of the mobile object, and may be referred to as frequent areas. These frequent regions are closely related to the travel law of the mobile object, and are one of the factors determining the behavior and safety risk of the mobile object.
However, there is no method that can mine a frequent area and quantify how often a moving object goes in and out of the frequent area. Therefore, at present, the track frequency cannot be analyzed as a factor of behavior analysis and security risk, which brings great difficulty to behavior analysis and security risk evaluation of the mobile object.
Disclosure of Invention
In view of this, the present disclosure provides a method, an apparatus, a storage medium, and an electronic device for calculating a track frequency, so as to achieve the purpose of accurately calculating the frequency of a moving object in a frequent area.
In a first aspect of embodiments of the present disclosure, a method of calculating trajectory frequency is provided. The method comprises the following steps: acquiring a track point set of a moving object; performing density-based clustering division on track points in the track point set by using a preset neighborhood radius and a preset neighborhood track point density threshold to obtain a plurality of cluster sets; and measuring the trend of the data center of the cluster sets to obtain the track frequency of the moving object.
Optionally, the method may further include: obtaining the preset neighborhood radius by the following steps: carrying out grid division on a rectangular area formed by the track point set in the two-dimensional coordinates to obtain a plurality of grids; finding out the grids with the largest number of track points from the grids as the most frequent areas; calculating the distance between all track points in the most frequent region; and calculating the neighborhood radius of at least one preset neighborhood track point density threshold track point in the neighborhood of any track point in the most frequent region by using the distance between all track points in the most frequent region, and obtaining the preset neighborhood radius.
Optionally, the grid division is performed on a rectangular area formed by the track point set in the two-dimensional coordinate, and obtaining a plurality of grids includes: determining a rectangular area formed by the track point set in the two-dimensional coordinates according to longitude and latitude extreme values of all starting points and end points in the track point set; assuming that the length of the rectangular region is divided into X sections and the width is divided into Y sections, calculating X and Y according to the preset neighborhood track point density threshold value as the average value of the number of track points of all grids and the ratio of the X to the Y is equivalent to the length-width ratio of the rectangular region, wherein X, Y is an integer; and dividing the length of the rectangular area into X sections and the width of the rectangular area into Y sections to obtain a plurality of grids.
Optionally, the distance between all track points in the most frequent region is used to calculate a neighborhood radius which enables at least the preset neighborhood track point density threshold track points in the neighborhood of any track point in the most frequent region, and obtaining the preset neighborhood radius includes: establishing a distance distribution matrix according to the distances between all track points in the most frequent region; sequencing the row values of the distance distribution matrix from small to large to obtain a new matrix; for the new matrix, taking a numerical value corresponding to each element of the density threshold of the second preset neighborhood track point of each row; and obtaining the preset neighborhood radius by taking the maximum value from the numerical values corresponding to the second preset neighborhood track point density threshold elements of each row.
In a second aspect of embodiments of the present disclosure, an apparatus for calculating trajectory frequency is provided. The device includes: an acquisition module configured to acquire a set of trajectory points of the moving object. And the clustering module is configured to perform density-based clustering division on the track points in the track point set by utilizing a preset neighborhood radius and a preset neighborhood track point density threshold value to obtain a plurality of cluster sets. And the frequency calculation module is configured to measure the trend of the data center on the plurality of cluster sets to obtain the track frequency of the moving object.
Optionally, the apparatus may further include: and the grid division module is configured to perform grid division on a rectangular area formed by the track point set in the two-dimensional coordinates to obtain a plurality of grids. And the area searching module is configured to search the grids with the largest number of track points from the grids as the most frequent areas. And the distance calculation module is configured to calculate the distances between all track points in the most frequent region. And the radius calculation module is configured to calculate the neighborhood radius which enables at least one track point with the preset neighborhood track point density threshold value in the neighborhood of any track point in the most frequent region by using the distance between all track points in the most frequent region, and obtain the preset neighborhood radius.
Optionally, the meshing module includes: and the rectangle determining submodule is configured to determine a rectangular area formed in the two-dimensional coordinates by the track point set according to the longitude and latitude extreme values of all the starting points and the end points in the track point set. And the segment number calculation submodule is configured to assume that the length of the rectangular region is divided into X segments, the width of the rectangular region is divided into Y segments, and calculate X and Y according to the preset neighborhood track point density threshold value as the average value of the track point numbers of all grids, and the ratio of the X to the Y is equivalent to the length-width ratio of the rectangular region, wherein X, Y is an integer. And the grid division submodule is configured to divide the length of the rectangular area into X sections and divide the width of the rectangular area into Y sections to obtain a plurality of grids.
Optionally, the radius calculation module includes: and the matrix establishing submodule is configured to establish a distance distribution matrix according to the distances between all track points in the most frequent region. And the sequencing submodule is configured to sequence the values of each row of the distance distribution matrix from small to large to obtain a new matrix. And the numerical value extraction sub-module is configured to obtain a numerical value corresponding to each row of the preset neighborhood track point density threshold value elements of the new matrix. And the maximum value extraction submodule is configured to obtain the preset neighborhood radius by taking the maximum value from the numerical values corresponding to the second preset neighborhood track point density threshold elements of each row.
In a third aspect of the embodiments of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, which when executed by a processor, performs the steps of the method as described in any one of the embodiments of the first aspect of the present disclosure.
In a fourth aspect of embodiments of the present disclosure, there is provided an electronic device, comprising: a computer-readable storage medium according to an embodiment of the third aspect of the present disclosure; and one or more processors to execute the program in the computer-readable storage medium.
Through this above-mentioned technical scheme of this disclosure, owing to utilize and predetermine neighborhood radius and predetermine neighborhood track point density threshold, it is right track point in the track point set carries out the cluster partition based on density to excavate and obtain a plurality of cluster and close also frequent region, owing to carry out the measurement of data center trend to a plurality of cluster again, the numerical value that obtains can describe the degree that a plurality of cluster trace distributes and concentrates the trend, consequently, this disclosure can accurately calculate the orbit frequency of moving object in frequent region. Therefore, the method provided by the disclosure can be used for excavating the frequent regions and quantifying the frequency of the frequent regions. The track frequency of the frequent region is closely related to the travel rule of the mobile object, and is one of the factors determining the behavior and safety risk of the mobile object. Therefore, the method provides a new quantitative index for the behavior analysis, the safety risk evaluation and the like of the moving object, so as to realize more accurate behavior analysis, safety risk evaluation and the like of the moving object.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows.
Drawings
The accompanying drawings, which are included to provide a further understanding of the disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the disclosure without limiting the disclosure. In the drawings:
fig. 1 is a flowchart illustrating a method of calculating track frequency according to an exemplary embodiment of the present disclosure.
Fig. 2 is a flowchart illustrating obtaining a preset neighborhood radius according to another exemplary embodiment of the present disclosure.
Fig. 3 is a schematic diagram of a rectangular area shown in accordance with another exemplary embodiment of the present disclosure.
Fig. 4 is a schematic diagram illustrating meshing according to another exemplary embodiment of the present disclosure.
Fig. 5 is a block diagram illustrating an apparatus for calculating trajectory frequency according to an exemplary embodiment of the present disclosure.
Fig. 6 is a block diagram illustrating an apparatus for calculating trajectory frequency according to another exemplary embodiment of the present disclosure.
Fig. 7 is a block diagram illustrating an electronic device according to an exemplary embodiment of the present disclosure.
Detailed Description
The following detailed description of specific embodiments of the present disclosure is provided in connection with the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating the present disclosure, are given by way of illustration and explanation only, not limitation.
Fig. 1 is a flowchart illustrating a method of calculating track frequency according to an exemplary embodiment of the present disclosure. As shown in fig. 1, the method may include the steps of:
in step 110, a set of trajectory points for the moving object is obtained.
In the present disclosure, the moving object may refer to a vehicle, a user holding a mobile device, or the like. The trajectory may be, for example, a driving trajectory of a vehicle, and the data may be acquired by a GPS device, including information on longitude, latitude, time, etc. of a series of location points through which the vehicle passes. And forming a track by the continuous position points passing through in the driving process according to the time sequence, and identifying in the database through the unique track ID. For another example, in some scenarios, the trajectory formed from the time when the vehicle starts (data starts to be collected) to the time when the vehicle stops (data stops to be collected) may be regarded as a trajectory. Because the starting points and the end points of the tracks are distributed in space to present the frequently moving areas of the moving object such as a vehicle, in order to improve the calculation efficiency, the starting points and the end points of a plurality of tracks of the moving object can be extracted to obtain the track point set, and the track point set is composed of the starting points and the end points of the plurality of tracks. Of course, a certain track point in the preset neighborhood radius of the starting point and a certain track point in the preset neighborhood radius of the ending point may also be extracted to obtain a track point set, which is not limited by the present disclosure. It can be understood that, in the case of forming a set of track points by taking the starting point and the end point, the calculation efficiency and the accuracy are relatively high. The starting point may refer to a starting point or a vehicle starting point of a moving object such as a vehicle, and the ending point may refer to a destination or a vehicle key-off point of the moving object such as a vehicle. For example, after acquiring the trajectory data, the start point and the end point of the trajectory may be sequentially extracted for each trajectory, and added to the trajectory point set DP,DP={p1,p2,…,pnN represents the total number of the starting points and the end points of all the tracks, and p is { longitude, latitude }, namely the collected GPS latitude and longitude information. In step 120, a preset neighborhood radius is utilized to determine the distance between the two neighboring regionsAnd presetting a neighborhood track point density threshold value, and performing density-based clustering division on the track points in the track point set to obtain a plurality of cluster sets.
The preset neighborhood radius is a radius for neighborhood searching by taking a certain track point as a circle center, and the numerical value can be set according to experience and can also be calculated according to the characteristics of the track of the moving object to obtain a self-adaptive numerical value. The preset neighborhood track point density threshold is a numerical value used for measuring the track point density in a neighborhood (except a central point) taking a certain track point as a circle center, and the larger the numerical value is, the larger the density of the track point is, and the numerical value can be set according to experience.
In a possible embodiment, the performing density-based clustering division on the track points in the track point set by using a preset neighborhood radius and a preset neighborhood track point density threshold to obtain a plurality of cluster sets may include the following steps:
the method comprises the following steps: and selecting any track point which is not divided into the cluster set and is not marked as a noise point from the track point set, and enabling the selected track point to be a first track point.
For example, for a set of track points DP,DP={p1,p2,…,pnBefore the beginning of step, all points p can be set as unmarked points. In step one, from DPRandomly selects an unlabeled point p and labels it.
Step two: and if the number of the track points in the preset neighborhood radius of the first track point is more than or equal to the preset neighborhood track point density threshold, creating a new cluster set, and putting the first track point into the new cluster set.
In connection with the example described above, if there are at least MinPts points within the ε neighborhood of point p, a new cluster set C is created and p is added to C. Epsilon represents the preset neighborhood radius, and MinPts represents the preset neighborhood track point density threshold.
Step three: and if the number of the track points in the preset neighborhood radius of the first track point is less than the preset neighborhood track point density threshold value, marking the first track point as a noise point.
In connection with the example described above, if there are less than MinPts points within the ε neighborhood of point p, then p is a noise point.
Step four: and taking all track points in the preset neighborhood radius of the first track point as a temporary set.
Step five: and selecting any track point which is not divided into the cluster set and is not marked as a noise point from the temporary set, and enabling the selected track point to be a second track point.
Step six: and if the number of the track points in the preset neighborhood radius of the second track point is more than or equal to the preset neighborhood track point density threshold value, adding the track points in the preset neighborhood radius of the second track point into the temporary set.
Step seven: and adding the second track point into the new cluster set.
Step eight: and if the track points which are not divided into the cluster set and are not marked as noise points exist in the temporary set, returning to the step five.
In connection with the example described above, steps five through eight may include, for N to be the set of all points within the epsilon neighborhood of p, traversing each point p ' in N, labeling p ' if it is unlabeled, adding those points to N if there are at least MinPts points within the epsilon neighborhood of p '. If p 'is not a member of any cluster set, then p' is added to cluster set C.
Step nine: and if the track points which are not divided into the cluster set and are not marked as noise points do not exist in the temporary set, outputting the new cluster set.
Step ten: and if the track points which are not divided into the cluster set and are not marked as noise points exist in the track point set, returning to the step one.
And if so, returning to the first step to continue marking and dividing the unmarked track points.
Step eleven: if the track point set does not have track points which are not divided into cluster sets and not marked as noise points, the following step 130 is carried out, the number of the cluster sets and the number of the track points in the cluster sets are utilized, the average value of the number of the track points of the cluster sets is calculated, and the track frequency of the moving object is obtained.
In step 130, the data center trend of the plurality of cluster sets is measured, and the track frequency of the moving object is obtained.
The cluster set is a data set consisting of the number of trace points within the set. The number of track points in the cluster set can reflect the frequency of the cluster set, and the greater the number, the greater the number of times of access of the mobile object in the area, and correspondingly, the greater the track frequency. Therefore, the data center trend of the cluster sets is measured, the obtained numerical value can describe the degree of the trend of the track distribution and concentration of the cluster sets, and the track frequency of the frequent region is represented.
The measure of the data center trend may adopt methods such as a mean, a median, a mode, and the like.
For example, the number of the plurality of cluster sets and the number of the track points in the plurality of cluster sets may be utilized to calculate an average value of the number of the track points of the plurality of cluster sets, so as to obtain the track frequency of the moving object. In an embodiment, the magnitude of the track frequency mainly depends on the number of track points in each cluster set (i.e., the frequent region), and the greater the number, the greater the number of times of access of the vehicle in the frequent region, and correspondingly, the greater the frequency thereof. Thus, the method of averaging combines several elements of trajectory frequency: the total number of trace points (e.g., start point, end point); the total number of noise points (points not belonging to any cluster set); and calculating the track frequency according to the number of the cluster sets. Specifically, the number of all cluster inner points may be divided by the number of cluster sets to obtain an average value of the number of trace points in each cluster set, and the average value is used as the trace frequency. For example, the number of the points in all the cluster sets can be obtained through two ways, one is to sum the number of the points in all the cluster sets in an accumulated manner, and the other is to subtract the number of the noise points from the total number of the trace points in the trace point set.
For example, assuming that the total number of trace points in the trace point set is N, the number of all cluster sets C is N, all noise points individually form a noise set, and the number of noise points is m, the trace frequency F may be calculated by the following formula:
Figure BDA0001700258100000091
if there are 2400 starting points and ending points in total, and the algorithm calculates that there are 110 noise points, that is, the number of clusters is 5, then the area frequency value F:
Figure BDA0001700258100000092
therefore, the method provided by the disclosure can dig out the frequent region and quantify the frequency of the frequent region. The track frequency of the frequent region is closely related to the travel rule of the mobile object, and is one of the factors determining the behavior and safety risk of the mobile object. For example, in driving safety risk evaluation, the track frequency of a frequent region and driving characteristics such as driving duration, mileage, speed, poor driving behavior and road state can be jointly used as independent variable characteristic vectors to perform data analysis, the relationship between the driving characteristics and the risk, namely a safety risk evaluation function, is analyzed, and function fitting is performed through machine learning, so that the driving risk factor of the driving safety risk evaluation function is perfected, the accuracy of driving safety risk evaluation is improved, and the accuracy of risk identification is improved. Therefore, the method and the device provide new quantitative indexes for behavior analysis, safety risk evaluation and the like of the mobile object, so that more accurate behavior analysis, safety risk evaluation and the like of the mobile object are realized.
In practical application, in order to facilitate data analysis, the calculated track frequency of the frequent region may be mapped to a corresponding numerical interval according to the specific application scenario needs, and the mapping function is set according to the application scenario needs, which is not limited by the present disclosure.
In one possible application scenario, a track point in the track has corresponding time information, i.e., the time to travel through the track point. In the application scenario, the track points, such as the starting point and the ending point, within the preset time range can be extracted according to actual needs, so that a track point set corresponding to the preset time range is obtained. And performing the clustering division in the step 120 on the track point set corresponding to the preset time range, so as to obtain a plurality of cluster sets corresponding to the preset time range. And then, the cluster set corresponding to the preset time range is subjected to the measurement of the data center trend in the step 130, so as to obtain the track frequency corresponding to the preset time range. By the implementation method, the track frequency of a certain time period can be obtained, and new and more detailed quantitative indexes are provided for behavior analysis, safety risk evaluation and the like of the moving object. As can be seen from the above step 120, the cluster set mining is sensitive to the parameter of the preset neighborhood radius, and the setting of the preset neighborhood radius parameter directly affects the cluster set mining result. Due to different habits of different moving objects, the sparse situation of the track is not consistent, and if the consistent preset neighborhood radius is set, the actual track characteristics of all the moving objects cannot be met. Therefore, the preset neighborhood radius needs to be calculated in a self-adaptive manner according to the track characteristics of the moving object. In the following, a possible embodiment of the present disclosure that calculates the adaptive preset neighborhood radius according to the characteristics of the trajectory of the moving object itself will be described in detail with reference to fig. 2.
Fig. 2 is a flowchart illustrating obtaining a preset neighborhood radius according to another exemplary embodiment of the present disclosure. As shown in fig. 2, the following steps may be included:
in step 210, grid division is performed on the rectangular area formed by the track point set in the two-dimensional coordinates, so as to obtain a plurality of grids.
In a possible implementation manner, a rectangular area formed by the track point set in the two-dimensional coordinates can be determined according to longitude and latitude extreme values of all the starting points and the end points in the track point set. And if the length of the rectangular area is divided into X sections and the width is divided into Y sections, calculating X and Y according to the preset neighborhood track point density threshold value which is the average value of the number of track points of all grids and the ratio of X to Y which is equivalent to the length-width ratio of the rectangular area. And dividing the length of the rectangular area into X sections and the width into Y sections to obtain a plurality of grids.
For example, the longitude and latitude of the start point and the end point of all the trajectories of the moving object may be extracted, the longitude and latitude correspond to the X and Y axes of the two-dimensional coordinates, and the coordinate of each start point or end point is p ═ longitude, latitude }. And calculating the maximum value and the minimum value of the longitude and the latitude of all the starting points and the ending points to respectively obtain the maximum value maxLng of the longitude, the minimum value minLng of the longitude, the maximum value maxLat of the latitude and the minimum value minLat of the latitude, wherein the east longitude and the north latitude are positive, and the west longitude and the south latitude are negative, so that four vertexes are determined according to the extreme values of the longitude and the latitude, and the boundary of the rectangular area is determined. For example, as shown in fig. 3, the minimum longitude value minLng and the maximum latitude value maxLat form the vertex P1(minLng, maxLat) of the rectangular region, the maximum longitude value maxLng and the maximum latitude value maxLat form the vertex P2(maxLng, maxLat) of the rectangular region, the minimum longitude value minLng and the minimum latitude value minLat form the vertex P3(minLng, minLat) of the rectangular region, and the maximum longitude value maxLng and the minimum latitude value minLat form the vertex P4(maxLng, minLat) of the rectangular region. This rectangular area is illustrated in fig. 3 by a dashed rectangular box. The boundaries of the rectangular area may include all the points of the trajectory. Assuming that the rectangular region length and width are divided into X, Y segments, respectively, the entire rectangle is divided into X Y grids. X and Y can be calculated by the following equation system:
Figure BDA0001700258100000111
wherein D is the aspect ratio of the rectangular area.
Solving the system of equations to obtain
Figure BDA0001700258100000112
After rounding X and Y, the rectangle may be gridded. For example, after the rectangular area shown in fig. 3 is subjected to meshing, a mesh as shown in fig. 4 can be obtained.
Since the embodiment sets the value of the preset neighborhood track point density threshold as the average value of the number of points falling in each grid, and the average value in the numerical statistics is not necessarily larger than the maximum value, at least one grid can be provided, the number of track points contained in the grid is larger than or equal to the preset neighborhood track point density threshold, and when the grid is square, the density situation around the area can be represented better, so that the length-width ratio of the segments divided into the length and the width is the length-width ratio of the rectangular area. In conclusion, the embodiment can ensure that at least one grid contains the preset neighborhood track point density threshold points, and the divided grid can represent the density situation around the area.
In step 220, the grid with the largest number of track points is found out from the grids as the most frequent region.
For example, the number of trace points is counted for each grid as shown in fig. 4, and the grid with the largest number of trace points is found.
In step 230, the distance between all trace points in the most frequent region is calculated.
For example, in order to establish a distance distribution matrix in the following example, the distance between any two points of the internal trace point of the most frequent region, that is, the grid containing the largest number of trace points, may be calculated, including the point itself. Assuming that the number of the track points of the most frequent region is m, the distance between any two points of the track points in the most frequent region can be represented as DISTm×m
DISTm×m={d(i,j),1≤i≤m,1≤j≤m}
In step 240, the distance between all track points in the most frequent region is used to calculate the neighborhood radius which enables at least the track points with the preset neighborhood track point density threshold to be in the neighborhood of any track point in the most frequent region, so as to obtain the preset neighborhood radius.
In a possible implementation manner, a distance distribution matrix may be established according to distances between all track points in the most frequent region. And sequencing the values of each row of the distance distribution matrix from small to large to obtain a new matrix. And for the new matrix, taking a numerical value corresponding to each element of the density threshold value of the second preset neighborhood track point of each row. And obtaining the preset neighborhood radius by taking the maximum value from the numerical values corresponding to the second preset neighborhood track point density threshold elements of each row. The embodiment searches the preset neighborhood radius value by establishing the distance distribution matrix, so that the searching is quick and efficient.
For example, according to DISTm×mDistance distribution matrix can be obtained by { d (i, j), i is 1 ≦ m, j is 1 ≦ m }:
Figure BDA0001700258100000121
and respectively sequencing the number of each row of the distance distribution matrix from small to large to obtain a new matrix. For the generated new matrix, respectively taking the value X corresponding to the MinPts element of each rowiThen ε is: epsilon is max Xi,1≤i≤m。
For example, assume the distance distribution matrix is a 5 x 5 matrix:
Figure BDA0001700258100000131
respectively sequencing the values of each row of the matrix from small to large to obtain a new matrix:
Figure BDA0001700258100000132
if MinPts is 4, the values of the 4 th element in each row are 9,11,10,12,10, respectively, and the maximum value 12 is taken as the value of epsilon.
In this embodiment, since the preset neighborhood radius is calculated in a self-adaptive manner according to the actual track of the mobile object, and at least one frequent region in the track point set can be mined, errors caused by manual experience parameter setting are avoided, and the accuracy of track frequency is improved.
Fig. 5 is a block diagram illustrating an apparatus 500 for calculating trajectory frequency according to an exemplary embodiment of the present disclosure. As shown in fig. 5, the apparatus may include: an acquisition module 510, a clustering module 520, and a frequency calculation module 530.
The obtaining module 510 may be configured to obtain a set of track points of the moving object.
The clustering module 520 may be configured to perform density-based clustering division on the trace points in the trace point set by using a preset neighborhood radius and a preset neighborhood trace point density threshold, so as to obtain a plurality of cluster sets.
The frequency calculation module 530 may be configured to perform a data center trend measurement on the several cluster sets, resulting in a track frequency of the moving object.
The cluster set is a data set consisting of the number of trace points within the set. The number of track points in the cluster set can reflect the frequency of the cluster set, and the greater the number, the greater the number of times of access of the mobile object in the area, and correspondingly, the greater the track frequency. Therefore, the data center trend of the cluster sets is measured, the obtained numerical value can describe the degree of the trend of the track distribution and concentration of the cluster sets, and the track frequency of the frequent region is represented.
The measure of the data center trend may adopt methods such as a mean, a median, a mode, and the like.
Therefore, the method provided by the disclosure can dig out the frequent region and quantify the frequency of the frequent region. The track frequency of the frequent region is closely related to the travel rule of the mobile object, and is one of the factors determining the behavior and safety risk of the mobile object. For example, in the driving safety risk evaluation, the track frequency of the frequent region and the driving characteristics such as the driving duration, the mileage, the speed, the bad driving behavior, the road state and the like can be jointly used as independent variable characteristic vectors for data analysis, so that the driving risk factor of the driving safety risk evaluation function is perfected, and the accuracy of the driving safety risk evaluation, namely the accuracy of risk identification, is improved. Therefore, the method provides a new quantitative index for the behavior analysis, the safety risk evaluation and the like of the mobile object, so as to realize more accurate behavior analysis, safety risk evaluation and the like of the mobile object.
In a possible embodiment, to improve the calculation efficiency, the obtaining module 510 may be configured to extract starting points and end points of several tracks of the moving object, so as to obtain the track point set.
According to the embodiment, the cluster set is mined sensitively to the parameter of the preset neighborhood radius, and the set of the preset neighborhood radius parameter directly influences the mining result of the cluster set. Due to different habits of different moving objects, the sparse situation of the track is not consistent, and if the consistent preset neighborhood radius is set, the actual track characteristics of all the moving objects cannot be met. Therefore, the preset neighborhood radius needs to be calculated in a self-adaptive manner according to the track characteristics of the moving object. Next, a possible embodiment of the present disclosure that calculates the adaptive preset neighborhood radius according to the characteristics of the trajectory of the moving object will be described in detail with reference to fig. 6.
Fig. 6 is a block diagram illustrating an apparatus 600 for calculating trajectory frequency according to another exemplary embodiment of the present disclosure. As shown in fig. 6, the apparatus may further include: a mesh partitioning module 540, a region finding module 550, a distance calculating module 560, and a radius calculating module 570.
The mesh dividing module 540 may be configured to perform mesh dividing on a rectangular area formed by the track point set in the two-dimensional coordinates, so as to obtain a plurality of meshes.
The region finding module 550 may be configured to find the grid with the largest number of tracing points from the grids as the most frequent region.
The distance calculation module 560 may be configured to calculate distances between all trace points in the most frequent region.
The radius calculation module 570 may be configured to calculate, by using distances between all track points in the most frequent region, a neighborhood radius that enables any track point in the most frequent region to have at least track points with a preset neighborhood track point density threshold, and obtain the preset neighborhood radius.
In this embodiment, since the preset neighborhood radius is calculated in a self-adaptive manner according to the actual track of the mobile object, and at least one frequent region in the track point set can be mined, errors caused by manual experience parameter setting are avoided, and the accuracy of track frequency is improved.
In a possible implementation, as shown in fig. 6, the meshing module 540 may include: a rectangle determination sub-module 541, a segment number calculation sub-module 542, and a grid division sub-module 543.
The rectangle determining submodule 541 may be configured to determine, according to longitude and latitude extreme values of all the start points and the end points in the track point set, a rectangular area formed by the track point set in two-dimensional coordinates.
The segment number calculating submodule 542 may be configured to assume that the rectangular region is divided into X segments in length and Y segments in width, and calculate X and Y according to the preset neighborhood trace point density threshold value as an average value of the trace point numbers of all the grids, and the ratio of X to Y is equivalent to the aspect ratio of the rectangular region.
The mesh dividing sub-module 543 may be configured to divide the rectangular region into X segments in length and Y segments in width, resulting in a number of meshes.
In the embodiment, the numerical value of the preset neighborhood track point density threshold is set as the average value of the number of points falling into each grid, and the average value in numerical statistics is not necessarily larger than the maximum value, so that at least one grid is provided, the number of track points contained in the grid is larger than or equal to the preset neighborhood track point density threshold, and when the grid is square, the density situation around the area can be represented better, and therefore, the number of segments divided by the length and the width is larger than the length-width ratio of the rectangular area. In summary, the embodiment can ensure that at least one grid contains the preset neighborhood track point density threshold points, and the divided grid can represent the density situation around the area.
In a possible implementation, as shown in fig. 6, the radius calculation module 570 may include: a matrix building sub-module 571, a sorting sub-module 572, a value extraction sub-module 573, and a maximum value extraction sub-module 574.
The matrix establishing sub-module 571 may be configured to establish a distance distribution matrix according to the distances between all the trace points in the most frequent region.
The sorting submodule 572 may be configured to sort the values of each row of the distance distribution matrix from small to large, resulting in a new matrix.
The value extracting sub-module 573 may be configured to take, for the new matrix, a value corresponding to a threshold number of elements of the density of the preset neighborhood trace points of each row.
The maximum value extraction submodule 574 may be configured to obtain the preset neighborhood radius by taking a maximum value from the numerical values corresponding to the preset neighborhood trace point density threshold elements in each row.
The embodiment searches the preset neighborhood radius value in a mode of establishing the distance distribution matrix, and the searching is quick and efficient.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Fig. 7 is a block diagram illustrating an electronic device 700 in accordance with an example embodiment. As shown in fig. 7, the electronic device 700 may include: a processor 701 and a memory 702. The electronic device 700 may also include one or more of a multimedia component 703, an input/output (I/O) interface 704, and a communication component 705.
The processor 701 is configured to control the overall operation of the electronic device 700, so as to complete all or part of the steps in the above method for calculating the track frequency. The memory 702 is used to store various types of data to support operation at the electronic device 700, such as instructions for any application or method operating on the electronic device 700 and application-related data, such as contact data, transmitted and received messages, pictures, audio, video, and the like. The Memory 702 may be implemented by any type of volatile or non-volatile Memory device or combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk, or optical disk. The multimedia components 703 may include screen and audio components. Wherein the screen may be, for example, a touch screen and the audio component is used for outputting and/or inputting audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may further be stored in the memory 702 or transmitted through the communication component 705. The audio assembly also includes at least one speaker for outputting audio signals. The I/O interface 704 provides an interface between the processor 701 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 705 is used for wired or wireless communication between the electronic device 700 and other devices. Wireless Communication, such as Wi-Fi, bluetooth, Near Field Communication (NFC), 2G, 3G, or 4G, or a combination of one or more of them, so that the corresponding Communication component 705 may include: Wi-Fi module, bluetooth module, NFC module.
In an exemplary embodiment, the electronic Device 700 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the above-described method for calculating trajectory frequency.
In another exemplary embodiment, a computer readable storage medium comprising program instructions which, when executed by a processor, implement the steps of the above-described method of calculating trajectory frequency is also provided. For example, the computer readable storage medium may be the memory 702 described above that includes program instructions executable by the processor 701 of the electronic device 700 to perform the method described above for calculating trajectory frequency.
The preferred embodiments of the present disclosure are described in detail with reference to the accompanying drawings, however, the present disclosure is not limited to the specific details of the above embodiments, and various simple modifications may be made to the technical solution of the present disclosure within the technical idea of the present disclosure, and these simple modifications all belong to the protection scope of the present disclosure.
It should be noted that the various features described in the above embodiments may be combined in any suitable manner without departing from the scope of the invention. In order to avoid unnecessary repetition, various possible combinations will not be separately described in this disclosure.
In addition, any combination of various embodiments of the present disclosure may be made, and the same should be considered as the disclosure of the present disclosure, as long as it does not depart from the spirit of the present disclosure.

Claims (8)

1. A method for calculating trajectory frequency, comprising:
acquiring a track point set of a moving object;
carrying out grid division on a rectangular area formed by the track point set in the two-dimensional coordinates to obtain a plurality of grids;
finding out the grids with the largest number of track points from the grids as the most frequent areas;
calculating the distance between all track points in the most frequent region;
calculating the neighborhood radius of at least one track point with a preset neighborhood track point density threshold in the neighborhood of any track point in the most frequent region by using the distance between all track points in the most frequent region to obtain the preset neighborhood radius;
performing density-based clustering division on the track points in the track point set by using the preset neighborhood radius and a preset neighborhood track point density threshold to obtain a plurality of cluster sets;
and measuring the trend of the data center of the cluster sets to obtain the track frequency of the moving object.
2. The method according to claim 1, wherein the grid-dividing the rectangular area formed by the track point sets in the two-dimensional coordinates to obtain a plurality of grids comprises:
determining a rectangular area formed by the track point set in the two-dimensional coordinates according to longitude and latitude extreme values of all starting points and end points in the track point set;
assuming that the rectangular region is divided into X sections and divided into Y sections, calculating X and Y according to the preset neighborhood track point density threshold value which is the average value of the number of track points of all grids and the ratio of the X to the Y which is equivalent to the length-width ratio of the rectangular region, wherein X, Y is an integer;
and dividing the length of the rectangular area into X sections and the width of the rectangular area into Y sections to obtain a plurality of grids.
3. The method according to claim 1, wherein the calculating a neighborhood radius enabling any track point in the most frequent region to have at least the threshold number of track points of the preset neighborhood track point density in the neighborhood of the track point in the most frequent region by using the distances between all track points in the most frequent region comprises:
establishing a distance distribution matrix according to the distances between all track points in the most frequent region;
sequencing the row values of the distance distribution matrix from small to large to obtain a new matrix;
for the new matrix, taking a numerical value corresponding to each element of the density threshold value of the second preset neighborhood track point of each row;
and obtaining the preset neighborhood radius by taking the maximum value from the numerical values corresponding to the second preset neighborhood track point density threshold elements of each row.
4. An apparatus for calculating trajectory frequency, comprising:
the acquisition module is configured to acquire a track point set of the mobile object;
the grid division module is configured to perform grid division on a rectangular area formed by the track point set in the two-dimensional coordinates to obtain a plurality of grids;
the area searching module is configured to search the grids with the largest number of track points from the grids to serve as the most frequent areas;
the distance calculation module is configured to calculate the distances between all track points in the most frequent region;
the radius calculation module is configured to calculate a neighborhood radius which enables at least one track point with a preset neighborhood track point density threshold value to be arranged in a neighborhood of any track point in the most frequent region by using distances between all track points in the most frequent region, and obtain a preset neighborhood radius;
the clustering module is configured to perform density-based clustering division on the track points in the track point set by using the preset neighborhood radius and a preset neighborhood track point density threshold value to obtain a plurality of cluster sets;
and the frequency calculation module is configured to measure the trend of the data center on the plurality of cluster sets to obtain the track frequency of the moving object.
5. The apparatus of claim 4, wherein the meshing module comprises:
the rectangle determining submodule is configured to determine a rectangular area formed in the two-dimensional coordinates by the track point set according to longitude and latitude extreme values of all starting points and end points in the track point set;
the segment number calculation submodule is configured to assume that the rectangular region is divided into X segments in length and Y segments in width, calculate X and Y according to the preset neighborhood track point density threshold value as the average value of the track point numbers of all grids and the ratio of the X to the Y is equivalent to the length-width ratio of the rectangular region, wherein X, Y is an integer;
and the grid division submodule is configured to divide the length of the rectangular area into X sections and divide the width of the rectangular area into Y sections to obtain a plurality of grids.
6. The apparatus of claim 4, wherein the radius calculation module comprises:
the matrix establishing submodule is configured to establish a distance distribution matrix according to the distances between all track points in the most frequent region;
the sorting submodule is configured to sort the values of each row of the distance distribution matrix from small to large to obtain a new matrix;
the numerical value extraction submodule is configured to obtain a numerical value corresponding to each element of the second preset neighborhood track point density threshold value of each row of the new matrix;
and the maximum value extraction submodule is configured to obtain the preset neighborhood radius by taking the maximum value from the numerical values corresponding to the second preset neighborhood track point density threshold elements of each row.
7. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 3.
8. An electronic device, comprising:
the computer-readable storage medium recited in claim 7; and
one or more processors to execute the program in the computer-readable storage medium.
CN201810631890.4A 2018-06-19 2018-06-19 Method and device for calculating track frequency, storage medium and electronic equipment Active CN109033011B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810631890.4A CN109033011B (en) 2018-06-19 2018-06-19 Method and device for calculating track frequency, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810631890.4A CN109033011B (en) 2018-06-19 2018-06-19 Method and device for calculating track frequency, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN109033011A CN109033011A (en) 2018-12-18
CN109033011B true CN109033011B (en) 2022-06-21

Family

ID=64610116

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810631890.4A Active CN109033011B (en) 2018-06-19 2018-06-19 Method and device for calculating track frequency, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN109033011B (en)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110046209B (en) * 2019-03-26 2022-08-09 太原科技大学 Trajectory stopping point extraction method based on Gaussian model
CN110222421B (en) * 2019-06-06 2023-03-10 优必爱信息技术(北京)有限公司 Method and system for evaluating concentration of driving route
CN110161464B (en) * 2019-06-14 2023-03-10 成都纳雷科技有限公司 Radar multi-target clustering method and device
CN112543419B (en) * 2019-09-20 2022-08-12 中国移动通信集团吉林有限公司 User trajectory prediction method and device based on density clustering
CN110781797B (en) * 2019-10-22 2021-04-06 杭州宇泛智能科技有限公司 Labeling method and device and electronic equipment
CN112949880B (en) * 2019-11-26 2023-11-03 北京京东振世信息技术有限公司 Method and device for generating recommended route
CN111274475A (en) * 2020-01-16 2020-06-12 深圳市前海随手数据服务有限公司 Method and device for extracting track features, storage medium and terminal
CN111476616B (en) * 2020-06-24 2020-10-30 腾讯科技(深圳)有限公司 Trajectory determination method and apparatus, electronic device and computer storage medium
CN111784728B (en) * 2020-06-29 2023-08-22 杭州海康威视数字技术股份有限公司 Track processing method, device, equipment and storage medium
CN112116806B (en) * 2020-08-12 2021-08-24 深圳技术大学 Traffic flow characteristic extraction method and system
CN112328728A (en) * 2020-11-30 2021-02-05 浙江师范大学 Clustering method and device for mining traveler track, electronic device and storage medium
CN112613455A (en) * 2020-12-29 2021-04-06 武汉理工大学 Ship anchoring gathering area identification method and device
CN112859125B (en) * 2021-01-07 2022-03-11 腾讯科技(深圳)有限公司 Entrance and exit position detection method, navigation method, device, equipment and storage medium
CN113239089B (en) * 2021-05-13 2023-01-24 中国联合网络通信集团有限公司 Path identification method, path identification device, electronic device, storage medium, and program product
CN114363824B (en) * 2021-05-26 2023-08-08 科大国创云网科技有限公司 Commute track depiction method and system based on MR (magnetic resonance) position and road GIS (geographic information System) information

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105138779A (en) * 2015-08-31 2015-12-09 武汉大学 Vehicle-mounted GPS space-time trajectory big data optimization method and system
CN107301254A (en) * 2017-08-24 2017-10-27 电子科技大学 A kind of road network hot spot region method for digging
CN107766808A (en) * 2017-09-30 2018-03-06 北京泓达九通科技发展有限公司 The method and system that Vehicle Object motion track clusters in road network space

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105446705B (en) * 2014-06-30 2019-06-21 国际商业机器公司 Method and apparatus for determining the characteristic of configuration file

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105138779A (en) * 2015-08-31 2015-12-09 武汉大学 Vehicle-mounted GPS space-time trajectory big data optimization method and system
CN107301254A (en) * 2017-08-24 2017-10-27 电子科技大学 A kind of road network hot spot region method for digging
CN107766808A (en) * 2017-09-30 2018-03-06 北京泓达九通科技发展有限公司 The method and system that Vehicle Object motion track clusters in road network space

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
海量数据的网格启发信息密度聚类算法;张海龙 等;《吉林大学学报(工学版)》;20110930;第41卷;第254-258页 *

Also Published As

Publication number Publication date
CN109033011A (en) 2018-12-18

Similar Documents

Publication Publication Date Title
CN109033011B (en) Method and device for calculating track frequency, storage medium and electronic equipment
Chen et al. TrajCompressor: An online map-matching-based trajectory compression framework leveraging vehicle heading direction and change
Kasemsuppakorn et al. A pedestrian network construction algorithm based on multiple GPS traces
Li et al. T-DesP: Destination prediction based on big trajectory data
CN102102992B (en) Multistage network division-based preliminary screening method for matched roads and map matching system
CN103533501A (en) Geofence generating method
CN105910612A (en) Personalized navigation method and system
JP2018538627A (en) Method and apparatus for obtaining route heat of a traffic road
CN108427679B (en) People stream distribution processing method and equipment thereof
CN110457413B (en) Method, device and equipment for determining driving direction and storage medium
CN112556717B (en) Travel mode screening method and travel route recommending method and device
CN107392252A (en) Computer deep learning characteristics of image and the method for quantifying perceptibility
Freschi et al. Bootstrap based uncertainty propagation for data quality estimation in crowdsensing systems
CN112788524A (en) Object query method, device, equipment and storage medium
Deng et al. Estimating traffic delays and network speeds from lowfrequency GPS taxis traces for urban transport modelling
Gervasoni et al. Convolutional neural networks for disaggregated population mapping using open data
US10444062B2 (en) Measuring and diagnosing noise in an urban environment
CN108600340A (en) It is a kind of that total method and device is pushed away based on the history crowd size for moving big-sample data
CN113516060B (en) Building space fusion discrimination method and device based on multi-temporal high-resolution data
CN106980029B (en) Vehicle overspeed judgment method and system
Advani et al. Stater: Slit-based trajectory reconstruction for dense urban network with overlapping bluetooth scanning zones
CN105513051A (en) Point cloud data processing method and device
Rodrigues et al. Extracting 3D maps from crowdsourced GNSS skyview data
CN109064445A (en) A kind of quantity statistics method and system, storage medium of animal
CN111899505B (en) Detection method and device for traffic restriction removal

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
GR01 Patent grant
GR01 Patent grant