Vehicle track segmentation method, device and equipment and storage medium

By obtaining the trajectory point data of the current and previous time periods, determining the parking point and segmenting the vehicle trajectory, the problem of inaccurate segmentation when the vehicle trajectory spans the time period is solved, and the accuracy of trajectory segmentation is improved.

CN119360614APending Publication Date: 2025-01-24ZHEJIANG INTELLIGENT TRANSPORTATION TECHNOLOGY INNOVATION CENTER +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411469784.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-21
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

When the vehicle trajectory spans different time periods, the prior art causes inaccurate trajectory segmentation and inability to effectively process trajectory data across time periods.

Method used

By obtaining the trajectory data of the current time period and the previous time period, determine the resident point, and cut the vehicle trajectory according to the resident point. This method is repeatedly used for the trajectory point in the previous time period to ensure accurately identify the resident point during the trajectory crossing the time.

Benefits of technology

The accuracy of the trajectory segments is improved, and the trajectory is incorrectly divided by the current technologies due to only processing the current time period data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119360614A_ABST
    Figure CN119360614A_ABST
Patent Text Reader

Abstract

The invention provides a vehicle track segmentation method, device and equipment and a storage medium, and the method comprises the steps: obtaining track point data corresponding to a time period where a current moment is located, the track point data comprising track points of a vehicle collected in the time period and track points of the vehicle collected in a previous time period before the time period; determining a resident point according to the track point data corresponding to the time period in which the current moment is located; and segmenting the track of the vehicle according to the parking point. When the residence point is calculated, the track point in the previous time period is reused each time, the residence point can be accurately identified when the track crosses the time period, the problem that only the data of the current time period is judged after the time period is ended and the track segmentation crossing the time period cannot be processed in the prior art is avoided, and the accuracy of track segmentation is further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of vehicles, and in particular to a method, device, equipment and storage medium for segmenting vehicle trajectories. Background Art

[0002] With the development of vehicle networking and vehicle-road collaboration, positioning devices are generally installed on vehicles to upload the vehicle's trajectory information in real time. Through this trajectory information, vehicle safety monitoring, vehicle travel route time assessment, and high-frequency residence areas can be achieved. In this process, it is necessary to identify the vehicle's residence points during driving in order to segment the trajectory route.

[0003] For a certain manufacturer, there may be hundreds of thousands or even more vehicles in the market. In the detection of residence points, the high frequency and large-scale recording of trajectory data will quickly occupy a large amount of server storage space. To solve this problem, the existing technology processes the received data in real time during a preset time period and releases the resources after the time period ends.

[0004] However, in the case where the trajectory of some vehicles crosses both sides of the time period, the above processing method will cause a continuous trajectory to be divided into two trajectory segments, resulting in inaccurate trajectory segmentation. Summary of the invention

[0005] The vehicle trajectory segmentation method, device, equipment and storage medium provided in the present application are used to solve the problem of inaccurate trajectory segmentation caused by vehicle trajectories spanning different time periods.

[0006] In a first aspect, an embodiment of the present application provides a method for segmenting a vehicle trajectory, the method comprising:

[0007] Acquire the trajectory point data corresponding to the time period at the current moment, wherein the trajectory point data includes the trajectory points of the vehicle collected in the time period and the trajectory points of the vehicle collected in the previous time period before the time period;

[0008] Determine the dwell point according to the trajectory point data corresponding to the time period of the current moment;

[0009] The trajectory of the vehicle is segmented according to the stationary points.

[0010] Optionally, the track point includes a timestamp and longitude and latitude, and the step of determining the dwell point according to the track point data corresponding to the time period at the current moment includes:

[0011] Determine the distance between the two adjacent trajectory points according to the longitude and latitude of the two adjacent trajectory points in the trajectory point data;

[0012] Determine a time difference between the two adjacent trajectory points according to the timestamps of the two adjacent trajectory points;

[0013] Determining the speed of the two adjacent trajectory points according to the distance and the time difference;

[0014] If the speed is less than a preset speed threshold, the two adjacent trajectory points are determined to be the residence points.

[0015] Optionally, determining the distance between two adjacent trajectory points according to the longitude and latitude of the two adjacent trajectory points in the trajectory point data includes:

[0016] According to the longitude and latitude of two adjacent trajectory points in the trajectory point data, the distance between the two adjacent trajectory points is determined by the haversine formula.

[0017] Optionally, the trajectory point further includes an altitude, and if the speed is less than a preset speed threshold, determining the two adjacent trajectory points as the stationary points includes:

[0018] If the speed is less than a preset speed threshold, determining the altitude difference between the two adjacent trajectory points according to the altitudes of the two adjacent trajectory points;

[0019] determining a vertical speed based on the altitude difference and the time difference;

[0020] If the vertical speed is less than a preset vertical speed threshold, the two adjacent trajectory points are determined to be the dwelling points.

[0021] Optionally, before obtaining the trajectory point data corresponding to the time period at the current moment, the method further includes:

[0022] Acquiring original track point data in real time, wherein the original track point data includes a vehicle identification;

