Traffic state-oriented multi-modal adaptive hierarchical trajectory similarity calculation method

By adopting a multimodal adaptive hierarchical trajectory similarity calculation method, the problem of unrobust trajectory similarity calculation in traffic state semantic modeling is solved, and accurate similarity calculation and representation are achieved in traffic event mutation scenarios, thereby improving computational efficiency and accuracy.

CN121997077APending Publication Date: 2026-05-08湖南工商大学
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202610471181.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-10
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

Existing technologies for traffic state semantic modeling suffer from problems such as non-robust trajectory similarity calculation, rigid hierarchical abstraction, non-differentiable pooling, and lack of traffic awareness in pre-trained masks, resulting in inaccurate calculation results in scenarios such as sudden congestion and tidal traffic.

Method used

A multimodal adaptive hierarchical trajectory similarity calculation method is adopted. Traffic states are aligned through a joint retrieval mechanism of road segment identifiers and timestamps. An adaptive hierarchical mechanism and a differentiable sequence pooling mechanism for traffic perception are constructed. Combined with traffic state guidance mask and cross-level collaborative prediction mechanism, a joint loss function for multi-task collaborative optimization is constructed to realize multi-level representation and similarity calculation of trajectories.

Benefits of technology

It achieves accurate characterization of traffic events while ensuring computational efficiency, solves the problems of inconsistent trajectory complexity, semantic loss and waste of computational resources in traditional methods, and improves the robustness and accuracy of trajectory similarity calculation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121997077A_ABST
    Figure CN121997077A_ABST
Patent Text Reader

Abstract

The invention discloses a traffic state-oriented multi-modal adaptive hierarchical trajectory similarity calculation method, which comprises the following steps of: preprocessing trajectory data, injecting a traffic state and POI (Point of Interest) semantics, and constructing a multi-modal feature sequence; by extracting speed dispersion, course change intensity and traffic state fluctuation intensity, a complexity score is calculated, and the layering depth is adaptively determined; self-adaptive down-sampling is realized through a micro TopK, discarded nodes are aggregated as segment-level attributes, and multi-level representation is generated; preferentially shielding a high-fluctuation region by using a mask mechanism guided by a traffic state, and enhancing traffic event perception by combining intra-layer prediction and cross-layer collaborative prediction; the model is optimized through multi-task joint loss and self-adaptive weight; carrying out weighted fusion on each level of representation according to the complexity score, outputting a unified trajectory vector and calculating the similarity; according to the method, adaptive compression and multi-scale semantic modeling can be realized while the continuity of traffic events is kept, and the robustness and discrimination of trajectory similarity calculation are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent transportation and spatiotemporal big data analysis technology, and in particular to a multimodal adaptive hierarchical trajectory similarity calculation method oriented towards traffic conditions. Background Technology

[0002] With the widespread adoption of connected vehicles, mobile terminals, and urban sensing infrastructure, transportation systems continuously generate massive amounts of trajectory data. Trajectories not only contain continuous geometric spatiotemporal signals composed of latitude, longitude, and timestamps, but are also naturally constrained by both road network accessibility and traffic operation status. That is, the same spatial location may correspond to drastically different average speeds, congestion indices, and road saturation at different time periods. At the same time, the road segment sequences formed by regular map matching reflect the road network topology and turning / connectivity constraints. In order to further characterize travel purposes and regional activity intentions, the distribution of POI categories within grid cells has also become an important source of trajectory semantics. Although existing trajectory similarity calculation and retrieval technologies have been widely applied to path retrieval, travel profiling, anomaly detection, and traffic management, they still have shortcomings in the robustness and discriminativeness of similarity results in real-world scenarios characterized by "strong time-varying traffic conditions, multi-source heterogeneous semantics, and significant differences in trajectory length."

[0003] In traffic state semantic modeling, many methods still rely on geometric similarity or road segment sequence similarity, treating traffic state as an additional attribute or ignoring it completely. This leads to measurement biases in scenarios such as sudden congestion, tidal traffic, and accident detours, where "spatial paths are similar but traffic events are very different." Especially when traffic state needs to be bound to road signs and time granularity, without a state retrieval and injection mechanism based on "road segment representation + time bucket / timestamp," information such as speed and congestion is difficult to be stably aligned to trajectory points or road segment fragments, thus limiting the ability of subsequent representation learning to express traffic physical semantics.

[0004] In terms of trajectory hierarchy partitioning, downsampling or hierarchical abstraction is often required to reduce the computational overhead of long trajectory retrieval. However, the fixed number of layers and fixed window pooling commonly used in existing technologies have two types of problems: First, the trajectory complexity varies significantly in different samples and different road segments, and fixed layer depth cannot achieve "preserving details of complex trajectories and reducing redundancy of simple trajectories". Second, hard selection such as max pooling is not differentiable or has sparse gradients. Mechanical cutting with fixed window / step size can easily cut off a complete congestion or acceleration event, retaining only local extreme points, resulting in semantic loss and abstraction distortion.

[0005] In terms of self-supervised pre-training masking strategies, mask reconstruction pre-training has been used in recent years to improve representation generalization. However, random masks often cannot guarantee coverage of abrupt changes in traffic conditions: the model may mainly reconstruct stable segments, but it is not good at learning key traffic events such as sudden congestion and speed drops. This makes similarity calculation insensitive to "event differences", and key segments are easily diluted by noise. Summary of the Invention

[0006] In view of this, the present invention proposes a multimodal adaptive hierarchical trajectory similarity calculation method for traffic conditions, which solves the problems of missing traffic state semantics, rigid hierarchical abstraction, non-differentiable pooling, and lack of traffic perception in pre-trained masks. It provides a trajectory representation and similarity calculation technology that can ensure efficiency while taking into account the consistency of traffic event characterization and multimodal semantics.

