Method for optimizing multi-dimensional sorting based on 64-bit integer encoding and string extension multi-dimensional sorting

CN122985879APending Publication Date: 2026-10-27YAOTANG (XIAMEN) NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610998795.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-06
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

当查询条件同时涉及目标区域、目标时间、速度等级、驾驶风险等级、道路等级、车辆类型和驾驶行为标签时,数据库需要在多个字段之间进行联合筛选,容易产生扫描范围过大、索引命中不集中、排序结果分散和响应效率下降的问题

Benefits of technology

本发明通过在车联网轨迹检索平台中对轨迹记录进行路网吸附、时间连续、速度方向和字段完整性筛选,使定位漂移点、断传点、方向异常点和字段缺失记录在进入64位主排序编码生成流程之前被识别和剔除,提高了车联网轨迹检索系统中参与编码排序的轨迹数据可靠性,减少异常轨迹记录对事故追溯、重点车辆监管和区域轨迹检索结果的干扰。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122985879A_ABST
    Figure CN122985879A_ABST
Patent Text Reader

Abstract

The application provides a multi-dimensional sorting and string expansion multi-dimensional sorting optimization method based on 64-bit integer coding, relates to the technical field of data coding and coding conversion, and comprises the following steps: acquiring vehicle networking track data, performing track validity screening on track records, and generating position grid coding, time slice coding, speed level coding and risk level coding; 64-bit main sorting coding is generated by combining in field order, so that track records with the same region, similar time, similar speed level and similar driving risk level form continuous coding segments in the database of the vehicle networking track retrieval platform; when inquiring, the track inquiry request is converted into multiple 64-bit main sorting coding candidate intervals, a second screening is performed based on a query hit adaptation coefficient, only the candidate intervals meeting the conditions are scanned, and a track retrieval sorting result is output. The application can improve the track coding sorting efficiency of the vehicle networking track retrieval system and reduce the invalid database scanning amount.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data encoding and encoding conversion technology, specifically to a multidimensional sorting and string extension multidimensional sorting optimization method based on 64-bit integer encoding. Background Technology

[0002] Vehicle-to-everything (V2X) trajectory retrieval platforms typically receive vehicle trajectory data uploaded from vehicle positioning terminals, V2X roadside units, vehicle driving recorders, traffic management platforms, and electronic road network systems. This trajectory data usually includes fields such as vehicle number, longitude, latitude, collection time, vehicle speed, driving direction angle, road grade, driving risk level, vehicle type, and driving behavior tags. Based on business requests such as traffic supervision, accident tracing, key vehicle monitoring, abnormal driving behavior retrieval, congestion review, and regional traffic analysis, the V2X trajectory retrieval platform needs to quickly query trajectory records for target areas, time ranges, and vehicle states from massive amounts of trajectory data, and output stable search results sorted by spatial location, time sequence, speed status, and risk level.

[0003] In large-scale data retrieval and sorting, it is often necessary to convert multi-field data into an encoding format that facilitates database storage, indexing, and comparison. 64-bit integer encoding is a commonly used fixed-length integer encoding method. It can represent a certain range of discrete data within a fixed 64-bit binary space and can directly utilize database integer indexes, bitwise operations, and numerical sorting for comparison processing. Compared to variable-length string encoding, 64-bit integer encoding has advantages such as fixed storage length, faster sorting speed, and simpler index structure. Therefore, it is suitable for unified encoding of discrete fields such as time, space, speed status, and risk status in vehicle network trajectory retrieval platforms.

[0004] However, existing vehicle-to-everything (V2X) trajectory retrieval platforms often employ separate time indexes, spatial indexes, or multi-field combination queries when processing city-level vehicle trajectory data. When query conditions simultaneously involve target area, target time, speed level, driving risk level, road level, vehicle type, and driving behavior tags, the database needs to perform joint filtering across multiple fields. This can easily lead to problems such as excessively large scanning range, scattered index hits, dispersed sorting results, and decreased response efficiency. Especially in densely populated areas such as around schools, transportation hubs, expressway entrances, commercial district roads, and key monitored roads, a large number of trajectory points are generated within the same time slice. If sorting is done solely using ordinary fields, it is difficult to form stable and continuous coded segments for trajectory records within the same area and time slice, resulting in numerous invalid reads when the V2X trajectory retrieval platform performs range queries and sorting outputs.

[0005] Existing methods typically focus only on spatial location or time fields, making it difficult to simultaneously consider speed level, driving risk level, road level, vehicle type, and driving behavior labels. When there are dense vehicles in a hotspot area and many trajectory records within the same time slice, a single encoding can easily lead to the accumulation of records with the same code, resulting in a lack of further differentiation criteria for trajectory records under the same master code. If high-precision spatial encoding and fine-grained temporal encoding are used throughout, it will increase data fragmentation and storage overhead in low-frequency areas, making it difficult for vehicle-to-everything (V2X) trajectory retrieval platforms to balance the retrieval accuracy of hotspot areas and the encoding stability of low-frequency areas when facing full-domain trajectory queries.

[0006] Furthermore, the data sources received by vehicle-to-everything (V2X) trajectory retrieval platforms are complex, potentially exhibiting issues such as location drift, abnormal collection times, unstable vehicle direction angles, missing fields, or out-of-order trajectory points. If the platform fails to perform validity screening of trajectory records before encoding and sorting, abnormal trajectory points will enter the encoding index and retrieval sorting process, thereby affecting the reliability of target area trajectory queries, accident trajectory tracing, and abnormal driving behavior retrieval results. Therefore, there is an urgent need for an encoding and sorting optimization method for V2X trajectory retrieval platforms or systems. This method should perform validity screening before trajectory data enters the database index and retrieval process, achieve clustered sorting based on location, time, speed, and risk dimensions within a fixed 64-bit encoding space, and supplement and differentiate through string-extended sorting encoding when there are main encoding conflicts or extended query conditions. This would improve the encoding and sorting efficiency, candidate interval hit efficiency, and trajectory retrieval output stability of the V2X trajectory retrieval platform. Summary of the Invention

[0007] The purpose of this invention is to provide a multidimensional sorting and string extension multidimensional sorting optimization method based on 64-bit integer encoding, so as to solve the problems mentioned in the background art.

[0008] To achieve the above objectives, the present invention provides the following technical solution: The optimization method for multidimensional sorting based on 64-bit integer encoding and string-extended multidimensional sorting includes the following steps: Acquire vehicle network trajectory data, which includes vehicle number, longitude, latitude, collection time, vehicle speed, driving direction angle, road grade, driving risk level, vehicle type, and driving behavior tags; The vehicle network trajectory data is filtered for trajectory validity, trajectory records that do not meet the first admission condition are removed, and trajectory records that meet the first admission condition are assigned a first tag; The trajectory record with the first mark is subjected to position quantization, time quantization, speed quantization and driving risk quantization to obtain position grid code, time slice code, speed level code and risk level code respectively; A 64-bit master sorting code is generated based on the location grid code, the time slice code, the speed level code, and the risk level code. The 64-bit master sorting code is combined according to the field order of the location grid code, the time slice code, the speed level code, and the risk level code, so that trajectory records with the same location grid code and the same time slice code are in the same continuous coding segment when arranged in ascending order according to the 64-bit master sorting code, and the trajectory records within the same continuous coding segment are further sorted according to the speed level code and the risk level code. The number of trajectory records with the same 64-bit primary sorting code is counted, the primary code conflict density coefficient is obtained, and when the primary code conflict density coefficient meets the preset conflict condition, or when the trajectory query request contains extended query conditions, a string extended sorting code is generated based on road grade, driving direction angle, vehicle type and driving behavior label. Receive a trajectory query request, convert the trajectory query request into multiple 64-bit main sorting code candidate intervals, and perform a second screening on the multiple 64-bit main sorting code candidate intervals based on the query hit adaptation coefficient, and assign a second label to the 64-bit main sorting code candidate intervals that meet the second screening conditions. Only the 64-bit main sorting code candidate interval with the second mark is scanned to obtain the hit trajectory records, and the hit trajectory records are sorted based on the 64-bit main sorting code and the string extended sorting code, and the trajectory retrieval sorting result is output.

[0009] Compared with the prior art, the beneficial effects of the present invention are: This invention improves the reliability of trajectory data participating in the coding and sorting process in the vehicle network trajectory retrieval platform by performing road network adsorption, time continuity, speed direction and field integrity screening on trajectory records. This allows location drift points, transmission interruption points, direction anomalies and missing field records to be identified and removed before entering the 64-bit main sorting encoding generation process. It also reduces the interference of abnormal trajectory records on accident tracing, key vehicle monitoring and regional trajectory retrieval results.

[0010] This invention combines location grid encoding, time slice encoding, speed level encoding, and risk level encoding in a vehicle network trajectory retrieval platform to generate a 64-bit master sorting code. This allows trajectory records in the same area, at similar times, at similar speed levels, and with similar driving risk levels to form continuous coded segments in an integer index of a common database. This improves the multi-dimensional aggregation and sorting capability of vehicle network trajectory data, reduces the platform's reliance on complex spatial indexes and multi-field joint scanning, and thus improves the response efficiency of trajectory retrieval within the target area and target time range.

[0011] This invention enables the vehicle-to-everything (V2X) trajectory retrieval platform to perform secondary differentiation of trajectory records with the same code based on road level, driving direction angle, vehicle type, and driving behavior tags in high-density trajectory scenarios such as hotspot areas, transportation hubs, school perimeters, and expressway entrances. It also scans only candidate code intervals that meet the query hit matching conditions, reducing the amount of database scanning for trajectory records in irrelevant areas, irrelevant time slices, and irrelevant risk states, thereby improving the sorting stability and query output accuracy of the V2X trajectory retrieval system. Attached Figure Description

[0012] Figure 1 This is a schematic diagram of the overall method flow of the present invention; Figure 2 A comparison chart of sample distribution before and after the first screening for trajectory validity; Figure 3 A comparison chart of grid levels and coding quantity in different regions; Figure 4 Comparison of trajectory aggregation effects before and after generating 64-bit master sorting encoding; Figure 5 Diagram showing the main coding collision density and extended coding triggering results; Figure 6 Comparison of sorting stability of identical code trajectories before and after string expansion sorting encoding; Figure 7 This is a comparison chart of the database scan volume before and after the second screening of the candidate interval. Detailed Implementation

