Multi-speed index vehicle track redisk method

By introducing a coprocessor and a multi-level speed-up indexing mechanism into HBase, the performance problem of storing and querying massive trajectory data has been solved, achieving efficient trajectory data storage and querying, and supporting large data volume expansion and fast querying.

CN121597782APending Publication Date: 2026-03-03THE 28TH RES INST OF CHINA ELECTRONICS TECH GROUP CORP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610130559.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-30
Publication Date
2026-03-03

Smart Images

  • Figure CN121597782A_ABST
    Figure CN121597782A_ABST
Patent Text Reader

Abstract

The invention discloses a multi-speed index vehicle trajectory redisk method. The method comprises the following steps: obtaining vehicle trajectory data and preprocessing the vehicle trajectory data; the traffic tool track data are stored in an HBase database; a plurality of speed index tables are established in the HBase, when track data are written, index data of different speeds are automatically generated through the coprocessor, and the coprocessor inserts the track data into the corresponding speed index tables according to the time difference between the current track data and the previous track data; the traffic tool track is recounted, the client side inquires the corresponding data table according to the selected multiplied speed and / or the traffic tool, and track display is carried out through a geographic information system; according to the method, only the track data need to be written, the index does not need to be written independently, and the data consistency is guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of information technology, and specifically to a method for reconstructing vehicle trajectories using multi-speed indexing. Background Technology

[0002] With the development of the Internet of Things (IoT) and intelligent transportation systems, the trajectory data generated by transportation vehicles (such as vehicles, ships, and airplanes) is growing explosively, placing higher demands on the storage and retrieval of trajectory data. In practical applications, users often need to review and analyze the historical trajectories of transportation vehicles, including full trajectory playback, playback at different speeds, and trajectory queries for specific vehicles. Currently, traditional trajectory data storage and retrieval methods have the following shortcomings: First, while relational databases can meet basic query needs when storing trajectory data, query performance drops sharply when faced with massive amounts of trajectory data, making it difficult to support millisecond-level high-concurrency retrieval. Furthermore, as the data volume increases, the database's scalability is insufficient, making effective horizontal scaling difficult. Second, while big data platforms such as HBase can support large-scale data storage and expansion, they typically employ a separate writing approach for data and indexes, meaning that indexes need to be built and updated separately while writing trajectory data. This separate writing mechanism can lead to inconsistencies between data and indexes, especially under concurrent writes or abnormal conditions, easily causing mismatches between the index and the original data, affecting query accuracy. Furthermore, existing speed-up trajectory query solutions mostly adopt a model of first querying the original full data, and then performing data filtering and speed-up calculations on the client or application layer. This approach not only increases the network transmission load but also consumes a large amount of computing resources, resulting in low query efficiency, especially under conditions of high user concurrency and high query frequency, making it difficult to guarantee system response time. Summary of the Invention

[0003] Purpose of the invention: The purpose of this invention is to provide a method for reconstructing vehicle trajectories using multi-speed indexing. By introducing an HBase coprocessor and a multi-level multi-speed indexing mechanism, it solves the problems of high computational and network resource consumption and low query efficiency.

[0004] Technical solution: The multi-speed indexing method for vehicle trajectory replay described in this invention includes the following steps:

[0005] (1) Acquire and preprocess vehicle trajectory data;

[0006] (2) Store the vehicle trajectory data in an HBase database;

[0007] (3) Create multiple speed index tables in HBase, and when writing trajectory data, automatically generate index data of different speeds through the coprocessor. The coprocessor inserts the trajectory data into the corresponding speed index table according to the time difference between the current trajectory data and the previous trajectory data.

[0008] (4) Review the trajectory of the vehicle. The client queries the corresponding data table according to the selected speed and / or vehicle, and displays the trajectory through the geographic information system.

[0009] Furthermore, in step (1), preprocessing includes cleaning the trajectory data to form high-quality trajectory data;

[0010] Furthermore, step (1) also includes: generating a unique vehicle type ID for each vehicle type, and generating a unique vehicle ID for each vehicle.

[0011] Further, step (2) is as follows: In HBase, a vehicle trajectory table is created for each vehicle type, the vehicle ID is concatenated with the trajectory time to form a Rowkey, and the trajectory data is written into the corresponding table according to the vehicle type ID.

[0012] Furthermore, in step (3), the coprocessor is specifically as follows: after the trajectory data is written into the vehicle trajectory table, it is triggered to determine the speed index table to be inserted based on the time difference between the current trajectory data and the previous trajectory data; where the larger the time difference, the higher the level of the speed index table to be inserted.

[0013] Furthermore, the speed index table includes multiple tables at different speed levels, each used to store trajectory sampling data at different time intervals, to support review queries at different speeds.