[0007] To achieve the above objectives, this invention provides a multimodal adaptive hierarchical trajectory similarity calculation method oriented towards traffic conditions, comprising the following steps: S1. Collect the original GPS trajectory points and preprocess them. Perform coordinate transformation on the latitude and longitude of the preprocessed trajectory points to obtain a trajectory point sequence sorted by time. Retrieve traffic status from the historical traffic status database using the road segment identifier and timestamp as keys and assign values. Obtain the semantically enhanced trajectory sequence based on the grid identifier associated with the POI category distribution vector. S2. Using the trajectory points as a unified alignment unit, perform multi-scale periodic time representation on the timestamps to obtain daily / weekly periodic regular time-frequency semantics. Convert the road segment identifiers and grid identifiers into spatial / topological semantic vectors through the embedding layer, map the POI category distribution vectors into regional functional semantic vectors, map continuous traffic state quantities into state semantic vectors, and align and project the time-frequency semantics, spatial / topological semantics, regional functional semantics, and traffic state semantics to a unified dimension for joint fusion to form a time-aligned multimodal feature vector. S3. Construct an adaptive hierarchical mechanism for the trajectory: Extract complexity indicators from the geometric changes of the trajectory and the changes in traffic conditions to form a complexity indicator vector, including speed dispersion, heading change intensity, and traffic condition fluctuation intensity; input the complexity indicator vector into the evaluation module to obtain a complexity score, and convert the complexity into a target number of layers through a preset mapping; round the target number of layers and truncate it to fall within the preset minimum and maximum number of layers, and output the complexity score and target number of the trajectory. S4. Construct a differentiable sequence pooling mechanism for traffic perception; S401. Determine the number of pooling operations using the multimodal feature vectors of the trajectory points and the target layer number, construct a hierarchical representation from bottom to top according to the target layer number, and perform a sequence pooling operation on the previous layer sequence to generate a new layer; S402. Construct a fixed-window temporal neighborhood for the sequence index at each level; S403. Using the current layer input sequence as the pooling object, construct a pooling window / neighborhood relationship in the time neighborhood, calculate the trajectory motion speed from the displacement and time difference of adjacent points, define the intensity of local geometric changes, calculate the adjacent difference amplitude of the traffic state vector, and linearly fuse the geometric changes and traffic state abrupt changes after normalization to obtain the node importance score. S404. Use a differentiable TopK selection operator to generate soft selection weights, determine the target pooling retention number of this layer and complete adaptive downsampling to obtain the pooling output sequence composed of the retained nodes; S405. Soft selection weights determine the set of retained indexes and connect the retained nodes in the original sequence order to maintain the original time order topology; S406. Define the coverage area of ​​the reserved node, calculate the segment-level duration and distance, perform weighted statistics on the traffic piles in the segment to obtain the segment-level state features, and map the segment-level attributes into segment semantic vectors. S407. Pool and aggregate the unretained nodes according to their time neighborhood / adjacent retained node intervals. Aggregate the features of the unretained nodes into segment-level attributes and attach them to the adjacent retained nodes. Fuse the point semantics and segment semantics of the retained nodes to obtain the next layer of node representation. Repeat steps S401 to S406 for a total of M times to obtain a multi-level trajectory representation with layer-by-layer length compression and layer-by-layer semantic generalization. S5. Construct a traffic state guidance mask and cross-level collaborative prediction mechanism: Analyze the intensity and rhythm of traffic state changes along the trajectory, identify high-fluctuation areas where road conditions change significantly, and prioritize the high-fluctuation areas as masking targets. Construct a horizontal prediction task within the layer, use the unmasked context of the same layer to recover the masked features, construct a vertical prediction task across layers, and use high-level generalized representations to guide the restoration of fine-grained features at the bottom layer. S6. Construct a joint loss function for multi-task collaborative optimization: The joint loss function constructs a joint optimization objective using mask reconstruction loss, contrastive learning loss, and structural consistency regularization term. An adaptive weighting mechanism is used to dynamically balance each loss term, and the hierarchical trajectory representation model and the stable representation of the trajectory at each layer are obtained through training. S7. Calculate the fusion weights of different levels of representation based on the complexity score, perform weighted fusion of trajectory representations at all levels, output a unified trajectory vector representation, and output the final trajectory similarity through the similarity calculation layer.

[0008] Preferably, preprocessing the original GPS trajectory points and generating semantically enhanced trajectory sequences specifically includes the following steps: S101. The original GPS trajectory points are denoised and cleaned to remove abnormal drift points and invalid sampling points with empty latitude, longitude, or time. The latitude and longitude of the preprocessed trajectory points are transformed to map the geographic coordinates to the trajectory point coordinates in the same plane coordinate system. The remaining sampling points are sorted in ascending order according to the timestamp to obtain the trajectory point sequence, which includes the spatiotemporal information of each trajectory point, including longitude, latitude, coordinates, and time. S102. Extract the road network topology map from the OpenStreetMap data, project the trajectory point sequence onto the road network topology map according to latitude and longitude, use a hidden Markov model to perform map matching, obtain the road segment identifier of each trajectory point, so as to obtain the optimal road segment sequence of the trajectory, and extract the static features contained in each road segment, including road segment length, road type, number of lanes and speed limit. S103. Given the H3 resolution parameters, define a grid mapping function, use the grid mapping function to calculate the grid identifier of each trajectory point, and obtain the grid sequence of the trajectory; S104. After obtaining the road segment identifier and time, calculate the discrete time bucket and retrieve the traffic status of the road segment from the historical traffic status database. The traffic status includes average speed, congestion index, and road saturation. S105. Based on the spatial range of each grid cell, statistically analyze the distribution of K types of POIs within it to obtain the POI category distribution vector; S106. The spatiotemporal information, road segment identifiers, grid identifiers, traffic state quantities, and POI category distribution vectors of the trajectory points are merged at the same granularity to obtain a semantically enhanced trajectory sequence.

[0009] Preferably, constructing time-aligned multimodal feature vectors specifically includes the following steps: S201. Using sine and cosine periodic encoding of time, the absolute timestamp is converted into the time within a day and the time within a week, and the time semantic vector of the trajectory point is constructed. S202. Convert the road segment identifiers and grid identifiers of the trajectory points into topological semantic vectors and spatial semantic vectors using a learnable parameter matrix; S203. Map the static features of the trajectory points into static road semantic vectors using MLP; S204. Map the POI category distribution vector of the trajectory points into a regional functional semantic vector through MLP; S205. Map the historical traffic state features of the trajectory points into traffic semantic vectors using MLP; S206. After unifying and aligning the modal feature vectors, they are fused into a point-level composite representation at the trajectory point granularity, and arranged in chronological order to obtain the input sequence representation of the trajectory.

[0010] Preferably, the trajectory adaptive hierarchical mechanism includes: S301. Extract the complexity index of the trajectory points and their corresponding traffic state vectors, including dispersion, heading change intensity index and traffic state fluctuation intensity index, to form a complexity index vector. S302. Input the complexity index vector into the evaluation module to obtain a complexity score. The evaluation module includes any one of a linear model, a two-layer fully connected network, or a lightweight multilayer perceptron. S303. Preset minimum and maximum number of layers, convert the complexity score into target number of layers through a preset mapping function, and round and truncate the target number of layers to make the target number of layers fall within a preset range.