[0013] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0014] To make the technical solution, technical features, and technical effects of the present invention clearer, the specific implementation of the present invention will be described below in the context of vehicle network trajectory retrieval. The following embodiments are only for explaining the present invention and are not intended to limit the scope of protection of the present invention; those skilled in the art can make equivalent substitutions based on the scale of vehicle trajectory data, road type, database structure, and query request form without departing from the concept of the present invention.

[0015] Please refer to Figures 1 to 7 The present invention provides the following technical solution: a multidimensional sorting and string-extended multidimensional sorting optimization method based on 64-bit integer encoding, the specific steps of which include: Step 1: Obtain vehicle network trajectory data, which includes vehicle number, longitude, latitude, collection time, vehicle speed, driving direction angle, road level, driving risk level, vehicle type, and driving behavior tag; perform coordinate validity verification, time continuity verification, speed and direction consistency verification, and field integrity verification on the vehicle network trajectory data, calculate the trajectory validity coefficient, and perform a first screening on the vehicle network trajectory data based on the trajectory validity coefficient, assigning a first tag to the trajectory records that pass the first screening; Step 2: Based on the trajectory records with the first marker, perform road network grid quantization on longitude and latitude to obtain location grid codes; perform time slice quantization on acquisition time to obtain time slice codes; perform speed level quantization on vehicle speed to obtain speed level codes; and perform risk level quantization on driving risk level to obtain risk level codes. Step 3: Based on location grid coding, time slice coding, speed level coding and risk level coding, generate a 64-bit master sorting code according to the preset bit width allocation rules, so that trajectory records of the same area, similar time, similar speed level and similar driving risk level are arranged continuously in the database sorting results; Step 4: Count the number of trajectory records with the same 64-bit master sorting code and calculate the master code conflict density coefficient; when the master code conflict density coefficient is greater than or equal to the preset conflict density threshold, or when the current query request contains at least one extended query condition among road level, driving direction angle, vehicle type or driving behavior label, generate a string extended sorting code based on road level, driving direction angle, vehicle type, driving behavior label and trajectory residual compensation information. Step 5: Receive a trajectory query request, which includes a target area range and a target time range; based on the target area range, target time range, speed level constraints, and driving risk level constraints, generate multiple 64-bit primary sorting code candidate intervals, calculate the query hit fit coefficient for each 64-bit primary sorting code candidate interval, and perform a second screening on the 64-bit primary sorting code candidate intervals according to the query hit fit coefficients, assigning a second label to the 64-bit primary sorting code candidate intervals that pass the second screening; Step 6: Scan only the 64-bit primary sorting code candidate interval with the second marker to obtain the hit trajectory records; when the hit trajectory records have string extended sorting codes, perform secondary sorting on the hit trajectory records based on the string extended sorting codes; when the hit trajectory records do not have string extended sorting codes, sort the hit trajectory records based on the 64-bit primary sorting codes to generate trajectory retrieval sorting results.

[0016] This implementation method is applied to a city-level vehicle-to-everything (V2X) trajectory retrieval platform. This platform accesses trajectory data from vehicle positioning terminals, V2X roadside units, vehicle driving record devices, and traffic management platforms, with a daily trajectory recording capacity reaching tens of millions. Each trajectory record includes at least the vehicle number, longitude, latitude, collection time, vehicle speed, driving direction angle, road grade, driving risk level, vehicle type, and driving behavior tags.

[0017] Figure 1 The process of acquiring vehicle-to-everything (V2X) trajectory data corresponding to urban road networks, vehicle trajectory points, roadside units, and data processing centers is described in steps 1 and 2. Step 1, "Track Validity Screening," verifies coordinate validity, time continuity, speed direction consistency, and field completeness, assigning a first marker. Steps 2 and 3, "Multidimensional Quantization and 64-bit Master Code Generation," convert latitude and longitude, acquisition time, vehicle speed, and driving risk level into location grid codes, time slice codes, speed level codes, and risk level codes, respectively, and combine them to generate a 64-bit master sorting code. Step 4, "Conflict Judgment and String Extension Coding," generates a string extension sorting code based on road level, driving direction angle, vehicle type, and driving behavior labels when there is a master code conflict or extended query conditions. Steps 5 and 6, "Candidate Interval Screening and Sorting Output," convert the query request into multiple candidate coding intervals, perform a second screening based on the query hit fit coefficient, scan only candidate intervals with the second marker, and output the trajectory retrieval sorting results.

[0018] In this implementation, the trajectory records are first screened for validity, eliminating those with out-of-bounds latitude and longitude, reversed time, abnormal speed and direction, and severe field deficiencies. Then, the latitude and longitude, collection time, vehicle speed, and driving risk level are quantized to generate a 64-bit master sorting code, ensuring that vehicle trajectory records from the same area, similar times, similar speed levels, and similar driving risk levels are consecutively arranged in the database. When the 64-bit master sorting code conflicts or the query request requires higher precision, a string extended sorting code is further generated based on road grade, driving direction angle, vehicle type, driving behavior label, and quantization residual. During the query, the target area and target time are converted into multiple 64-bit code candidate intervals. Only the candidate intervals that pass the screening are scanned, and a secondary sorting is completed based on the string extended sorting code.

[0019] The key technical point of this implementation method is not simply to concatenate vehicle trajectory fields into sorting keys, but to form a complete execution process of "filtering, elimination, main coding, extended coding, candidate interval filtering, hit segment scanning and secondary sorting" through trajectory validity coefficient, coding allocation weight coefficient, main coding conflict density coefficient and query hit adaptation coefficient. This improves the efficiency of vehicle network trajectory retrieval and reduces the amount of invalid scanning during range queries without building a complex spatial index.

[0020] Example 1 S101. Obtain the i-th trajectory record, wherein the i-th trajectory record includes the vehicle ID. i Longitude λ i latitude φ i Collection time t i Vehicle speed v i , driving direction angle α i Road grade i Driving risk level rk i Vehicle type i and driving behavior label bh i Vehicle identification number is obtained from the vehicle network platform or vehicle terminal registration information; longitude, latitude, collection time, vehicle speed, and driving direction angle are collected by the vehicle positioning terminal; road grade is obtained by matching electronic road network data with trajectory points; driving risk level is obtained by the traffic management platform based on records of rapid acceleration, rapid deceleration, abnormal deviation, and suspected wrong-way driving; vehicle type is obtained from vehicle registration information; driving behavior tags are determined by changes in speed, direction, and dwell time between adjacent trajectory points.

[0021] S102. Verify the validity of the longitude and latitude coordinates. Project the trajectory points onto the electronic road network and obtain the road network adsorption offset distance e from the trajectory points to the centerline of the matching road. i If a trajectory point fails to match a road or road network and the offset distance exceeds the preset maximum offset distance, the trajectory point is considered a suspected location drift point. Road network adhesion consistency. Calculate according to the following formula: Where e0 represents the preset road network adsorption reference distance, in meters, preferably 30m; when the trajectory point cannot be matched to the electronic road network road segment, R i Taking 0 directly, the formula evaluates the positioning reliability by the degree to which the trajectory point deviates from the road centerline. The smaller the offset distance, the closer the trajectory point is to the actual road position, and the higher the degree of road network adhesion. When the offset distance exceeds the reference distance, R... i It is suppressed to near 0 to reduce the impact of location drift points on subsequent sorting and encoding.

[0022] S103. Perform time continuity verification on the data acquisition time. Read the acquisition time interval Δt between the i-th trajectory record and the previous valid trajectory record for the same vehicle. i And compare it with the target sampling period Δt0 to determine the degree of time continuity. Calculate according to the following formula: Among them, Et i This represents the deviation of the data acquisition time interval, measured in seconds, expressed by Δt. i The absolute value of the difference between TL and Δt0 is obtained; Δt0 is in seconds, and the ratio between the two is the dimensionless ratio. The current formula is used to evaluate the stability of the sampling rhythm of adjacent trajectory records. The closer the acquisition time interval is to the target sampling period, the higher TL is. i The closer to 1, the greater the risk of transmission interruption, delayed uploading, or abnormal retransmission of the trajectory when the sampling interval deviation is large.

[0023] S104. Perform a consistency check on vehicle speed and driving direction angle. Specifically, first, based on the current driving direction angle recorded in the i-th trajectory and the driving direction angle recorded in the previous trajectory, obtain the actual change in direction angle Δα. i Then, based on the positional changes of adjacent trajectory points and the vehicle speed change trend, the change in the direction angle Δα is obtained to derive the speed. v,i Then, calculate the difference in direction angle between the actual change in direction angle and the velocity-derived change in direction angle, Ea. i The formula is as follows: In the formula, Ea i This represents the difference in the direction angle of the i-th trajectory record, measured in degrees. Furthermore, the degree of consistency in velocity direction, S, is calculated using the following formula. i : Where α0 represents the preset reference value for the direction angle difference, in degrees, preferably 45°; max represents the maximum value function, used to avoid the calculation result being less than 0 when the direction angle difference is too large. The current formula judges the reliability of the velocity direction field by comparing the change in driving direction uploaded by the vehicle terminal with the change in displacement direction calculated from the coordinates of the trajectory points. The more consistent the two are, the more realistic the vehicle trajectory movement trend is; when the difference is too large, there may be terminal direction angle drift, positioning jump point, or trajectory point disorder.

[0024] S105. Analyze the missing fields for vehicle number, longitude, latitude, data collection time, vehicle speed, driving direction angle, road grade, driving risk level, vehicle type, and driving behavior label to obtain the field completeness F. i .

[0025] In the formula, NF i NF0 represents the number of complete fields in the i-th trajectory record, and NF0 represents the total number of fields that should be collected. When longitude, latitude, or collection time is missing, F... i Take 0 directly.

