Trajectory data processing method, device, computer equipment, readable storage medium and program product

By filtering and validating vehicle GPS trajectory data and eliminating abnormal trajectory points, the problem of trajectory point drift caused by GPS hardware or software defects is solved, achieving efficient and accurate trajectory data processing.

CN119846673BActive Publication Date: 2025-10-28BEIJING FENGZHI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510157600.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-13
Publication Date
2025-10-28
Estimated Expiration
2045-02-13

AI Technical Summary

Technical Problem

Due to defects in GPS hardware or software, the latitude and longitude values ​​of certain points in the vehicle's GPS trajectory data are transmitted incorrectly, causing the latitude and longitude of the trajectory points displayed on the map to drift, resulting in poor accuracy.

Method used

By acquiring the preset speed threshold and the initial trajectory data of the target object, filtering algorithms and validity verification processes are used to eliminate abnormal trajectory points, ensuring the accuracy of the output trajectory data.

Benefits of technology

This improves the accuracy and quality of trajectory data, ensuring efficient and accurate judgment of subsequent trajectory data and enhancing the quality of output trajectory data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119846673B_ABST
    Figure CN119846673B_ABST
Patent Text Reader

Abstract

This application relates to a method, apparatus, computer device, computer-readable storage medium, and computer program product for processing trajectory data. The method includes: acquiring a preset speed threshold and initial trajectory data of a target object; the initial trajectory data includes multiple trajectory points of the target object arranged in chronological order, each trajectory point including a timestamp and location information; if the number of trajectory points in the initial trajectory data is greater than or equal to a preset length threshold, then filtering the initial trajectory data based on a first filtering algorithm to obtain second trajectory data; if the number of trajectory points in the second trajectory data is greater than or equal to the preset length threshold, then performing validity verification processing based on the starting trajectory point in the second trajectory data and the preset speed threshold to obtain valid trajectory data, and outputting the valid trajectory data. This method can efficiently and accurately determine the degree of anomaly of the starting trajectory point in the trajectory data of the target object, ensuring the accuracy of the trajectory data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, computer device, computer-readable storage medium, and computer program product for processing trajectory data. Background Art

[0002] With the continuous maturation and promotion of new energy vehicles, the Internet of Things, and precise positioning technologies, vehicle-to-everything (V2X) is becoming increasingly widespread, and many vehicles have already been connected to intelligent platforms. Currently, when vehicles acquire GPS trajectory data and directly use it to display routes on maps, due to defects in GPS hardware or software, the latitude and longitude values ​​of some points may be transmitted incorrectly. This results in latitude and longitude drift of the trajectory points displayed on the map, leading to poor accuracy of the route. Summary of the Invention

[0003] Therefore, it is necessary to provide a method, apparatus, computer equipment, computer-readable storage medium, and computer program product for processing trajectory data that can improve the accuracy of trajectory points, in order to address the above-mentioned technical problems.

[0004] Firstly, this application provides a method for processing trajectory data, including:

[0005] Acquire a preset speed threshold and initial trajectory data of the target object; the initial trajectory data includes multiple trajectory points of the target object arranged in chronological order, and each trajectory point includes a timestamp and location information;

[0006] If the number of trajectory points in the initial trajectory data is greater than or equal to a preset length threshold, the initial trajectory data is filtered based on the first filtering algorithm to obtain the second trajectory data.

[0007] If the number of trajectory points in the second trajectory data is greater than or equal to the preset length threshold, then a validity verification process is performed based on the starting trajectory point in the second trajectory data and the preset speed threshold to obtain valid trajectory data, and the valid trajectory data is output.

[0008] In one embodiment, the validity verification process based on the starting trajectory point in the second trajectory data and the preset speed threshold to obtain valid trajectory data includes:

[0009] Based on the starting trajectory point in the second trajectory data and the preset speed threshold, the validity of the starting point is verified to obtain the trajectory data to be output.

[0010] The output trajectory data is filtered using a second filtering algorithm to obtain valid trajectory data.

[0011] In one embodiment, the starting point validity verification process based on the starting trajectory point in the second trajectory data and the preset speed threshold to obtain the trajectory data to be output includes:

[0012] Calculate the first velocity between the starting trajectory point and the second trajectory point in the second trajectory data, where the second trajectory point is the next trajectory point after the starting trajectory point; if the first velocity is greater than the preset velocity threshold, then calculate the second velocity between the second trajectory point and the third trajectory point;

[0013] If the second speed is less than or equal to the preset speed threshold, then the starting trajectory point is determined to be an abnormal trajectory point, the starting trajectory point is removed from the second trajectory data, a third data list is obtained, and the third data list is determined to be the trajectory data to be output; the third trajectory point is the next trajectory point of the second trajectory point; or,

[0014] If the second speed is greater than the preset speed threshold, the second trajectory point is determined to be an abnormal trajectory point, and a third speed is calculated from the starting trajectory point to the third trajectory point; if the third speed is less than or equal to the speed threshold, the starting trajectory point is determined to be a normal trajectory point, and the second trajectory data is determined to be the trajectory data to be output; or,

[0015] If the third speed is greater than the preset speed threshold, the starting trajectory point is determined to be an abnormal trajectory point, the starting trajectory point in the second trajectory data is removed, a third data list is obtained, and the third data list is determined to be the trajectory data to be output.

[0016] In one embodiment, the method further includes:

[0017] If the first speed is less than or equal to the preset speed threshold, then the second trajectory data is determined to be the trajectory data to be output.

[0018] In one embodiment, the step of filtering the trajectory data to be output using a second filtering algorithm to obtain valid trajectory data includes:

[0019] Calculate the velocity between adjacent trajectory points in the trajectory data to be output, and determine the trajectory points whose velocity is less than or equal to the preset velocity threshold as valid trajectory points;

[0020] Based on each of the valid trajectory points in the trajectory data to be output, valid trajectory data is obtained.

[0021] In one embodiment, the method further includes:

[0022] If the number of trajectory points in the initial trajectory data is less than a preset length threshold, then the initial trajectory data list is output; or,

[0023] If the number of trajectory points in the second trajectory data is less than the preset length threshold, then the initial trajectory data is output.

[0024] In one embodiment, the step of filtering the initial trajectory data based on the first filtering algorithm to obtain the second trajectory data includes:

[0025] Trajectory points that do not meet the preset completeness condition in the initial trajectory data are removed to obtain the second trajectory data. The preset completeness condition is that the trajectory points include timestamps and location information.

[0026] Secondly, this application also provides a trajectory data processing apparatus, comprising:

[0027] The first acquisition module is used to acquire a preset speed threshold and the initial trajectory data of the target object; the initial trajectory data includes multiple trajectory points of the target object arranged in chronological order, and each trajectory point includes a timestamp and location information;

[0028] The first processing module is used to filter the initial trajectory data based on a first filtering algorithm to obtain second trajectory data if the number of trajectory points in the initial trajectory data is greater than or equal to a preset length threshold.

[0029] The second processing module is used to perform validity verification processing based on the starting trajectory point in the second trajectory data and the preset speed threshold if the number of trajectory points in the second trajectory data is greater than or equal to the preset length threshold, to obtain valid trajectory data, and output the valid trajectory data.

[0030] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0031] Acquire a preset speed threshold and initial trajectory data of the target object; the initial trajectory data includes multiple trajectory points of the target object arranged in chronological order, and each trajectory point includes a timestamp and location information;

[0032] If the number of trajectory points in the initial trajectory data is greater than or equal to a preset length threshold, the initial trajectory data is filtered based on the first filtering algorithm to obtain the second trajectory data.

[0033] If the number of trajectory points in the second trajectory data is greater than or equal to the preset length threshold, then a validity verification process is performed based on the starting trajectory point in the second trajectory data and the preset speed threshold to obtain valid trajectory data, and the valid trajectory data is output.

[0034] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:

[0035] Acquire a preset speed threshold and initial trajectory data of the target object; the initial trajectory data includes multiple trajectory points of the target object arranged in chronological order, and each trajectory point includes a timestamp and location information;

[0036] If the number of trajectory points in the initial trajectory data is greater than or equal to a preset length threshold, the initial trajectory data is filtered based on the first filtering algorithm to obtain the second trajectory data.

[0037] If the number of trajectory points in the second trajectory data is greater than or equal to the preset length threshold, then a validity verification process is performed based on the starting trajectory point in the second trajectory data and the preset speed threshold to obtain valid trajectory data, and the valid trajectory data is output.

[0038] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:

[0039] Acquire a preset speed threshold and initial trajectory data of the target object; the initial trajectory data includes multiple trajectory points of the target object arranged in chronological order, and each trajectory point includes a timestamp and location information;

[0040] If the number of trajectory points in the initial trajectory data is greater than or equal to a preset length threshold, the initial trajectory data is filtered based on the first filtering algorithm to obtain the second trajectory data.

[0041] If the number of trajectory points in the second trajectory data is greater than or equal to the preset length threshold, then a validity verification process is performed based on the starting trajectory point in the second trajectory data and the preset speed threshold to obtain valid trajectory data, and the valid trajectory data is output.

[0042] The aforementioned trajectory data processing method, apparatus, computer equipment, computer-readable storage medium, and computer program product include the following steps: acquiring a preset speed threshold and initial trajectory data of a target object; the initial trajectory data includes multiple trajectory points of the target object arranged in chronological order, each trajectory point including a timestamp and location information; if the number of trajectory points in the initial trajectory data is greater than or equal to a preset length threshold, then filtering the initial trajectory data based on a first filtering algorithm to obtain second trajectory data; if the number of trajectory points in the second trajectory data is greater than or equal to the preset length threshold, then performing validity verification processing based on the starting trajectory point in the second trajectory data and the preset speed threshold to obtain valid trajectory data, and outputting the valid trajectory data. By employing this method, initial filtering of multiple trajectory points of the target object arranged in chronological order can be performed using a preset speed threshold, and validity verification processing can be performed based on the starting trajectory point among the filtered trajectory points to obtain valid trajectory data of the target object. This method can efficiently and accurately determine the degree of anomaly of the starting trajectory point in the target object's trajectory data, ensuring the accuracy of subsequent trajectory data and improving the high quality of the output trajectory data. Attached Figure Description

[0043] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0044] Figure 1 This is an application environment diagram of a trajectory data processing method in one embodiment;

[0045] Figure 2 This is a flowchart illustrating a trajectory data processing method in one embodiment;

[0046] Figure 3 This is a flowchart illustrating the steps for obtaining valid trajectory data in one embodiment;

[0047] Figure 4 This is a flowchart illustrating the steps for obtaining the trajectory data to be output in one embodiment;

[0048] Figure 5 This is a flowchart illustrating the steps for obtaining valid trajectory data in one embodiment;

[0049] Figure 6 This is a flowchart illustrating a trajectory data processing method in another embodiment;

[0050] Figure 7This is a flowchart illustrating a trajectory data processing method in another embodiment;

[0051] Figure 8 This is a structural block diagram of a trajectory data processing device in one embodiment;