[0014] Further, step (4) is as follows: when the client performs a full trajectory review, it scans the single-speed index table according to the start and end times; when the client selects a speed review, it scans the corresponding speed index table according to the start and end times; when the client selects a specific mode of transportation for review, it scans the corresponding mode of transportation trajectory table according to the mode of transportation ID and time range.

[0015] Furthermore, the scanning operation is implemented based on a range query of the Rowkey, where the Rowkey is composed of a timestamp and / or a vehicle ID.

[0016] The present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the methods described herein.

[0017] An electronic device according to the present invention includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the program to implement any of the methods described herein.

[0018] Beneficial effects: Compared with the prior art, the present invention has the following significant advantages: The present invention supports hundreds of billions of trajectory points and can support a larger amount of data by expanding nodes; The present invention only needs to write trajectory data, no longer needs to write indexes separately, and data consistency is guaranteed. Attached Figure Description

[0019] Figure 1 This is a flowchart of the present invention;

[0020] Figure 2 This is a flowchart summarizing the key transportation vehicles of the present invention. Detailed Implementation

[0021] The technical solution of the present invention will be further described below with reference to the accompanying drawings.

[0022] like Figure 1 As shown, this embodiment of the invention provides a method for reconstructing vehicle trajectories using multi-speed indexing, comprising the following steps:

[0023] Step 1: Preprocess trajectory data;

[0024] Step 1-1: Design the vehicle type IDs: 01 for ground vehicles, 02 for water vehicles, and 03 for air vehicles;

[0025] Steps 1-2: Design the vehicle ID, using ordered numbers or unordered strings as the encoding, such as the cargo ship "Sea Giant" being coded as 2000024, and China Eastern Airlines MU2812 being coded as 3000021, etc.

[0026] Steps 1-3 involve preprocessing the trajectory data, including deleting duplicate data, filling missing values, correcting outliers, and standardizing the format to form high-quality trajectory data; among these steps, Lagrange interpolation is used to fill missing values.

[0027] Step 2: Store the trajectory data;

[0028] Step 2-1: In HBase, create three tables: T_Land, T_Watercraft, and T_Air (Tables 1-3). Define the column family CF_TRACK, and define columns within CF_TRACK, including static and dynamic attributes. Static attributes include vehicle type ID, vehicle ID, vehicle name, vehicle details, and brand. Dynamic attributes include trajectory time, longitude, latitude, altitude, speed, and azimuth.

[0029] Table 1 T_Land Table

[0030] Type ID Tool ID Train number name Details brand Track Time longitude latitude speed Azimuth 1 1001 1011 Yutong Bus bus Yutong 2025 / 12 / 01 11:21:00 121 degrees 29 minutes East 31°14'N 30km / h 230°

[0031] Table 2 T_ Watercraft Table

[0032] Type ID Tool ID Ship markings name Details brand Track Time longitude latitude speed Azimuth 2 2003 1011 Maersk container ship Maersk 2025 / 04 / 01 11:21:00 121 degrees 30 minutes East 31°14'N 15km / h 200°

[0033] Table 3 T_Air Table

[0034] Type ID Tool ID Flight number name Details brand Track Time longitude latitude high speed Azimuth 3 3084 1011 737 Civil aircraft Boeing 2025 / 05 / 25 09:25:10 121 degrees 28 minutes East 31°14'N 10km 800km / h 180°

[0035] Step 2-2: Concatenate the vehicle ID and trajectory time fields to form the primary key Rowkey for the trajectory data;

[0036] Java

[0037] / / Rowkey generates pseudocode

[0038] int hashCode = vehicleID.hashCode();

[0039] int sequence = sequence + 1;

[0040] byte[] rowkey = Bytes.add(Bytes.add(Bytes.toBytes(hashCode),Bytes.toBytes(timestamp)), Bytes.toBytes(sequence));

[0041] Steps 2-3: Based on the vehicle type ID in the trajectory data, select the corresponding vehicle trajectory table (see Table 4), and write the primary key Rowkey and the corresponding trajectory data into the vehicle trajectory table.

[0042] Table 4 Mapping Rules Table

[0043] Vehicle Type ID Vehicle trajectory table 1 T_Land 2 T_Watercraft 3 T_Air

[0044] Step 3: Generate a multi-speed index; such as Figure 2 As shown, it includes the following steps:

[0045] Step 3-1: Create a single-speed track table T_Track in HBase (see Table 5), and multi-speed index tables for ×2, ×4, ×8, ×16, and ×32 speeds, namely T_Track_2, T_Track_4, T_Track_8, T_Track_16, and T_Track_32, respectively. The table structure is the same as that of T_Track.

[0046] Table 5 T_Track Table

