A whitelist trajectory extraction method and system for mass trajectory big data
By performing low-order rasterization of latitude and longitude and multi-dimensional neighbor expansion within the Executor node, combined with geometric dissimilarity clustering, the problems of high computational complexity and clustering failure of massive trajectory data are solved, and efficient whitelist trajectory extraction is achieved.
Patent Information
- Application Number
- CN202611219618.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-12
- Publication Date
- 2026-11-20
AI Technical Summary
Existing trajectory clustering and extraction technologies suffer from inherent conflicts between distributed computing architecture and high-dimensional clustering algorithms when dealing with massive amounts of big data. They also suffer from clustering failures caused by spatial dilution of massive long-distance trajectory points and incorrect sampling frequencies, resulting in a severe lack of standard whitelist routes in the final aggregated data.
By introducing a distributed shuffle mechanism with the destination as a high-dimensional routing key, order tasks are aggregated into the same Executor node. Within the node, low-order rasterization of latitude and longitude and multi-dimensional neighbor expansion of routes are performed. Clustering is carried out using geometric dissimilarity, and finally representative trajectory data is selected for structured encapsulation.
It significantly improves the return rate and whitelist extraction purity of massive long-distance trips, solves the problems of high computational complexity and clustering failure, and achieves efficient trajectory data collection and purity improvement.
Smart Images