[0052] Figure 9 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0053] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0054] The trajectory data processing method provided in this application embodiment can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or placed on a cloud or other network server. Terminal 102 can be a vehicle-mounted terminal, and server 104 can be a gateway server. The vehicle-mounted terminal can collect GPS information and other vehicle information from the vehicle and transmit this GPS information and other vehicle information to the gateway server. The gateway server can include a database, allowing it to save the received GPS information and other vehicle information to the database. When historical trajectory data of a vehicle is needed, the gateway server can query the data stored in the database and render the queried data using a map component to obtain the vehicle's historical trajectory data. The method provided in this embodiment can process the queried data and output the vehicle's trajectory data, i.e., output the vehicle's valid trajectory data. Server 104 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.

[0055] In an exemplary embodiment, Figure 2 As shown, a method for processing trajectory data is provided, which can be applied to... Figure 1 Taking server 104 as an example, the explanation includes the following steps 202 to 206. Wherein:

[0056] Step 202: Obtain the preset speed threshold and the initial trajectory data of the target object.

[0057] The initial trajectory data includes multiple trajectory points of the target object arranged in chronological order. Each trajectory point includes a timestamp and location information. The target object can be a moving object, such as a vehicle; the chronological order can be the order in which time events occur; the multiple trajectory points can be various trajectory points formed during the movement of the target object; the timestamp and location information included in each trajectory point can be the location information of the target object at the time represented by that timestamp. This location can be coordinate data in the Earth coordinate system, or latitude and longitude data, etc. This disclosure does not limit the specific form of the location information. The preset speed threshold can be a speed threshold determined based on the actual application scenario. For example, it can be the average speed of the target object during its movement in that application scenario; or it can be the average speed of other target objects; or it can be the historical speed of the target object within a historical time period, etc.

[0058] Specifically, the server can identify the target object and query the trajectory data of the target object in the corresponding database. In other words, the trajectory data of the target object stored in the database is the initial trajectory data of the target object. The initial trajectory data contains multiple trajectory points of the target object arranged in chronological order during its movement. The server can also obtain the pre-configured speed threshold of the target object.

[0059] Step 204: If the number of trajectory points in the initial trajectory data is greater than or equal to a preset length threshold, the initial trajectory data is filtered based on the first filtering algorithm to obtain the second trajectory data.

[0060] The number of trajectory points in the initial trajectory data can be the total number of trajectory points contained in the initial trajectory data; the preset length threshold can be a pre-determined threshold used to filter whether the initial trajectory data should be filtered; the preset length threshold can be the minimum value that indicates the initial trajectory data can be filtered, and optionally, the preset length threshold can be 3. The first filtering algorithm can be an invalid data filtering algorithm, for example, it can be used to filter trajectory points with invalid timestamps and / or invalid location information.

[0061] Specifically, after obtaining the initial trajectory data corresponding to the target object, the server can determine the number of trajectory points contained in the initial trajectory data and judge the relationship between the number of trajectory points in the initial trajectory data and the preset length threshold. If the number of trajectory points in the initial trajectory data is greater than or equal to the preset length threshold, it is determined that the initial trajectory data can be filtered. The server can then filter the trajectory points contained in the initial trajectory data based on the first filtering algorithm to obtain the filtered trajectory data and determine the filtered trajectory data as the second trajectory data.

[0062] Step 206: If the number of trajectory points in the second trajectory data is greater than or equal to a preset length threshold, then perform validity verification processing based on the starting trajectory point in the second trajectory data and the preset speed threshold to obtain valid trajectory data and output the valid trajectory data.

[0063] The starting trajectory point in the second trajectory data can be the trajectory point that is first in the second trajectory data; the preset speed threshold can be the speed threshold corresponding to the target object determined based on the actual scene.

[0064] Specifically, after filtering the first trajectory data, the server obtains the second trajectory data. The server can determine the number of trajectory points contained in the second trajectory data and judge the relationship between the number of trajectory points in the second trajectory data and a preset length threshold. If the number of trajectory points in the second trajectory data is greater than or equal to the preset length threshold, the server can obtain the starting trajectory point in the second trajectory data and perform validity verification processing on each trajectory point in the second trajectory data based on the starting trajectory point and the preset speed threshold to obtain the valid trajectory data corresponding to the second trajectory data. In this way, the server can output the valid trajectory data.

[0065] Optionally, the server can output the valid trajectory data corresponding to the target object to the map component, perform visualization processing on the valid trajectory data through the map component, obtain the visualization data corresponding to the movement process of the target object, and display the visualization data, etc.

[0066] In the above trajectory data processing method, a preset speed threshold and initial trajectory data of the target object are obtained. The initial trajectory data includes multiple trajectory points of the target object arranged in chronological order, each trajectory point including a timestamp and location information. If the number of trajectory points in the initial trajectory data is greater than or equal to a preset length threshold, the initial trajectory data is filtered based on a first filtering algorithm to obtain second trajectory data. If the number of trajectory points in the second trajectory data is greater than or equal to the preset length threshold, validity verification is performed based on the starting trajectory point in the second trajectory data and the preset speed threshold to obtain valid trajectory data, which is then output. By adopting this method, the multiple trajectory points of the target object arranged in chronological order can be initially filtered using a preset speed threshold, and validity verification is performed based on the starting trajectory point in each filtered trajectory point to obtain valid trajectory data of the target object. This method can efficiently and accurately determine the degree of abnormality of the starting trajectory point in the target object's trajectory data, ensuring the accuracy of subsequent trajectory data and improving the high quality of the output trajectory data.