[0011] Preferably, the traffic state guidance mask and cross-level collaborative prediction mechanism specifically include the following steps: S501. Calculate the intensity and rhythm of traffic state changes along the traffic state vector of the trajectory point sequence; S502. Based on the change intensity and change rhythm, construct a point-level fluctuation score, determine the high fluctuation region index set, prioritize the high fluctuation region as the mask occlusion target, and generate a point-level mask vector. S503. Establish a point-to-hierarchical node coverage mapping for the multi-level trajectory representation, map the point-level mask set to the hierarchical mask set, and generate a hierarchical mask. S504. Replace the masked node with the masked marker vector at any level to obtain the masked input sequence. Set the in-layer horizontal predictor and use the unmasked context of the same layer to recover the occluded features. S505. Establish a parent-child mapping from low-level nodes to high-level nodes, set up a cross-level vertical predictor, and use the high-level generalization representation to guide the recovery of occluded features in the low level. S506. At any level, the masked input sequence is used as the mask to reconstruct training samples, and the true representation of the masked node in the original sequence is used as the reconstruction target to construct training sample-target pairs.

[0012] Preferably, the process of constructing and training the joint loss function for multi-task collaborative optimization specifically includes: S601. Construct a mask input sequence based on the multi-level trajectory representation, the mask set of each layer, and the layer mask vector, and define a supervised traffic state vector for each layer node; S602, Construct a mask to reconstruct the loss; S603. Set up traffic state regression decoding, decode the latent space representation into traffic state prediction, and construct traffic state regression loss. S604. Define a trajectory-level representation extraction operator and introduce a projection head. Construct two random views as positive sample pairs for the same trajectory and build a contrastive learning loss. S605. Construct diversity regularization to prevent representation collapse, hierarchical consistency regularization to avoid excessive or insufficient abstraction, and synthetic structure regularization. S606. Introduce learnable uncertainty parameters to construct an adaptively weighted joint loss. Update the encoder, pooling module, predictor, decoder, and weight parameters by minimizing the joint loss. The expression for the adaptively weighted joint loss is: ; in, Represents the weight parameters. Indicates the loss during mask reconstruction. Indicates the loss due to traffic condition regression. Indicates the contrast learning loss. Represents a structure regularization term; S607. After training, a hierarchical trajectory representation model is obtained, which outputs the stable representation of each layer and the trajectory-level vector for any trajectory input.

[0013] Preferably, the steps include calculating the fusion weights of different levels of representation based on the complexity score, weighting and fusing the trajectory representations at each level, and outputting the trajectory similarity. S701. Construct each level of trajectory representation based on the multi-level trajectory representation and trajectory complexity score; S702. Generate unnormalized weights for each layer based on the complexity score, and obtain the layer fusion weights by using Softmax normalization. S703. Weighted fusion of trajectory-level representations at each level is performed according to the weights to obtain a unified trajectory vector representation. S704. Output a unified vector representation of any two trajectories through a similarity calculation layer, wherein the similarity calculation layer is any one of cosine similarity, bilinear similarity, and MLP similarity. S705. Output a unified vector representation of each trajectory and a similarity score between any two trajectories.

[0014] Compared with the prior art, the beneficial effects of the present invention are: This invention uses a joint retrieval mechanism of "road segment identifier + timestamp" to accurately align dynamic traffic physical quantities such as average speed, congestion index, and road saturation to trajectory points, solving the problem of disconnect between traffic status and trajectory spatiotemporal context. It introduces gridded POI distribution information to endow the trajectory with regional functional semantics, enabling the trajectory representation to reflect the purpose of travel and land use. This invention breaks through the limitations of traditional methods that rely only on geometry or road segment sequences, and constructs a unified representation that includes time, space, road network topology, regional function, and dynamic traffic status. This invention proposes an adaptive principle that "the more complex the trajectory, the deeper the abstraction level should be." It generates a complexity score by quantifying geometric changes (speed dispersion, heading changes) and physical changes (traffic state fluctuations). The method proposed in this invention can automatically allocate more layers to straight-through congested road segments (geometrically simple but physically complex) to retain key traffic event details, and use shallow abstraction for open and unobstructed road segments (geometrically and physically simple) to reduce computational overhead. This achieves intelligent matching of computational resources and representation accuracy, and solves the rigidity problem of "redundant calculation of simple trajectories and loss of details of complex trajectories" caused by the use of fixed layer depth for abstraction in traditional models. This invention generates soft selection weights through a differentiable TopK mechanism, enabling the model to actively learn and retain key nodes through gradient backpropagation. This ensures the optimizability of the pooling process in end-to-end training. Geometric changes (speed difference) and traffic state changes (state difference) are used as the criteria for judging the importance of retained nodes, ensuring that key event nodes are retained. This overcomes the shortcomings of traditional hard pooling (such as max pooling) which is non-differentiable, has sparse gradients, and suffers from the fragmentation of traffic events (such as congestion segments) due to fixed window segmentation. Attached Figure Description

[0015] Figure 1 This is a flowchart of a multimodal adaptive hierarchical trajectory similarity calculation method for traffic conditions proposed in this invention; Figure 2 This is a schematic diagram of the trajectory mapping grid of the present invention; Figure 3 This is a flowchart illustrating the adaptive layering and process of the trajectory of this invention. Figure 4 This is a schematic diagram of the traffic status guidance mask and cross-level collaborative prediction of the present invention. Detailed Implementation

[0016] To further illustrate the technical means and effects of the present invention in achieving its intended purpose, the following detailed description of the specific implementation methods, structures, features, and effects of the present invention, in conjunction with the accompanying drawings and preferred embodiments, is provided below.

