A trajectory prediction method fusing traffic state and driving style and related equipment

By acquiring and analyzing the historical trajectories of the target vehicle and neighboring vehicles, and performing fusion prediction based on driving style and traffic conditions, the problem of low trajectory prediction accuracy in existing technologies is solved, achieving higher prediction accuracy and model performance.

CN119091628BActive Publication Date: 2025-10-21CENT SOUTH UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411235118.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-04
Publication Date
2025-10-21
Estimated Expiration
2044-09-04

AI Technical Summary

Technical Problem

Existing vehicle trajectory prediction methods have low accuracy in complex driving situations and fail to effectively take into account the differences in various driving modes and driving environments.

Method used

By acquiring the historical trajectories of multiple target vehicles and neighboring vehicles, driving style clustering and traffic state analysis are performed. A prediction model is then used to predict the trajectory, and the final model is trained using a prediction loss function to improve prediction accuracy.

Benefits of technology

It improves the accuracy of trajectory prediction by taking into account the driving and motion conditions of vehicles near the target vehicle, thus enhancing the performance of the prediction model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119091628B_ABST
    Figure CN119091628B_ABST
Patent Text Reader

Abstract

The application relates to the field of traffic technology and provides a trajectory prediction method fusing traffic states and driving styles and related equipment, which comprises the following steps: clustering each adjacent vehicle based on the historical trajectory of the adjacent vehicle to obtain the driving style of the adjacent vehicle; obtaining the traffic state of each target vehicle according to the historical trajectory of all target vehicles; performing trajectory prediction on each target vehicle by using a prediction model according to the traffic state of all target vehicles and the driving style of all adjacent vehicles to obtain multiple prediction trajectories of each target vehicle; constructing a prediction loss function by using all prediction trajectories, training the prediction model by using the prediction loss function, and obtaining a final prediction model; and performing trajectory prediction on a to-be-predicted vehicle by using the final prediction model to obtain the final prediction trajectory of the to-be-predicted vehicle. The method can improve the accuracy of trajectory prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of traffic technology, and in particular to a trajectory prediction method and related equipment that integrates traffic conditions and driving styles. Background Art

[0002] Predicting the paths of multiple targets in complex driving situations, especially at intersections and roundabouts, involves dynamic interactions among vehicles and other entities, resulting in dense swarms of agents, varying speeds, and environmental obstacles. To enhance decision-making in interactive driving environments, the emergence of vehicle-to-vehicle (V2V) communication systems has opened up new possibilities for predicting and regulating the trajectories of multiple entities. Compared to traditional trajectory prediction methods, V2V offers advantages including real-time accuracy, robustness, wider coverage, and enhanced vehicle coordination. With V2V technology, vehicles can share information and synchronize their actions, thereby improving road safety and operational efficiency.

[0003] Previous researchers have proposed trajectory prediction based on interactive perception using V2V technology, but these methods fail to consider various driving patterns and environments. Furthermore, drivers of the same type may exhibit different responses in different driving environments. Consequently, existing vehicle trajectory prediction methods suffer from low accuracy. Summary of the Invention

[0004] The present application provides a trajectory prediction method and related equipment that integrates traffic conditions and driving style, which can solve the problem of low trajectory prediction accuracy.

[0005] In a first aspect, an embodiment of the present application provides a trajectory prediction method that integrates traffic conditions and driving style. The trajectory prediction method includes:

[0006] Obtaining historical trajectories of multiple target vehicles and historical trajectories of multiple neighboring vehicles of each target vehicle; the historical trajectories of the target vehicle include trajectory data of the target vehicle at multiple historical moments, and the trajectory data includes vehicle speed, acceleration, distance between the target vehicle and each neighboring vehicle, and collision time;

[0007] For each neighboring vehicle, cluster the neighboring vehicles based on their historical trajectories to obtain their driving styles. Driving styles are used to describe the driving conditions of neighboring vehicles at all historical moments.

[0008] Obtain the traffic state of each target vehicle based on the historical trajectories of all target vehicles; the traffic state is used to describe the movement status of all neighboring vehicles of the target vehicle at the last historical moment;

[0009] Based on the traffic status of all target vehicles and the driving styles of all neighboring vehicles, the prediction model is used to predict the trajectory of each target vehicle, and multiple predicted trajectories of each target vehicle are obtained;

[0010] A prediction loss function is constructed using all predicted trajectories, and the prediction model is trained using the prediction loss function to obtain the final prediction model; the prediction loss function is used to describe the accuracy of all predicted trajectories;

[0011] The final prediction model is used to predict the trajectory of the vehicle to be predicted, and the final predicted trajectory of the vehicle to be predicted is obtained.

[0012] In a second aspect, an embodiment of the present application provides a trajectory prediction device that integrates traffic conditions and driving style, including:

[0013] An acquisition module is configured to acquire historical trajectories of multiple target vehicles and historical trajectories of multiple neighboring vehicles of each target vehicle; the historical trajectories of the target vehicle include trajectory data of the target vehicle at multiple historical moments, including vehicle speed, acceleration, distance between the target vehicle and each neighboring vehicle, and collision time;

[0014] The clustering module clusters neighboring vehicles based on their historical trajectories to obtain their driving styles. Driving styles are used to describe the driving conditions of neighboring vehicles at all historical moments.

[0015] The traffic status acquisition module obtains the traffic status of each target vehicle based on the historical trajectories of all target vehicles. The traffic status is used to describe the movement status of all neighboring vehicles of the target vehicle at the last historical moment.

[0016] A first trajectory prediction module predicts the trajectory of each target vehicle using a prediction model based on the traffic status of all target vehicles and the driving styles of all neighboring vehicles, thereby obtaining multiple predicted trajectories for each target vehicle;

[0017] The construction module uses all predicted trajectories to construct a prediction loss function, and uses the prediction loss function to train the prediction model to obtain the final prediction model; the prediction loss function is used to describe the accuracy of all predicted trajectories;

[0018] The second trajectory prediction module uses the final prediction model to predict the trajectory of the vehicle to be predicted to obtain the final predicted trajectory of the vehicle to be predicted.

[0019] In a third aspect, an embodiment of the present application provides a terminal device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the method for trajectory prediction integrating traffic conditions and driving styles is implemented.

[0020] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the above-mentioned trajectory prediction method that integrates traffic conditions and driving styles.

[0021] The above solution of the present application has the following beneficial effects:

[0022] In an embodiment of the present application, by obtaining the historical trajectories of multiple target vehicles and the historical trajectories of multiple neighboring vehicles of each target vehicle, and then clustering the neighboring vehicles based on the historical trajectories of the neighboring vehicles for each neighboring vehicle, the driving style of the neighboring vehicles is obtained, and then the traffic status of each target vehicle is obtained according to the historical trajectories of all target vehicles, and then the trajectory of each target vehicle is predicted using a prediction model based on the traffic status of all target vehicles and the driving style of all neighboring vehicles to obtain a predicted trajectory of each target vehicle, and then all the predicted trajectories are used to construct a prediction loss function, and the prediction model is trained using the prediction loss function to obtain a final prediction model, and finally the historical trajectory to be predicted of the vehicle to be predicted is obtained, and based on the historical trajectory to be predicted, the final prediction model is used to perform prediction to obtain the final predicted trajectory of the vehicle to be predicted. Among them, the driving style of the neighboring vehicles of the target vehicle is obtained, the driving conditions of the neighboring vehicles of the target vehicle can be analyzed, the traffic status of the target vehicle is obtained based on the historical trajectory, the authenticity of the traffic status is improved, the trajectory is predicted according to the real driving style and traffic status, the driving conditions of the neighboring vehicles of the target vehicle and the movement conditions of the neighboring vehicles are taken into account, the accuracy of the predicted trajectory is improved, and the prediction model is trained based on the predicted trajectory with high accuracy, which can improve the prediction performance of the prediction model, thereby effectively improving the accuracy of the trajectory prediction when the prediction model is used for trajectory prediction.

[0023] Other beneficial effects of the present application will be described in detail in the subsequent specific implementation section. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0025] Figure 1 A flowchart of a trajectory prediction method integrating traffic conditions and driving style provided in one embodiment of the present application;

[0026] Figure 2 A schematic diagram of a driving style provided in an embodiment of the present application;

[0027] Figure 3 A schematic diagram of feature importance scores provided in one embodiment of the present application;

[0028] Figure 4 A schematic diagram of the trajectory prediction performance of the Transformer model provided in one embodiment of the present application;

[0029] Figure 5 A schematic diagram of the trajectory prediction performance of the GAN model provided in one embodiment of the present application;

[0030] Figure 6 A schematic diagram of the trajectory prediction performance of the CAVE model provided in one embodiment of the present application;

[0031] Figure 7 A schematic diagram of the structure of a trajectory prediction device integrating traffic conditions and driving style provided in one embodiment of the present application;

[0032] Figure 8 A schematic diagram of the structure of a terminal device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0033] In the following description, specific details such as specific system structures and techniques are provided for purposes of illustration rather than limitation to facilitate a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obscuring the description of the present application with unnecessary detail.

[0034] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections thereof.

[0035] It will also be understood that the term "and / or" used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

[0036] As used in this specification and the appended claims, the term "if" can be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.

[0037] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0038] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.

[0039] In response to the problem of low accuracy of existing trajectory prediction, an embodiment of the present application provides a trajectory prediction method that integrates traffic status and driving style. The trajectory prediction method obtains the historical trajectories of multiple target vehicles and the historical trajectories of multiple neighboring vehicles of each target vehicle, and then clusters the neighboring vehicles based on the historical trajectories of the neighboring vehicles for each target vehicle to obtain the driving style of the neighboring vehicles. The traffic status of each target vehicle is obtained based on the historical trajectories of all target vehicles. The trajectory of each target vehicle is predicted using a prediction model based on the traffic status of all target vehicles and the driving style of all neighboring vehicles to obtain a predicted trajectory of each target vehicle. A prediction loss function is then constructed using all the predicted trajectories, and the prediction model is trained using the prediction loss function to obtain a final prediction model. Finally, the historical trajectory to be predicted of the vehicle to be predicted is obtained, and the final prediction model is used to perform prediction based on the historical trajectory to be predicted to obtain the final predicted trajectory of the vehicle to be predicted. Among them, the driving style of the neighboring vehicles of the target vehicle is obtained, the driving conditions of the neighboring vehicles of the target vehicle can be analyzed, the traffic status of the target vehicle is obtained based on the historical trajectory, the authenticity of the traffic status is improved, the trajectory is predicted according to the real driving style and traffic status, the driving conditions of the neighboring vehicles of the target vehicle and the movement conditions of the neighboring vehicles are taken into account, the accuracy of the predicted trajectory is improved, and the prediction model is trained based on the predicted trajectory with high accuracy, which can improve the prediction performance of the prediction model, thereby effectively improving the accuracy of the trajectory prediction when the prediction model is used for trajectory prediction.

[0040] Next, the trajectory prediction method integrating traffic conditions and driving style provided in this application is exemplified.

[0041] like Figure 1 As shown, the trajectory prediction method provided by this application that integrates traffic status and driving style includes the following steps:

[0042] Step 11: Obtain historical trajectories of multiple target vehicles and historical trajectories of multiple neighboring vehicles of each target vehicle.

[0043] The target vehicle has real trajectory data. The historical trajectory of the target vehicle includes trajectory data of the target vehicle at multiple historical moments. The trajectory data includes vehicle speed, acceleration, distance to each neighboring vehicle, and collision time. The historical trajectory of neighboring vehicles includes trajectory data of neighboring vehicles at multiple historical moments.

[0044] In some embodiments of the present application, the historical trajectories of multiple target vehicles and the historical trajectories of multiple neighboring vehicles of each target vehicle can be obtained by accessing public vehicle trajectory datasets, such as rounD and INTERACTION datasets.

[0045] It should be noted that in order to improve the diversity and reliability of driving style recognition, statistical indicators such as the minimum, maximum, average, and standard deviation (STD) of the features are used. The resulting trajectory data includes 18 dimensions, as shown in Table 1.

[0046]

[0047] Table 1

[0048] Among them, Speed ​​STD represents the speed standard deviation, Mean speed represents the mean speed, AccelerationSTD represents the acceleration standard deviation, Mean acceleration represents the acceleration mean, Min space headway represents the minimum headway, Max space headway represents the maximum headway, Mean space headway represents the average headway, Space headway STD represents the standard deviation of the headway, Min jerk represents the minimum acceleration rate, Max jerk represents the maximum acceleration rate, Mean jerk represents the average acceleration rate, Jerk STD represents the standard deviation of the acceleration rate, Min TTC represents the minimum time to collision, and Proportion of "TTC<3s" represents the proportion of collision times less than 3 seconds.