[0067] In one embodiment, such as Figure 3As shown, the specific processing steps of "performing validity verification based on the starting trajectory point and preset speed threshold in the second trajectory data to obtain valid trajectory data" may include:

[0068] Step 302: Perform a validity verification process on the starting trajectory point in the second trajectory data and a preset speed threshold to obtain the trajectory data to be output.

[0069] Among them, the preset speed threshold can be the speed threshold corresponding to the target object determined based on the actual application scenario; the starting point validity verification process can be based on the starting trajectory point in the second trajectory data and the next trajectory point of the starting trajectory point to perform validity verification process, which is used to detect anomalies in the next trajectory point of the starting trajectory point.

[0070] Specifically, after obtaining the second trajectory data, the server can acquire the starting trajectory point and the next trajectory point of the starting trajectory point, i.e., the second trajectory point. Based on the inspiration trajectory point and the second trajectory point, the server can calculate the speed of the target object moving from the starting trajectory point to the second trajectory point, and perform a starting point validity verification process based on the speed and a preset speed threshold to obtain the trajectory data to be output corresponding to the second trajectory data.

[0071] Step 304: The output trajectory data is filtered using the second filtering algorithm to obtain valid trajectory data.

[0072] The second filtering algorithm can be a general filtering algorithm, such as an algorithm that filters based on the velocity of each trajectory point to date.

[0073] Specifically, the server can filter multiple trajectory points contained in the output trajectory data based on the second filtering algorithm. That is, the server can detect the validity of multiple trajectory points contained in the output trajectory data based on the second filtering algorithm, obtain multiple trajectory points that pass the validity detection, and obtain the valid trajectory data corresponding to the target object based on these multiple valid trajectory points.

[0074] In this embodiment, by using a preset speed threshold filtering algorithm to perform multiple validity checks on the trajectory data of the target object, the validity and accuracy of the obtained trajectory data can be guaranteed, thereby improving the quality of the output trajectory data of the target object.

[0075] In one embodiment, such as Figure 4 As shown, the specific processing steps of "verifying the validity of the starting point based on the starting trajectory point in the second trajectory data and a preset speed threshold to obtain the trajectory data to be output" may include:

[0076] Step 402: Calculate the first velocity between the starting trajectory point and the second trajectory point in the second trajectory data. The second trajectory point is the next trajectory point after the starting trajectory point. If the first velocity is greater than a preset velocity threshold, then calculate the second velocity between the second trajectory point and the third trajectory point.

[0077] The multiple trajectory points included in the second trajectory data can be arranged in chronological order. The second trajectory point can be the next trajectory point after the starting trajectory point in the second trajectory data, that is, the trajectory point located at the second position in the second trajectory data. Correspondingly, the third trajectory point can be the next trajectory point after the second trajectory point, that is, the next trajectory point after the second trajectory point in the second trajectory data.

[0078] Specifically, after determining the starting trajectory point corresponding to the second trajectory data and the next trajectory point (the second trajectory point), the server can calculate the time taken to move from the starting trajectory point to the second trajectory point based on the timestamp in the starting trajectory point and the timestamp in the second trajectory point. Based on the position data in the starting trajectory point and the position data in the second trajectory point, the server can calculate the distance moved from the starting trajectory point to the second trajectory point. Based on this, the server can calculate the first speed based on the distance and time taken to move from the starting trajectory point to the second trajectory point.

[0079] The server can compare a first speed with a preset speed threshold. If the first speed is greater than the preset speed threshold, the server can determine the next trajectory point, i.e., the third trajectory point, for that second trajectory point. In this way, the server can calculate the time taken to move from the second trajectory point to the third trajectory point based on the timestamps in the second and third trajectory points, and calculate the distance traveled from the second trajectory point to the third trajectory point based on the position data in the second and third trajectory points. Based on this, the server can calculate the second speed based on the distance and time taken to move from the second trajectory point to the third trajectory point.

[0080] Optionally, if the server determines that the first speed is less than or equal to a preset speed threshold, the server can determine the current second trajectory data as the trajectory data to be output, that is, determine the second trajectory data as the trajectory data to be output for the target object.

[0081] Step 404: If the second speed is less than or equal to a preset speed threshold, the starting trajectory point is determined to be an abnormal trajectory point. The starting trajectory point is removed from the second trajectory data to obtain a third data list, which is then determined as the trajectory data to be output. The third trajectory point is the next trajectory point after the second trajectory point.

[0082] Specifically, the server can compare the second velocity during the movement from the second trajectory point to the third trajectory point with a preset velocity threshold. If the calculated second velocity is less than or equal to the preset velocity threshold, the server can determine that the starting trajectory point is an abnormal trajectory point. The server can then remove the starting trajectory point from the second trajectory data, obtaining the second trajectory data after removing the starting trajectory point, and determine this second trajectory data as the third data list. The server can then determine this third data list as the trajectory data to be output.

[0083] Step 406: If the second speed is greater than a preset speed threshold, the second trajectory point is determined to be an abnormal trajectory point, and a third speed is calculated from the starting trajectory point to the third trajectory point. If the third speed is less than or equal to the speed threshold, the starting trajectory point is determined to be a normal trajectory point, and the second trajectory data is determined to be the trajectory data to be output.