[0026] S106. Weight and fuse the consistency of road network adsorption, temporal continuity, velocity direction consistency, and field completeness to obtain the trajectory validity coefficient of the i-th trajectory record. : Where a1, a2, a3, and a4 are dimensionless weighting coefficients, and a1+a2+a3+a4=1. The current formula unifies spatial positioning reliability, temporal continuity, velocity direction consistency, and field completeness into a single trajectory validity evaluation value for the first screening. Weighted fusion avoids a single field anomaly directly determining the entire result, while also highlighting the impact of road network adhesion and motion consistency on trajectory retrieval reliability through weight settings.

[0027] S107. The trajectory validity coefficient Q of the i-th trajectory is recorded. i The threshold is compared with a preset first admission threshold Q0, which is preferably set to 0.70. When Q... i When Q ≥ 0, the i-th trajectory record is determined to meet the first admission condition, and the trajectory record is regarded as the trajectory record that has passed the first screening and is assigned the first mark; When Q i When Q < 0, the i-th trajectory record is determined not to meet the first admission condition and is therefore removed from the subsequent position grid quantization, time slice quantization, and 64-bit master sorting encoding. Through the first admission threshold comparison process, the calculation result of the trajectory validity coefficient can be clearly transformed into the execution result of "entering subsequent encoding sorting" or "being removed". An example of Example 1 is shown in Table 1 below.

[0028] Table 1: Sample Table for First Screening of Trajectory Validity Ts1 the bus Expressway entrance 6.5 10 0.93 1.00 0.94 Assign the first mark Ts2 ride-hailing School surroundings 18.2 12 0.88 1.00 0.86 Assign the first mark Ts3 truck Urban side roads 42.6 30 0.71 0.90 0.66 Eliminate Ts4 private cars Urban main roads 9.8 9 0.96 1.00 0.95 Assign the first mark Ts5 taxi Surrounding business district 68.4 10 0.52 1.00 0.58 Eliminate Ts6 Hazardous materials vehicles Hazardous materials passage 13.5 11 0.90 1.00 0.89 Assign the first mark Ts7 ordinary trucks Suburban side roads 15.8 14 0.84 1.00 0.82 Assign the first mark Ts8 taxi Transportation hub 11.6 10 0.91 1.00 0.90 Assign the first mark As shown in Table 1, the trajectory validity coefficients of Ts1, Ts2, Ts4, Ts6, Ts7, and Ts8 are all not lower than the preset first admission threshold of 0.70. Therefore, they are assigned the first mark and used as input trajectory records for subsequent location grid quantization, time slice quantization, speed level quantization, and risk level quantization. Although Ts3 has a high degree of field completeness, its road network adsorption offset distance is large and its time interval deviates significantly from the target sampling period, resulting in a trajectory validity coefficient lower than 0.70. Ts5 has a large road network adsorption offset distance and low speed direction consistency, indicating that this trajectory record may have positioning drift or abnormal direction angle. Therefore, Ts3 and Ts5 are removed and do not participate in the subsequent 64-bit main sorting encoding. The technical principle of this embodiment is that vehicle network trajectory retrieval depends not only on latitude, longitude, and time, but also on the reliability of trajectory points. The degree of road network adsorption consistency can reflect whether the positioning point falls within a reasonable road range; the degree of time continuity can reflect whether the trajectory upload is stable; the degree of speed direction consistency can reflect whether the vehicle's movement direction and position change are consistent; and the degree of field completeness can reflect whether the trajectory record has the basic fields required for encoding. Using the trajectory validity coefficient for the first screening allows subsequent coding and sorting to be performed based on valid trajectory records, improving the reliability of the sorting results.

[0029] Example 2 This embodiment corresponds to step two, which involves quantizing and encoding the vehicle network trajectory records that have passed the first screening and bear the first mark. Because areas such as urban commercial districts, school perimeters, expressway entrances, and transportation hubs have high road density, trajectory point density, and historical query activity, using a uniform grid precision could easily lead to coding conflicts in hotspot areas; while using overly fine grids for suburban side roads and low-frequency query areas would result in fragmented coding. Therefore, this embodiment determines the location grid level based on the normalized values ​​of road density, trajectory point density, and historical query activity, and quantifies the collection time, vehicle speed, and driving risk characteristics to generate location grid codes, time slice codes, speed level codes, and risk level codes. The specific steps are as follows: S201. Read the trajectory record with the first tag, obtain the longitude and latitude of the i-th trajectory record, and use the electronic road network matching method to match the trajectory point to the road segment in the electronic road network; within the preset neighborhood of the road segment where the trajectory point is located, calculate the road density, trajectory point density, and historical query popularity, and perform normalization processing on each to obtain the normalized road density value R. ri Normalized value of trajectory point density R ti and the normalized value of historical query popularity R qi .

[0030] Furthermore, a quadtree hierarchical grid coding method is used to determine the location grid level of the i-th trajectory record. The quadtree hierarchical grid coding method involves dividing the target road network area into grids hierarchically. Higher levels result in finer grids and higher location coding accuracy; lower levels result in coarser grids and lower location coding accuracy. Higher location grid levels are used for areas with high road density, high trajectory point density, or high historical query activity; lower location grid levels are used for areas with low road density, low trajectory point density, or low historical query activity.

[0031] S2011. Calculate the position grid level adjustment value for the i-th trajectory record: In the formula, Mi represents the position grid level adjustment value of the i-th trajectory record, which is dimensionless; R ri R represents the normalized road density value within the neighborhood of the road segment containing the i-th trajectory record. It is dimensionless and is obtained by normalizing the ratio between the total length of the road segments and the area of ​​the neighborhood within a preset neighborhood. ti R represents the normalized density of trajectory points within the neighborhood of the road segment containing the i-th trajectory record. It is dimensionless and is obtained by normalizing the ratio of the number of trajectory points in the neighborhood to the area of ​​the neighborhood within a preset time window. qi This represents the normalized historical query popularity value within the neighborhood of the road segment containing the i-th trajectory record. It is dimensionless and is obtained by counting and normalizing the number of times historical query requests hit this neighborhood. μ1, μ2, and μ3 represent weighting coefficients, with preferred values ​​of 0.35, 0.35, and 0.30, respectively, and μ1 + μ2 + μ3 = 1. Higher road density indicates a more complex road structure in the area; higher trajectory point density indicates a denser concentration of vehicle trajectories in the area; and higher historical query popularity indicates that the area is easier to retrieve. By weighting and fusing these three factors, a hierarchical adjustment value reflecting whether the area containing the trajectory point needs a finer grid representation can be obtained.

[0032] S2012, Adjustment value M based on location grid hierarchy i Determine the grid level Lg of the i-th trajectory record. i : In the formula, L0 represents the preset minimum position grid level, a dimensionless integer, preferably 12; L1 represents the preset maximum position grid level, a dimensionless integer, preferably 15; M i This represents the position grid level adjustment value, which is dimensionless. This represents the floor function; adding 1 / 2 is used to achieve rounding to the nearest integer. (M) iMultiplying by the level difference between L1 and L0, the level adjustment value between 0 and 1 is mapped to an adjustable range between the minimum and maximum grid levels, and then an integer level is generated using a floor function. This step explicitly defines the level variation range, enabling higher location coding accuracy in areas with dense roads, dense trajectories, or frequent queries. Furthermore, when the calculated Lg... i When it is less than L0, Lg i Corrected to L0; when the calculated Lg i When it is greater than L1, Lg i Revised to L1.

[0033] S202, Based on the position grid level Lg recorded by the i-th trajectory. i The method maps longitude and latitude to a road network spatial grid to obtain location grid codes. Specifically, it uses a quadtree hierarchical grid mapping method, and the execution process includes determining the target road network boundary, dividing the grid into layers, calculating the row and column numbers of trajectory points, generating quadrant codes layer by layer, and converting quaternary integer codes.

[0034] Define the latitude and longitude boundaries of the target road network region, representing it as a rectangular area bounded by the minimum longitude, maximum longitude, minimum latitude, and maximum latitude. For the i-th trajectory record, its longitude is denoted as λ. i Latitude is denoted as φ i The location grid level is denoted as Lg. i In the Lg i In the layered quadtree mesh, the target road network region is divided into 2 Lg along both the longitude and latitude directions. i Power of 1000 grid cells.

[0035] The i-th trajectory is recorded in the grid column X along the longitude direction. i Obtain it using the following formula: In the formula, λ i λ represents the longitude of the i-th trajectory record, measured in degrees, obtained from positioning data reported by the vehicle positioning terminal or vehicle network platform; λmin represents the minimum longitude of the target road network area, measured in degrees; λmax represents the maximum longitude of the target road network area, measured in degrees. λ represents the floor function. i The dimensions of λmin and λmax are all degrees. Dividing the numerator and denominator yields a dimensionless ratio, which is then multiplied by... The result is still a dimensionless value, which, after being rounded down, yields a dimensionless integer X. i The current formula is used to determine which grid column a trajectory point belongs to in the longitude direction within the target road network area. The closer the longitude is to the eastern side of the target area, the higher the X... iThe larger the x-axis, the closer the longitude is to the west of the target area. i The smaller.

[0036] The i-th trajectory is recorded in the grid row number Y along the latitude direction. i Obtain it using the following formula: In the formula, the latitude φ of the i-th trajectory record i Location data is obtained through vehicle-mounted positioning terminals or vehicle-to-everything (V2X) platforms; φmin represents the minimum latitude of the target road network area, and φmax represents the maximum latitude of the target road network area; the current formula is used to determine which grid row the trajectory point is in along the latitudinal direction of the target road network area. The closer the latitude is to the north of the target area, the higher the Y... i The larger the value; the closer the latitude is to the south of the target area, the greater the value of Y. i The smaller.

[0037] X i and Y i Convert to Lg respectively i A binary number is generated, and the longitude and latitude binary bits are read layer by layer from the most significant bit to the least significant bit. The quadrant code q in the k-th level quadtree is... ik Obtain it using the following formula: In the formula, q ik This represents the quadrant code of the i-th trajectory record in the k-th level quadtree, with a value of 0, 1, 2, or 3; x ik X represents i The k-th binary value takes the value 0 or 1; y ik Y represents i The k-th binary value can be either 0 or 1.

[0038] q ik x ik and y ik All are binary or quadrant numbers, belonging to dimensionless integers. The encoding principle is that each level of the quadtree grid divides the current grid into four sub-grids, x ik Used to indicate whether a trajectory point in this layer is located in the left or right half of the region, y ik This is used to indicate whether a trajectory point in this layer is located in the lower or upper half of the region, via 2y. ik +x ik The corresponding quadrant number of the quadtree can be obtained.