[0049] Excluding the minimum and maximum speeds and accelerations as well as the maximum TTC and time-to-collision standard deviation (TTC STD) aims to differentiate driving styles, as these indicators tend to show similarities among drivers and cannot fully represent the diversity of driving styles.

[0050] In step 12, for each neighboring vehicle, the neighboring vehicles are clustered based on their historical trajectories to obtain the driving styles of the neighboring vehicles.

[0051] The above driving styles are used to describe the driving conditions of neighboring vehicles at all historical moments, such as conservative, smooth, aggressive, etc.

[0052] In some embodiments of the present application, the step of clustering neighboring vehicles based on their historical trajectories to obtain their driving styles is specifically as follows:

[0053] In the first step, based on the historical trajectories of neighboring vehicles, the distribution model is used to calculate the probability density of neighboring vehicles belonging to each Gaussian distribution.

[0054] Multiple Gaussian distributions correspond one-to-one to multiple driving styles.

[0055] It should be noted that the distribution model calculates the probability density of adjacent vehicles belonging to each Gaussian distribution as N(x|μr ,Σ r ), where N(x|μ r ,Σ r ) represents the probability density of the neighboring vehicle belonging to the rth Gaussian distribution, μ k represents the mean of the rth Gaussian distribution, ∑ r represents the covariance matrix of the rth Gaussian distribution, and x represents the historical trajectories of neighboring vehicles.

[0056] In the second step, all probability densities are used to optimize the distribution model to obtain the final distribution model, and the final probability density of neighboring vehicles belonging to each Gaussian distribution is calculated based on the final distribution model.

[0057] First, the total probability density of neighboring vehicles is calculated based on all probability densities.

[0058] Specifically, through the formula:

[0059]

[0060] Calculate the total probability density p(x) of neighboring vehicles.

[0061] Among them, π k represents the mixing coefficient of the rth Gaussian distribution, N(x|μ r ,Σ r ) represents the probability density of the neighboring vehicle belonging to the rth Gaussian distribution, μ k represents the mean of the rth Gaussian distribution, ∑ r represents the covariance matrix of the rth Gaussian distribution, R represents the number of Gaussian distributions, and x represents the historical trajectories of neighboring vehicles.

[0062] Then, it is determined whether the total probability density of neighboring vehicles is greater than a preset probability density.

[0063] If so, the distribution model is taken as the final distribution model.

[0064] Otherwise, the mixing coefficients, mean and covariance matrix in the distribution model are adjusted, and the step of calculating the probability density of the neighboring vehicles belonging to each Gaussian distribution using the distribution model based on the historical trajectories of the neighboring vehicles is returned.

[0065] Finally, the final probability density of neighboring vehicles belonging to each Gaussian distribution is calculated based on the final distribution model.

[0066] Specifically, based on the historical trajectories of neighboring vehicles, the final probability density of neighboring vehicles belonging to each Gaussian distribution is calculated using the final probability density.

[0067] In the third step, the final Gaussian distribution of the neighboring vehicles is obtained based on all the final probability densities, and the driving style corresponding to the final Gaussian distribution is used as the driving style of the neighboring vehicles.

[0068] Specifically, the final probability density describes the probability that the neighboring vehicle belongs to the Gaussian distribution. The final Gaussian distribution to which the neighboring vehicle belongs is obtained based on all probabilities. For example, if the final probability density corresponding to the first Gaussian distribution is 0.2, it means that the probability that the neighboring vehicle belongs to the first Gaussian distribution is 0.2. If the final probability density corresponding to the second Gaussian distribution is 0.3, it means that the probability that the neighboring vehicle belongs to the first Gaussian distribution is 0.3. That is, when selecting the final Gaussian distribution, the first Gaussian distribution has a probability of 0.2 to be selected, and the second Gaussian distribution has a probability of 0.3 to be selected. According to the probability of all Gaussian distributions being selected, one Gaussian distribution is selected from all Gaussian distributions as the final Gaussian distribution of the neighboring vehicle.

[0069] Exemplarily, the final Gaussian distribution to which the neighboring vehicle belongs is the second Gaussian distribution, and the driving style corresponding to the second Gaussian distribution is conservative, so the driving style of the neighboring vehicle is conservative.

[0070] It should be noted that when using this step to obtain the driving style of neighboring vehicles, data is transmitted between the target vehicle and the neighboring vehicle through V2V technology, so that the target vehicle obtains the trajectory data of the neighboring vehicle over a period of time and obtains the driving style of the neighboring vehicle through the algorithm of the above steps.

[0071] It is worth mentioning that obtaining the driving styles of the target vehicle's neighboring vehicles can analyze the driving conditions of the target vehicle's neighboring vehicles and further study the impact of the neighboring vehicles' driving conditions on the target vehicle's trajectory.

[0072] The above driving style is illustrated below with reference to a specific example.

[0073] The data performance of the three driving styles (conservative, smooth, and aggressive) is shown in Table 2.

[0074]

[0075]

[0076] Table 2

[0077] Among them, SH represents the headway, SH Min represents the minimum headway, SH Mean represents the mean headway, SH Max represents the maximum headway, SH STD represents the standard deviation of the headway, Speed ​​STD represents the standard deviation of the speed, SH Min represents the minimum headway, SH Mean represents the mean headway, TTC Min represents the minimum time to collision, and TTC<3s represents the proportion of collision times less than 3 seconds.

[0078] Each driving style has various driving metrics related to speed, acceleration, jerk, headway, and time to collision (TTC). These metrics illustrate the fundamental differences and characteristics of each driving style.

[0079] The distribution of the three driving styles is as follows Figure 2 As shown in the figure, the horizontal axis represents the minimum collision time TTC Min, the vertical axis represents the average speed Speed ​​Mean, and the vertical axis represents the average acceleration rate JerkMean. Figure 2 The middle dot indicates a cautious (i.e. conservative) driving style, the triangular dot indicates a smooth driving style, and the square dot indicates an aggressive driving style.