[0084] Specifically, if the calculated second speed is greater than a preset speed threshold, the server can determine that the next trajectory point of the starting trajectory point is an abnormal trajectory point, that is, determine that the second trajectory point is an abnormal trajectory point. In this way, the server can calculate the time taken to move from the starting trajectory point to the third trajectory point based on the timestamps in the starting and third trajectory points, and calculate the distance traveled from the starting trajectory point to the third trajectory point based on the position data in the starting and third trajectory points. Based on this, the server can calculate the third speed based on the distance and time taken to move from the starting trajectory point to the third trajectory point; for example, the server can determine the third speed as the ratio between the distance and the time taken.

[0085] The server can compare the third speed with a preset speed threshold. If the calculated third speed is less than or equal to the preset speed threshold, the server can determine that the starting trajectory point is a normal trajectory point and determine that the second trajectory data is the trajectory data to be output.

[0086] Step 408: If the third speed is greater than the preset speed threshold, the starting trajectory point is determined to be an abnormal trajectory point. The starting trajectory point in the second trajectory data is removed to obtain the third data list, and the third data list is determined to be the trajectory data to be output.

[0087] Specifically, if the third speed exceeds a preset speed threshold, the server can determine that the starting trajectory point is an abnormal trajectory point. The server can then remove the abnormal trajectory point from the second trajectory data and define the second trajectory data after removing the starting trajectory point as the third data list, and define this third data list as the trajectory data to be output. In other words, the server can determine the second trajectory data after removing the starting trajectory point as the trajectory data to be output if the third speed exceeds the preset speed threshold.

[0088] It should be noted that this disclosure does not limit the execution order and scope of the above steps 402, 404, 406 and 408. Those skilled in the art can execute one or more of the above steps 402, 404, 406 and 408 based on the needs of the actual application scenario.

[0089] In this embodiment, by calculating the velocity between the starting trajectory point and the second trajectory point, the velocity between the second trajectory point and the third trajectory point, and the velocity between the starting trajectory point and the third trajectory point, anomaly detection of trajectory data can be achieved starting from the starting trajectory point, ensuring the accuracy of subsequent trajectory data output and improving judgment efficiency.

[0090] In one embodiment, the method for processing the trajectory data further includes:

[0091] If the first speed is less than or equal to a preset speed threshold, then the second trajectory data is determined to be the trajectory data to be output.

[0092] Specifically, the server can calculate a first speed based on the time taken and distance traveled from the starting trajectory point to the second trajectory point, and compare the first speed with a preset speed threshold. If the server determines that the first speed is less than or equal to the preset speed threshold, the server can determine the second trajectory data as the trajectory data to be output.

[0093] In this embodiment, the efficiency of anomaly detection at the starting trajectory point can be improved by comparing the calculated speed with a preset speed threshold.

[0094] In an exemplary embodiment, Figure 5 As shown, the specific processing steps of the step "filtering the output trajectory data using the second filtering algorithm to obtain valid trajectory data" include:

[0095] Step 502: Calculate the velocity between adjacent trajectory points in the trajectory data to be output, and determine the trajectory points whose velocity is less than or equal to a preset velocity threshold as valid trajectory points.

[0096] The output trajectory data contains multiple trajectory points, which are arranged in chronological order according to the timestamps on the trajectory points. Adjacent trajectory points can be defined by their order of arrangement within the output trajectory data.

[0097] Specifically, the server can calculate the speed between each trajectory point according to the order of the trajectory points in the output trajectory data. Based on the relationship between the speeds of each trajectory point and a preset speed threshold, multiple valid trajectory points are obtained by filtering among the trajectory points. For example, the server can compare the speed of a trajectory point with a preset speed threshold and determine the trajectory points with speeds less than the preset speed threshold as valid trajectory points.

[0098] In one example, for each trajectory point in the output trajectory data, the process of calculating the velocity of the trajectory point may include: the server can determine the previous trajectory point in the output trajectory data, and using the timestamp in the trajectory point and the timestamp in the previous trajectory point, calculate the time taken to move from the previous trajectory point to the current trajectory point, and based on the position data in the previous trajectory point and the current trajectory point, calculate the distance traveled from the previous trajectory point to the current trajectory point. Based on this, the server can calculate the velocity of the trajectory point based on the distance and the time taken.

[0099] Step 504: Based on each valid trajectory point in the trajectory data to be output, obtain the valid trajectory data.

[0100] Specifically, the server can filter out multiple valid trajectory points from the trajectory points contained in the trajectory points to be output, and determine each of these valid trajectory points as valid trajectory data.

[0101] In this embodiment, the validity of each trajectory point is detected by a second filtering algorithm, thereby improving the efficiency and accuracy of detecting valid trajectory points.

[0102] In one embodiment, the method for processing the trajectory data further includes:

[0103] If the number of trajectory points in the initial trajectory data is less than a preset length threshold, then output the initial trajectory data list. Alternatively, if the number of trajectory points in the second trajectory data is less than a preset length threshold, then output the initial trajectory data.

[0104] Specifically, the server can compare the number of trajectory points in the initial trajectory data with a preset length threshold. If the server determines that the number of trajectory points in the initial trajectory data is less than the preset length threshold, the server can output the initial trajectory data to the map component and perform visualization processing on the initial trajectory data through the map component to obtain the visualization data corresponding to the movement process of the target object, and display the visualization data, etc.

[0105] In this embodiment, the processing efficiency of initial trajectory data is improved.

[0106] In one embodiment, the specific processing steps of "filtering the initial trajectory data based on the first filtering algorithm to obtain the second trajectory data" include:

[0107] The second trajectory data is obtained by removing trajectory points in the initial trajectory data that do not meet the preset completeness conditions.

[0108] The preset condition for completeness is that the trajectory points include timestamps and location information.