[0023] Grouping the original track point data according to the vehicle identification to obtain the original track point data of each vehicle;

[0024] The trajectory point data of each vehicle is determined according to the original trajectory point data of each vehicle.

[0025] Optionally, determining the trajectory point data of each vehicle according to the original trajectory point data of each vehicle includes:

[0026] For the original trajectory point data of each vehicle, one piece of original trajectory point data is selected every preset trajectory point number or every preset time period as the trajectory point data.

[0027] Optionally, the method further includes:

[0028] Determine whether the current time reaches the start time of any time period;

[0029] If the current moment reaches the start moment of any time period, a new rolling window is enabled, and the new rolling window is used to obtain the trajectory point data corresponding to the time period where the current moment is located.

[0030] In a second aspect, the present application further provides a vehicle trajectory segmentation device, the device comprising:

[0031] An acquisition module, used to acquire the track point data corresponding to the time period at the current moment, wherein the track point data includes the track points of the vehicle collected in the time period and the track points of the vehicle collected in the previous time period before the time period;

[0032] A determination module, used to determine the dwell point according to the trajectory point data corresponding to the time period of the current moment;

[0033] The trajectory segmentation module is used to segment the trajectory of the vehicle according to the stationary points.

[0034] Optionally, the determining module is specifically used to:

[0035] Determine the distance between the two adjacent trajectory points according to the longitude and latitude of the two adjacent trajectory points in the trajectory point data;

[0036] Determine a time difference between the two adjacent trajectory points according to the timestamps of the two adjacent trajectory points;

[0037] Determining the speed of the two adjacent trajectory points according to the distance and the time difference;

[0038] If the speed is less than a preset speed threshold, the two adjacent trajectory points are determined to be the residence points.

[0039] Optionally, the determining module is further used for:

[0040] According to the longitude and latitude of two adjacent trajectory points in the trajectory point data, the distance between the two adjacent trajectory points is determined by the haversine formula.

[0041] Optionally, the trajectory point also includes an altitude, and the determination module is further used to:

[0042] If the speed is less than a preset speed threshold, determining the altitude difference between the two adjacent trajectory points according to the altitudes of the two adjacent trajectory points;

[0043] determining a vertical speed based on the altitude difference and the time difference;

[0044] If the vertical speed is less than a preset vertical speed threshold, the two adjacent trajectory points are determined to be the dwelling points.

[0045] Optionally, the device further includes a preprocessing module, and the preprocessing module is specifically used for:

[0046] Acquiring original track point data in real time, wherein the original track point data includes a vehicle identification;

[0047] Grouping the original track point data according to the vehicle identification to obtain the original track point data of each vehicle;

[0048] The trajectory point data of each vehicle is determined according to the original trajectory point data of each vehicle.

[0049] Optionally, the preprocessing module is further used for:

[0050] For the original trajectory point data of each vehicle, one piece of original trajectory point data is selected every preset trajectory point number or every preset time period as the trajectory point data.

[0051] Optionally, the acquisition module is further used for:

[0052] Determine whether the current time reaches the start time of any time period;

[0053] If the current moment reaches the start moment of any time period, a new rolling window is enabled, and the new rolling window is used to obtain the trajectory point data corresponding to the time period where the current moment is located.

[0054] In a third aspect, the present application further provides an electronic device, comprising: a memory, a processor;

[0055] The memory stores computer-executable instructions;

[0056] The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method as described in any one of the first aspects.

[0057] In a fourth aspect, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method as described in any one of the first aspects.

[0058] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the method described in any one of the first aspects.

[0059] The present application provides a method, device, equipment and storage medium for vehicle trajectory segmentation, the method comprising: obtaining trajectory point data corresponding to the time period at the current moment, the trajectory point data including the trajectory points of the vehicle collected in the time period and the trajectory points of the vehicle collected in the previous time period before the time period; determining the dwelling point according to the trajectory point data corresponding to the time period at the current moment; and segmenting the vehicle trajectory according to the dwelling point. By using this method, each time the dwelling point is calculated, the trajectory points in the previous time period are reused, and the dwelling point can be accurately identified when the trajectory crosses time periods, avoiding the problem in the prior art that only the current time period data is judged after the time period ends and the trajectory segmentation across time periods cannot be processed, thereby improving the accuracy of trajectory segmentation. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0061] Figure 1 A schematic diagram of a scenario for the vehicle trajectory segmentation method provided in this application;

[0062] Figure 2 A schematic diagram of a flow chart of a first embodiment of a method for segmenting vehicle trajectories provided in the present application;

[0063] Figure 3 Schematic diagram of the time distribution of trajectory point data provided for this application Figure 1 ;

[0064] Figure 4 A schematic diagram of a flow chart of a second embodiment of a method for segmenting vehicle trajectories provided in the present application;

[0065] Figure 5 A flowchart of a third embodiment of the vehicle trajectory segmentation method provided in the present application;

[0066] Figure 6 A flowchart of a fourth embodiment of the vehicle trajectory segmentation method provided in the present application;

[0067] Figure 7 A schematic diagram of the structure of the device for segmenting vehicle trajectories provided in this application;