[0080] Depend on Figure 2 As can be seen, lower average speeds are characteristic of cautious drivers, demonstrating careful acceleration behavior. Their driving is smooth, as evidenced by relatively low jitter indicators, indicating that they accelerate and change lanes cautiously, tending to maintain a safe distance and avoid close encounters. Smooth drivers exhibit a smooth transition between cautious and aggressive, with higher average speeds and moderate speed variations compared to conservative drivers. Their acceleration is slightly more confident but still controlled, as reflected by lower jitter means and standard deviations, indicating smoother transitions than aggressive drivers but less cautious than conservative drivers. Headway, smaller minimum TTC values, and a higher proportion of TTCs less than 3 seconds indicate a tendency to shorten the distance to other vehicles while maintaining a moderate safety margin. Aggressive drivers have significantly higher average speeds and fewer speed variations, indicating a tendency to drive quickly. Their acceleration rate indicators indicate abrupt and frequent changes in speed or direction, highlighting a more dynamic and potentially unpredictable driving style. Aggressive drivers maintain closer distances, have the lowest minimum TTC values, and a higher frequency of TTCs less than 3 seconds, indicating a higher risk of close encounters or collisions due to reduced reaction time and safe distance.

[0081] In some embodiments of the present application, a random forest model can be used to calculate the feature importance of each dimension of the trajectory data mentioned in step 11 to evaluate the importance of each dimension in distinguishing driving styles. The calculation of feature importance in the random forest model is based on the reduction of node impurity when the feature is used for segmentation, and the reduction is aggregated across all trees in the forest. For a given feature Xi , its importance can be estimated by calculating the average reduction in impurity across all trees where the feature is used for segmentation. The reduction in impurity can be calculated using the following formula:

[0082]

[0083] Among them, I(parent) is the impurity measure of the parent node, N left and N right are the number of samples of the left and right child nodes, I(left) and I(right) are the impurities of the left and right child nodes, and N is the number of samples of the parent node. i The overall importance of is calculated by calculating the ΔI(X i ,T) are summed and averaged.

[0084]

[0085] Among them, N T is the cumulative number of trees in the random forest ensemble.

[0086] Rank features (i.e., the dimensional data corresponding to the trajectory data) based on their importance scores. This ranking helps identify the most influential features. Multiple features with high scores can be used as final features for this step's calculation, reducing computational complexity and improving efficiency.

[0087] The feature importance scores obtained are as follows Figure 3 As shown in the figure, the horizontal axis represents the feature, the vertical axis represents the feature importance score, Jerk Max represents the maximum acceleration rate, TTC Min represents the minimum collision time, Speed ​​Mean represents the average speed, Jerk Mean represents the average acceleration rate, TTC<3s represents the proportion of collision time less than 3 seconds, Jerk STD represents the standard deviation of acceleration rate, JerkMin represents the minimum acceleration rate, SH Max represents the maximum headway, SH STD represents the standard deviation of headway, ACC Mean represents the average acceleration, Speed ​​STD represents the standard deviation of speed, SH Min represents the minimum headway, SH Mean represents the average headway, and ACC STD represents the standard deviation of acceleration.

[0088] It can be seen that the features are sorted by their importance scores, with “Jerk Max” being the most important, followed by “TTC Min”, “Speed ​​Mean”, and so on, and finally “ACC STD”, which is the least important feature among the listed features.

[0089] By understanding which driving behaviors are most indicative of risky driving, V2V systems can develop more nuanced safety protocols. These protocols might involve alerting drivers to potential hazards or automatically adjusting vehicle operation to prevent accidents. By gaining a deeper understanding of the most influential driving behaviors, V2V communication can be combined with predictive models that anticipate driver behavior. This capability can improve traffic flow and reduce collisions by proactively adjusting the driving strategies of nearby vehicles. Furthermore, V2V technology can use these insights to provide real-time feedback to drivers, suggesting adjustments to their driving style to improve safety and efficiency.

[0090] Step 13: Obtain the traffic status of each target vehicle based on the historical trajectories of all target vehicles.

[0091] The above traffic state is used to describe the movement status of all neighboring vehicles of the target vehicle at the last historical moment.

[0092] Specifically, for each target vehicle, the intersection where the target vehicle is located is determined based on the trajectory data of the target vehicle at the last historical moment, and the entire intersection is divided into multiple spatiotemporal regions based on the stop or yield signs of each lane at the intersection. At a specific time step t, the traffic graph G is used t To represent the traffic conditions in the space-time region. The spatial position of the graph is represented by a set of vertices Represented as follows, where each vertex represents a road user at a certain time point (i.e., the target vehicle and its neighboring vehicles). The relationships between road users are represented by a set of undirected weighted edges E t Indicates. Two road users v i and v j The distance between If satisfied That is, the Euclidean distance between them is less than the threshold μ, and there will be an edge link between them. In order to determine the change in the relationship between road users and their neighboring vehicles, the traffic graph G corresponding to each time step t is t In the example, a symmetric adjacency matrix A is calculated. t .

[0093]

[0094] Distance function Denotes that at time t, any two road users v i and v jThe interaction between them. A decaying exponential function is used so that distant road users are given lower weights, while nearby road users are given higher weights. Each road user will pay more attention to the road users around him to avoid traffic collisions. A convolutional neural network (CNN) is used to extract features from the adjacency matrix of the traffic graph, and then sent as input to two gated recurrent units (GRU). Finally, an algorithm that can perform classification (such as random forest and K-means clustering) is used to classify the output of the GRU, and the spatiotemporal information in the traffic graph (i.e., the spatial positions of road users and the dynamic changes in the relationships between them) is classified into one of multiple traffic states (such as aggregation, neutrality, and dispersion) to obtain the traffic state of the target vehicle.

[0095] It is worth mentioning that the historical trajectory provides real information about the target vehicle. The traffic status of the target vehicle is obtained based on the historical trajectory, which improves the authenticity of the traffic status.

[0096] Step 14: Based on the traffic status of all target vehicles and the driving styles of all neighboring vehicles, a prediction model is used to predict the trajectory of each target vehicle to obtain multiple predicted trajectories of each target vehicle.

[0097] The above-mentioned predicted trajectory includes the predicted trajectory data of the target vehicle at multiple prediction moments.

[0098] In some embodiments of the present application, the step of performing trajectory prediction for each target vehicle using a prediction model based on the traffic conditions of all target vehicles and the driving styles of all neighboring vehicles to obtain the predicted trajectory of each target vehicle includes:

[0099] In the first step, the historical feature sequence is calculated based on the historical trajectories of all target vehicles, and the latent code of each target vehicle is generated according to the historical feature sequence.

[0100] Specifically, through the formula:

[0101] C=Agent Aware Attention(Q,K,V)+[E1,E2,…,E n ]

[0102]

[0103] Q=K=V=[E1,E2,…,E n ]