[0039] Based on the quadrant coding q ik Generate position grid code G i : In the formula, q ikq represents the quadrant code of the i-th trajectory record in the k-th level quadtree; Lgi represents the position grid level; k represents the quadtree level index. ik Lg is a dimensionless integer, 4. i -k represents the quaternary bit weight, used to give higher ranking weights to earlier quadrant codes. G i It uses dimensionless integer encoding. The formula combines the quadrant numbers of each level of the quadtree into an integer code in quaternary order. Trajectory points with similar positions usually have the same or similar codes in the first few levels of quadrants, so the generated position grid codes have a spatial proximity clustering effect when sorting.

[0040] Example explanation as follows: Assume the minimum longitude of the target road network area is 116.20°, the maximum longitude is 116.60°, the minimum latitude is 39.70°, and the maximum latitude is 40.10°; the longitude of a certain trajectory point is 116.35°, and the latitude is 39.92°. For ease of explanation, assume the grid level of this trajectory point is 3, then the 3rd grid is divided into 8 grid cells in both the longitude and latitude directions. The grid column number in the longitude direction is: The latitudinal grid row number is: X i =3 converted to 3 bits is 011, Y i =4 converted to 3 bits is 100; reading layer by layer from high to low bits, the quadtree path is 2→1→1, and the corresponding position grid code is: Therefore, the position grid code of this trajectory point in the 3rd layer quadtree grid is 37. In the actual system, if the 14th or 15th layer is used, a higher precision integer code is generated in the same way and displayed in the sample table in the form of G-14-08321, G-15-12877, etc., as shown in Table 2.

[0041] Table 2: Example Table of Quadtree Hierarchical Mesh Mapping Level 1 0 1 2 2nd floor 1 0 1 3rd floor 1 0 1 S203. Perform time slice quantization based on the collection time of the i-th trajectory record. Read the congestion status value of the road segment where the trajectory point is located during the corresponding time period, and determine the time slice length based on the congestion status value; among them, a shorter time slice is used during peak congestion periods, a medium time slice is used during normal periods, and a longer time slice is used during low-traffic periods at night.

[0042] The congestion status value of the road segment corresponding to the i-th trajectory record is calculated using the following formula. : In the formula, Na i This represents the actual vehicle throughput of the road segment within a preset statistical period, measured in vehicles per minute, obtained through roadside detectors, checkpoint equipment, or vehicle-to-everything (V2X) platforms. Na0 represents the reference capacity of the road segment within the same statistical period, also measured in vehicles per minute, obtained through road grade, number of lanes, and historical capacity calibration. min represents the minimum value function, used to limit the congestion status value between 0 and 1. When the actual vehicle throughput is close to or exceeds the reference capacity, it indicates that the road segment is congested or under high load, requiring a shorter time slice to improve the accuracy of accident tracing, congestion analysis, and short-term trajectory retrieval. When the actual vehicle throughput is significantly lower than the reference capacity, a longer time slice can be used to reduce coding fragmentation.

[0043] Record the congestion status value of the corresponding road segment based on the i-th trajectory. The time slice length corresponding to the i-th trajectory record is determined by the following formula. : In the formula, Δτ i The time slice is measured in seconds; 10, 20, and 60 represent preferred time slice lengths in seconds. The time slice length is determined by segmenting congestion status values, allowing for finer time resolution in peak congestion areas and coarser time resolution in low-traffic areas, thus balancing retrieval accuracy and encoding stability.

[0044] Time slice encoding of the i-th trajectory record Obtain it using the following formula: In the formula, t i t0 represents the acquisition time of the i-th trajectory record, in seconds; t0 represents the preset encoding start time, in seconds. This represents the floor function. t i Subtracting t0 from t0 gives the time difference; the time difference is related to Δτ. i The division yields a dimensionless value, which is then rounded down to form the dimensionless integer code C. i The current formula converts continuous acquisition time into discrete time slices, allowing trajectory records from similar acquisition times to cluster in the coding sorting. Using shorter time slices during peak periods improves the accuracy of accident tracing and congestion analysis, while using longer time slices during low-traffic periods reduces coding fragmentation.

[0045] S204. Generate a speed level code based on the vehicle speed recorded in the i-th trajectory. Specifically, the vehicle speed is calculated using the on-board positioning terminal, the vehicle-to-everything (V2X) platform, or the distance and time interval between adjacent trajectory points, and is measured in kilometers per hour.

[0046] When the vehicle speed is 0, the speed level code is taken as the parking level; When the vehicle speed is greater than 0 but not more than 20 km / h, the speed class code is the low speed class. When the vehicle speed is greater than 20 km / h but not more than 60 km / h, the speed rating code is taken as medium speed rating. When the vehicle speed is greater than 60km / h but not more than 100km / h, the speed class code is taken as the highway class; When the vehicle speed is greater than 100km / h, the speed level code is set to the abnormal high speed level.

[0047] Speed ​​rating codes are determined according to the following formula: In the formula, V i The velocity level code for the i-th trajectory record is a dimensionless integer; v i Let v represent the vehicle speed recorded in the i-th trajectory, in kilometers per hour. i The dimension of V is kilometers per hour; the speed thresholds of 20, 60, and 100 all correspond to units of kilometers per hour. i This is a classification code, belonging to dimensionless integers. By using speed thresholds to convert continuous vehicle speeds into discrete speed levels, it allows for differentiation between stopped, low-speed congestion, medium-speed traffic, high-speed driving, and abnormally high-speed conditions in the subsequent 64-bit master sorting code, thereby improving the efficiency of retrieving trajectory records by traffic condition.

[0048] S205. Generate a risk level code based on driving risk characteristics. Specifically, driving risk characteristics include the number of rapid accelerations, rapid decelerations, abnormal lane deviations, suspected wrong-way driving markers, and short-term frequent lane change markers. The number of rapid accelerations, rapid decelerations, and abnormal lane deviations are statistically obtained through the vehicle-to-everything (V2X) platform within a preset time window; suspected wrong-way driving markers are determined by the angle between the vehicle's driving direction angle and the permissible direction of travel on the road; short-term frequent lane change markers are determined by the number of changes in the vehicle's lane number or lateral position on the road within a preset time window.

[0049] Calculate the driving risk feature value of the i-th trajectory record. : In the formula, P i Aa represents the dimensionless driving risk characteristic value of the i-th trajectory record; iAa0 represents the number of rapid accelerations within a preset time window, measured in units of 1; Aa0 represents the reference number of rapid accelerations, measured in units of 1, with 3 being the preferred value; Ba i Ba0 represents the number of rapid decelerations within a preset time window, measured in units of 1000; Ba0 represents the reference number of rapid decelerations, measured in units of 1000, preferably 3000; E i E0 represents the number of abnormal yawings within a preset time window, measured in units of times; E0 represents the reference number of abnormal yawings, measured in units of times, preferably 2 times; U i Z represents a suspected retrograde marker, dimensionless, set to 1 if a suspected retrograde exists, and 0 otherwise; i The first indicator, d1, represents frequent lane changes in a short period of time. It is dimensionless and takes the value 1 when frequent lane changes occur, otherwise it takes the value 0. The second indicator, d5, represents risk weighting coefficients, also dimensionless, with preferred values ​​of 0.20, 0.25, 0.20, 0.20, and 0.15, respectively. The formula is based on the principle that sudden deceleration, abnormal yaw, suspected wrong-way driving, and frequent lane changes in a short period of time are all directly related to driving risk or traffic anomalies. By normalizing and weighting different risk behaviors, various discrete driving behaviors are transformed into a unified driving risk feature value, providing a quantitative basis for risk level coding.

[0050] Furthermore, the risk level code Rk i Determined according to the following formula: In the formula, Rk i P represents the risk level code for the i-th trajectory record, a dimensionless integer; i This represents the dimensionless characteristic value of driving risk. Through threshold segmentation, continuous driving risk characteristic values ​​are converted into four categories of codes: normal driving (0), risk of concern (1), abnormal risk (2), and high-risk risk (3). This allows the risk level code to participate in the subsequent 64-bit master sorting code, achieving continuous arrangement of trajectory records for similar areas, similar times, and similar risk states.

[0051] The trajectory quantization coding samples of this embodiment are shown in Tables 3 and 4. Table 3 displays the spatial quantization coding parameters of the trajectories that passed the first screening, and Table 4 displays the time, speed, and risk quantization coding parameters of the trajectories that passed the first screening. Tables 3 and 4 only include Ts1, Ts2, Ts4, Ts6, Ts7, and Ts8, which have been assigned the first label in Table 1. Ts3 and Ts5 have been removed and are not included in the quantization coding samples. The position grid coding and time slice coding in the tables are displayed in a "hierarchy-serial number" format for ease of reading, and their corresponding internal database values ​​are all dimensionless integer codes.

[0052] Table 3: Spatial Quantization Encoding Sample Table of Trajectories Selected Through the First Screening Ts1 Expressway entrance 0.62 0.74 0.68 0.68 14 G-14-08321 Ts2 School surroundings 0.88 0.91 0.86 0.89 15 G-15-12877 Ts4 Urban main roads 0.54 0.59 0.50 0.54 14 G-14-08329 Ts6 Hazardous materials passage 0.76 0.70 0.82 0.76 15 G-15-12904 Ts7 Suburban side roads 0.18 0.22 0.16 0.19 12 G-12-02116 Ts8 Transportation hub 0.92 0.87 0.90 0.90 15 G-15-13102 Table 4: Sample table of time, speed and risk quantification coding of the first screening trajectory Ts1 0.78 10 C-32405 82 High-speed level 0.42 Pay attention to risks Ts2 0.72 10 C-32408 18 Low speed level 0.61 Abnormal risks Ts4 0.48 20 C-16204 46 Medium speed level 0.18 Normal driving Ts6 0.81 10 C-32409 55 Medium speed level 0.82 High risk Ts7 0.20 60 C-5401 44 Medium speed level 0.12 Normal driving Ts8 0.88 10 C-32410 12 Low speed level 0.36 Pay attention to risks As shown in Table 3, Ts2 and Ts8 are located near a school and a transportation hub, respectively. Both have high normalized values ​​for road density, trajectory point density, and historical query popularity. Therefore, a location grid level of 15 is chosen to encode trajectory points in hotspot areas with higher spatial precision. Ts7 is located on a suburban side road, with low road density, trajectory point density, and historical query popularity. Therefore, a location grid level of 12 is chosen to reduce coding fragmentation in low-frequency areas.