[0017] This implementation provides a multimodal adaptive hierarchical trajectory similarity calculation method oriented towards traffic conditions, including the following steps: S1. Collect the original GPS trajectory points and preprocess them. Perform coordinate transformation on the latitude and longitude of the preprocessed trajectory points to obtain a trajectory point sequence sorted by time. Retrieve traffic status from the historical traffic status database using the road segment identifier and timestamp as keys and assign values. Obtain the semantically enhanced trajectory sequence based on the grid identifier associated with the POI category distribution vector. S101. Perform noise reduction and data cleaning on the original GPS trajectory points, removing abnormal drift points and invalid sampling points with empty latitude, longitude, or time. Perform coordinate transformation on the latitude and longitude of the preprocessed trajectory points to convert the geographic coordinates. Mapped to the coordinates of trajectory points in the same plane coordinate system The remaining sampling points are then sorted in ascending order by timestamp to obtain the trajectory point sequence. Each trajectory point This includes the spatiotemporal information of the point, such as longitude, latitude, coordinates, and time; S102. Extracting the road network topology map from OpenStreetMap data , where the set of nodes Represents road intersections or endpoints, and the set of edges. The directed path segment connecting nodes has a polygonal shape. , the trajectory point sequence Projected onto the road network topology map according to latitude and longitude Above, a Hidden Markov Model (HMM) is used for map matching to obtain the road segment identifier for each trajectory point, thus obtaining the optimal road segment sequence for the trajectory. The expression is: ; in, Indicates the first Road segment identifiers for each trajectory point Indicates the first A set of candidate road segments for each trajectory point. , Indicates a fixed search radius. This represents the shortest distance from the point to the broken line of the road segment; This represents the emission probability, used to characterize the geometric consistency of trajectory points falling on candidate road segments; express arrive The transition probability is used to characterize the reachability and consistency of road segments corresponding to adjacent points in the road network topology; Extract the static features contained in each road segment These correspond to the road segment length, road type, number of lanes, and speed limit, respectively. S103. Obtain the grid identifier through grid mapping, given H3 resolution parameters. Define the mesh mapping function Calculate each trajectory point using the grid mapping function. The grid identifier, expressed as: ; Obtain the grid sequence of the trajectory ; S104, after obtaining road segment signs With time Next, the discrete-time bucket is calculated, and the expression is: ; in, Indicates time-discrete granularity; From historical traffic data database Traffic conditions of the search section The expression is: ; in, This represents the key-value mapping form of the historical traffic status database, a value vector. These represent the traffic status fields of the road segment within the time bucket, such as average speed, congestion index, and road saturation. S105, Based on each grid cell The distribution of K types of POIs within a spatial range is statistically analyzed, and the expression is as follows: ; in, Represents a grid The number of POIs of type k within the inner domain. Represents a grid Total number of internal POIs; Grid The expression for the POI category distribution vector within the range is: ; S106. The spatiotemporal information, road segment identifiers, grid identifiers, traffic state variables, and POI category distribution vectors of the trajectory points are merged at the same granularity to obtain the semantically enhanced trajectory points, expressed as: ; The semantically enhanced trajectory sequence is obtained, expressed as: .

[0018] S2. Using the trajectory points as a unified alignment unit, perform multi-scale periodic time representation on the timestamps to obtain daily / weekly periodic regular time-frequency semantics. Convert the road segment identifiers and grid identifiers into spatial / topological semantic vectors through the embedding layer, map the POI category distribution vectors into regional functional semantic vectors, map continuous traffic state quantities into state semantic vectors, and align and project the time-frequency semantics, spatial / topological semantics, regional functional semantics, and traffic state semantics to a unified dimension for joint fusion to form a time-aligned multimodal feature vector. S201. Utilize sine and cosine periodic encoding of time to convert absolute timestamps. Converted to daily time and time within a week The expression is: ; in, This indicates the week index corresponding to the timestamp (e.g., Monday is 0). Indicates the daily cycle. , Indicates the weekly cycle. ; Construct the first The temporal semantic vector of each trajectory point is expressed as: ; in, Represents the angular frequency function. ; S202, Identify the road segments of the trajectory points using a learnable parameter matrix. and grid markings Convert to topological semantic vector and spatial semantic vectors The expression is: ; in, , The learnable parameter matrix is ​​represented, which maps the road segment sequence and grid sequence to embedding vectors. S203. Map the static features of the trajectory points into static road semantic vectors using MLP. The expression is: ; in, MLP refers to the mapping of static attributes such as road class, length, speed limit, and one-way attributes to spatial / topological semantics. S204. Map the POI category distribution vector of the trajectory points to a region functional semantic vector using MLP. ; ; in, MLP is used to map the POI category distribution structure within a grid to region functional semantics. S205. Map the historical traffic state features of the trajectory points into traffic semantic vectors using MLP. The expression is: ; in, Indicates MLP; S206. After unifying and aligning the modal feature vectors, they are fused into a point-level composite representation at the trajectory point granularity, and arranged in chronological order to obtain the input sequence representation of the trajectory. because First, project the temporal semantics onto a unified dimension. The expression is: ; in, , Indicates learnable parameters; The aligned semantic vectors are then fused at the trajectory point granularity into a point-level composite representation, expressed as follows: ; in, Indicates splicing, , Indicates learnable parameters; Arranging the point-level composite representation in chronological order yields the input sequence representation of the trajectory, expressed as: .

[0019] S3. Construct an adaptive hierarchical mechanism for the trajectory: Extract complexity indicators from the geometric changes of the trajectory and the changes in traffic conditions to form a complexity indicator vector, including speed dispersion, heading change intensity, and traffic condition fluctuation intensity; input the complexity indicator vector into the evaluation module to obtain a complexity score, and convert the complexity into a target number of layers through a preset mapping; round the target number of layers and truncate it to fall within the preset minimum and maximum number of layers, and output the complexity score and target number of the trajectory. S301. Extract the trajectory points. and its corresponding traffic state vector The complexity indicators include dispersion, heading change intensity, and traffic condition fluctuation intensity: The expression for the velocity dispersion index is: ; ; The heading change intensity index is calculated first from adjacent trajectory points, with the following expression: ; Next, calculate the intensity of the course change, expressed as: ; in, This means normalizing the angular difference to... ; The expression for the traffic condition fluctuation intensity index is: ; Construct a complexity vector from the complexity metrics. The expression is: ; S302, convert the complexity index vector Input evaluation module The complexity score is obtained by the following expression: in, Denotes the Sigmoid function, which makes... ; The evaluation module includes any one of a linear model, a two-layer fully connected network, or a lightweight multilayer perceptron; S303, Preset minimum number of layers With the maximum number of layers The complexity is scored by a preset mapping function. Convert to target layer number The expression is: ; in, This represents the integer operation. This indicates boundary truncation, causing the target layer number to fall within... Output trajectory complexity score With the target number of layers This is used for bottom-up hierarchical construction in subsequent steps; Step S3 proposes a trajectory adaptive layering mechanism, which breaks through the rigid design of fixed layer depth in traditional models. Based on the principle that "the more complex the trajectory, the deeper the abstraction level should be", the geometric and physical dimensions of the trajectory are incorporated into the depth decision consideration. This allows the model to automatically increase the number of trajectory layers to retain more fine-grained physical features in scenarios with simple geometry but extremely complex traffic conditions (such as straight-through congestion sections).