[0068] Figure 8 A schematic diagram of the structure of the electronic device provided in this application.

[0069] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0070] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0071] Figure 1 A schematic diagram of a scenario of the vehicle trajectory segmentation method provided in this application, such as Figure 1 As shown, a large number of vehicles upload their real-time locations during driving, and the cloud server determines the stop points of each vehicle during driving, and divides the vehicle's driving trajectory into different trajectory segments according to the stop points for subsequent analysis and research.

[0072] The cloud server needs to process a large amount of vehicle trajectory data, and storing all the data will quickly occupy a large amount of server storage space. To solve this problem, the existing technology is to process the received data in real time during a preset time period and release the resources after the time period ends.

[0073] In some scenarios, when the vehicle trajectory crosses both sides of the time period, it will lead to incorrect trajectory segment division. For example, the cloud server processes data every hour, processing the trajectory point data from 8:00 to 9:00, but the vehicle's driving trajectory from 8:50 to 9:10 is continuous. The above processing method divides the continuous trajectory into two trajectory segments: 8:50-9:00 and 9:00-9:10, resulting in incorrect trajectory division.

[0074] In view of the above problems, the inventors found in the process of research in this field that a large amount of data can be handled by a real-time processing engine, and a rolling window is set at regular intervals to obtain the trajectory point data in the current time period and the trajectory point data in the previous time period in the rolling window, and the acquisition is continuously rolled. In this way, the trajectory points obtained each time reuse a segment of data, which can solve the problem of trajectory splitting.

[0075] The execution subject of the present application may be a real-time processing engine, which may be distributed or centralized. Preferably, the distributed real-time processing engine architecture can process large-scale data streams, and the distributed real-time processing engine can also have higher fault tolerance. When a node fails, other nodes can continue to process data, thereby ensuring high availability of the system.

[0076] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0077] Figure 2 A flow chart of the first embodiment of the vehicle trajectory segmentation method provided in the present application is shown in FIG. Figure 2 As shown, the following steps are included:

[0078] S101. Acquire trajectory point data corresponding to a time period at a current moment, wherein the trajectory point data includes trajectory points of vehicles collected in the time period and trajectory points of vehicles collected in a previous time period before the time period.

[0079] In this step, multiple time periods are pre-set, and the track point data of the vehicle is obtained in real time through the window in each time period. After each time period ends, the obtained track point data is stored, and a new window is enabled to continue to obtain the track point data of the vehicle in the new time period in real time.

[0080] The time period is preset, and the length of each time period can be one hour, two hours or three hours. For example, 24 time periods are set in a day, each time period is set to 1 hour, and a new window is started every hour to obtain the vehicle's trajectory point data.

[0081] The trajectory point data corresponding to the time period of the current moment is obtained in real time through the window, wherein the obtained trajectory point data includes the trajectory points in the current time period and the trajectory points in the previous time period. For example, the current time period is 9-10 o'clock, and the trajectory point data obtained in real time include the trajectory points in the current time period of 9-10 o'clock and the trajectory points in the previous time period of 8-9 o'clock. When the current moment reaches the time period of 10-11 o'clock, the trajectory point data obtained in real time include the trajectory points in the current time period of 10-11 o'clock and the trajectory points in the previous time period of 9-10 o'clock.

[0082] Optionally, the acquired trajectory point data includes not only the trajectory points in the current time period and the trajectory points in the previous time period, but also the trajectory points in the time period before the previous time period.

[0083] S102: Determine the dwell point according to the trajectory point data corresponding to the time period at the current moment.

[0084] As for determining the time of the dwell point, the acquired trajectory point data may be stored at the end of the current time period, and the dwell point may be determined based on the stored trajectory point data. Alternatively, the dwell point may be determined in real time during the acquisition process.

[0085] According to the time and longitude and latitude of the trajectory points in the current time period and the previous time period in the trajectory point data, the speed of any two adjacent trajectory points can be determined. If the speed is less than the preset threshold, it means that the point is a suspected residence point.

[0086] In one implementation, a suspected dwelling point whose speed is less than a preset threshold is used as a dwelling point.

[0087] In another implementation, if the suspected dwelling points are continuous and the number of the continuous points is greater than a preset number, then all the suspected dwelling points in the section are taken as dwelling points.

[0088] In the process of calculating the speed of the dwell point, the trajectory points of all time periods in the trajectory point data can be calculated, or only the dwell points in the last time period can be calculated. If the velocity of the trajectory point at the end time is greater than the preset velocity threshold, it means that it is not a dwell point at the end of the time period, then the final dwell point of the broken trajectory is determined according to the trajectory point data corresponding to the next time period.

[0089] S103: Segment the trajectory of the vehicle according to the stationary points.

[0090] In this step, after obtaining the dwelling point, the vehicle's trajectory can be segmented into different trajectory segments. The continuous trajectory points between two dwelling points with a speed greater than a preset speed threshold are regarded as a trajectory segment. Each trajectory segment includes the start and end time points and the longitude and latitude of each point in the trajectory segment.