Figure CN123138753A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent transportation technology, specifically to a method and system for extracting whitelisted trajectories from massive amounts of trajectory big data. Background Technology
[0002] Extracting standard logistics trunk lines (i.e., whitelisted trajectories) from massive historical vehicle trajectory data is the core foundation for intelligent traffic guidance, bulk logistics timeliness assessment, and vehicle deviation warning. Typically, after preprocessing and segmenting into individual trips, a clustering algorithm (DBSCAN density clustering) is used to group trips heading to the same destination with highly overlapping routes together, and the most representative one is extracted as the standard track.
[0003] However, existing trajectory clustering and extraction technologies face inherent conflicts with existing distributed computing architectures and high-dimensional clustering algorithms when dealing with massive amounts of big data (such as millions of vehicles and decades of historical data), as well as problems such as spatial dilution of massive long-distance trajectory points and incorrect sampling frequency leading to clustering failure.
[0004] Therefore, there is an urgent need to propose a technical solution for distributed spatial grid clustering and whitelist extraction for massive trajectory big data. Summary of the Invention
[0005] This invention aims to solve at least one of the technical problems existing in the prior art, and proposes a whitelist trajectory extraction method and system for massive trajectory big data.
[0006] In a first aspect, the present invention provides a method for extracting whitelisted trajectories from massive amounts of trajectory big data, including:
[0007] Retrieve all order tasks and aggregate all order tasks heading to the same shipping destination into a single Executor node;
[0008] Perform low-order rasterization of latitude and longitude and multi-dimensional neighbor expansion of routes within the Executor node of the current destination set;
[0009] Based on the geometric dissimilarity between any two distributed trajectory data in the current destination set, each distributed trajectory data in the current destination set is clustered and labeled.
[0010] Based on the clustering results, two clusters are selected for the current destination, and one distributed trajectory data is selected from each of the two clusters for structured encapsulation.
[0011] Secondly, this invention provides a whitelist trajectory extraction system for massive trajectory big data, comprising:
[0012] The acquisition module is configured to acquire all order tasks and aggregate all order tasks heading to the same shipping destination into a single Executor node;
[0013] The processing module is configured to perform low-order latitude and longitude rasterization and multi-dimensional neighbor expansion of routes within the Executor nodes of the current destination set.
[0014] The clustering module is configured to cluster and label each distributed trajectory data in the current destination set based on the geometric dissimilarity between any two distributed trajectory data in the current destination set.
[0015] The encapsulation module is configured to select two clusters for the current destination based on the clustering results, and then select one distributed trajectory data from each of the two clusters for structured encapsulation.
[0016] Thirdly, embodiments of the present invention provide an electronic device, the electronic device comprising:
[0017] At least one processor; and a memory communicatively connected to the at least one processor;
[0018] The memory stores a computer program that can be executed by at least one processor, such that the at least one processor is able to perform the steps of the method according to any embodiment of the present invention.
[0019] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing computer instructions that, when executed by a processor, implement the steps of a method according to any embodiment of the present invention.
[0020] Compared with the prior art, the present invention has the following advantages:
[0021] The technical solution in this embodiment first acquires all order tasks and aggregates all order tasks heading to the same transportation destination into a single Executor node. Then, within the Executor node of the current destination set, it performs low-order latitude and longitude rasterization and multi-dimensional neighbor expansion processing of the route. Next, based on the geometric dissimilarity between any two distributed trajectory data in the current destination set, it clusters and labels each distributed trajectory data in the current destination set. Finally, based on the clustering results, it selects two clusters for the current destination and selects one distributed trajectory data from each cluster for structured encapsulation. By introducing low-order spatial gridding dimensionality reduction and a multi-dimensional neighbor dynamic expansion mechanism, the infinitely continuous latitude and longitude point flow is transformed into a finite discrete spatial grid set. This significantly reduces computational complexity while tolerating reporting drift and sparsity errors in long-distance trajectories, significantly improving the return rate and whitelist extraction purity of massive long-distance trips. Attached Figure Description
[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only preferred embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 A flowchart illustrating a whitelist trajectory extraction method for massive trajectory big data provided in this embodiment of the invention;
[0024] Figure 2 This is a schematic diagram of the structure of a whitelist trajectory extraction system for massive trajectory big data provided in an embodiment of the present invention;
[0025] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0026] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0027] Existing trajectory clustering and extraction technologies face the following insurmountable technical bottlenecks when dealing with massive amounts of data (such as millions of vehicles or decades of historical data):
[0028] 1) The inherent conflict between distributed computing architecture and high-dimensional clustering algorithms: Traditional trajectory similarity measurement algorithms (such as DTW dynamic time warping, LCSS longest common subsequence) and DBSCAN clustering algorithm have computational complexity as high as... When the number of processes reaches hundreds of thousands or even millions, such algorithms cannot run on a single machine at the Driver end of a distributed cluster (it will inevitably trigger an OutOfMemoryError). Furthermore, existing distributed frameworks (such as the Spark architecture) do not natively provide matrix clustering operators for the overlap of complex spatial geometric curves.
[0029] 2) Clustering failure caused by spatial dilution and unequal sampling frequencies of massive long-distance trajectory points: Long-distance cross-province trajectories (e.g., 3000 km) span several provinces on the map. Due to inconsistent location reporting frequencies of different vehicles, stops at service areas for detours, or brief deviations on highways, it is extremely difficult for two trips on the same route to accurately overlap in spatial geometry. If point-to-point distance calculations are performed directly, the intersection ratio will be rapidly diluted, resulting in a large number of trips that actually belong to the same trunk line being misclassified as "noise" by the algorithm, leading to a severe lack of standard whitelist routes in the final aggregation.
[0030] Figure 1 This is a flowchart illustrating a whitelist trajectory extraction method for massive trajectory big data provided in this embodiment of the invention. This embodiment is particularly applicable to scenarios where whitelist trajectories are extracted from massive historical vehicle trajectory data. This method can be executed by a whitelist trajectory extraction system for massive trajectory big data. The system can be implemented in software and / or hardware and can be configured in an electronic device.
[0031] like Figure 1 As shown, the method specifically includes:
[0032] S1 retrieves all order tasks and aggregates all order tasks destined for the same shipping destination into the same Executor node.
[0033] That is, all OrderTasks for the same shipping destination are transmitted over the network and stored in the memory of the same Executor process.
[0034] It should be noted that an order task refers to a complete transportation operation task; an Executor node refers to a worker process in the Spark cluster that is responsible for running business calculations.
[0035] A Spark cluster consists of Executors and Drivers. Executors, as the executors in the Spark cluster, are responsible for reading data, performing calculations, and caching intermediate results in memory. Drivers, as the drivers in the Spark cluster, are responsible for issuing tasks, scheduling, and overall coordination, but do not perform heavy computations.
[0036] In some embodiments, all order tasks are retrieved, and all order tasks destined for the same shipping destination are aggregated into a single Executor node, including:
[0037] S101, obtain all order tasks, and perform simplification on the GPS trajectory point sequence corresponding to each order task to obtain the simplified spatiotemporal point string sequence corresponding to each order task.
[0038] The thinning and simplification methods include: time-dimensional thinning, spatial geometric thinning, GPS dirty point filtering, and business semantic pruning.
[0039] Each order task (OrderTask) corresponds to a simplified spatiotemporal point string sequence, which can be denoted as: List[MiniPoint].
[0040] Temporal thinning can remove overly dense consecutive points by sampling at time intervals, reducing the total number of points. Especially when the vehicle is stationary, GPS repeatedly reports almost the same latitude and longitude, retaining only one of each and eliminating a large number of duplicate points.
[0041] Spatial geometric thinning can preserve trajectory turns and inflection points while removing redundant intermediate points on straight lines. This is especially useful when vehicles are on long, straight highways where a large number of GPS points fall almost on a straight line; only the start and end points are retained, while all intermediate points are discarded. In addition, key points at turns, ramps, and lane changes must be preserved to ensure that the route outline is not distorted.
[0042] GPS dirty point filtering can directly discard invalid or outlandish positioning. For example: ① points with latitude and longitude outside the domestic geographical area; ② points with abnormal speed (the instantaneous speed of the vehicle is obviously drifting between the two points); ③ points with poor accuracy (points with poor GPS positioning accuracy are directly eliminated); ④ points with time jump (dirty points with disordered device time and reversed timestamps).
[0043] Business semantic trimming refers to trimming based on the order task (OrderTask). For example: ① Only retain GPS points during the execution of the order task; ② Remove irrelevant trajectories before loading and after unloading; ③ Separate mixed trajectories so that each OrderTask has its own set of points.
[0044] It should be noted that if the original tens of thousands of trajectory points are directly fed into Spark Shuffle, the amount of data transmitted by the Shuffle network will explode, and the memory usage will skyrocket. Therefore, the GPS trajectory point sequence corresponding to each order task is thinned and simplified. By filtering out redundant and duplicate positioning points in advance, the amount of subsequent calculations is reduced.
[0045] S102, each order task and the corresponding simplified spatiotemporal point sequence are treated as a distributed trajectory data to construct a distributed dataset.
[0046] The input receives a preprocessed and thinned distributed dataset, processedTripsRDD. The data format of each distributed trajectory data in the distributed dataset is: each order task and its corresponding simplified spatiotemporal point string sequence. The distributed dataset can be denoted as: [OrderTask, List[MiniPoint]].
[0047] S103 invokes the distributed remapping operator to reconstruct the distributed dataset into a tuple with the transportation destination as the high-dimensional routing key and the distributed trajectory data as the value.
[0048] By invoking the distributed remapping operator, the data is reassembled into tuples with the destination as the high-dimensional routing key and the order and point sequence as the value. The reassembled tuple can be represented as:
[0049]
[0050] It should be noted that the transportation destination is used as the routing label for data distribution across the entire network. During the Shuffle phase, the cluster will perform hash sharding based on this key; the value retains the complete order ID plus the complete simplified trajectory point string of the order, without losing the original business data.
[0051] Furthermore, the transportation destination itself is geographical information, and as a fragmented routing index for distributed network transmission, it serves a dual function of business geographical dimension and distributed scheduling routing dimension, hence it is called a high-dimensional routing key.
[0052] S104 triggers the underlying distributed Shuffle operator, which aggregates the distributed trajectory data of the tuples heading to the same transportation destination into the same Executor node.
[0053] Triggering the underlying distributed Shuffle operator (such as groupByKey) shuffles the data in the cluster network, automatically converging all historical travel trajectories heading to the same destination into the same specified computing node (Executor memory implicit queue) in the cluster, achieving true data immobilization, operator movement, and parallel domain isolation.
[0054] Understandably, a massive number of freight GPS orders scattered across the country are distributed across various machines in the cluster. By using a shuffle operation with the destination as the key, all orders heading to a certain city are aggregated onto a single server. This server then performs batch processing of all trajectory grid fault-tolerant calculations to that city in memory.
[0055] S2 performs low-order rasterization of latitude and longitude and multi-dimensional neighbor expansion of routes within the Executor node of the current destination set.
[0056] Within the Executor node that receives a specific set of destinations, in-memory parallel processing logic is enabled, eliminating the need for frequent disk reads and writes and resulting in faster speeds. The operator internally performs low-order spatial gridding and dynamic neighbor grid expansion to convert the vehicle's GPS trajectory into a low-precision grid. Then, 3×3 neighborhood grid expansion is used to offset positioning errors caused by GPS drift, missed points, and lane changes.
[0057] In some embodiments, low-order latitude and longitude rasterization and multi-dimensional neighbor expansion of routes are performed within the Executor nodes of the current destination set, including:
[0058] S201, iterate through each distributed trajectory data in the current destination set, and perform uniform multiplication and rounding down on the latitude and longitude of all physical positioning points in all distributed trajectory data.
[0059] For each GPS location point (Lng longitude, Lat latitude) in the trajectory, multiply by 100 and round down.
[0060] Low-order rasterization of latitude and longitude: Traversing every historical trip under this specific destination To reduce computational space complexity and tolerate vehicle driving errors, each physical location point during the journey is... Latitude and longitude coordinates are uniformly downgraded and retained to 2 decimal places (forming approximately...) Spatial physical grid identifier).
[0061] It should be noted that the purpose of low-order gridding of latitude and longitude is twofold: firstly, directly calculating the distance of a massive number of GPS positioning points is extremely costly, so converting them into a coarse-grained grid reduces the spatial computational complexity and significantly improves the speed of matching, comparison, and deduplication operations; secondly, it naturally filters out normal GPS drift of tens or hundreds of meters, so that similar positioning points will fall into the same grid, which can tolerate the basic driving error of the vehicle.
[0062] S202 adds each processed physical location point in the same distributed trajectory data and the neighboring points around each processed physical location point to the same grid set.
[0063] For any distributed trajectory data i, the physical location points on that distributed trajectory data i, after being multiplied and rounded down, are respectively added to the same grid set. Simultaneously, using the physical location point as the center point, the eight neighboring points around the center point are also included in the grid set. .
[0064] Route Multidimensional Neighbor-Grid Expansion: Incorporating Location Points into the Grid Set At that time, the algorithm not only calculates the current grid center, but also discretizes and expands the eight neighboring grids around the center point.
[0065] It should be noted that the purpose of multi-dimensional grid expansion processing is as follows: Firstly, when a vehicle changes lanes on a highway / main road, the GPS may shift laterally by several hundred meters. Originally, this would fall into an adjacent grid, but after expansion, the adjacent grids belong to the same trajectory set, and the matching will not identify them as two completely different routes. Secondly, when temporarily detouring or entering / exiting ramps, the vehicle may deviate from the main road grid for a short time, and the surrounding adjacent grids have been included in the set, but the algorithm still identifies them as the same route. Thirdly, when the device signal is lost or there is no signal in the tunnel, a segment of positioning may be missing. As long as there is overlap between the expanded grids of the effective points before and after the segment, the trajectory can be determined to be continuous and will not be broken.
[0066] In some embodiments, latitude and longitude low-order rasterization is represented as:
[0067]
[0068] in, Indicates the longitude of the physical location point. Indicates the longitude of the processed physical location point. Indicates the latitude of the physical location point. This indicates the latitude of the processed physical location point.
[0069] In some embodiments, the route multidimensional neighbor-cell expansion process is represented as:
[0070]
[0071] in, Let k represent the set of grid cells for the i-th distributed trajectory data, k represent the longitude offset, and m represent the latitude offset. By iterating through all offset combinations, all 9 grid cells are added to the grid set for this trip. middle.
[0072] For example, suppose the original coordinates of a GPS point are: Lng=114.326, Lat=30.574.
[0073] First, rasterize the coordinates: Longitude 114.326 × 100 = 11432.6, rounded to 11432; Latitude 30.574 × 100 = 3057.4, rounded to 3057; thus, the central grid (11432, 3057) is obtained.
[0074] Then, neighbor-cell expansion is performed: offsets k and m are changed from -1 to 1, generating 9 sets of cell IDs, namely (11431,3056), (11431,3057), (11431,3058), (11432,3056), (11432,3057), (11432,3058), (11433,3056), (11433,3057), and (11433,3058). All 9 cells belong to the trajectory set of this journey. As long as other trajectories hit any cell, it is determined that the space overlaps.
[0075] It should be noted that every 0.01 degree shift in longitude or latitude is equivalent to an offset of approximately 1.1 km.
[0076] This expansion mechanism is equivalent to proportionally thickening the originally extremely thin GPS track lines on the digital map to a radius of more than 2 kilometers. A single GPS point no longer represents only a 1.1km grid, but covers a 3×3 grid block, with a horizontal and vertical coverage range of about 3.3km. This completely eliminates the geometric distance errors caused by lane switching, brief deviations, or missed points during long-distance transportation.
[0077] In this embodiment, low-order rasterization of latitude and longitude significantly reduces the amount of coordinate calculations, while parallel memory processing improves throughput. Multi-dimensional neighbor-grid expansion of the route directly eliminates geometric distance errors, eliminating the need for complex trajectory curve fitting and distance threshold judgment.
[0078] S3, based on the geometric dissimilarity between any two distributed trajectory data in the current destination set, clusters and labels each distributed trajectory data in the current destination set.
[0079] Based on the trip grid set that has been expanded into a grid within the Executor, similarity calculation and route clustering are performed in single-machine memory. The goal is to automatically group freight trips that go to the same destination and have similar routes into one category.
[0080] In some embodiments, each distributed trajectory data in the current destination set is clustered and labeled based on the geometric dissimilarity between any two distributed trajectory data in the current destination set, including:
[0081] S301, based on each distributed trajectory data in the current destination set, initializes a [database name] in the operator memory. The two-dimensional high-dimensional distance matrix.
[0082] Where M represents the number of distributed trajectory data in the current destination set.
[0083] In this matrix, each element represents the geometric dissimilarity between two distributed trajectory data.
[0084] Furthermore, if two distributed trajectory data refer to the same distributed trajectory data, the geometric dissimilarity value is 0.
[0085] Specifically, the high-dimensional distance matrix is constructed as follows: Let the current destination have a total of For each historical process, the Executor initializes a memory space of size [size missing] in the operator's memory. The two-dimensional high-dimensional distance matrix.
[0086] S302, based on the intersection and union of the grid sets of the i-th distributed trajectory data and the j-th distributed trajectory data, calculate the geometric dissimilarity between the i-th distributed trajectory data and the j-th distributed trajectory data, and use it as an element in the two-dimensional high-dimensional distance matrix.
[0087] Specifically, the discrete set cross measure: the algorithm uses high-speed bit operations in the Executor's local memory to quickly solve the intersection and union of pairwise line grid sets, and directly defines the geometric dissimilarity of two trajectories using the Jaccard distance formula.
[0088] In some embodiments, the geometric dissimilarity between the i-th distributed trajectory data and the j-th distributed trajectory data is represented as:
[0089]
[0090] in, This represents the grid set of the i-th distributed trajectory data. This represents the grid set of the j-th distributed trajectory data. Indicates geometric dissimilarity.
[0091] It should be noted that before calculating the geometric dissimilarity, the system first performs validity checks on the grid sets of the i-th and j-th distributed trajectory data respectively. If any abnormal or invalid grid sets are found, the program outputs... =1.
[0092] S303 inputs the complete two-dimensional high-dimensional distance matrix into the DBSCAN clustering algorithm, and clusters and labels each distributed trajectory data in the current destination set based on the pre-set neighborhood dissimilarity threshold and minimum line formation threshold.
[0093] Specifically, the local DBSCAN parallel driver directly feeds the calculated distanceMatrix into the single-node DBSCAN core algorithm. A neighborhood dissimilarity threshold is set. (That is, if the thickened trunk grids of two trajectories overlap by more than 30%, they are considered to be the same route), and a minimum line formation threshold is set. The algorithm generates clustering labels for each trip in a distributed, parallel manner.
[0094] Understandable If the dissimilarity threshold is the neighborhood dissimilarity threshold, then The two trajectories are determined to be neighbors; the reverse derivation is then performed. When the grid overlap rate is ≥30%, it is considered as the same trunk route.
[0095] A cluster must contain at least two routes. A single isolated route does not form a valid route cluster and is marked as an outlier. Same label: Belongs to the same frequently traveled main route. Special label: Isolated route (no similar routes, niche or off-the-beaten-path route).
[0096] S4. Based on the clustering results, select two clusters for the current destination, and select one distributed trajectory data from each of the two clusters for structured encapsulation.
[0097] Based on the clustering results, standard trunk lines to the destinations are selected from a large number of route clusters, and standardized route data is generated as the final closed-loop output of the entire distributed operator.
[0098] In some embodiments, two clusters for the current destination are selected based on the clustering results, and a distributed trajectory data from each of the two clusters is selected for structured encapsulation, including:
[0099] S401, based on the number of distributed trajectory data contained in each cluster, sorts each cluster in descending order and selects the top two clusters as the two core standard main lines of the current destination.
[0100] Specifically, the Top-2 core routes are consolidated: Isolated trips deemed noise (labeled -1) are filtered out within the operator. The routes are then sorted in descending order based on the number of historical trips within each cluster, and the top two are forcibly selected as the core standard main routes to that destination (one as the main trunk line and the other as a compliant backup route), resolving the issue of multiple routes coexisting. By filtering out less popular and temporary routes, only regular trunk lines with statistical significance are retained. The dual-route design balances daily main transportation with emergency detour scenarios, adapting to freight compliance verification requirements.
[0101] First, filtering and cleaning are performed, directly removing noisy routes marked as -1 by DBSCAN (isolated, niche routes not included in the standard trunk lines). Then, cluster size is sorted, with all remaining valid clusters ordered in descending order of the total number of historical trips contained within each cluster. Next, a forced truncation rule is executed, retaining only the top two clusters as the official standard trunk lines for that destination: the first is the main transportation trunk line (the mainstream route chosen by the vast majority of vehicles); the second is the compliant backup route (a high-frequency alternative channel used for diversion, congestion avoidance, and detour scenarios). Finally, the business goal is achieved: when multiple high-frequency routes exist for the same destination, two standard routes are uniformly fixed, achieving standardized route management.
[0102] S402 measures the grid density of all distributed trajectory data in the two extracted clusters, and selects the best distributed trajectory data in each of the two clusters as the standard skeletal tracks for the two clusters respectively.
[0103] Specifically, the spatial skeleton representativeness metric is as follows: For the selected core cluster cid, the algorithm measures the grid density of all member trajectories within that cluster and selects the route with the most concise physical points and the best continuity as the most spatially representative standard skeleton trajectory, standardPoints. Since there are dozens or hundreds of similar trajectories within the same cluster, it is not necessary to store them all; only the most representative standard trajectory is stored, significantly reducing storage and subsequent comparison computation.
[0104] Understandably, after selecting two core clusters (cid), a unique standard route skeleton (standardPoints) for that cluster is generated.
[0105] First, grid density is measured by traversing the expanded grid set (GridSet_i) of all routes within the cluster and calculating the grid coverage density of each trajectory. Then, a selection rule is applied, choosing routes that simultaneously meet two conditions as representative tracks: the total number of physical points is minimized (no redundant or duplicate points, optimal thinning quality); and spatial continuity is best (no trajectory breaks, no large grid gaps, complete coverage of the entire trunk line). Finally, the output is: standardPoints = the standard skeletal track of this cluster, serving as the baseline template for this trunk line.
[0106] S403 generates a characterless primary key for each of the two core standard mainlines of the current destination, assembles the metadata of the core standard mainlines into the main table buffer, assembles the serialized points of the standard skeletal track into the secondary table buffer, and packages the data from the main and secondary buffers as the output of the Executor node.
[0107] Specifically, the globally unique serialization encapsulation is as follows: First, a globally unique non-hyphenated primary key routeCode (based on UUID conversion) is generated for each extracted route; then, the main line metadata is assembled into the main table buffer localBaseRows; next, the serialized points of the standard skeletal track standardPoints (assigned an auto-incrementing sequence number point_seq) are assembled into the slave table buffer localPointRows, which is finally used as the closed-loop output of the entire distributed operator (mapValues).
[0108] That is, the two standard main lines are structured and encapsulated, the master and slave double buffers are split, and the final return value of the operator, mapValues, is generated:
[0109] Globally unique route code (routeCode): Generates a conflict-free string primary key based on UUID. Each trunk line is assigned an independent and unique code for global route indexing, business queries, and data association.
[0110] The main table buffer localBaseRows stores trunk metadata, such as destination, routeCode, cluster number, primary / backup route markers, trip statistics, and other attribute information.
[0111] From the table buffer localPointRows: split the point sequence of the standard skeleton track standardPoints, assign an auto-incrementing index point_seq to each point, and completely record the driving point order of the standard route;
[0112] Closed-loop output: The data from the master and slave buffers are packaged into mapValues, which serve as the final result of the entire set of distributed operators on the current Executor node. This data can be stored in a database or distributed to downstream businesses.
[0113] The technical solution in this invention proposes a distributed shuffle mechanism with the destination as the high-dimensional routing key. This changes the traditional single-machine clustering architecture, seamlessly pushing down the energy-intensive distance matrix calculation and DBSCAN clustering algorithm to the distributed parallel execution of each Executor node in the cluster, completely freeing up the Driver. Furthermore, by introducing low-order spatial gridding dimensionality reduction and a multi-dimensional neighbor grid dynamic expansion mechanism, the infinitely continuous latitude and longitude point flow is transformed into a finite discrete spatial grid set. This significantly reduces computational complexity while tolerating reporting drift and sparsity errors in long-distance trajectories, significantly improving the return rate and whitelist extraction purity of massive long-distance trips.
[0114] In summary, the technical effects brought about by the technical solutions in the embodiments of the present invention are reflected in at least the following aspects:
[0115] 1) Completely overcomes the OOM (Out of Memory) technical bottleneck in massive spatiotemporal trajectory clustering: Through the innovative "destination distributed Shuffle routing key" design, the traditional single-machine operation, which is prone to causing Driver-side OOM, is transformed. The complexity-space clustering algorithm successfully reduced dimensionality and distributed the cluster across tens of thousands of Executor nodes in a distributed cluster. Even with millions of orders and billions of location points over five years, it achieved linear scaling of computing resources, resulting in a several-fold improvement in system robustness.
[0116] 2) Significantly improved robustness and accuracy of complex long-distance trunk line identification: The unique "low-order spatial gridding + dynamic expansion of adjacent 9-grid" mechanism transforms the complex calculation of curve geometric overlap into high-speed bitwise operations of discrete set intersection and union in the Executor memory. It successfully overcomes the clustering failure problems caused by sparse reporting points on long-distance 3000-kilometer routes, signal disconnection in mountainous areas, and detours in urban areas, achieving a merging and rerouting accuracy of over 98% for whitelisted trunk lines.
[0117] 3) Ensures consistency of primary and foreign key cascading and security of high-concurrency writes in downstream business systems: The alignment and assembly of UUID to primary and foreign key routeCode of the slave table is completed in a closed loop within the operator, completely eliminating dirty join data; at the same time, in conjunction with the global concurrency defense mechanism, the distributed full RDD flattened write channel is locked within the safety threshold, which not only realizes the high throughput of big data, but also perfectly protects the hardware resources of downstream relational databases.
[0118] Based on the same inventive concept Figure 2 This is a schematic diagram of the structure of a whitelist trajectory extraction system for massive trajectory big data provided in an embodiment of the present invention, as shown below. Figure 2 As shown, the system specifically includes:
[0119] The module 100 is configured to retrieve all order tasks and aggregate all order tasks destined for the same transportation destination into the same Executor node;
[0120] The processing module 200 is configured to perform low-order latitude and longitude rasterization and multi-dimensional neighbor expansion of routes within the Executor nodes of the current destination set.
[0121] Clustering module 300 is configured to cluster and label each distributed trajectory data in the current destination set based on the geometric dissimilarity between any two distributed trajectory data in the current destination set;
[0122] The encapsulation module 400 is configured to select two clusters for the current destination based on the clustering results, and select one distributed trajectory data from each of the two clusters for structured encapsulation.
[0123] The technical effects of the solution in this embodiment are similar to those described above, and will not be repeated here.
[0124] Based on the same inventive concept Figure 3 This is a schematic diagram of an electronic device that implements the whitelist trajectory extraction method for massive trajectory big data according to embodiments of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0125] like Figure 3 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded into the RAM 13 from storage unit 18. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0126] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0127] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, central processing unit (CPU), graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as whitelist trajectory extraction methods for massive trajectory big data.
[0128] In some embodiments, the whitelist trajectory extraction method for massive trajectory big data can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the whitelist trajectory extraction method for massive trajectory big data described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to perform the whitelist trajectory extraction method for massive trajectory big data by any other suitable means (e.g., by means of firmware).
[0129] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0130] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0131] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0132] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0133] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0134] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0135] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0136] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for extracting whitelisted trajectories from massive trajectory big data, characterized in that, include: Retrieve all order tasks and aggregate all order tasks heading to the same shipping destination into a single Executor node; Perform low-order rasterization of latitude and longitude and multi-dimensional neighbor expansion of routes within the Executor node of the current destination set; Based on the geometric dissimilarity between any two distributed trajectory data in the current destination set, each distributed trajectory data in the current destination set is clustered and labeled. Based on the clustering results, two clusters are selected for the current destination, and one distributed trajectory data is selected from each of the two clusters for structured encapsulation.
2. The method according to claim 1, characterized in that, The process of obtaining all order tasks and aggregating all order tasks destined for the same shipping destination into a single Executor node includes: All order tasks are obtained, and the GPS trajectory point sequence corresponding to each order task is thinned and simplified to obtain the simplified spatiotemporal point string sequence corresponding to each order task. Each order task and its corresponding simplified spatiotemporal point sequence are treated as a distributed trajectory data to construct a distributed dataset. Invoke the distributed remapping operator to reconstruct the distributed dataset into a tuple with the transportation destination as the high-dimensional routing key and the distributed trajectory data as the value; Trigger the underlying distributed Shuffle operator to aggregate the distributed trajectory data of the tuples heading to the same transportation destination into the same Executor node.
3. The method according to claim 1, characterized in that, The process of performing low-order latitude and longitude rasterization and multi-dimensional neighbor expansion of routes within the Executor nodes of the current destination set includes: Iterate through each distributed trajectory data in the current destination set, and perform uniform multiplication and rounding down on the latitude and longitude of all physical positioning points in all distributed trajectory data. Each processed physical location point in the same distributed trajectory data, along with its neighboring points, is added to the same grid set.
4. The method according to claim 1 or 3, characterized in that, The low-order rasterization of latitude and longitude is represented as follows: in, Indicates the longitude of the physical location point. Indicates the longitude of the processed physical location point. Indicates the latitude of the physical location point. Indicates the latitude of the processed physical location point; The multidimensional neighbor-cell expansion process of the route is represented as follows: in, Let k represent the grid set of the i-th distributed trajectory data, k represent the longitude offset, and m represent the latitude offset.
5. The method according to claim 1, characterized in that, The step of clustering and labeling each distributed trajectory data in the current destination set based on the geometric dissimilarity between any two distributed trajectory data in the current destination set includes: Based on each distributed trajectory data in the current destination set, initialize a [database name] in the operator memory. A two-dimensional high-dimensional distance matrix; Based on the intersection and union of the grid sets of the i-th distributed trajectory data and the j-th distributed trajectory data, the geometric dissimilarity between the i-th and j-th distributed trajectory data is calculated and used as an element in the two-dimensional high-dimensional distance matrix; The complete two-dimensional high-dimensional distance matrix is input into the DBSCAN clustering algorithm. Based on the pre-set neighborhood dissimilarity threshold and minimum line formation threshold, each distributed trajectory data in the current destination set is clustered and labeled.
6. The method according to claim 5, characterized in that, The geometric dissimilarity between the i-th distributed trajectory data and the j-th distributed trajectory data is expressed as: in, This represents the grid set of the i-th distributed trajectory data. This represents the grid set of the j-th distributed trajectory data. Indicates geometric dissimilarity.
7. The method according to claim 1, characterized in that, The step of selecting two clusters for the current destination based on clustering results, and then selecting one distributed trajectory data from each of the two clusters for structured encapsulation, includes: Based on the number of distributed trajectory data contained in each cluster, each cluster is sorted in descending order, and the top two clusters are selected as the two core standard main lines for the current destination. The grid density of all distributed trajectory data in the two extracted clusters is measured respectively, and the optimal distributed trajectory data in each of the two clusters is selected as the standard skeletal track for the two clusters respectively. Generate a characterless primary key for each of the two core standard mainlines of the current destination, assemble the metadata of the core standard mainlines into the main table buffer, assemble the serialized points of the standard skeletal track into the secondary table buffer, and package the data from the main and secondary buffers as the output of the Executor node.
8. A whitelist trajectory extraction system for massive trajectory big data, characterized in that, The system is configured to implement the method according to any one of claims 1-7, the system comprising: The acquisition module is configured to acquire all order tasks and aggregate all order tasks destined for the same shipping destination into a single Executor node; The processing module is configured to perform low-order latitude and longitude rasterization and multi-dimensional neighbor expansion of routes within the Executor nodes of the current destination set. The clustering module is configured to cluster and label each distributed trajectory data in the current destination set based on the geometric dissimilarity between any two distributed trajectory data in the current destination set. The encapsulation module is configured to select two clusters for the current destination based on the clustering results, and then select one distributed trajectory data from each of the two clusters for structured encapsulation.
9. An electronic device, characterized in that, The electronic device includes: At least one processor; and a memory communicatively connected to said at least one processor; The memory stores a computer program that can be executed by the at least one processor to enable the at least one processor to perform the steps of the method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to perform the steps of the method according to any one of claims 1-7.
