Trajectory prediction method, model training method, device, equipment, medium and vehicle
By constructing the embedding vector matrix and adjacency matrix of the trajectory points, the road scene model is accurately constructed, which solves the accuracy problem of oncoming vehicle trajectory prediction in autonomous driving and improves driving safety.
Patent Information
- Application Number
- CN202310195276.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-24
- Publication Date
- 2024-08-27
AI Technical Summary
In autonomous driving, it is difficult for existing technology to accurately predict the trajectory of oncoming vehicles, resulting in limited driving safety, especially due to the large amount of data processing and unsatisfactory results.
By obtaining the nearest N trajectory points and position data in the historical trajectory of the vehicle to be tested, the embedding vector matrix and adjacency matrix corresponding to the trajectory points are constructed, trajectory prediction is performed based on these data, and the road scene model is accurately constructed.
The accuracy of vehicle trajectory prediction is improved, the driving trajectory of the vehicle to be tested can be predicted more accurately, and driving safety is enhanced.
Smart Images

Figure CN118551871A
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of trajectory prediction, and in particular to a trajectory prediction method, a model training method, an apparatus, a device, a medium and a vehicle. Background Art
[0002] In order to improve driving safety in autonomous driving, it is necessary to predict the driving trajectories of other vehicles around the vehicle. Usually, the images of other vehicles around the vehicle are collected by the on-board camera, and the relative position relationship between other vehicles around the vehicle and the vehicle is obtained through the images. Then, the trajectory prediction of other vehicles around the vehicle is completed based on the changes in the relative position relationship.
[0003] This method requires judgment through comparison of image data, which requires a large amount of data processing, and uses the relative position relationship between vehicles to predict trajectories. The results are often not ideal, especially for how to predict oncoming vehicles. There is currently no good solution. Summary of the invention
[0004] In order to solve the above technical problems, the present disclosure provides a trajectory prediction method, a model training method, an apparatus, a device, a medium and a vehicle.
[0005] A first aspect of an embodiment of the present disclosure provides a trajectory prediction method, the method comprising:
[0006] Obtain the N track points closest to the current moment in the historical track of the vehicle to be tested and the position data of each track point;
[0007] For each trajectory point, the search range corresponding to the trajectory point is obtained using the preset range and the position data of the trajectory point, and the lane line is searched within the search range to obtain the target lane line corresponding to the trajectory point;
[0008] For each trajectory point, the lane line point set of the target lane line corresponding to the trajectory point and the position data of the trajectory point are encoded to construct an embedded vector matrix corresponding to the trajectory point, and the lane line point set contains the position data of each lane point in the target lane line;
[0009] For each trajectory point, the lane segment closest to the trajectory point in the target lane line is determined as the first lane segment, and at least one lane segment adjacent to the first lane segment is determined as the second lane segment. The point set of the first lane segment and the point set of the second lane segment in the lane line point set are encoded to construct an adjacency matrix corresponding to the trajectory point.
[0010] Trajectory prediction is performed based on the embedding vector matrix and adjacency matrix corresponding to the N trajectory points to obtain the predicted trajectory of the vehicle to be tested.
[0011] A second aspect of an embodiment of the present disclosure provides a method for training a trajectory prediction model, the method comprising:
[0012] Obtain L consecutive trajectory points of the sample vehicle and the position data of each trajectory point from the historical data;
[0013] According to the time sequence of the trajectory points, the trajectory formed by the M consecutive trajectory points after the L trajectory points is taken as the target trajectory;
[0014] For each of the L trajectory points, a search range corresponding to the trajectory point is obtained using a preset range and the position data of the trajectory point, and a lane line is searched within the search range to obtain a target lane line corresponding to the trajectory point;
[0015] For each of the L trajectory points, encode the lane line point set of the target lane line corresponding to the trajectory point and the position data of the trajectory point to construct an embedding vector matrix corresponding to the trajectory point;
[0016] For each of the L trajectory points, the lane segment closest to the trajectory point in the target lane line is determined as the first lane segment, at least one lane segment adjacent to the first lane segment is determined as the second lane segment, the point set of the first lane segment and the point set of the second lane segment in the lane line point set are encoded, and an adjacency matrix corresponding to the trajectory point is constructed;
[0017] The embedding vector matrix and adjacency matrix corresponding to the L trajectory points are input into the prediction model, and the predicted trajectory of the sample vehicle is output based on the prediction model;
[0018] Based on the predicted trajectory and the target trajectory, the iterative function is calculated;
[0019] The parameters of the prediction model are adjusted according to the iterative function, and the prediction model is iteratively trained until the iterative function value converges or the set number of iterations is reached to obtain a trained trajectory prediction model.
[0020] A third aspect of an embodiment of the present disclosure provides a trajectory prediction device, the device comprising:
[0021] The first acquisition module is used to obtain the N track points closest to the current moment in the historical track of the vehicle to be tested and the position data of each track point;
[0022] A first search module is used to obtain a search range corresponding to each trajectory point by using a preset range and the position data of the trajectory point, and to search for a lane line within the search range to obtain a target lane line corresponding to the trajectory point;
[0023] The first construction module is used to encode the lane line point set of the target lane line corresponding to the trajectory point and the position data of the trajectory point for each trajectory point, and construct an embedded vector matrix corresponding to the trajectory point, wherein the lane line point set contains the position data of each lane point in the target lane line;
[0024] A second construction module is used to determine, for each trajectory point, a lane segment in the target lane line that is closest to the trajectory point as a first lane segment, determine at least one lane segment adjacent to the first lane segment as a second lane segment, encode a point set of the first lane segment and a point set of the second lane segment in a lane line point set, and construct an adjacency matrix corresponding to the trajectory point;
[0025] The first prediction module is used to perform trajectory prediction based on the embedding vector matrix and the adjacency matrix corresponding to the N trajectory points to obtain the predicted trajectory of the vehicle to be tested.
[0026] A fourth aspect of an embodiment of the present disclosure provides a training device for a trajectory prediction model, the device comprising:
[0027] The second acquisition module is used to obtain L consecutive trajectory points of the sample vehicle and the position data of each trajectory point from the historical data;
[0028] A determination module, used for taking the trajectory formed by M consecutive trajectory points after L trajectory points as the target trajectory according to the time sequence of the trajectory points;
[0029] A second search module is used to obtain a search range corresponding to the trajectory point for each of the L trajectory points using a preset range and the position data of the trajectory point, and to search for a lane line within the search range to obtain a target lane line corresponding to the trajectory point;
[0030] The third construction module is used to encode the lane line point set of the target lane line corresponding to the trajectory point and the position data of the trajectory point for each trajectory point in the L trajectory points, and construct an embedding vector matrix corresponding to the trajectory point;
[0031] a fourth construction module, for each of the L trajectory points, determining the lane segment closest to the trajectory point in the target lane line as the first lane segment, determining at least one lane segment adjacent to the first lane segment as the second lane segment, encoding the point set of the first lane segment and the point set of the second lane segment in the lane line point set, and constructing an adjacency matrix corresponding to the trajectory point;
[0032] The second prediction module is used to input the embedding vector matrix and the adjacency matrix corresponding to the L trajectory points into the prediction model, and output the predicted trajectory of the sample vehicle based on the prediction model;
[0033] A calculation module, used for calculating an iterative function based on the predicted trajectory and the target trajectory;
[0034] The training module is used to adjust the parameters of the prediction model according to the iterative function, and iteratively train the prediction model until the iterative function value converges or reaches the set number of iterations to obtain a trained trajectory prediction model.
[0035] A fifth aspect of an embodiment of the present disclosure provides a computer device, comprising a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the trajectory prediction method of the first aspect or the trajectory prediction model training method of the second aspect can be implemented.
[0036] A sixth aspect of an embodiment of the present disclosure provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the trajectory prediction method of the first aspect or the trajectory prediction model training method of the second aspect can be implemented.
[0037] A seventh aspect of an embodiment of the present disclosure provides a vehicle, which includes the trajectory prediction device of the third aspect or the training device of the trajectory prediction model of the fourth aspect or the computer device of the fifth aspect or the computer-readable storage medium of the sixth aspect.
[0038] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has the following advantages:
[0039] In the disclosed embodiment, N trajectory points closest to the current moment in the historical trajectory of the vehicle to be tested and the position data of each trajectory point are obtained; for each trajectory point, a search range corresponding to the trajectory point is obtained using a preset range and the position data of the trajectory point, and the lane line is searched within the search range to obtain the target lane line corresponding to the trajectory point; for each trajectory point, a lane line point set of the target lane line corresponding to the trajectory point and the position data of the trajectory point are encoded and processed to construct an embedded vector matrix corresponding to the trajectory point; for each trajectory point, a lane segment closest to the trajectory point in the target lane line is determined as a first lane segment, and at least one lane segment adjacent to the first lane segment is determined as a second lane segment, and the point set of the first lane segment and the point set of the second lane segment in the lane line point set are encoded and processed to construct an adjacency matrix corresponding to the trajectory point; trajectory prediction is performed based on the embedded vector matrix and the adjacency matrix corresponding to the N trajectory points to obtain a predicted trajectory of the vehicle to be tested, and a real road scene model can be accurately constructed through the positional relationship between the trajectory point and the lane line of the historical trajectory of the vehicle to be tested and the positional relationship between each lane segment in the road, thereby improving the accuracy of vehicle trajectory prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0042] Figure 1 is a flow chart of a trajectory prediction method provided by an embodiment of the present disclosure;
[0043] Figure 2 is a flow chart of another trajectory prediction method provided by an embodiment of the present disclosure;
[0044] Figure 3 is a flow chart of another trajectory prediction method provided by an embodiment of the present disclosure;
[0045] Figure 4 is a flowchart of a method for training a trajectory prediction model provided by an embodiment of the present disclosure;
[0046] Figure 5 is a structural schematic diagram of a trajectory prediction device provided by an embodiment of the present disclosure;
[0047] Figure 6 It is a structural schematic diagram of a trajectory prediction model training device provided by an embodiment of the present disclosure;
[0048] Figure 7 It is a structural diagram of a computer device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0049] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0050] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0051] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0052] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0053] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0054] In response to the defects of related technologies in vehicle trajectory prediction, the embodiments of the present disclosure provide a trajectory prediction method, a model training method, an apparatus, a device, a medium and a vehicle, which can accurately construct a real road scene model by obtaining the positional relationship between the trajectory points of the historical trajectory of the vehicle to be tested and the lane points in the lane line, as well as the positional relationship between each lane segment in the road, thereby improving the accuracy of vehicle trajectory prediction.
[0055] The trajectory prediction method provided by the embodiments of the present disclosure may be executed by a computer device, which may be understood as any device with processing and computing capabilities, and may include but is not limited to electronic devices such as laptop computers, tablet computers (PADs), vehicle-mounted terminals, and desktop computers.
[0056] In order to better understand the inventive concept of the embodiments of the present disclosure, the technical solutions of the embodiments of the present disclosure are described below in conjunction with exemplary embodiments.
[0057] Figure 1 is a flow chart of a trajectory prediction method provided by an embodiment of the present disclosure. Figure 1 As shown, the trajectory prediction method provided in this embodiment may include steps 110-150:
[0058] Step 110: Obtain the N track points closest to the current moment in the historical track of the vehicle to be tested and the position data of each track point.
[0059] In the disclosed embodiment, the vehicle to be tested is a vehicle whose driving trajectory needs to be predicted, and may be a vehicle to be tested around the vehicle. The computer device may obtain the historical trajectory of the vehicle to be tested from historical data; wherein the historical data may be the historical data of the vehicle to be tested collected by the vehicle-mounted sensor of the vehicle, or may be the historical data of the vehicle to be tested received using technologies such as the Internet of Vehicles; the historical data may include the trajectory points contained in the trajectory of the vehicle and the position data of each trajectory point, and the position data of the trajectory point may be understood as the specific coordinates of the trajectory point in a certain coordinate system in the driving environment, for example, it may be the specific coordinates of the trajectory point in the vehicle coordinate system of the vehicle. The historical trajectory of the vehicle to be tested may be understood as the motion trajectory of the vehicle to be tested before the current moment, and the historical trajectory may be composed of multiple trajectory points of the vehicle to be tested. The computer device may obtain the N trajectory points closest to the current moment and the position data of each trajectory point in the historical trajectory of the vehicle to be tested.
[0060] Step 120: for each trajectory point, a search range corresponding to the trajectory point is obtained using a preset range and the position data of the trajectory point, and a lane line is searched within the search range corresponding to the trajectory point to obtain a target lane line corresponding to the trajectory point.
[0061] In the disclosed embodiment, after obtaining the position data of each trajectory point in the historical trajectory, the computer device can use the specific coordinates of each trajectory point in the self-vehicle coordinate system as the center point of the preset range to obtain the search range corresponding to each trajectory point in the self-vehicle coordinate system, and then search for the lane line within the search range corresponding to each trajectory point to obtain the lane line within the search range, and then determine it as the target lane line corresponding to the trajectory point.
[0062] The preset range can be pre-set as needed, for example, a circular range with a radius of 50m, which is not specifically limited here. In addition, the specific position of the lane line in the vehicle coordinate system can be obtained by combining with map data, or can be collected by vehicle-mounted sensors, which is not limited here.
[0063] Step 130: For each trajectory point, encode the lane line point set of the target lane line corresponding to the trajectory point and the position data of the trajectory point to construct an embedded vector matrix corresponding to the trajectory point, wherein the lane line point set contains the position data of each lane point in the target lane line.
[0064] In the disclosed embodiment, each lane line may be composed of multiple lane segments, each lane segment may be composed of multiple lane points, and the lane line point set is a collection of position data of each lane point contained in the lane line, and the position data of the lane point may be the coordinates of the lane point in the vehicle's own vehicle coordinate system, or may be the coordinates and direction of the lane point in the vehicle's own vehicle coordinate system. The computer device may obtain the position data of each lane point contained in the target lane line corresponding to each trajectory point in the world coordinate system from the high-precision map, and then convert the position data of the lane point in the world coordinate system to the vehicle's own vehicle coordinate system, to obtain the position data of the lane point contained in the target lane line corresponding to each trajectory point, that is, the lane line point set of the target lane line corresponding to each trajectory point.
[0065] In the disclosed embodiment, for each trajectory point, the computer device may encode the lane line point set of the target lane line corresponding to the trajectory point and the position data of the trajectory point to obtain the embedding vector matrix corresponding to the trajectory point, and then construct the embedding vector matrix corresponding to the N trajectory points. Each row of the embedding vector matrix may represent the position data of a lane point or the embedding vector of the position data of the trajectory point.
[0066] For example, if the embedding vector matrix is a U×V matrix, U represents the number of rows of the embedding vector matrix, and V represents the number of columns of the embedding vector matrix. The lane line point set of the target lane line corresponding to the trajectory point a includes the coordinates of the three lane points A, B, and C in the vehicle coordinate system of the vehicle to be tested. The coordinates of point A are (X1, Y1, Z1), the coordinates of point B are (X2, Y2, Z2), and the coordinates of point C are (X3, Y3, Z3). The embedding vector established for point A is {X1, Y1, Z1}, the embedding vector established for point B is {X2, Y2, Z2}, and the embedding vector established for point C is {X3, Y 3, Z3}, when N is 1, the coordinates of trajectory point a in the vehicle coordinate system of the vehicle to be tested are (x1, y1, z1), and the embedding vector established by trajectory point a is {x1, y1, z1}. The embedding vector established by point A is input into the first row of the matrix, the embedding vector established by point B is input into the second row of the matrix, the embedding vector established by point C is input into the third row of the matrix, and the embedding vector established by trajectory point a is input into the fourth row of the matrix. The remaining elements in the matrix are set to 0, and the embedding vector matrix constructed by the position data of the three lane points A, B, and C and the position data of trajectory point a can be obtained.
[0067] In some embodiments, the computer device can convert the lane line point set of the target lane line corresponding to each trajectory point into a first embedding vector, convert the position data of each trajectory point into a second embedding vector, and then add each first embedding vector to the matrix in a first direction, and add each second embedding vector to the matrix in a second direction to obtain an embedded vector matrix, where the second direction is opposite to the first direction. For example, the first embedding vector can be added to the matrix from the front of the matrix to the back, and the second embedding vector can be added to the matrix from the back of the matrix to the front.
[0068] It should be noted that the encoding process of the lane line point set of the target lane line corresponding to the trajectory point and the position data of the trajectory point can be completed by using embedded expression, and the specific form is not limited here.
[0069] Step 140: For each trajectory point, determine the lane segment in the target lane line that is closest to the trajectory point as the first lane segment, determine at least one lane segment adjacent to the first lane segment as the second lane segment, encode the point set of the first lane segment and the point set of the second lane segment in the lane line point set, and construct an adjacency matrix corresponding to the trajectory point.
[0070] In the disclosed embodiment, for each trajectory point, the computer device may determine the lane segment closest to the trajectory point as the first lane segment, and determine at least one lane segment adjacent to the first lane segment as the second lane segment, wherein the adjacent lane segment of the first lane segment includes at least one of the preceding lane segment, the succeeding lane segment, the left lane segment, and the right lane segment of the first lane segment, wherein the preceding lane segment of the first lane segment is the first lane segment in the forward direction of the first lane segment, the succeeding lane segment of the first lane segment is the first lane segment in the backward direction of the first lane segment, the left lane segment of the first lane segment is the first lane segment on the left side of the forward direction of the first lane segment, and the right lane segment of the first lane segment is the first lane segment on the right side of the forward direction of the first lane segment. The computer device may encode the point set of the first lane segment and the point set of the second lane segment in the lane line point set of the target lane line corresponding to the trajectory point, construct an adjacency matrix corresponding to the trajectory point, and then construct an adjacency matrix corresponding to N trajectory points. The adjacency matrix may represent the association relationship between each node.
[0071] Specifically, for each trajectory point, the lane line point set of the target lane line corresponding to the trajectory point and the point set of the first lane segment can be converted into vector matrices respectively, and the vector matrix corresponding to the point set of the first lane segment and the vector matrices corresponding to the point sets of each second lane segment are used as nodes of the adjacency matrix, and the connection relationship between the vector matrices corresponding to each point set is used as the edge of the adjacency matrix to construct the adjacency matrix corresponding to the trajectory point. For example, for trajectory point a, the lane segment closest to trajectory point a in the target lane line corresponding to trajectory point a is lane segment 1, and lane segment 1 is the first lane segment. The lane segments adjacent to lane segment 1 include the preceding lane segment 2 of lane segment 1, the succeeding lane segment 3 of lane segment 1, the left lane segment 4 of lane segment 1, and the right lane segment 5 of lane segment 1. The preceding lane segment 2, the succeeding lane segment 3, the left lane segment 4, and the right lane segment 5 are determined as the second lane segment. The point sets of lane segment 1, the preceding lane segment 2, the succeeding lane segment 3, the left lane segment 4, and the right lane segment 5 are respectively converted into vector matrices, and the vector matrices corresponding to the point sets of lane segment 1, the preceding lane segment 2, the succeeding lane segment 3, the left lane segment 4, and the right lane segment 5 are respectively determined as nodes of the adjacency matrix, and the connection relationship between the vector matrices corresponding to each point set is determined as an edge of the adjacency matrix. The adjacency matrix corresponding to trajectory point a is constructed based on each node and edge.
[0072] It should be noted that the encoding process of the point set of the first lane segment and the point set of the second lane segment in the lane line point set of the target lane line corresponding to the trajectory point can be completed using an adjacency matrix, and the specific form is not limited here.
[0073] Step 150: perform trajectory prediction based on the embedding vector matrix and the adjacency matrix corresponding to the N trajectory points to obtain a predicted trajectory of the vehicle to be tested.
[0074] In the disclosed embodiment, the computer device may input the embedding vector matrix and the adjacency matrix corresponding to the N trajectory points in the historical trajectory into a preset trajectory prediction model, predict the trajectory of the vehicle to be tested based on the trajectory prediction model, and obtain the predicted trajectory of the vehicle to be tested. Specifically, feature extraction may be completed by the input layer of the trajectory prediction model, feature fusion may be completed by the fusion layer of the trajectory prediction model, and the predicted trajectory of the vehicle to be tested may be output by the output layer of the trajectory prediction model. Specifically, the input layer may include a VectorNet model and a MapNet model, and the fusion layer may include a feature fusion model based on a cross-attention mechanism. The trajectory prediction model may be a deep learning model built based on the cross-attention mechanism Cross Attention. The cross-attention mechanism can analyze the correlation between two different features and fuse the two features with a larger correlation.
[0075] In some embodiments, performing trajectory prediction based on the embedding vector matrix and the adjacency matrix corresponding to the N trajectory points to obtain the predicted trajectory of the vehicle to be tested may include steps 1501-1504:
[0076] Step 1501: input the embedding vector matrix corresponding to the N trajectory points into the VectorNet model in the preset trajectory prediction model, and extract the trajectory features of the vehicle to be tested based on the VectorNet model.
[0077] In the disclosed embodiment, the computer device can input the embedded vector matrix corresponding to N trajectory points into the VectorNet model in the trajectory prediction model, and extract the trajectory features of the vehicle to be tested based on the VectorNet model. The trajectory features can include the correlation between the historical trajectory of the vehicle to be tested and the lane line, and the trajectory features are in the form of a feature vector matrix. Among them, the VectorNet model can be understood as a hierarchical graph neural network, which can encode the data of the historical trajectory points of the vehicle to be tested and the data of the lane line into graph nodes, and obtain the correlation between the historical trajectory of the vehicle to be tested and the lane line.
[0078] Step 1502: input the adjacency matrix corresponding to the N trajectory points into the MapNet model in the preset trajectory prediction model, and extract the map features corresponding to the N trajectory points based on the MapNet model.
[0079] In the disclosed embodiment, the computer device can input the adjacency matrix corresponding to each trajectory point into a preset MapNet model, and extract the map features corresponding to N trajectory points in the historical trajectory based on the MapNet model. The map features may include the positional relationship between the first lane segment and other lane segments corresponding to the vehicle to be tested, and the positional relationship between the trajectory point of the vehicle to be tested and each lane point in the target lane line, etc. The map features are in the form of a feature vector matrix, and the dimension of the matrix is the same as the dimension of the feature vector matrix corresponding to the above-mentioned trajectory features. Among them, the MapNet model can be understood as a deep learning network, which can be used to extract structured map information from vectorized high-precision map data.
[0080] Step 1503: Fuse the trajectory features and map features based on the cross-attention mechanism to obtain fused features.
[0081] In the disclosed embodiment, after obtaining the trajectory features and the map features, the computer device can analyze the correlation between the features in the trajectory features and the map features based on the cross-attention mechanism, assign a larger weight to the features with a larger correlation, and assign a smaller weight to the features with a smaller correlation, and then fuse the trajectory features and the map features to obtain a fused feature, and the fused feature is in the form of a feature vector matrix.
[0082] Step 1504: predict the trajectory of the vehicle to be tested based on the fusion features to obtain a predicted trajectory of the vehicle to be tested.
[0083] In the disclosed embodiment, after obtaining the fusion feature, the computer device can decode the fusion feature to obtain decoded data, predict the trajectory of the vehicle to be tested based on the decoded data, and obtain the position data of multiple trajectory points of the vehicle to be tested within a preset time period after the current moment. Based on the position data of the multiple trajectory points, the predicted trajectory of the vehicle to be tested within the preset time period after the current moment can be obtained, for example, the trajectory of the vehicle to be tested within the next 3 seconds can be predicted.
[0084] Therefore, the real road scene model can be accurately constructed through the positional relationship between the trajectory points of the historical trajectory of the vehicle to be tested and the lane lines, as well as the positional relationship between the various lane segments in the road, thereby improving the accuracy of vehicle trajectory prediction.
[0085] In the disclosed embodiment, N trajectory points closest to the current moment in the historical trajectory of the vehicle to be tested and the position data of each trajectory point are obtained; for each trajectory point, a search range corresponding to the trajectory point is obtained using a preset range and the position data of the trajectory point, and the lane line is searched within the search range to obtain the target lane line corresponding to the trajectory point; for each trajectory point, a lane line point set of the target lane line corresponding to the trajectory point and the position data of the trajectory point are encoded and processed to construct an embedded vector matrix corresponding to the trajectory point; for each trajectory point, a lane segment closest to the trajectory point in the target lane line is determined as a first lane segment, and at least one lane segment adjacent to the first lane segment is determined as a second lane segment, and the point set of the first lane segment and the point set of the second lane segment in the lane line point set are encoded and processed to construct an adjacency matrix corresponding to the trajectory point; trajectory prediction is performed based on the embedded vector matrix and the adjacency matrix corresponding to the N trajectory points to obtain a predicted trajectory of the vehicle to be tested, and a real road scene model can be accurately constructed through the positional relationship between the trajectory point and the lane line of the historical trajectory of the vehicle to be tested and the positional relationship between each lane segment in the road, thereby improving the accuracy of vehicle trajectory prediction.
[0086] Figure 2 is a flow chart of a trajectory prediction method provided by an embodiment of the present disclosure. Figure 2 As shown, the trajectory prediction method provided in this embodiment may include steps 210-280:
[0087] Step 210: Obtain the N track points closest to the current moment in the historical track of the vehicle to be tested and the position data of each track point.
[0088] Step 220: for each trajectory point, a search range corresponding to the trajectory point is obtained using a preset range and the position data of the trajectory point, and a lane line is searched within the search range corresponding to the trajectory point to obtain a target lane line corresponding to the trajectory point.
[0089] Steps 201-202 in the embodiment of the present disclosure may refer to the contents of the above-mentioned steps 110-120, which will not be repeated here.
[0090] Step 230: Starting from the starting point of the target lane line, the target lane line is divided into a plurality of lane segments at a first preset distance, and a first centerline coordinate corresponding to the centerline of each lane segment is calculated.
[0091] In the disclosed embodiment, the computer device may start from the starting point of the target lane line, divide the target lane line into a plurality of lane segments at intervals of a first preset distance, and then calculate the first centerline coordinates corresponding to the centerline of the lane segment according to the coordinates of each lane point included in the lane segment. The first preset distance may be set as required and is not specifically limited here.
[0092] In some embodiments, the starting point coordinates of the center line of each lane segment may be determined as the first center line coordinates corresponding to each center line; in other embodiments, the midpoint coordinates of the center line of each lane segment may be determined as the first center line coordinates corresponding to each center line; in still other embodiments, the ending point coordinates of the center line of each lane segment may be determined as the first center line coordinates corresponding to each center line.
[0093] Step 240: starting from the starting point of each lane segment, each lane segment is divided into a plurality of sub-lane segments at a second preset distance, and a second centerline coordinate corresponding to the centerline of each sub-lane segment is calculated.
[0094] In the disclosed embodiment, after the target lane line is divided into a plurality of lane segments of equal distance, the computer device may start from the starting point of each lane segment and divide each lane segment into a plurality of sub-lane segments at intervals of a second preset distance, and then calculate the second centerline coordinates corresponding to the centerline of the sub-lane segment according to the coordinates of each lane point included in the sub-lane segment. The second preset distance may be set as required and is not specifically limited here.
[0095] In some embodiments, the starting point coordinates of the center line of each sub-lane segment can be determined as the second center line coordinates corresponding to each center line; in other embodiments, the midpoint coordinates of the center line of each sub-lane segment can be determined as the second center line coordinates corresponding to each center line; in still other embodiments, the end point coordinates of the center line of each sub-lane segment can be determined as the second center line coordinates corresponding to each center line.
[0096] Step 250: construct a lane line point set of the target lane line based on the first center line coordinates and the second center line coordinates.
[0097] In the disclosed embodiment, the computer device may determine a set constructed by first centerline coordinates and second centerline coordinates corresponding to the target lane line as a lane line point set of the target lane line.
[0098] Step 260: For each trajectory point, encode the lane line point set of the target lane line corresponding to the trajectory point and the position data of the trajectory point to construct an embedding vector matrix corresponding to the trajectory point.
[0099] The contents of the embodiments of the present disclosure may refer to the contents of the above step 130 and will not be repeated here.
[0100] Step 270: For each trajectory point, determine the lane segment in the target lane line that is closest to the trajectory point as the first lane segment, determine at least one lane segment adjacent to the first lane segment as the second lane segment, encode the point set of the first lane segment and the point set of the second lane segment in the lane line point set, and construct an adjacency matrix corresponding to the trajectory point.
[0101] Step 280: perform trajectory prediction based on the embedding vector matrix and the adjacency matrix corresponding to the N trajectory points to obtain a predicted trajectory of the vehicle to be tested.
[0102] The contents of steps 260-280 in the embodiment of the present disclosure may refer to the contents of steps 130-150 described above, and will not be repeated here.
[0103] Therefore, the real road scene model can be accurately constructed through the positional relationship between the trajectory points of the historical trajectory of the vehicle to be tested and the lane lines, as well as the positional relationship between the lane segments in the road, thereby improving the accuracy of vehicle trajectory prediction.
[0104] Figure 3 is a flow chart of a trajectory prediction method provided by an embodiment of the present disclosure. Figure 3 As shown, the trajectory prediction method provided in this embodiment may include steps 310-370:
[0105] Step 310: Obtain the original track points contained in the historical track of the vehicle to be tested.
[0106] In the disclosed embodiment, the computer device may obtain the original track points included in the historical track of the vehicle to be tested.
[0107] Step 320: insert virtual track points between the original track points to obtain an updated historical track, wherein the distance between adjacent track points in the updated historical track is a preset fixed distance.
[0108] In the disclosed embodiment, the spacing between the original track points contained in the historical track of the vehicle to be tested may be uneven, resulting in the historical track being inaccurate. Therefore, the computer device can insert virtual track points between the original track points to obtain an updated historical track, and the distance between adjacent track points in the updated historical track is a preset fixed spacing, which can be set as needed and is not specifically limited here. The spacing between any two adjacent track points in the historical track thus obtained is equal, and the accuracy of the historical track is improved due to the increase in the number of track points.
[0109] Specifically, the coordinates of the center line of the lane line and the coordinates of the first trajectory point of the original trajectory point of the vehicle to be tested can be converted to the Frenet coordinate system to obtain the distance ds between every two original trajectory points in the direction of the longitudinal coordinate s; then the historical trajectory of the vehicle to be tested is evenly divided into trajectory points with preset intervals, and according to the size of ds, virtual trajectory points are interpolated in the middle of each segment ds of the original trajectory points, and finally the obtained new trajectory is converted back to the Cartesian coordinate system to obtain the updated historical trajectory.
[0110] Step 330: Obtain the N track points closest to the current time in the updated historical track and the position data of each track point.
[0111] In the disclosed embodiment, the computer device may obtain the N track points closest to the current moment in the updated historical track and the position data of each track point.
[0112] Step 340: For each trajectory point, a search range corresponding to the trajectory point is obtained using a preset range and the position data of the trajectory point, and a lane line is searched within the search range to obtain a target lane line corresponding to the trajectory point.
[0113] Step 350: For each trajectory point, encode the lane line point set of the target lane line corresponding to the trajectory point and the position data of the trajectory point to construct an embedding vector matrix corresponding to the trajectory point.
[0114] Step 360: For each trajectory point, determine the lane segment in the target lane line that is closest to the trajectory point as the first lane segment, determine at least one lane segment adjacent to the first lane segment as the second lane segment, encode the point set of the first lane segment and the point set of the second lane segment in the lane line point set, and construct an adjacency matrix corresponding to the trajectory point.
[0115] Step 370: perform trajectory prediction based on the embedding vector matrix and the adjacency matrix corresponding to the N trajectory points to obtain a predicted trajectory of the vehicle to be tested.
[0116] Steps 340-370 in the embodiment of the present disclosure may refer to the contents of the above-mentioned steps 120-150, which will not be repeated here.
[0117] Therefore, by inserting virtual trajectory points between original trajectory points, the distance between any two adjacent trajectory points in the historical trajectory is made equal, which improves the accuracy of the historical trajectory, thereby improving the accuracy of the trajectory point position and further improving the accuracy of vehicle trajectory prediction.
[0118] Figure 4 is a flowchart of a method for training a trajectory prediction model provided by an embodiment of the present disclosure, such as Figure 4 As shown, the trajectory prediction model training method provided in this embodiment may include steps 410-480:
[0119] Step 410: Obtain L consecutive trajectory points of the sample vehicle and position data of each trajectory point from historical data.
[0120] In the disclosed embodiment, the computer device may obtain L consecutive trajectory points of the sample vehicle and the position data of each trajectory point from historical data.
[0121] Step 420: According to the time sequence of the generation of the trajectory points, the trajectory formed by the M consecutive trajectory points after the L trajectory points is used as the target trajectory.
[0122] In the disclosed embodiment, the computer device may use the trajectory formed by M consecutive trajectory points after L trajectory points in the time sequence of the trajectory points as the target trajectory. The target trajectory may be understood as the trajectory of target prediction.
[0123] Step 430: for each of the L trajectory points, a search range corresponding to the trajectory point is obtained using a preset range and the position data of the trajectory point, and a lane line is searched within the search range to obtain a target lane line corresponding to the trajectory point.
[0124] Step 440: For each of the L trajectory points, encode the lane line point set of the target lane line corresponding to the trajectory point and the position data of the trajectory point to construct an embedding vector matrix corresponding to the trajectory point.
[0125] Step 450: For each of the L trajectory points, determine the lane segment in the target lane line that is closest to the trajectory point as the first lane segment, determine at least one lane segment adjacent to the first lane segment as the second lane segment, encode the point set of the first lane segment and the point set of the second lane segment in the lane line point set, and construct an adjacency matrix corresponding to the trajectory point.
[0126] The contents of steps 430-450 in the embodiment of the present disclosure may refer to the contents of steps 120-140 described above, and will not be repeated here.
[0127] Step 460: Input the embedding vector matrix and the adjacency matrix corresponding to the L trajectory points into the prediction model, and output the predicted trajectory of the sample vehicle based on the prediction model.
[0128] In the disclosed embodiment, the embedding vector matrix and adjacency matrix corresponding to the L trajectory points can be input into the prediction model, the input layer of the prediction model completes feature extraction, the fusion layer of the prediction model completes feature fusion, and the output layer of the prediction model outputs the predicted trajectory of the sample vehicle.
[0129] Step 470: Calculate an iterative function based on the predicted trajectory and the target trajectory.
[0130] In the disclosed embodiment, the predicted trajectory can be compared with the target trajectory to determine the error between the predicted trajectory and the target trajectory. The iterative function is the sum of the squares of the distances between each point in the point set of the predicted trajectory and each point in the point set of the target trajectory. The point set is the position data of each trajectory point contained in the trajectory in the self-vehicle coordinate system of the sample vehicle.
[0131] Step 480: adjust the parameters of the prediction model according to the iterative function, and iteratively train the prediction model until the iterative function value converges or reaches a set number of iterations to obtain a trained trajectory prediction model.
[0132] In the disclosed embodiment, the parameters of the prediction model can be adjusted according to the iterative function, and the prediction model can be iteratively trained until the iterative function value converges or reaches a set number of iterations, that is, the sum of the squares of the distances between each point in the point set of the predicted trajectory and each point in the point set of the target trajectory converges or reaches a set number of iterations, then the training is completed and a trained trajectory prediction model is obtained.
[0133] Therefore, the vehicle trajectory prediction model can be trained through the positional relationship between the trajectory points of the sample vehicle's historical trajectory and the lane lines, as well as the positional relationship between the lane segments in the road. The trajectory prediction model can accurately construct a real road scene model and achieve accurate prediction of the vehicle trajectory.
[0134] Figure 5 is a schematic diagram of the structure of a trajectory prediction device provided by an embodiment of the present disclosure, and the device can be understood as the above-mentioned computer device or some functional modules in the above-mentioned computer device. Figure 5 As shown, the trajectory prediction device 500 may include:
[0135] The first acquisition module 510 is used to acquire N track points closest to the current moment in the historical track of the vehicle to be tested and the position data of each track point;
[0136] A first search module 520 is used to obtain a search range corresponding to each trajectory point by using a preset range and the position data of the trajectory point, and search for a lane line within the search range to obtain a target lane line corresponding to the trajectory point;
[0137] A first construction module 530 is used to encode, for each trajectory point, a lane line point set of a target lane line corresponding to the trajectory point and the position data of the trajectory point, and construct an embedded vector matrix corresponding to the trajectory point, wherein the lane line point set includes the position data of each lane point in the target lane line;
[0138] A second construction module 550 is used to determine, for each trajectory point, a lane segment in the target lane line that is closest to the trajectory point as a first lane segment, determine at least one lane segment adjacent to the first lane segment as a second lane segment, encode a point set of the first lane segment and a point set of the second lane segment in a lane line point set, and construct an adjacency matrix corresponding to the trajectory point;
[0139] The first prediction module 550 is used to perform trajectory prediction based on the embedding vector matrix and the adjacency matrix corresponding to the N trajectory points to obtain a predicted trajectory of the vehicle to be tested.
[0140] Optionally, the first building module 530 may include:
[0141] A first division submodule is used to divide the target lane line into a plurality of lane segments at a first preset distance starting from the starting point of the target lane line, and calculate a first centerline coordinate corresponding to the centerline of each lane segment;
[0142] A second division submodule is used to divide each lane segment into a plurality of sub-lane segments at a second preset distance starting from the starting point of each lane segment, and calculate a second centerline coordinate corresponding to the centerline of each sub-lane segment;
[0143] A determination submodule, for constructing a lane line point set of a target lane line based on each first center line coordinate and each second center line coordinate;
[0144] The construction submodule is used to encode the lane line point set of the target lane line corresponding to the trajectory point and the position data of the trajectory point for each trajectory point, and construct the embedding vector matrix corresponding to the trajectory point.
[0145] Optionally, the adjacent lane segment of the target lane segment includes at least one of a preceding lane segment, a succeeding lane segment, a left lane segment, and a right lane segment of the target lane segment.
[0146] Optionally, the prediction module 550 may include:
[0147] A first extraction submodule is used to input the embedding vector matrix corresponding to the N trajectory points into a VectorNet model in a preset trajectory prediction model, and extract trajectory features of the vehicle to be tested based on the VectorNet model;
[0148] The second extraction submodule is used to input the adjacency matrix corresponding to the N trajectory points into the MapNet model in the preset trajectory prediction model, and extract the map features corresponding to the N trajectory points based on the MapNet model;
[0149] The fusion submodule is used to fuse the trajectory features and map features based on the cross-attention mechanism to obtain the fused features;
[0150] The prediction submodule is used to predict the trajectory of the vehicle to be tested based on the fusion features to obtain the predicted trajectory of the vehicle to be tested.
[0151] Optionally, the acquisition module 510 may include:
[0152] The first acquisition submodule is used to acquire the original track points contained in the historical track of the vehicle to be tested;
[0153] An inserting submodule is used to insert virtual track points between original track points to obtain an updated historical track, wherein the distance between adjacent track points in the updated historical track is a preset fixed distance;
[0154] The second acquisition module is used to obtain the N track points closest to the current moment in the updated historical track and the position data of each track point.
[0155] Optionally, the first building module 530 may include:
[0156] A conversion submodule, used to convert a lane line point set of a target lane line corresponding to each trajectory point into a first embedding vector, and convert the position data of each trajectory point into a second embedding vector;
[0157] The adding submodule is used to add each first embedding vector to the matrix according to a first direction, and add each second embedding vector to the matrix according to a second direction to obtain an embedding vector matrix, wherein the second direction is opposite to the first direction.
[0158] The trajectory prediction device provided by the embodiment of the present disclosure can achieve the above Figure 1-Figure 3 The method of any embodiment has similar execution mode and beneficial effects, which will not be described in detail here.
[0159] Figure 6 is a schematic diagram of the structure of a training device for a trajectory prediction model provided by an embodiment of the present disclosure, and the device can be understood as the above-mentioned computer device or some functional modules in the above-mentioned computer device. Figure 6As shown, the training device 600 of the trajectory prediction model may include:
[0160] A second acquisition module 610 is used to acquire L consecutive trajectory points of the sample vehicle and position data of each trajectory point from historical data;
[0161] A determination module 620 is used to take the trajectory formed by M consecutive trajectory points after L trajectory points as the target trajectory according to the time sequence of the trajectory points;
[0162] A second search module 630 is used to obtain a search range corresponding to each of the L track points by using a preset range and the position data of the track point, and search for a lane line within the search range to obtain a target lane line corresponding to the track point;
[0163] A third construction module 640 is used to encode the lane line point set of the target lane line corresponding to the trajectory point and the position data of the trajectory point for each trajectory point in the L trajectory points, and construct an embedding vector matrix corresponding to the trajectory point;
[0164] A fourth construction module 650 is used to determine, for each of the L trajectory points, a lane segment in the target lane line that is closest to the trajectory point as a first lane segment, determine at least one lane segment adjacent to the first lane segment as a second lane segment, encode a point set of the first lane segment and a point set of the second lane segment in a lane line point set, and construct an adjacency matrix corresponding to the trajectory point;
[0165] A second prediction module 660, configured to input the embedding vector matrix and the adjacency matrix corresponding to the L trajectory points into a prediction model, and output a predicted trajectory of the sample vehicle based on the prediction model;
[0166] A calculation module 670, configured to calculate an iterative function based on the predicted trajectory and the target trajectory;
[0167] The training module 680 is used to adjust the parameters of the prediction model according to the iterative function, and iteratively train the prediction model until the iterative function value converges or reaches a set number of iterations to obtain a trained trajectory prediction model.
[0168] The training device of the trajectory prediction model provided in the embodiment of the present disclosure can achieve the above Figure 4 The method of any embodiment has similar execution mode and beneficial effects, which will not be described in detail here.
[0169] The embodiments of the present disclosure also provide a computer device, which includes a processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the method of any of the above embodiments can be implemented, and its execution method and beneficial effects are similar and will not be repeated here.
[0170] Figure 7 is a schematic diagram of the structure of a computer device provided by an embodiment of the present disclosure, such as Figure 7 As shown, the computer device 700 may include a processor 710 and a memory 720, wherein the memory 720 stores a computer program 721, and when the computer program 721 is executed by the processor 710, the method provided by any of the above embodiments can be implemented, and its execution method and beneficial effects are similar, which will not be repeated here.
[0171] Of course, to simplify, Figure 7 Only some of the components related to the present invention in the computer device 700 are shown, and components such as a bus, an input / output interface, an input device, and an output device are omitted. In addition, according to specific application conditions, the computer device 700 may also include any other appropriate components.
[0172] An embodiment of the present disclosure provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the method of any of the above embodiments can be implemented. The execution method and beneficial effects are similar and will not be repeated here.
[0173] The above-mentioned computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0174] The computer program may be written in any combination of one or more programming languages to write program codes for performing the operations of the disclosed embodiments, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer device, partially on the user's device, as a separate software package, partially on the user's computer device and partially on a remote computer device, or entirely on a remote computer device or server.
[0175] The embodiments of the present disclosure also provide a vehicle, which includes the above-mentioned trajectory prediction device or computer equipment or computer-readable storage medium, and can implement the method of any of the above-mentioned embodiments. The execution method and beneficial effects are similar and will not be repeated here.
[0176] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0177] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0178] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A trajectory prediction method, characterized in that: include: Obtain the N track points closest to the current moment in the historical track of the vehicle to be tested and the position data of each track point; For each of the track points, a search range corresponding to the track point is obtained using a preset range and the position data of the track point, and a lane line is searched within the search range to obtain a target lane line corresponding to the track point; For each of the trajectory points, encoding a lane line point set of the target lane line corresponding to the trajectory point and the position data of the trajectory point is performed to construct an embedded vector matrix corresponding to the trajectory point, wherein the lane line point set contains the position data of each lane point in the target lane line; For each of the trajectory points, a lane segment in the target lane line that is closest to the trajectory point is determined as a first lane segment, at least one lane segment adjacent to the first lane segment is determined as a second lane segment, and a point set of the first lane segment and a point set of the second lane segment in the lane line point set are encoded to construct an adjacency matrix corresponding to the trajectory point; Trajectory prediction is performed based on the embedded vector matrix and the adjacency matrix corresponding to the N trajectory points to obtain a predicted trajectory of the vehicle to be tested.
2. The method according to claim 1, characterized in that For each of the trajectory points, encoding the lane line point set of the target lane line corresponding to the trajectory point and the position data of the trajectory point is performed to construct an embedded vector matrix corresponding to the trajectory point, including: Starting from the starting point of the target lane line, the target lane line is divided into a plurality of lane segments at a first preset distance, and a first centerline coordinate corresponding to the centerline of each lane segment is calculated; Starting from the starting point of each lane segment, each lane segment is divided into a plurality of sub-lane segments at a second preset distance, and a second centerline coordinate corresponding to the centerline of each sub-lane segment is calculated; Constructing a lane line point set of the target lane line based on each of the first center line coordinates and each of the second center line coordinates; For each of the trajectory points, the lane line point set of the target lane line corresponding to the trajectory point and the position data of the trajectory point are encoded to construct an embedded vector matrix corresponding to the trajectory point.
3. The method according to claim 1, characterized in that The second lane segment includes at least one of a preceding lane segment, a succeeding lane segment, a left lane segment, and a right lane segment of the first lane segment.
4. The method according to claim 1, characterized in that The performing trajectory prediction based on the embedding vector matrix and the adjacency matrix corresponding to the N trajectory points to obtain the predicted trajectory of the vehicle to be tested includes: Inputting the embedding vector matrix corresponding to the N trajectory points into a VectorNet model in a preset trajectory prediction model, and extracting the trajectory features of the vehicle to be tested based on the VectorNet model; Inputting the adjacency matrix corresponding to the N trajectory points into a MapNet model in a preset trajectory prediction model, and extracting map features corresponding to the N trajectory points based on the MapNet model; The trajectory feature and the map feature are fused based on a cross attention mechanism to obtain a fused feature; The trajectory of the vehicle to be tested is predicted based on the fusion features to obtain a predicted trajectory of the vehicle to be tested.
5. The method according to claim 1, characterized in that The step of obtaining the N track points closest to the current moment in the historical track of the vehicle to be tested and the position data of each track point includes: Obtaining original track points contained in the historical track of the vehicle to be tested; Inserting virtual track points between the original track points to obtain an updated historical track, wherein the distance between adjacent track points in the updated historical track is a preset fixed distance; The N track points closest to the current time in the updated historical track and the position data of each track point are obtained.
6. The method according to claim 1, characterized in that For each of the trajectory points, encoding the lane line point set of the target lane line corresponding to the trajectory point and the position data of the trajectory point is performed to construct an embedded vector matrix corresponding to the trajectory point, including: Converting a lane line point set of the target lane line corresponding to each of the trajectory points into a first embedding vector, and converting the position data of each of the trajectory points into a second embedding vector; Each of the first embedding vectors is added to a matrix in a first direction, and each of the second embedding vectors is added to a matrix in a second direction to obtain the embedding vector matrix, where the second direction is opposite to the first direction.
7. A method for training a trajectory prediction model, characterized in that: include: Obtain L consecutive trajectory points of the sample vehicle and the position data of each trajectory point from the historical data; According to the time sequence of the trajectory points, the trajectory formed by the M consecutive trajectory points after the L trajectory points is used as the target trajectory; For each of the L trajectory points, a search range corresponding to the trajectory point is obtained using a preset range and the position data of the trajectory point, and a lane line is searched within the search range to obtain a target lane line corresponding to the trajectory point; For each of the L trajectory points, encoding the lane line point set of the target lane line corresponding to the trajectory point and the position data of the trajectory point is performed to construct an embedded vector matrix corresponding to the trajectory point; For each of the L trajectory points, a lane segment in the target lane line that is closest to the trajectory point is determined as a first lane segment, at least one lane segment adjacent to the first lane segment is determined as a second lane segment, a point set of the first lane segment and a point set of the second lane segment in the lane line point set are encoded, and an adjacency matrix corresponding to the trajectory point is constructed; Inputting the embedding vector matrix and the adjacency matrix corresponding to the L trajectory points into a prediction model, and outputting a predicted trajectory of the sample vehicle based on the prediction model; Calculating an iterative function based on the predicted trajectory and the target trajectory; The parameters of the prediction model are adjusted according to the iterative function, and the prediction model is iteratively trained until the iterative function value converges or reaches a set number of iterations to obtain a trained trajectory prediction model.
8. A trajectory prediction device, characterized in that: include: The first acquisition module is used to obtain the N track points closest to the current moment in the historical track of the vehicle to be tested and the position data of each track point; A first search module is used to obtain, for each of the track points, a search range corresponding to the track point using a preset range and the position data of the track point, and search for a lane line within the search range to obtain a target lane line corresponding to the track point; A first construction module is used to encode, for each of the trajectory points, a lane line point set of the target lane line corresponding to the trajectory point and the position data of the trajectory point, and construct an embedded vector matrix corresponding to the trajectory point, wherein the lane line point set contains the position data of each lane point in the target lane line; A second construction module is used to determine, for each of the trajectory points, a lane segment in the target lane line that is closest to the trajectory point as a first lane segment, determine at least one lane segment adjacent to the first lane segment as a second lane segment, encode the point set of the first lane segment and the point set of the second lane segment in the lane line point set, and construct an adjacency matrix corresponding to the trajectory point; The first prediction module is used to perform trajectory prediction based on the embedded vector matrix and the adjacency matrix corresponding to the N trajectory points to obtain a predicted trajectory of the vehicle to be tested.
9. A training device for a trajectory prediction model, characterized in that: include: The second acquisition module is used to obtain L consecutive trajectory points of the sample vehicle and the position data of each trajectory point from the historical data; A determination module, configured to take a trajectory formed by M consecutive trajectory points after the L trajectory points as a target trajectory according to the time sequence of the trajectory points; A second search module is used to obtain, for each of the L trajectory points, a search range corresponding to the trajectory point using a preset range and the position data of the trajectory point, and search for a lane line within the search range to obtain a target lane line corresponding to the trajectory point; A third construction module is used to encode the lane line point set of the target lane line corresponding to each of the L trajectory points and the position data of the trajectory point, and construct an embedded vector matrix corresponding to the trajectory point; a fourth construction module, configured to, for each of the L trajectory points, determine a lane segment in the target lane line that is closest to the trajectory point as a first lane segment, determine at least one lane segment adjacent to the first lane segment as a second lane segment, perform encoding processing on a point set of the first lane segment and a point set of the second lane segment in the lane line point set, and construct an adjacency matrix corresponding to the trajectory point; A second prediction module, configured to input the embedding vector matrix and the adjacency matrix corresponding to the L trajectory points into a prediction model, and output a predicted trajectory of the sample vehicle based on the prediction model; A calculation module, used for calculating an iterative function based on the predicted trajectory and the target trajectory; The training module is used to adjust the parameters of the prediction model according to the iterative function, and iteratively train the prediction model until the iterative function value converges or reaches a set number of iterations to obtain a trained trajectory prediction model.
10. A computer device, characterized in that: include: A memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the trajectory prediction method according to any one of claims 1 to 6 or the trajectory prediction model training method according to claim 7 is implemented.
11. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the processor, the trajectory prediction method according to any one of claims 1 to 6 or the trajectory prediction model training method according to claim 7 is implemented.
12. A vehicle, characterized in that: The vehicle includes the trajectory prediction device of claim 8 or the trajectory prediction model training device of claim 9 or the computer device of claim 10 or the computer-readable storage medium of claim 11.