[0020] S4. Construct a differentiable sequence pooling mechanism for traffic perception; The hierarchical representation is constructed from bottom to top according to the target number of layers. The generation of each layer is completed by performing a sequence pooling operation on the sequence of the previous layer: taking the input sequence of the current layer as the pooling object, a pooling window / neighborhood relationship is constructed in the temporal neighborhood, and the importance score of each node is calculated by combining the geometric changes and traffic state changes within the window; based on the importance score, a differentiable TopK selection operator is used to generate the soft selection weight of the nodes, thereby determining the pooling retention scale of this layer and completing adaptive downsampling to obtain the pooled output sequence composed of retained nodes; at the same time, the nodes that are not retained are pooled and aggregated according to their temporal neighborhood / adjacent retained node intervals, and their features are aggregated into segment-level attributes and attached to the adjacent retained nodes to obtain a multi-level trajectory representation with layer-by-layer length compression and layer-by-layer semantic generalization; S401, using the multimodal feature vector of the trajectory points and target layer The number of pooling operations is determined by the following expression: ; Construct a hierarchical representation from bottom to top according to the target number of layers, and perform a sequence pooling operation on the previous layer sequence to generate a new layer; S402. Construct a fixed-window temporal neighborhood for the sequence index at each level; In the layer For sequence indexing To construct a fixed window neighborhood, the expression is: ; in, Indicates the preset half-window width. Indicates the first Layer sequence length (and ); S403. Using the current layer input sequence as the pooling object, construct a pooling window / neighborhood relationship in the time neighborhood, calculate the trajectory motion speed from the displacement and time difference of adjacent points, define the intensity of local geometric changes, calculate the adjacent difference amplitude of the traffic state vector, and linearly fuse the geometric changes and traffic state abrupt changes after normalization to obtain the node importance score. First, calculate the trajectory velocity using the displacement and time difference between adjacent points (with the initial point set to zero). The expression is: ; The intensity of local geometric change is defined as follows: ; The expression for calculating the adjacent difference magnitude of the traffic state vector (with the first point set to zero) is as follows: ; After normalizing and linearly fusing the geometric changes and traffic state abrupt changes, the node importance score is obtained, expressed as: ; in, Indicates the weighting coefficient. Represents the normalization function; S404. Use a differentiable TopK selection operator to generate soft selection weights, determine the target pooling retention number of this layer and complete adaptive downsampling to obtain the pooling output sequence composed of the retained nodes; Let the first The number of layer targets to retain is And a differentiable TopK selection operator is used to generate soft selection weights, the expression of which is: ; in, , Represents the temperature parameter, the first Number of layer targets retained satisfy: ; in, Indicates the preset or retention ratio related to the target layer number H; S405. Soft selection weights determine the set of retained indexes and connect the retained nodes in the original sequence order to maintain the original time order topology; The soft selection weights determine the set of indexes to retain, expressed as: ; S406. Define the coverage area of ​​the reserved node, calculate the segment-level duration and distance, perform weighted statistics on the traffic piles in the segment to obtain the segment-level state features, and map the segment-level attributes into segment semantic vectors. For adjacent reserved nodes Define the coverage interval as follows: ; The expression for calculating segment-level duration and distance is: ; The segment-level state characteristics are obtained by weighted statistical analysis of traffic conditions within the interval, and the expression is as follows: ; The segment-level attributes are mapped to segment semantic vectors, as expressed by: ; in, This represents a linear layer or a lightweight multilayer perceptron. S407. Pool and aggregate the unretained nodes according to their time neighborhood / adjacent retained node intervals. Aggregate the features of the unretained nodes into segment-level attributes and append them to adjacent retained nodes. Merge the point semantics and segment semantics of the retained nodes to obtain the next-level node representation. The expression is: ; Get the first Layer sequence ; Repeat steps S401 to S406 M times to obtain a multi-level trajectory representation with layer-by-layer length compression and layer-by-layer semantic generalization, expressed as: ; The sequence length is compressed layer by layer, while the semantic continuity of traffic is maintained and semantic dimensionality is upgraded from point-level features to path segment-level features through segment-level attribute aggregation. Step S4 proposes a differentiable sequence pooling method for traffic perception, overcoming the shortcomings of traditional pooling (such as max pooling) in terms of non-differentiability and hard segmentation: the output of max pooling is determined by a single extreme point within the window, and the gradient is only backpropagated to that point, while the gradients of other points are zero. This approach makes the entire process non-differentiable, the learning signal sparse, and the training unstable. Meanwhile, hard segmentation uses a fixed window and step size to mechanically cut the sequence into blocks. The window boundary is determined by parameters rather than by traffic events. As a result, a complete congested road segment may be cut, leaving only a certain "peak point", causing semantic loss. Importance sampling is achieved through differentiable soft sorting, enabling the model to actively learn "which high-weight points should be retained" through gradient backpropagation. In addition, by aggregating the information of discarded nodes according to the intervals of adjacent retained nodes and encoding it into segment-level summary features, the granularity of feature representation from point-level feature representation is improved to segment-level feature representation while maintaining the topological integrity of the graph sequence, thus enhancing trajectory representation.