[0053] As shown in Table 4, Ts1, Ts2, Ts6, and Ts8 all correspond to high congestion status values, therefore a 10-second time slice is used to improve the accuracy of trajectory retrieval during peak congestion or in key areas. Ts7 corresponds to a lower congestion status value, therefore a 60-second time slice is used to reduce the fragmentation of low-frequency trajectory data encoding. Ts6, with a risk characteristic value of 0.82, is quantified as a high-risk level and can be clearly distinguished from other ordinary trajectory records in the subsequent 64-bit master sorting encoding.

[0054] The technical principle of this embodiment lies in the fact that vehicle network trajectory sorting needs to express not only spatial location, but also temporal proximity, speed status, and driving risk status simultaneously. Through a quadtree hierarchical grid coding method, road density, trajectory point density, and historical query popularity are combined at the location grid level, allowing hotspot areas to use finer grids and low-frequency areas to use coarser grids. By segmenting the time slice length, high-congestion areas achieve finer temporal resolution. Speed ​​level coding and risk level coding enable vehicle motion status and abnormal risk status to participate in subsequent 64-bit master sorting coding. The beneficial effect of this embodiment is that it reduces coding conflicts in hotspot areas and fragmentation in low-frequency areas caused by using fixed spatial grids and fixed time slices for the entire vehicle network trajectory. By generating location grid coding, time slice coding, speed level coding, and risk level coding, trajectory records in the same area, with similar times, similar speed levels, and similar driving risk levels have a continuous arrangement basis in subsequent database sorting, thus providing accurate quantitative input for the generation of 64-bit master sorting coding and string-extended sorting coding.

[0055] Example 3 This embodiment corresponds to step three, specifically explaining how to generate a 64-bit master sorting code based on the location grid code, time slice code, speed level code, and risk level code obtained in embodiment two. This embodiment is still applied to the aforementioned city-level vehicle network trajectory retrieval platform, and the processing objects are Ts1, Ts2, Ts4, Ts6, Ts7, and Ts8 in Table 1 that passed the first screening and completed quantization coding in embodiment two. Ts3 and Ts5 were removed in embodiment one and do not participate in the generation of the 64-bit master sorting code in this embodiment.

[0056] S301. Statistical historical query requests, obtain the dimension query frequency values ​​Fa for location, time, speed, and driving risk dimensions respectively. d Specifically, within a preset historical statistical period, the total number of historical query requests received by the vehicle network trajectory retrieval platform is read, and the number of query requests including location range conditions, time range conditions, speed level conditions, and driving risk level conditions are counted separately. The ratio of the number of times each dimension appears as a query condition to the total number of historical query requests is calculated to obtain the dimension query frequency value Fa for the corresponding dimension. d The query frequency value for the location dimension is obtained by the ratio of the number of query requests containing the target area range, road range, or spatial grid range to the total number of historical query requests; the query frequency value for the time dimension is obtained by the ratio of the number of query requests containing the target time range or time slice range to the total number of historical query requests; the query frequency value for the speed dimension is obtained by the ratio of the number of query requests containing speed level constraints to the total number of historical query requests; and the query frequency value for the driving risk dimension is obtained by the ratio of the number of query requests containing risk level constraints or driving behavior risk constraints to the total number of historical query requests.

[0057] It should be noted that the normalized value R of historical query popularity in Example 2 qi The region query popularity used to characterize the neighborhood of the road segment where the i-th trajectory record is located is the statistical object of the road segment neighborhood; the dimension query frequency value Fa in this step d It is used to characterize the frequency with which a certain dimension is used as a query condition in historical query requests, and its statistical object is the query dimension.

[0058] S302. Count the number of different quantization values ​​for each dimension within the current encoding cycle, and calculate the dimension dispersion value Da. d Specifically, within the current encoding cycle, the trajectory records in Table 1 that have passed the first screening and been assigned the first label are read, and the number of different values ​​for location grid encoding, time slice encoding, velocity level encoding, and risk level encoding are counted respectively. The ratio of the number of different quantization values ​​for each dimension to the total number of trajectory records participating in encoding within the current encoding cycle is calculated to obtain the dimensional dispersion value Da for the corresponding dimension.d The dispersion value of the location dimension is obtained by the ratio of the number of grid codes at different locations to the total number of trajectory records involved in the encoding; the dispersion value of the time dimension is obtained by the ratio of the number of codes at different time slices to the total number of trajectory records involved in the encoding; the dispersion value of the speed dimension is obtained by the ratio of the number of codes at different speed levels to the total number of trajectory records involved in the encoding; and the dispersion value of the driving risk dimension is obtained by the ratio of the number of codes at different risk levels to the total number of trajectory records involved in the encoding. A higher dispersion value indicates a more dispersed distribution of values ​​within the current encoding period, requiring more encoding bits to distinguish different values; a lower dispersion value indicates a more concentrated distribution of values ​​within the dimension, allowing for a smaller allocation of encoding bits. In this way, the bit width allocation of the 64-bit master sorting code can simultaneously consider historical query needs and the current trajectory data distribution.

[0059] S303, Calculate the dimension query frequency value Fa d and the degree of dispersion of dimensions Da d We perform weighted fusion to obtain the encoding weight coefficients for the d-th dimension: Where b1 and b2 are weight coefficients, and the weight is the mean; the current formula unifies the query usage frequency and data dispersion as the basis for bit width allocation, so that 64-bit encoding resources are preferentially allocated to high-frequency and high-dispersion value dimensions, thereby improving the adaptability of the main sorting code to actual retrieval needs.

[0060] S305. Determine the position grid encoding bit width B based on the weighting coefficients assigned to each dimension. g Time slice coding bit width B Ts Speed ​​level coding bit width B v Risk level coding bit width B r Specifically, first calculate the universal coding bit width B of the d-th dimension. d When the d-th dimension is a position dimension, B d Corresponding to B g When the d-th dimension is the time dimension, B d Corresponding to B t When the d-th dimension is the velocity dimension, B d Corresponding to B v When the d-th dimension is the driving risk dimension, B d Corresponding to B r ; In this embodiment, the position grid encoding bit width B g The preferred bit width is 30, with a time slice coding bit width of B. t The preferred bit width is 20, and the speed level encoding bit width is B. v The preferred value is 4 bits, with a risk level coding width of B.r Ideally, 4 bits should be used, with 2 bits reserved for version marking or extended marking, so that the total bit width does not exceed 64 bits.

[0061] Dimensional explanation: B d d represents the encoding bit width for the d-th dimension, a dimensionless integer; 64 represents the total bit width of a 64-bit integer, calculated and rounded down to obtain the encoding bit width. The current formula allocates the 64-bit encoding space to different dimensions based on their weights. Dimensions with higher weights receive more bit width, representing more quantized values; this bit width allocation balances spatial precision, temporal precision, and risk ranking capability within a fixed 64-bit capacity.

[0062] S306. Encode the position grid according to the field order G i Time slice coding C i Speed ​​level code V i and risk level code Rk i The combination is a 64-bit master sort code K. i : Among them, B t B v and B r The bit width is dimensionless; the left shift operation only changes the position of the integer encoding field and does not introduce physical dimensions. The current formula embeds the position, time, speed, and risk fields into the same 64-bit integer through displacement operations. The position and time fields are in the high bits, so that trajectory records in the same area and at similar times are preferentially clustered in the database index; the speed and risk fields are in the low bits, so that records within the same spatiotemporal range are further sorted according to vehicle status and driving risk. Examples of Implementation Example 3 are shown in Tables 5 and 6 below.

[0063] Table 5: Sample table of bit width configurations for the first filtered trajectory Ts1 30 20 4 4 Ts2 30 20 4 4 Ts4 30 20 4 4 Ts6 30 20 4 4 Ts7 30 20 4 4 Ts8 30 20 4 4 Table 6: Sample table of 64-bit master sort codes of the first screening trajectory Ts1 08321 32405 3 1 K-08321-32405-3-1 Ts2 12877 32408 1 2 K-12877-32408-1-2 Ts4 08329 16204 2 0 K-08329-16204-2-0 Ts6 12904 32409 2 3 K-12904-32409-2-3 Ts7 02116 05401 2 0 K-02116-05401-2-0 Ts8 13102 32410 1 1 K-13102-32410-1-1 Table 5 confirms the bit width of the location, time, speed, and risk fields used for each sample. The location grid code, time slice code, speed level code, and risk level code in Table 6 all follow the quantization results of Example 2. Specifically, in the speed level code, parking level is 0, low speed level is 1, medium speed level is 2, high speed level is 3, and abnormal high speed level is 4. In the risk level code, normal driving is 0, concern risk is 1, abnormal risk is 2, and high risk is 3. Therefore, the 64-bit master sort code in Table 6 is consistent with the quantization results of Tables 3 and 4.

[0064] The technical principle of this embodiment lies in the fact that the 64-bit master sorting code uses a one-dimensional integer index to represent four dimensions: space, time, speed, and risk. By allocating high-frequency query dimensions and highly discrete dimensions to higher bit widths and higher field positions, approximate multidimensional clustered sorting can be achieved in a regular database integer index without the need to build an additional complex spatial index structure.

[0065] Example 4 This embodiment corresponds to step four, specifically explaining the process of determining the primary code conflict density and generating the string extended sorting code. The application scenario for this embodiment is high-density areas such as school entrances, expressway ramps, and transportation hubs. These areas may have a large number of vehicles within the same location grid and the same time slice. If only the 64-bit primary sorting code is relied upon, multiple trajectory records may have the same primary sorting code, leading to sorting conflicts. Therefore, this embodiment generates a string extended sorting code for secondary sorting when the primary code conflict density is high.