[0047] Type ID Tool ID Flight number name Details brand Track Time longitude latitude high speed Azimuth 1 1001 1011 Yutong Bus bus Yutong 2025 / 12 / 01 11:21:00 121 degrees 29 minutes East 31°14'N - 30km / h 230° 2 2003 1011 Maersk container ship Maersk 2025 / 04 / 01 11:21:00 121 degrees 30 minutes East 31°14'N - 15km / h 200° 3 3084 1011 737 Civil aircraft Boeing 2025 / 05 / 25 09:25:10 121 degrees 28 minutes East 31°14'N 10km 800km / h 180°

[0048] Step 3-2: After the trajectory data is written to the vehicle trajectory table, the coprocessor of the table is triggered to concatenate the trajectory time field, vehicle ID and random number into the primary key Rowkey of the historical trajectory data and insert it into the single speed table T_Track;

[0049] Java

[0050] / / Single-speed data writing pseudocode

[0051] byte[] rowkey = Bytes.add(Bytes.add(Bytes.toBytes(timestamp),Bytes.toBytes(hashCode)), Bytes.toBytes(sequence));

[0052] insert(rowkey, track);

[0053] Step 3-3: In the coprocessor, query the time of the previous trajectory data for this trajectory data, and insert the multi-speed meter according to the time difference;

[0054] Discard when the time difference is less than 2 seconds;

[0055] When the time difference is greater than or equal to 2 seconds and less than 4 seconds, insert the historical trajectory at 2x speed.

[0056] When the time difference is greater than or equal to 4 seconds and less than 8 seconds, insert the historical trajectory 2x speedometer and the historical trajectory 4x speedometer.

[0057] When the time difference is greater than or equal to 8 seconds and less than 16 seconds, insert the historical trajectory 2x speedometer, historical trajectory 4x speedometer, and historical trajectory 8x speedometer.

[0058] When the time difference is greater than or equal to 16 seconds and less than 32 seconds, insert the historical trajectory 2x speedometer, historical trajectory 4x speedometer, historical trajectory 8x speedometer, and historical trajectory 16x speedometer.

[0059] When the time difference is greater than 32 seconds, insert the historical trajectory 2x speedometer, historical trajectory 4x speedometer, historical trajectory 8x speedometer, historical trajectory 16x speedometer, and historical trajectory 32x speedometer.

[0060] Java

[0061] / / Coprocessor logic pseudocode