[0104] Calculate the historical feature sequence C;

[0105] Among them, Agent Aware Attention (Q, K, V) represents the encoding vector, E1 represents the historical trajectory of the first target vehicle, E2 represents the historical trajectory of the second target vehicle, and E n represents the historical trajectory of the nth target vehicle, softmax() represents the activation function, A represents the attention score matrix, which is used to calculate the importance weight of the input vector, M represents the mask, Q self Denotes the predicted query vector, Q other represents other query vectors, K self Denotes the predicted key vector, K other represents the prediction key vector, Q represents the query vector, K represents the key vector, and V represents the value vector. and Both represent the prediction projection weights, and All represent other projection weights.

[0106] Then, the historical feature sequences are sampled to obtain multiple potential code sets {Z (1) ,Z (2) ,…,Z (K) Each potential code set includes the 32-dimensional potential code of each target vehicle. For each target vehicle, the 32-dimensional potential codes corresponding to the target vehicle in all potential code sets are integrated to obtain the potential code of the target vehicle. n represents the nth target vehicle.

[0107] In the second step, for each target vehicle, multiple predicted trajectories of the target vehicle are obtained based on the target vehicle's latent code, traffic status, and the corresponding driving styles of all neighboring vehicles.

[0108] Specifically, the target vehicle’s potential code, traffic status, and all corresponding driving styles are integrated to obtain an enhanced potential code S represents the traffic state of the nth target vehicle, and D represents the driving style of all neighboring vehicles of the nth target vehicle. The enhanced latent code is then input into a decoder (such as a Transformer decoder) to obtain a predicted trajectory including the predicted trajectory data of the target vehicle at multiple prediction moments. It should be noted that in the enhanced latent code of the target vehicle, the latent code of the target vehicle Including 32-dimensional potential codes corresponding to K target vehicles, the number of predicted trajectories obtained in this step is the same as The number of 32-dimensional latent codes in is also K, that is, each target vehicle has K predicted trajectories.

[0109] It can be understood that the above process of calculating the historical adjustment sequence and obtaining the predicted trajectory is the operation process of the prediction model.

[0110] It is worth mentioning that trajectory prediction is based on real driving style and traffic conditions, taking into account the driving conditions of the target vehicle's neighboring vehicles and the movement conditions of the neighboring vehicles, which effectively improves the accuracy of trajectory prediction and provides highly accurate training data for the training of the prediction model in subsequent steps.

[0111] In step 15, a prediction loss function is constructed using all the prediction trajectories, and the prediction loss function is used to train the prediction model to obtain the final prediction model.

[0112] The above prediction loss function is used to describe the accuracy of all predicted trajectories.

[0113] Specifically, the prediction loss function is:

[0114]

[0115] Among them, L sampler represents the value of the prediction loss function, represents the kth predicted trajectory set, Y represents all true trajectories, N represents the number of target vehicles, KL represents the divergence, r θ Indicates Gaussian sampling distribution on , represents the potential code of the nth target vehicle in the kth predicted trajectory set, X represents the historical trajectory of the nth target vehicle, and p θ represents the conditional Gaussian prior, z n represents the overall potential code of the n-th target vehicle, K represents the last set of predicted trajectories, represents the k1th predicted trajectory set, represents the k2th predicted trajectory set, σ d Represents the scaling parameter.

[0116] In some embodiments of the present application, the steps of training the prediction model using the prediction loss function to obtain the final prediction model are specifically as follows:

[0117] Determine whether the predicted loss function is less than the preset loss function value.

[0118] If yes, the prediction model is taken as the final prediction model.

[0119] Otherwise, adjust the parameters in the prediction model, and return to the step of using the prediction model to predict the trajectory of each target vehicle according to the driving style and traffic status of all target vehicles to obtain the predicted trajectory of each target vehicle.

[0120] For example, the preset value of the loss function is 1.5, and the value of the loss function is 3.8, which is greater than the preset value of the loss function. The parameters of the prediction model are adjusted, and the steps of using the prediction model to predict the trajectory of each target vehicle based on the driving style and traffic conditions of all target vehicles are returned to obtain the predicted trajectory of each target vehicle. At this time, the value of the loss function is 1.2, which is less than the preset value of the loss function. The prediction model at this time is used as the final prediction model.

[0121] It is worth mentioning that by constructing a loss function and using it to optimize the prediction model, the performance of the prediction model can be improved and the performance of the prediction model can meet expectations.

[0122] Step 16: Use the final prediction model to predict the trajectory of the vehicle to be predicted to obtain the final predicted trajectory of the vehicle to be predicted.

[0123] The above-mentioned vehicle to be predicted is a vehicle that needs to have its trajectory predicted.

[0124] Specifically, the historical trajectory of the vehicle to be predicted and the historical trajectories of multiple neighboring vehicles of the vehicle to be predicted are obtained, the driving styles of the neighboring vehicles are obtained, and the traffic status of the vehicle to be predicted is obtained based on the historical trajectory of the vehicle to be predicted. Then, based on the traffic status and all driving styles, the final prediction model is used to predict the trajectory of the vehicle to be predicted, and the final predicted trajectory of the vehicle to be predicted at the future moment is obtained.

[0125] It is worth mentioning that obtaining the driving style of the target vehicle's neighboring vehicles can analyze the driving conditions of the target vehicle's neighboring vehicles, and obtaining the target vehicle's traffic status based on the historical trajectory improves the authenticity of the traffic status. Trajectory prediction is performed based on the actual driving style and traffic status, taking into account the driving conditions of the target vehicle's neighboring vehicles and the movement conditions of the neighboring vehicles, thereby improving the accuracy of the predicted trajectory. Training the prediction model based on the predicted trajectory with high accuracy can improve the prediction performance of the prediction model, thereby effectively improving the accuracy of trajectory prediction when the prediction model is used for trajectory prediction.

[0126] In some embodiments of the present application, the above prediction model may also be based on a generative adversarial network (GAN). Specifically, the encoder in the generator is first used to obtain the hidden states of all target vehicles, using the formula:

[0127]

[0128] Calculate the hidden state P i .

[0129] Among them, PM ( ) represents pooling, represents the hidden state of the i-th target vehicle at time t-1, represents the hidden state of the Nth target vehicle at time t, represents the hidden state of the i-th target vehicle at time t, represents the position embedding of the i-th target vehicle at time t, represents the horizontal coordinate of the i-th target vehicle at time t, Represents the vertical coordinate of the i-th target vehicle at time t, LSTM e ( ) indicates an encoder.

[0130] Then use the decoder in the generator to decode the hidden state to obtain the predicted trajectory of each target vehicle, through the formula:

[0131]

[0132] Calculate the predicted trajectory of the i-th target vehicle

[0133] Among them, γ o ( ) and γ d ( ) are all multi-layer perceptrons with ReLU activation, represents the decoder input of the i-th target vehicle, LSTM d represents the decoder, S represents the traffic state of the i-th target vehicle, D i represents the driving styles of all neighboring vehicles of the i-th target vehicle, and z represents a latent variable that conforms to the standard normal distribution.

[0134] Finally, the discriminator is used to distinguish the true trajectory from the predicted trajectory. The input it processes either represents the true trajectory (expressed as [X i ,Y i ]), or predicted trajectories that represent the same structure. The efficiency of the discriminator depends on the ability of its LSTM encoder to analyze and interpret trajectory sequence data, taking into account the dynamics of traffic conditions and interactions between multiple vehicles. The intelligence of the discriminator is continuously developed through training, enabling it to identify trajectories that do not conform to expected traffic flow patterns and vehicle interactions as "fake". This learning process is guided by two key components. The adversarial loss measures the discriminator's ability to distinguish between real trajectories and those forged by the generator. It penalizes the discriminator when it mistakenly labels a real trajectory as a fake trajectory or vice versa. The diversity loss primarily affects the generator to diversify its output, while indirectly affecting the discriminator's evaluation criterion by encouraging the generation of diverse but reasonable trajectories.

[0135] The above prediction model can also be a model based on the conditional variational autoencoder (CVAE, Convolutional Variational Autoencoder), which represents each target vehicle as a node and encodes it using a long short-term memory model (LSTM, Long Short Term Memory) with 8 hidden layers. The LSTM captures the position data of the target vehicle during the entire observation period, thereby generating a node history. The interactions between target vehicles are represented by edges. When the target vehicles approach, edges are established between them. Each edge is also encoded using LSTM to generate an interaction history.

[0136] Based on the node history, interaction history, traffic status, and all corresponding driving styles of the target vehicle, a comprehensive representation vector of the target vehicle is obtained. Finally, the predicted trajectory of the target vehicle is obtained based on the comprehensive representation vector. Specifically, the formula is:

[0137]

[0138] Get the predicted trajectory of the i-th target vehicle

[0139] Among them, GMM () represents Gaussian mixture model, GRU () represents gated recurrent unit, e i represents the comprehensive representation vector, z represents the latent variable, S represents the traffic state of the i-th target vehicle, D represents the driving style of all neighboring vehicles of the i-th target vehicle, and f i represents the distribution parameter, represents the trajectory generation code of the i-th target vehicle, C i represents the class of the i-th target vehicle, X i Indicates the horizontal coordinate of the position of the i-th target vehicle, Y i represents the ordinate of the position of the i-th target vehicle, represents the interaction history of the i-th target vehicle, represents the node history of the i-th target vehicle.

[0140] The three prediction models are evaluated and the evaluation results are shown in Table 3.

[0141]

[0142]

[0143] Table 3

[0144] Among them, DS-GAN represents a GAN model considering driving style, TS-GAN represents a GAN model considering traffic status, TSD-GAN represents a GAN model considering driving style and traffic status, DS-CVAE represents a CVAE model considering driving style, TS-CVAE represents a CVAE model considering traffic status, TSD-CVAE represents a CVAE model considering driving style and traffic status, DS-Transformer represents a Transformer model considering driving style, TS-Transformer represents a Transformer model considering traffic status, TSD-Transformer represents a Transformer model considering driving style and traffic status (i.e., the prediction model given in step 14), minADE1 represents the minimum average displacement error when the sampling value is 1, minFDE1 represents the minimum final displacement error when the sampling value is 1, minADE5 represents the minimum average displacement error when the sampling value is 5, minFDE5 represents the minimum final displacement error when the sampling value is 5, minADE 10 Indicates the minimum average displacement error when the sampling value is 10, minFDE 10 Indicates the minimum final displacement error when the sampling value is 10, minADE 20 Indicates the minimum average displacement error when the sampling value is 20, minFDE 20 Indicates the minimum final displacement error when the sampling value is 20, KDENLL 20 It represents the negative log-likelihood based on kernel density estimation when the sampling value is 20.

[0145] As can be seen, the TSD-Transformer architecture performs well in models that consider traffic conditions and driving style. This integration improves the prediction accuracy for large sample sizes and improves the overall accuracy of the predicted trajectory.

[0146] The above prediction model is used to predict trajectories in various scenarios, and the evaluation results are shown in Table 4.

[0147]

[0148] Table 4

[0149] Among them, CHN Roundabout LN is a roundabout in China, DEU Roundabout OF is a roundabout in Germany, USA Roundabout EP is a roundabout EP in the United States, USA Roundabout FT is a roundabout FT in the United States, USA Roundabout SR is a roundabout SR in the United States, and ITRA (Interaction-aware Trajectory Prediction with Relational Attention) is an interaction-aware trajectory prediction model based on relational attention.

[0150] As can be seen, the TSD-Transformer model exhibits the best performance in most scenarios. These results demonstrate that incorporating traffic state and driving style significantly improves the model's trajectory prediction accuracy in roundabout scenarios characterized by multiple merges and divergences. Furthermore, the proposed TSD-Transformer model also demonstrates superior performance compared to the ITRA model, highlighting its effectiveness in complex traffic scenarios. This underscores the potential benefits of incorporating traffic state and driving style into trajectory prediction models, enabling more accurate and reliable predictions in multi-entry and multi-exit environments.

[0151] Ablation studies incorporate traffic states and driving styles into various components of the model framework and use minADE1 / minFDE1 and minADE 20 / minFDE 20 The indicators are evaluated to determine the best structure to improve trajectory prediction accuracy. The ablation study results of the TSD-GAN model are shown in Table 5.

[0152]

[0153] Table 5

[0154] The ablation experiment results of TSD-CVAE are shown in Table 6.

[0155]

[0156]

[0157] Table 6 The ablation experiment results of the TSD-Transformer model are shown in Table 7.

[0158]

[0159] Table 7

[0160] In Tables 5, 6, and 7, √ indicates that traffic conditions and driving styles are taken into account, and × indicates that traffic conditions and driving styles are not taken into account.

[0161] It can be seen that by integrating traffic conditions and driving styles into the prediction model, the model can fully grasp the complex situations of real-world driving conditions, thereby improving the accuracy and reliability of trajectory prediction.

[0162] Figure 4 The trajectory prediction performance of the Transformer model based on driving style, traffic conditions, and a combination of the two is compared. The horizontal axis represents the horizontal axis position, the vertical axis represents the vertical axis position, and the three curves are the historical trajectory, future trajectory, and predicted trajectory. Figure 4 a is the trajectory prediction comparison of DS-Transformer, Figure 4 b is the trajectory prediction comparison of TS-Transformer, Figure 4 c is the trajectory prediction comparison of TSD-Transformer. Figure 5 The trajectory prediction performance of the GAN model based on driving style, traffic conditions, and a combination of the two is compared. The horizontal axis represents the horizontal axis position, the vertical axis represents the vertical axis position, and the three curves are the historical trajectory, future trajectory, and predicted trajectory. Figure 5 a is the trajectory prediction comparison of DS-GAN, Figure 5 b is the trajectory prediction comparison of TS-GAN, Figure 5 c is the trajectory prediction comparison of TSD-GAN. Figure 6 The trajectory prediction performance of the CAVE model based on driving style, traffic conditions, and a combination of the two is compared. The horizontal axis represents the horizontal axis position, the vertical axis represents the vertical axis position, and the three curves are the historical trajectory, future trajectory, and predicted trajectory. Figure 6 a is the trajectory prediction comparison of DS-CAVE, Figure 6 b is the trajectory prediction comparison of TS-CAVE, Figure 6 c is the trajectory prediction comparison of TSD-CAVE.

[0163] It can be seen that considering both traffic conditions and driving style together can produce better predictions than considering only one of these factors. The convex hull area produced by the combined method is smaller, indicating that the predicted trajectory is closer to the ground truth trajectory.

[0164] The following is an exemplary description of the trajectory prediction device that integrates traffic conditions and driving styles provided in this application.

[0165] like Figure 7 As shown, an embodiment of the present application provides a trajectory prediction device that integrates traffic conditions and driving styles. The trajectory prediction device 700 that integrates traffic conditions and driving styles includes:

[0166] Acquisition module 701 acquires historical trajectories of multiple target vehicles and historical trajectories of multiple neighboring vehicles of each target vehicle; the historical trajectories of the target vehicles include trajectory data of the target vehicles at multiple historical moments, including vehicle speed, acceleration, distance between the target vehicles and each neighboring vehicle, and collision time;

[0167] The clustering module 702 clusters each neighboring vehicle based on its historical trajectory to obtain the driving style of the neighboring vehicle. The driving style is used to describe the driving status of the neighboring vehicle at all historical moments.

[0168] Traffic status acquisition module 703 acquires the traffic status of each target vehicle based on the historical trajectories of all target vehicles; the traffic status is used to describe the movement status of all neighboring vehicles of the target vehicle at the last historical moment;

[0169] A first trajectory prediction module 704 performs trajectory prediction for each target vehicle using a prediction model based on the traffic status of all target vehicles and the driving styles of all neighboring vehicles, thereby obtaining multiple predicted trajectories for each target vehicle;

[0170] Construction module 705, using all predicted trajectories to construct a prediction loss function, and using the prediction loss function to train the prediction model to obtain a final prediction model; the prediction loss function is used to describe the accuracy of all predicted trajectories;

[0171] The second trajectory prediction module 706 uses the final prediction model to perform trajectory prediction on the vehicle to be predicted to obtain a final predicted trajectory of the vehicle to be predicted.

[0172] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of this application. Their specific functions and technical effects can be found in the method embodiment section and will not be repeated here.

[0173] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0174] like Figure 8 As shown, an embodiment of the present application provides a terminal device, and the terminal device D10 of this embodiment includes: at least one processor D100 ( Figure 8 Only one processor is shown in the figure), a memory D101, and a computer program D102 stored in the memory D101 and executable on the at least one processor D100, wherein the processor D100 implements the steps of any of the above method embodiments when executing the computer program D102.