[0066] S401, Statistics show that they have the same 64-bit primary sort code K i Number of trajectory records N i And calculate the main coding collision density coefficient D based on the preset number of same code references N0. i : Where, N i Both N0 and N0 represent the number of trajectory records, expressed in records. Dividing them yields a dimensionless ratio. The preset reference number for identical codes, N0, is 30 records. The current formula determines whether to expand the sorting based on the crowding level of records under the same primary sorting code. The more records with identical codes, the more severe the primary code conflict. S402, Set the main coding collision density coefficient D i Compared with a preset conflict density threshold D0, the preset conflict density threshold D0 is preferably set to 0.70. When D... i When D0 is greater than or equal to D0, a sorting conflict is determined to exist under the corresponding 64-bit primary sorting code, and an extended sorting code Ext is generated. i When D i If the value is less than D0, but the current query request contains at least one of the extended query conditions: road class, driving direction angle, vehicle type, or driving behavior label, then an extended sort code Ext is also generated. i When Di is less than D0 and the current query request does not contain extended query conditions, no string extended sort code is generated.

[0067] Based on the above judgment, the string extended sorting code is generated only when the main code conflict is high or the query conditions require more fine distinction, thereby reducing the increase in index storage burden caused by generating extended strings for all trajectory records.

[0068] S403. Generate the extended road level segment Erdi based on the road level rdi. Specifically, read the road level rd of the matching road segment from the i-th trajectory record. i The road is then converted into a fixed-length road grade extension segment Erdi according to a preset road grade coding table. The road grades include expressways, urban expressways, arterial roads, secondary arterial roads, local roads, park roads, parking lot roads, and hazardous chemical transport lanes; each road grade corresponds to a fixed-length string code.

[0069] For example, highways correspond to R01, urban expressways to R02, arterial roads to R03, secondary arterial roads to R04, local roads to R05, industrial park roads to R06, parking lot roads to R07, and hazardous materials access roads to R08. The above encoding is only used for string expansion sorting and does not change the position grid encoding in Example 2 or the 64-bit main sorting encoding in Example 3.

[0070] S404. Generate the direction angle extension segment Ediri based on the driving direction angle αi. Specifically, the driving direction angle from 0° to 360° is divided into several direction sectors, and each direction sector corresponds to a fixed-length direction angle extension segment. In this embodiment, it is preferable to divide 0° to 360° into 16 direction sectors, and the angle width of each direction sector is 22.5°; when higher direction accuracy is required, it can be divided into 32 direction sectors.

[0071] Directional sector number O i Determined according to the following formula: ; In the formula, O i αi represents the direction sector number corresponding to the i-th trajectory record, a dimensionless integer; αi represents the driving direction angle of the i-th trajectory record, in degrees; 22.5 represents the angular width of each direction sector, in degrees. This represents the floor function. Directional sector numbers are used to convert consecutive driving direction angles into a finite number of direction categories, allowing trajectory records within the same driving direction range to form similar sorting results in the string extended sorting code. For example, vehicles with similar direction angles can be further distinguished according to driving direction category under the same main sorting code, which is beneficial for differentiating trajectory records of vehicles traveling in opposite directions, turning, or yawing within the same area and at the same time.

[0072] 405. Based on vehicle type i Generate vehicle type extension segment Etype i Specifically, read the vehicle type corresponding to the i-th trajectory record. i And generate a fixed-length vehicle type extension segment Etype according to the preset vehicle type coding table. iThe vehicle types include private cars, taxis, ride-hailing vehicles, buses, ordinary trucks, hazardous chemical transport vehicles, emergency vehicles, and other vehicles; each vehicle type corresponds to a fixed-length string encoding.

[0073] For example, private cars correspond to T01, taxis to T02, ride-hailing vehicles to T03, buses to T04, ordinary trucks to T05, hazardous chemical vehicles to T06, emergency vehicles to T07, and other vehicles to T08. The vehicle type extension segment is used to further distinguish different vehicle categories under the same 64-bit main sorting code, improving the stability of key vehicle trajectory retrieval and secondary sorting of trajectories with the same code.

[0074] S406, based on driving behavior tags (bh) i Generate driving behavior extension segment Ebh i Specifically, read the driving behavior label bh corresponding to the i-th trajectory record. i And generate the extended segment Ebh of driving behavior according to the preset driving behavior coding table. i Driving behavior tags include smooth driving, rapid acceleration, rapid deceleration, stop-and-go driving, slow crawling, abnormal veergence, and suspected wrong-way driving.

[0075] For example, smooth driving corresponds to B01, rapid acceleration corresponds to B02, rapid deceleration corresponds to B03, stopping and starting corresponds to B04, low-speed crawling corresponds to B05, abnormal yaw corresponds to B06, and suspected wrong-way driving corresponds to B07. If multiple driving behavior labels exist within the same trajectory segment, a behavior label sequence is generated according to the chronological order of the behavior occurrence, and this behavior label sequence is used as the driving behavior extension segment Ebh. i If there is no abnormal driving behavior, then the smooth driving code is used as the extended segment of driving behavior.

[0076] S407, expanded section Erd according to road classification i , Direction angle extension segment Edir i Vehicle type extension segment Etype i and driving behavior extension segment Ebh i The order of generating strings extended sort encoding Ext i The formula is as follows: Here, || represents a string concatenation operation that does not change the encoded units. The current formula unifies road grade, direction angle, vehicle type, and driving behavior label information into an extended sorting key, enabling the database to perform secondary sorting through lexicographical order when the 64-bit primary codes are the same or the query conditions are more refined. An example of Example 4 is shown in Table 7 below.

[0077] Table 7: Sample Table of Main Encoding Conflicts and String Extension Sorting Encoding Ts1 K-08321-32405-3-1 18 0.60 Urban expressway Northeast the bus Smooth driving No generation Ts2 K-12877-32408-1-2 38 1.00 branch road Northeast ride-hailing Rapid deceleration Generate extended encoding Ts4 K-08329-16204-2-0 8 0.27 Main road West private cars Smooth driving No generation Ts6 K-12904-32409-2-3 24 0.80 Hazardous materials passage South Hazardous materials vehicles abnormal yaw Generate extended encoding Ts7 K-02116-05401-2-0 5 0.17 branch road North ordinary trucks Smooth driving No generation Ts8 K-13102-32410-1-1 32 1.00 Urban expressway East taxi slow crawling Generate extended encoding As shown in Table 7, the main code conflict density coefficients corresponding to Ts2, Ts6, and Ts8 are 1.00, 0.80, and 1.00, respectively, all of which are not lower than the preset conflict density threshold of 0.70. Therefore, string extended sorting codes are generated. The number of records with the same code corresponding to Ts1, Ts4, and Ts7 is relatively small, the main code conflict density coefficient is lower than 0.70, and the extended query condition is not triggered. Therefore, string extended sorting codes are not generated. The above samples are all trajectory records that have been assigned the first mark in Table 1. Ts3 and Ts5, which were removed, did not enter the main code conflict judgment and extended code generation process of this embodiment.

[0078] The technical principle of this embodiment is that while 64-bit master sorting codes are suitable for expressing core dimensions such as location, time, speed, and risk, in high-density sub-areas such as school perimeters, expressway entrances, hazardous materials transport lanes, and transportation hubs, a large number of trajectory records may still cluster under the same master sorting code. This embodiment determines whether string extended sorting codes need to be enabled by using the master code conflict density coefficient, and performs secondary sorting using road grade, direction angle, vehicle type, and driving behavior labels. Without increasing the complexity of spatial indexing, this improves the distinguishability and sorting stability of trajectory records with the same code.

[0079] Example 5 This embodiment corresponds to step five, specifically explaining how the trajectory query request is converted into multiple 64-bit primary sorting code candidate intervals, and a second filtering is performed based on the query hit fit coefficient. The application scenario of this embodiment is for traffic management personnel to query "vehicle trajectories within 500m of an accident intersection, between 08:00 and 08:10, exhibiting abnormal risks or sudden deceleration behavior." Directly scanning all vehicle trajectories within this time period would generate a large number of irrelevant reads; therefore, it is necessary to convert the query request into multiple code candidate intervals and eliminate candidate intervals with low hit probability.

[0080] S501. Receive trajectory query request and parse the target area range A of the q-th trajectory query request. q Target time range T q Speed ​​level constraint V q Driving risk level constraints R q and extended query conditions E q The target area can be represented by a rectangle, a polygon, or a road buffer zone; the target time range can be represented by the start and end times; extended query criteria include at least one of the following: road class, driving direction angle range, vehicle type, and driving behavior label.

[0081] S502, Target area range A q Convert the target location grid range into several target time ranges, and convert the target time range T.q Convert to several target time slice ranges, and constrain the velocity level V. q Convert to the target speed level range, and constrain the driving risk level R. q Convert to the target risk level range.

[0082] S503. Based on the field width and field order in the 64-bit master sorting code, the target location grid range, target time slice range, target velocity level range, and target risk level range are combined into multiple 64-bit master sorting code candidate intervals. Each candidate interval includes the candidate interval starting code K. start,m and candidate interval termination code K end,m .

[0083] Calculate the degree of grid overlap P corresponding to the m-th 64-bit master sorting candidate interval. m The degree of overlap of the location grid is calculated according to the following formula: Among them, P m It is a dimensionless value; and Both are measured in square meters, and dividing them yields the dimensionless degree of overlap. The current formula determines the spatial hit probability of a candidate interval by the overlap area between the spatial grid corresponding to the candidate interval and the target region. The larger the overlap area, the more likely the encoded interval is to contain trajectory records within the target region.