[0091] The segmented vehicle trajectory can be the overall trajectory of the vehicle, which may span multiple time periods, with the power-on and power-off of the terminal device uploading data on the vehicle side as an overall trajectory cycle. The segmented vehicle trajectory can also be the trajectory of the trajectory point data corresponding to the time period at the current moment.

[0092] This embodiment provides a method for segmenting vehicle trajectories, obtaining trajectory point data corresponding to the time period at the current moment, the trajectory point data including the trajectory points of the vehicle collected in the time period and the trajectory points of the vehicle collected in the previous time period before the time period; determining the dwelling point according to the trajectory point data corresponding to the time period at the current moment; and segmenting the vehicle trajectory according to the dwelling point. With this method, each time the dwelling point is calculated, the trajectory points in the previous time period are reused, and the dwelling point can be accurately identified even when the trajectory crosses time periods, avoiding the problem in the prior art that only the current time period data is judged after the time period ends and the trajectory that crosses time periods cannot be processed, thereby improving the accuracy of the dwelling point and trajectory segmentation.

[0093] The following is an introduction to how to use trajectory point data.

[0094] Figure 3 Schematic diagram of the time distribution of trajectory point data provided for this application Figure 1 ,like Figure 3 As shown in the figure, the time points of 8, 9, 10, and 11 are shown. As shown in Figure a, when the current time is 9-10 o'clock, the trajectory points from 8 o'clock to the current time are continuously obtained until 10 o'clock. After reaching 10 o'clock, the data from 8 to 10 o'clock are stored and the dwell point judgment is performed. As shown in Figure b, at 10-11 o'clock, a new window is started to obtain the trajectory points from 9 o'clock to the current time until 11 o'clock.

[0095] exist Figure 3 In the schematic, the data stored at 10 o'clock is the data of 8-9 and 9-10, and the data stored at 11 o'clock is the data of 9-10 and 10-11, and so on, each time reused for one hour. There are at least two ways to calculate the dwell point:

[0096] In one method, all the dwell points within two hours of each storage are calculated, and the dwell points 9-10 are calculated twice at 10 o'clock and 11 o'clock respectively, and duplicate removal is performed.

[0097] In another way, the dwell points in the first hour of the two hours stored are calculated, that is, based on the trajectory points from 8 to 10 o'clock stored at 10 o'clock, only the dwell points from 8 to 9 are calculated. If the speed at 9 o'clock is greater than the preset speed threshold, the trajectory points from 9 to 10 o'clock are used to determine the dwell points of the broken trajectory. At 11 o'clock, based on the trajectory points from 9 to 11 o'clock stored at 11 o'clock, only the dwell points from 9 to 10 o'clock are calculated. If the speed at 9 o'clock is greater than the preset speed threshold, the trajectory from the starting point in 8 to 9 to the first dwell point in 9 to 10 has been divided in the previous time period, so only the trajectory after the first dwell point from 9 to 10 o'clock is divided in 11 o'clock.

[0098] In the above two methods, if there is no dwelling point between 9 and 10 points, it means that the vehicle has been traveling at a speed greater than the preset speed threshold, and it is necessary to continue waiting for the next dwelling point to be generated. The trajectory is between the two dwelling points.

[0099] Through the above two methods, the real-time processing engine can divide the trajectory when the trajectory crosses the time period by reusing the data of a period of time, thereby avoiding the situation in the prior art that the real-time processing engine cannot identify the trajectory across the time period after the time period ends.

[0100] The following is a detailed description of how to calculate and determine the dwell point using an embodiment.

[0101] Figure 4 A flow chart of the second embodiment of the vehicle trajectory segmentation method provided in this application is shown in FIG. Figure 4 As shown, the following steps are included:

[0102] S201, determining the distance between two adjacent trajectory points according to the longitude and latitude of two adjacent trajectory points in the trajectory point data.

[0103] In one implementation, the distance between two trajectory points is determined by using the Haversine formula according to the longitude and latitude of two adjacent trajectory points. The Haversine formula is a formula for calculating the distance between two points on a sphere.

[0104] Among them, the Haversine formula is:

[0105] a=sin 2 (Δlat / 2)+cos(lat1)*cos(lat2)*sin 2 (Δlon / 2)

[0106] d = 2r * arcsin (sqrt (a))

[0107] Where Δlat is the latitude difference, Δlon is the longitude difference, lat1 is the latitude of the first point, lat2 is the latitude of the second point, r is the radius of the earth, and d is the distance between the two points in meters.

[0108] S202: Determine the time difference between two adjacent trajectory points according to the time stamps of the two adjacent trajectory points.

[0109] S203: Determine the speed of two adjacent trajectory points according to the distance and time difference.

[0110] By dividing the distance between two adjacent track points by the time difference, the speed of the two adjacent track points can be obtained. The speed of each two adjacent track points is calculated point by point.

[0111] S204: Determine a dwell point according to the speeds of two adjacent trajectory points and a preset speed threshold.

[0112] In one implementation, if the speed of two adjacent trajectory points is less than a preset speed threshold, the point is determined to be a dwell point.

