Motor vehicle trip chain intelligent generation method based on attention mechanism
By adopting a Transformer-based attention mechanism and a multi-task pre-training scheme, the problem of travel chain reconstruction for sparse and fragmented AVI data is solved, achieving high-precision and highly adaptable travel chain generation, and supporting the construction of intelligent transportation systems.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SOUTHEAST UNIV
- Filing Date
- 2025-06-11
- Publication Date
- 2026-05-19
AI Technical Summary
Existing technologies struggle to efficiently reconstruct motor vehicle travel chains from sparse and fragmented AVI detector data, especially in environments with wide detection blind spots or uneven coverage, where the model's inference accuracy and generalization ability are insufficient.
By employing a Transformer-based attention mechanism, combined with multi-task pre-training and hierarchical fine-tuning, a pre-training scheme for autoregressive generation and contrastive learning is designed. Through standardized lexicalization, cross-attention, and cluster analysis, accurate reasoning and batch generation of travel chains are achieved.
It improves the accuracy of travel chain inference and the ability to adapt to individual heterogeneity in complex environments, and can generate high-quality continuous travel chains under large-scale conditions, supporting the construction of intelligent transportation systems.
Smart Images

Figure CN120783511B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of traffic behavior modeling and artificial intelligence, specifically to a method for intelligent generation of motor vehicle travel chains based on an attention mechanism. Background Technology
[0002] With the rapid development of urban transportation systems and the continuous growth of motor vehicle ownership, refined modeling and intelligent reasoning of traffic behavior have become important directions in the fields of intelligent transportation, urban planning, and traffic management. Traditional data collection methods (such as questionnaires, GPS tracking, and mobile phone signaling) are limited by small data scale, low response rate, and high privacy protection requirements, making it difficult to meet the needs of large-scale, real-time, and low-intervention travel chain reconstruction. In recent years, fragmented travel observation data based on AVI detectors have gradually become an important data source for motor vehicle travel behavior modeling due to their high coverage, low cost, and privacy advantages. However, AVI data is naturally sparse and fragmented, and continuous vehicle travel chains are often missing. Existing methods that rely on rule inference or statistical regression are unable to capture complex spatiotemporal correlation features, resulting in insufficient inference accuracy and generalization ability. In particular, in environments with wide detection blind spots or uneven density, model performance further declines.
[0003] To address the aforementioned challenges, there is an urgent need for an intelligent generation method capable of inferring complete travel chains based on fragmented observations, and possessing high scalability and personalized adaptability. The Transformer architecture and its attention mechanism have demonstrated excellent performance in natural language processing and sequence modeling, particularly adept at handling long-distance dependencies and missing information. Introducing the Transformer into the motor vehicle travel chain inference task, and structurally modifying it to suit the characteristics of AVI data, can effectively improve the accuracy and robustness of travel chain generation. Furthermore, combining multi-task pre-training, contrastive learning, and hierarchical fine-tuning techniques helps capture diverse travel patterns of millions of vehicles at the urban scale, further enhancing the model's inference capabilities and its ability to adapt to individual heterogeneity.
[0004] Against this backdrop, this invention proposes an intelligent generation method for motor vehicle travel chains based on an attention mechanism. It constructs a standardized lexicalization system for dual sequences of observations and travel chains, improves the Transformer encoding / decoding structure that integrates spatiotemporal correlations, designs a pre-training scheme combining autoregressive generation and contrastive learning, and achieves heterogeneous adaptation of travel groups through hierarchical fine-tuning. This method can efficiently infer and generate high-quality motor vehicle travel chains in batches under fragmented observation conditions, providing strong support for the construction of intelligent transportation systems. Summary of the Invention
[0005] The objective of this invention is to provide an intelligent method for generating motor vehicle travel chains based on an attention mechanism. This method, targeting fragmented motor vehicle travel observation data acquired by an AVI detector, employs standardized lexicalization, joint embedding representation, multi-task pre-training, and hierarchical fine-tuning to accurately infer and batch generate continuous travel chains that conform to spatiotemporal constraints. This method effectively improves inference accuracy and individual heterogeneity adaptation capabilities in complex environments with wide detection blind spots and uneven coverage, providing novel technical support for large-scale travel chain reconstruction and intelligent traffic management.
[0006] To achieve the above functions, this invention designs an intelligent generation method for motor vehicle travel chains based on an attention mechanism. It utilizes in-road and out-of-road AVI detectors to acquire fragmented travel observation data of individual vehicles, and executes the following steps S1-S4 to realize the reasoning and batch generation of continuous vehicle travel chains:
[0007] Step S1: Based on the association between the AVI observation data of individual vehicles and the travel behavior attributes, the AVI observation data sequence and the travel behavior sequence are represented by lexicalization. Semantic embedding and syntactic embedding are performed on the obtained AVI observation lexical and travel behavior lexical to construct the embedding vector representation and establish the basic sentence model.
[0008] Step S2: Improve the Transformer-based encoder, decoder, and encoder-decoder fusion method. The encoder uses self-attention to process the input AVI observation data sequence with missing values. The encoder-decoder fusion method introduces a cross-attention mechanism to match the embedding vector sequence of AVI observation data with the embedding vector sequence of travel behavior. The decoder generates variable-length travel chains through mask attention.
[0009] Step S3: Design a pre-training scheme that includes an autoregressive generation task and a contrastive learning task. The contrastive learning task is trained using a triplet loss function, and the autoregressive generation task takes the AVI observation data sequence as input and predicts the travel chain step by step by maximizing the likelihood function.
[0010] Step S4: Divide travel groups with similar characteristics through cluster analysis, and use a hierarchical fine-tuning strategy and lightweight adapter method to achieve individual heterogeneity adaptation. Generate candidate travel chains in batches in the form of command-response dialogue, and output Top-K high confidence results by combining generation probability and spatiotemporal consistency constraints to complete the batch generation of vehicle travel chains.
[0011] Beneficial effects: Compared with the prior art, the advantages of the present invention include:
[0012] 1. More accurate spatiotemporal correlation modeling capability. This invention innovatively improves the Transformer encoding and decoding structure by introducing a multi-head attention mechanism that integrates spatiotemporal features. It can accurately capture complex spatiotemporal dependencies in fragmented AVI observation data, significantly improving the accuracy of trip chain inference, and outperforming traditional rule-based inference, simple matching, or regression methods.
[0013] 2. It possesses stronger adaptability and generalization ability. Through techniques such as multi-task pre-training, autoregressive generation, and contrastive learning, the model can encode city-level motor vehicle travel patterns and has high robustness and good scalability under different detection coverage and travel pattern diversity conditions, overcoming the performance degradation problem of existing methods in areas with wide blind spots or sparse detection areas.
[0014] 3. It possesses a superior individual heterogeneity adaptation mechanism. This invention combines cluster analysis with a hierarchical fine-tuning strategy and employs lightweight adapter technology to achieve personalized adaptation for different travel groups (such as commuters, business travelers, etc.). It can intelligently adjust the inference process based on individual differences, thereby improving the personalization, diversity, and application flexibility of the generated results. Attached Figure Description
[0015] Figure 1 This is a flowchart of an intelligent generation method for motor vehicle travel chains based on an attention mechanism, provided by an embodiment of the present invention.
[0016] Figure 2 This is a schematic diagram illustrating the modeling concept of AVI observation data sequence and chained travel sequence statements provided in an embodiment of the present invention;
[0017] Figure 3 This is a schematic diagram of the overall architecture of the improved attention mechanism and encoding / decoding structure provided in the embodiments of the present invention. Detailed Implementation
[0018] The present invention will be further described below with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and should not be used to limit the scope of protection of the present invention.
[0019] This invention provides an intelligent generation method for motor vehicle travel chains based on an attention mechanism, referring to... Figure 1 By using in-road and out-of-road AVI detectors to acquire fragmented travel observation data of individual vehicles, the following steps S1-S4 are executed to achieve the inference and batch generation of continuous travel chains for vehicles:
[0020] Step S1: Based on the association between the AVI observation data of individual vehicles and their travel behavior attributes, the AVI observation data sequence (in-street vehicle passing / out-of-street parking detection events) and the travel behavior sequence (travel purpose, route, etc.) are lexicalized. Semantic embedding (distinguishing lexical attribute features) and syntactic embedding (encoding spatiotemporal order rules) are performed on the obtained AVI observation lexical and travel behavior lexical to construct the embedding vector representation and establish the basic sentence model.
[0021] Reference Figure 2 The specific method for performing lexical representation of the AVI observation data sequence and travel behavior sequence is as follows:
[0022] Regarding the AVI observation data sequence, each individual vehicle's AVI observation data is represented as a triple x. i =(t i ,l i ,s i ), where t i The timestamp representing the observation point (e.g., the time when the vehicle was detected), l i Indicates the spatial location of the observation point (e.g., detector number or coordinate information), s i This indicates whether the detection at the observation point is within or outside the road.
[0023] Regarding travel behavior sequences, the travel behavior of individual vehicles is defined as a quadruple. in Indicates travel segment y j The start time, Indicates travel segment y j The end time, l j Indicates travel segment y j The parking position, a j Indicates travel segment y j Behavioral categories (such as going home, going to work, shopping, etc.);
[0024] To achieve a unified structural representation of AVI observation data and travel chain behavior, the following spatiotemporal matching function `match(x)` is constructed. i ,y j ):
[0025]
[0026] Where f[·] is an indicator function, which takes the value 1 when the condition inside the parentheses is true, and takes the value 0 otherwise; ε t and ε l These are time and space tolerance thresholds, used to determine whether an observed event matches a certain travel behavior; Represents the observed event x i timestamp t iTravel snippets j Central Time Point The phase difference is less than the threshold ε t ;dist(l i ,l j )<ε l The spatial location l of the observed event i The central location of the travel segment j The spatial distance is less than the threshold ε l ;
[0027] Therefore, a spatiotemporal matching matrix M∈{0,1} is constructed. m×n .
[0028] Semantic embedding and syntactic embedding methods are as follows:
[0029] Define the attribute vector of each AVI observation term as a xi =[t i ,l i ,s i The attribute vector of travel behavior lexical units is defined as follows: Introducing the AVI observation attribute encoder Will Mapped to an embedding vector, and introduced into a travel behavior attribute encoder. Will Mapped to an embedding vector;
[0030] The semantic association degree of the attribute layer is calculated by the cosine similarity between the two, and the attribute similarity matrix is constructed as follows:
[0031]
[0032] Among them, S ij ∈[-1,1] represents the attribute matching degree between the i-th AVI observation data and the j-th travel behavior, and the similarity matrix S∈R m×n It can serve as auxiliary guiding information for subsequent Transformer attention mechanisms, establishing semantic relationships between cross-modal data.
[0033] The method for constructing the embedded vector representation is as follows:
[0034] Each term (including AVI observation term and travel behavior term) is uniformly encoded into an embedding vector h. k It includes semantic embedding and positional embedding, and is constructed as follows:
[0035]
[0036] Where, ω kThis represents the k-th word element, and can take values such as [HOME], [IN_101], [MASK], etc.; Embed(ω k Attr(ω) represents the static embedding of lexical identifiers; k ) represents the dynamic attributes carried by the lexical, such as dwell time, geographic coordinates, etc.; MLP(·) represents the multilayer perceptron; PosEnc(k) represents the position embedding of the k-th lexical, used to maintain the sequence structure;
[0037] The position embedding uses the standard Transformer position encoding function definition:
[0038]
[0039] Where k represents the position index of the word in the sequence, i represents the subscript of the position dimension, and d is the total dimension of the embedding vector; this sine and cosine form of encoding enables the model to perceive the relative position of words.
[0040] The method for establishing a basic statement model is as follows:
[0041] For travel behavior, its statement structure is defined as follows:
[0042] S chain =[ω1,ω2,…,ω L ],ω k ∈{HOME,TRIP,WORK,…}
[0043] Among them, S chain Represents a travel chain, where each ω k A travel behavior terminology, including words like "home," "trip," and "work," corresponds to the terms HOME, TRIP, and WORK, respectively; the corresponding embedding vector sequence H chain Represented as:
[0044]
[0045] in, The word ω represents travel behavior. k The corresponding embedding vector;
[0046] For pause behavior tokens, attribute information such as pause duration is also attached. Geographical location k These are all encoded into the vector h through attribute embedding. k middle;
[0047] For AVI observation data, its statement structure is defined as follows:
[0048] S obs =[ω′1,ω′2,…,ω′ L′],ω′ k ∈{IN 105 ,OUT 101 MASK,…}
[0049] Among them, S obs This represents the AVI observation data sequence, where each ω′ k This represents an AVI observation term, where [MASK] represents a placeholder for a missing term, and the corresponding embedding vector sequence H obs for:
[0050]
[0051] in, ω′ represents the AVI observation term k The corresponding embedding vector.
[0052] Through the unified modeling structure described above, structural alignment and semantic fusion between travel behavior and AVI observations can be achieved. The spatiotemporal matching, attribute alignment, semantic embedding and serialization of cross-source behavioral data are systematically completed, providing a structured input foundation for subsequent travel chain reconstruction models based on Transformer.
[0053] Step S2: Improve the Transformer-based encoder, decoder, and encoder-decoder fusion method. The encoder uses self-attention to process the input AVI observation data sequence with missing values. The encoder-decoder fusion method introduces a cross-attention mechanism to match the embedding vector sequence of AVI observation data with the embedding vector sequence of travel behavior. The decoder generates variable-length travel chains through mask attention.
[0054] Step S2 constructs a three-tiered interconnected sub-network of "observation-observation," "observation-travel," and "travel-travel," accurately modeling the complex spatiotemporal dependencies in long-cycle travel chains, forming the core architecture of a large-scale model for generating motor vehicle travel chains, referencing... Figure 3 The specific steps are as follows:
[0055] Step S2.1: Improve the encoder by considering the fragmented nature of the AVI observation data, allowing the encoder to use observation sequences with missing term placeholders as input. The self-attention mechanism is encoded to learn the correlations between AVI observations;
[0056] The encoder takes an AVI observation data sequence with missing word placeholders as input, introduces missing word placeholders (such as [MASK]), and modifies the original AVI observation data sequence S. obs =[ω′1,ω′2,…,ω′ L′The abnormal missing locations in the data, i.e. missing observations or inference fill-in points, are explicitly represented;
[0057] Embedding vector sequences of AVI observation data using an improved multi-head self-attention mechanism Encode:
[0058]
[0059] Among them, Q obs , V obs These are the query, key, and value vectors of the AVI observation data, respectively, and are derived from the embedding vector. The linear mapping yields d, where d is the total dimension of the embedding vector.
[0060] Step S2.2: Improve the decoder by considering the possibility of multiple unobserved trips between AVI observation pairs. Allow the decoder's output length to be variable to adapt to the uncertainty of trip chain length: the decoder outputs variable-length trip chains sequentially in units of AVI observation pairs until all missing information is filled in; adopt... The masked attention mechanism captures the relationships between different trips in the travel chain over a longer distance;
[0061] The decoder's output length is allowed to be variable; the decoder generates the travel chain S. chain =[ω1,ω2,…,ω L ], where each word element ω k ∈{HOME,TRIP,WORK,…,[EOS]} represents a trip segment or end marker [EOS];
[0062] A masked attention mechanism based on historical travel behavior is introduced to calculate the contextual associations of historical travel behavior sequences:
[0063]
[0064] Among them, Q chain , V chain These represent the query, key, and value vectors for travel behavior, respectively, where d is the total dimension of the embedding vectors, and M ∈ R. L×L The mask matrix ensures that the k-th lexical unit can only focus on the previous k historical actions (autoregressive). The embedded vector sequence representing travel behavior is obtained from step S1; the output process iterates continuously until [EOS] is generated, completing a complete travel chain y = [y1, y2, ..., y n ];
[0065] Step S2.3: Improve the codec fusion method by introducing a method between the encoder and decoder. The cross-attention mechanism establishes a three-dimensional association (time, space, semantics) between the observed data and the generated sequence, ensuring that the generated travel chain strictly meets the spatiotemporal constraints of AVI observation.
[0066] A cross-attention mechanism is introduced between the encoder and decoder to embed the AVI observation data into a vector sequence H. obs With the embedded vector sequence H of travel behavior chain Establish a match:
[0067]
[0068] Where S∈R m×n The attribute similarity matrix is obtained from step S1; α is a hyperparameter used to adjust the influence of prior attribute similarity on the attention distribution.
[0069] Step S3: Design a pre-training scheme that includes an autoregressive generation task (predicting complete travel chains) and a contrastive learning task (distinguishing travel modes). The contrastive learning task is trained using a triplet loss function, and the autoregressive generation task uses AVI observation data sequences as input and predicts travel chains step by step by maximizing the likelihood function.
[0070] The autoregressive generation task uses the AVI observation data sequence X = {x1, x2, ..., x} to generate data. m Given the input}, the travel chain Y = {y1, y2, ..., y} is predicted step by step by maximizing the likelihood function. n}, where y i Let i∈n represent travel behavior terms (such as "work", "go home", etc.), and the likelihood function formula is as follows:
[0071]
[0072] Where X represents the input sequence consisting of m AVI observations, each x i , i∈m includes detection type (in-street, out-of-street), timestamp, and geographic location features; Y represents the sequence to be generated containing n travel nodes, y i ,i∈n represents travel behavior terms (such as work, go home, etc.); conditional probability Pr(y i |y1,…,y i-1 (,X) represents the prefixes y1,…,y that have already been generated. i-1 Given input X, predict the current step y. i The probability of.
[0073] The contrastive learning task uses a triplet loss function:
[0074] LCL = max(0, d(z) a ,z p )-d(z a ,z n )+α)
[0075] Where LCL represents the triplet loss function, z a z represents the encoded vector of the anchor observation sequence. p and z n These correspond to the encoding of positive samples (similar travel chains) and negative samples (dissimilar travel chains), respectively. The distance metric d(·,·) adopts modified cosine similarity, which is calculated by subtracting the standard cosine similarity from 1 to ensure that it satisfies the non-negativity and symmetry of the distance metric. α is a boundary parameter that controls the minimum interval between positive and negative sample pairs (typically set to 0.2) to enhance the inter-class separability of the feature space.
[0076] Step S4: Divide travel groups with similar characteristics (such as commuters and business travelers) through cluster analysis, and use a hierarchical fine-tuning strategy (freezing general parameters and optimizing attention heads) and a lightweight adapter method to achieve individual heterogeneity adaptation. Generate candidate travel chains in batches in the form of "instruction-response" dialogue, and output Top-K high confidence results by combining generation probability and spatiotemporal consistency constraints to complete the batch generation of vehicle travel chains.
[0077] The individual heterogeneity adaptation method is as follows:
[0078] Individual attributes related to travel behavior (such as the traveler's age, gender, and travel frequency) are used as control variables, and these control variables are uniformly represented as attribute feature vectors. via attribute encoder E c (·) Embed attribute feature vectors (such as categorical variables and numerical variables) into a high-dimensional space:
[0079] c = E c (a (p) ),a (p) = [Gender, Age, Travel Frequency, ...]
[0080] Where E c (·) is the control variable encoder, which can use a multilayer perceptron (MLP) or converter structure to extract the individual behavior feature vector c and use it as the prior input for decoding guidance;
[0081] The attribute feature vector c will participate in the logical construction of behavior generation in the decoder stage, guiding the travel chain sequence towards individual preferences; for each travel behavior lexical y to be generated in the decoder k Its embedding vector is constructed as follows:
[0082]
[0083] in, Indicates the embedding of original travel behavior terms; This represents the fusion weight matrix of the control variables; This represents the lexical embedding after incorporating control variables. This structure ensures that control information continues to play a role throughout the generation process; it also ensures that individual attributes continue to guide the generation process throughout the travel chain, making the generated results more closely match the actual behavioral preferences of travelers.
[0084] The embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the present invention is not limited to the above embodiments. Within the scope of knowledge possessed by those skilled in the art, various changes can be made without departing from the spirit of the present invention.
Claims
1. A method for intelligently generating motor vehicle travel chains based on an attention mechanism, characterized in that, Fragmented travel observation data of individual vehicles are obtained using on- and off-road AVI detectors. Steps S1-S4 are then executed to achieve the inference and batch generation of continuous travel chains for vehicles: Step S1: Based on the association between the AVI observation data of individual vehicles and the travel behavior attributes, the AVI observation data sequence and the travel behavior sequence are represented by lexicalization. Semantic embedding and syntactic embedding are performed on the obtained AVI observation lexical and travel behavior lexical to construct the embedding vector representation and establish the basic sentence model. The specific method for performing lexical representation of the AVI observation data sequence and travel behavior sequence mentioned in step S1 is as follows: Regarding the AVI observation data sequence, each individual vehicle's AVI observation data is represented as a triple. ,in Indicates the timestamp of the observation point. Indicates the spatial location of the observation point. This indicates whether the detection at the observation point is within or outside the road. Regarding travel behavior sequences, the travel behavior of individual vehicles is defined as a quadruple. ,in Indicates travel segment The start time, Indicates travel segment End time, Indicates travel segment The parking location, Indicates travel segment Behavioral categories; Construct the following spatiotemporal matching function : ; in, This is an indicator function that takes the value 1 when the condition inside the parentheses is true, and 0 otherwise. and These are the time and space tolerance thresholds, respectively. Represents observed events timestamp Travel snippets Central Time Point The difference is less than the threshold ; Indicates the spatial location of the observed event The central location of the travel segment Spatial distance less than threshold ; Therefore, a spatiotemporal matching matrix is constructed. ; The semantic embedding and syntactic embedding methods in step S1 are as follows: Define the attribute vector of each AVI observation term as Define the attribute vector of travel behavior lexical units as Introducing the AVI observation attribute encoder ,Will Mapped to an embedding vector, and introduced into a travel behavior attribute encoder. Will Mapped to an embedding vector; The attribute similarity matrix is constructed as follows: ; in, Indicates the first The AVI observation data and the first The degree of attribute matching between individual travel behaviors; Step S2: Improve the Transformer-based encoder, decoder, and encoder-decoder fusion method. The encoder uses self-attention to process the input AVI observation data sequence with missing values. The encoder-decoder fusion method introduces a cross-attention mechanism to match the embedding vector sequence of AVI observation data with the embedding vector sequence of travel behavior. The decoder generates variable-length travel chains through mask attention. Step S3: Design a pre-training scheme that includes an autoregressive generation task and a contrastive learning task. The contrastive learning task is trained using a triplet loss function, and the autoregressive generation task takes the AVI observation data sequence as input and predicts the travel chain step by step by maximizing the likelihood function. Step S4: Divide travel groups with similar characteristics through cluster analysis, and use a hierarchical fine-tuning strategy and lightweight adapter method to achieve individual heterogeneity adaptation. Generate candidate travel chains in batches in the form of command-response dialogue, and output Top-K high confidence results by combining generation probability and spatiotemporal consistency constraints to complete the batch generation of vehicle travel chains.
2. The method for intelligent generation of motor vehicle travel chains based on an attention mechanism according to claim 1, characterized in that, The method for constructing the embedded vector representation in step S1 is as follows: Each word is uniformly encoded into an embedding vector. It includes semantic embedding and positional embedding, and is constructed as follows: ; in, Indicates the first Each word element; Static embedding of lexical identifiers; Indicates the dynamic attributes carried by lexical units; Represents a multilayer perceptron; Indicates the first The positional embedding of each word element; The position embedding uses the standard Transformer position encoding function definition: ; in, Indicates the position index of a word in the sequence. The index indicating the location dimension. This represents the total dimension of the embedded vector.
3. The method for intelligent generation of motor vehicle travel chains based on an attention mechanism according to claim 1, characterized in that, The method for establishing the basic statement model in step S1 is as follows: For travel behavior, its statement structure is defined as follows: ; in, Represents the travel chain, each This represents a sequence of embedding vectors corresponding to a travel behavior term. Represented as: ; in, Descriptive words for travel behavior The corresponding embedding vector; For AVI observation data, its statement structure is defined as follows: ; in, Represents the AVI observation data sequence, each This represents an AVI observation term. The sequence of embedding vectors representing placeholders for missing words. for: ; in, Indicates AVI observation term The corresponding embedding vector.
4. The method for intelligent generation of motor vehicle travel chains based on an attention mechanism according to claim 1, characterized in that, The specific steps of step S2 are as follows: Step S2.1: Improve the encoder to allow it to use AVI observation data sequences with missing word placeholders as input. Introduce missing word placeholders to modify the original AVI observation data sequences. The locations of abnormal missing measurements are explicitly represented; Embedding vector sequences of AVI observation data using an improved multi-head self-attention mechanism Encode: ; in, , , These are the query, key, and value vectors of the AVI observation data, respectively, and are derived from the embedding vector. Linear mapping yields, The total dimension of the embedded vector; Step S2.2: Improve the decoder to allow for variable output length; the decoder generates a trip chain. Each word element Indicates a segment of a trip or the end of a journey. ; A masked attention mechanism based on historical travel behavior is introduced to calculate the contextual associations of historical travel behavior sequences: ; in, , , These are the query, key, and value vectors for travel behavior, respectively. The total dimension of the embedded vector. For the mask matrix, The output process iterates continuously until a sequence of embedded vectors representing travel behavior is generated. To complete a complete travel chain ; Step S2.3: Improve the encoder-decoder fusion method by introducing a cross-attention mechanism between the encoder and decoder, and embedding the AVI observation data into a vector sequence. Embedded vector sequence of travel behavior Establish a match: ; in, This is an attribute similarity matrix; This is a hyperparameter.
5. The method for intelligent generation of motor vehicle travel chains based on an attention mechanism according to claim 1, characterized in that, The autoregressive generation task in step S3 uses AVI observation data sequences. Using the likelihood function as input, travel chains are predicted step by step. ,in The likelihood function formula for representing travel behavior terms is as follows: ; in, Indicates by The input sequence consists of AVI observation data, each... Includes detection type, timestamp, and geographic location features; Indicates the contents to be generated A sequence of travel nodes, Terminology representing travel behavior; conditional probability Indicates that the generated prefix and input Under the condition of predicting the current step The probability of.
6. The method for intelligent generation of motor vehicle travel chains based on an attention mechanism according to claim 1, characterized in that, The contrastive learning task in step S3 uses a triplet loss function: ; in, Represents the triplet loss function. The encoded vector representing the anchor point observation sequence. and The encodings for positive and negative samples, respectively; distance metric. The modified cosine similarity is used, and the calculation method is 1 minus the standard cosine similarity. This is a boundary parameter that controls the minimum interval between positive and negative sample pairs.
7. The method for intelligent generation of motor vehicle travel chains based on an attention mechanism according to claim 1, characterized in that, The individual heterogeneity fitting method in step S4 is as follows: The individual attributes to which the travel behavior belongs are used as control variables, and these control variables are uniformly represented as attribute feature vectors. via attribute encoder Embed the attribute feature vectors into a high-dimensional space: ; For each travel behavior lexical to be generated in the decoder Its embedding vector is constructed as follows: ; in, Indicates the embedding of original travel behavior terms; This represents the fusion weight matrix of the control variables; This indicates the word embedding after incorporating control variables.