[0021] S5. Construct a traffic state guidance mask and cross-level collaborative prediction mechanism: Analyze the intensity and rhythm of traffic state changes along the trajectory, identify high-fluctuation areas where road conditions change significantly, and prioritize the high-fluctuation areas as masking targets. Construct a horizontal prediction task within the layer, use the unmasked context of the same layer to recover the masked features, construct a vertical prediction task across layers, and use high-level generalized representations to guide the restoration of fine-grained features at the bottom layer. S501. Calculate the intensity and rhythm of traffic state changes along the traffic state vector of the trajectory point sequence; Along the trajectory point sequence Traffic state vector Calculate the intensity and rhythm of traffic state changes: The intensity of change is defined as the adjacent difference norm, expressed as: ; The rhythm of change is defined as the degree of fluctuation of the intensity of change within a local window, and its expression is: ; in, This indicates the window radius; windows that exceed the boundary will be either truncated or copied to the boundary. S502. Construct a point-level fluctuation score based on the aforementioned change intensity and change rhythm, expressed as: ; Determine the set of indexes for high volatility regions ,in At least the TopK rule must be satisfied, that is ; The high-fluctuation region is preferentially selected as the masking target, and a point-level mask vector is generated. , making hour, ,otherwise ; S503, for the multi-level trajectory (in The representation establishes a coverage mapping from points to hierarchical nodes, and sets the point-level mask set. Mapped to a set of hierarchical masks And generate a hierarchical mask. , making hour, ,otherwise ; S504, Any level Use masked vectors Replace the masked nodes to obtain the masked input sequence. Its node expression is: ; Set up in-layer horizontal predictor The occluded features are recovered using the unoccluded context of the same layer, expressed as: ; S505, for any low layer Establish low-level nodes Parent-child mapping to higher-level nodes Set up a cross-layer vertical predictor Using high-level generalization representation The expression for guiding the recovery of occluded features at lower levels is: ; in, Indicates the relationship with lower-level nodes The index of the higher-level node corresponding to the time coverage interval; Used to inject high-level robust generalization information into the low-level fine-grained reconstruction process; S506, Any level Chinese and Israeli masked input sequences As training samples for mask reconstruction, the true representation of the masked nodes in the original sequence. ( As the reconstruction target, we construct training sample-target pairs, expressed as: ; And predict the output With corresponding target This generates a supervisory signal, which is used for subsequent mask reconstruction training. The core innovation of step S5 lies in proposing a traffic state-guided masking and cross-level collaborative prediction mechanism. Unlike the random masking approach in traditional pre-training, this mechanism actively locates and prioritizes masking high-fluctuation areas through traffic state change analysis, forcing the model to learn the contextual dependencies "before and after the mutation," thereby reducing the risk of key traffic events being ignored or diluted by noise. At the same time, it introduces cross-level vertical prediction, allowing more macroscopic and robust generalized information from higher levels to participate in constraining the recovery of details in lower levels, enhancing the semantic consistency and coupling strength between different levels of representation, and thus improving the ability of trajectory representation to characterize traffic events.

[0022] S6. Construct a joint loss function for multi-task collaborative optimization: The joint loss function constructs a joint optimization objective using mask reconstruction loss, contrastive learning loss, and structural consistency regularization term. An adaptive weighting mechanism is used to dynamically balance each loss term, and the hierarchical trajectory representation model and the stable representation of the trajectory at each layer are obtained through training. S601, Based on the multi-level trajectory representation Mask sets for each layer Hierarchical mask vector Construct the masked input sequence The expression is: ; For any masked node The two types of prediction outputs are obtained from the intra-layer predictor and the cross-layer predictor, and the expression is: ; in, For low-level nodes The corresponding high-level parent node index is represented by a unified notation, and the final reconstructed representation is defined as follows: ; in, Indicates a preset constant or a learnable parameter; Define a supervisory traffic state vector for each layer node (derived from the historical traffic state field in step S1 and aggregated / inherited to the layer nodes according to step S4), with the following expression: ; in, This field represents the historical average speed of the road segment corresponding to this node within the corresponding time bucket. For the congestion index field, For road saturation field; S602, Construct a mask to reconstruct the loss; Define the Smooth L1 function The latent space reconstruction loss is constructed for all masked nodes in all layers, and its expression is: ; in, For the original and true representation target, To predict and reconstruct characterization; S603, Setting up Traffic State Regression Decoding (Linear layer or lightweight MLP) decodes the latent space representation into traffic state prediction, expressed as: ; The traffic state regression loss is constructed for the masked nodes, and the expression is: ; in, The supervision target consists of historical traffic status fields, which are used to anchor the implicitly represented traffic physical semantics. S604. To obtain global discriminative power, define a trajectory-level representation extraction operator. And introduce a projection head Each trajectory is represented at the top level. The trajectory-level vector is obtained from the above, and its expression is: ; Construct two random views of the same trajectory (e.g., different mask sampling or different augmented views). As positive sample pairs, other trajectories within the same batch are represented as negative sample sets. Define the similarity function: ; The InfoNCE loss expression is then: ; in, Indicates batch size, For temperature parameters; S605. Construct diversity regularization to prevent representation collapse (suppress collapse and constrain the rationality of abstraction), hierarchical consistency regularization to avoid excessive or insufficient abstraction, and synthetic structure regularization terms: Diversity regularization (preventing representation collapse): for intra-batch trajectory-level representations Calculate the standard deviation of each dimension Construct a lower bound regularization for variance: ; in, Indicates a preset threshold; Hierarchical consistency / abstraction penalty (avoiding over- or under-abstraction): parent-child mapping from low-level to high-level layers. Define the low-level aggregate representation of child nodes (taking the mean as an example): ; And constrain its representation with the corresponding higher-level parent node. Consistency: ; The above regular expressions are combined into a structural regular expression, which is: ; in, Indicates the weighting coefficient; S606, Introduce learnable uncertainty parameters Construct an adaptively weighted joint loss, expressed as: ; in, Represents the weight parameters. Indicates the loss during mask reconstruction. Indicates the loss due to traffic condition regression. Indicates the contrast learning loss. Represents a structure regularization term; By minimizing the joint loss Update the encoder, pooling module, and predictor in steps 2 through 5. decoder and weight parameters The adaptive weighted joint loss achieves a dynamic balance between mask reconstruction, traffic semantic anchoring, global discriminability, and structural consistency. S607. After training, a hierarchical trajectory representation model is obtained. For any trajectory input (without masking or multiple random masking options), the model outputs the stable representation of each layer. and trajectory-level vector This is used for subsequent similarity calculations and integration with downstream tasks; Step S6 constructs a joint loss function for multi-task collaborative optimization. This method does not simply superimpose conventional losses, but sets corresponding constraints for four key points in hierarchical abstraction: "detail recoverability, physical state regressibility, global discriminability, and hierarchical structure rationality". This allows the model to retain key traffic event details after compression, while also ensuring that the high-level generalized representation has clear traffic semantics and serves similarity discrimination. At the same time, structural consistency constraints stabilize the hierarchical abstraction process and reduce performance fluctuations caused by over- or under-abstract abstraction. The accompanying adaptive weighting mechanism further realizes adaptive trade-offs among multiple tasks, ensuring that the above four objectives can be achieved collaboratively in the same model from the perspective of training stability.

[0023] S7. Calculate the fusion weights of different levels of representation based on the complexity score, perform weighted fusion of trajectory representations at all levels, output a unified trajectory vector representation, and output the final trajectory similarity through the similarity calculation layer. S701, Based on the multi-level trajectory representation Trajectory complexity score To perform hierarchical fusion, first construct a trajectory-level representation for each layer (read out within the layer), the expression is: ; in, This represents any one of average pooling, attention pooling, or a combination thereof; S702. Generate unnormalized weights for each layer based on the complexity score, and obtain the layer fusion weights by using Softmax normalization. (1) Hierarchical mapping of complexity scores: Score based on complexity The unnormalized weights (scores) for each layer are generated using the following expression: ; in, This indicates a preset mapping function or a learnable lightweight function. It can be either a linear model or a two-layer fully connected network; this embodiment uses a linear mapping. ; in, , Indicates learnable parameters or preset parameters; (2) Weight normalization: (3) Softmax normalization is applied to the scores of each layer to obtain the layer fusion weight, which is expressed as: ; This allows the fusion weights to be determined solely by the complexity score. Decision and follow change; S703. Weighted fusion of the trajectory-level representations at each level is performed according to their respective weights to obtain a unified trajectory vector representation, expressed as follows: ; S704. The unified vector representation of any two trajectories output through the similarity calculation layer is denoted as follows: The similarity calculation layer can be any of the following: Cosine similarity: ; Bilinear similarity: ,in, Represents the learnable parameter matrix MLP similarity: ,in, This represents a multilayer perceptron, and ⊙ represents the Hadamard product; S705, Output a unified vector representation for each trajectory. And the similarity score of any two trajectories It is used for trajectory similarity retrieval and integration with downstream application tasks.

[0024] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.

Claims

1. A multimodal adaptive hierarchical trajectory similarity calculation method oriented towards traffic conditions, characterized in that, Includes the following steps: S1. Collect the original GPS trajectory points and preprocess them. Retrieve traffic status from the historical traffic status database using road segment identifier and timestamp as keys and assign values. Obtain the semantically enhanced trajectory sequence based on the grid identifier associated with the POI category distribution vector. S2. Using the trajectory points as a unified alignment unit, the timestamps are represented by multi-scale periodic time to obtain time-frequency semantics. The road segment identifiers and grid identifiers are converted into spatial / topological semantic vectors through an embedding layer. The POI category distribution vector is mapped to a regional functional semantic vector, and the continuous traffic state quantities are mapped to state semantic vectors. The time-frequency semantics, spatial / topological semantics, regional functional semantics and traffic state semantics are aligned and projected to a unified dimension for joint fusion to form a time-aligned multimodal feature vector. S3. Construct a trajectory adaptive hierarchical mechanism: Extract complexity indicators from the geometric changes of the trajectory and the changes in traffic conditions to form a complexity indicator vector, including speed dispersion, heading change intensity and traffic condition fluctuation intensity. Input the vector into the evaluation module to obtain a complexity score, and then map it to the target number of layers. S4. Construct a differentiable sequence pooling mechanism for traffic perception. Generate new layers from bottom to top according to the target number of layers. Calculate the importance score of each node in the temporal neighborhood by combining geometric changes and traffic state changes. Generate soft selection weights through differentiable TopK to achieve adaptive downsampling. Output the sequence of retained nodes. Aggregate the discarded nodes into segment-level attributes according to intervals and attach them to the adjacent retained nodes to obtain a multi-level trajectory representation with layer-by-layer length compression and layer-by-layer semantic generalization. S5. Construct a traffic state guidance mask and cross-level collaborative prediction mechanism: Analyze the intensity and rhythm of traffic state changes along the trajectory, identify high-fluctuation areas where road conditions change significantly, and prioritize the high-fluctuation areas as masking targets. Construct a horizontal prediction task within the layer, use the unmasked context of the same layer to recover the masked features, construct a vertical prediction task across layers, and use high-level generalized representations to guide the restoration of fine-grained features at the bottom layer. S6. Construct a joint loss function for multi-task collaborative optimization, and use an adaptive weighting mechanism to dynamically balance each loss term to train and obtain a hierarchical trajectory representation model and a stable representation of the trajectory at each layer. S7. Calculate the fusion weights of different levels of representation based on the complexity score, perform weighted fusion of trajectory representations at all levels, output a unified trajectory vector representation, and output the final trajectory similarity through the similarity calculation layer.

2. The multimodal adaptive hierarchical trajectory similarity calculation method for traffic conditions according to claim 1, characterized in that, Preprocessing the original GPS trajectory points to generate semantically enhanced trajectory sequences specifically includes the following steps: S101. The original GPS trajectory points are denoised and cleaned to remove abnormal drift points and invalid sampling points with empty latitude, longitude, or time. The latitude and longitude of the preprocessed trajectory points are transformed to map the geographic coordinates to the trajectory point coordinates in the same plane coordinate system. The remaining sampling points are sorted in ascending order according to the timestamp to obtain the trajectory point sequence, which includes the spatiotemporal information of each trajectory point, including longitude, latitude, coordinates, and time. S102. Extract the road network topology map from the OpenStreetMap data, project the trajectory point sequence onto the road network topology map according to latitude and longitude, use a hidden Markov model to perform map matching, obtain the road segment identifier of each trajectory point, so as to obtain the optimal road segment sequence of the trajectory, and extract the static features contained in each road segment, including road segment length, road type, number of lanes and speed limit. S103. Given the H3 resolution parameters, define a grid mapping function, use the grid mapping function to calculate the grid identifier of each trajectory point, and obtain the grid sequence of the trajectory; S104. After obtaining the road segment identifier and time, calculate the discrete time bucket and retrieve the traffic status of the road segment from the historical traffic status database. The traffic status includes average speed, congestion index, and road saturation. S105. Based on the spatial range of each grid cell, statistically analyze the distribution of K types of POIs within it to obtain the POI category distribution vector; S106. The spatiotemporal information, road segment identifiers, grid identifiers, traffic state quantities, and POI category distribution vectors of the trajectory points are merged at the same granularity to obtain a semantically enhanced trajectory sequence.

3. The multimodal adaptive hierarchical trajectory similarity calculation method for traffic conditions according to claim 1, characterized in that, Constructing time-aligned multimodal feature vectors specifically includes the following steps: S201. Using sine and cosine periodic encoding of time, the absolute timestamp is converted into the time within a day and the time within a week, and the time semantic vector of the trajectory point is constructed. S202. Convert the road segment identifiers and grid identifiers of the trajectory points into topological semantic vectors and spatial semantic vectors using a learnable parameter matrix; S203. Map the static features of the trajectory points into static road semantic vectors using MLP; S204. Map the POI category distribution vector of the trajectory points into a regional functional semantic vector through MLP; S205. Map the historical traffic state features of the trajectory points into traffic semantic vectors using MLP; S206. After unifying and aligning the modal feature vectors, they are fused into a point-level composite representation at the trajectory point granularity, and arranged in chronological order to obtain the input sequence representation of the trajectory.

4. The multimodal adaptive hierarchical trajectory similarity calculation method for traffic conditions according to claim 1, characterized in that, The trajectory adaptive hierarchical mechanism includes: S301. Extract the complexity index of the trajectory points and their corresponding traffic state vectors, including dispersion, heading change intensity index and traffic state fluctuation intensity index, to form a complexity index vector. S302. Input the complexity index vector into the evaluation module to obtain a complexity score. The evaluation module includes any one of a linear model, a two-layer fully connected network, or a lightweight multilayer perceptron. S303. Preset minimum and maximum number of layers, convert the complexity score into target number of layers through a preset mapping function, and round and truncate the target number of layers to make the target number of layers fall within a preset range.

5. The multimodal adaptive hierarchical trajectory similarity calculation method for traffic conditions according to claim 1, characterized in that, The traffic perception differentiable sequence pooling mechanism generates multi-level trajectory representations through the following steps: S401. Determine the number of pooling operations using the multimodal feature vectors of the trajectory points and the target layer number, construct a hierarchical representation from bottom to top according to the target layer number, and perform a sequence pooling operation on the previous layer sequence to generate a new layer; S402. Construct a fixed-window temporal neighborhood for the sequence index at each level; S403. Using the current layer input sequence as the pooling object, construct a pooling window / neighborhood relationship in the time neighborhood, calculate the trajectory motion speed from the displacement and time difference of adjacent points, define the intensity of local geometric changes, calculate the adjacent difference amplitude of the traffic state vector, and linearly fuse the geometric changes and traffic state abrupt changes after normalization to obtain the node importance score. S404. Use a differentiable TopK selection operator to generate soft selection weights, determine the target pooling retention number of this layer and complete adaptive downsampling to obtain the pooling output sequence composed of the retained nodes; S405. Soft selection weights determine the set of retained indexes and connect the retained nodes in the original sequence order to maintain the original time order topology; S406. Define the coverage area of ​​the reserved node, calculate the segment-level duration and distance, perform weighted statistics on the traffic piles in the segment to obtain the segment-level state features, and map the segment-level attributes into segment semantic vectors. S407. Pool and aggregate the unretained nodes according to their time neighborhood / adjacent retained node intervals. Aggregate the features of the unretained nodes into segment-level attributes and attach them to the adjacent retained nodes. Fuse the point semantics and segment semantics of the retained nodes to obtain the next layer of node representation. Repeat steps S401 to S406 for a total of M times to obtain a multi-level trajectory representation with layer-by-layer length compression and layer-by-layer semantic generalization.

6. The multimodal adaptive hierarchical trajectory similarity calculation method for traffic conditions according to claim 1, characterized in that, The traffic status guidance mask and cross-level collaborative prediction mechanism specifically include the following steps: S501. Calculate the intensity and rhythm of traffic state changes along the traffic state vector of the trajectory point sequence; S502. Based on the change intensity and change rhythm, construct a point-level fluctuation score, determine the high fluctuation region index set, prioritize the high fluctuation region as the mask occlusion target, and generate a point-level mask vector. S503. Establish a point-to-hierarchical node coverage mapping for the multi-level trajectory representation, map the point-level mask set to the hierarchical mask set, and generate a hierarchical mask. S504. Replace the masked node with the masked marker vector at any level to obtain the masked input sequence. Set the in-layer horizontal predictor and use the unmasked context of the same layer to recover the occluded features. S505. Establish a parent-child mapping from low-level nodes to high-level nodes, set up a cross-level vertical predictor, and use the high-level generalization representation to guide the recovery of occluded features in the low level. S506. At any level, the masked input sequence is used as the mask to reconstruct training samples, and the true representation of the masked node in the original sequence is used as the reconstruction target to construct training sample-target pairs.

7. The multimodal adaptive hierarchical trajectory similarity calculation method for traffic conditions according to claim 1, characterized in that, The process of constructing and training the joint loss function for the multi-task collaborative optimization specifically includes: S601. Construct a mask input sequence based on the multi-level trajectory representation, the mask set of each layer, and the layer mask vector, and define a supervised traffic state vector for each layer node; S602, Construct a mask to reconstruct the loss; S603. Set up traffic state regression decoding, decode the latent space representation into traffic state prediction, and construct traffic state regression loss. S604. Define a trajectory-level representation extraction operator and introduce a projection head. Construct two random views as positive sample pairs for the same trajectory and build a contrastive learning loss. S605. Construct diversity regularization to prevent representation collapse, hierarchical consistency regularization to avoid excessive or insufficient abstraction, and synthetic structure regularization. S606. Introduce learnable uncertainty parameters to construct an adaptively weighted joint loss. Update the encoder, pooling module, predictor, decoder, and weight parameters by minimizing the joint loss. The expression for the adaptively weighted joint loss is: ; in, Represents the weight parameters. Indicates the loss during mask reconstruction. Indicates the loss due to traffic condition regression. Indicates the contrast learning loss. Represents a structural regularization term. S607. After training, a hierarchical trajectory representation model is obtained, which outputs the stable representation of each layer and the trajectory-level vector for any trajectory input.

8. The multimodal adaptive hierarchical trajectory similarity calculation method for traffic conditions according to claim 1, characterized in that, The fusion weights for different levels of representation are calculated based on the complexity score. The trajectory representations at each level are weighted and fused, and the trajectory similarity is output. The specific steps include: S701. Construct each level of trajectory representation based on the multi-level trajectory representation and trajectory complexity score; S702. Generate unnormalized weights for each layer based on the complexity score, and obtain the layer fusion weights by using Softmax normalization. S703. Weighted fusion of trajectory-level representations at each level is performed according to the weights to obtain a unified trajectory vector representation. S704. Output a unified vector representation of any two trajectories through a similarity calculation layer, wherein the similarity calculation layer is any one of cosine similarity, bilinear similarity, and MLP similarity. S705. Output a unified vector representation of each trajectory and a similarity score between any two trajectories.

Citation Information

Patent Citations

  • Differential model scaling method and system based on differentiable topk

    CN117195999A

  • Artificial intelligence modeling techniques for joint behavioral planning and prediction

    CN120166977A

  • Method and apparatus for trajectory estimation, and method for segmentation

    US20120106794A1