[0084] S505. Calculate the time slice overlap T corresponding to the m-th 64-bit master sorting code candidate interval. m The degree of time slice overlap is calculated using the following formula: Among them, T m Time(τ) is a dimensionless value. m ∩T q ) and Time(T q The units of measurement are seconds or minutes; dividing the two yields the dimensionless overlap. The current formula determines the probability of a time match by the overlap duration between the candidate interval's corresponding time slice and the target time range. The longer the overlap duration, the more necessary it is for the candidate interval to participate in the scan; intervals with insufficient overlap can be eliminated before scanning.

[0085] S506. Calculate the speed risk matching degree B corresponding to the m-th candidate interval. m The degree of speed-risk matching is determined by whether the speed level coding range and risk level coding range in the candidate interval meet the query constraints.

[0086] S507. Calculate the extended conditional matching degree E corresponding to the m-th candidate interval. mIf the query request includes road grade, direction angle, vehicle type, or driving behavior label conditions, then E is calculated based on the prefix matching of the string extended sorting encoding. m If the query request does not contain extended query conditions, then E m Take 1.

[0087] S508. Weighted fusion of location grid overlap, time slice overlap, velocity risk matching, and extended condition matching yields the query hit fit coefficient: Where c1, c2, c3, and c4 are dimensionless weighting coefficients, and c1 + c2 + c3 + c4 = 1, therefore H m This is the dimensionless query hit fit coefficient. The current formula unifies spatial hit, temporal hit, velocity risk constraint, and expansion condition matching into a candidate interval evaluation value for secondary screening. This evaluation allows for the elimination of low-probability coding intervals before database scanning, thereby reducing invalid reads.

[0088] S509, Query the hit fit coefficient H m The result is compared with a preset hit-fit threshold H0. In this embodiment, H0 is preferably set to 0.65. When H... m When H ≥ H0, the m-th candidate interval is selected as a 64-bit main sorting code candidate interval that passes the second screening, and is assigned a second label; when H m When <H0, the m-th candidate interval is removed and does not participate in the database scan. Example of Example 5 is shown in Table 8 below.

[0089] Table 8: Sample Table for Second Filtering of Candidate Intervals m1 0.92 0.85 1.00 0.90 0.91 Assign a second mark m2 0.76 0.80 1.00 0.80 0.83 Assign a second mark m3 0.68 0.72 0.90 0.85 0.77 Assign a second mark m4 0.35 0.60 0.80 0.40 0.52 Eliminate m5 0.81 0.66 0.90 0.70 0.77 Assign a second mark m6 0.28 0.42 0.60 0.50 0.44 Eliminate As shown in Table 7, the query hit fit coefficients of m1, m2, m3, and m5 are not lower than 0.65, therefore they are assigned a second label and participate in the database scan. Although m4 and m6 may partially approach the query conditions in a single dimension, their overall hit fit is insufficient, so they are eliminated. The technical principle of this embodiment is that after a multi-dimensional range query is converted into a one-dimensional encoding interval, multiple candidate intervals may be generated, some of which only overlap with the target region or target time. By using the query hit fit coefficient for the second screening, encoding intervals with low hit probability can be eliminated before scanning, reducing invalid database reads.

[0090] Example 6 This embodiment corresponds to step six and is still applied to the aforementioned city-level vehicle network trajectory retrieval platform. Specifically, in accident tracing and key vehicle trajectory playback requests, only the 64-bit primary sorting code candidate intervals with the second tag are scanned, and the final trajectory retrieval sorting result is generated based on the string extended sorting code. Traffic management personnel on the same platform not only need to find vehicles in the target area and within the target time, but also need to arrange trajectory records from the same area, similar time, similar risk level, and with the same behavioral tags adjacently to facilitate rapid review of vehicle operating status before and after an accident. Here, q represents the query request sequence number, and m represents the candidate interval sequence number generated by the q-th query request.

[0091] S601. Read the 64-bit main sorting code candidate interval with the second tag under the q-th trajectory query request, and sort it according to the candidate interval starting code K. start,q,m and candidate interval termination code K end,q,m Perform a range scan in the database. For candidate intervals without a second marker under the q-th trajectory query request, do not perform a database scan. By only scanning candidate intervals with a second marker, the number of reads of 64-bit master sorted encoded intervals with low hit probability can be reduced.

[0092] S602. Review and filter the scanned trajectory records. Specifically, based on the target area A of the q-th trajectory query request. q Target time range T q Speed ​​level constraint V q and driving risk level constraints R q The trajectory records obtained from the scan are reviewed and judged. If the trajectory record meets the constraints of target area range, target time range, speed level and driving risk level, the trajectory record is retained; otherwise, the trajectory record is discarded as a wrong hit record of the coding boundary.

[0093] The verification filter is used to remove false hit records caused by spatial grid quantization, time slice quantization or candidate interval boundary expansion, so that the trajectory records that are finally sorted are consistent with the actual retrieval conditions of the q-th trajectory query request.

[0094] S603. The track records after review and filtering are encoded using a 64-bit primary sorting code K. i The first sorting is performed from smallest to largest. This first sorting forms a main sorting sequence based on location grid encoding, time slice encoding, speed level encoding, and risk level encoding, thus ensuring that trajectory records from the same area, at similar times, at similar speed levels, and at similar driving risk levels are arranged adjacently in the sorting results.

[0095] S604. When multiple trajectory records have the same 64-bit master sort code K iWhen this occurs, determine if it contains the string extended sort code Ext. i If a string extended sorting encoding Ext exists i If no string extended sort code Ext exists, then a second sort is performed according to the lexicographical order of the Ext string; if no string extended sort code Ext exists... i If so, the first sorting result based on the 64-bit master sort code Ki is maintained.

[0096] S605. When multiple trajectory records have the same 64-bit primary sort code Ki and the same string extended sort code Exti, they are stably sorted according to the acquisition time ti and vehicle number IDi to form the final sorting key: In the formula, Sort i K represents the composite sorting key of the i-th trajectory record, which has no physical quantity; i represents the 64-bit primary sort code of the i-th trajectory record, which is a dimensionless integer code; Exti represents the string extended sort code of the i-th trajectory record; t i This represents the acquisition time of the i-th trajectory record, converted into a comparable value in the sorting key according to a uniform timestamp format; ID i This represents the vehicle number corresponding to the i-th trajectory record. The current formula uses a 64-bit primary sorting code as the first sorting criterion and a string extended sorting code as the second sorting criterion for records with the same code. When both the 64-bit primary sorting code and the string extended sorting code are the same, stable sorting is further ensured by the acquisition time and vehicle number. This sorting method eliminates the use of trajectory residual compensation segments, avoiding the additional computational complexity introduced by residual parameters and ensuring stable sorting results for trajectory records with the same code across different retrieval batches.

[0097] S606. Calculate the scan saving rate to evaluate the effectiveness of the present invention in reducing invalid scans. For the q-th trajectory query request, the scan saving rate η is... q Calculate according to the following formula: ; In the formula, M all,q M represents the number of trajectory records that need to be read when directly scanning according to the target time range Tq, in units of records; hit,q This represents the actual number of trajectory records read when only candidate intervals with the second marker are scanned, expressed in records. The current formula characterizes the reduction in database scans achieved through candidate interval filtering. η q The larger η is, the more irrelevant trajectory records are skipped in the q-th trajectory query request, and the fewer invalid reads are made in the range query; q The smaller the value, the closer the target query condition is to the coverage of the candidate interval, and the fewer irrelevant records can be skipped.

[0098] S607. Output the trajectory retrieval and sorting results. The trajectory retrieval and sorting results include vehicle number, longitude, latitude, collection time, vehicle speed, driving direction angle, road grade, driving risk level, vehicle type, driving behavior label, 64-bit main sorting code, string extended sorting code, and sorting sequence number. Example implementation is shown in Table 9 below.

[0099] Table 9: Sample Table of Secondary Sorting Output of Hit Trajectory 1 Guangdong A***1 K-12877-32408-1-2 R05-D03-T03-B03 low speed Abnormal risks Rapid deceleration The primary codes are the same, but the extended codes come first. 2 Guangdong A***5 K-12877-32408-1-2 R05-D03-T03-B05 low speed Abnormal risks slow crawling Sort by driving behavior label under the same main code 3 Guangdong A***9 K-12877-32408-1-2 R03-D04-T01-B04 low speed Abnormal risks Parking and starting Roads of different grades are sorted twice by extended code. 4 Guangdong B***0 K-12904-32409-2-3 R08-D08-T06-B06 medium speed High risk abnormal yaw After the main codes are aggregated, they are sorted by extended codes. 5 Guangdong A***8 K-13102-32410-1-1 R02-D02-T02-B05 low speed Pay attention to risks slow crawling Adjacent time slice output As shown in Table 9, for multiple trajectory records with the same 64-bit primary sorting code, a secondary sorting can be performed by using string extended sorting code according to road level, direction angle, vehicle type, and driving behavior label; when both the 64-bit primary sorting code and the string extended sorting code are the same, a stable sorting is then performed according to the collection time and vehicle number.

[0100] As shown in Table 9, for multiple trajectory records with the same primary sorting code, secondary sorting can be achieved by extending the sorting code with strings according to road level, direction angle, vehicle type and driving behavior label; for trajectory records with no obvious primary code conflict, the primary sorting code is directly output.

[0101] The technical principle of this embodiment lies in the fact that the 64-bit primary sorting code is responsible for clustering trajectory records with similar spatial, temporal, speed, and risk levels in the database; the string extended sorting code is responsible for secondary sorting when there are conflicts in the primary code or when there are fine-grained query conditions; through candidate interval filtering and hit segment scanning, this invention can reduce the reading of trajectory records with irrelevant time periods, irrelevant areas, and irrelevant risk levels, and achieve multi-dimensional sorting and retrieval of vehicle network trajectory data without building a complex spatial index. Therefore, this invention can achieve joint sorting of vehicle network trajectory data according to space, time, speed, and risk level under the conditions of ordinary integer index and string lexicographical index, and compensate through string extended coding when high-precision retrieval is required. It is suitable for application scenarios such as urban traffic operation analysis, accident tracing, key vehicle monitoring, abnormal driving behavior retrieval, and road congestion review.

[0102] It should be noted that all calculation formulas in this application employ regression analysis, including but not limited to machine learning algorithms, to deeply analyze the collected parameters and identify their natural trends and interrelationships. Specialized software, such as Python's Scikit-learn library or the R language, is used to automatically generate mathematical models that match the data. Then, cross-validation and other methods are used to objectively evaluate the model performance, and continuous feedback and optimization are combined to ensure that the created formulas truly reflect the inherent laws of the data, thereby guaranteeing their effectiveness and accuracy. In all calculation formulas in this application, the parameters in each formula undergo dimensionless processing within a consistent range to ensure that different physical quantities are compared on the same scale; dimensionless processing techniques include, but are not limited to, min-max-normalization and Z-score standardization. The algorithm of this invention is implemented as a Python script. Before executing the core logic, the program first executes a data loading module (e.g., using the widely used pandas library in Python) configured to read the aforementioned spreadsheet file and load its contents into the program's working memory (e.g., a DataFrame data structure). Subsequent algorithm steps will directly query and retrieve the required configuration parameters from this in-memory data structure.

[0103] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A multidimensional sorting and string-extended multidimensional sorting optimization method based on 64-bit integer encoding, characterized in that, The specific steps include: Acquire vehicle network trajectory data, which includes vehicle number, longitude, latitude, collection time, vehicle speed, driving direction angle, road grade, driving risk level, vehicle type, and driving behavior label; The vehicle network trajectory data is filtered for trajectory validity, trajectory records that do not meet the first admission condition are removed, and trajectory records that meet the first admission condition are assigned a first tag; The trajectory record with the first mark is subjected to position quantization, time quantization, speed quantization and driving risk quantization to obtain position grid code, time slice code, speed level code and risk level code respectively; A 64-bit master sorting code is generated based on the location grid code, the time slice code, the speed level code, and the risk level code. The 64-bit master sorting code is combined according to the field order of the location grid code, the time slice code, the speed level code, and the risk level code, so that trajectory records with the same location grid code and the same time slice code are in the same continuous coding segment when arranged in ascending order according to the 64-bit master sorting code, and the trajectory records within the same continuous coding segment are further sorted according to the speed level code and the risk level code. The number of trajectory records with the same 64-bit primary sorting code is counted, the primary code conflict density coefficient is obtained, and when the primary code conflict density coefficient meets the preset conflict condition, or when the trajectory query request contains extended query conditions, a string extended sorting code is generated based on road level, driving direction angle, vehicle type and driving behavior label. Receive a trajectory query request, convert the trajectory query request into multiple 64-bit main sorting code candidate intervals, and perform a second screening on the multiple 64-bit main sorting code candidate intervals based on the query hit adaptation coefficient, and assign a second label to the 64-bit main sorting code candidate intervals that meet the second screening conditions. Only the 64-bit main sorting code candidate interval with the second mark is scanned to obtain the hit trajectory records, and the hit trajectory records are sorted based on the 64-bit main sorting code and the string extended sorting code, and the trajectory retrieval sorting result is output.

2. The multidimensional sorting and string extension multidimensional sorting optimization method based on 64-bit integer encoding according to claim 1, characterized in that, The vehicle network trajectory data is subjected to trajectory validity screening, including: Obtain the degree of consistency of road network adsorption, temporal continuity, velocity direction consistency, and field completeness of trajectory records; The trajectory effectiveness coefficient is obtained by weighted fusion based on the consistency of road network adsorption, temporal continuity, velocity direction consistency, and field completeness. The trajectory validity coefficient is compared with a preset first admission threshold. When the trajectory validity coefficient is greater than or equal to the preset first admission threshold, the corresponding trajectory record is assigned a first mark. When the trajectory validity coefficient is less than the preset first admission threshold, the corresponding trajectory record is removed so that the corresponding trajectory record does not participate in the subsequent quantization encoding and 64-bit master sorting encoding generation.

3. The multidimensional sorting and string extension multidimensional sorting optimization method based on 64-bit integer encoding according to claim 2, characterized in that, The consistency of road network adsorption is obtained by the road network adsorption offset distance from the trajectory point to the center line of the matching road; the temporal continuity is obtained by the deviation between the collection time interval between adjacent valid trajectory records and the target sampling period; the consistency of speed direction is obtained by the difference in direction angle between the actual change in direction angle and the speed-derived change in direction angle; the completeness of fields is obtained by the number of complete fields of vehicle number, longitude, latitude, collection time, vehicle speed, driving direction angle, road grade, driving risk level, vehicle type and driving behavior label.

4. The multidimensional sorting and string extension multidimensional sorting optimization method based on 64-bit integer encoding according to claim 1, characterized in that, Position quantization is performed on the trajectory record bearing the first marker, including: Read the longitude and latitude of the trajectory record with the first mark, and match the trajectory points to road segments in the electronic road network; Within a preset neighborhood of the road segment where the trajectory point is located, the road density, trajectory point density, and historical query popularity are statistically analyzed and normalized respectively to obtain the normalized values ​​of road density, trajectory point density, and historical query popularity. The location grid level is determined based on the normalized values ​​of road density, trajectory point density, and historical query popularity. Based on the location grid hierarchy, a quadtree hierarchical grid mapping method is used to map the longitude and latitude of the trajectory records into location grid codes.

5. The multidimensional sorting and string extension multidimensional sorting optimization method based on 64-bit integer encoding according to claim 4, characterized in that, Quadtree hierarchical grid mapping methods include: Determine the minimum longitude, maximum longitude, minimum latitude, and maximum latitude of the target road network area; Based on the longitude, latitude, and location grid levels of the trajectory records, the grid column number in the longitude direction and the grid row number in the latitude direction are determined respectively; The grid column number and the grid row number are converted into binary numbers of the corresponding grid level, and the binary bits in the longitude direction and the binary bits in the latitude direction are read layer by layer to obtain the quadtree quadrant code of each layer; The position grid code is generated by combining the quadtree quadrant codes of each level in quaternary order.

6. The multidimensional sorting and string extension multidimensional sorting optimization method based on 64-bit integer encoding according to claim 1, characterized in that, The trajectory record bearing the first marker is quantized for time, speed, and driving risk, including: Based on the actual vehicle throughput and reference traffic capacity of the road segment where the trajectory record is located during the corresponding time period, the congestion status value is determined, and the time slice length is determined based on the congestion status value. Based on the acquisition time of the trajectory record, the preset encoding start time, and the time slice length, a time slice code is generated; Based on the vehicle speed recorded by the trajectory, the vehicle speed is divided into parking level, low speed level, medium speed level, high speed level and abnormal high speed level, and a speed level code is generated. Driving risk feature values ​​are obtained based on the number of rapid accelerations, rapid decelerations, abnormal yaws, suspected wrong-way driving markers, and short-term frequent lane change markers, and risk level codes are generated based on the driving risk feature values.

7. The multidimensional sorting and string extension multidimensional sorting optimization method based on 64-bit integer encoding according to claim 6, characterized in that, Generate a 64-bit master sort code, including: Obtain the query frequency and dispersion values ​​for the location, time, speed, and driving risk dimensions, respectively. The encoding allocation weight coefficients for each dimension are obtained based on the dimension query frequency value and the dimension dispersion value; The location grid coding bit width, time slice coding bit width, speed level coding bit width, and risk level coding bit width are determined based on the coding allocation weight coefficients. The location grid code, time slice code, velocity level code, and risk level code are combined into a 64-bit master sort code according to the field order. The location grid code is located in the high-order field, the time slice code is located after the location grid code, the velocity level code is located after the time slice code, and the risk level code is located in the low-order field.

8. The multidimensional sorting and string extension multidimensional sorting optimization method based on 64-bit integer encoding according to claim 1, characterized in that, Generate extended sorted encoding strings based on road grade, driving direction angle, vehicle type, and driving behavior labels, including: Generate road level extension segments based on road level; Generate a direction angle extension segment based on the direction sector to which the driving direction angle belongs; Generate vehicle type extension segments based on vehicle type; Generate extended segments of driving behavior based on driving behavior tags; The strings are concatenated in the order of road grade extension segment, direction angle extension segment, vehicle type extension segment, and driving behavior extension segment to generate a string extension sorting code.

9. The multidimensional sorting and string extension multidimensional sorting optimization method based on 64-bit integer encoding according to claim 1, characterized in that, The trajectory query request is converted into multiple 64-bit primary sorted code candidate intervals, and a second filtering is performed based on the query hit fit coefficient, including: Receive the q-th trajectory query request, and parse the target area range, target time range, speed level constraint, driving risk level constraint, and extended query conditions in the q-th trajectory query request; The target area range is converted into a target location grid range, the target time range is converted into a target time slice range, the speed level constraint is converted into a target speed level range, and the driving risk level constraint is converted into a target risk level range. Based on the field width and field order in the 64-bit master sort code, multiple 64-bit master sort code candidate ranges are generated. The degree of overlap of the position grid, the degree of overlap of the time slice, the degree of matching of the velocity risk and the degree of matching of the extended conditions of the m-th 64-bit main sorting code candidate interval under the q-th trajectory query request are obtained respectively. The query hit adaptation coefficient of the m-th 64-bit main sorting code candidate interval under the q-th trajectory query request is obtained by weighted fusion based on the degree of overlap of the location grid, the degree of overlap of the time slice, the degree of matching of the velocity risk, and the degree of matching of the extended conditions. The query hit fit coefficient is compared with the preset hit fit threshold. When the query hit fit coefficient is greater than or equal to the preset hit fit threshold, the corresponding 64-bit main sorting code candidate interval is assigned a second label. When the query hit fit coefficient is less than the preset hit fit threshold, the corresponding 64-bit main sorting code candidate interval is removed so that it does not participate in the database scan.

10. The multidimensional sorting and string-extended multidimensional sorting optimization method based on 64-bit integer encoding according to claim 1, characterized in that, The output trajectory retrieval sorting results include: Read the 64-bit main sorting code candidate range with the second tag, and perform a range scan in the database according to the candidate range start code and candidate range end code; The track records obtained from the scan are reviewed and filtered for target area range, target time range, speed level constraints, and driving risk level constraints; The reviewed and filtered trajectory records are sorted in ascending order according to the 64-bit primary sort code; When multiple trajectory records have the same 64-bit primary sort code, determine whether they have a string extended sort code; if a string extended sort code exists, perform a second sort according to the lexicographical order of the string extended sort code; if no string extended sort code exists, maintain the first sort result. When multiple trajectory records have the same 64-bit primary sort code and the same string extended sort code, they are stably sorted according to the collection time and vehicle number. The output includes the trajectory retrieval sorting results, which include vehicle number, longitude, latitude, data collection time, vehicle speed, driving direction angle, road grade, driving risk level, vehicle type, driving behavior label, 64-bit main sort code, string extended sort code, and sorting sequence number.