[0175] Specifically, when the processor D100 executes the computer program D102, it obtains the historical trajectories of multiple target vehicles and the historical trajectories of multiple neighboring vehicles of each target vehicle, and then clusters the neighboring vehicles based on the historical trajectories of the neighboring vehicles for each neighboring vehicle to obtain the driving style of the neighboring vehicles. Then, the traffic status of each target vehicle is obtained according to the historical trajectories of all target vehicles. Then, based on the traffic status of all target vehicles and the driving style of all neighboring vehicles, the trajectory of each target vehicle is predicted using a prediction model to obtain a predicted trajectory of each target vehicle. Then, a prediction loss function is constructed using all the predicted trajectories, and the prediction loss function is used to train the prediction model to obtain a final prediction model. Finally, the historical trajectory to be predicted of the vehicle to be predicted is obtained, and based on the historical trajectory to be predicted, the final prediction model is used to perform prediction to obtain a final predicted trajectory of the vehicle to be predicted. Among them, the driving style of the neighboring vehicles of the target vehicle is obtained, the driving conditions of the neighboring vehicles of the target vehicle can be analyzed, the traffic status of the target vehicle is obtained based on the historical trajectory, the authenticity of the traffic status is improved, the trajectory is predicted according to the real driving style and traffic status, the driving conditions of the neighboring vehicles of the target vehicle and the movement conditions of the neighboring vehicles are taken into account, the accuracy of the predicted trajectory is improved, and the prediction model is trained based on the predicted trajectory with high accuracy, which can improve the prediction performance of the prediction model, thereby effectively improving the accuracy of the trajectory prediction when the prediction model is used for trajectory prediction.