[0113] In another implementation, if the speed of two adjacent trajectory points is less than a preset speed threshold, the trajectory point is regarded as a suspected dwelling point. When a preset number of suspected dwelling points appear continuously, the suspected dwelling point is determined as a dwelling point.

[0114] Considering that the vehicle is traveling on a spherical surface, the distance determined by the haversine formula increases the accuracy of speed calculation and improves the accuracy of the dwell point.

[0115] When determining the dwell point, the above embodiment only takes into account the longitude and latitude, that is, the movement on the plane. However, when the vehicle is driving, especially in mountainous areas, it may be necessary to climb the mountain road. In this case, the horizontal distance between two position points may be relatively close, which will cause the calculated speed to be less than the preset speed threshold and be misjudged as a dwell point. The lower the upload frequency at the trajectory point, the greater the probability of such misjudgment. Therefore, when judging the dwell point, it is also necessary to introduce the altitude.

[0116] Figure 5 The flowchart of the vehicle trajectory segmentation method embodiment 3 provided in this application is as follows: Figure 5 As shown, the following steps are included:

[0117] S301, acquiring trajectory point data in real time, and determining the distance between two adjacent trajectory points according to the longitude and latitude of two adjacent trajectory points in the trajectory point data.

[0118] S302: Determine the time difference between two adjacent trajectory points according to the time stamps of the two adjacent trajectory points.

[0119] S303: Determine the speed of two adjacent trajectory points according to the distance and time difference.

[0120] If the speeds of two adjacent trajectory points are greater than or equal to the preset speed threshold, step S301 is executed.

[0121] If the speeds of two adjacent trajectory points are less than the preset speed threshold, step S304 is executed.

[0122] S304: Determine the altitude difference between two adjacent trajectory points according to the altitudes of the two adjacent trajectory points.

[0123] S305: Determine the vertical speed according to the altitude difference and the time difference.

[0124] S306: If the vertical speed is less than a preset vertical speed threshold, two adjacent trajectory points are determined to be stationary points.

[0125] By calculating the vertical speed at altitude, we can avoid misjudgments caused by driving in mountainous areas and improve the accuracy of stop point judgment and trajectory division.

[0126] Before obtaining the trajectory point data, the original trajectory point data needs to be processed to improve the efficiency of the dwell point calculation and reduce data redundancy.

[0127] Figure 6 A flow chart of a fourth embodiment of the vehicle trajectory segmentation method provided in the present application is shown in FIG. Figure 6 As shown, the following steps are included:

[0128] S401. Acquire original track point data in real time, where the original track point data includes a vehicle identification.

[0129] Before formally processing the data, the data needs to be preprocessed to filter out abnormal or invalid data, such as data with incorrect format and data that exceeds the upper and lower limits of the preset file size threshold.

[0130] Parse raw track point data from raw JSON format data into a processable object form.

[0131] S402: Group the original track point data according to the vehicle identification to obtain the original track point data of each vehicle.

[0132] The original track point data are grouped according to vehicle identification (such as vehicle VIN code) so as to process each vehicle individually.

[0133] S403 . For the original trajectory point data of each vehicle, select one piece of original trajectory point data every preset trajectory point number or every target duration as trajectory point data.

[0134] Set the time window or count window for frame extraction.

[0135] In one implementation, a rolling window of a preset time (eg, 1 second) may be set to select the first record from the data per second to achieve the purpose of frame extraction.

[0136] In another implementation, every 10 data items form a window, and the first record in the window is selected as output.

[0137] The frame-extracted data is output to a distributed message queue (such as Apache Kafka) for data stream transmission. You can use the engine's built-in Kafka connector or write a custom connector to import the trajectory data stream into the subsequent computing engine in real time.

[0138] Through this embodiment, frames are extracted from the original trajectory point data to form a new low-frequency data set. This process can not only maintain the key information required for speed calculation, but also significantly reduce the amount of data and reduce the burden of subsequent processing. Grouping by vehicle identification can enable subsequent speed calculations to perform continuous dwell point identification and trajectory segmentation based on the same vehicle.

[0139] The following is a detailed introduction using an example.

[0140] 1. Upload vehicle data.

[0141] The vehicle sensor sends raw track point data to the server at a frequency of 10 Hz per second (i.e., 10 track data are sent per second). Each data includes the following information: vehicle VIN code, timestamp, longitude, latitude, and altitude.

[0142] 2. The server receives the original trajectory point data and processes it.

[0143] The server receives 10 pieces of trajectory data per second. From the 10 pieces of trajectory data received per second, one piece of data is selected (timestamp or other algorithms can be used to select) to form a new low-frequency data set (i.e., trajectory point data formed after frame extraction). This piece of data will represent the trajectory information within that second.

[0144] Format the track point data into a message format suitable for Kafka, such as JSON or Avro.

[0145] 3. Send the track point data to the Kafka message queue.

[0146] This step ensures that data can be transmitted to the downstream real-time computing engine in real time and efficiently.

[0147] 4. The real-time computing engine receives the trajectory point data and processes it.