[0109] Specifically, for each trajectory point among the multiple trajectory points contained in the initial trajectory data, the server can determine whether the trajectory point meets the preset completeness condition. The server can determine that trajectory points whose data does not contain a timestamp or location information are not trajectory points that do not meet the preset completeness condition. In this way, the server can remove all trajectory points in the initial trajectory data that do not meet the preset completeness condition, obtain the removed initial trajectory data, and determine the removed initial trajectory data as the second trajectory data.

[0110] In this embodiment, the accuracy of the trajectory data of the target object is ensured by detecting the integrity of the data contained in each trajectory point.

[0111] The following describes a specific embodiment, such as... Figure 6 As shown, the specific implementation process of the above trajectory data processing method can include:

[0112] Step 1: Input data list, speed threshold v, which is the initial trajectory data and speed threshold of the target object obtained by the server.

[0113] Step 2: Determine if the data list is less than 3. If it is not less than 3, proceed to Step 3; otherwise, proceed to Step 6.

[0114] Step 3: Filter invalid trajectory points. The server can filter invalid trajectory points in the initial trajectory data to obtain a filtered data list.

[0115] Step 4: Determine if the length of the filtered data list is less than 3; if it is not less than 3, proceed to step 5; if it is less than 3, proceed to step 6.

[0116] Step 5: Process the starting trajectory point and filter the remaining trajectory points.

[0117] Step 6: Return the data list, that is, output the data list.

[0118] In conjunction with a specific embodiment, such as Figure 7 As shown, the specific implementation process of the above trajectory data processing method can include:

[0119] The gateway server collects vehicle GPS information and other data through the in-vehicle terminal, and saves the message data to the database. When it is necessary to view historical trajectory routes, the backend program queries the database and passes the data to the map component for trajectory rendering. Each data point has latitude, longitude, and a timestamp. The Havesing formula is used to calculate the shortest distance between two points on the Earth's surface. By obtaining the timestamps of two adjacent trajectory points, the velocity value between the previous trajectory point and the next trajectory point can be calculated. The unit of the velocity value can be meters per second.

[0120] Step S1: Input data list and speed threshold. Specifically, the input parameters may include the speed threshold and a list of vehicle trajectory data points sorted in ascending order of time. The information of a single vehicle trajectory point must include latitude, longitude and timestamp. The unit of the speed threshold is meters per second.

[0121] Step S2: If the input data list is empty or its length is less than 3, return the original data list.

[0122] Step S3: Filter invalid points. Invalid points can be data points that are missing latitude and longitude or timestamps. If the number of data points after filtering is still less than 3, return the original list of data points.

[0123] Step S4: Process the starting trajectory point: Verify the validity of the starting trajectory point using the starting trajectory point filtering method, and process the starting trajectory point.

[0124] Step S4.1: Input the data list and the speed threshold v.

[0125] Step S4.2: Calculate the velocity v12 from the starting trajectory point to the second trajectory point. If the velocity v12 is greater than the velocity threshold v, continue to step S4.3; otherwise, directly return the input data list.

[0126] Step S4.3: Calculate the velocity v23 from the second trajectory point to the third trajectory point. If the velocity v23 is less than or equal to the velocity threshold v, the starting trajectory point is determined to be an abnormal point. The input data list is removed from the starting trajectory point and the process is returned. If the velocity v23 is greater than the velocity threshold v, the second trajectory point is suspected to be abnormal. Step S4.4 is then executed.

[0127] Step S4.4: If the second trajectory point is abnormal, the velocity v13 can be calculated based on the starting trajectory point and the third trajectory point. If v13 is less than or equal to the velocity threshold v, the starting trajectory point is marked as a normal point and the input data list is returned. If v13 is greater than the velocity threshold v, the starting trajectory point is determined to be invalid, the input data list is removed from the starting trajectory point and then returned.

[0128] Step S5: Process the data list returned in step S4 using the second filtering algorithm. Specifically, calculate the velocity between adjacent points one by one. If the calculated velocity exceeds a velocity threshold, mark the point as an outlier and skip it. Otherwise, add the point to the list of valid points and update the previous point to the current point.

[0129] Step S6: Return the filtered list of valid trajectory points. The server can then input this filtered list of valid trajectory points into the map component, which processes the list to obtain visualized trajectory data of the target object.

[0130] The trajectory data processing method provided in this embodiment can determine the validity of all initial trajectory data by using the first few data points in the initial trajectory data, ensuring the accuracy of subsequent data and improving the accuracy of the output trajectory data of the target object.

[0131] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0132] Based on the same inventive concept, this application also provides a trajectory data processing apparatus for implementing the trajectory data processing method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more trajectory data processing apparatus embodiments provided below can be found in the limitations of the trajectory data processing method described above, and will not be repeated here.

[0133] In an exemplary embodiment, Figure 8 As shown, a trajectory data processing device 800 is provided, comprising:

[0134] The first acquisition module 802 is used to acquire a preset speed threshold and the initial trajectory data of the target object; the initial trajectory data includes multiple trajectory points of the target object arranged in chronological order, and each trajectory point includes a timestamp and location information;

[0135] The first processing module 804 is used to filter the initial trajectory data based on a first filtering algorithm to obtain second trajectory data if the number of trajectory points in the initial trajectory data is greater than or equal to a preset length threshold.

[0136] The second processing module 806 is used to perform validity verification processing based on the starting trajectory point in the second trajectory data and the preset speed threshold if the number of trajectory points in the second trajectory data is greater than or equal to the preset length threshold, to obtain valid trajectory data, and output the valid trajectory data.

[0137] In one embodiment, the second processing module is specifically used for:

[0138] Based on the starting trajectory point in the second trajectory data and the preset speed threshold, the validity of the starting point is verified to obtain the trajectory data to be output.

[0139] The output trajectory data is filtered using a second filtering algorithm to obtain valid trajectory data.

[0140] In one embodiment, the second processing module is further specifically used for:

[0141] Calculate the first velocity between the starting trajectory point and the second trajectory point in the second trajectory data, where the second trajectory point is the next trajectory point after the starting trajectory point; if the first velocity is greater than the preset velocity threshold, then calculate the second velocity between the second trajectory point and the third trajectory point;

[0142] If the second speed is less than or equal to the preset speed threshold, then the starting trajectory point is determined to be an abnormal trajectory point, the starting trajectory point is removed from the second trajectory data, a third data list is obtained, and the third data list is determined to be the trajectory data to be output; the third trajectory point is the next trajectory point of the second trajectory point; or,

[0143] If the second speed is greater than the preset speed threshold, the second trajectory point is determined to be an abnormal trajectory point, and a third speed is calculated from the starting trajectory point to the third trajectory point; if the third speed is less than or equal to the speed threshold, the starting trajectory point is determined to be a normal trajectory point, and the second trajectory data is determined to be the trajectory data to be output; or,

[0144] If the third speed is greater than the preset speed threshold, the starting trajectory point is determined to be an abnormal trajectory point, the starting trajectory point in the second trajectory data is removed, a third data list is obtained, and the third data list is determined to be the trajectory data to be output.

[0145] In one embodiment, the trajectory data processing apparatus further includes:

[0146] The first determining module is used to determine the second trajectory data as the trajectory data to be output if the first speed is less than or equal to the preset speed threshold.

[0147] In one embodiment, the second processing module is further specifically used for:

[0148] Calculate the velocity between adjacent trajectory points in the trajectory data to be output, and determine the trajectory points whose velocity is less than or equal to the preset velocity threshold as valid trajectory points;

[0149] Based on each of the valid trajectory points in the trajectory data to be output, valid trajectory data is obtained.

[0150] In one embodiment, the trajectory data processing apparatus further includes:

[0151] The first output module is configured to output a list of initial trajectory data if the number of trajectory points in the initial trajectory data is less than a preset length threshold; or,

[0152] The second output module is used to output the initial trajectory data if the number of trajectory points in the second trajectory data is less than the preset length threshold.

[0153] In one embodiment, the first processing module is specifically used for:

[0154] Trajectory points that do not meet the preset completeness condition in the initial trajectory data are removed to obtain the second trajectory data. The preset completeness condition is that the trajectory points include timestamps and location information.

[0155] Each module in the aforementioned trajectory data processing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0156] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 9As shown, the computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When executed by the processor, the computer program implements a method for processing trajectory data. The display unit is used to form a visually visible image and can be a display screen, projection device, or virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0157] Those skilled in the art will understand that Figure 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0158] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0159] Acquire a preset speed threshold and initial trajectory data of the target object; the initial trajectory data includes multiple trajectory points of the target object arranged in chronological order, and each trajectory point includes a timestamp and location information;

[0160] If the number of trajectory points in the initial trajectory data is greater than or equal to a preset length threshold, the initial trajectory data is filtered based on the first filtering algorithm to obtain the second trajectory data.

[0161] If the number of trajectory points in the second trajectory data is greater than or equal to the preset length threshold, then a validity verification process is performed based on the starting trajectory point in the second trajectory data and the preset speed threshold to obtain valid trajectory data, and the valid trajectory data is output.

[0162] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0163] Acquire a preset speed threshold and initial trajectory data of the target object; the initial trajectory data includes multiple trajectory points of the target object arranged in chronological order, and each trajectory point includes a timestamp and location information;

[0164] If the number of trajectory points in the initial trajectory data is greater than or equal to a preset length threshold, the initial trajectory data is filtered based on the first filtering algorithm to obtain the second trajectory data.

[0165] If the number of trajectory points in the second trajectory data is greater than or equal to the preset length threshold, then a validity verification process is performed based on the starting trajectory point in the second trajectory data and the preset speed threshold to obtain valid trajectory data, and the valid trajectory data is output.

[0166] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:

[0167] Acquire a preset speed threshold and initial trajectory data of the target object; the initial trajectory data includes multiple trajectory points of the target object arranged in chronological order, and each trajectory point includes a timestamp and location information;

[0168] If the number of trajectory points in the initial trajectory data is greater than or equal to a preset length threshold, the initial trajectory data is filtered based on the first filtering algorithm to obtain the second trajectory data.

[0169] If the number of trajectory points in the second trajectory data is greater than or equal to the preset length threshold, then a validity verification process is performed based on the starting trajectory point in the second trajectory data and the preset speed threshold to obtain valid trajectory data, and the valid trajectory data is output.

