Vehicle moving track data compression method and system and electronic equipment
By analyzing vehicle driving data, removing impurities, merging redundant points and merging similar trajectory, combined with Douglas-Peucker trajectory compression method, the problem of low compression rate of vehicle moving trajectory data is solved, and efficient data processing and transmission is achieved, suitable for Subsequent data mining analysis.
Patent Information
- Application Number
- CN202310702265.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-13
- Publication Date
- 2024-12-13
AI Technical Summary
The prior art is difficult to effectively compress vehicle movement trajectory data, resulting in high data processing and transmission pressure and low compression effect.
By acquiring vehicle driving data, performing analysis and processing, decomposition removal, trajectory redundant point merging and similar trajectory merging, the Douglas-Peucker trajectory compression method and point-based distance similarity judgment are used to further compress the vehicle trajectory data.
It improves the compression rate of vehicle trajectory data, reduces data processing and transmission pressure, retains trajectory information, and is suitable for subsequent data mining and analysis.
Smart Images

Figure CN119135185A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of vehicle travel data processing, and more specifically, to a vehicle movement trajectory data compression method. In addition, the present application also relates to a vehicle movement trajectory data compression system and electronic equipment. Background Art
[0002] With the increasing coverage of 5G technology and the rapid development of wireless communication and sensor equipment in the automotive industry, the mobile data generated daily has gradually become diversified as the scope of individual activities continues to expand. The mobile trajectories generated by these individuals can be used to analyze user preferences, driving habits, and hotspot path selection, etc., which has high research value. However, due to the large amount of collected mobile data and the presence of a large amount of useless information, it cannot be directly used by mining algorithms. Some commonly used offline trajectory compression processing methods generally only consider compressing adjacent trajectory points, resulting in low compression effect.
[0003] Therefore, how to provide a vehicle movement trajectory data compression method that can improve the compression rate of vehicle movement trajectory and reduce the pressure of data processing and transmission has become a technical problem that needs to be solved urgently by technical personnel in this field. Summary of the invention
[0004] In order to solve the above technical problems, the present application provides a vehicle movement trajectory data compression method, which can improve the compression rate of vehicle form trajectory and reduce the pressure of data processing and transmission. In addition, the present application also relates to a vehicle movement trajectory data compression system and electronic equipment, which also have the above beneficial effects.
[0005] The technical solutions provided by this application are as follows:
[0006] The present application provides a vehicle movement trajectory data compression method, the method comprising the following steps: acquiring vehicle driving data, the vehicle driving data comprising vehicle original trajectory data; performing a first analysis process on the vehicle driving data to obtain vehicle travel information; performing a first de-cluttering process on the vehicle original trajectory data to obtain first trajectory de-cluttering data; performing a trajectory redundant point merging process on the first trajectory de-cluttering data to obtain first trajectory compressed data; performing a similar trajectory merging process on the first trajectory compressed data to output second trajectory compressed data.
[0007] Furthermore, in a preferred embodiment of the present invention, the vehicle driving data is associated with the VIN code, and is data obtained by collecting the vehicle speed, vehicle coordinate longitude and vehicle coordinate latitude according to the collection time; the vehicle trip information includes the vehicle VIN code, trip ID, trip start and end time, trip distance, trip start state of charge (SOC) and trip end state of charge (SOC), and trip average speed.
[0008] Furthermore, in a preferred embodiment of the present invention, the "performing a first de-impurity processing on the original trajectory data of the vehicle to obtain the first trajectory de-impurity data" specifically includes the following steps: filling / eliminating missing data: filling in the data where the GPS signal is lost under normal driving conditions, and eliminating the data if it cannot be filled; eliminating redundant data: eliminating repeated data generated under normal use conditions based on long-term stays and repeated collections; eliminating noise data: eliminating noise data generated by the system itself or by external interference during the collection process.
[0009] Further, in a preferred embodiment of the present invention, the noise data type includes: a) invalid data: erroneous data generated during data collection, inf or null data; b) abnormal time: due to signal loss, the time for providing data is less than 1s;
[0010] c) Abnormal vehicle speed: the vehicle speed exceeds the maximum speed that the vehicle can travel; d) Abnormal parking: during the engine off period, the engine speed is 0, but the vehicle speed is not 0; e) Abnormal mileage: the driving distance exceeds the maximum drivable distance in a day; f) Abnormal power consumption: within the driving track, the mileage is not zero, and the power consumption is negative or 0.
[0011] Furthermore, in a preferred embodiment of the present invention, the “merging redundant trajectory points of the first trajectory data to obtain compressed trajectory data” specifically includes the following steps: Step A): Identify along the trajectory direction. If there are two or more trajectory information points within a first preset distance threshold s, retain the last trajectory information point and remove the remaining trajectory information points; Step B): Loop execution until the distance difference between any two adjacent trajectory information points among all trajectory information points is greater than the first preset distance threshold s, and output the first process trajectory Traj=[p1, p2,…, pn]; Step C): Approximate trajectory processing is performed on the first process trajectory Traj=[p1, p2,…, pn] according to the Douglas-Peucker trajectory compression method to obtain an approximate trajectory Traj′, and the approximate trajectory Traj′ is output as the first trajectory compressed data.
[0012] Furthermore, in a preferred embodiment of the present invention, the step A) specifically includes the following steps: A1) traversing the vehicle's trajectory to collect data, and calculating the difference in travel distance between the current trajectory information point and the adjacent trajectory information point during the vehicle's driving process; A2) if the travel distance differences of the trajectory information points in the driving trajectory are all greater than a given first preset distance threshold s, no compression is required; A3) if there are adjacent trajectory information points whose difference is not greater than the given first preset distance threshold s, merging them, retaining only the last trajectory information point, and removing the remaining trajectory information points.
[0013] Furthermore, in a preferred embodiment of the present invention, the step C) specifically includes the following steps: C1) analyzing the first process trajectory Traj=[p1, p2, ..., pn], among the points p2, ..., pn-1, the point with the largest distance from the line segment p1pn- is pindex, and the distance between pindex and the line segment p1pn- is dmax; C2) if dmax is less than a second preset distance threshold d, setting the first process trajectory Traj=[p1, p2, ..., pn] as an approximate trajectory, and outputting the first process trajectory Traj as the first trajectory compressed data; C3) if dmax is less than a second preset distance threshold d, max is greater than or equal to the second preset distance threshold d, then take pindex as the segmentation point and divide the first process trajectory Traj = [p1, p2, ..., pn] into two segments, repeat the above operation for the two segments, and determine whether to further segment according to the relationship between the distance from the trajectory information points on the two end trajectories to p1pindex- and pindexpn- and the second preset distance threshold d; C4) when the distances from all trajectory information points to the corresponding trajectories are less than the second preset distance threshold d, an approximate trajectory Traj′ is obtained, and the approximate trajectory Traj′ is output as the first trajectory compression data.
[0014] Furthermore, in a preferred embodiment of the present invention, the similar trajectory merging process adopts a trajectory similarity judgment method based on point distance, which specifically includes the following steps: initializing the trajectory matrix Cost(M, N), N represents the number of trajectory points of trajectory Trajn1, M represents the number of trajectory points of trajectory Trajm2, and setting a distance threshold distance; calculating the Euclidean distance between trajectory Trajn1 and trajectory Trajm2, if the distance is less than the distance threshold distance, it is 1, otherwise it is 0; when a trajectory point of trajectory Trajn1 and a trajectory point CostTrajn1,Trajm2 in trajectory Trajm2 are 1, stop the current distance calculation and start a new trajectory point matching, otherwise continue to calculate the trajectory distance; set a trajectory similarity threshold R, when the trajectory matrix Cost-1,-1minM,N>R, it means that the two trajectories are similar and can be merged, otherwise they are not similar; according to the similarity judgment result, merge the similar trajectories to obtain the second trajectory compression data.
[0015] In addition, the present application also provides a technical solution for a vehicle movement trajectory data compression system. The solution is used to execute the above-mentioned vehicle movement trajectory data compression method; the system includes: a first acquisition module, the first acquisition module is used to acquire vehicle travel data; a first processing module, the first processing module is used to perform a first analysis and processing on the vehicle travel data to obtain vehicle travel information; a second processing module, the second processing module is used to perform a first de-impurity processing on the original vehicle trajectory data to obtain first trajectory de-impurity data; a third processing module, the third processing module is used to perform a trajectory redundant point merging processing on the first trajectory de-impurity data to obtain first trajectory compressed data; a fourth processing module, the fourth processing module is used to perform a similar trajectory merging processing on the first trajectory compressed data to output second trajectory compressed data.
[0016] In addition, the present application also provides a technical solution for an electronic device. The solution includes: a computer program, the computer program is used to execute the above-mentioned vehicle movement trajectory data compression method; a memory, the memory is used to store the computer program; and a processor, the processor is used to execute the computer program.
[0017] It should be noted that with the popularization of automobiles and the development of urban transportation networks, human activity areas have expanded and become more diverse. The amount of mobile data collected by automobile sensor devices is increasing, and the data is gradually becoming more diverse. This data can be used to analyze user preferences, driving habits, hotspot paths and areas, etc. However, this data is constantly growing. Although it has been filtered by some means, it is still limited by computing resources and cannot be directly used by mining algorithms.
[0018] In order to solve the above problems, we first developed data preprocessing logic and outlier processing methods by mining the vehicle's driving data and trajectory data. Then, we combined the retained vehicle trajectory data to perform trajectory compression. Finally, we combined the compressed vehicle trajectory data to determine the trajectory similarity of different trips and removed the trip trajectory data with high similarity.
[0019] The present invention comprehensively considers the similarity of adjacent trajectory points and trajectories between different travel slices of the vehicle, first analyzes the vehicle's driving data, and formulates a set of data screening logic to eliminate invalid trajectory information. Then, combined with the acquired vehicle driving data, a trajectory compression method based on driving distance is first proposed to reduce the redundant trajectory points of adjacent trajectory points, and then an efficient trajectory repetition recognition method is proposed to further compress similar trajectory data of different travel slices.
[0020] Compared with the prior art, the vehicle movement trajectory data compression method provided by the present invention first obtains the vehicle driving data of the vehicle, and then obtains the vehicle travel information through a first analysis process based on the vehicle driving data. Furthermore, the vehicle driving data includes the original trajectory data of the vehicle, and a first impurity removal process is performed based on the original trajectory data of the vehicle to obtain the first trajectory impurity removal data; further, the first trajectory compressed data is obtained by merging the trajectory redundant points; the present solution creatively proposes to further compress the first trajectory compressed data into the second trajectory compressed data by further adopting the method of merging and calculating similar trajectories; thereby completing the high compression of the vehicle trajectory data. The technical solution provided by the present application can improve the compression rate of the vehicle trajectory and reduce the pressure of data processing and transmission. In addition, the present application also relates to a vehicle movement trajectory data compression system and electronic device, which also have the above-mentioned beneficial effects.
[0021] Further, compared with the prior art, the present invention has the following advantages:
[0022] 1. High reliability. The number of vehicle trajectories processed by this method can be compressed by 40% at most, and the loss of trajectory information is less than 10%.
[0023] 2. Innovation: First, the consideration of driving distance is added to the existing offline trajectory compression method. On the basis of retaining trajectory information, redundant information is further eliminated to reduce the number of trajectories. Secondly, the trajectory similarity calculation method is optimized. By setting the similarity threshold and cost matrix to end early, the time complexity of the original method is reduced and the execution performance of the algorithm is improved.
[0024] 3. It can be extended. The trajectory data processed by this method retains the trajectory information, and trajectory data mining can be further performed to study travel hotspots, user preferences and other follow-up work. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0026] Figure 1 A schematic diagram of a flow chart of a vehicle movement trajectory data compression method provided by an embodiment of the present invention;
[0027] Figure 2 A schematic diagram of processing flow nodes of a vehicle movement trajectory data compression method provided by an embodiment of the present invention;
[0028] Figure 3 A schematic diagram of the simplified structure of a vehicle movement trajectory data compression system provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0029] In order to enable those skilled in the art to better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of this application.
[0030] It should be noted that when an element is referred to as being "fixed on" or "set on" another element, it can be directly on the other element or indirectly set on the other element; when an element is referred to as being "connected to" another element, it can be directly connected to the other element or indirectly connected to the other element.
[0031] It should be understood that the terms "length", "width", "up", "down", "front", "back", "first", "second", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating the orientation or position relationship, are based on the orientation or position relationship shown in the drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present application.
[0032] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, "multiple" and "several" mean two or more, unless otherwise clearly and specifically defined.
[0033] It should be noted that the structures, proportions, sizes, etc. illustrated in the drawings of this specification are only used to match the contents disclosed in the specification for people familiar with this technology to understand and read, and are not used to limit the conditions under which this application can be implemented. Therefore, they have no substantive technical significance. Any structural modification, change in proportional relationship or adjustment of size should still fall within the scope of the technical content disclosed in this application without affecting the effects and purposes that can be achieved by this application.
[0034] like Figures 1 to 3As shown, the vehicle movement trajectory data compression method provided by the embodiment of the present application includes the following steps: acquiring vehicle driving data, wherein the vehicle driving data includes vehicle original trajectory data; performing a first analysis process on the vehicle driving data to obtain vehicle travel information; performing a first de-impurity process on the vehicle original trajectory data to obtain first trajectory de-impurity data; performing a trajectory redundant point merging process on the first trajectory de-impurity data to obtain first trajectory compressed data; performing a similar trajectory merging process on the first trajectory compressed data to output second trajectory compressed data.
[0035] The present invention provides a technical solution for a vehicle movement trajectory data compression method, firstly, the vehicle driving data of the vehicle is obtained, and then the vehicle travel information is obtained through a first analysis process based on the vehicle driving data. Furthermore, the vehicle driving data includes the original trajectory data of the vehicle, and a first impurity removal process is performed based on the original trajectory data of the vehicle to obtain the first trajectory impurity removal data; further, the first trajectory compressed data is obtained by merging redundant points of the trajectory; the present solution creatively proposes to further compress the first trajectory compressed data into second trajectory compressed data by further adopting a similar trajectory merging calculation process; thereby completing the high compression of the vehicle trajectory data. The technical solution provided by the present application can improve the compression rate of the vehicle trajectory and reduce the pressure of data processing and transmission. In addition, the present application also relates to a vehicle movement trajectory data compression system and electronic device, which also have the above-mentioned beneficial effects.
[0036] Specifically, in an embodiment of the present invention, the vehicle driving data is associated with the VIN code, and is data obtained by collecting the vehicle speed, vehicle coordinate longitude and vehicle coordinate latitude according to the collection time; the vehicle trip information includes the vehicle VIN code, trip ID, trip start and end time, trip distance, trip start state of charge (SOC) and trip end state of charge (SOC), and trip average speed.
[0037] Specifically, in an embodiment of the present invention, the "performing a first de-impurity processing on the original trajectory data of the vehicle to obtain the first trajectory de-impurity data" specifically includes the following steps: filling / eliminating missing data: filling in the data where the GPS signal is lost under normal driving conditions, and eliminating the data if it cannot be filled; eliminating redundant data: eliminating repeated data generated under normal use conditions based on long-term stays and repeated collections; eliminating noise data: eliminating noise data generated by the system itself or by external interference during the collection process.
[0038] Specifically, in the embodiment of the present invention, the noise data type includes: a) invalid data: erroneous data generated during data collection, inf or null data; b) abnormal time: due to signal loss, the time for providing data is less than 1s;
[0039] c) Abnormal vehicle speed: the vehicle speed exceeds the maximum speed that the vehicle can travel; d) Abnormal parking: during the engine off period, the engine speed is 0, but the vehicle speed is not 0; e) Abnormal mileage: the driving distance exceeds the maximum drivable distance in a day; f) Abnormal power consumption: within the driving track, the mileage is not zero, and the power consumption is negative or 0.
[0040] Specifically, in an embodiment of the present invention, the "merging redundant trajectory points of the first trajectory data to obtain the first trajectory compressed data" specifically includes the following steps: Step A): Identify along the trajectory direction. If there are two or more trajectory information points within the first preset distance threshold s, retain the last trajectory information point and remove the remaining trajectory information points; Step B): Loop execution until the distance difference between any two adjacent trajectory information points among all trajectory information points is greater than the first preset distance threshold s, and output the first process trajectory Traj=[p1, p2,…, pn]; Step C): Approximate trajectory processing is performed on the first process trajectory Traj=[p1, p2,…, pn] according to the Douglas-Peucker trajectory compression method to obtain an approximate trajectory Traj′, and the approximate trajectory Traj′ is output as the first trajectory compressed data.
[0041] Specifically, in an embodiment of the present invention, the step A) specifically includes the following steps: A1) traversing the trajectory of the vehicle to collect data, and calculating the difference in travel distance between the current trajectory information point and the adjacent trajectory information point during the vehicle's driving process; A2) if the travel distance differences of the trajectory information points in the driving trajectory are all greater than a given first preset distance threshold s, no compression is required; A3) if there are adjacent trajectory information points whose difference is not greater than the given first preset distance threshold s, merging is performed, only the last trajectory information point is retained, and the remaining trajectory information points are removed.
[0042] Specifically, in an embodiment of the present invention, the step C) specifically includes the following steps: C1) analyzing the first process trajectory Traj = [p1, p2, ..., pn], among the points p2, ..., pn-1, the point with the largest distance from the line segment p1pn- is pindex, and the distance between pindex and the line segment p1pn- is dmax; C2) if dmax is less than a second preset distance threshold d, setting the first process trajectory Traj = [p1, p2, ..., pn] as an approximate trajectory, and outputting the first process trajectory Traj as the first trajectory compressed data; C3) if dma If x is greater than or equal to the second preset distance threshold d, then pindex is used as the segmentation point to divide the first process trajectory Traj = [p1, p2, ..., pn] into two segments, and the above operation is repeated for the two segments. According to the relationship between the distance from the trajectory information points on the two end trajectories to p1pindex- and pindexpn- and the second preset distance threshold d, it is determined whether to further segment; C4) When the distances from all trajectory information points to the corresponding trajectories are less than the second preset distance threshold d, an approximate trajectory Traj′ is obtained, and the approximate trajectory Traj′ is output as the first trajectory compression data.
[0043] Specifically, in an embodiment of the present invention, the similar trajectory merging process adopts a trajectory similarity judgment method based on point distance, which specifically includes the following steps: initialize the trajectory matrix Cost (M, N), N represents the number of trajectory points of trajectory Trajn1, M represents the number of trajectory points of trajectory Trajm2, and set the distance threshold distance; calculate the Euclidean distance between trajectory Trajn1 and trajectory Trajm2, if the distance is less than the distance threshold distance, it is 1, otherwise it is 0; when a trajectory point of trajectory Trajn1 and a trajectory point CostTrajn1,Trajm2 in trajectory Trajm2 are 1, stop the current distance calculation and start a new trajectory point matching, otherwise continue to calculate the trajectory distance; set the trajectory similarity threshold R, when the trajectory matrix Cost-1,-1minM,N>R, it means that the two trajectories are similar and can be merged, otherwise they are not similar; according to the similarity judgment result, merge the similar trajectories to obtain the second trajectory compression data.
[0044] In addition, the present application also provides a technical solution for a vehicle movement trajectory data compression system. The system is used to execute the above-mentioned vehicle movement trajectory data compression method; the system includes: a first acquisition module, the first acquisition module is used to acquire vehicle driving data; a first processing module, the first processing module is used to perform a first analysis and processing on the vehicle driving data to obtain vehicle travel information; a second processing module, the second processing module is used to perform a first de-impurity processing on the original vehicle trajectory data to obtain first trajectory de-impurity data; a third processing module, the third processing module is used to perform a trajectory redundant point merging process on the first trajectory de-impurity data to obtain first trajectory compressed data; a fourth processing module, the fourth processing module is used to perform a similar trajectory merging process on the first trajectory compressed data to output second trajectory compressed data. The technical solution for a vehicle movement trajectory data compression system provided by the present application also has the above-mentioned beneficial effects.
[0045] In addition, the present application also provides a technical solution for an electronic device. The solution includes: a computer program, the computer program is used to execute the above-mentioned vehicle movement trajectory data compression method; a memory, the memory is used to store the computer program; and a processor, the processor is used to execute the computer program. The technical solution of an electronic device provided by the present application also has the above-mentioned beneficial effects.
[0046] It should be noted that the technical problem to be solved by the present invention is achieved through the following technical solution, which mainly takes new energy vehicles as an example: a solution for compressing vehicle movement trajectory data, mainly including:
[0047] Step 1: Data acquisition. The data consists of the following two parts:
[0048] T-BOX is used to collect vehicle driving data transmitted by the vehicle terminal, including the vehicle's VIN code, collection time, speed, longitude and latitude.
[0049] The vehicle trip information obtained by aggregating and dividing the vehicle driving data by day includes vehicle VIN code, trip ID, trip start and end time, trip distance, trip start and end SOC and trip average speed.
[0050] Step 2: Trajectory data preprocessing. Data preprocessing mainly includes three steps:
[0051] Eliminate missing data: If GPS signals are lost due to high-altitude building coverage or tunnels, fill in such data with previous values, and eliminate those that cannot be filled.
[0052] Eliminate redundant data: Due to long-term parking, some vehicles have no changes in regional information at different times, and there are two or more sets of identical data at the same sampling time. These are considered redundant data and should be removed and the first record should be retained.
[0053] Eliminate noise data: The cause of noise points may be strong noise generated by the system itself or external interference during the data collection process. They do not provide meaningful information and will only reduce the quality of data and subsequent analysis. The following noise data should be eliminated.
[0054] Noise data includes:
[0055] a) Invalid data, error data generated during data collection, inf or null data;
[0056] b) Abnormal time: due to signal loss, the time to provide data is less than 1s;
[0057] c) Abnormal vehicle speed, exceeding the maximum speed the vehicle can travel;
[0058] d) Abnormal parking: during the engine shutdown, the speed is 0, but the vehicle speed is not 0;
[0059] e) The mileage is abnormal, and the driving distance exceeds the maximum drivable distance in a day;
[0060] f) The power consumption is abnormal. In the driving track, the mileage is not zero, and the power consumption is negative or 0.
[0061] Step 3: Trajectory data dimension reduction. In order to ensure accuracy, general trajectories are sampled at high frequency, which will result in a large number of redundant points, which requires a lot of computing power for trajectory calculation. Through mining and analysis of trajectory data, an improved Douglas-Peucker offline trajectory compression method based on vehicle driving distance is proposed. Since the speed of the vehicle is uneven during driving, especially at low speed, a large number of dense points will be generated. Therefore, a distance threshold can be set. When the difference in driving distance between adjacent trajectories is less than the distance threshold, the trajectories are merged and only the last trajectory information point is retained. The cycle is executed until the difference in driving distance between all adjacent trajectory points is greater than the distance threshold.
[0062] Then the trajectory points are further compressed using the Douglas-Peucker trajectory compression method.
[0063] The specific steps mainly include the following steps:
[0064] Traverse the vehicle's trajectory to collect data, calculate the difference in distance traveled between the current sampling point and the adjacent sampling point during the vehicle's driving process, and if the distance difference between adjacent sampling points in a driving trajectory is greater than the given distance difference threshold s, then compression is not required. If there are adjacent trajectories whose difference is not greater than the given threshold s, merge them and only keep the last trajectory point. This operation is repeated to obtain the new trajectory Traj = [p1, p2, ..., pn] after the initial combined vehicle driving distance compression.
[0065] Connect the starting point p1 and the ending point pn of the new trajectory to get the line segment p1pn-, and make perpendicular lines to the remaining points. Take the point pindex with the largest perpendicular line length, and the corresponding maximum distance is dmax.
[0066] Set a distance threshold d. If dmax is less than the distance threshold d, the trajectory p1pn- is taken as an approximation of the trajectory.
[0067] If dmax is not less than the distance threshold d, the trajectory is divided into two segments p1pindex- and pindexpn- with pindex as the segmentation point, and then operations 2) to 4) are repeated for these two segments.
[0068] If the distance from the trajectory point to p1pn- is less than the set distance threshold d, the final approximate trajectory Traj′ is obtained.
[0069] Step 4: Calculate trajectory similarity. Further mine effective trajectory information by judging the trajectory similarity of vehicles in different time periods. Trajectory similarity judgment methods include point-based distance, shape-based distance, and segment-based distance. Here, we mainly use point-based distance and propose an efficient dynamic time warping (C_DTW) measurement method, which is defined as follows:
[0070] C_DTW Traj1,Traj2=CostTrajn1,Trajm2+max C_DTW Trajn-11,Trajm-12,C_DTW Trajn-11,,Trajm2 C_DTW Trajn1,Trajm-12) (1)
[0071] Where Cost represents the cost matrix of two trajectories, and the matrix elements represent the similarity of two trajectory points, which is defined as follows:
[0072] CostTrajn1,Trajm2=1 if distTrajn1,Trajm2≤distance0 if distTrajn1,Trajm2>distance (2)
[0073] Where dist represents the Euclidean distance between the pn point of the trajectory Traj1 and the pm of the trajectory Traj2, and distance represents the set distance threshold, which is defined as follows:
[0074] distTrajn1,Trajm2=1nk=1nTrajn1·lat-Trajm2·lat2-Trajn1·lng-Trajm2·ln g2 (3)
[0075] The trajectory points Trajn1(lat,lng) and Trajm2(lat,lng) contain the longitude and latitude coordinates, and the Euclidean distance is calculated based on the longitude and latitude.
[0076] distTrajn1,Trajm2=2arcsin sin2 a2+cos(Lat1)×cos(Lat2)×sin2 b2×6378.137 (4)
[0077] Among them, Lat1 and Lat2 represent the coordinate angles converted into radians, a represents the difference in latitude, b represents the difference in precision, and 6378.137 is the radius of the earth r. This method mainly includes three steps:
[0078] Initialize the trajectory matrix Cost(M,N), where N represents the number of trajectory points of trajectory Trajn1, and M represents the number of trajectory points of trajectory Trajm2, and set the distance threshold distance.
[0079] Calculate the distance between trajectory Trajn1 and trajectory Trajm2. If the distance is less than the distance threshold distance, it is 1, otherwise it is 0. When a trajectory point in trajectory Trajn1 matches a trajectory point CostTrajn1,Trajm2 in trajectory Trajm2 is 1, stop the distance calculation and start a new trajectory point matching, otherwise continue to calculate the trajectory distance.
[0080] Set the trajectory similarity threshold R. When the trajectory matrix Cost-1,-1minM,N>R, it means that the two trajectories are similar and can be merged, otherwise they are not similar.
[0081] It should be noted that in the specific embodiments of the present application, in order to further describe the technical features and effects of the present invention, the present invention is further described below in conjunction with the accompanying drawings and specific implementation methods.
[0082] Table 1 is the vehicle travel data table, and Table 2 is the vehicle driving data table
[0083] Field Type Description vin String Vehicle vin code trip_id String This section of continuous driving record ID serial code trip_start_time String Tour start time trip_end_time String End time of the trip trip_start_soc Int Trip Start SOC trip_end_soc Int End of trip SOC last_accu_mile Float Cumulative mileage (meter) avg_effective_speed Float Average running speed (effective)
[0084] Table 1: Vehicle trip data table
[0085]
[0086]
[0087] Table 2: Vehicle driving data table
[0088] like Figure 1 As shown, the present application provides a flow chart of a vehicle movement trajectory data compression method, and the algorithm flow is as follows:
[0089] Step 1: Data preprocessing, mainly processing vehicle travel data. It includes two steps:
[0090] Data grouping is performed by combining the vehicle VIN code and driving record ID into the Rowkey field.
[0091] Data aggregation: a. Combine the starting SOC and ending SOC of the trip to count the vehicle's daily power (SOC) consumption and charging times; b. Combine the initial mileage and the final mileage corresponding to the trip id to count the effective mileage of the day; c. Combine the earliest start time and the latest end time corresponding to the vehicle vin on that day to calculate the cumulative driving time of the vehicle corresponding to the vin code for one day.
[0092] Step 2: Abnormal data processing. Abnormal data processing mainly processes the vehicle driving data table and the trip data table, and removes vehicles with abnormal driving through rules. It mainly includes three steps:
[0093] 1) Fill in missing values: sort each set of data in chronological order and fill in the missing values according to the previous value.
[0094] 2) Remove duplicate values, using the vehicle VIN code and time as the judgment conditions, remove duplicate redundant data, and retain the first data.
[0095] 3) Abnormal value filtering, mainly combining mileage, power (SOC) consumption, charging times, and vehicle speed to filter abnormal vehicle data. The filtering conditions are
[0096] a. Daily mileage is greater than or equal to 2400km and less than 1km;
[0097] b. The power consumption is 0 or negative;
[0098] c. The number of daily charging times is more than 3 times;
[0099] d. The vehicle speed is greater than 160km / h and less than 0km / h.
[0100] After outlier filtering, vehicles with less than two driving record IDs on the day are eliminated, and the remaining vehicles are processed later.
[0101] Step 3: Trajectory data dimensionality reduction. Since vehicle driving data is collected at a fixed period, there will be tens of thousands of driving data information collected by a vehicle in one day. Therefore, it is necessary to reduce the dimensionality of the driving data corresponding to the vehicle retained in the previous step. The main steps are as follows:
[0102] First, make a difference in the accumulated mileage in the driving data table, set the distance difference threshold s = 2km, merge the data with adjacent mileage differences less than 2km, and keep only the last one. Repeat this method multiple times, and finally ensure that the adjacent mileage differences are greater than 2km. Get the new trajectory traj = {p1, p2, ..., pn} after the initial combined vehicle travel distance compression. If the number of new trajectory points of the vehicle is less than three, the vehicle is eliminated.
[0103] Draw a line segment p1pn- with the starting point p1 and the ending point pn of the new trajectory of the vehicle after compression, find the point pindex with the largest perpendicular length from the remaining points to the line segment, and record its length dmax.
[0104] Determine the size of dmax and the set distance threshold d. If dmax is less than the distance threshold d, the trajectory p1pn- is used as the approximation of the trajectory. If dmax is not less than the distance threshold d, use pindex as the dividing point to divide the trajectory into two segments p1pindex- and pindexpn-, and then repeat 2) to 3) for the two end trajectories.
[0105] When the distance from the trajectory point to p1pn- is less than the set distance threshold d, the final approximate trajectory Traj′ is obtained
[0106] Step 4: Calculate the trajectory similarity. In order to further eliminate redundant trajectory data of vehicles, we make similarity judgments on different trajectory IDs of vehicles and remove the IDs with high duplication, thereby further simplifying the trajectory data and facilitating subsequent research. The real-time steps of the algorithm are as follows:
[0107] The two trajectories Traj1 and Traj2 are represented in matrix form [p1, p2, …, pn]. Then the C_DWT matrix and the trajectory cost matrix Cost element value are initialized to 0, and the matrix dimension size (M, N) is the length of the two compared trajectories, that is, M = len(Traj1), N = len(Traj2), each element of the Cost matrix represents the similarity value of the two trajectory points, and each element of the C_DWT matrix represents the number of similar trajectory points in the two trajectories.
[0108] Starting from the initial position 0,0 of the C_DWT matrix, recursively search for the trajectory point of Traj1 that is closest to the trajectory point of Traj2. The distance calculation method between the trajectory points of the two trajectories adopts the Euclidean distance calculation method. The driving trajectory coordinates are represented by geographical longitude and latitude (lat, long). The calculation logic adopted during distance calculation is as follows:
[0109] S = 2 * arcsin(sqrt(sin^2((lat1 - lat2) / 2) + cos(Lat1) * cos(Lat2) * sin^2((long1 - long2) / 2))) * r, where Lat1 and Lat2 are the values after angle conversion of lat1 and lat2. CostTrajn1,Trajm2 is used to record the similarity of trajectory points. This value is obtained by comparing S with the set distance threshold distance = 2000. If it is less than this threshold, then the corresponding CostTrajn1,Trajm2 = 1; otherwise, it is 0. When
[0110] CostTrajn1,Trajm2 = 1, stop the matching of the current trajectory point, start the matching of the next trajectory point, and update the corresponding DWT matrix:
[0111] DWTTrajn1,Trajm2 = max(DWTTrajn - 11,Trajm2, DWTTrajn1,Trajm - 12, DWTTr ajn - 11,Trajm - 12) + Cost(Trajn1,Trajm2).
[0112] Combined with the trajectory similarity threshold R, which is set to 0.8 here. When the trajectory matrix Costm,nminM,N ≥ R, it means that the two trajectories are similar and can be merged, and the calculation stops; otherwise, continue to traverse and compare the trajectory points. If finally Costm,nminM,N < R, the two trajectories are not similar and cannot be merged.
[0113] The beneficial effects achieved by the present invention are as follows: First, through the trajectory compression and trajectory matching methods, the vehicle driving trajectory data is compressed to the greatest extent, and the vehicle driving trajectory information is retained to the greatest extent. Second, by combining the trajectory travel data, establishing a cost matrix, and setting an early stopping strategy, the complexity of the algorithm is greatly reduced, and the execution efficiency is improved.
[0114] It should be noted that compared with the existing technologies, the key points and protection points of the present invention are as follows:
[0115] 1. The outlier processing logic of driving data. The present invention deeply mines the driving data, combines the driving data and travel data of the vehicle, and formulates strategies such as abnormal power consumption, abnormal itinerary, abnormal vehicle speed, and abnormal driving time, reducing the abnormal driving data of the vehicle.
[0116] 2. Trajectory compression method. The present invention proposes a Douglas-Peucker trajectory compression method based on travel distance. Compared with the existing technology, the redundant trajectory points are firstly removed in combination with the travel distance judgment, thereby retaining the trajectory information to the greatest extent possible.
[0117] Secondly, the number of trajectory points is compressed by combining the travel distance limit, which improves the execution efficiency of Douglas-Peucker.
[0118] 3. Trajectory similarity judgment method. Compared with the existing DWT method, the present invention establishes a cost matrix and sets an early stopping strategy, which reduces the complexity of the algorithm and improves the calculation speed.
[0119] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A vehicle movement trajectory data compression method, characterized in that: The method comprises the steps of: Acquiring vehicle driving data, wherein the vehicle driving data includes original vehicle trajectory data; Performing a first analysis and processing on the vehicle travel data to obtain vehicle travel information; Performing a first impurity removal process on the original vehicle trajectory data to obtain first trajectory impurity removed data; Performing a track redundant point merging process on the first track de-cluttered data to obtain first track compressed data; Perform similar trajectory merging processing on the first trajectory compressed data to output second trajectory compressed data.
2. The vehicle movement trajectory data compression method according to claim 1, characterized in that: The vehicle driving data is associated with the VIN code and is obtained by collecting the vehicle speed, vehicle coordinate longitude and vehicle coordinate latitude according to the collection time; The vehicle trip information includes the vehicle VIN code, trip ID, trip start and end time, trip distance, trip start state of charge (SOC) and trip end state of charge (SOC), and trip average speed.
3. The vehicle movement trajectory data compression method according to claim 2, characterized in that: The “performing a first impurity removal process on the original vehicle trajectory data to obtain first trajectory impurity removal data” specifically includes the following steps: Fill / eliminate missing data: fill in the data where GPS signal is lost during normal driving, or remove it if it cannot be filled; Eliminate redundant data: Eliminate duplicate data generated by long-term stay and repeated collection under normal use; Eliminate noise data: Eliminate noise data generated by the system itself or by external interference during the acquisition process.
4. The vehicle movement trajectory data compression method according to claim 3, characterized in that: The noise data types include: a) Invalid data: incorrect data generated during data collection, inf or null data; b) Abnormal time: due to signal loss, the time to provide data is less than 1s; c) Abnormal vehicle speed: The vehicle speed exceeds the maximum speed that the vehicle can travel; d) Abnormal parking: During the engine shutdown period, the speed is 0, but the vehicle speed is not 0; e) Abnormal mileage: The driving distance exceeds the maximum mileage that can be driven in one day; f) Abnormal power consumption: within the driving track, the mileage is not zero, and the power consumption is negative or 0.
5. The vehicle movement trajectory data compression method according to claim 4, characterized in that: The “performing track redundant point merging processing on the first track de-cluttered data to obtain first track compressed data” specifically includes the following steps: Step A): Identify along the trajectory direction. If there are two or more trajectory information points within the first preset distance threshold s, retain the last trajectory information point and remove the remaining trajectory information points; Step B): execute the loop until the distance difference between any two adjacent trajectory information points among all trajectory information points is greater than the first preset distance threshold s, and output the first process trajectory Traj=[p1, p2,…, pn]; Step C): perform approximate trajectory processing on the first process trajectory Traj=[p1, p2,…, pn] according to the Douglas-Peucker trajectory compression method to obtain an approximate trajectory Traj', and output the approximate trajectory Traj' as the first trajectory compression data.
6. The vehicle movement trajectory data compression method according to claim 5, characterized in that: The step A) specifically comprises the following steps: A1) Traverse the vehicle's trajectory to collect data and calculate the difference between the current trajectory information point and the adjacent trajectory information point during the vehicle's driving process. A2) if the distance differences of the track information points in the driving track are all greater than a given first preset distance threshold s, compression is not required; A3) If there are adjacent trajectory information points whose difference is not greater than a given first preset distance threshold s, only the last trajectory information point is retained and the remaining trajectory information points are removed.
7. The vehicle movement trajectory data compression method according to claim 5, characterized in that: The step C) specifically comprises the following steps: C1) Analyze the first process trajectory Traj = [p1, p2, ..., pn], among the points p2, ..., pn-1, the point with the largest distance to the line segment p1pn- is pindex, and the distance between pindex and the line segment p1pn- is dmax, C2) if dmax is less than a second preset distance threshold d, setting the first process trajectory Traj=[p1, p2, ..., pn] as an approximate trajectory, and outputting the first process trajectory Traj as the first trajectory compression data; C3) If dmax is greater than or equal to the second preset distance threshold d, the first process trajectory Traj = [p1, p2, ..., pn] is divided into two segments with pindex as the segmentation point, and the above operation is repeated for the two segments, and whether to further segment is determined according to the relationship between the distances from the trajectory information points on the two segments to p1pindex- and pindexpn- and the second preset distance threshold d; C4) When the distances from all trajectory information points to the corresponding trajectory are less than the second preset distance threshold d, an approximate trajectory Traj' is obtained, and the approximate trajectory Traj' is output as the first trajectory compression data.
8. The vehicle movement trajectory data compression method according to claim 7, characterized in that: The similar trajectory merging process adopts a trajectory similarity judgment method based on point distance, including the following steps: Initialize the trajectory matrix Cost(M, N), where N represents the number of trajectory points of trajectory Trajn1, and M represents the number of trajectory points of trajectory Trajm2, and set the distance threshold distance; Calculate the Euclidean distance between trajectory Trajn1 and trajectory Trajm2. If the distance is less than the distance threshold distance, it is 1, otherwise it is 0; When a certain trajectory point in trajectory Trajn1 matches a certain trajectory point in trajectory Trajm2 CostTrajn1,Trajm2 is 1, stop the current distance calculation and start matching a new trajectory point, otherwise continue to calculate the trajectory distance; Set the trajectory similarity threshold R. When the trajectory matrix Cost-1,-1minM,N>R, it means that the two trajectories are similar, otherwise they are not similar; According to the similarity judgment result, similar trajectories are merged to obtain second trajectory compression data.
9. A vehicle movement trajectory data compression system, characterized in that: The system is used to execute the vehicle movement trajectory data compression method described in any one of claims 1 to 8; The system includes: A first acquisition module, the first acquisition module is used to acquire vehicle driving data; A first processing module, the first processing module is used to perform a first analysis and processing on the vehicle driving data to obtain vehicle travel information; A second processing module, the second processing module is used to perform a first impurity removal process on the original vehicle trajectory data to obtain first trajectory impurity removal data; A third processing module, the third processing module is used to perform track redundant point merging processing on the first track de-cluttering data to obtain first track compressed data; A fourth processing module is used to perform similar trajectory merging processing on the first trajectory compression data to output second trajectory compression data.
10. An electronic device, characterized in that include: A computer program, the computer program being used to execute the vehicle movement trajectory data compression method according to any one of claims 1 to 8; A memory, the memory being used to store the computer program; A processor is used to execute the computer program.
Citation Information
Cited By
Big data rapid processing operation method based on smart city
CN120434362A
A trajectory compression storage method for a two-wheeled vehicle and related products
CN122802602A
