Trajectory reconstruction method and device, electronic equipment and storage medium
By using trajectory reconstruction methods and trajectory prediction models, the problems of rising cloud storage pressure and costs have been solved, achieving efficient data storage and analysis.
Patent Information
- Application Number
- CN202311391915.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-24
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2043-10-24
AI Technical Summary
Cloud storage devices face challenges in storing vehicle driving data, including increased storage pressure and costs, especially due to the exponential growth in driving data, which leads to increased storage demands.
By using trajectory reconstruction methods, vehicle trajectory data and compartment information are obtained. The missing latitude and longitude are predicted using trajectory prediction models. Only some key data is stored, reducing cloud storage requirements.
This effectively reduces storage pressure and costs in the cloud while maintaining the accuracy of trajectory data analysis.
Smart Images

Figure CN117633366B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of vehicle networking technology, specifically to a trajectory reconstruction method, device, electronic device, and storage medium. Background Technology
[0002] With the development of big data, many vehicle-related businesses require data collection from users, especially driving data. During operation, vehicles send driving data to the cloud at regular intervals; this data may include Global Positioning System (GPS) signals.
[0003] Currently, to analyze user driving habits, it's often necessary to analyze vehicle driving trajectories, requiring data collection granularity down to the second. However, with the increase in vehicles and the passage of time, driving data is growing exponentially. The cloud needs to store this driving data in a database, which places a significant burden on cloud storage and drives up storage costs.
[0004] Therefore, how to alleviate the storage pressure on driving data in the cloud and reduce cloud storage costs are urgent problems to be solved. Summary of the Invention
[0005] This application provides a trajectory reconstruction method, apparatus, electronic device, and storage medium to solve the above-mentioned problems.
[0006] In a first aspect, embodiments of this application provide a trajectory reconstruction method, comprising: acquiring trajectory data of a trajectory to be reconstructed and bins to which the trajectory to be reconstructed belongs, wherein the trajectory data includes the latitude and longitude of some trajectory points and multiple factors related to the latitude and longitude changes of all trajectory points, the multiple factors including at least the vehicle's dashboard mileage, remaining fuel level, and outdoor temperature, and the bins to which the trajectory to be reconstructed belongs are obtained by binning based on the trajectory length of the trajectory to be reconstructed; acquiring a trajectory prediction model corresponding to the bins to which the trajectory to be reconstructed belongs, wherein the bins and the trajectory prediction model have a predetermined mapping relationship, the trajectory prediction model is used to predict the latitude and longitude of the next trajectory point based on the trajectory data of the current trajectory point; and restoring the latitude and longitude of the missing trajectory points of the trajectory to be reconstructed based on the trajectory prediction model and the trajectory data.
[0007] Secondly, embodiments of this application provide a trajectory reconstruction device, including a data acquisition module for acquiring trajectory data of a trajectory to be reconstructed and the bin to which the trajectory to be reconstructed belongs. The trajectory data includes the latitude and longitude of some trajectory points and multiple factors related to the latitude and longitude changes of all trajectory points. These multiple factors include at least the vehicle's odometer reading, remaining fuel level, and outdoor temperature. The bin to which the trajectory to be reconstructed belongs is obtained by binning based on the trajectory length of the trajectory to be reconstructed. A model selection module is used to acquire a trajectory prediction model corresponding to the bin to which the trajectory to be reconstructed belongs. The bin and the trajectory prediction model have a predetermined mapping relationship. The trajectory prediction model is used to predict the latitude and longitude of the next trajectory point based on the trajectory data of the current trajectory point. A trajectory reconstruction module is used to restore the latitude and longitude of missing trajectory points in the trajectory to be reconstructed based on the trajectory prediction model and the trajectory data.
[0008] Thirdly, embodiments of this application provide an electronic device. The electronic device includes a memory; one or more processors; and one or more application programs, wherein the one or more application programs are stored in the memory and are used to execute the methods described above when invoked by one or more processors.
[0009] Fourthly, embodiments of this application provide a computer-readable storage medium storing program code, which is used to execute the above-described method when invoked by a processor.
[0010] The trajectory reconstruction method, apparatus, electronic device, and storage medium provided in this application acquire trajectory data of the trajectory to be reconstructed and the bin to which the trajectory belongs. The trajectory data includes the latitude and longitude of some trajectory points and multiple factors related to the latitude and longitude changes of all trajectory points. These multiple factors include the vehicle's odometer reading, remaining fuel level, and outdoor temperature. The bin to which the trajectory belongs is obtained by binning the trajectory length based on the odometer reading of the trajectory to be reconstructed. The application then acquires a trajectory prediction model corresponding to the bin to which the trajectory belongs, wherein the bin and the trajectory prediction model have a predetermined mapping relationship. Based on the trajectory prediction model and the trajectory data, the application restores the latitude and longitude of the missing trajectory points in the trajectory to be reconstructed. This restores the latitude and longitude of the missing trajectory points in the trajectory to be reconstructed after compression in a specific manner, allowing the cloud to store only the latitude and longitude of some trajectory points instead of all trajectory points, reducing the storage pressure and cost on the cloud. Attached Figure Description
[0011] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 A schematic flowchart of a trajectory reconstruction method provided in an embodiment of this application is shown;
[0013] Figure 2 A bar chart illustrating the influence of longitude variation factors provided in an exemplary embodiment of this application is shown;
[0014] Figure 3 A bar chart illustrating the influence of latitude variation factors provided in an exemplary embodiment of this application is shown;
[0015] Figure 4 This invention provides a schematic diagram of the structure of multiple sub-compartments according to an exemplary embodiment of the present application.
[0016] Figure 5 This invention provides a schematic diagram of the structure of a sliding window according to an exemplary embodiment of the present application.
[0017] Figure 6 This illustration shows a schematic diagram of latitude and longitude reconstruction of a fork in the road segment provided in an exemplary embodiment of this application;
[0018] Figure 7 This illustration shows a schematic diagram of latitude and longitude reconstruction of a fork in the road segment provided in another exemplary embodiment of this application;
[0019] Figure 8 A flowchart illustrating a trajectory reconstruction method provided in another embodiment of this application is shown;
[0020] Figure 9 This illustration shows a schematic diagram of the vehicle-side data acquisition process provided in an exemplary embodiment of this application;
[0021] Figure 10 This illustration shows a schematic diagram of trajectory point latitude and longitude compression provided in an exemplary embodiment of this application;
[0022] Figure 11 A schematic diagram of the trajectory reconstruction device provided in an embodiment of this application is shown;
[0023] Figure 12 A schematic diagram of the structure of an electronic device provided in an embodiment of this application is shown. Detailed Implementation
[0024] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of the present application, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present application without creative effort are within the scope of protection of the present application.
[0025] Please see Figure 1 , Figure 1 A schematic flowchart of a trajectory reconstruction method according to an embodiment of this application is shown. This trajectory reconstruction method can be applied to a trajectory reconstruction device, electronic device, or cloud (e.g., a cloud server). Specifically, the trajectory reconstruction method may include the following steps S110 to S130.
[0026] Step S110: Obtain the trajectory data of the trajectory to be reconstructed and the bin to which the trajectory to be reconstructed belongs.
[0027] In this embodiment, the trajectory data includes only the latitude and longitude of some trajectory points, and multiple factors corresponding to all trajectory points. These multiple factors are all related to the (GPS) latitude and longitude changes of the trajectory points. That is, the factors in this application refer to data that can affect the latitude and longitude changes of the trajectory, such as the vehicle's odometer reading, remaining fuel level, outside temperature, cabin temperature, vehicle speed, lateral acceleration, and longitudinal acceleration.
[0028] Multiple factors related to the latitude and longitude changes of a trajectory point can be pre-determined based on actual needs and the degree of influence of each factor on the trajectory point's latitude and longitude changes. For example, seven factors potentially correlated with the trajectory point's latitude and longitude changes can be initially selected from cloud-stored data: outdoor temperature, cabin temperature, vehicle speed, odometer reading, remaining fuel level, lateral acceleration, and longitudinal acceleration. Then, a decision tree algorithm can be used to calculate the weight of each of the seven factors influencing the trajectory point's latitude and longitude changes. For example, the weights of the seven factors can be calculated as follows: Figure 2 and Figure 3 As shown, the weights of the vehicle's odometer reading, remaining fuel level, outside temperature, cabin temperature, vehicle speed, lateral acceleration, and longitudinal acceleration decrease sequentially. To ensure the accuracy of trajectory prediction, at least the vehicle's odometer reading, remaining fuel level, and outside temperature must be selected as multiple factors in this embodiment. In some embodiments, to improve the accuracy of trajectory prediction, the vehicle's odometer reading, remaining fuel level, outside temperature, cabin temperature, and vehicle speed can be selected as multiple factors in this embodiment. In other embodiments, to reduce computational load and improve trajectory prediction efficiency, the vehicle's odometer reading, remaining fuel level, and outside temperature can be selected as multiple factors in this embodiment.
[0029] For details on how the trajectory data is obtained, please refer to steps S210 to S230. This application embodiment will not elaborate further here.
[0030] The bins corresponding to the trajectory to be reconstructed can be obtained by binning the trajectory based on its length. Multiple factors include the vehicle's odometer readings. When the odometer readings for all trajectories of the trajectory to be reconstructed are obtained, the difference between the start and end points of the odometer readings can be calculated as the trajectory length. Based on the trajectory length range within which the trajectory to be reconstructed falls, the bins corresponding to the trajectory are determined.
[0031] The binning and trajectory length intervals have a predetermined mapping relationship. For example, the mapping relationship between binning and trajectory length intervals can be predetermined based on the training dataset. The training dataset can be pre-built and includes multiple historical trajectories of multiple vehicles within a preset time range. The coverage of historical trajectories in the training dataset can be as wide as possible to achieve reconstruction of a larger range of latitude and longitude, while improving the accuracy of trajectory reconstruction.
[0032] For example, suppose there are ten trajectories in the training dataset. These ten trajectories can be sorted in ascending order of their length, say 1, 2, 3, 4, 5, 6, 7, 8, 9, 10. They can then be binned according to the 10%, 30%, 50%, 75%, and 90% quantiles, thus determining five bins.
[0033] For these five bins, we can first calculate the index position corresponding to each quantile. The index position corresponding to the 10th quantile is (10+1)*10% = 1.1, the index position corresponding to the 30th quantile is (10+1)*30% = 3.3, the index position corresponding to the 50th quantile is (10+1)*50% = 5.5, the index position corresponding to the 75th quantile is (10+1)*75% = 8.25, and the index position corresponding to the 90th quantile is (10+1)*90% = 9.9. The highest value is 10.
[0034] Based on the index position, the upper and lower boundaries (i.e., the trajectory length intervals) of each of these five bins can be determined: [1,1.1], [1.2,3.3], [3.4,5.5], [5.6,8.25], [8.26,10].
[0035] Based on this, the ten tracks are binned: the first bin contains tracks with a length of 1; the second bin contains tracks with lengths of 2 and 3; the third bin contains tracks with lengths of 4 and 5; the fourth bin contains tracks with lengths of 6, 7, and 8; and the fifth bin contains tracks with lengths of 9 and 10.
[0036] It should be noted that the number of boxes can be set by the developer according to actual needs, and the quantile used for boxing can also be set by the developer according to actual needs. This application embodiment does not limit this.
[0037] In this embodiment of the application, the trajectory data of the trajectory to be reconstructed may include the difference between the start and end points of the odometer readings of the trajectory to be reconstructed. When obtaining the bin corresponding to the trajectory to be reconstructed, the trajectory length of the trajectory to be reconstructed (i.e., the difference between the start and end points of the odometer readings) can be obtained first, and the bin to which the trajectory to be reconstructed should belong can be determined based on the aforementioned upper and lower boundaries.
[0038] Step S120: Obtain the trajectory prediction model corresponding to the bin to which the trajectory to be reconstructed belongs.
[0039] The bin to which the trajectory to be reconstructed belongs has a corresponding preset sliding window size and a trajectory prediction model. The sliding window size can be set by the developer according to actual needs. Figure 4 As shown, the sliding window sizes for the five bins can be set to 2, 4, 6, 8, and 10, respectively. The sliding window size refers to the number of trajectory points preceding the current trajectory point needed to predict its latitude and longitude.
[0040] The trajectory prediction model corresponding to the bin to which the trajectory to be reconstructed belongs is pre-trained based on the sliding window size corresponding to the bin. This trajectory prediction model is used to predict the latitude and longitude of each trajectory point by using multiple factors corresponding to the first N trajectory points of each trajectory point and latitude and longitude, where N is the sliding window size.
[0041] In some embodiments, the trajectory prediction model can be pre-trained as follows: The training dataset is obtained, comprising multiple trajectories, each including all trajectory points corresponding to the multiple factors and latitude / longitude; the multiple trajectories are binned according to their respective lengths to obtain multiple trajectories belonging to different bins, each bin corresponding to a preset sliding window size; the multiple factors and latitude / longitude corresponding to all trajectory points of each trajectory are serialized according to the sliding window size corresponding to the bin to which each trajectory belongs, to obtain a sequence for each trajectory; the trajectory prediction model corresponding to each bin is trained using the sequences of trajectories within each bin. For each bin, one trajectory within that bin can be identified as the target trajectory. The sequence of the target trajectory is used as the input to a Long Short-Term Memory (LSTM) network, and the latitude and longitude of all trajectory points of the target trajectory are used as the output of the LSTM network to train the LSTM network. After the LSTM network training is completed, the step of identifying one trajectory within the bin as the target trajectory is repeated until all trajectories within the bin have been used to train the LSTM network. The resulting LSTM network is then used as the trajectory prediction model for that bin.
[0042] The Long Short-Term Memory (LSTM) network is used to predict the latitude and longitude of each trajectory point by using multiple factors corresponding to the first N trajectory points of each trajectory point, as well as the latitude and longitude. Here, N is the sliding window size corresponding to the bin.
[0043] For example, suppose a target trajectory is defined in a bin with a sliding window of 2, and the target trajectory includes data from only 10 trajectory points (collected in 1-second increments). Then, for the target trajectory, the serialized data includes the latitude and longitude of each of the ten trajectory points arranged in the order of collection, along with multiple factors. This data can be input into the Long Short-Term Memory (LSTM) network as follows: [1+2, 3], [2+3, 4], [3+4, 5], [4+5, 6], [5+6, 7], [6+7, 8], [7+8, 9], [8+9, 10]. The sequence parameter [A+B, C] means using the multiple factors and latitude and longitude corresponding to the Ath and Bth trajectory points to predict the latitude and longitude of the Cth trajectory point. For example, [1+2, 3] means using the multiple factors and latitude and longitude corresponding to the first and second trajectory points to predict the latitude and longitude of the second trajectory point.
[0044] Since the latitude and longitude of all trajectory points and multiple factors of each trajectory in the training dataset are known, all elements in the sequence corresponding to each trajectory in the training dataset contain data.
[0045] Each bin corresponds to a Long Short-Term Memory (LSTM) network. The serialized data corresponding to the trajectories within each bin is sequentially input into the corresponding LTM network, thereby continuously training and refining the LTM network for that bin. After using all trajectories in the entire training dataset to train the LTM networks, five trajectory prediction models corresponding to the five bins are obtained. It's understandable that in the training dataset, multiple factors and latitude / longitude coordinates of all trajectories are known. Serializing this known data and inputting it into the LTM network allows the LTM network to train itself into the trajectory prediction model corresponding to that bin through progressive calculation of data correlation.
[0046] Step S130: Based on the sliding window size, trajectory prediction model, and trajectory data, restore the latitude and longitude of the missing trajectory points in the trajectory to be reconstructed.
[0047] In some implementations, when reconstructing ordinary road segments (i.e., non-intersection road segments) of the trajectory to be reconstructed, multiple factors corresponding to all trajectory points and the latitude and longitude of some trajectory points can be serialized according to the sliding window size corresponding to the bin to which the trajectory to be reconstructed belongs, to obtain a sequence; the sequence is then input into the trajectory prediction model to obtain the latitude and longitude of the missing trajectory points of the trajectory to be reconstructed.
[0048] Specifically, the trajectory data can be sorted according to the acquisition order of the trajectory points to obtain a sequence. The first N elements in the sequence include multiple factors corresponding to the trajectory points and latitude and longitude. Each element after the Nth element includes multiple factors corresponding to the trajectory points. N is the sliding window size corresponding to the bin to which the trajectory to be reconstructed belongs. The sequence is input into the trajectory prediction model to obtain the latitude and longitude of the missing trajectory points of the trajectory to be reconstructed.
[0049] like Figure 5 As shown, for Figure 5 In the trajectory shown, the sliding window is represented by the solid line box. By inputting the data within the solid line box (i.e., the data of trajectory point 1 and trajectory point 2) into the trajectory prediction model, the latitude and longitude of the first trajectory point after the solid line box (i.e., the latitude and longitude of trajectory point 3) are predicted. After determining the latitude and longitude of trajectory point 3, these coordinates are filled into... Figure 5 In the table shown, slide the sliding window backward to the position of the dashed box, that is, input the data of trajectory point 2 and trajectory point 3 into the trajectory prediction model to predict the latitude and longitude of trajectory point 4, and so on.
[0050] Unlike the training model with the training dataset mentioned above, where the training dataset serializes the trajectory and the resulting sequence includes the latitude and longitude of all trajectory points, when using the trajectory prediction model to predict the trajectory to be reconstructed, the latitude and longitude of subsequent trajectory points are unknown except for the latitude and longitude of the first N trajectory points. Each time the latitude and longitude of a trajectory point is obtained, it is filled into the sequence, thereby gradually obtaining all the latitude and longitude.
[0051] In some implementations, when reconstructing the fork in the trajectory to be reconstructed, N trajectory points before entering the fork can be obtained from the partial trajectory points, where N is the sliding window size corresponding to the bin to which the trajectory to be reconstructed belongs; multiple factors and latitude and longitude of the N trajectory points before entering the fork are input into the trajectory prediction model multiple times to obtain multiple candidate latitude and longitude; the distance between the multiple candidate latitude and longitude and the latitude and longitude of the trajectory points before entering the fork are calculated respectively; the candidate latitude and longitude with the shortest distance is taken as the latitude and longitude of the first missing trajectory point at the fork.
[0052] For an example, please refer to Figure 6 Assuming the sliding window size corresponding to the trajectory to be reconstructed is 2, at the fork in the road segment, the multiple factors and latitude / longitude of the two trajectory points d and e before the fork can be serialized to obtain a sequence. This sequence can be input into the trajectory prediction model multiple times. Assuming three input operations are performed, resulting in three different candidate latitude / longitudes f, g, and h, the distances between f, g, h, and point e are calculated respectively. If point h is found to be closest to point e, then point h is selected as the latitude / longitude of the first missing trajectory point entering the fork. It should be noted that inputting the same sequence into the trajectory prediction model does not always yield different candidate latitude / longitudes. After repeated experiments, the inventors found that performing three-stage prediction (i.e., obtaining three different candidate latitude / longitudes each time) provides more accurate predictions while keeping costs as low as possible.
[0053] In some implementations, after point h, it can be considered that the normal road segment has been entered. Then, the multiple factors and latitude and longitude corresponding to the two trajectory points e and h can be serialized, and subsequent reconstruction operations on the normal road segment can be performed. This will not be elaborated here.
[0054] Please see Figure 7 If the trajectory to be reconstructed passes through multiple road forks, then each time the reconstruction reaches a road fork, the following process is executed: Figure 6 And the related description of trajectory reconstruction operations at the fork in the road. For example, Figure 7 The solid points are the trajectory points reconstructed using the above method.
[0055] The trajectory reconstruction method provided in this application obtains trajectory data of the trajectory to be reconstructed and the bins to which the trajectory belongs. The trajectory data includes the latitude and longitude of some trajectory points and multiple factors related to the latitude and longitude changes of all trajectory points. These multiple factors include the vehicle's odometer reading, remaining fuel level, and outdoor temperature. The bins to which the trajectory belongs are obtained by binning the trajectory length based on the odometer reading of the trajectory to be reconstructed. The method then obtains a trajectory prediction model corresponding to the bins to which the trajectory belongs, wherein the bins and the trajectory prediction model have a predetermined mapping relationship. Based on the trajectory prediction model and the trajectory data, the method restores the latitude and longitude of the missing trajectory points in the trajectory to be reconstructed. This restores the latitude and longitude of the missing trajectory points in the trajectory to be reconstructed after compression in a specific way, allowing the cloud to store only the latitude and longitude of some trajectory points instead of all trajectory points, thus reducing the storage pressure and cost on the cloud.
[0056] Please see Figure 8 Before step S110, the trajectory reconstruction method may further include the following steps S210 to S230.
[0057] Step S210: Obtain all trajectory points of the trajectory to be reconstructed. All trajectory points have multiple factors and latitude and longitude.
[0058] like Figure 9 As shown, during vehicle operation, multiple sensors installed on the vehicle can collect real-time vehicle data at a certain frequency (e.g., once per second). For example, vehicle data may include, but is not limited to, mileage on the dashboard, remaining fuel level, outside temperature, cabin temperature, vehicle speed, and latitude and longitude. After collecting the vehicle data, it can be sent to the vehicle's Electronic Control Unit (ECU). The ECU then formats the vehicle data into a Protobuf (Protocol Buffer) format message and sends it via the Controller Area Network (CLAN) bus to the Telematics Box (TBOX). The TBOX then transmits the data to the cloud, such as a cloud server. Protobuf is a lightweight and efficient structured data storage format, commonly used for the serialization of structured data. Transmitting signals via Protobuf messages achieves higher compatibility. Alternatively, the collected data can be uploaded to the cloud server at the end of the current trip, or it can be uploaded immediately after collection; this embodiment does not limit the scope of the application.
[0059] After receiving the vehicle data corresponding to the trajectory through the IoT communication module, the server can parse the Protobuf format message sent to the server using the Protobuf parsing algorithm to extract the vehicle data. Then, it executes the following steps S220 and S230 to compress the vehicle data for the trajectory and store it in the storage program module (i.e., database) of the cloud server.
[0060] When the trajectory needs to be reconstructed, the compressed data of the trajectory is retrieved from the database of the cloud server. By executing the above steps S110 to S130, the trajectory can be approximately restored to its state before compression.
[0061] Step S220: Based on the trajectory length of the trajectory to be reconstructed, the trajectory to be reconstructed is binned to obtain the bin to which the trajectory to be reconstructed belongs. The bin to which the trajectory to be reconstructed belongs corresponds to a sliding window size.
[0062] As described above, binning based on the training dataset, determining the sliding window size for each bin, and determining the trajectory prediction model corresponding to each bin are all pre-executed operations. When the complete vehicle data for the trajectory to be reconstructed is obtained from the cloud server, the difference between the start and end points of the odometer readings on the dashboard of the trajectory to be reconstructed can be calculated as the trajectory length of the trajectory to be reconstructed. Based on the trajectory length and the pre-determined trajectory length range corresponding to each bin, it can be determined which bin the trajectory for this trip belongs to, and the corresponding sliding window size can be determined. For details on how binning is performed, please refer to step S110 above.
[0063] As mentioned earlier, the number of trajectory points preceding the current trajectory point needed to predict its latitude and longitude can be determined by the sliding window size. Therefore, it becomes clear how the trajectory should be compressed.
[0064] Step S230: Store the latitude and longitude of some trajectory points in the trajectory to be reconstructed, and multiple factors corresponding to all trajectory points, where N is the sliding window size.
[0065] In some implementations, when the complete vehicle data for the trajectory is obtained, a preset algorithm can be used to identify whether the trajectory passes through a fork in the road. The preset algorithm can be a GeoHash geocoding algorithm, and is not limited thereto.
[0066] If the trajectory does not pass through forks, then the latitude and longitude of the first N trajectory points and multiple factors corresponding to all trajectory points can be stored, where N is the sliding window size corresponding to the trajectory. It can be understood that, through... Figure 1The trajectory reconstruction method provided in the embodiments described above can reconstruct the latitude and longitude of all subsequent trajectory points one by one, given the latitude and longitude of the initial N trajectory points and the multiple factors corresponding to all trajectory points.
[0067] If the trajectory passes through a fork in the road, then N trajectory points before each fork can be obtained, where N is the size of the sliding window corresponding to that trajectory. This can be understood as... Figure 1 The trajectory reconstruction method provided in the embodiment can reconstruct the first missing trajectory point after entering a fork in the road by using multiple factors and latitude and longitude coordinates corresponding to the N trajectory points before entering the fork. Based on this, the latitude and longitude coordinates of the first N trajectory points, the latitude and longitude coordinates of the N trajectory points before each fork, and the multiple factors corresponding to all trajectory points can be stored to reconstruct the latitude and longitude coordinates of all subsequent trajectory points one by one.
[0068] It should be noted that, apart from the data already stored (e.g., the latitude and longitude of the first N trajectory points, the multiple factors corresponding to all trajectory points, and the latitude and longitude of the N trajectory points before entering the fork in the trajectory to be reconstructed), all other data in the trajectory to be reconstructed can be deleted. This allows the cloud to store only the key data used for reconstructing trajectory points, rather than all the data of the trajectory to be reconstructed, thereby reducing the storage pressure and cost on the cloud. For example, as shown... Figure 10 As shown, if the sliding window size corresponding to the trajectory to be reconstructed is 2 and there is only one fork in the road, then the cloud can store multiple factors of all trajectory points of the trajectory to be reconstructed, the latitude and longitude of the first two trajectory points of the trajectory to be reconstructed, and the latitude and longitude of the first two trajectory points of the fork in the road.
[0069] Based on steps S210 to S230, the bin to which the trajectory to be reconstructed belongs is determined according to the trajectory length, and the corresponding sliding window size and trajectory prediction model are determined. Thus, based on the sliding window size and trajectory prediction model, a method for deleting the latitude and longitude of some trajectory points from all trajectory points of the trajectory to be reconstructed can be determined, which reduces storage pressure and enables reconstruction using the corresponding trajectory prediction model when the trajectory to be reconstructed needs to be analyzed.
[0070] Please see Figure 11 , Figure 11A schematic diagram of a trajectory reconstruction device according to an embodiment of this application is shown. The trajectory reconstruction device 100 includes: a data acquisition module 110, used to acquire trajectory data of the trajectory to be reconstructed and the bin to which the trajectory to be reconstructed belongs, wherein the trajectory data includes the latitude and longitude of some trajectory points and multiple factors related to the latitude and longitude changes of all trajectory points, the multiple factors including at least the vehicle's dashboard mileage, remaining fuel, and outdoor temperature, and the bin to which the trajectory to be reconstructed belongs is obtained by binning according to the trajectory length of the trajectory to be reconstructed; a model selection module 120, used to acquire the trajectory prediction model corresponding to the bin to which the trajectory to be reconstructed belongs, wherein the bin and the trajectory prediction model have a predetermined mapping relationship, and the trajectory prediction model is used to predict the latitude and longitude of the next trajectory point based on the trajectory data of the current trajectory point; and a trajectory reconstruction module 130, used to restore the latitude and longitude of the missing trajectory points of the trajectory to be reconstructed based on the trajectory prediction model and the trajectory data.
[0071] In some implementations, the trajectory reconstruction module 130 is further configured to sort the trajectory data according to the acquisition order of the trajectory points to obtain a sequence. The first N elements in the sequence include multiple factors corresponding to the trajectory points and latitude and longitude. Each element after the Nth element includes multiple factors corresponding to the trajectory points. N is the sliding window size corresponding to the bin to which the trajectory to be reconstructed belongs. The sequence is then input into the trajectory prediction model to obtain the latitude and longitude of the missing trajectory points of the trajectory to be reconstructed.
[0072] In some embodiments, the trajectory reconstruction device 100 further includes a model building module. The model building module is used to acquire a training dataset, which includes multiple trajectories, each trajectory including all trajectory points corresponding to the multiple factors and latitude and longitude; binning the multiple trajectories according to their respective trajectory lengths to obtain multiple trajectories belonging to different bins, each bin corresponding to a preset sliding window size; serializing the multiple factors and latitude and longitude corresponding to all trajectory points of each trajectory according to the sliding window size corresponding to the bin to which each trajectory belongs, to obtain a sequence for each trajectory; and training a trajectory prediction model corresponding to each bin using the sequences of trajectories within each bin.
[0073] In some implementations, the model building module is further configured to: for each bin, determine one trajectory within that bin as the target trajectory; use the sequence of target trajectories as input to a Long Short-Term Memory (LSTM) network, and use the latitude and longitude of all trajectory points of the target trajectory as output to train the LTM network; wherein the LTM network is used to predict the latitude and longitude of each trajectory point using the multiple factors corresponding to the first N trajectory points of each trajectory point and the latitude and longitude, where N is the sliding window size corresponding to the bin; after the LTM network training is completed, the step of determining one trajectory within that bin as the target trajectory is repeated until all trajectories within that bin have been used to train the LTM network, and the resulting LTM network is used as the trajectory prediction model corresponding to that bin.
[0074] In some embodiments, the trajectory reconstruction device 100 further includes a trajectory compression module. The trajectory compression module is used to acquire the plurality of factors and latitude and longitude corresponding to all trajectory points of the trajectory to be reconstructed; to divide the trajectory to be reconstructed into bins according to the trajectory length, obtaining the bins to which the trajectory to be reconstructed belongs, each bin corresponding to a sliding window size; and to store the latitude and longitude of the first N trajectory points in the trajectory to be reconstructed, and the plurality of factors corresponding to all trajectory points, where N is the sliding window size.
[0075] In some implementations, the trajectory compression module is further configured to, if a preset algorithm identifies that the trajectory to be reconstructed passes through at least one fork in the road, obtain N trajectory points before entering the fork, where N is the size of the sliding window; and store the latitude and longitude of the N trajectory points before entering the fork in the trajectory to be reconstructed.
[0076] In some implementations, the multiple factors also include cabin temperature and vehicle speed.
[0077] Those skilled in the art will clearly understand that the trajectory reconstruction apparatus provided in the embodiments of this application can implement the trajectory reconstruction method provided in the embodiments of this application. The specific working process of the above modules can be found in the corresponding process of the trajectory reconstruction method in the embodiments of this application, and will not be described further here.
[0078] In the embodiments provided in this application, the coupling, direct coupling, or communication connection between the modules shown or discussed may be indirect coupling or communication coupling through some interfaces, devices, or modules, and may be electrical, mechanical, or other forms. The embodiments of this application do not limit this.
[0079] Furthermore, the functional modules in the embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules, and this application embodiment does not impose any restrictions on this.
[0080] Please see Figure 12 , Figure 12 A schematic diagram of the structure of an electronic device 200 provided in an embodiment of this application is shown. The electronic device includes a memory 210; one or more processors 220; and one or more application programs, which are stored in the memory 210 and are used to execute the methods as described in the above method embodiments when invoked by one or more processors 220.
[0081] The processor 220 may include one or more processing cores. The processor 220 connects to various parts within the electronic device 200 using various interfaces and lines. It performs various functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 210, and by accessing data stored in the memory 210. The processor 220 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 220 may integrate one or more of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. It is understood that the aforementioned modem may also be implemented separately as a communication chip, rather than being integrated into the processor 220.
[0082] The memory 210 may include random access memory (RAM) or read-only memory (ROM). The memory 210 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 210 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for implementing at least one function, instructions for implementing the various method embodiments described above, etc. The data storage area may store data created by the electronic device 200 during use.
[0083] This application embodiment also provides a computer-readable storage medium storing program code, which is used to execute the method described in the above method embodiments when called by a processor.
[0084] Computer-readable storage media can be electronic storage devices such as flash memory, electrically erasable programmable read-only memory (EEPROM), electrically programmable read-only memory (EPROM), hard disk, or read-only memory (ROM). In some embodiments, the computer-readable storage medium may include a non-transitory computer-readable storage medium (NTRSM). The computer-readable storage medium has storage space for program code that performs any of the method steps described above. This program code can be read from or written to one or more computer program products. The program code may be compressed in an appropriate form.
[0085] The above are merely preferred embodiments of this application and are not intended to limit this application in any way. Although this application has disclosed preferred embodiments as above, it is not intended to limit this application. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the technical solution of this application. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of this application without departing from the scope of the technical solution of this application shall still fall within the scope of the technical solution of this application.
Claims
1. A trajectory reconstruction method, characterized by, include: The trajectory data of the trajectory to be reconstructed and the bin to which the trajectory belongs are obtained. The trajectory data includes the latitude and longitude of some trajectory points and multiple factors related to the latitude and longitude changes of all trajectory points. The multiple factors include at least the vehicle's odometer reading, remaining fuel level, and outdoor temperature. The bin to which the trajectory belongs is obtained by binning the trajectory based on the length of the trajectory to be reconstructed. Obtain the trajectory prediction model corresponding to the bin to which the trajectory to be reconstructed belongs, wherein the bin and the trajectory prediction model have a predetermined mapping relationship, and the trajectory prediction model is used to predict the latitude and longitude of the next trajectory point based on the trajectory data of the current trajectory point; Based on the trajectory prediction model and trajectory data, the latitude and longitude of the missing trajectory points in the trajectory to be reconstructed are restored.
2. The method of claim 1, wherein, The step of restoring the latitude and longitude of missing trajectory points in the trajectory to be reconstructed based on the trajectory prediction model and trajectory data includes: The trajectory data is sorted according to the acquisition order of the trajectory points to obtain a sequence. The first N elements in the sequence include multiple factors corresponding to the trajectory points and latitude and longitude. Each element after the Nth element includes multiple factors corresponding to the trajectory points. N is the sliding window size corresponding to the bin to which the trajectory to be reconstructed belongs. The sequence is input into the trajectory prediction model to obtain the latitude and longitude of the missing trajectory points in the trajectory to be reconstructed.
3. The method of claim 1, wherein, Before the step of obtaining the trajectory data of the trajectory to be reconstructed and the bin to which the trajectory to be reconstructed belongs, the method further includes: Obtain a training dataset, which includes multiple trajectories, and each trajectory includes the multiple factors and latitude and longitude corresponding to all trajectory points of that trajectory; Based on the length of each trajectory, the multiple trajectories are binned to obtain multiple trajectories belonging to different bins. Each bin corresponds to a preset sliding window size. Based on the sliding window size corresponding to the bins to which each trajectory belongs, the multiple factors and latitude and longitude of all trajectory points of each trajectory are serialized to obtain the sequence of each trajectory. The trajectory prediction model for each bin is trained using the sequence of trajectories within each bin.
4. The method of claim 3, wherein, The step of training a trajectory prediction model for each bin using the sequence of trajectories within each bin includes: For each bin, one of the trajectories within that bin is designated as the target trajectory; The sequence of the target trajectory is used as the input of the Long Short-Term Memory Network (LSTM), and the latitude and longitude of all trajectory points of the target trajectory are used as the output of the LTM to train the LTM. The LTM is used to predict the latitude and longitude of each trajectory point by using the multiple factors corresponding to the first N trajectory points of each trajectory point and the latitude and longitude. N is the sliding window size corresponding to the bin. After the training of the Long Short-Term Memory Network is completed, the step of determining one of the trajectories in the bin as the target trajectory is repeated until all trajectories in the bin have been used to train the Long Short-Term Memory Network. The resulting Long Short-Term Memory Network is then used as the trajectory prediction model for the bin.
5. The method of claim 1, wherein, Before the step of obtaining the trajectory data of the trajectory to be reconstructed and the bin to which the trajectory to be reconstructed belongs, the method further includes: Obtain the multiple factors and latitude and longitude corresponding to all trajectory points of the trajectory to be reconstructed; Based on the trajectory length of the trajectory to be reconstructed, the trajectory to be reconstructed is divided into bins to obtain the bin to which the trajectory to be reconstructed belongs. The bin to which the trajectory to be reconstructed belongs corresponds to a sliding window size. Store the latitude and longitude of the first N trajectory points in the trajectory to be reconstructed, as well as the multiple factors corresponding to all trajectory points, where N is the sliding window size.
6. The method according to claim 5, characterized in that, Before the step of obtaining the trajectory data of the trajectory to be reconstructed and the bin to which the trajectory to be reconstructed belongs, the method further includes: If the preset algorithm identifies that the trajectory to be reconstructed passes through at least one fork in the road, then obtain N trajectory points before entering the fork in the road, where N is the size of the sliding window; Store the latitude and longitude of N trajectory points before entering the fork in the trajectory to be reconstructed.
7. The method according to claim 1, characterized in that, The factors also include cabin temperature and vehicle speed.
8. A trajectory reconstruction device, characterized in that, include: The data acquisition module is used to acquire the trajectory data of the trajectory to be reconstructed and the bin to which the trajectory to be reconstructed belongs. The trajectory data includes the latitude and longitude of some trajectory points and multiple factors related to the latitude and longitude changes of all trajectory points. The multiple factors include at least the vehicle's dashboard mileage, remaining fuel, and outdoor temperature. The bin to which the trajectory to be reconstructed belongs is obtained by binning the trajectory based on the length of the trajectory to be reconstructed. The model selection module is used to obtain the trajectory prediction model corresponding to the bin to which the trajectory to be reconstructed belongs. The bin and the trajectory prediction model have a predetermined mapping relationship. The trajectory prediction model is used to predict the latitude and longitude of the next trajectory point based on the trajectory data of the current trajectory point. The trajectory reconstruction module is used to restore the latitude and longitude of missing trajectory points in the trajectory to be reconstructed based on the trajectory prediction model and trajectory data.
9. An electronic device, characterized in that, include: Memory; One or more processors; One or more applications, which are stored in the memory and used to perform the method as described in any one of claims 1-7 when invoked by the one or more processors.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program code that, when invoked by a processor, executes the method as described in any one of claims 1-7.
Citation Information
Patent Citations
Acquisition method of trajectory recovery model and trajectory recovery method and device
CN114254063A
Traffic mode recognition method and system based on global and local spatial-temporal feature fusion
CN116595410A