[0170] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0171] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0172] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0173] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for processing trajectory data, characterized in that, The method includes: Acquire a preset speed threshold and initial trajectory data of the target object; the initial trajectory data includes multiple trajectory points of the target object arranged in chronological order, and each trajectory point includes a timestamp and location information; If the number of trajectory points in the initial trajectory data is greater than or equal to a preset length threshold, the initial trajectory data is filtered based on the first filtering algorithm to obtain the second trajectory data. If the number of trajectory points in the second trajectory data is greater than or equal to the preset length threshold, then a validity verification process is performed based on the starting trajectory point in the second trajectory data and the preset speed threshold to obtain valid trajectory data, and the valid trajectory data is output. The validity verification process based on the starting trajectory point in the second trajectory data and the preset speed threshold is used to obtain valid trajectory data, including: Based on the starting trajectory point in the second trajectory data and the preset speed threshold, the validity of the starting point is verified to obtain the trajectory data to be output. The trajectory data to be output is filtered by a second filtering algorithm to obtain valid trajectory data; The starting point validity verification process based on the starting trajectory point in the second trajectory data and the preset speed threshold is used to obtain the trajectory data to be output, including: Calculate the first velocity between the starting trajectory point and the second trajectory point in the second trajectory data, where the second trajectory point is the next trajectory point after the starting trajectory point; if the first velocity is greater than the preset velocity threshold, then calculate the second velocity between the second trajectory point and the third trajectory point; If the second speed is less than or equal to the preset speed threshold, then the starting trajectory point is determined to be an abnormal trajectory point, the starting trajectory point is removed from the second trajectory data, a third data list is obtained, and the third data list is determined to be the trajectory data to be output; the third trajectory point is the next trajectory point of the second trajectory point; or, If the second speed is greater than the preset speed threshold, the second trajectory point is determined to be an abnormal trajectory point, and a third speed is calculated from the starting trajectory point to the third trajectory point; if the third speed is less than or equal to the speed threshold, the starting trajectory point is determined to be a normal trajectory point, and the second trajectory data is determined to be the trajectory data to be output; or, If the third speed is greater than the preset speed threshold, the starting trajectory point is determined to be an abnormal trajectory point, the starting trajectory point in the second trajectory data is removed, a third data list is obtained, and the third data list is determined to be the trajectory data to be output.

2. The method according to claim 1, characterized in that, The method further includes: If the first speed is less than or equal to the preset speed threshold, then the second trajectory data is determined to be the trajectory data to be output.

3. The method according to claim 1, characterized in that, The step of filtering the trajectory data to be output using the second filtering algorithm to obtain valid trajectory data includes: Calculate the velocity between adjacent trajectory points in the trajectory data to be output, and determine the trajectory points whose velocity is less than or equal to the preset velocity threshold as valid trajectory points; Based on each of the valid trajectory points in the trajectory data to be output, valid trajectory data is obtained.

4. The method according to claim 1, characterized in that, The method further includes: If the number of trajectory points in the initial trajectory data is less than a preset length threshold, then output the initial trajectory data list; or, If the number of trajectory points in the second trajectory data is less than the preset length threshold, then the initial trajectory data is output.

5. The method according to claim 1, characterized in that, The step of filtering the initial trajectory data based on the first filtering algorithm to obtain the second trajectory data includes: Trajectory points that do not meet the preset completeness condition in the initial trajectory data are removed to obtain the second trajectory data. The preset completeness condition is that the trajectory points include timestamps and location information.

6. A trajectory data processing device, characterized in that, The device includes: The first acquisition module is used to acquire a preset speed threshold and the initial trajectory data of the target object; the initial trajectory data includes multiple trajectory points of the target object arranged in chronological order, and each trajectory point includes a timestamp and location information; The first processing module is used to filter the initial trajectory data based on a first filtering algorithm to obtain second trajectory data if the number of trajectory points in the initial trajectory data is greater than or equal to a preset length threshold. The second processing module is used to perform validity verification processing based on the starting trajectory point in the second trajectory data and the preset speed threshold if the number of trajectory points in the second trajectory data is greater than or equal to the preset length threshold, to obtain valid trajectory data, and output the valid trajectory data. The second processing module is specifically used to perform a starting point validity verification process based on the starting trajectory point in the second trajectory data and the preset speed threshold to obtain the trajectory data to be output; and to perform a filtering process on the trajectory data to be output using a second filtering algorithm to obtain valid trajectory data. The second processing module is also specifically used for: Calculate the first velocity between the starting trajectory point and the second trajectory point in the second trajectory data, where the second trajectory point is the next trajectory point after the starting trajectory point; if the first velocity is greater than the preset velocity threshold, then calculate the second velocity between the second trajectory point and the third trajectory point; If the second speed is less than or equal to the preset speed threshold, then the starting trajectory point is determined to be an abnormal trajectory point, the starting trajectory point is removed from the second trajectory data, a third data list is obtained, and the third data list is determined to be the trajectory data to be output; the third trajectory point is the next trajectory point of the second trajectory point; or, If the second speed is greater than the preset speed threshold, the second trajectory point is determined to be an abnormal trajectory point, and a third speed is calculated from the starting trajectory point to the third trajectory point; if the third speed is less than or equal to the speed threshold, the starting trajectory point is determined to be a normal trajectory point, and the second trajectory data is determined to be the trajectory data to be output; or, If the third speed is greater than the preset speed threshold, the starting trajectory point is determined to be an abnormal trajectory point, the starting trajectory point in the second trajectory data is removed, a third data list is obtained, and the third data list is determined to be the trajectory data to be output.

7. The apparatus according to claim 6, characterized in that, The device further includes: The first determining module is used to determine the second trajectory data as the trajectory data to be output if the first speed is less than or equal to the preset speed threshold.

8. The apparatus according to claim 6, characterized in that, The second processing module is also specifically used for: Calculate the velocity between adjacent trajectory points in the trajectory data to be output, and determine the trajectory points whose velocity is less than or equal to the preset velocity threshold as valid trajectory points; Based on each of the valid trajectory points in the trajectory data to be output, valid trajectory data is obtained.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • GPS trajectory correction method based on speed calculation strategy

    CN111538050A

  • Data processing method and device, electronic equipment and storage medium

    CN111856521A