[0176] The processor D100 may be a central processing unit (CPU), or may be another general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor may be a microprocessor or any conventional processor.

[0177] In some embodiments, the memory D101 may be an internal storage unit of the terminal device D10, such as a hard disk or memory of the terminal device D10. In other embodiments, the memory D101 may also be an external storage device of the terminal device D10, such as a plug-in hard disk, a smart memory card (SMC, SmartMedia Card), a secure digital (SD, Secure Digital) card, a flash card, etc. equipped on the terminal device D10. Furthermore, the memory D101 may also include both an internal storage unit of the terminal device D10 and an external storage device. The memory D101 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program. The memory D101 may also be used to temporarily store data that has been output or is to be output.

[0178] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned various method embodiments can be implemented.

[0179] An embodiment of the present application provides a computer program product. When the computer program product is run on a terminal device, the terminal device can implement the steps in the above-mentioned method embodiments when executing the computer program product.

[0180] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, it can implement the steps of the above-mentioned various method embodiments. Among them, the computer program includes computer program code, which can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the trajectory prediction method device / terminal device that integrates traffic status and driving style, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

[0181] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.

[0182] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0183] The above is a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles described in the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A trajectory prediction method integrating traffic status and driving style, characterized in that: include: Obtaining historical trajectories of multiple target vehicles and historical trajectories of multiple neighboring vehicles of each target vehicle; the historical trajectories of the target vehicles include trajectory data of the target vehicles at multiple historical moments, the trajectory data including vehicle speed, acceleration, distance between the target vehicles and each neighboring vehicle, and collision time; For each of the neighboring vehicles, clustering the neighboring vehicles based on their historical trajectories to obtain a driving style of the neighboring vehicle; the driving style is used to describe the driving conditions of the neighboring vehicle at all historical moments; Obtaining the traffic state of each target vehicle based on the historical trajectories of all target vehicles; the traffic state is used to describe the movement status of all neighboring vehicles of the target vehicle at the last historical moment; Based on the traffic status of all target vehicles and the driving styles of all neighboring vehicles, using a prediction model to predict the trajectory of each target vehicle, thereby obtaining multiple predicted trajectories of each target vehicle; Constructing a prediction loss function using all predicted trajectories, and using the prediction loss function to train the prediction model to obtain a final prediction model; the prediction loss function is used to describe the accuracy of all predicted trajectories; Using the final prediction model to predict the trajectory of the vehicle to be predicted, to obtain a final predicted trajectory of the vehicle to be predicted; Wherein, the prediction loss function is: Among them, L sampler represents the value of the prediction loss function, represents the kth predicted trajectory set, Y represents all true trajectories, N represents the number of target vehicles, KL represents the divergence, r θ Indicates Gaussian sampling distribution on , represents the potential code of the nth target vehicle in the kth predicted trajectory set, X represents the historical trajectory of the nth target vehicle, and p θ represents the conditional Gaussian prior, z n represents the overall potential code of the n-th target vehicle, K represents the last set of predicted trajectories, represents the k1th predicted trajectory set, represents the k2th predicted trajectory set, σ d Represents the scaling parameter.