[0148] The real-time computing engine (for example, Flink) consumes data in the Kafka message queue. Using Flink's window mechanism, the data is divided into 2-hour windows. For each 2-hour window, the trajectory point data within the current hour and the trajectory point data from the previous hour are included. ListState is used to store all trajectory point data within the window. ListState can store trajectory points and their timestamps to ensure that complete data can be accessed at the end of the window. At the end of the window, the trajectory points in ListState are traversed and the stop points are identified using the predefined stop point determination criteria. Based on the identified stop points, the trajectory data is divided into multiple trajectory segments, each of which represents the movement of the vehicle between different locations.

[0149] Exemplary:

[0150] Table 1 shows the trajectory point data obtained in window 1

[0151] Vehicle identification time latitude longitude V1 08:00:00 37.7749 -122.4194 V1 08:15:00 37.7749 -122.4194 V1 08:30:00 37.7740 -122.4189 V1 08:45:00 37.7740 -122.4190 V1 09:00:00 37.7741 -122.4185 … … … … V1 9:45:00 37.7745 -122.4189 V1 10:00:00 37.7750 -122.4190

[0152] Through the speed of every two trajectory points, it is determined that the dwelling points are (37.7740, -122.4194), (37.7740, -122.4189), (37.7740, -122.4190), and the dwelling points are continuous.

[0153] Therefore, the trajectory segment from the beginning to the end of window 1 is divided into:

[0154] Track segment 1: vhc_id(V1), [(37.7749,-122.4194), (37.7740,-122.4189)], start_time: 2024-09-10T08:15:00, end_time: 2024-09-10T08:30:00.

[0155] Trajectory segment 2: vhc_id(V1), [(37.7740,-122.4190), ..., (37.7750,-122.4190)], start_time: 2024-09-10T08:45:00, end_time: 2024-09-10T10:00:00.

[0156] The end time of track 2 is between 9 and 10 o'clock. If the last track point of track 2 is a dwell point, it means that track 2 ends. However, the speed of track 2 at 10 o'clock is greater than the preset speed, which means that track 2 does not end at 10 o'clock and is not a dwell point. Continue to obtain data for the next window.

[0157] Table 2 shows the trajectory point data obtained in window 2

[0158]

[0159]

[0160] According to the trajectory point data obtained in window 2, it is determined that the dwelling points are the trajectory points at 10:15 and 10:30 (37.7755, -122.4190).

[0161] Track segment 3: vhc_id(V1), [(37.7741,-122.4185), ..., (37.7755,-122.4190)], start_time: 2024-09-10T09:00:00, end_time: 2024-09-10T10:15:00.

[0162] The start time of track segment 3 is 9 o'clock, which is between 8:45-10:00 in track segment 2, so track segment 3 is merged with track segment 2. The start and end time of track segment 2 is 8:45-10:00, and the start and end time of track segment 3 is 9:00-10:15. Both are V1 vehicles, so the merged track segment is 8:45-10:15.

[0163] Through the trajectory segment merging of this embodiment, the trajectory spanning multiple time periods can be accurately segmented.

[0164] The above example introduces the situation that spans three or more time periods, which requires the use of trajectory segment merging to handle. If the speed between two dwell points is greater than the preset value of the trajectory segment (such as trajectory 1), it can be accurately identified. When there is a situation that spans two time periods, it is similar to the situation that spans three trajectory segments. The starting point of the trajectory segment identified in the previous window is the same as the starting point of the trajectory segment identified in the next window, and the end point of the trajectory point of the previous window (that is, the last moment of the time period) is in the trajectory of the trajectory point of the next window, then the trajectory segment of the next window is directly used to replace the trajectory segment of the previous window (it can also be represented by trajectory segment merging).

[0165] In the above three tables, the data is displayed for 15 minutes as an example. In actual applications, the data frequency can be set as needed, for example, one piece of data can be set per second.

[0166] Based on the above embodiments, the detection of the dwell point is determined by speed. When the speed is temporarily lower than the preset speed, it may be due to waiting for a traffic light, deceleration or avoidance, etc. This will divide a trajectory into dozens or even hundreds of trajectory segments, especially when driving in the city. In some cases, these trajectory segments caused by traffic lights, deceleration or avoidance need to be avoided.

[0167] This can be done in the following ways:

[0168] 1. The sum of speed and time thresholds is used to determine that a dwell point is reached only when the speed drops below a preset threshold and the duration exceeds a certain threshold. For example, a vehicle speed of less than 5 km / h and maintained for more than 5 minutes is considered a dwell point. This can eliminate misjudgments caused by short-term deceleration.

[0169] 2. Position change detection: Even if the speed is 0, when the speed drops below the preset threshold and the vehicle position changes very little over a period of time, the vehicle can be considered to be in a stationary state. A position change threshold can be set. When the position change is less than the position threshold, it means that the vehicle is stable and may be a stationary point. Otherwise, it is not a stationary point.

[0170] 3. Acceleration and attitude: Determine whether the vehicle is moving by detecting changes in acceleration. If the acceleration is close to zero and remains for a period of time, it can be more reliably determined to be stationary. The vehicle's attitude (such as changes in the vehicle's tilt angle) can also assist in the judgment.

