Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements that are expressly listed or inherent to such process, method, article, or apparatus.
Example 1
Fig. 1 is a flowchart of a track point state recognition method according to an embodiment of the present invention, where the method may be applied to a case of performing accurate motion state recognition on track data of a target object, and the method may be performed by a track point state recognition device, where the track point state recognition device may be implemented in hardware and/or software, and the track point state recognition device may be configured in an electronic device, where the electronic device may include, but is not limited to, a computer, a server, and the like. As shown in fig. 1, the track point state identification method provided in the first embodiment specifically includes the following steps:
s110, compressing the acquired original track data to obtain target track data of different target objects.
Wherein the original track data may be a data set collected by a global positioning system (Global Positioning System, GPS) device and containing a plurality of target object moving tracks, the data set contains a plurality of track points, each track point may contain a time stamp t and a longitudeLatitude and longitudeAttribute information such as target object identification ID. The target objects may refer to subjects that generate trajectories, such as vehicles, persons, equipment, or animals, each having a unique target object identification (e.g., equipment ID, user ID, etc.) for distinguishing between the trajectories of different subjects.
The compression process may refer to a process of simplifying and purifying the original track data, and aims to reduce data volume, remove noise, and output high-quality track data suitable for subsequent track analysis, and may include, for example, operations such as object grouping, time window extraction, longitude and latitude correction, repeated point merging, drift point rejection, and the like.
In the embodiment of the invention, the obtained large-scale original track data can be subjected to object grouping according to the target object identification of the track points to obtain the initial track data corresponding to each target object, and then the initial track data of each target object is subjected to data compression operations such as space-time range filtering, repeated point merging, drift point removing and the like, so that the data quantity of the initial track data is reduced on the basis of keeping key motion characteristics, and the high-quality target track data corresponding to each target object is output.
S120, respectively carrying out track analysis on the target track data of each target object according to a preset space-time density constraint condition to generate a track point state identification result of each target object, wherein the preset space-time density constraint condition comprises a space constraint based on a preset stay radius and a time constraint based on a preset stay time.
The preset space-time density constraint condition can be a double constraint rule for judging the state of the track point (motion), and consists of a space constraint based on a preset stay radius and a time constraint based on a preset stay time, and is a core judgment basis of track analysis.
The preset dwell radius (space constraint) may refer to a pre-configured distance threshold (e.g., 250 meters) for defining a space aggregation, and the activity of the target object within the dwell radius may be regarded as a spatially aggregated state, which is a space criterion for determining the state of the track point.
The preset dwell time length (time constraint) may refer to a pre-configured time threshold (e.g. 20 minutes) for defining a time duration, and the time duration representing that the target object needs to reach the time threshold in the space aggregation state before "dwell" is formed, which is a time standard for determining the state of the track point.
The track analysis can refer to a track point state identification process based on target track data, and specifically can comprise the processes of point cluster aggregation, space-time constraint judgment, state identification and the like. The track point state recognition result can be the final output of track analysis of the target track result by the pointer, and can be a point cluster sequence arranged in time sequence, wherein each point cluster is marked as a stay point cluster or a motion point cluster, and comprises information such as the starting time, the ending time, the longitude and latitude of a central point, the number of combined track points and the like of the point cluster, so that the movement and stay rules of the target object can be intuitively reflected.
In the embodiment of the invention, in order to improve the overall processing efficiency of the track data, the corresponding track analysis operation can be simultaneously executed in a parallel computing mode aiming at the target track data of different target objects, for example, the track analysis operation can be realized in a multi-thread mode, a distributed computing mode and the like. The track analysis process of a single target object is described below, wherein the track analysis process comprises the steps of traversing target track data, carrying out point cluster aggregation on track points in the target track data according to time sequence, judging the state (stay or movement) of the point cluster according to a preset space-time density constraint condition, namely, whether all track points in a check point cluster are located in a circular area (space constraint) taking the center point of the point cluster as a circle center and the preset stay radius as a radius, calculating the duration time of the point cluster from the first track point to the last track point in time, judging whether the duration time reaches the preset stay time (time constraint), if the space constraint and the time constraint are met, the point cluster is the stay point cluster, and if the space constraint and the time constraint are not met, the point cluster is the movement point cluster. After the point cluster identification is completed by traversing all the track points, adjacent stay point clusters with relatively close space distance can be further combined to finally form a point cluster sequence reflecting the stay and motion states of the target object. In short, the clustering of the point clusters is to sequentially identify the largest point cluster within the preset stay radius through clustering, and the largest point cluster also needs to meet the time constraint based on the preset stay time.
According to the technical scheme, the obtained original track data are compressed to obtain the target track data of different target objects, track analysis is carried out on the target track data of each target object according to preset space-time density constraint conditions to generate track point state identification results of each target object, wherein the preset space-time density constraint conditions comprise space constraint based on a preset stay radius and time constraint based on a preset stay time. According to the technical scheme, redundant information can be effectively reduced by compressing original track data, high-quality data input is provided for track analysis, and by adopting space-time density constraint conditions of combination of space constraint based on the preset stay radius and time constraint based on the preset stay time, stay points and motion points in the track data can be accurately identified, so that accuracy and efficiency of track point state identification are improved.
Example two
Fig. 2 is a flowchart of a track point state recognition method according to a second embodiment of the present invention, which is further optimized and expanded based on the foregoing embodiments, and may be combined with each of the optional technical solutions in the foregoing embodiments. As shown in fig. 2, the track point state identification method provided in the second embodiment specifically includes the following steps:
S210, extracting target object identifiers of all track points in the original track data.
In the embodiment of the present invention, after the large-scale original track data is acquired, the target object identifier, such as the device ID, the user ID, the vehicle ID, and the like, contained in each track point may be extracted.
S220, dividing the original track data into initial independent track data corresponding to different target objects according to the target object identification.
The initial independent track data may refer to a data set formed by all original track points of a single target object after being divided according to the target object, and the data set is not subjected to data compression processing.
In the embodiment of the invention, the original track data can be divided into a plurality of groups of initial independent track data according to the target object identification of each track point in the original track data, wherein each group of initial independent track data only comprises all original track points of a single target object. Illustratively, all original track points of the vehicle a are classified as initial independent track data 1, all original track points of the user B are classified as initial independent track data 2, and so on, so as to ensure that track data of different target objects are not confused.
S230, performing data compression operation on each initial independent track data in parallel to obtain corresponding target track data.
In the embodiment of the invention, the data compression operation can be executed on each divided initial independent track data in parallel, for example, the data compression tasks of different target objects can be distributed to independent computing nodes, processor cores or threads and the like for simultaneous processing, and finally the reduced target track data corresponding to each target is generated.
Further, based on the above embodiment of the present invention, as shown in fig. 3, in S230, a data compression operation is performed on the initial independent track data to obtain corresponding target track data, which specifically includes the following steps:
s11, performing track point filtering on initial independent track data according to a preset time window and a preset longitude and latitude coordinate range to obtain first track data;
s12, arranging the track points in the first track data according to a time sequence, merging track points with continuous same longitude and latitude coordinates, and reserving an earliest time stamp to obtain second track data;
S13, traversing second track data, determining a first distance between a current track point and a previous track point and a second distance between the previous track point and a next track point of the current track point, and determining the current track point as a drift point and eliminating if the first distance and the second distance meet a preset drift point judgment condition;
S14, taking the second track data after the drift points are removed as third track data, and combining track points with continuous same longitude and latitude coordinates in the third track data to obtain target track data.
The preset time window may be an effective time range set according to a service requirement or an activity rule of a target object, and is used for screening track points belonging to an effective period in track data, and eliminating redundant points of irrelevant periods. In an embodiment, the preset time window may be set to a time length of 24 hours and cover the active trough period of most target objects, and may be selected from 04:00 to 04:00 the next day, for example. It should be understood that, in practical application, the time length and the time period of the preset time window may be set according to the actual service requirement or the activity rule of the target object, which is not limited in this embodiment.
The preset latitude and longitude coordinate range may refer to an effective geographic boundary set based on an actual track analysis scene and is used for filtering abnormal positioning points exceeding the range in track data, and the preset latitude and longitude coordinate range may be, for example, a latitude and longitude coordinate range of a country, a city, an area and the like.
The drift point may be an abnormal track point caused by signal noise interference, equipment fault and the like, and is shown as a sudden and large jump of the distance between the drift point and the front and rear track points (for example, the distance between two adjacent points is suddenly changed from 10 meters to 1000 meters), which can interfere with the continuity of the track, so that the drift point needs to be removed.
The preset drift point determination condition may be a determination condition for identifying a drift point, and is based on a logic setting that a track point does not suddenly jump greatly in normal movement, and is used for distinguishing an abnormal drift point from a normal movement point, and exemplary, the preset drift point determination condition may at least include whether a first distance is greater than a preset multiple (such as 3 times) of a second distance, where the first distance may be a distance between a current track point and a previous track point, and the second distance may be a distance between two adjacent track points corresponding to the current track point.
The first track data may refer to track data obtained by performing space-time range filtering on initial independent track data, where the space-time range filtering includes time window extraction and longitude and latitude deviation correction. The second track data may refer to track data obtained by repeating point combination of the first track data. The third track data may refer to track data obtained after the second track data is subjected to drift point removal.
In the embodiment of the present invention, the specific process of performing the data compression operation on the initial independent track data to obtain the target track data includes:
① And filtering the space-time range, namely acquiring a preset time window and a preset longitude and latitude coordinate range which are preset, screening initial independent track data based on the preset time window and the preset longitude and latitude coordinate range, only keeping track points with time stamps within the preset time window and longitude and latitude coordinates within the preset longitude and latitude coordinate range, and removing invalid track points outside the time window or beyond the longitude and latitude coordinate range to obtain first track data.
② One-time de-duplication, namely sequencing the track points in the first track data according to time sequence, traversing the sequenced track points, and if the longitude and latitude coordinates of a plurality of continuous track points are identical, for example, the track pointsAndIs the same in longitude and latitude coordinates, only the trace point with the earliest timestamp is reservedAnd obtaining second track data after one time of de-duplication.
③ Drift point rejection, namely traversing the second track data, and for every three continuous track points, namely the previous track pointCurrent track pointAnd the latter locus pointPerforming distance analysis, i.e. calculating the current track points respectivelyWith the previous track pointFirst distance betweenAnd the previous trace pointBetween the track point and the latter track pointIs a second distance of (2)Judging the first distanceAnd a second distanceJudging whether a preset drift point judging condition is met, if so, judging the current track pointThe third track data can be obtained after all the drift points in the second track data are removed for the drift points and the drift points are removed, wherein the preset drift point judgment condition can be that whether the first distance is more than 3 times of the second distance or not。
In one embodiment, the first distanceAnd a second distanceThe squared euclidean distance may be used, namely:
④ And performing secondary deduplication, namely performing deduplication operation on the third track data again to obtain final target track data because new adjacent repeated points possibly appear after the drift points are removed, wherein the flow of the deduplication operation is the same as that of the step ②, and the repeated description is omitted.
According to the method, the device and the system, the space-time range filtering, the drift point removing and the twice duplicate removal data compression operation are carried out on the initial independent track data of the target object, so that redundancy or noise data (such as repeated reported position points, misplacement drift points and the like) in the initial independent track data can be effectively reduced, the calculation amount of subsequent track analysis (such as point cluster aggregation and state identification) is remarkably reduced, and the overall processing efficiency is improved.
S240, performing track point state recognition operation on each target track data in parallel to generate a corresponding track point state recognition result, wherein the track point state recognition operation is used for recognizing track points in the target track data as stay points or motion points based on a preset space-time density constraint condition.
In the embodiment of the invention, the corresponding track point state identification operation can be simultaneously executed by distributing independent processing threads or computing nodes and the like aiming at the target track data of each target object. The processing processes of different target objects are mutually independent, do not occupy calculation resources, only complete track point (motion) state identification tasks in respective calculation units, and finally output track point state identification results corresponding to each target object.
Further, on the basis of the above embodiment of the present invention, as shown in fig. 4, in S240, a track point state recognition operation is performed on the target track data to generate a corresponding track point state recognition result, which specifically includes the following steps:
S21, initializing a first track point in target track data as a center point of a current point cluster;
S22, traversing subsequent track points according to a time sequence, and judging whether all track points in the current point cluster are in a target circular area taking a central point as a circle center and a preset stay radius as a radius;
s23, if all the track points are in the target circular area and undetected track points exist in the target track data, merging the current track points into a current point cluster, updating the center point of the current point cluster, returning to traverse the subsequent track points according to the time sequence, and judging whether all the track points in the current point cluster are in the target circular area with the center point as the circle center and the preset stay radius as the radius;
S24, if all the track points are in the target circular area and the undetected track points do not exist in the target track data, marking the current point cluster as a stay point cluster, and recording point cluster information;
S25, if at least one track point is not in the target circular area and the duration of the current point cluster is longer than the preset stay time, marking the current point cluster with the tail track point removed as a stay point cluster, recording the point cluster information, and then re-executing the point cluster aggregation procedure by taking the tail track point as the central point of the new current point cluster;
S26, if at least one track point is not in the target circular area and the duration of the current point cluster is smaller than or equal to the preset stay time, marking the first track point in the current point cluster as a moving point cluster, recording point cluster information, and then re-executing a point cluster aggregation flow by taking the second track point in the current point cluster as the center point of the new current point cluster;
S27, after the target track data are completely traversed, determining the accumulated spherical surface distance of all the moving point clusters between the adjacent stay point clusters in the obtained point cluster sequence, if the accumulated spherical surface distance is smaller than a preset distance threshold value, merging the two stay point clusters and all the moving point clusters between the two stay point clusters into a new stay point cluster, and updating the point cluster information of the new stay point cluster;
s28, determining the ending time of each point cluster in the point cluster sequence to update the point cluster information, and taking the updated point cluster sequence as a track point state identification result of the target object.
In the embodiment of the invention, the track analysis process of the single target object specifically comprises the following steps:
① An empty current point cluster is initialized and a first track point in target track data is set as an initial center point (longitude and latitude coordinates) of the current point cluster.
② And sequentially processing other track points in the target track data according to time sequence, and for each current track point to be processed, judging whether all track points contained in the current point cluster are positioned in a target circular area taking the central point of the current point cluster as the circle center and taking the preset stay radius as the radius, namely judging whether all track points in the current point cluster meet the space constraint based on the preset stay radius.
In an embodiment, determining whether the track point is in the target circular area may specifically include:
determining a cosine value of a geocentric angle between the track point and a central point of the current point cluster;
If the cosine value of the geocentric angle is larger than the preset threshold value of the cosine value of the geocentric angle, determining that the track point is in the target circular area, otherwise, determining that the track point is not in the target circular area.
The cosine value of the geocentric angle can be the cosine value of an included angle (geocentric angle) formed by the connection line of the sphere center of the earth and two track points (the track points to be judged and the central point of the point cluster), and the cosine value is an indirect index for measuring the spherical distance between two points on the surface of the earth, and the larger the value is, the closer the distance between the two points is.
Specifically, longitude and latitude coordinates of the track point to be determined and the center point of the current point cluster can be extracted, and based on the longitude and latitude coordinates of the two points, the geocentric angle cosine value between the two points is calculated through the spherical geometrical relationship, for example, for the track point to be determinedAnd the center point of the current point clusterThe cosine values of the centroid angle between them can be expressed as:
In the formula, Representing a trace pointAnd the center point of the current point clusterThe center angle between them.
Then, the calculated cosine value of the geocentric angle is calculatedAnd a preset cosine value threshold value of the geocentric angleComparing ifAnd if the spherical distance between the two points is smaller than or equal to the preset stay radius, judging that the track point is in the target circular area, otherwise, judging that the track point is not in the target circular area. Wherein, the threshold value of the cosine value of the geocentric angle is presetCan be based on a preset dwell radiusAnd the earth radius R, i.e。
It should be understood that in this embodiment, the cosine value of the geocentric angle between the track point to be determined and the center point of the current point cluster is used to determine whether the track point meets the space constraint based on the preset stay radius. In practical application, the space constraint judgment can be performed by utilizing the spherical distance between the two, and the spherical distance between the two can be expressed asIf the spherical distanceLess than or equal to a preset spherical distance thresholdAnd if not, judging that the track point is not in the target circular area. As can be seen from the calculation formula of the spherical distance, the calculation of the cosine value of the geocentric angle is an intermediate step of the calculation of the spherical distance, and the embodiment directly uses the cosine value of the geocentric angle to carry out space constraint judgment, so that the calculation resource consumption can be reduced, and the calculation efficiency is remarkably improved.
③ If all the track points in the current point cluster are in the target circular area (namely, the space constraint is met), and unprocessed track points still exist in the target track data, merging the next undetected track point, namely, the current track point into the current point cluster, recalculating the center point of the current point cluster, returning to the step S22, and continuously judging whether the updated current point cluster meets the space constraint. Wherein the updated center pointCan be expressed as:, where n represents the number of track points in the current point cluster.
④ If all track points in the current point cluster are in the target circular area (i.e. space constraint is satisfied) and no undetected track points exist in the target track data (i.e. traverse to the end of the target track data), marking the current point cluster as a stay point cluster (representing that the target object stays in the area), and recording phase point cluster information of the point cluster, for example, including the following tuple information, wherein,The starting time of the stay of the jth point cluster at the center point of the point cluster is represented, namely, the timestamp corresponding to the first track point in the point cluster; And Respectively representing the longitude and the latitude of the center point of the jth point cluster; Representing the number of merging track points contained in the jth point cluster; Representing the motion state of the jth point cluster for identifying the current point cluster Whether it is a resting point cluster or a moving point cluster, andIndicating the resting state of the vehicle,Representing the state of motion.
⑤ If at least one track point exists in the current point cluster and is not in the target circular area (i.e. space constraint is not met), and the duration time of the current point cluster (the time difference between the first track point and the last track point in the cluster) is longer than the preset stay time (i.e. time constraint is met), marking the point cluster after the tail track point (i.e. the last track point in the current point cluster) is removed as a stay point cluster, recording relevant point cluster information, taking the tail track point as the center point of the new current point cluster, restarting the point cluster aggregation flow, and returning to execute S22.
⑥ If at least one track point exists in the current point cluster and is not in the target circular area (i.e. space constraint is not met), and the duration of the current point cluster is smaller than or equal to the preset stay time (i.e. time constraint is not met), marking the first track point in the current point cluster as a moving point cluster (representing that the target object is in a moving state) and recording related point cluster information, then taking the second track point in the current point cluster as the center point of the new current point cluster, restarting the point cluster aggregation flow, and returning to execute S22.
⑦ After the target track data is completely traversed, a point cluster sequence containing a plurality of point clusters is generated, then the point cluster sequence is checked, and the accumulated spherical distance of all the moving point clusters is calculated for two adjacent stay point clustersIf the accumulated spherical distanceLess than a preset distance thresholdAnd merging the two stay point clusters and all the movement point clusters in the middle into a new stay point cluster, and updating the related point cluster information of the new point cluster. Exemplary, if present,AndFor two adjacent clusters of dwell points, the corresponding cumulative spherical distance can be expressed as:
After the two adjacent stay point clusters are combined, the corresponding start time of the new stay point cluster is as follows I.e. the previous dwell point clusterThe longitude and latitude corresponding to the new center point are respectively as follows:, The number of the new merging track points is The new motion state is。
By combining the short movements in the step S27, the misjudgment of short-distance movement (such as traffic jam creeping) is solved, and the stay continuity can be improved.
⑧ Adding an end time for each dwell or motion point cluster in the sequence of point clustersSpecifically, if a subsequent point cluster exists, setting the ending time of the current point cluster as the starting time of the next point cluster, if no subsequent point cluster exists, namely, the current point cluster is the last point cluster in the point cluster sequence, setting the ending time of the current point cluster as the right boundary of the preset time window, and finally, taking the updated point cluster sequence as a track point state identification result of the corresponding target object.
Meanwhile, parameters such as the preset stay radius, the preset stay time, the preset distance threshold and the like can be adjusted according to actual scenes, for example, the track of a pedestrian adopts small radius/short time, the track of a vehicle adopts large radius/long time and the like, so that the technical scheme can be suitable for track analysis requirements of different target objects (people, vehicles, equipment and the like).
According to the technical scheme, the object grouping is carried out on large-scale original track data, then data compression operation is carried out on initial independent track data of each target object in parallel to obtain corresponding target track data, redundant information can be effectively reduced, the obtained target track data are more simplified, a high-quality low-noise input basis is provided for subsequent track analysis, calculation resource consumption in a subsequent analysis process is reduced, parallel track analysis is carried out on the target track data of each target object by adopting a space constraint based on a preset stay radius and a time constraint based on a preset stay time, stay points and motion points in the respective track data can be accurately identified, accuracy and efficiency of track point state identification are improved, in addition, data compression and track analysis flows of each target object are mutually independent, track data confusion of different targets is avoided, scene requirements of multi-body (such as multiple users, multiple devices and multiple vehicles) track analysis can be met, and universality of the scheme is improved.
Example III
Fig. 5 is a flowchart of a track point state recognition method provided by the third embodiment of the present invention, where the present embodiment uses a target object as a vehicle as an example on the basis of the foregoing embodiment, and provides an implementation manner of the track point state recognition method, so as to quickly and accurately recognize track point motion states of different target objects. As shown in fig. 5, the track point state recognition method provided in the third embodiment of the present invention specifically includes the following steps:
S310, acquiring original track data.
In the embodiment of the invention, the original track data can contain track points of a large number of target objects (i.e. different vehicles), wherein redundant and abnormal track points can exist, and each track point contains the following attribute information of time stamp t and longitudeLatitude and longitudeAnd a target object identification ID.
S320, dividing the original track data into initial independent track data corresponding to different target objects according to the target object identification.
S330, an independent calculation unit is allocated for each target object.
In the embodiment of the invention, each target object can be respectively allocated with an independent computing unit, such as an independent computing node, a processor core or a thread, and the data compression and track analysis tasks of the respective target object are respectively executed by utilizing the computing units.
S340, controlling each computing unit to execute corresponding data compression tasks according to the initial independent track data of each target object so as to obtain target track data corresponding to each target object.
In the embodiment of the present invention, taking a single target object as an example, the execution flow of the corresponding data compression task is as follows:
① Time window extraction, namely, the initial independent track data can be extracted by utilizing a preset time window Filtering to obtain track data. Wherein, the time window extraction can be carried out daily, the time window setting needs to consider the region where the time window is positioned and the trough time of the vehicle running (for example, 24 hours account period plusAn hour delay, i.e., 04:00-the next 04:00), if there are sufficient computing resources, the longer the time span the better, but the cut-off time needs to be set at the trough time of the vehicle travel.
② Deviation correction of longitude and latitude, namely, track data can be corrected by utilizing a preset longitude and latitude coordinate rangeFiltering again to obtain track data. Wherein, the Chinese effective coordinate span can be utilized to keep meeting the requirementsAndExcluding invalid track data, thereby obtaining track data after space-time range filtering。
③ In the normal case, the track data contains a large number of track points in a static state, and the calculation amount of the subsequent track analysis can be greatly reduced by combining repeated points in advance. Specifically, can be firstly matched withAll the track points in the track points are sequenced back and forth according to the time sequence, and the sequenced track points are traversed, if the longitude and latitude coordinates of a plurality of track points are identical, for example, the track pointsAndIs the same in longitude and latitude coordinates, i.e,Only the trace point in which the timestamp is earliest is retainedObtaining track data after one-time de-duplication。
④ Drift point rejection, namely, because the GPS data has drift caused by signal noise, the step identifies and removes track points with different distances from adjacent points. Specifically, the trajectory data is traversedFor every three continuous track points, the previous track pointCurrent track pointAnd the latter locus pointPerforming distance analysis, i.e. calculating the current track points respectivelyWith the previous track pointFirst squared Euclidean distance betweenAnd the previous trace pointBetween the track point and the latter track pointIs the second square Euclidean distance of (2)The previous track point is set according to the angle analysis of plane geometryCurrent track pointAnd the latter locus pointPoints A, B and C, respectively, the normal trajectory should be a smooth forward curve ifI.e.Is obtained according to sine theoremVisible current track pointThe distance between the current track point and the adjacent track point is abnormally large, so the current track point is judgedAre drift points and are culled. Most position drift noise points can be removed through the method, and the track data after the drift points are removed is as follows。
⑤ Secondary de-duplication, namely, new adjacent repeated points possibly appear after the drift point is removed, so that the track data can be referred to in the step ③Performing repeated removing operation again to obtain further simplified target track data。
S350, controlling each computing unit to execute a corresponding track analysis task according to the target track data of each target object so as to obtain a track point state identification result corresponding to each target object.
In the embodiment of the present invention, taking a single target object as an example, the execution flow of the corresponding track analysis task is as follows:
① Initializing and creating an empty current point cluster, and setting a first track point in target track data Set as the initial center point of the current point cluster(Longitude and latitude coordinates).
② Traversing the subsequent track points according to the time sequence, and judging whether all track points in the current point cluster are at the center pointIs the center of a circle and presets the stay radiusAnd judging whether all track points in the current point cluster meet space constraint based on a preset stay radius in the target circular area with the radius.
The step can use the geocentric angle to approximately replace the spherical surface distance of the earth surface, namely, the track points to be judged are comparedAnd the center point of the current point clusterAnd the cosine value of the geocentric angle between the two points is used for judging whether the track point is in the target circular area, so that the calculation efficiency is improved, and repeated calculation is avoided. Specifically, the locus point to be judgedAnd the center point of the current point clusterThe cosine value of the centroid angle in between can be expressed as: the spherical distance between the two can be expressed as Wherein the earth radius r=6371000 meters, if: then determine the track point Within the target circular region (i.e., satisfying the spatial constraint), otherwise, determining the locus pointNot within the target circular region (i.e., not meeting space constraints).
③ If the current point clusterAll the track points in the track point are in the target circular area (namely, the space constraint is satisfied), and unprocessed track points still exist in the target track dataThen the next undetected trace pointMerging the two points into the current point cluster, re-calculating the central point of the current point cluster, and returning to execute the step ② to continuously judge whether the updated current point cluster meets the space constraint.
Wherein, the center point of the current point clusterEuclidean centers that can be updated to the current cluster of points, i.e,。
④ If the current point clusterAll track points in the track cluster are in the target circular area (namely, space constraint is met), and no undetected track points exist in the target track data (namely, the track points traverse to the tail of the target track data), marking the current point cluster as a stay point cluster, and recording phase point cluster information of the point cluster, namely, tuple informationWherein, the method comprises the steps of,For the current cluster of pointsOf the start time of the cluster of points, i.e. the cluster of pointsA timestamp corresponding to the first track point; And Respectively the current point clustersLongitude and latitude of (a); Representing the current cluster of points The number of incorporated trace points; Set to 0, indicating the current cluster of points Is a cluster of stay points.
⑤ If the current point clusterIf at least one track point is not in the target circular area (i.e. the space constraint is not satisfied), calculating the duration of the current point clusterDuration of if(I.e., satisfying the time constraint), then the points are clusteredMarked as a stay point cluster and recording tuple informationWherein, the method comprises the steps of,Merging track point numbersThen, the track points areAs the center point of the new current point cluster, the point cluster aggregation process is restarted, i.e., step ② is performed back.
⑥ If the current point clusterAt least one track point is not in the target circular area (namely, the space constraint is not satisfied), and the duration of the current point cluster is less than or equal to the preset stay time(I.e., the time constraint is not satisfied), the current point is clusteredFirst track point in (a)Marked as a cluster of motion points (in which there is actually only one motion point) And record the tuple informationWherein, the method comprises the steps of,Merging track point numbersThen, the current point is clusteredA second trace point in (a)As the center point of the new current point cluster, the point cluster aggregation process is restarted, i.e., step ② is performed back.
⑦ Merging the short movements, namely circularly executing the steps ② to ⑥ until all track points are traversed completely, and generating a point cluster sequence containing a plurality of point clustersThen for two adjacent stay clusters in the sequence of clusters, e.g. if present,AndIs two adjacent stay point clustersFor successive clusters of motion points), the cumulative spherical distance of all clusters of motion points between them is calculated:
If the accumulated spherical distanceLess than a preset distance thresholdCombining the two stay point clusters and all the movement point clusters in the middle into a new stay point clusterAnd for new point clustersThe updating of the related point cluster information of the (c) comprises the following steps:,,,,。
⑧ Adding an end time for each dwell or motion point cluster in the sequence of point clusters Specifically, if a subsequent point cluster exists, setting the ending time of the current point cluster as the starting time of the next point cluster, if no subsequent point cluster exists, namely, the current point cluster is the last point cluster in the point cluster sequence, setting the ending time of the current point cluster as the right boundary of the preset time window, and finally, taking the updated point cluster sequence as a track point state identification result of the corresponding target object. Wherein each point cluster in the point cluster sequence contains the following field information:。
Fig. 6 is a flowchart of another track point state recognition method according to the third embodiment of the present invention. As shown in fig. 6, the scheme mainly includes an original GPS input procedure, a data preprocessing procedure, and a track point status recognition procedure, and the specific implementation process may refer to the above embodiment, which is not described herein again.
According to the technical scheme, the object grouping is carried out on the large-scale original track data, then the data compression operation is carried out on the initial independent track data of each target object in parallel, redundant information can be effectively reduced, the obtained target track data are more simplified, a high-quality and low-noise input basis is provided for subsequent track analysis, the calculation resource consumption of the subsequent analysis process is reduced, the parallel track analysis is carried out on the target track data of each target object by adopting the time-space double constraint condition, the recognition precision and the recognition efficiency of the stay points in the track are improved, meanwhile, the scheme can be suitable for track analysis requirements of different target objects (people, vehicles, equipment and the like), and the universality is strong.
Example IV
Fig. 7 is a schematic structural diagram of a track point state recognition device according to a fourth embodiment of the present invention. As shown in fig. 7, the apparatus includes:
the compression processing module 41 is configured to perform compression processing on the obtained original track data to obtain target track data of different target objects;
The track analysis module 42 is configured to perform track analysis on the target track data of each target object according to a preset space-time density constraint condition, and generate a track point state recognition result of each target object, where the preset space-time density constraint condition includes a space constraint based on a preset stay radius and a time constraint based on a preset stay duration.
Further, on the basis of the above embodiment of the invention, the compression processing module 41 includes:
the object identification extraction unit is used for extracting target object identifications of all track points in the original track data;
The object grouping unit is used for dividing the original track data into initial independent track data corresponding to different target objects according to the target object identification;
And the data compression parallel execution unit is used for executing data compression operation on each initial independent track data in parallel to obtain corresponding target track data.
Further, on the basis of the embodiment of the present invention, performing a data compression operation on the initial independent track data to obtain corresponding target track data, including:
performing track point filtering on the initial independent track data according to a preset time window and a preset longitude and latitude coordinate range to obtain first track data;
Arranging the track points in the first track data according to the time sequence, merging track points with continuous longitude and latitude coordinates of the same longitude and latitude, and reserving the earliest timestamp to obtain second track data;
Traversing the second track data, determining a first distance between the current track point and the previous track point and a second distance between the previous track point and the next track point of the current track point, and determining the current track point as a drift point and eliminating if the first distance and the second distance meet the preset drift point judgment condition;
And taking the second track data after the drift point is removed as third track data, and merging track points with continuous same longitude and latitude coordinates in the third track data to obtain target track data.
Further, on the basis of the above embodiment of the invention, the trajectory analysis module 42 includes:
The state recognition parallel execution unit is used for executing the track point state recognition operation on each target track data in parallel to generate a corresponding track point state recognition result, wherein the track point state recognition operation is used for recognizing the track points in the target track data as stay points or motion points based on a preset space-time density constraint condition.
Further, on the basis of the embodiment of the present invention, track point state recognition operations are performed on target track data, and corresponding track point state recognition results are generated, including:
Initializing a first track point in target track data as a center point of a current point cluster;
Traversing subsequent track points according to a time sequence, and judging whether all track points in the current point cluster are in a target circular area taking a central point as a circle center and a preset stay radius as a radius;
If all the track points are in the target circular area and undetected track points exist in the target track data, merging the current track points to a current point cluster, updating the center point of the current point cluster, returning to traverse the subsequent track points according to the time sequence, and judging whether all the track points in the current point cluster are in the target circular area taking the center point as the circle center and the preset stay radius as the radius;
if all the track points are in the target circular area and the undetected track points do not exist in the target track data, marking the current point cluster as a stay point cluster, and recording the point cluster information;
if at least one track point is not in the target circular area and the duration of the current point cluster is longer than the preset stay time, marking the current point cluster with the tail track point removed as a stay point cluster, recording the point cluster information, and then re-executing a point cluster aggregation flow path by taking the tail track point as the central point of the new current point cluster;
If at least one track point is not in the target circular area and the duration of the current point cluster is less than or equal to the preset stay time, marking the first track point in the current point cluster as a moving point cluster, recording the point cluster information, and then re-executing a point cluster aggregation flow path by taking the second track point in the current point cluster as the center point of the new current point cluster;
After the target track data is completely traversed, determining the accumulated spherical surface distance of all the moving point clusters between the adjacent stay point clusters in the obtained point cluster sequence, merging the two stay point clusters and all the moving point clusters between the two stay point clusters into a new stay point cluster if the accumulated spherical surface distance is smaller than a preset distance threshold value, and updating the point cluster information of the new stay point cluster;
And determining the ending time of each point cluster in the point cluster sequence to update the point cluster information, and taking the updated point cluster sequence as a track point state identification result of the target object.
Further, on the basis of the embodiment of the present invention, determining whether the track point is in the target circular area includes:
determining a cosine value of a geocentric angle between the track point and a central point of the current point cluster;
If the cosine value of the geocentric angle is larger than the preset threshold value of the cosine value of the geocentric angle, determining that the track point is in the target circular area, otherwise, determining that the track point is not in the target circular area.
The track point state recognition device provided by the embodiment of the invention can execute the track point state recognition method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example five
Fig. 8 shows a schematic diagram of an electronic device 50 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 8, the electronic device 50 includes at least one processor 51, and a memory, such as a Read Only Memory (ROM) 52, a Random Access Memory (RAM) 53, etc., communicatively connected to the at least one processor 51, in which the memory stores a computer program executable by the at least one processor, and the processor 51 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 52 or the computer program loaded from the storage unit 58 into the Random Access Memory (RAM) 53. In the RAM 53, various programs and data required for the operation of the electronic device 50 can also be stored. The processor 51, the ROM 52 and the RAM 53 are connected to each other via a bus 54. An input/output (I/O) interface 55 is also connected to bus 54.
Various components in the electronic device 50 are connected to the I/O interface 55, including an input unit 56 such as a keyboard, mouse, etc., an output unit 57 such as various types of displays, speakers, etc., a storage unit 58 such as a magnetic disk, optical disk, etc., and a communication unit 59 such as a network card, modem, wireless communication transceiver, etc. The communication unit 59 allows the electronic device 50 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunications networks.
The processor 51 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 51 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 51 performs the various methods and processes described above, such as the track point state identification method.
In some embodiments, the track point state identification method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as the storage unit 58. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 50 via the ROM 52 and/or the communication unit 59. When the computer program is loaded into RAM 53 and executed by processor 51, one or more steps of the track point state identification method described above may be performed. Alternatively, in other embodiments, the processor 51 may be configured to perform the track point state identification method in any other suitable way (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include being implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be a special or general purpose programmable processor, operable to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
In some embodiments, the track point state recognition method may be implemented as a computer program, which is intangibly comprised in a computer program product, which when executed by a processor implements the track point state recognition method of the invention, the computer program product being understood to be a software product whose solution is implemented mainly by the computer program. A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user, for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback), and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a Local Area Network (LAN), a Wide Area Network (WAN), a blockchain network, and the Internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.