2. The trajectory prediction method according to claim 1, characterized in that The clustering of the neighboring vehicles based on the historical trajectories of the neighboring vehicles to obtain the driving styles of the neighboring vehicles includes: Based on the historical trajectory of the neighboring vehicle, a distribution model is used to calculate the probability density of the neighboring vehicle belonging to each Gaussian distribution; multiple Gaussian distributions correspond one to one with multiple driving styles; Optimizing the distribution model using all probability densities to obtain a final distribution model, and calculating a final probability density of the neighboring vehicle belonging to each Gaussian distribution based on the final distribution model; A final Gaussian distribution to which the neighboring vehicle belongs is obtained according to all final probability densities, and the driving style corresponding to the final Gaussian distribution is used as the driving style of the neighboring vehicle.

3. The trajectory prediction method according to claim 2, characterized in that The method of optimizing the distribution model using all probability densities to obtain a final distribution model includes: Calculate the total probability density of the neighboring vehicles based on all probability densities; Determining whether the total probability density of the neighboring vehicles is greater than a preset probability density; If yes, the distribution model is used as the final distribution model; Otherwise, the mixing coefficient, mean and covariance matrix in the distribution model are adjusted, and the step of calculating the probability density of the neighboring vehicle belonging to each Gaussian distribution using the distribution model based on the historical trajectory of the neighboring vehicle is returned to.

4. The trajectory prediction method according to claim 3, characterized in that Calculating the total probability density of the neighboring vehicles based on all probability densities includes: By formula: Calculate the total probability density p(x) of the neighboring vehicles; Among them, π k represents the mixing coefficient of the rth Gaussian distribution, N(x|μ r ,∑ r ) represents the probability density of the neighboring vehicle belonging to the rth Gaussian distribution, μ k represents the mean of the rth Gaussian distribution, ∑ r represents the covariance matrix of the rth Gaussian distribution, R represents the number of Gaussian distributions, and x represents the historical trajectory of the neighboring vehicle.

5. The trajectory prediction method according to claim 1, characterized in that The method of performing trajectory prediction on each target vehicle using a prediction model based on the traffic status of all target vehicles and the driving styles of all neighboring vehicles to obtain a predicted trajectory of each target vehicle includes: Calculating a historical feature sequence based on the historical trajectories of all target vehicles, and generating a potential code for each target vehicle according to the historical feature sequence; For each target vehicle, a plurality of predicted trajectories of the target vehicle are obtained based on the potential code of the target vehicle, the traffic state, and the driving styles of all corresponding neighboring vehicles.

6. The trajectory prediction method according to claim 5, characterized in that The calculation of the historical feature sequence based on the historical trajectories of all target vehicles includes: By formula: C=Agent Aware Attention(Q,K,V)+[E1,E2,…,E n ] Q=K=V=[E1,E2,…,E n ] Calculate the historical feature sequence C; Among them, Agent Aware Attention (Q, K, V) represents the encoding vector, E1 represents the historical trajectory of the first target vehicle, E2 represents the historical trajectory of the second target vehicle, and E n represents the historical trajectory of the nth target vehicle, softmax() represents the activation function, A represents the attention score matrix, M represents the mask, Q self Denotes the predicted query vector, Q other represents other query vectors, K self Denotes the predicted key vector, K other represents the prediction key vector, Q represents the query vector, K represents the key vector, and V represents the value vector. and Both represent the prediction projection weights, and All represent other projection weights.

7. The trajectory prediction method according to claim 1, characterized in that The method of training the prediction model using the prediction loss function to obtain a final prediction model includes: Determine whether the predicted loss function is less than a preset loss function value; If yes, the prediction model is used as the final prediction model; Otherwise, the parameters in the prediction model are adjusted, and the process returns to the step of performing trajectory prediction on each target vehicle using the prediction model according to the driving styles and traffic conditions of all target vehicles to obtain a predicted trajectory of each target vehicle.

8. A terminal device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the trajectory prediction method integrating traffic conditions and driving style is implemented as described in any one of claims 1 to 7.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the trajectory prediction method integrating traffic conditions and driving styles is implemented as claimed in any one of claims 1 to 7.