Trajectory data processing method and device, equipment, storage medium and product
By acquiring location difference data of trajectory points and thinning the positioning points, compressed trajectory data is generated, which solves the storage and transmission bottleneck problem caused by the large amount of trajectory data, and achieves effective reduction of data volume and optimization of storage space.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2021-12-06
- Publication Date
- 2026-04-28
AI Technical Summary
Geographic information application systems contain large amounts of trajectory data, which occupy a lot of space, leading to transmission bottlenecks and storage waste. In particular, the data volume increases significantly during long-term navigation, affecting user experience and data upload success rate.
By acquiring the position data of at least two trajectory points in the trajectory, determining their position difference data, generating compressed trajectory data based on the position data of the starting trajectory point and the position difference data, replacing the original position data with the Douglas Pucker algorithm and position difference data, and combining positioning point thinning processing, the number of data items is reduced.
It effectively reduces the amount of trajectory data, decreases storage space usage, improves data transmission efficiency, reduces the risk of upload failure, and optimizes user experience.
Smart Images

Figure CN116226301B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a trajectory data processing method, apparatus, device, storage medium, and product. Background Technology
[0002] A significant characteristic of geographic information application systems is the large volume and heterogeneity of data. Therefore, data transmission over the network has become a bottleneck affecting the performance of geographic information applications.
[0003] In related technologies, trajectory files are constructed by recording location data at a preset frequency, with one data point recorded per line. The location records include various location attribute data of the positioning points, such as longitude, latitude, and timestamps.
[0004] In related technologies, trajectory data files have a large data volume and occupy a lot of space. Summary of the Invention
[0005] This application provides a trajectory data processing method, apparatus, device, storage medium, and product that can effectively reduce the amount of trajectory data and reduce the space occupied by trajectory data.
[0006] According to one aspect of the embodiments of this application, a trajectory data processing method is provided, the method comprising:
[0007] Acquire the position data of at least two trajectory points in the target trajectory, wherein the at least two trajectory points include the starting trajectory point;
[0008] Based on the location data, determine the positional difference data between each pair of the at least two trajectory points;
[0009] Based on the position data of the starting trajectory point and the position difference data, compressed trajectory data corresponding to the target trajectory is obtained.
[0010] According to one aspect of the embodiments of this application, a trajectory data processing apparatus is provided, the apparatus comprising:
[0011] A location data acquisition module is used to acquire the location data of at least two trajectory points in the target trajectory, wherein the at least two trajectory points include the starting trajectory point;
[0012] The difference data determination module is used to determine the position difference data between each pair of the at least two trajectory points based on the position data.
[0013] The compressed trajectory determination module is used to obtain compressed trajectory data corresponding to the target trajectory based on the position data of the starting trajectory point and the position difference data.
[0014] According to one aspect of the embodiments of this application, a computer device is provided, the computer device including a processor and a memory, the memory storing at least one instruction, at least one program, code set or instruction set, the at least one instruction, the at least one program, the code set or instruction set being loaded and executed by the processor to implement the above-described trajectory data processing method.
[0015] According to one aspect of the embodiments of this application, a computer-readable storage medium is provided, wherein at least one instruction, at least one program, code set, or instruction set is stored in the storage medium, and the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the above-described trajectory data processing method.
[0016] According to one aspect of the embodiments of this application, a computer program product is provided, the computer program product including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, causing the computer device to perform to implement the above-described trajectory data processing method.
[0017] The technical solution provided in this application can bring the following beneficial effects:
[0018] By acquiring the position data of at least two trajectory points in the trajectory and determining the position difference data between each pair of at least two trajectory points, compressed trajectory data corresponding to the target trajectory can be obtained based on the position data of the first starting trajectory point and the aforementioned position difference data. Replacing the original position data with the position difference data can effectively shorten the length of stored data, effectively reduce the amount of trajectory data, and reduce the space occupied by trajectory data. Attached Figure Description
[0019] 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.
[0020] Figure 1 This is a schematic diagram of an application runtime environment provided in one embodiment of this application;
[0021] Figure 2 This is a flowchart of a trajectory data processing method provided in one embodiment of this application. Figure 1 ;
[0022] Figure 3 An example diagram of a trajectory file is shown;
[0023] Figure 4 This is a flowchart of a trajectory data processing method provided in one embodiment of this application. Figure 2 ;
[0024] Figure 5 This is a flowchart of a trajectory data processing method provided in one embodiment of this application. Figure 3 ;
[0025] Figure 6 An example diagram illustrating the loss of the first row of data is shown;
[0026] Figure 7 An exemplary diagram illustrates a process for storing the first row of data;
[0027] Figure 8 An exemplary schematic diagram of an asynchronous trajectory file thinning process is shown;
[0028] Figure 9(a) illustrates a schematic diagram of the trajectory before the positioning point thinning process;
[0029] Figure 9(b) illustrates a schematic diagram of the trajectory in a positioning point thinning process;
[0030] Figure 9(c) illustrates a schematic diagram of a trajectory after the positioning point thinning process;
[0031] Figure 10(a) illustrates a schematic diagram of a cycling navigation planning page;
[0032] Figure 10(b) illustrates a schematic diagram of a walking navigation planning page;
[0033] Figure 10(c) illustrates a schematic diagram of a driving navigation planning page;
[0034] Figure 11 An example diagram shows a portion of the trajectory displayed on a map display page in zoomed-out mode;
[0035] Figure 12(a) illustrates an example of a driving navigation page. Figure 1 ;
[0036] Figure 12(b) illustrates an example of a driving navigation page. Figure 2 ;
[0037] Figure 13(a) illustrates an example of a public transportation navigation page. Figure 1 ;
[0038] Figure 13(b) illustrates an example of a navigation page for hybrid travel modes. Figure 2 ;
[0039] Figure 14 An example diagram illustrating the effect of trajectory data compression is shown below;
[0040] Figure 15(a) illustrates an example of a static trajectory display page in a map application;
[0041] Figure 15(b) illustrates an example of a dynamic trajectory display page in a map application;
[0042] Figure 16 An exemplary diagram of a trajectory file upload path is shown;
[0043] Figure 17 This is a block diagram of a trajectory data processing apparatus provided in one embodiment of this application;
[0044] Figure 18 This is a structural block diagram of a computer device provided in one embodiment of this application. Detailed Implementation
[0045] The technical solutions provided in this application can be applied to the fields of mapping and transportation. A brief description is given below to facilitate understanding by those skilled in the art.
[0046] Intelligent Traffic Systems (ITS), also known as Intelligent Transportation Systems, effectively integrate advanced technologies (information technology, computer technology, data communication technology, sensor technology, electronic control technology, automatic control theory, operations research, artificial intelligence, etc.) into transportation, service control, and vehicle manufacturing. This strengthens the connection between vehicles, roads, and users, thereby forming a comprehensive transportation system that ensures safety, improves efficiency, enhances the environment, and conserves energy.
[0047] Intelligent Vehicle Infrastructure Cooperative Systems (IVICS) are a development direction of Intelligent Transportation Systems (ITS). IVICS utilizes advanced wireless communication and next-generation Internet technologies to implement comprehensive, real-time dynamic information exchange between vehicles and infrastructure. Based on the collection and fusion of dynamic traffic information across all times and spaces, it conducts active vehicle safety control and cooperative road management, fully realizing effective collaboration between people, vehicles, and roads. This ensures traffic safety, improves traffic efficiency, and ultimately forms a safe, efficient, and environmentally friendly road traffic system.
[0048] In some application scenarios, the location information corresponding to each point in the trajectory is generated every second. The longer the relevant map application is used, the larger the space occupied by the trajectory file. As shown in Table 1 below, it shows the average trajectory file size record table under different navigation distances.
[0049] Table 1
[0050] Navigation distance (km) Track file size (kb) 20 272.45 50 704.86 100 1829.59
[0051] In medium- to long-distance navigation, users' trajectory files are on average over 1MB in size, resulting in significant storage waste. Uploading these trajectory files consumes a large amount of user data. Furthermore, the larger the uploaded data volume, the greater the likelihood of upload failure, posing a risk of data loss and hindering cloud-based backend computation and recommendations based on user trajectory data.
[0052] The trajectory data processing method provided in this application embodiment can be applied to the above-mentioned intelligent transportation system or intelligent vehicle-road cooperative system to achieve compressed storage of trajectory data.
[0053] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0054] Please refer to Figure 1 This diagram illustrates an application runtime environment provided in one embodiment of this application. The application runtime environment may include: terminal 10 and server 20.
[0055] Terminal 10 includes, but is not limited to, electronic devices such as mobile phones, computers, smart voice interaction devices, smart home appliances, in-vehicle terminals, game consoles, e-book readers, multimedia playback devices, and wearable devices. Application clients can be installed on terminal 10.
[0056] In this embodiment, the application described above can be any application capable of providing map services. Typically, the application is a map application. Of course, other types of applications besides map applications can also provide map services. For example, social applications, interactive entertainment applications, browser applications, shopping applications, content sharing applications, game applications, virtual reality (VR) applications, augmented reality (AR) applications, etc., are not limited in this embodiment. In addition, the videos pushed by different applications will also be different, and the corresponding functions will also be different. These can be pre-configured according to actual needs, and are not limited in this embodiment. Optionally, the terminal 10 runs a client of the above-mentioned application.
[0057] Server 20 provides background services to clients of applications in terminal 10. For example, server 20 can be a background server for the aforementioned applications. Server 20 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Optionally, server 20 can simultaneously provide background services to applications in multiple terminals 10.
[0058] Optionally, terminal 10 and server 20 can communicate with each other via network 30. Terminal 10 and server 20 can be directly or indirectly connected via wired or wireless communication, which is not limited herein.
[0059] Before introducing the method embodiments provided in this application, a brief introduction will be given on the application scenarios, related terms or nouns that may be involved in the method embodiments of this application, so as to facilitate the understanding of those skilled in the art.
[0060] Trajectory data: A collection of information such as the user's current location recorded at a preset frequency.
[0061] Track file: A data storage product that saves track data.
[0062] Please refer to Figure 2 It illustrates the flow of a trajectory data processing method provided in one embodiment of this application. Figure 1 This method can be applied to computer devices, which refer to electronic devices with data computing and processing capabilities. For example, the entity executing each step can be... Figure 1 Terminal 10 in the application runtime environment shown. The method may include the following steps (210-230).
[0063] Step 210: Obtain the position data of at least two trajectory points in the target trajectory.
[0064] Acquire trajectory data, which includes the position data of at least two trajectory points in the target trajectory.
[0065] The aforementioned at least two trajectory points include the starting trajectory point. The starting trajectory point is the first trajectory positioning point among the trajectory positioning points. The aforementioned at least two trajectory points are all or part of the trajectory positioning points, where a trajectory positioning point refers to the positioning point in the target trajectory for which positioning is requested.
[0066] Location data includes at least one location attribute, which includes, but is not limited to, longitude, latitude, velocity, altitude, and timestamp of the trajectory positioning point. Optionally, the aforementioned at least one location attribute includes at least one of latitude data (E6 format), longitude data (E6 format), velocity data (double type), altitude data (double type), and timestamp data (long type).
[0067] In one example, such as Figure 3 As shown, it exemplifies a schematic diagram of a trajectory file. Figure 3 In the trajectory file shown, each line records one data point, and each data point represents the location data of a trajectory positioning point. The location data of each trajectory positioning point includes latitude data (E6 format), longitude data (E6 format), velocity data (double type), altitude data (double type), and timestamp data (long type).
[0068] Text files are stored on hard drives or disks in bytes. The file size is determined by the file encoding, the number of bytes occupied by Chinese and English characters, and the hard drive alignment. In a disk system, the encoding format refers to different encodings of text, defined by the first two bytes of the text. The number of Chinese characters refers to the total number of characters, including Chinese characters, punctuation, and full-width symbols. The number of English characters refers to the total number of characters, including English letters, punctuation, and half-width symbols. 4096 is equivalent to 4K. 4K alignment is the default disk sector alignment rule; it does not apply if the disk is not 4K aligned. Because mobile devices use 4K alignment, the space occupied is always a multiple of 4096.
[0069] Therefore, the final storage formula for the text file is:
[0070] TXT file size = length of encoding flags + number of Chinese characters * number of bytes occupied by a single Chinese character + number of English characters * number of bytes occupied by a single English letter.
[0071] TXT file size = (TXT file size / 4096) * 4096 (rounded up).
[0072] In an exemplary embodiment, to ensure that each data item segment in the trajectory file is sufficiently short, a data specification constraint method is used to record the location data, with the following rules:
[0073] (1) Latitude, longitude, speed, altitude, and time stamp are encoded using ANSI (a character code) because there are no Chinese characters. Each location attribute data is separated by commas in the location data.
[0074] (2) Latitude and longitude are stored as integers (int). The returned data is originally in E6 format (int data). In older versions, it was converted to LatLng. This conversion can be removed. Other data is defined as double data type (double), but it is converted to int when stored in the file for calculation. The advantages of this definition are reduced storage bits, faster calculation speed, and avoidance of errors caused by loss of precision in double calculations.
[0075] In an exemplary embodiment, such as Figure 4 As shown, the implementation process of step 210 above includes the following steps (211-212). Figure 4 The flowchart of a trajectory data processing method provided in one embodiment of this application is shown. Figure 2 .
[0076] Step 211: Obtain the position data of the trajectory positioning points in the target trajectory.
[0077] In an exemplary embodiment, location data of trajectory positioning points are collected at a preset frequency. For example, the location data of one trajectory positioning point is recorded every 1 second. In the trajectory file, each line records one data point, and each data point represents the location data of one trajectory positioning point.
[0078] In an exemplary embodiment, the starting trajectory point is the first trajectory positioning point among the trajectory positioning points. Accordingly, as... Figure 5 As shown, the implementation process of step 211 above includes the following steps (211a~211b), Figure 5 The flowchart of a trajectory data processing method provided in one embodiment of this application is shown. Figure 3 .
[0079] Step 211a: If the position data of the starting trajectory point is written to the first storage area, the position data of the starting trajectory point is forcibly transferred from the first storage area to the second storage area.
[0080] In one possible implementation, the first storage area is a memory area, and the second storage area is the storage area corresponding to the memory.
[0081] During the saving of some trajectory files, the first line of data may be lost. The first line of data is the location data corresponding to the starting trajectory point mentioned above. The location data collected by the terminal is often first stored in memory and then transferred to the storage medium according to certain transmission rules. However, after the memory receives the location data, it does not necessarily immediately transfer the location data to the storage medium for storage. There may be a delay, which may lead to data loss.
[0082] In one example, such as Figure 6As shown, this example illustrates a schematic diagram of the loss of the first line of data. Record 611, containing the first line of data corresponding to the historical trajectory, is stored in trajectory file 61. However, in trajectory file 62, the first line of data corresponding to the historical trajectory has been lost.
[0083] In this embodiment, the trajectory file stores the positional difference data between each trajectory point and the previous trajectory point. This positional difference data depends on the positional data of the previous trajectory point; therefore, the accuracy of the positional data of the first trajectory point must be ensured. For other solutions, since the method of storing positional difference data as described in this embodiment is not used, the problem of losing positional data for a single point is not amplified, and the route can remain essentially unchanged. However, this embodiment uses positional data differential to reduce the length of data fields. Therefore, it is necessary to ensure the normal writing of the first point. Once the positional data of the starting trajectory point is written to the first storage area, the positional data of the starting trajectory point is forcibly transferred from the first storage area to the second storage area for storage to avoid the loss of the starting trajectory point's positional data.
[0084] In one possible implementation, the position data of the starting trajectory point is checked for correctness. If the position data of the starting trajectory point passes the correctness check, the position data of the starting trajectory point is retained. If the position data of the starting trajectory point fails the correctness check, the position data of the starting trajectory point is determined to be abnormal data, the abnormal data is deleted, and the position data of the starting trajectory point is re-determined.
[0085] The above correctness checks include, but are not limited to, the following methods:
[0086] The location data of the starting trajectory point is subjected to data format validation to obtain the data format validation result. Data format validation includes determining whether the data format of each location attribute data in the location data is the corresponding preset format. Optionally, if the data format of each location attribute data is the corresponding preset format, the data format validation result is determined to be that the location data of the starting trajectory point passes the data format validation; otherwise, the data format validation result is determined to be that it fails.
[0087] The location data of the starting trajectory point is subjected to data range verification to obtain the data range verification result. Data range verification includes determining whether each location attribute data in the location data is within the corresponding preset data interval. Optionally, if each location attribute data is within the corresponding preset data interval, the data range verification result is determined to be that the location data of the starting trajectory point passes the data range verification; otherwise, the data range verification result is determined to be that it fails.
[0088] In one example, such as Figure 7As shown, this example illustrates a flowchart for storing the first row of data. First, the first-point check process is initiated; then, the process waits for the first-point data to be written; the first-point data is written using a BufferWriter, which has a buffer, and the first-point write is forced to flush(). Additionally, after writing the first-point data, a BufferReader is used to read the first-point data and perform a correctness check. If the correctness check passes, the first-point data is retained; if the correctness check fails, the first-point data is determined to be abnormal, deleted, and the first-point check process is restarted.
[0089] Step 211b: If the location data of the trajectory positioning points stored in the first storage area meets the data transmission conditions, the location data of the trajectory positioning points stored in the first storage area is transmitted to the second storage area.
[0090] For trajectory positioning points other than the starting trajectory point, their position data are first written into memory. After a certain number of trajectory positioning point position data are accumulated in memory, they can be transferred together to the second storage area to reduce the number of I / O (input / output) operations inside the device.
[0091] Step 212: Based on the location data of the trajectory positioning points, perform positioning point thinning processing on the trajectory positioning points to obtain at least two trajectory points.
[0092] In this embodiment of the application, in order to reduce the number of data items in the trajectory file sufficiently, all trajectory positioning points in the target trajectory can be thinned out to obtain at least two trajectory points.
[0093] Optionally, the Douglas-Puk algorithm is used to thin out the localization points, obtaining at least two trajectory points corresponding to the target trajectory after thinning. Using the Douglas-Puk algorithm to thin out localization points requires acquiring all trajectory localization points. After the target trajectory terminates, the thinned trajectory localization points are saved. In one example, such as... Figure 8 As shown, this example illustrates a schematic diagram of an asynchronous trajectory file thinning process. First, the original trajectory file is read and asynchronous memory trajectory thinning is performed; the original file is renamed (backup), i.e., the original trajectory file is backed up; the thinned trajectory is written to the file; after the thinned trajectory is successfully written, the backup file is deleted.
[0094] Optionally, during the point writing process in navigation, the positioning points can be thinned to obtain at least two trajectory points.
[0095] In an exemplary embodiment, for a mature traffic road network, the trajectory can be formed by connecting various road branching points. Therefore, the location data of trajectory positioning points collected during the user's journey can be matched with the location data of at least one road branching point. Only the location data of trajectory positioning points that match the road branching point is retained, while the location data of trajectory positioning points that do not match the road branching point is deleted, thus achieving real-time positioning point thinning processing. The aforementioned road branching point refers to a location point corresponding to at least two travel directions, such as a crossroads or a U-turn junction.
[0096] Furthermore, the remaining trajectory positioning points that match the road fork points can be subjected to secondary positioning point thinning, for example, by using the Douglas Pucker algorithm to perform secondary thinning, to obtain at least the above two trajectory points.
[0097] In one possible implementation, such as Figure 5 As shown, the implementation process of step 212 above includes the following steps (2121 to 2123).
[0098] Step 2121: Based on the location data of the trajectory positioning points, determine the trajectory offset data between the trajectory positioning points.
[0099] In some application scenarios, such as typical map navigation, the routes traversed by users are mostly straight line segments. At a certain map scale with magnification, the length of the line segment offset can be ignored. Therefore, by determining the aforementioned trajectory offset data, trajectory positioning points with small offsets can be removed from a certain trajectory range.
[0100] The aforementioned trajectory offset data includes the offset distance between the trajectory positioning point and the target line. Optionally, the target line is the line connecting the first and last trajectory positioning points within the trajectory interval where the trajectory positioning point is located.
[0101] Optionally, the aforementioned offset distance can be determined using the Heron-Qin Jiushao formula. The Heron-Qin Jiushao formula shows that the area of a triangle can be calculated if the lengths of its three sides are known. If the lengths of the three sides of a triangle are a, b, and c, Where s is half the perimeter of the triangle, i.e., s = 1 / 2(a + b + c), and A is the area of the triangle. The height D of the triangle is the offset distance mentioned above, D = 2A / b, and thus the offset distance can be calculated.
[0102] Step 2122: Based on the trajectory offset data, determine the trajectory removal point in the trajectory positioning point.
[0103] A trajectory removal point refers to a trajectory location point whose offset distance within the trajectory interval is less than a distance threshold. Optionally, the aforementioned distance threshold is 20 meters, an empirical distance value for road snapping during navigation.
[0104] If the offset distance between the trajectory positioning point and the target line is less than the distance threshold, the point can be identified as the trajectory removal point.
[0105] In some application scenarios, after confirming the distance threshold and using the Douglas-Puk algorithm for thinning, optimizing points within the distance threshold can achieve the goal of reducing the number of data entries in the trajectory file.
[0106] In an exemplary embodiment, the line connecting the first and last points corresponding to the trajectory interval is determined; the offset distance between the trajectory positioning point within the trajectory interval and the line connecting the first and last points is determined.
[0107] If the offset distance between the trajectory positioning point and the line connecting the first and last points within the trajectory interval is less than the distance threshold, the trajectory positioning point within the trajectory interval, except for the points located at the endpoints of the interval, is determined as the trajectory removal point.
[0108] If the offset distance between any trajectory positioning point and the line connecting the first and last points within the trajectory interval is greater than the distance threshold, the trajectory positioning point corresponding to the maximum offset distance is determined as the interval boundary point; based on the interval boundary point, the trajectory interval is divided into new trajectory intervals; for any trajectory interval, the process starts from the above steps of determining the line connecting the first and last points corresponding to the trajectory interval, until the trajectory thinning is completed.
[0109] Step 2123: Remove the trajectory removal point from the trajectory positioning point to obtain at least two trajectory points.
[0110] Remove the trajectory removal point from the trajectory positioning point, and the remaining trajectory positioning point is the at least two trajectory points obtained after trajectory thinning.
[0111] In relevant scenarios, the aforementioned offset distance is calculated using Heron's formula, and a distance threshold is set to thin out the trajectory points within that threshold. After thinning, the trajectory points maintain the trajectory shape while significantly reducing the number of trajectory data items in the trajectory file. Statistical analysis shows that the average number of data items decreased by over 75%.
[0112] In some scenarios, map zooming is required for feedback and reporting, so the trajectory data source needs to be as accurate and detailed as possible. Therefore, a fixed empirical distance threshold of 20 meters is currently used. However, for other scenarios, the distance threshold can be dynamically set according to the map zoom ratio, allowing for more flexible location point thinning.
[0113] In one example, such as Figures 9(a) to 9(c)As shown in Figure 9(a), a schematic diagram of the trajectory before positioning point thinning is exemplarily presented; Figure 9(b) shows a schematic diagram of the trajectory during positioning point thinning is exemplarily presented; and Figure 9(c) shows a schematic diagram of the trajectory after positioning point thinning is exemplarily presented. In Figure 9(a), the trajectory to be processed includes 10 trajectory positioning points, namely trajectory positioning point 1 to trajectory positioning point 10. In Figure 9(a), trajectory positioning points 1 and 10 are the endpoints on both sides of the trajectory interval, and the line connecting the first and last points between trajectory positioning points 1 and 10 is determined; the offset distance between trajectory positioning points 2 to 8 within the trajectory interval and the line connecting the first and last points is determined. Since the offset distance of trajectory positioning point 7 within the trajectory interval is greater than the distance threshold, trajectory positioning point 7 is determined as the interval boundary point. Therefore, in Figure 9(b), the trajectory intervals are re-obtained, namely trajectory positioning points 1 to 7 and trajectory positioning points 7 to 10, and then positioning point thinning is continued in each trajectory interval. Figure 9(c) shows the thinning result. In the trajectory positioning points 1 to 10 shown in Figure 9(a), trajectory positioning points 2, 4, 6 and 8 were removed to obtain the thinned trajectory points.
[0114] Besides thinning the data based on trajectory offset and distance thresholds, trajectory data can also be optimized and saved in segments according to different application scenarios. Therefore, in another possible implementation, such as... Figure 5 As shown, the implementation process of step 212 above also includes the following steps (212a to 212b).
[0115] Step 212a: If the target trajectory includes at least one segment of a preset trajectory, determine the key positioning points corresponding to at least one segment of the preset trajectory based on the position data of the trajectory positioning points in the at least one segment of the preset trajectory.
[0116] The aforementioned preset trajectories include interval trajectories corresponding to the planned trajectory and fixed trajectories. The planned trajectory includes the trajectory corresponding to the planned path provided by the application based on the destination location; this planned path can be displayed to the user as reference information. Interval trajectories corresponding to the planned trajectory include interval trajectories that overlap or approximately overlap with the planned trajectory within the target interval. Fixed trajectories include path trajectories corresponding to fixed transportation routes, such as fixed trajectories between transportation stations. These transportation stations include, but are not limited to, bus stops, subway stations, train stations, airport terminals, and ferry terminals.
[0117] In practical applications, the aforementioned planned trajectory and fixed trajectory can correspond to scenarios where trajectory is optimized and collected before navigation, and scenarios where trajectory data is saved in segments during navigation.
[0118] For scenarios where the collected trajectory is optimized before navigation, such as Figures 10(a) to 10(c)As shown, Figure 10(a) illustrates a schematic diagram of a cycling navigation planning page, including a cycling planning trajectory 101; Figure 10(b) illustrates a schematic diagram of a walking navigation planning page, including a walking planning trajectory 102; and Figure 10(c) illustrates a schematic diagram of a driving navigation planning page, including a driving planning trajectory 103.
[0119] The trajectory data for the aforementioned planned trajectory can be a planned trajectory determined and displayed by the server based on big data and the starting and ending points of navigation. For example, the trajectory data for the planned trajectory may be a trajectory drawn and displayed based on the different starting and ending points of the route calculation after data collection and processing by a map service company through the map big data backend. Therefore, for the trajectory path collected from the cloud, the density of the trajectory point set of the downloaded trajectory can be dynamically adjusted according to the map scale zoom level. For example, when the zoom level is 50 kilometers, the number of trajectory points sent by the backend is 1 / 5000 of the original trajectory point data (one point record per meter). When the user zooms the map using the zoom button or two-finger zoom, the set of trajectory points corresponding to the scale within the visible area of the page is dynamically sent according to the zoom level. This set of trajectory points is not necessarily all the trajectory points of the entire trajectory, but rather the set of trajectory points within the currently zoomed visible area. Figure 11 As shown, this example illustrates a schematic diagram of a map display page showing a portion of the trajectory in zoomed-out mode. The map display page 110 includes a portion of the entire trajectory 111 within the visible range of the page.
[0120] The aforementioned target trajectory includes the planned trajectory when the interval trajectory within the target trajectory overlaps with the planned trajectory. In the case where the target interval trajectory overlaps with the target planned trajectory, the trajectory data corresponding to the target planned trajectory can be reused. Key positioning points in the target planned trajectory can be directly obtained as key positioning points corresponding to the target interval trajectory. Alternatively, trajectory positioning points in the target interval trajectory that match key positioning points in the target planned trajectory can be determined as key positioning points, and mismatched trajectory positioning points can be determined as trajectory removal points for subsequent removal processing.
[0121] In this embodiment of the application, by reusing the trajectory data of the planned trajectory before navigation and combining it with the location point thinning process, the combination of trajectory points can be made smaller, and the amount of trajectory data in special scenarios can be further reduced.
[0122] Furthermore, for scenarios where trajectory data is saved in segments during navigation, different traffic scenarios can be discussed separately. In this embodiment, different trajectory data saving methods are determined based on the user's specific traffic scenario. These traffic scenarios include, but are not limited to, driving, walking, cycling, public transportation, subway, and taxi services.
[0123] For navigation scenarios involving driving, walking, and cycling, users have a strong desire to actively drive. For example... Figure 12(a) , 12(b) As shown, Figure 12(a) illustrates an example of a driving navigation page. Figure 1 Figure 12(b) illustrates an example of a driving navigation page. Figure 2 Figure 12(a) includes the planned trajectory 121, and Figure 12(b) includes the turning prompt box 122. During active driving, the user may enter various navigation planned trajectories or non-planned trajectories, and may also perform abnormal operations such as pausing navigation at any time. Therefore, it is necessary to record the location data of the user's trajectory positioning points at a preset frequency (once per second), and then perform positioning point thinning processing after obtaining the location data of the trajectory positioning points. If the preset trajectory includes an interval trajectory corresponding to the planned trajectory, then the key positioning points in the target planned trajectory can be obtained as the key positioning points corresponding to the target interval trajectory, or the trajectory positioning points in the target interval trajectory that match the key positioning points in the target planned trajectory can be determined as key positioning points.
[0124] For bus and subway navigation scenarios, the trajectory data generated by public transportation has corresponding fixed and non-fixed navigation trajectory data that can be recorded and extracted. Specifically, when a user takes a specific bus or subway route, the trajectory data is fixed and cannot be actively changed by the user. Therefore, the trajectory data can be reused from the route planned before navigation and is not saved. When the user arrives at the station and walks to the destination, or when connecting between different public transportation routes and needs to walk, the location data of the user's trajectory positioning points needs to be recorded at a preset frequency (once per second) based on the user's current navigation trajectory. The recording method here can be consistent with the driving, walking, and cycling navigation methods mentioned above.
[0125] like Figure 13(a) , 13(b) As shown in Figure 13(a), a schematic diagram of a public transportation navigation page is provided. Figure 1 Figure 13(b) illustrates an example of a navigation page for hybrid travel modes. Figure 2 Figure 13(a) includes a navigation planning trajectory 131 composed of fixed routes corresponding to different public transportation modes, and Figure 13(b) includes a walking trajectory 132 to the subway station and a subway planning trajectory 133.
[0126] Unlike driving, walking, and cycling navigation, bus and subway navigation scenarios require different approach before point thinning. Before thinning, the location data of trajectory points within a fixed trajectory can be matched with the location data of corresponding transportation stops or marker points. The trajectory points matching these stops or markers are then identified as key location points. For trajectories between key location points, the connecting paths between these stops or markers can be reused. Trajectories between transportation stops are not necessarily straight lines; markers can be used to indicate changes in the trajectory between stops. In a specific example, for a public transportation route segment, trajectory points matching bus stops can be used as key location points. For a straight line or several broken lines, the number of trajectory points is already very small, so point thinning for this segment can be skipped. By identifying key location points, point thinning can still be performed, reducing the number of data items in the trajectory data.
[0127] In ride-hailing navigation scenarios, the navigation is largely non-subjective, with the driver controlling the route and actions. Therefore, in ride-hailing navigation, the trajectory data recorded in the navigation generated on the end-user's device can be generated and reported by the driver and then distributed to the passenger's device via the cloud. The driver records the trajectory using the same method as in driving navigation scenarios: after thinning, it is uploaded to the cloud, and then the sufficiently optimized data is downloaded to the user's device. Therefore, the trajectory file already contains a sufficiently small set of trajectory points, eliminating the need for further thinning.
[0128] Step 212b: Remove all trajectory positioning points except for key positioning points from at least one preset trajectory to obtain trajectory points corresponding to at least one preset trajectory.
[0129] Step 220: Based on the location data, determine the positional difference data between at least two trajectory points.
[0130] In an exemplary embodiment, the aforementioned location data includes at least one location attribute data. Differential analysis is performed on the location attribute data with the same meaning between each trajectory point to reduce the field length of each data item in the trajectory file. Correspondingly, as... Figure 4 As shown, the implementation process of step 220 includes the following step 221.
[0131] Step 221: If the target trajectory point is not the starting trajectory point, perform differential processing on at least one position attribute data corresponding to the target trajectory point and at least one position attribute data corresponding to the previous trajectory point of the target trajectory point to obtain at least one position attribute difference data corresponding to the target trajectory point.
[0132] The target trajectory point is any one of at least two trajectory points, and the position difference data includes at least one position attribute difference data corresponding to at least two trajectory points.
[0133] In one example, as shown in Table 2 below, the data specifications and differential methods for each location attribute data are illustrated.
[0134] Table 2
[0135]
[0136] In Table 2, each location attribute data involves differentiation. Differentiation means that the location attribute data needs to be differentiated, that is, logical difference calculation is performed on the fields with the same meaning in two adjacent trajectory data.
[0137] Optionally, the difference function corresponding to the above difference processing is illustrated below.
[0138] for(Number IndexNumber){
[0139] StoreNumber=CurrentNumber-IndexNumber
[0140] CurrentNumber = IndexNumber
[0141] }
[0142] In an exemplary embodiment, the implementation process of step 220 above includes the following:
[0143] Optionally, the latitude data corresponding to the target trajectory point is differentially processed with the latitude data corresponding to the previous trajectory point of the target trajectory point to obtain the latitude difference data corresponding to the target trajectory point.
[0144] Optionally, the longitude data corresponding to the target trajectory point is differentially processed with the longitude data corresponding to the previous trajectory point of the target trajectory point to obtain the longitude difference data corresponding to the target trajectory point.
[0145] Optionally, the velocity data corresponding to the target trajectory point is differentially processed with the velocity data corresponding to the previous trajectory point of the target trajectory point to obtain the velocity difference data corresponding to the target trajectory point.
[0146] Optionally, the elevation data corresponding to the target trajectory point can be differentially processed with the elevation data corresponding to the previous trajectory point of the target trajectory point to obtain the elevation difference data corresponding to the target trajectory point.
[0147] Optionally, the timestamp data corresponding to the target trajectory point is differentially processed with the timestamp data corresponding to the previous trajectory point of the target trajectory point to obtain the timestamp difference data corresponding to the target trajectory point.
[0148] The above-mentioned location attribute difference data includes, but is not limited to, latitude difference data, longitude difference data, speed difference data, altitude difference data, and timestamp difference data.
[0149] Step 230: Based on the position data of the starting trajectory point and the position difference data, obtain the compressed trajectory data corresponding to the target trajectory.
[0150] Apart from the position data of the starting trajectory point, the position data of subsequent trajectory points are obtained by differing from the position data of the previous trajectory point.
[0151] The compressed trajectory data includes the position data of the starting trajectory point and the position difference data of the trajectory points after the starting trajectory point.
[0152] After field optimization and differencing, the data content in the trajectory file before and after compression is as follows: Figure 14 As shown, this example illustrates a schematic diagram of trajectory data compression. Trajectory file 141 contains data records representing the original position data of each trajectory point, while trajectory file 142 contains data records including the original position data corresponding to the starting trajectory point and the positional difference data between subsequent trajectory points and the previous trajectory point. In some application scenarios, statistical analysis shows that using the data specifications and differential compression method of this embodiment reduces the data volume by an average of 63%.
[0153] In an exemplary embodiment, such as Figure 4 As shown, the above method also includes the following steps (240-250).
[0154] Step 240: Perform data encapsulation processing on the compressed trajectory data to obtain the trajectory file corresponding to the target trajectory.
[0155] The aforementioned trajectory file is primarily used for trajectory recording, playback, and display. Optionally, the trajectory file can be a text file. The trajectory file includes the position data of the starting trajectory point of the target trajectory and the positional difference data corresponding to other trajectory points.
[0156] The aforementioned trajectory file is a storage product of compressed trajectory data. Optionally, the storage product is a text file with the .log extension.
[0157] Step 250: Compress the trajectory file to obtain the compressed trajectory file corresponding to the target trajectory.
[0158] In this embodiment of the application, in order to make the size of the trajectory file small enough, the trajectory file can be further compressed to obtain a compressed trajectory file.
[0159] In one possible implementation, the above file compression process is a lossless compression process.
[0160] Optionally, the above file compression process is Deflate compression, which can be used on the Android system. Deflate compression is a lossless data compression algorithm that uses both the LZ77 algorithm and Huffman coding.
[0161] LZ77 removes duplicate data by recording the offset plus the length of the duplicate code.
[0162] Huffman coding is a method of encoding data using a coding table with different side lengths, also known as optimal binary tree. Its core points are: (1) using prefix coding even though the lengths are different. (2) the coding table is designed based on the probability of letter occurrence, with high-probability characters using short codes. In related applications, after testing and statistics, the average file compression rate of trajectory files is 56.2%, which meets the requirements. Therefore, the generated text files containing compressed trajectory data can be compressed using Deflate.
[0163] In one example, as shown in Figures 15(a) and 15(b), Figure 15(a) illustrates a schematic diagram of a static trajectory display page in a map application, and Figure 15(b) illustrates a schematic diagram of a dynamic trajectory display page in a map application. During navigation using the target application, the terminal records one location data record every second according to preset rules. After navigation, the terminal thins the trajectory location point set to reduce the number of data items in the trajectory file. It then performs differential analysis on the location data of the thinned trajectory points to obtain location difference data, generating a trajectory file to ensure that each data item field in the trajectory file is sufficiently short. Finally, after navigation, the trajectory file is compressed to obtain a compressed trajectory file, reducing its size. Based on the compressed trajectory file, the user's journey trajectory is either statically displayed on the static trajectory display page 151 in Figure 15(a) or dynamically displayed on the dynamic trajectory display page 152 in Figure 15(b).
[0164] In some application scenarios, such as mobile navigation, mobile navigation records the latitude, longitude, altitude, and other location data of multiple user points in real time, and the resulting trajectory file is stored on the client side. Due to product requirements, the trajectory file needs to be uploaded to a cloud server after navigation. Therefore, it is necessary to compress and optimize the trajectory file data on the client side to achieve smaller file size and more accurate data. In one example, such as... Figure 16 As shown, this example illustrates a schematic diagram of a trajectory file upload path. The trajectory records generated when a user uses a map application for public transportation navigation, subway navigation, driving, walking, cycling navigation, or taxi navigation, after being processed and optimized using the technical solution provided in this application embodiment, can be uploaded to the cloud backend as optimized compressed trajectory files.
[0165] In summary, the technical solution provided in this application obtains the position data of at least two trajectory points in the trajectory and determines the position difference data between each pair of at least two trajectory points. This enables the acquisition of compressed trajectory data corresponding to the target trajectory based on the position data of the first starting trajectory point and the aforementioned position difference data. By replacing the original position data with the position difference data, the storage data length can be effectively shortened, and the amount of trajectory data and the space occupied by the trajectory data can be effectively reduced.
[0166] Furthermore, the technical solution provided in this application embodiment, based on the positional offset relationship of the originally collected trajectory positioning points, performs thinning processing on the original collected trajectory positioning points, which can effectively reduce the number of trajectory points and reduce redundant trajectory positioning point data in a large number of approximately straight line segments, thereby reducing the number of data records in the trajectory file and reducing the size of the trajectory file from the dimension of the number of data records. In addition, this application embodiment also performs differential processing on the positional data of adjacent trajectory points in the trajectory file based on the logical relationship between each trajectory point, replacing the original data with the difference data for storage, which can effectively reduce the data length of each data item, thereby reducing the size of the trajectory file. Finally, the trajectory file can be compressed again to further reduce the file size. The technical solution provided in this application embodiment, without affecting the accuracy of trajectory data display, greatly reduces the storage space occupied by trajectory file data by generating points according to certain rules and physically compressing the generated trajectory file.
[0167] The technical solutions provided in this application embodiment are described below with reference to specific statistical data. In this application embodiment, by standardizing the location data specifications and using location data differentiation, the field length of each location attribute data in the trajectory file is shortened sufficiently, thereby reducing the average data size of the trajectory file by 63%; by using trajectory thinning, the number of location data entries in the trajectory file is reduced sufficiently, thereby reducing the average data size of the trajectory file by 75.3%; and by using Deflate compression, the trajectory file is further compressed, making the size of the trajectory file small enough, thereby reducing the average storage file size by 56.2%. Compared to historical version trajectory files, the average file size of the trajectory files generated using the technical solutions provided in this application embodiment is reduced to less than 1 / 20 of the historical version trajectory files, as shown in Table 3 below.
[0168] Navigation distance (km) Track file size (kb) Current track file size (kb) 20 272.45 11.68 50 704.86 34.47 100 1829.59 87.21
[0169] The following are embodiments of the apparatus of this application, which can be used to execute embodiments of the method of this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method of this application.
[0170] Please refer to Figure 17 This diagram illustrates a block diagram of a trajectory data processing apparatus according to an embodiment of this application. The apparatus has the function of implementing the above-described trajectory data processing method; this function can be implemented in hardware or by hardware executing corresponding software. The apparatus 1700 can be a computer device or can be installed within a computer device. The apparatus 1700 may include: a location data acquisition module 1710, a difference data determination module 1720, and a compressed trajectory determination module 1730.
[0171] The location data acquisition module 1710 is used to acquire the location data of at least two trajectory points in the target trajectory, wherein the at least two trajectory points include the starting trajectory point.
[0172] The difference data determination module 1720 is used to determine the position difference data between each pair of the at least two trajectory points based on the position data.
[0173] The compressed trajectory determination module 1730 is used to obtain compressed trajectory data corresponding to the target trajectory based on the position data of the starting trajectory point and the position difference data.
[0174] In an exemplary embodiment, the location data includes at least one location attribute data, and the difference data determination module 1720 is specifically used for:
[0175] If the target trajectory point is not the starting trajectory point, perform differential processing on at least one position attribute data corresponding to the target trajectory point and at least one position attribute data corresponding to the previous trajectory point of the target trajectory point to obtain at least one position attribute difference data corresponding to the target trajectory point.
[0176] Wherein, the target trajectory point is any one of the at least two trajectory points, and the position difference data includes at least one position attribute difference data corresponding to the at least two trajectory points.
[0177] In an exemplary embodiment, the location data acquisition module 1710 includes: a location data acquisition unit and a location point thinning unit.
[0178] A location data acquisition unit is used to acquire the location data of the trajectory positioning points in the target trajectory;
[0179] The positioning point thinning unit is used to perform positioning point thinning processing on the trajectory positioning points based on the position data of the trajectory positioning points to obtain the at least two trajectory points.
[0180] In an exemplary embodiment, the positioning point thinning unit includes: an offset data determination subunit, a removal point determination subunit, and a positioning point removal unit.
[0181] The offset data determination subunit is used to determine the trajectory offset data between the trajectory positioning points based on the position data of the trajectory positioning points.
[0182] The removal point determination subunit is used to determine the trajectory removal point among the trajectory positioning points based on the trajectory offset data.
[0183] The positioning point removal unit is used to remove the trajectory removal point from the trajectory positioning point to obtain the at least two trajectory points.
[0184] In an exemplary embodiment, the positioning point thinning unit further includes a key positioning point determination subunit.
[0185] The key positioning point determination subunit is used to determine the key positioning point corresponding to the at least one preset trajectory based on the position data of the trajectory positioning points in the at least one preset trajectory when the target trajectory includes at least one preset trajectory.
[0186] The positioning point removal unit is further configured to remove trajectory positioning points other than the key positioning point from the at least one preset trajectory segment, thereby obtaining trajectory points corresponding to the at least one preset trajectory segment.
[0187] In an exemplary embodiment, the starting trajectory point is the first trajectory positioning point among the trajectory positioning points, and the location data acquisition unit includes: a starting point forced writing unit.
[0188] The starting point forced write unit is used to force the position data of the starting trajectory point to be transferred from the first storage area to the second storage area when the position data of the starting trajectory point is written to the first storage area.
[0189] In an exemplary embodiment, the device 1700 further includes: a trajectory file generation module and a trajectory file compression module.
[0190] The trajectory file generation module is used to encapsulate the compressed trajectory data to obtain the trajectory file corresponding to the target trajectory.
[0191] The trajectory file compression module is used to compress the trajectory file to obtain a compressed trajectory file corresponding to the target trajectory.
[0192] In summary, the technical solution provided in this application obtains the position data of at least two trajectory points in the trajectory and determines the position difference data between each pair of at least two trajectory points. This enables the acquisition of compressed trajectory data corresponding to the target trajectory based on the position data of the first starting trajectory point and the aforementioned position difference data. By replacing the original position data with the position difference data, the storage data length can be effectively shortened, and the amount of trajectory data and the space occupied by the trajectory data can be effectively reduced.
[0193] It should be noted that the apparatus provided in the above embodiments is only illustrated by the division of the above functional modules when implementing its functions. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.
[0194] Please refer to Figure 18 This diagram illustrates a structural block diagram of a computer device according to an embodiment of this application. The computer device can be a terminal or a server. This computer device is used to implement the trajectory data processing method provided in the above embodiments. Specifically:
[0195] Typically, computer device 1800 includes a processor 1801 and a memory 1802.
[0196] Processor 1801 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 1801 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field Programmable Gate Array), and PLA (Programmable Logic Array). Processor 1801 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 1801 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 1801 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0197] The memory 1802 may include one or more computer-readable storage media, which may be non-transitory. The memory 1802 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 1802 is used to store at least one instruction, at least one program, code set, or instruction set, configured to be executed by one or more processors to implement the trajectory data processing method described above.
[0198] In some embodiments, the computer device 1800 may also optionally include a peripheral device interface 1803 and at least one peripheral device. The processor 1801, memory 1802, and peripheral device interface 1803 can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface 1803 via a bus, signal line, or circuit board. Specifically, the peripheral device includes at least one of the following: a radio frequency circuit 1804, a touch display screen 1805, a camera assembly 1806, an audio circuit 1807, a positioning assembly 1808, and a power supply 1809.
[0199] Those skilled in the art will understand that Figure 18The structure shown does not constitute a limitation on the computer device 1800, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.
[0200] In an exemplary embodiment, a computer-readable storage medium is also provided, the storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, the at least one program, the code set, or the instruction set, when executed by a processor, implements the above-described trajectory data processing method.
[0201] Optionally, the computer-readable storage medium may include: ROM (Read Only Memory), RAM (Random Access Memory), SSD (Solid State Drives), or optical disc, etc. The random access memory may include ReRAM (Resistance Random Access Memory) and DRAM (Dynamic Random Access Memory).
[0202] In an exemplary embodiment, a computer program product or computer program is also provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the aforementioned trajectory data processing method.
[0203] It should be understood that "multiple" as used herein refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. Furthermore, the step numbers described herein are merely illustrative of one possible execution order. In some other embodiments, the steps may not be executed in numerical order, such as two steps with different numbers being executed simultaneously, or two steps with different numbers being executed in the reverse order of the illustration. This application does not limit this.
[0204] In addition, in the specific embodiments of this application, data such as user information are involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0205] The above description is merely an exemplary embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A trajectory data processing method, characterized in that, The method includes: Acquire the position data of at least two trajectory points in the target trajectory, wherein the at least two trajectory points include the starting trajectory point; Based on the location data, determine the positional difference data between each pair of the at least two trajectory points; Based on the position data of the starting trajectory point and the position difference data, the compressed trajectory data corresponding to the target trajectory is obtained; The acquisition of position data for at least two trajectory points in the target trajectory includes: Obtain the position data of the trajectory positioning points in the target trajectory; When the target trajectory includes at least one preset trajectory, the key positioning point corresponding to the at least one preset trajectory is determined based on the position data of the trajectory positioning points in the at least one preset trajectory; the preset trajectory includes the interval trajectory corresponding to the planned trajectory and the fixed trajectory; the planned trajectory includes the trajectory corresponding to the planned path provided by the application based on the endpoint position; Remove the trajectory positioning points other than the key positioning points from the at least one preset trajectory segment to obtain the trajectory points corresponding to the at least one preset trajectory segment; The methods for determining the key positioning points include: if the target interval trajectory in the target trajectory coincides with the target planned trajectory, the trajectory data corresponding to the target planned trajectory can be reused to directly obtain the key positioning points in the target planned trajectory as the key positioning points corresponding to the target interval trajectory; or, the trajectory positioning points in the target interval trajectory that match the key positioning points in the target planned trajectory can be determined as the key positioning points; or, the position data of the trajectory positioning points in the fixed trajectory can be matched with the position data of the traffic stations corresponding to the fixed trajectory or the position data of the marker points corresponding to the fixed trajectory, and the trajectory positioning points that match the traffic stations or marker points can be determined as the key positioning points.
2. The method according to claim 1, characterized in that, The location data includes at least one location attribute data, and the step of determining the pairwise location difference data between the at least two trajectory points based on the location data includes: If the target trajectory point is not the starting trajectory point, perform differential processing on at least one position attribute data corresponding to the target trajectory point and at least one position attribute data corresponding to the previous trajectory point of the target trajectory point to obtain at least one position attribute difference data corresponding to the target trajectory point. Wherein, the target trajectory point is any one of the at least two trajectory points, and the position difference data includes at least one position attribute difference data corresponding to the at least two trajectory points.
3. The method according to claim 1, characterized in that, The acquisition of position data for at least two trajectory points in the target trajectory includes: Obtain the position data of the trajectory positioning points in the target trajectory; Based on the location data of the trajectory positioning points, the trajectory positioning points are thinned out to obtain at least two trajectory points.
4. The method according to claim 3, characterized in that, The step of performing location point thinning processing on the trajectory positioning points based on the location data of the trajectory positioning points to obtain the at least two trajectory points includes: Based on the position data of the trajectory positioning points, determine the trajectory offset data between the trajectory positioning points; Based on the trajectory offset data, determine the trajectory removal point among the trajectory positioning points; The trajectory removal point is removed from the trajectory positioning point to obtain the at least two trajectory points.
5. The method according to claim 3, characterized in that, The starting trajectory point is the first trajectory positioning point among the trajectory positioning points. The step of obtaining the position data corresponding to the trajectory positioning points in the target trajectory includes: When the position data of the starting trajectory point is written to the first storage area, the position data of the starting trajectory point is forcibly transferred from the first storage area to the second storage area.
6. The method according to any one of claims 1 to 5, characterized in that, The method further includes: The compressed trajectory data is encapsulated to obtain the trajectory file corresponding to the target trajectory; The trajectory file is compressed to obtain a compressed trajectory file corresponding to the target trajectory.
7. A trajectory data processing device, characterized in that, The device includes: A location data acquisition module is used to acquire the location data of at least two trajectory points in the target trajectory, wherein the at least two trajectory points include the starting trajectory point; The difference data determination module is used to determine the position difference data between each pair of the at least two trajectory points based on the position data. The compressed trajectory determination module is used to obtain compressed trajectory data corresponding to the target trajectory based on the position data of the starting trajectory point and the position difference data; The acquisition of position data for at least two trajectory points in the target trajectory includes: Obtain the position data of the trajectory positioning points in the target trajectory; When the target trajectory includes at least one preset trajectory, the key positioning point corresponding to the at least one preset trajectory is determined based on the position data of the trajectory positioning points in the at least one preset trajectory; the preset trajectory includes the interval trajectory corresponding to the planned trajectory and the fixed trajectory; the planned trajectory includes the trajectory corresponding to the planned path provided by the application based on the endpoint position; Remove the trajectory positioning points other than the key positioning points from the at least one preset trajectory segment to obtain the trajectory points corresponding to the at least one preset trajectory segment; The methods for determining the key positioning points include: if the target interval trajectory in the target trajectory coincides with the target planned trajectory, the trajectory data corresponding to the target planned trajectory can be reused to directly obtain the key positioning points in the target planned trajectory as the key positioning points corresponding to the target interval trajectory; or, the trajectory positioning points in the target interval trajectory that match the key positioning points in the target planned trajectory can be determined as the key positioning points; or, the position data of the trajectory positioning points in the fixed trajectory can be matched with the position data of the traffic stations corresponding to the fixed trajectory or the position data of the marker points corresponding to the fixed trajectory, and the trajectory positioning points that match the traffic stations or marker points can be determined as the key positioning points.
8. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing at least one instruction, at least one program, a code set, or an instruction set, the at least one instruction, the at least one program, the code set, or the instruction set being loaded and executed by the processor to implement the trajectory data processing method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The storage medium stores at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the trajectory data processing method as described in any one of claims 1 to 6.
10. A computer program product, characterized in that, The computer program product includes computer instructions stored in a computer-readable storage medium, a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the trajectory data processing method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Positioning data processing method and device, electronic equipment and storage medium
CN111797064A
Trajectory data processing method and device
CN113223049A