[0171] 4. Combined with traffic signal information: Through the vehicle position and high-precision map, the traffic light status information of the road where the user is located is obtained. When the speed is less than the preset threshold within the preset distance from the traffic light, it means that the vehicle is waiting for the red light, and this point is not used as a parking point. By combining with traffic signal information, it can reduce misjudgments caused by waiting for red lights.

[0172] 5. Environmental and geographic information, combined with map data, road networks, and geographic fences, identify common residence areas (such as parking lots, rest areas), and use this information to more accurately determine residence points. For example, when the speed is less than the preset threshold and is determined to be a suspected residence point, but its location is within the residence area, the probability that it is a residence point can be increased and it can be used as a residence point. When the speed is less than the preset threshold and is determined to be a suspected residence point, but its location is not within the residence area, it is necessary to further determine whether it is a residence point based on the time threshold, location threshold, etc. The real-time processing engine side needs to store the location information of preset common residence areas.

[0173] 6. Use multi-sensor data, combined with other sensor data (such as accelerometer, gyroscope, IMU, etc.) for more comprehensive analysis. For example, by analyzing acceleration data, you can determine whether the vehicle is parked stably.

[0174] 7. Dynamically adjust the threshold: dynamically adjust the threshold of the residence judgment according to the actual traffic conditions and environment. For example, different speed thresholds can be set on urban roads and highways to adapt to different driving conditions. The speed threshold of urban roads is lower than that of highways. For example, the speed thresholds during the morning and evening peak hours of urban roads are different from the speed thresholds during non-peak hours, and the time thresholds are also different. The speed threshold is lowered during peak hours, and the time threshold is also lowered. Among them, in the case of dynamic adjustment, the real-time processing engine side needs to pre-store the corresponding speed thresholds, time thresholds, location thresholds and other data for different situations. The real-time processing engine needs to first determine the type of road the vehicle is on based on the vehicle position and high-precision map, and then determine the speed threshold, time threshold, location threshold, etc.

[0175] 8. Data smoothing and filtering: Filter the sensor data to reduce noise and interference. For example, use Kalman filtering or moving average to smooth the position and velocity data to improve the accuracy of dwell point detection.

[0176] 9. Artificial intelligence and machine learning, using machine learning technology to train the model to identify dwelling points in advance through data such as speed thresholds, time thresholds, position thresholds, and structures. Through training data, the model can learn to identify the real dwelling point and the error caused by short-term deceleration, thereby improving the accuracy of judgment.

[0177] Exemplary:

[0178] Assume that the speed threshold is set to 5km / h. When the vehicle speed is lower than 5km / h, the following conditions can be combined to determine whether it is a parking point:

[0179] The speed is less than 5 km / h and maintained for more than 30 seconds.

[0180] The position change is less than the set threshold (such as 5 meters).

[0181] The acceleration change is less than the set threshold (such as 0.1m / s 2 ).

[0182] Historical data and pattern analysis results indicate that this location is a common dwelling area.

[0183] When all the above conditions are met, it is determined to be a dwell point. The above method can significantly improve the accuracy of dwell point detection and reduce misjudgments caused by short deceleration and stopping.

[0184] Figure 7 A schematic diagram of the structure of the vehicle trajectory segmentation device provided in this application, such as Figure 7 As shown, the vehicle trajectory segmentation device 700 provided in this embodiment includes:

[0185] An acquisition module 711 is used to acquire the track point data corresponding to the time period at the current moment, wherein the track point data includes the track points of the vehicle collected in the time period and the track points of the vehicle collected in the previous time period before the time period;

[0186] A determination module 712, configured to determine a dwell point according to the trajectory point data corresponding to the time period of the current moment;

[0187] The track segmentation module 713 is used to segment the track of the vehicle according to the stationary points.

[0188] In some embodiments, the determining module 712 is specifically configured to:

[0189] Determine the distance between the two adjacent trajectory points according to the longitude and latitude of the two adjacent trajectory points in the trajectory point data;

[0190] Determine a time difference between the two adjacent trajectory points according to the timestamps of the two adjacent trajectory points;

[0191] Determining the speed of the two adjacent trajectory points according to the distance and the time difference;

[0192] If the speed is less than a preset speed threshold, the two adjacent trajectory points are determined to be the residence points.

[0193] In some embodiments, the determining module 712 is further configured to:

[0194] According to the longitude and latitude of two adjacent trajectory points in the trajectory point data, the distance between the two adjacent trajectory points is determined by the haversine formula.

[0195] In some embodiments, the trajectory point also includes an altitude, and the determination module 712 is further configured to:

[0196] If the speed is less than a preset speed threshold, determining the altitude difference between the two adjacent trajectory points according to the altitudes of the two adjacent trajectory points;

[0197] determining a vertical speed based on the altitude difference and the time difference;

[0198] If the vertical speed is less than a preset vertical speed threshold, the two adjacent trajectory points are determined to be the dwelling points.

[0199] In some embodiments, the device further includes a preprocessing module 714, and the preprocessing module 714 is specifically configured to:

[0200] Acquiring original track point data in real time, wherein the original track point data includes a vehicle identification;

[0201] Grouping the original track point data according to the vehicle identification to obtain the original track point data of each vehicle;

[0202] The trajectory point data of each vehicle is determined according to the original trajectory point data of each vehicle.

[0203] In some embodiments, the pre-processing module 714 is further configured to:

[0204] For the original trajectory point data of each vehicle, one piece of original trajectory point data is selected every preset trajectory point number or every preset time period as the trajectory point data.

[0205] In some embodiments, the acquisition module 711 is further used to:

[0206] Determine whether the current time reaches the start time of any time period;

[0207] If the current moment reaches the start moment of any time period, a new rolling window is enabled, and the new rolling window is used to obtain the trajectory point data corresponding to the time period where the current moment is located.

[0208] The device for segmenting vehicle trajectories provided in this embodiment can execute the method provided in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be described in detail here.

[0209] Figure 8 This is a schematic diagram of the structure of the electronic device provided in this application. The electronic device may be a server, such as Figure 8 As shown, the electronic device 50 provided in this embodiment includes: at least one processor 501 and a memory 502. Optionally, the device 50 also includes a communication component 503. The processor 501, the memory 502 and the communication component 503 are connected via a bus 504.

[0210] In a specific implementation process, at least one processor 501 executes the computer-executable instructions stored in the memory 502, so that at least one processor 501 executes the above method.

[0211] The specific implementation process of the processor 501 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.

[0212] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.

[0213] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-volatile Memory, NVM), such as at least one disk memory.

[0214] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.

[0215] The present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.

[0216] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above method is implemented.

[0217] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.

[0218] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.

[0219] The division of units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.

[0220] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0221] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0222] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0223] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

[0224] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention, which follow the general principles of the present invention and include common knowledge or customary technical means in the art not disclosed by the present invention, are not limited to the precise structure described above and shown in the drawings, and may be modified and changed in various ways without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.

Claims

1. A method for segmenting vehicle trajectories, characterized in that: The method comprises: Acquire the trajectory point data corresponding to the time period at the current moment, wherein the trajectory point data includes the trajectory points of the vehicle collected in the time period and the trajectory points of the vehicle collected in the previous time period before the time period; Determine the dwell point according to the trajectory point data corresponding to the time period of the current moment; The trajectory of the vehicle is segmented according to the stationary points.

2. The method according to claim 1, characterized in that The track point includes a timestamp and longitude and latitude, and the determination of the dwell point according to the track point data corresponding to the time period of the current moment includes: Determine the distance between the two adjacent trajectory points according to the longitude and latitude of the two adjacent trajectory points in the trajectory point data; Determine a time difference between the two adjacent trajectory points according to the timestamps of the two adjacent trajectory points; Determining the speed of the two adjacent trajectory points according to the distance and the time difference; If the speed is less than a preset speed threshold, the two adjacent trajectory points are determined to be the residence points.

3. The method according to claim 2, characterized in that The determining the distance between the two adjacent trajectory points according to the longitude and latitude of the two adjacent trajectory points in the trajectory point data includes: According to the longitude and latitude of two adjacent trajectory points in the trajectory point data, the distance between the two adjacent trajectory points is determined by the haversine formula.

4. The method according to claim 2 or 3, characterized in that: The trajectory point also includes an altitude, and if the speed is less than a preset speed threshold, determining the two adjacent trajectory points as the residence points includes: If the speed is less than a preset speed threshold, determining the altitude difference between the two adjacent trajectory points according to the altitudes of the two adjacent trajectory points; determining a vertical speed based on the altitude difference and the time difference; If the vertical speed is less than a preset vertical speed threshold, the two adjacent trajectory points are determined to be the dwelling points.

5. The method according to any one of claims 1 to 3, characterized in that: Before obtaining the trajectory point data corresponding to the time period at the current moment, the method further includes: Acquiring original track point data in real time, wherein the original track point data includes a vehicle identification; Grouping the original track point data according to the vehicle identification to obtain the original track point data of each vehicle; The trajectory point data of each vehicle is determined according to the original trajectory point data of each vehicle.

6. The method according to claim 5, characterized in that The step of determining the trajectory point data of each vehicle according to the original trajectory point data of each vehicle comprises: For the original trajectory point data of each vehicle, one piece of original trajectory point data is selected every preset trajectory point number or every preset time period as the trajectory point data.

7. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: Determine whether the current time reaches the start time of any time period; If the current moment reaches the start moment of any time period, a new rolling window is enabled, and the new rolling window is used to obtain the trajectory point data corresponding to the time period where the current moment is located.

8. A device for segmenting vehicle trajectories, characterized in that: The device comprises: An acquisition module, used to acquire the track point data corresponding to the time period at the current moment, wherein the track point data includes the track points of the vehicle collected in the time period and the track points of the vehicle collected in the previous time period before the time period; A determination module, used to determine the dwell point according to the trajectory point data corresponding to the time period of the current moment; The trajectory segmentation module is used to segment the trajectory of the vehicle according to the stationary points.

9. An electronic device, characterized in that: include: Memory, processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.