[0062] class SpeedIndexCoprocessor extends BaseRegionObserver {

[0063] void postPut(ObserverContext ctx, Put put) {

[0064] long currentTime = put.get('timestamp');

[0065] long prevTime = queryPrevTime(put.get(Track_id')); / / Query the previous time

[0066] long delta = currentTime - prevTime;

[0067] if(delta >= 2000) { / / 2-second threshold

[0068] insertToIndexTable('T_Track_2x', put, delta);

[0069] }elseif(delta >= 4000){

[0070] insertToIndexTable('T_Track_4x', put, delta);

[0071] }elseif(delta >= 8000){

[0072] insertToIndexTable('T_Track_8x', put, delta);

[0073] }elseif(delta >= 16000){

[0074] insertToIndexTable('T_Track_16x', put, delta);

[0075] }elseif(delta >= 32000){

[0076] insertToIndexTable('T_Track_32x', put, delta);

[0077] }

[0078] }

[0079] }

[0080] Step 4: Client-side review; such as Figure 2 As shown, it includes the following steps:

[0081] Step 4-1: The client enters the review mode. When the user reviews the historical trajectory of all means of transportation, a time period is selected for query. Starting with the start time and ending time, a start Rowkey and an end Rowkey are generated respectively. The single speed trajectory table T_Track is scanned with [start Rowkey, end Rowkey]. After querying the trajectory data, it is displayed through different layers of the geographic information system.

[0082] Java

[0083] / / Single-speed replay pseudocode

[0084] byte[] startRowkey = Bytes.add(Bytes.add(Bytes.toBytes(startTimestamp), Bytes.toBytes(0x00)), Bytes.toBytes(0x00));

[0085] byte[] endRowkey = Bytes.add(Bytes.add(Bytes.toBytes(endTimestamp),Bytes.toBytes(0xFF)), Bytes.toBytes(0xFF));

[0086] scan.setStartRow(startRowkey);

[0087] scan.setStopRow(endRowkey);

[0088] ResultScanner scanner = T_Track.getScanner(scan);

[0089] Step 4-2: When a user reviews the historical trajectories of all modes of transportation at double speed, the [Start Rowkey, End Rowkey] is used to scan the historical trajectory table at the corresponding speed. After querying the trajectory data, it is displayed through different layers of the geographic information system.

[0090] Java

[0091] / / Single-speed replay pseudocode

[0092] byte[] startRowkey = Bytes.add(Bytes.add(Bytes.toBytes(startTimestamp), Bytes.toBytes(0x00)), Bytes.toBytes(0x00));

[0093] byte[] endRowkey = Bytes.add(Bytes.add(Bytes.toBytes(endTimestamp),Bytes.toBytes(0xFF)), Bytes.toBytes(0xFF));

[0094] scan.setStartRow(startRowkey);

[0095] scan.setStopRow(endRowkey);

[0096] ResultScanner result = nulll;

[0097] if (speed==2){

[0098] result = T_ Track_2.getScanner(scan);

[0099] }elseif(speed==4){

[0100] result = T_Track_4.getScanner(scan);

[0101] }elseif(speed==8){

[0102] result = T_Track_8.getScanner(scan);

[0103] }elseif(speed==16){

[0104] result = T_Track_16.getScanner(scan);

[0105] }elseif(speed==32){

[0106] result = T_Track_32.getScanner(scan);

[0107] }

[0108] Step 4-3: When a user selects a specific mode of transportation for query, the mode of transportation ID and start time are concatenated to form the start Rowkey, and the mode of transportation ID and end time are concatenated to form the end Rowkey. The [start Rowkey, end Rowkey] is used to scan the mode of transportation trajectory table, and after querying the trajectory data, it is displayed through the geographic information system.

[0109] Java

[0110] / / Key Transportation Vehicle Review Pseudocode

[0111] byte[] startRowkey = Bytes.add(Bytes.add(Bytes.toBytes(vehicle ID),Bytes.toBytes(startTimestamp)), Bytes.toBytes(0x00));

[0112] byte[] endRowkey = Bytes.add(Bytes.add(Bytes.toBytes(vehicle ID),Bytes.toBytes(endTimestamp)), Bytes.toBytes(0xFF));

[0113] scan.setStartRow(startRowkey);

[0114] scan.setStopRow(endRowkey);

[0115] ResultScanner result= T_Air.getScanner(scan);

[0116] / / Or ResultScanner result= T_Land.getScanner(scan);

[0117] / / Or ResultScanner result= T_Watercraft.getScanner(scan);

[0118] / / Or ResultScanner result= T_Space.getScanner(scan).

Claims

1. A method for reconstructing vehicle trajectories using multi-speed indexing, characterized in that, include: (1) Acquire and preprocess vehicle trajectory data; (2) Store the vehicle trajectory data in an HBase database; (3) Create multiple speed index tables in HBase, and when writing trajectory data, automatically generate index data of different speeds through the coprocessor. The coprocessor inserts the trajectory data into the corresponding speed index table according to the time difference between the current trajectory data and the previous trajectory data. (4) Review the trajectory of the vehicle. The client queries the corresponding data table according to the selected speed and / or vehicle, and displays the trajectory through the geographic information system.

2. The method for reconstructing vehicle trajectories using multi-speed indexing according to claim 1, characterized in that, In step (1), preprocessing includes cleaning the trajectory data to form trajectory data.

3. The method for reconstructing vehicle trajectories using multi-speed indexing according to claim 1, characterized in that, Step (1) also includes: generating a unique vehicle type ID for each vehicle type, and generating a unique vehicle ID for each vehicle.

4. The method for reconstructing vehicle trajectories using multi-speed indexing according to claim 1, characterized in that, Step (2) is as follows: In HBase, a vehicle trajectory table is created for each vehicle type. The vehicle ID and trajectory time are concatenated to form a Rowkey. The trajectory data is written into the corresponding table according to the vehicle type ID.

5. The method for reconstructing vehicle trajectories using multi-speed indexing according to claim 1, characterized in that, In step (3), the coprocessor is specifically as follows: after the trajectory data is written into the vehicle trajectory table, it is triggered to determine the speed index table to be inserted based on the time difference between the current trajectory data and the previous trajectory data; where the larger the time difference, the higher the level of the speed index table to be inserted.

6. The method for reconstructing vehicle trajectories using multi-speed indexing according to claim 5, characterized in that, The speed index table includes multiple tables at different speed levels, each used to store trajectory sampling data at different time intervals to support review queries at different speeds.

7. The method for reconstructing vehicle trajectories using multi-speed indexing according to claim 1, characterized in that, Step (4) is as follows: When the client performs a full trajectory review, it scans the single-speed index table according to the start and end times; when the client selects a speed review, it scans the corresponding speed index table according to the start and end times; when the client selects a specific mode of transportation for review, it scans the corresponding mode of transportation trajectory table according to the mode of transportation ID and time range.

8. The method for reconstructing vehicle trajectories using multi-speed indexing according to claim 7, characterized in that, The scanning operation is implemented based on a range query of the Rowkey, where the Rowkey is composed of a timestamp and / or a vehicle ID.

9. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1-8.

10. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor executes the program to implement the method as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Video double-speed playing method and system and storage medium

    CN111327966A

  • Molten steel transportation track playback method and device, electronic equipment and medium

    CN120086399A