Trajectory generation method, device, electronic device, storage medium and program product

By selecting subsequent sections based on the intersection turning state in the reference map, the problem of randomly generated trajectory inaccurate is solved, and the accuracy of trajectory generation and the effect of fitting into the actual driving scene is achieved.

CN119443458BActive Publication Date: 2025-03-21SHENZHEN JIHENGXIN TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510019344.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-07
Publication Date
2025-03-21
Estimated Expiration
2045-01-07

AI Technical Summary

Technical Problem

The method of randomly generating trajectories in the prior art leads to inaccurate trajectories and fails to effectively fit the actual driving scenario of the user.

Method used

By determining the next section of the latest section from the successor section with topological relationship with the latest section in the reference map, the next section of the latest section is determined according to the turning state of the previous intersection in the obtained track, and the next section is added to the obtained track until the track meets the preset conditions.

Benefits of technology

The accuracy of trajectory generation is improved, so that the generated trajectory is more in line with the user's actual driving scenario, and meets preset conditions such as trajectory length, number of forked intersections and number of merged intersections.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119443458B_ABST
    Figure CN119443458B_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide a trajectory generation method, device, electronic device, storage medium and program product. The method includes: repeatedly executing the following steps until the obtained trajectory meets the first preset condition, and determining the obtained trajectory as the target trajectory: for the latest section in the obtained trajectory, if a subsequent section with a topological relationship with the latest section is determined from the reference map along the first direction, then according to the turning state of the previous intersection in the obtained trajectory, the next section of the latest section is determined from the subsequent section, and the next section is added to the obtained trajectory. The method can generate the trajectory taking into account the turning state of the trajectory at the intersection, so that the generated trajectory fits the user's actual driving scene more accurately.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of map technology and intelligent driving, and in particular to a trajectory generation method, device, electronic device, storage medium and program product. Background Art

[0002] With the rapid development of science and technology, the application of intelligent driving vehicles is becoming more and more widespread. In order to support the intelligent driving of vehicles, it is necessary to generate trajectories, which are used for the automatic driving of vehicles.

[0003] In some techniques, trajectories are randomly generated based on a certain start and end point.

[0004] However, the trajectory obtained by randomly generating trajectories is not accurate. Summary of the invention

[0005] The trajectory generation method, device, electronic device, storage medium and program product provided in the embodiments of the present application generate trajectories taking into account the turning state of the trajectory at the intersection, thereby improving the accuracy of the generated trajectory in fitting with the user's actual driving scenario.

[0006] In a first aspect, an embodiment of the present application provides a trajectory generation method, comprising:

[0007] Repeat the following steps until the obtained trajectory meets the first preset condition, and determine the obtained trajectory as the target trajectory:

[0008] For the latest section in the obtained trajectory, if a subsequent section having a topological relationship with the latest section is determined from the reference map along the first direction, then according to the turning state of the previous intersection in the obtained trajectory, the next section of the latest section is determined from the subsequent section, and the next section is added to the obtained trajectory.

[0009] In a possible implementation, according to the turning state of the previous intersection in the obtained trajectory, determining the next section of the latest section from the subsequent sections includes:

[0010] Determine a first heading angle between the latest section and the subsequent section;

[0011] According to the first heading angle and the turning state, a section is selected from a plurality of subsequent sections as the next section of the latest section.

[0012] In a possible implementation, according to the first heading angle and the turning state, a road segment is selected from a plurality of subsequent road segments, which is the next road segment of the latest road segment, including at least one of the following:

[0013] If it is determined that the turning state indicates that there is a turn at the previous intersection, then determining that the subsequent road segment corresponding to the first heading angle of the multiple subsequent road segments whose first heading angle is less than or equal to the first preset angle threshold is the next road segment of the latest road segment;

[0014] If it is determined that the turning state indicates that there is a turn at the previous intersection, and it is determined that there is no subsequent road section corresponding to the first heading angle whose first heading angle is less than or equal to the first preset angle threshold among the multiple subsequent road sections, a road section is randomly selected from the multiple subsequent road sections as the next road section of the latest road section;

[0015] If it is determined that the turning state indicates that there is no turn at the previous intersection, then a subsequent section corresponding to a first heading angle in a first preset angle range among multiple subsequent sections is determined to be the next section of the latest section; wherein the first preset angle range is greater than a first preset angle threshold and less than a second preset angle threshold; and the second preset angle threshold is greater than the first preset angle threshold;

[0016] If it is determined that the turning state indicates that there is no turn at the previous intersection, and it is determined that there is no subsequent section corresponding to the first heading angle whose first heading angle belongs to the first preset angle range among multiple subsequent sections, then a section is randomly selected from the multiple subsequent sections as the next section of the latest section.

[0017] In a possible implementation, the method further includes:

[0018] If it is determined that the second heading angle between the latest section and the section next to the latest section is less than or equal to the first preset angle threshold, then the number of straight lines corresponding to the obtained trajectory is accumulated by 1; if it is determined that the second heading angle between the latest section and the section next to the latest section belongs to the first preset angle range, then the number of turns corresponding to the obtained trajectory is accumulated by 1, and the connection point between the latest section and the section next to the latest section is determined to be a waypoint; wherein the first preset angle range is greater than the first preset angle threshold and less than the second preset angle threshold; the second preset angle threshold is greater than the first preset angle threshold; and / or

[0019] If it is determined that the third heading angle between the next section of the latest section and the starting section of the obtained trajectory does not belong to the second preset angle range, then determine the connection point between the latest section and the next section of the latest section as a waypoint; wherein the second preset angle range is greater than the third preset angle threshold and less than the fourth preset angle threshold; wherein the third preset angle threshold is the negative of the fourth preset angle threshold; and / or

[0020] If it is determined that the number of straight lines corresponding to the obtained trajectory is accumulated by 1, or the number of turns corresponding to the obtained trajectory is accumulated by 1, then it is determined that the number of fork intersections corresponding to the obtained trajectory is accumulated by 1.

[0021] In a possible implementation, determining a subsequent road segment having a topological relationship with the latest road segment from a reference map along a first direction includes:

[0022] A subsequent road segment having a topological relationship with the latest road segment is determined from a preset land area in a reference map along a first direction.

[0023] In a possible implementation, the method further includes:

[0024] If no subsequent road segment having a topological relationship with the latest road segment is determined from the reference map along the first direction, a predecessor fork intersection node of the latest road segment is determined from the obtained trajectory; wherein the predecessor fork intersection node includes multiple road segments, and multiple road segments in the predecessor fork intersection node have a topological relationship with a previous road segment of the latest road segment; determine the other road segments in the obtained predecessor fork intersection node except the latest road segment as the new latest road segment; and / or

[0025] If the predecessor fork intersection node of the latest segment is not determined from the obtained trajectory, the starting segment of the obtained trajectory is determined as the new latest segment; starting from the second direction, the steps of determining a subsequent segment having a topological relationship with the latest segment from the reference map for the latest segment in the obtained trajectory are started; wherein the second direction is the reverse of the first direction.

[0026] In one possible implementation, the first preset condition includes at least one of the following: the length of the obtained trajectory meets the preset length, the number of fork intersections in the obtained trajectory meets the preset number of fork intersections, the number of merge intersections in the obtained trajectory meets the preset number of merge intersections, and the next section of the latest section meets the preset requirements.

[0027] In a possible implementation manner, the preset length includes a first length and a second length, and the first length is smaller than the second length; the preset number of forked intersections includes a first number of forked intersections and a second number of forked intersections, and the first number of forked intersections is smaller than the second number of forked intersections;

[0028] The preset requirement represents that the next road segment of the latest road segment and the previous intersection corresponding to the next road segment in the reference map, and the first condition information between the two meet the second preset condition; wherein the first condition information includes the first road segment number and / or the first distance value;

[0029] The obtained trajectory meets the first preset condition, including at least one of the following:

[0030] The length of the obtained trajectory is greater than or equal to the second length, and the next section of the latest section is determined to meet the preset requirements;

[0031] The length of the obtained trajectory is greater than or equal to the first length and less than the second length, and the number of forked intersections in the obtained trajectory is greater than or equal to the second number of forked intersections, and the next segment of the latest segment meets the preset requirements;

[0032] The length of the obtained trajectory is greater than or equal to the first length and less than the second length, and the number of forked intersections in the obtained trajectory is greater than or equal to the first number of forked intersections and less than the second number of forked intersections, and the number of straight lines in the obtained trajectory is greater than a first preset number, and the number of turns in the obtained trajectory is greater than a second preset number, and the number of merged intersections in the obtained trajectory is greater than or equal to the preset number of merged intersections, and the next segment of the latest segment meets the preset requirements.

[0033] In a possible implementation, the method further includes:

[0034] Selecting an initial road section from the reference map, determining the initial road section, a next intersection corresponding to the initial road section in the reference map, and second condition information between the two; wherein the second condition information includes the number of second road sections and / or a second distance value;

[0035] If it is determined that the second condition information meets the third preset condition, the initial section is determined to be the starting section of the trajectory.

[0036] In a second aspect, an embodiment of the present application provides a trajectory generation device, comprising:

[0037] The execution module is used to repeatedly execute the following steps until the obtained trajectory meets the first preset condition, and determine the obtained trajectory as the target trajectory:

[0038] For the latest section in the obtained trajectory, if a subsequent section having a topological relationship with the latest section is determined from the reference map along the first direction, then according to the turning state of the previous intersection in the obtained trajectory, the next section of the latest section is determined from the subsequent section, and the next section is added to the obtained trajectory.

[0039] In a possible implementation, according to the turning state of the previous intersection in the obtained trajectory, the next section of the latest section is determined from the subsequent sections, and the execution module is used to:

[0040] Determine a first heading angle between the latest section and the subsequent section;

[0041] According to the first heading angle and the turning state, a section is selected from a plurality of subsequent sections as the next section of the latest section.

[0042] In a possible implementation, according to the first heading angle and the turning state, a road section is selected from a plurality of subsequent road sections as the next road section of the latest road section, and the execution module is used to execute at least one of the following:

[0043] If it is determined that the turning state indicates that there is a turn at the previous intersection, then determining that the subsequent road segment corresponding to the first heading angle of the multiple subsequent road segments whose first heading angle is less than or equal to the first preset angle threshold is the next road segment of the latest road segment;

[0044] If it is determined that the turning state indicates that there is a turn at the previous intersection, and it is determined that there is no subsequent road section corresponding to the first heading angle whose first heading angle is less than or equal to the first preset angle threshold among the multiple subsequent road sections, a road section is randomly selected from the multiple subsequent road sections as the next road section of the latest road section;

[0045] If it is determined that the turning state indicates that there is no turn at the previous intersection, then a subsequent section corresponding to a first heading angle in a first preset angle range among multiple subsequent sections is determined to be the next section of the latest section; wherein the first preset angle range is greater than a first preset angle threshold and less than a second preset angle threshold; and the second preset angle threshold is greater than the first preset angle threshold;

[0046] If it is determined that the turning state indicates that there is no turn at the previous intersection, and it is determined that there is no subsequent section corresponding to the first heading angle whose first heading angle belongs to the first preset angle range among multiple subsequent sections, then a section is randomly selected from the multiple subsequent sections as the next section of the latest section.

[0047] In a possible implementation, the execution module is further configured to:

[0048] If it is determined that the second heading angle between the latest section and the section next to the latest section is less than or equal to the first preset angle threshold, then the number of straight lines corresponding to the obtained trajectory is accumulated by 1; if it is determined that the second heading angle between the latest section and the section next to the latest section belongs to the first preset angle range, then the number of turns corresponding to the obtained trajectory is accumulated by 1, and the connection point between the latest section and the section next to the latest section is determined to be a waypoint; wherein the first preset angle range is greater than the first preset angle threshold and less than the second preset angle threshold; the second preset angle threshold is greater than the first preset angle threshold; and / or

[0049] If it is determined that the third heading angle between the next section of the latest section and the starting section of the obtained trajectory does not belong to the second preset angle range, then determine the connection point between the latest section and the next section of the latest section as a waypoint; wherein the second preset angle range is greater than the third preset angle threshold and less than the fourth preset angle threshold; wherein the third preset angle threshold is the negative of the fourth preset angle threshold; and / or

[0050] If it is determined that the number of straight lines corresponding to the obtained trajectory is accumulated by 1, or the number of turns corresponding to the obtained trajectory is accumulated by 1, then it is determined that the number of fork intersections corresponding to the obtained trajectory is accumulated by 1.

[0051] In a possible implementation, a subsequent road segment having a topological relationship with the latest road segment is determined from a reference map along a first direction, and the execution module is used to:

[0052] A subsequent road segment having a topological relationship with the latest road segment is determined from a preset land area in a reference map along a first direction.

[0053] In a possible implementation, the execution module is further configured to:

[0054] If no subsequent road segment having a topological relationship with the latest road segment is determined from the reference map along the first direction, a predecessor fork intersection node of the latest road segment is determined from the obtained trajectory; wherein the predecessor fork intersection node includes multiple road segments, and multiple road segments in the predecessor fork intersection node have a topological relationship with a previous road segment of the latest road segment; determine the other road segments in the obtained predecessor fork intersection node except the latest road segment as the new latest road segment; and / or

[0055] If the predecessor fork intersection node of the latest segment is not determined from the obtained trajectory, the starting segment of the obtained trajectory is determined as the new latest segment; starting from the second direction, the steps of determining a subsequent segment having a topological relationship with the latest segment from the reference map for the latest segment in the obtained trajectory are started; wherein the second direction is the reverse of the first direction.

[0056] In one possible implementation, the first preset condition includes at least one of the following: the length of the obtained trajectory meets the preset length, the number of fork intersections in the obtained trajectory meets the preset number of fork intersections, the number of merge intersections in the obtained trajectory meets the preset number of merge intersections, and the next section of the latest section meets the preset requirements.

[0057] In a possible implementation manner, the preset length includes a first length and a second length, and the first length is smaller than the second length; the preset number of forked intersections includes a first number of forked intersections and a second number of forked intersections, and the first number of forked intersections is smaller than the second number of forked intersections;

[0058] The preset requirement represents that the next road segment of the latest road segment and the previous intersection corresponding to the next road segment in the reference map, and the first condition information between the two meet the second preset condition; wherein the first condition information includes the first road segment number and / or the first distance value;

[0059] The obtained trajectory meets the first preset condition, including at least one of the following:

[0060] The length of the obtained trajectory is greater than or equal to the second length, and the next section of the latest section is determined to meet the preset requirements;

[0061] The length of the obtained trajectory is greater than or equal to the first length and less than the second length, and the number of forked intersections in the obtained trajectory is greater than or equal to the second number of forked intersections, and the next segment of the latest segment meets the preset requirements;

[0062] The length of the obtained trajectory is greater than or equal to the first length and less than the second length, and the number of forked intersections in the obtained trajectory is greater than or equal to the first number of forked intersections and less than the second number of forked intersections, and the number of straight lines in the obtained trajectory is greater than a first preset number, and the number of turns in the obtained trajectory is greater than a second preset number, and the number of merged intersections in the obtained trajectory is greater than or equal to the preset number of merged intersections, and the next segment of the latest segment meets the preset requirements.

[0063] In a possible implementation, the execution module is further configured to:

[0064] Selecting an initial road section from the reference map, determining the initial road section, a next intersection corresponding to the initial road section in the reference map, and second condition information between the two; wherein the second condition information includes the number of second road sections and / or a second distance value;

[0065] If it is determined that the second condition information meets the third preset condition, the initial section is determined to be the starting section of the trajectory.

[0066] In a third aspect, an embodiment of the present application provides an electronic device, including: a memory, a processor;

[0067] Memory stores computer-executable instructions;

[0068] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the above first aspect and / or various possible implementations of the first aspect.

[0069] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the first aspect above and / or various possible implementations of the first aspect.

[0070] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the above first aspect and / or various possible implementation methods of the first aspect.

[0071] The trajectory generation method, device, electronic device, storage medium and program product provided by the embodiments of the present application determine the next section of the latest section from the subsequent sections having a topological relationship with the latest section in the reference map according to the turning state of the previous intersection in the obtained trajectory, and add the next section to the obtained trajectory; when the obtained trajectory meets the first preset condition, it is determined that a complete trajectory is obtained, and during the trajectory generation process, the turning execution state when the trajectory passes through the intersection can be taken into account, which can improve the accuracy of trajectory generation. BRIEF DESCRIPTION OF THE DRAWINGS

[0072] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0073] Figure 1 Schematic diagram of the trajectory generation method provided in this application Figure 1 ;

[0074] Figure 2 is a topological relationship diagram of an exemplary latest road segment;

[0075] Figure 3 Schematic diagram of the trajectory generation method provided in this application Figure 2 ;

[0076] Figure 4 is a schematic diagram of an exemplary heading angle;

[0077] Figure 5 A schematic diagram of an exemplary intersection with a turn;

[0078] Figure 6 A schematic diagram of an exemplary preset land area;

[0079] Figure 7 This is a schematic diagram of the data link within the scope of the exemplary preset plot;

[0080] Figure 8 Schematic diagram of the trajectory generation method provided in this application Figure 3 ;

[0081] Fig. 9 Schematic diagram for example trajectory generation Figure 1 ;

[0082] Fig.10 Schematic diagram of the trajectory generation method provided in this application Figure 4 ;

[0083] Fig.11 Schematic diagram for example trajectory generation Figure 2 ;

[0084] Fig.12 A schematic diagram for exemplifying the judgment of turning and going straight;

[0085] Fig.13 is a schematic diagram of an exemplary merging intersection;

[0086] Fig.14 A schematic diagram of a process for exemplarily determining a target trajectory;

[0087] Fig.15 is a schematic diagram of exemplary waypoints;

[0088] Fig.16 A schematic diagram of the structure of the trajectory generating device provided in this application;

[0089] Fig.17 A schematic diagram of the structure of the electronic device provided in this application.

[0090] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0091] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0092] First, the terms involved in this application are explained:

[0093] First direction: refers to the direction of exploring the subsequent road segment of the latest road segment during the initial generation of the trajectory in the reference map. The first direction is the same direction as the direction indicated by the road segment vector data in the reference map, which can also be understood as the forward direction. Correspondingly, the second direction is the reverse direction of the first direction.

[0094] Topological relationship: refers to the predecessor and successor relationship between road segments in the reference map. For any road segment in the reference map, the next road segment connected to the road segment along the direction indicated by the road segment vector data is called the successor road segment of the road segment; correspondingly, the previous road segment connected to the road segment is called the predecessor road segment of the road segment. The directed connection relationship between the road segment and the corresponding successor road segment and the corresponding predecessor road segment is called the topological relationship of the road segment.

[0095] Heading angle: The heading angle in the embodiment of the present application may refer to the angle between the extension line of the current section and the successor section of the current section, that is, the angle at which the extension line of the current section is deflected to the overlapping position of the successor section; the successor section is the next section connected to the current section, and the extension line of the current section refers to a line extending along the direction of the current section with the connection point between the current section and the successor section as the starting point; taking a high-precision map as an example, the heading angle may be the angle between the vector data of two sections in the high-precision map.

[0096] Fork in the road: In the reference map, if the current road segment has at least one subsequent road segment, the connection point between the current road segment and at least one subsequent road segment is called a fork in the road.

[0097] Merge intersection: In the reference map, if the current road section has at least one predecessor road section, the connection point between the current road section and at least one predecessor road section is called a merge intersection.

[0098] Road segment: refers to the data used to indicate the direction, connection relationship and / or other attribute information of the road in the reference map. For standard maps, road segments are usually represented by lines to indicate the direction and connection relationship of the road; for high-precision maps, due to the improved data accuracy in high-precision maps, a road can be divided into multiple segments, and each segment can be considered as a link in the road. In addition, the road segments in high-precision maps can also include other attribute information, such as speed limit information, lane information, connection information, etc.

[0099] With the rapid development of science and technology, the application of intelligent driving vehicles is becoming more and more widespread. Intelligent driving vehicles can realize automatic driving of vehicles based on the generated trajectory.

[0100] In the field of intelligent driving, it is necessary to rely on the data in the reference map for data processing, or rely on the road sections in the reference map for trajectory generation and other operations. Furthermore, the reference map may include but is not limited to: any one or a combination of standard maps (Standard Definition Map, referred to as SD map) and high-precision maps (High Definition Map, referred to as HD map). Compared with SD maps, HD maps have higher data accuracy, usually including lane-level road geometry information, traffic signs, traffic rules, etc. Furthermore, the reference map may also include: lightweight maps with data accuracy between SD maps and HD maps.

[0101] In some embodiments, the track is generated in the reference map by randomly generating a track between the start point and the end point based on the determined start point and the end point. For example, based on the determined start point and the end point, a track is randomly generated in the reference map that connects the start point and the end point.

[0102] In the above embodiment, the trajectory randomly generated between the starting point and the end point does not take into account the actual driving scenario of the user, such as the turning state of the intersection. Therefore, the trajectory obtained by randomly generating the trajectory has low accuracy.

[0103] The trajectory generation method provided by the present application determines the next section of the latest section from the subsequent sections that have a topological relationship with the latest section in the reference map according to the turning state of the previous intersection in the obtained trajectory, and adds the next section to the obtained trajectory; when it is determined that the obtained trajectory meets the first preset condition, it is determined that a complete trajectory is obtained, and the user's actual driving scenario can be taken into account during the trajectory generation process. That is, based on the turning state of the previous intersection, it is determined whether the intersection between the latest section and the next section of the latest section is a turn or a straight line. The generated trajectory is made to fit the user's actual driving scenario more closely, and the accuracy of the generated trajectory is improved.

[0104] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0105] Figure 1 Schematic diagram of the trajectory generation method provided in this application Figure 1 ,like Figure 1 As shown, the method includes:

[0106] Repeat the following steps until the obtained trajectory meets the first preset condition, and determine the obtained trajectory as the target trajectory:

[0107] Step 101. For the latest section in the obtained trajectory, if a subsequent section having a topological relationship with the latest section is determined from the reference map along the first direction, then the next section of the latest section is determined from the subsequent section according to the turning state of the previous intersection in the obtained trajectory.

[0108] The reference map may include but is not limited to: any one or any combination of an HD map, an SD map, and a lightweight map with data accuracy between the HD map and the SD map.

[0109] Exemplarily, in the reference map, the obtained trajectory includes multiple road segments, and the multiple road segments have a topological relationship. The topological relationship between the multiple road segments is preset in the reference map. Among them, the topological relationship of the latest road segment can indicate the successor road segment and the predecessor road segment that have a topological relationship with the latest road segment. In the reference map, a road segment usually has two endpoints and a directed line segment connecting the two endpoints to form a road segment. The endpoint of the emitted directed line segment can be called the head end, and the endpoint pointed to by the directed line segment can be called the tail end.

[0110] Figure 2 is a topological relationship diagram of an exemplary latest road segment. The subsequent road segment having a topological relationship with the latest road segment refers to a road segment in which the head end of a directed line segment in the road segment is connected or overlapped with the tail end of a directed line segment in the latest road segment, such as Figure 2 As shown in [a], the tail end of the directed line segment in the latest segment overlaps with the head end of the directed line segment in the successor segment of the latest segment. Correspondingly, the predecessor segment having a topological relationship with the latest segment refers to the segment where the tail end of the directed line segment in the segment is connected to the head end of the directed line segment in the latest segment, as shown in Figure 2 As shown in [b], the means of the directed line segments in the latest segment overlap with the tail ends of the directed line segments in the predecessor segment of the latest segment.

[0111] By acquiring reference map data and integrating the topological relationship of the reference map data, the attribute information of each road section in the acquired reference map data and the topological relationship between the road sections can be obtained.

[0112] Optionally, the attribute information of each road section and the topological relationship between each road section can be stored in a bidirectional linked list. Exemplarily, the bidirectional linked list may include an attribute information variable, denoted as Road; a topological relationship variable, denoted as Road_link. Each road section has a corresponding attribute information variable, and the topological relationship variable is used to record whether there is a topological relationship between the road sections. For example, if there is a topological relationship between the road section H1 and the subsequent road section H2, the topological relationship variable of the road section H1 includes the topological relationship information "from H1 to H2".

[0113] Taking the execution of the steps of generating a trajectory as an example for specific explanation, for the latest segment in the trajectory, the successor segment of the latest segment is determined along the first direction. According to the definition of the first direction, along the direction of the segment vector data of the latest segment in the reference map, it is determined whether there is a successor segment having a topological relationship with the latest segment.

[0114] It should be noted that the number of subsequent road segments having a topological relationship with the latest road segment may be one or more, wherein "multiple" may mean at least one.

[0115] In one example, when the number of successor road segments having a topological relationship with the latest road segment is one, the topological relationship variable corresponding to the latest road segment includes only one piece of topological relationship information. For example, road segment H1 has only one successor road segment H2 having a topological relationship, and the topological relationship variable of road segment H1 is "from H1 to H2".

[0116] In another example, when there are multiple successor sections that have a topological relationship with the latest section, the topological relationship variable corresponding to the latest section includes multiple topological relationship information. For example, section H1 has successor sections H2, H3, and H4 that have a topological relationship, and the topological relationship variable of section H1 is "from H1 to H2; from H1 to H3; from H1 to H4".

[0117] When there are multiple successor sections having a topological relationship with the latest section, specifically, it is necessary to select one section from the multiple successor sections as the next section of the latest section according to the turning state of the previous intersection in the currently obtained trajectory.

[0118] The turning state is used to characterize whether there is a turn at the intersection, that is, the turning state includes characterizing the presence of a turn at the intersection and characterizing the absence of a turn at the intersection. For example, if the turning state of the previous intersection characterizes the presence of a turn at the previous intersection, then the subsequent section of the latest section can be selected to form a subsequent section with a turn at the intersection corresponding to the latest section.

[0119] Step 102: Add the next segment to the obtained trajectory.

[0120] Exemplarily, if it is determined that there are one or more successor sections that have a topological relationship with the latest section, then based on the turning state of the previous intersection of the latest section in the obtained trajectory, a section is determined from one or more successor sections as the next section of the latest section, and the determined next section is added to the obtained trajectory to obtain a new trajectory.

[0121] At this point, the execution of the step of generating a trajectory is completed. When executing the step of generating the next trajectory, the next section of the latest section determined during the current trajectory generation is used as the latest section in the step of generating the next trajectory.

[0122] The steps of generating the trajectory are repeated multiple times until the obtained trajectory meets the first preset condition.

[0123] Exemplarily, after each step of trajectory generation is completed, the trajectory obtained after the step of trajectory generation is executed is judged, and if it is determined that the obtained trajectory meets the first preset condition, the trajectory obtained after the step of trajectory generation is executed is determined to be the target trajectory. Obtaining the target trajectory can be understood as completing the trajectory generation.

[0124] The first preset condition may include, but is not limited to, any one or any combination of: whether the length of the obtained trajectory meets the requirements, whether the characteristics of the obtained trajectory meet the requirements, whether the obtained trajectory meets the actual driving needs of the user, etc. The first preset condition shown in this embodiment may include one or more, and the conditions shown are not used as limitations on the first preset condition, and the first preset condition can be adjusted according to actual conditions.

[0125] It should be noted that Figure 1 The repeatedly executed steps are described only as an exemplary description. In a specific implementation, step 101 and step 102 may be executed sequentially or simultaneously.

[0126] The trajectory generation method provided by the embodiment of the present application repeatedly executes the trajectory generation step multiple times. Each time the trajectory generation step is executed, the latest section in the obtained trajectory is explored along the first direction with the latest section. If the latest section has a successor section, the next section of the latest section is selected from the successor sections based on the turning state of the previous intersection of the obtained trajectory, and the selected next section is added to the obtained trajectory. In the process of trajectory generation, the turning state of the intersection scene is taken into consideration, and the subsequent trajectory is generated based on the turning state of the previous intersection, so that the constructed trajectory can be more in line with the user's actual driving scene and the accuracy of trajectory generation can be improved.

[0127] Based on the foregoing embodiments, it can be known that in each step of executing trajectory generation, it is necessary to select the successor section of the latest section according to the turning state of the previous intersection. This embodiment specifically explains how to determine the turning state of the previous intersection and how to select the successor section of the latest section according to the turning state.

[0128] Figure 3 Schematic diagram of the trajectory generation method provided in this application Figure 2 ,like Figure 3 As shown, the method includes:

[0129] Step 301: Determine a first heading angle between a latest segment and a subsequent segment.

[0130] For example, Figure 4 is a schematic diagram of an exemplary heading angle, combined with Figure 4 The calculation of the heading angle is explained. Figure 4 As shown, the first heading angle refers to the angle between the extension line of the latest section and the subsequent section of the latest section. It can be understood that the angle when the extension line of the latest section is deflected to the overlapping position of the subsequent section is the first heading angle. According to the description in the above embodiment, if a subsequent section having a topological relationship with the latest section is determined, the first heading angle between the latest section and the subsequent section can be calculated based on the latest section and the subsequent section.

[0131] Step 302: According to the first heading angle and the turning state, a section is selected from a plurality of subsequent sections as the next section of the latest section.

[0132] Exemplarily, according to the turning state of the previous intersection in the obtained trajectory, a corresponding subsequent road segment whose first heading angle meets the heading angle requirement among multiple subsequent road segments is determined as the next road segment of the latest road segment.

[0133] It should be noted that, if it is determined that the number of subsequent road segments having a topological relationship with the latest road segment is one, the subsequent road segment can be directly selected as the next road segment of the latest road segment.

[0134] Furthermore, if it is determined that there are multiple successor sections having a topological relationship with the latest section, the first heading angle corresponding to each successor section can be calculated according to step 301. A successor section corresponding to the first heading angle that meets the requirements can be selected from multiple successor sections according to the turning state of the previous intersection in the obtained trajectory.

[0135] As an embodiment, the turning state of the intersection in the embodiment of the present application is used to characterize whether there is a turn at the intersection, then the turning state of the previous intersection in the obtained trajectory may include: a first state characterizing that there is a turn at the previous intersection, and a second state characterizing that there is no turn at the previous intersection; wherein "there is a turn at the intersection" means that the heading angle between two adjacent sections forming the trajectory at the intersection is within a preset angle range. Specifically, the preset angle range includes a heading angle deflected to the left within a preset first angle range and / or a heading angle deflected to the right within a preset second angle range. Exemplarily, the preset first angle range and the second angle range can be obtained by the upper limit of the preset angle range and the lower limit of the preset angle range, and the first angle range and the second angle range can be the same or different, and the specific value of the preset angle range is not limited. For example, when the upper limit of the preset angle range can be set to 135 degrees and the lower limit of the preset angle range is set to 10 degrees, the first angle range and the second angle range can be "greater than 10 degrees and less than or equal to 35 degrees, greater than 10 degrees and less than or equal to 40 degrees", "greater than 30 degrees and less than or equal to 60 degrees, greater than 30 degrees and less than or equal to 60 degrees" or "greater than 20 degrees and less than or equal to 120 degrees, greater than 10 degrees and less than or equal to 40 degrees", etc. Those skilled in the art can set the first angle range and the second angle range according to actual needs.

[0136] If it is determined that the heading angle of two adjacent road sections is greater than or equal to the lower limit of the preset angle range, and the heading angle is less than or equal to the upper limit of the preset angle range, then it is determined that the heading angle between the two adjacent road sections forming the trajectory of the intersection is within the preset angle range, and then the turning state of the intersection is determined to be characterized as the existence of a turn at the intersection. Figure 5 is a schematic diagram of an exemplary intersection with a turn, such as Figure 5 As shown in [a] of FIG. 1 , if the heading angle of the two adjacent sections of the track formed at the intersection is within the preset angle range, then it is determined that Figure 5 The turning state of the intersection [a] as an example represents that there is a turn at the intersection; Figure 5 As shown in [b] of FIG. 1 , if the heading angles of the two adjacent sections of the track formed at the intersection that deviate to the left are within the preset angle range, then it is determined Figure 5 The turning state of the intersection shown in [b] as an example represents that there is a turn at the intersection.

[0137] In one example, when the turning state is the first state indicating that a turn exists at the previous intersection, when selecting a subsequent road section, a subsequent road section that goes straight should be selected.

[0138] Exemplarily, if it is determined that the turning state represents a first state in which a turn exists at the previous intersection, then the subsequent section corresponding to the first heading angle in multiple subsequent sections whose first heading angle is less than or equal to the first preset angle threshold is determined to be the next section of the latest section.

[0139] The first preset angle threshold may be set to 45 degrees. It is understood that if the first heading angle is less than or equal to 45 degrees, it is considered that the subsequent road section corresponding to the first heading angle and the latest road section are straight.

[0140] Optionally, the first preset angle threshold may also be set to other values, such as 10 degrees, 15 degrees, 30 degrees, etc. When the first heading angle is less than or equal to the first preset angle threshold, the subsequent road corresponding to the first heading angle is regarded as a straight line. Therefore, the value of the first preset angle threshold should not be too large.

[0141] It should be noted that the first heading angle may be deflected to the left or to the right. However, no matter it is deflected to the left or to the right, as long as the value of the first heading angle is less than or equal to the first preset angle threshold, the subsequent road section corresponding to the first heading angle and the latest road section are straight.

[0142] For example, if the turning state of the previous intersection in the obtained trajectory is determined, indicating that there is a turn at the previous intersection, then there should be no turn between the latest section and the subsequent section, that is, go straight.

[0143] A subsequent section whose first heading angle satisfies the straight travel is selected from a plurality of subsequent sections as the next section of the latest section.

[0144] Optionally, if there are multiple subsequent road segments that satisfy the straight-ahead travel requirement, a subsequent road segment is randomly selected from the subsequent road segments that satisfy the straight-ahead travel requirement as the next road segment of the latest road segment.

[0145] In one possible case, there is no subsequent road segment among the multiple subsequent road segments whose first heading angle satisfies straight travel.

[0146] Therefore, exemplarily, if it is determined that the turning state is the first state characterizing the presence of a turn at the previous intersection, and it is determined that there is no subsequent section corresponding to the first heading angle less than or equal to the first preset angle threshold among multiple subsequent sections, then a section is randomly selected from the multiple subsequent sections as the next section of the latest section.

[0147] For example, if the turning state of the previous intersection in the obtained trajectory is determined, indicating that there is a turn at the previous intersection, then there should be no turn between the latest section and the subsequent section, that is, straight ahead. However, after step 201, among the multiple subsequent sections calculated, no subsequent section has a heading angle less than or equal to 45 degrees, that is, no subsequent section is straight ahead, then a section is randomly selected from the multiple subsequent sections as the next section of the latest section.

[0148] In the above example, when it is determined that the turning state of the previous intersection in the obtained trajectory is the first state indicating that there is a turn at the previous intersection, if it is determined that there is a subsequent section that satisfies the straight-ahead driving, the subsequent section that satisfies the straight-ahead driving is selected as the next section of the latest road. A trajectory with multiple consecutive turns can be generated in a manner that avoids completely random generation of trajectories. According to the trajectory generation method provided in this embodiment, the obtained trajectory is more in line with the actual driving scenario of the user, and the accuracy of the generated trajectory is improved.

[0149] In another example, in the second state where the turning state represents that there is no turn at the previous intersection, when selecting a subsequent section, the subsequent section of the turn should be selected.

[0150] Exemplarily, if the turning state is determined to be the second state characterizing that there is no turn at the previous intersection, then the subsequent section corresponding to the first heading angle in a plurality of subsequent sections whose first heading angle belongs to the first preset angle range is determined to be the next section of the latest section; wherein the first preset angle range is greater than the first preset angle threshold and less than the second preset angle threshold; the second preset angle threshold is greater than the first preset angle threshold.

[0151] Among them, those skilled in the art can set the first preset angle range and the second preset angle range according to actual needs. For example, the first preset angle threshold can be set to 45 degrees, and the second preset angle threshold can be set to 135 degrees. It can be understood that the first preset angle range is greater than 45 degrees and less than 135 degrees. In combination with actual examples, if the first heading angle is greater than 45 degrees and less than 135 degrees, that is, the first heading angle belongs to the first preset angle range, it is deemed that the subsequent section corresponding to the first heading angle and the latest section are turning.

[0152] Optionally, the first preset angle threshold and the second preset angle threshold may also be set to other values, such as setting the second preset angle threshold to 100 degrees, 115 degrees, 125 degrees or 145 degrees, etc. When the first heading angle is greater than the first preset angle threshold and less than the second angle threshold, the subsequent road corresponding to the first heading angle is regarded as a turn.

[0153] It should be noted that the first heading angle may be a leftward or rightward deflection. However, no matter whether it is a leftward or rightward deflection, as long as the value of the first heading angle belongs to the first preset angle range, the subsequent section corresponding to the first heading angle and the latest section are turns.

[0154] Furthermore, if the first heading angle is deflected to the left and the value of the first heading angle belongs to the first preset angle range, then the subsequent section corresponding to the first heading angle and the latest section are turned left; if the first heading angle is deflected to the right and the value of the first heading angle belongs to the first preset angle range, then the subsequent section corresponding to the first heading angle and the latest section are turned right.

[0155] For example, if it is determined that the turning state of the previous intersection in the obtained trajectory is the second state indicating that there is no turn at the previous intersection, it is determined that there is a turn between the latest section and the subsequent section.

[0156] A subsequent section whose first heading angle satisfies the turn is selected from a plurality of subsequent sections as the next section of the latest section.

[0157] Optionally, if there are multiple successor road segments that satisfy the turning requirement, one successor road segment is randomly selected from the successor road segments that satisfy the turning requirement as the next road segment of the latest road segment.

[0158] In one possible situation, there is no subsequent road segment in which the first heading angle satisfies the turn among the multiple subsequent road segments.

[0159] Therefore, exemplarily, if it is determined that the turning state is the second state characterizing that there is no turn at the previous intersection, and it is determined that there is no successor section corresponding to the first heading angle whose first heading angle belongs to the first preset angle range among multiple successor sections, then a section is randomly selected from the multiple successor sections as the next section of the latest section.

[0160] For example, if it is determined that the turning state of the previous intersection in the obtained trajectory is the second state indicating that the previous intersection does not have a turn (such as including but not limited to the situation that the previous intersection is a straight line), then the latest section and the subsequent section should be a turn. However, after step 201, among the multiple subsequent sections calculated, no heading angle corresponding to any subsequent section belongs to the first preset angle range, that is, no subsequent section is a turn, then a section is randomly selected from the multiple subsequent sections as the next section of the latest section.

[0161] In the above example, when the turning state of the previous intersection in the obtained trajectory is determined, in the second state indicating that there is no turning at the previous intersection, the subsequent section of the turning should be selected from the subsequent sections as the next section of the latest section. If it is determined that there is a subsequent section that satisfies the turning, the subsequent section that satisfies the turning is selected as the next section of the latest road. In a way that can avoid completely random generation of trajectories, a trajectory of continuous straight lines is generated. The accuracy of the generated trajectory is further improved.

[0162] Combined with the above two examples, the trajectory generation method provided in this embodiment can, to a certain extent, ensure that in the obtained trajectory, straight driving and turning appear alternately between intersections. The generated trajectory more accurately fits the user's actual driving scene and has a certain regularity.

[0163] When repeatedly executing the trajectory generation step, each time it is necessary to obtain the subsequent road segment having a topological relationship with the latest road segment from the reference map, considering that the reference map obtained has a large range, the reference map can be divided into blocks before repeatedly executing the trajectory generation step. This embodiment explains how to divide the reference map into blocks and how to construct a trajectory within the block range.

[0164] In one example, a subsequent road segment having a topological relationship with the latest road segment is determined from a preset land area in a reference map along a first direction.

[0165] Exemplarily, before starting to construct the trajectory, the data file of the reference map is first obtained, and the obtained reference map data file is processed into map blocks by a block algorithm. The block algorithm includes but is not limited to: Google S2 algorithm. Google S2 algorithm refers to a spatial index algorithm for dividing the earth's surface into multiple small blocks (or units).

[0166] By using the block algorithm, the reference map data obtained can be processed into blocks to obtain multiple preset land area ranges. Each time the trajectory generation step is repeated, it is performed in a preset land area range.

[0167] Figure 6 is a schematic diagram of an exemplary preset plot range, such as Figure 6 As shown, within the preset plot range, there are 4 map tiles, namely Figure 6 In the example shown in FIG. 1 , tile 1, tile 2, tile 3, and tile 4 are shown in FIG. In practical applications, these four map tiles are the actual trajectory generation area. It can be understood that when trajectories are generated within the current preset land area, a road segment is selected from tile 1 to tile 4 as the latest road segment, and based on the method provided in the above embodiment, the next road segment of the latest road segment is explored.

[0168] Optionally, the side length of each map tile can be set to 16 km, that is, the side length of the trajectory generation area is 32 km.

[0169] Furthermore, a buffer block is set around the trajectory generation area, that is, Figure 6 The buffer block buffs are shown in . These buffer block buffs are used in the process of repeatedly executing the trajectory generation steps. If the latest road segment is already at the edge of the map tile, and the subsequent road segment with a topological relationship with the latest road segment is located in the buffer block buff, the subsequent road segment with a topological relationship with the latest road segment can be continued in the buff as the next road segment of the latest road segment and added to the obtained trajectory.

[0170] Optionally, the side length of each buffer block buff can be set to 8km.

[0171] According to the above four map tiles and the multiple buffer tiles surrounding the four map tiles, a preset land area is obtained. It can be understood that multiple preset land area can be obtained in the reference map data obtained.

[0172] After obtaining multiple preset land parcel ranges, it is also necessary to pre-process and extract the reference map data within each preset land parcel range, extract the attribute information of the road sections within each preset land parcel range, and the topological relationship between the road sections.

[0173] Among them, the topological relationship between the road segments can indicate the predecessor and successor relationship between the road segments. Combined with the description in the above example, if the tail end of the directed line segment in the first road segment is connected to the head end of the directed line segment in the second road segment, the second road segment is determined to be the successor of the first road segment; if the head end of the directed line segment in the first road segment is connected to the tail end of the directed line segment in the third road segment, the third road segment is determined to be the predecessor of the first road segment.

[0174] For example, the attribute information of a road segment may include but is not limited to: road form rd_form, road class rd_class, travel direction direction, travel status rdStatus, etc. Based on the above embodiments, the attribute information of each road segment and the topological relationship between each road segment may be stored in a bidirectional linked list.

[0175] Specifically, the bidirectional linked list may include an attribute information variable, denoted as Road, and a topological relationship variable, denoted as Road_link. The attribute information variable Road may include multiple attribute information of a road segment. The topological relationship variable Road_link of a road segment may include a topological relationship between road segments. If Road_link includes multiple topological relationships, it means that the Road_link corresponds to an intersection.

[0176] Figure 7 The following is a schematic diagram of the data link within the scope of an exemplary preset plot, such as Figure 7 As shown, within the preset land parcel range, the attribute information variable Road of each road segment within the preset land parcel range and the topological relationship variable Road_link of each road segment can be obtained.

[0177] Further, such as Figure 7 As shown, in the attribute information variable Road of the road section, multiple attribute information of the road section may be included, such as the front association relationship, the back association relationship, the reference line ID, the divided S2 block ID (i.e., the ID of the map tile), the road form (i.e., rd_form in the aforementioned example), the road status (i.e., the traffic status rdStatus in the aforementioned example), the traffic direction (i.e., the traffic direction direction in the aforementioned example), the length, the geometric shape, etc.

[0178] Furthermore, as an example, the variable values ​​of the road form rd_form, the road class rd_class, the travel direction direction, and the travel status rdStatus can be stored in the form of integer data (Int).

[0179] The value range of road form rd_form and its corresponding meaning are shown in Table 1.

[0180] Table 1 Road shape values ​​and their corresponding meanings

[0181]

[0182] Among them, the value range of road class rd_class and the corresponding meaning of the value are shown in Table 2.

[0183] Table 2 Road grade values ​​and their corresponding meanings

[0184]

[0185] The value range of the traffic status rdStatus and the corresponding meanings of the values ​​are shown in Table 3.

[0186] Table 3 Traffic status values ​​and their corresponding meanings

[0187]

[0188] The value range of the direction and the corresponding meanings of the values ​​are shown in Table 4.

[0189] Table 4 Passage direction values ​​and their corresponding meanings

[0190]

[0191] At this point, the data of the road sections within each preset plot range and the topological relationship between the road sections have been extracted into a bidirectional linked list. Each time the trajectory generation step is repeated, it is performed within a preset plot range. A road section is selected from the map tiles within the preset plot range as the latest road section, and trajectory generation begins. According to the method provided in the aforementioned embodiment, within the preset plot range, a successor road section that has a topological relationship with the latest road section is explored. If it is determined that a successor road section exists, a successor road section is selected as the next road section of the latest road section, and the next road section is added to the obtained trajectory.

[0192] Optionally, each time a road segment is added to the obtained trajectory, a field or flag is set in the attribute information variable in the bidirectional linked list to indicate whether the road segment corresponding to the attribute information variable has been used.

[0193] After a complete trajectory is generated, unused sections are selected within the current preset plot range to generate new trajectories. If it is determined that all sections within the current preset plot range have been used, it is determined that all trajectories within the current preset plot range are generated. Continue to generate trajectories for the next preset plot range.

[0194] In the above embodiment, by dividing the reference map into multiple preset plot ranges, each time the trajectory is generated, the trajectory is generated only for the data within a single preset plot range. This can avoid the problem of large data volume and heavy computing load caused by directly using a large range of reference map data for trajectory generation. In addition, according to the needs of the scene, a preset plot range that meets the scene can be selected, and the trajectory can be constructed within a controllable data range; and targeted trajectory generation can be performed within the preset plot range that meets the scene, so that the generated trajectory can fit the application scenario more accurately.

[0195] Based on the above embodiment, it can be known that in each step of executing trajectory generation, it is necessary to select a section from the successor section with a topological relationship from the latest section as the next section of the latest section, and add the next section to the obtained trajectory. However, in some cases, when the latest section is explored along the first direction, it is impossible to find a successor section with a topological relationship with the latest section. It is understandable that the current trajectory exploration is like a dead end. At this time, it is necessary to adjust the strategy of trajectory exploration and correct the obtained trajectory. This embodiment specifically explains how to continue trajectory generation when the latest section does not have a successor section with a topological relationship.

[0196] Figure 8 Schematic diagram of the trajectory generation method provided in this application Figure 3 ,like Figure 8 As shown, the method also includes:

[0197] Step 801: If no subsequent road segment having a topological relationship with the latest road segment is determined from the reference map along the first direction, a predecessor fork intersection node of the latest road segment is determined from the obtained trajectory.

[0198] The preceding fork intersection node includes a plurality of road sections, and the plurality of road sections in the preceding fork intersection node have a topological relationship with a preceding road section of the latest road section.

[0199] For example, Fig. 9 Schematic diagram for example trajectory generation Figure 1 .like Fig. 9 As shown in [a], along the first direction, that is, the same direction as the vector direction of the latest road segment, in the reference map, the obtained trajectory is H1 to H2 to H3, and it is found that there is no successor road segment having a topological relationship with the latest road segment H3, then the predecessor fork intersection node of the latest road segment is determined from the obtained trajectory.

[0200] Among them, the predecessor fork node refers to the connection node between the latest section and the previous section of the latest section, and the connection node includes multiple sections that have a topological relationship with the previous section of the latest section. Specifically, from the obtained trajectory, the connection node between the latest section and the previous section of the latest section is determined. Based on the connection node, in the reference map, if the number of subsequent sections that have a topological relationship with the previous section of the latest section is determined to be greater than 1, then the connection node is the predecessor fork node of the latest section.

[0201] like Fig. 9As shown in [a], from the obtained trajectory, the connection node between the latest section H3 and the previous section H2 of the latest section is determined. In addition, in the reference map, the number of successor sections that have a topological relationship with the previous section H2 of the latest section is 2, namely, section H3 and section H4, and the connection node is the predecessor fork node of the latest section. In the predecessor fork node, multiple sections have a topological relationship with the previous section H2 of the latest section, namely, H2 has a topological relationship with H3, and H2 has a topological relationship with H4.

[0202] Step 802: Determine the other road sections in the obtained predecessor fork intersection node except the latest road section as the new latest road section.

[0203] Exemplarily, after determining the preceding fork intersection node, Fig. 9 As shown in [b], the latest segment H3 is deleted from the obtained trajectory. In the predecessor fork node, other segments except the deleted latest segment are selected as new latest segments, and the selected new latest segments are added to the obtained trajectory. Fig. 9 As shown in [b], H4 is taken as the new latest segment and added to the obtained trajectory, that is, the current obtained trajectory is H1 to H2 to H4.

[0204] At this time, the new latest road segment is used to continue exploring in the reference map or within the preset land area in the reference map to see if there is a subsequent road segment with a topological relationship with the new latest road segment. Fig. 9 From [b], we can see that the successor segment that has a topological relationship with the new latest segment H4 is H5. The successor segment H5 is used as the next segment of the new latest segment, and the next segment is added to the obtained trajectory, that is, the current obtained trajectory is H1 to H2 to H4 to H5.

[0205] It should be noted that Fig. 9 It is only used as an example to explain how to operate when the latest segment does not have a subsequent segment with a topological relationship with it. It does not serve as a limitation on the connection relationship of the segments, or the actual position and length of the segments in the reference map.

[0206] In the above example, for the case where the latest road segment does not have a subsequent road segment with a topological relationship with it, the trajectory can be generated by selecting other road segments at the predecessor fork intersection node. When the trajectory generation enters a dead end or reaches the boundary of the data range, other road segments at the fork intersection can be selected to continue the trajectory generation, and the trajectory generation will not be terminated directly, thereby ensuring the integrity of the generated trajectory.

[0207] Combination Fig. 9[b] is explained. In a possible implementation, if the new latest road segment H4 has a successor road segment H5 with a topological relationship, H5 can be added to the obtained trajectory. However, in another possible implementation, the new latest road segment also does not have a successor road segment with a topological relationship. In this case, reverse exploration can be performed on the currently obtained trajectory. Fig.10 Schematic diagram of the trajectory generation method provided in this application Figure 4 ,like Fig.10 As shown, as an example, the following steps can be used to implement reverse exploration of the currently obtained trajectory:

[0208] Step 1001: If the predecessor fork node of the latest segment is not determined from the obtained trajectory, the starting segment of the obtained trajectory is determined as the new latest segment.

[0209] For example, Fig.11 Schematic diagram for example trajectory generation Figure 2 , combined with Fig.11 Explain step 1001. The obtained trajectory is H1 to H2 to H3. The latest segment H3 does not have a successor segment with a topological relationship. Then, the predecessor fork node connected to the latest segment is searched. However, the previous segment H2 of the latest segment only has a topological relationship with H3. At this time, it is deemed that the predecessor fork node of the latest segment has not been determined.

[0210] Therefore, the starting section H1 of the obtained trajectory is used as the new latest section.

[0211] Step 1002: Starting from the second direction, start executing the step of determining a subsequent segment having a topological relationship with the latest segment from the reference map for the latest segment in the obtained trajectory.

[0212] The second direction is the opposite direction of the first direction.

[0213] Exemplary, combined Fig.11 Step 1002 is explained as follows: Fig.11 As shown, the first direction is the same as the vector direction of the road section, and the second direction is the opposite direction of the first direction, that is, the second direction is the opposite direction to the vector direction of the road section.

[0214] Take the new latest road segment H1 along the second direction to determine whether the road segment H1 has a subsequent road segment with a topological relationship. Fig.11 As shown, along the second direction, the segment H4 is a subsequent segment having a topological relationship with the segment H1, and the segment H4 is taken as the next segment of the latest segment, and the segment H4 is added to the obtained trajectory, and H4 is taken as the new latest segment. At this time, the obtained trajectory is H4 to H1 to H2 to H3.

[0215] Furthermore, H4 is the latest segment, and segment H5 is a subsequent segment having a topological relationship with segment H4 along the second direction, then segment H5 is taken as the next segment of the latest segment, and segment H5 is added to the obtained trajectory, and H5 is taken as the new latest segment. At this time, the obtained trajectory is H5 to H4 to H1 to H2 to H3.

[0216] It should be noted that if multiple subsequent sections having a topological relationship with the latest section are encountered when generating the trajectory in the second direction, you can refer to the description of steps 301 to 302, and select one from the multiple subsequent sections as the next section of the latest section based on the heading angle between the latest section and the subsequent section and based on the turning state of the previous intersection.

[0217] In the above example, considering that the latest segment may not have a successor segment, reverse exploration is performed on the obtained trajectory, which is equivalent to updating the starting point of the obtained trajectory to form a longer trajectory. This avoids the problem of incomplete and inaccurate generated trajectories due to improper selection of the starting segment of the trajectory.

[0218] On the basis of any of the above embodiments, when the step of generating a trajectory is repeatedly executed, it is necessary to determine whether the first preset condition for obtaining a complete trajectory is met based on the obtained trajectory. This embodiment specifically explains how to determine whether the obtained trajectory meets the first preset condition for obtaining a complete trajectory.

[0219] When it is determined that the obtained trajectory meets the first preset condition, it is determined that the obtained trajectory is a complete trajectory.

[0220] In one example, the first preset condition includes at least one of the following: the length of the obtained trajectory meets the preset length, the number of fork intersections in the obtained trajectory meets the preset number of fork intersections, the number of merge intersections in the obtained trajectory meets the preset number of merge intersections, and the next section of the latest section meets the preset requirements.

[0221] As an example, it is explained in detail how to determine whether the obtained track length meets the preset length. The preset length includes a first length and a second length, and the first length is smaller than the second length.

[0222] Exemplarily, the lengths in the attribute information variables of each road section in the obtained trajectory are summed to obtain the obtained trajectory length value. According to the obtained trajectory length value, it is compared with the first length or the second length. If it is determined that the obtained trajectory length is greater than or equal to the first length or greater than or equal to the second length, it is considered that the obtained trajectory length meets the preset length. Correspondingly, if the obtained trajectory length is less than the first length, it is considered that the obtained trajectory length does not meet the preset length, and the subsequent road section of the latest road section is continuously explored to execute the trajectory generation step.

[0223] As an example, it is specifically explained how to determine whether the number of forked intersections in the obtained trajectory meets the preset number of forked intersections. The preset number of forked intersections includes a first number of forked intersections and a second number of forked intersections, and the first number of forked intersections is less than the second number of forked intersections.

[0224] Exemplarily, in the process of repeatedly executing trajectory generation, a segment is selected from a plurality of subsequent segments having a topological relationship with the latest segment as the next segment of the latest segment. It can be determined whether the trajectory generated at the intersection is a turn or a straight line according to the heading angle between the next segment of the selected latest segment and the latest segment. Fig.12 This is a schematic diagram for judging turning and going straight, combined with Fig.12 Explain how to judge whether to turn or go straight.

[0225] Specifically, if it is determined that the second heading angle between the latest section and the next section of the latest section is less than or equal to the first preset angle threshold, then the number of straight-line times corresponding to the obtained track is accumulated by 1.

[0226] For example, Fig.12 As shown in [a], according to the extension line of the latest section, when the angle is deflected to coincide with the next section of the latest section, the angle turned is the second heading angle. If the value of the second heading angle is determined to be less than or equal to the first preset angle threshold, the trajectory generated at this intersection is determined to be straight. Among them, the first preset angle threshold can be set to 45 degrees. If the trajectory generated at this intersection is straight, the number of straight-line times corresponding to the obtained trajectory is accumulated and added by 1.

[0227] Specifically, if it is determined that the second heading angle between the latest section and the next section of the latest section belongs to the first preset angle range, the number of trajectory turns corresponding to the obtained trajectory is accumulated by 1, and the connection point between the latest section and the next section of the latest section is determined as a waypoint.

[0228] The first preset angle range is greater than the first preset angle threshold and less than the second preset angle threshold; the second preset angle threshold is greater than the first preset angle threshold.

[0229] For example, Fig.12 As shown in [b], according to the extension line of the latest road section, when the angle is deflected to coincide with the next road section of the latest road section, the angle turned is the second heading angle. If the value of the second heading angle is determined to belong to the first preset angle range, it is determined that the trajectory generated at this intersection is a turn.

[0230] The first preset angle threshold can be set to 45 degrees, and the second preset angle threshold can be set to 135 degrees, that is, the first preset angle range is greater than 45 degrees and less than 135 degrees. If the trajectory generated at this intersection is a turn, the number of turns corresponding to the obtained trajectory is accumulated and added by 1. In addition, the connection point between the latest section and the next section of the latest section is determined as a waypoint.

[0231] It should be noted that the waypoint is used to indicate the obtained track at which the turning operation was performed. After repeatedly executing the track generation steps, the obtained complete track may include multiple waypoints, which can be used to reproduce the complete track generated according to the embodiment of the present application based on multiple waypoints in the commercial map software.

[0232] Based on the above two examples, the number of forks corresponding to the obtained trajectory can be determined by accumulating the number of straight-line times and the number of turns in the trajectory.

[0233] More specifically, if it is determined that the number of straight lines corresponding to the obtained trajectory is accumulated by 1, or the number of turns corresponding to the obtained trajectory is accumulated by 1, then it is determined that the number of fork intersections corresponding to the obtained trajectory is accumulated by 1.

[0234] For example, whether the number of straight-line movements of the track is accumulated by 1 or the number of turns of the track is accumulated by 1, both are operations performed when passing through a fork in the road. It can be understood that the number of straight-line movements of the track is accumulated by 1, which is equivalent to the track passing through a fork in the road and choosing to go straight; the number of turns of the track is accumulated by 1, which is equivalent to the track passing through a fork in the road and choosing to turn.

[0235] The number of forked intersections is accumulated by accumulating the number of straight lines of the trajectory by 1 or the number of turns of the trajectory by 1, thereby determining the number of forked intersections corresponding to the obtained trajectory.

[0236] The number of forked roads corresponding to the obtained trajectory is compared with the first number of forked roads or the second number of forked roads. If it is determined that the number of forked roads corresponding to the obtained trajectory is greater than or equal to the first number of forked roads or the second number of forked roads, the number of forked roads corresponding to the obtained trajectory is deemed to meet the preset number of forked roads. Correspondingly, if the number of forked roads corresponding to the obtained trajectory is less than the first number of forked roads, the number of forked roads corresponding to the obtained trajectory is deemed to not meet the preset number of forked roads, and the subsequent sections of the latest section are explored continuously, and the step of generating the trajectory is executed.

[0237] As an example, it is specifically explained how to determine whether the number of merged intersections in the obtained trajectory meets the preset number of merged intersections.

[0238] Specifically, if it is determined that the number of predecessor road sections corresponding to the latest road section in the reference map is greater than a preset number, then the number of merged intersections corresponding to the obtained trajectory is accumulated by 1.

[0239] The merged intersection means that, in the reference map, if the number of predecessor sections that are topologically related to the first section is greater than 1, then the intersection where the head end of the directed line segment of the first section is located is the merged intersection. Fig.13 is a schematic diagram of an exemplary merging intersection, such as Fig.13 As shown, the road section H3 is the latest road section, and the latest road section has two corresponding predecessor road sections, namely H1 and H2. If the number of predecessor road sections is greater than the preset number, which can be set to 1, the intersection is determined to be a merged intersection, and the number of merged intersections corresponding to the obtained trajectory is determined to be accumulated by 1.

[0240] The number of merged intersections corresponding to the obtained trajectory is compared with the preset number of merged intersections. If it is determined that the number of merged intersections corresponding to the obtained trajectory is greater than or equal to the preset number of merged intersections, the number of merged intersections corresponding to the obtained trajectory is deemed to meet the preset number of merged intersections. Correspondingly, if the number of merged intersections corresponding to the obtained trajectory is less than the preset number of merged intersections, the number of merged intersections corresponding to the obtained trajectory is deemed to not meet the preset number of merged intersections, and the subsequent sections of the latest section are continuously explored to execute the trajectory generation step.

[0241] As an example, it is explained in detail how to determine whether the next section of the latest section meets the preset requirements.

[0242] Specifically, the preset requirement represents that the next road section of the latest road section and the previous intersection corresponding to the next road section in the reference map meet the second preset condition. The first condition information includes the first road section number and / or the first distance value.

[0243] Exemplarily, the preset requirement is used to determine whether the next section of the latest section can be used as the end point of the complete trajectory. The preset requirement can represent the next section, and the number of first sections between the previous intersection corresponding to the next section in the reference map is greater than or equal to the first section number threshold.

[0244] Taking trajectory generation within the preset plot range of the reference map as an example, the next segment of the latest segment has 10 segments between the previous intersection within the preset plot range of the reference map, and the first segment number threshold is set to 5. It can be understood that the next segment of the latest segment has passed enough segments from the previous intersection, and the next segment can be used as the end point of the complete trajectory.

[0245] Exemplarily, the preset requirement may also represent that a next road section and a previous intersection corresponding to the next road section in the reference map have a first distance value greater than or equal to a first distance threshold.

[0246] For example, the next section of the latest section has a first distance value of 10 km from the last intersection within the preset plot range of the reference map, and the first distance threshold is set to 5 km. It can be understood that the next section of the latest section has a sufficiently long distance from the last intersection, and the next section can be used as the end point of the complete trajectory.

[0247] It should be noted that the preset requirements of the above two examples can be implemented in combination or separately.

[0248] For example, when combined with the implementation, the next segment of the latest segment, the number of segments between the previous intersection within the preset plot range of the reference map is 10, which is greater than the first segment number threshold, and the first distance value is 10km, which is greater than the first distance threshold, then it is determined that the next segment can be used as the end point of the complete trajectory.

[0249] For another example, when implemented alone, the next segment of the latest segment has a total of 3 segments between the previous intersection within the preset plot range of the reference map, which is less than the first segment number threshold, but the first distance value is 10km, which is greater than the first distance threshold. The next segment can also be determined as the end point of the complete trajectory.

[0250] In the above example, during the execution of the trajectory generation step, the length of the obtained trajectory, the number of forked intersections of the obtained trajectory, the number of merged intersections of the obtained trajectory, the next section of the latest section, and other information are determined. Based on this information, it can be determined whether a complete trajectory has been obtained. With this information, it can be ensured that the obtained trajectory is of sufficient length and passes through a sufficient number of intersections, and can accurately fit the actual driving scenario of the user.

[0251] Next, a detailed explanation is given on whether the obtained trajectory is the target trajectory according to the first preset condition.

[0252] In one example, if it is determined that the length of the obtained trajectory is greater than or equal to the second length, and it is determined that the next segment of the latest segment meets the preset requirements, it is determined that a complete trajectory is obtained, that is, the obtained trajectory meets the first preset condition.

[0253] For example, if the length of the currently obtained trajectory has reached the larger second length, that is, it is greater than or equal to the second length. In this case, it means that the trajectory is long enough, and the number of forked intersections and the number of merged intersections passed are not considered, and the currently obtained trajectory is directly considered to end the exploration. Moreover, based on the trajectory that can end the exploration, if the next section of the latest section in the trajectory that can end the exploration can be used as the end point of the complete trajectory, it is determined that the complete trajectory is obtained, and the generation of this trajectory ends.

[0254] For example, if the length of the currently obtained trajectory is 25.8km and the second length is set to 25km, the length of the obtained trajectory is greater than the second length, and it is considered that a sufficiently long trajectory has been obtained. If the next segment of the latest segment in the trajectory can be used as the end point, it is determined that a complete trajectory has been obtained.

[0255] In one example, if it is determined that the length of the obtained trajectory is greater than or equal to the first length and less than the second length, then when it is determined that the number of forks in the obtained trajectory is greater than or equal to the second number of forks, and when it is determined that the next section of the latest section meets the preset requirements, it is determined that a complete trajectory is obtained, that is, the obtained trajectory meets the first preset condition.

[0256] Exemplarily, based on the length of the currently obtained trajectory, when it has not yet reached the larger second length but has reached the smaller first length, that is, when it is greater than or equal to the first length and less than the second length, it is determined whether the number of forks in the currently obtained trajectory meets the preset number of forks.

[0257] The number of forked intersections in the currently obtained trajectory has reached the larger second fork intersection number, that is, greater than or equal to the second fork intersection number. In this case, it means that the length of the trajectory is appropriate and the trajectory has passed through enough forked intersections, then the number of merged intersections passed is not considered, and the currently obtained trajectory is directly considered to end the exploration. Moreover, based on the trajectory that can end the exploration, if in the trajectory that can end the exploration, the next section of the latest section can be used as the end point of the complete trajectory, then it is determined that the complete trajectory is obtained, and the generation of this trajectory ends.

[0258] For example, if the length of the currently obtained trajectory is 12 km, the first length is set to 10 km, and the second length is set to 25 km, the obtained trajectory length is greater than the first length and less than the second length, and the obtained trajectory length is considered appropriate.

[0259] The number of forks in the currently obtained trajectory is 15, and the number of second forks is set to 15. At this time, the number of forks in the obtained trajectory is equal to the number of second forks. It is considered that the trajectory of appropriate length has passed enough forks. If the next section of the latest section in the trajectory can be used as the end point, it is determined that the complete trajectory is obtained.

[0260] In one example, if it is determined that the length of the obtained trajectory is greater than or equal to the first length and less than the second length, then when it is determined that the number of fork intersections in the obtained trajectory is greater than or equal to the first number of fork intersections and the number of fork intersections is less than the second number of fork intersections, the number of straight lines in the obtained trajectory is greater than the first preset number, and the number of turns in the obtained trajectory is greater than the second preset number, it is determined whether the number of merging intersections in the obtained trajectory is greater than or equal to the preset number of merging intersections.

[0261] If it is determined that the number of merged intersections in the obtained trajectory is greater than or equal to the preset number of merged intersections, and it is determined that the next section of the latest section meets the preset requirements, it is determined that a complete trajectory is obtained, that is, the obtained trajectory meets the first preset condition.

[0262] Exemplarily, based on the length of the currently obtained trajectory, when it has not yet reached the larger second length but has reached the smaller first length, that is, when it is greater than or equal to the first length and less than the second length, it is determined whether the number of forks in the currently obtained trajectory meets the preset number of forks.

[0263] When the number of forks in the currently obtained trajectory has not yet reached the larger second fork number, but has reached the smaller first fork number, that is, it is greater than or equal to the first fork number and less than the second fork number. In this case, it means that the length of the trajectory is appropriate and the number of forks passed by the trajectory is also appropriate.

[0264] Further, it is determined whether the number of turns and the number of straight lines in the currently obtained trajectory meet the requirements. The first preset number and the second preset number can be set according to the number of the first fork intersections.

[0265] For example, the first number of forks is 10. Since the number of forks in the currently obtained trajectory is determined to be greater than 10, in order to ensure that the number of straight lines and turns in the constructed trajectory is relatively even, the first preset number and the second preset number can both be set to 3.

[0266] It can be understood that the obtained trajectory passes through at least 10 forks, for example, 12 forks. When passing through the forks, if 11 of the 12 times are straight driving and only 1 is a turn, the difference between the number of straight driving and the number of turns is too large, and the obtained trajectory is not accurate. Determining the number of straight driving according to the first preset number and the number of turns according to the second preset number can ensure that in the obtained trajectory, the number of turns and the number of straight driving at the forks are more balanced, so that the obtained trajectory more accurately fits the driving scene.

[0267] For example, if the length of the currently obtained trajectory is 12 km, the first length is set to 10 km, and the second length is set to 25 km, the obtained trajectory length is greater than the first length and less than the second length, and the obtained trajectory length is considered appropriate.

[0268] The number of forks in the currently obtained trajectory is 12, the first number of forks is set to 10, and the second number of forks is set to 15. At this time, the number of forks in the obtained trajectory is greater than the first number of forks and less than the second number of forks. It is considered that the number of forks passed in the trajectory of appropriate length is also appropriate.

[0269] Furthermore, the number of straight lines in the currently obtained trajectory is 7, and the number of turns is 5. The first preset number and the second preset number are both set to 3. At this time, the number of straight lines in the obtained trajectory is greater than the first preset number, and the number of turns is greater than the second preset number. It is considered that the number of straight lines and turns passing through the fork intersection is average, and it is determined whether the number of merged intersections in the obtained trajectory meets the preset number of merged intersections.

[0270] The number of merged intersections in the currently obtained trajectory is 5, and the preset number of merged intersections is set to 3. At this time, the number of merged intersections in the obtained trajectory is greater than the preset number of merged intersections, which is considered to be a trajectory with appropriate length, appropriate number of forks, average execution and turning times, and appropriate number of merged intersections. If the next segment of the latest segment in the trajectory can be used as the end point, it is determined that the complete trajectory has been obtained.

[0271] Fig.14 This is a flow chart of an exemplary determination of the target trajectory. To better explain how to determine the complete trajectory, Fig.14 Determine the process description for obtaining the complete trajectory.

[0272] like Fig.14As shown, the obtained trajectory is input for length judgment. The termination condition of the length judgment corresponds to "the length of the obtained trajectory is greater than or equal to the second length" in the above example; the sufficient condition of the length judgment corresponds to "the length of the obtained trajectory is greater than or equal to the first length, and less than the second length" in the above example; the non-satisfaction of the length judgment corresponds to "the length of the obtained trajectory is less than the first length" in the above example.

[0273] The termination condition for fork intersection judgment corresponds to "the number of forks in the obtained trajectory is greater than or equal to the second number of forks" in the above example; the sufficient condition for fork intersection judgment corresponds to "the number of forks in the obtained trajectory is greater than or equal to the first number of forks and less than the second number of forks, the number of straight lines in the obtained trajectory is greater than the first preset number, and the number of turns in the obtained trajectory is greater than the second preset number" in the above example; the non-satisfaction of fork intersection judgment corresponds to "the number of forks in the obtained trajectory is less than the first number of forks" in the above example.

[0274] The termination condition of the merge intersection judgment corresponds to "the number of merge intersections in the obtained trajectory is greater than or equal to the preset number of merge intersections" in the above example; the failure to meet the merge intersection judgment corresponds to "the number of merge intersections in the obtained trajectory is less than the preset number of merge intersections" in the above example.

[0275] The end point judgment corresponds to the above example of "the next section of the latest section and the previous intersection of the next section within the preset plot range in the reference map, the number of sections between the two is greater than or equal to the first section number threshold, and / or the distance value between the two is greater than or equal to the first distance threshold".

[0276] The above-mentioned endpoint judgment can ensure that the endpoint of the generated trajectory is a certain distance away from the intersection. In combination with actual application examples, it is very rare for a user to reach the destination immediately after passing an intersection and end the trajectory. Based on the above-mentioned endpoint judgment rules, it can ensure that the generated trajectory is more accurately in line with the user's actual driving scenario.

[0277] When the obtained trajectory meets the above conditions, it indicates that the currently obtained trajectory is the target trajectory, that is, Fig.14 The complete trajectory is determined as shown in .

[0278] In the above embodiment, by judging various parameters in the obtained trajectory, it is possible to ensure that the generated trajectory more accurately fits the user's actual driving scenario, and the generation of the trajectory is terminated after certain requirements are met.

[0279] In the aforementioned embodiment, when the section between the latest section and the section next to the latest section is determined to be a turn, the connection point between the latest section and the section next to the latest section is used as a waypoint.

[0280] Optionally, whether to add a waypoint may be determined based on a heading angle between the latest segment and the starting segment of the track.

[0281] In one example, if the third heading angle between the latest segment and the starting segment of the obtained trajectory is determined to be not within the second preset angle range, the connection point between the latest segment and the next segment of the latest segment is determined to be a waypoint.

[0282] The second preset angle range is greater than the third preset angle threshold and less than the fourth preset angle threshold; the third preset angle threshold is the negative of the fourth preset angle threshold.

[0283] Wherein, the waypoint refers to the key node of the track in the reference map. Based on multiple waypoints, the track generated according to the embodiment of the present application can be reproduced in commercial map software.

[0284] For example, Fig.15 is a schematic diagram of an exemplary pathway point. Fig.15 As shown, the starting section is the starting section of the obtained trajectory. The third heading angle can be calculated based on the starting section and the next section of the latest section. Specifically, when the vector direction of the starting section is deflected to coincide with the vector direction of the next section of the latest section, the angle turned is the third heading angle.

[0285] In one example, based on the vector direction of the initial road section, the third heading angle deflected to the left is recorded as a negative value, and the third heading angle deflected to the right is recorded as a positive value. Among them, the third angle threshold can be set to -90 degrees, and the fourth angle threshold can be set to 90 degrees. Correspondingly, the second preset angle range is greater than -90 degrees and less than 90 degrees.

[0286] Combined with the practical application explanation, when the third heading angle is within the second preset angle range, the trajectory is considered to be forward because the deflection angle between the next section of the latest section and the initial section of the trajectory is between -90 degrees and 90 degrees. When the third heading angle does not fall within the second preset angle range, the trajectory is considered to be a U-turn because the deflection angle between the next section of the latest section and the initial section of the trajectory is outside the range of -90 degrees to 90 degrees.

[0287] Therefore, when the trajectory is considered as a U-turn, the connection point between the latest segment and the next segment of the latest segment is determined as a waypoint.

[0288] In combination with the above embodiments, it can be seen that in the obtained trajectory, if a fork in the road is encountered and a turn is made at the fork in the road, a waypoint will be marked, and if a U-turn occurs, a waypoint will also be marked. Based on the waypoints in multiple trajectories, a complete and accurate trajectory can be reproduced in the subsequent commercial map software.

[0289] Based on any of the above embodiments, at the beginning of the trajectory generation, a road section is selected from the reference map or within the preset plot range of the reference map as the latest road section. The strategy for selecting the road section is not specifically limited, but not every road section is suitable as the starting point of the trajectory. The starting point of the trajectory needs to meet certain requirements. This embodiment specifically explains how to determine whether a road section meets the requirements for being the starting point of the trajectory.

[0290] In one example, an initial road section is selected from a reference map, and second condition information between the initial road section and a next intersection corresponding to the initial road section in the reference map is determined, wherein the second condition information includes the number of second road sections and / or a second distance value.

[0291] Exemplarily, when starting trajectory generation, a road segment is randomly selected from the reference map as an initial road segment, and the number of second road segments passed between the selected initial road segment and the next intersection corresponding to the initial road segment in the reference map is determined. In addition, a second distance value passed between the selected initial road segment and the next intersection corresponding to the initial road segment in the reference map is determined.

[0292] If it is determined that the second condition information meets the third preset condition, the initial section is determined to be the starting section of the trajectory.

[0293] Exemplarily, the third preset condition is used to determine whether the initial road section can be used as the starting road section of the trajectory. The third preset condition can represent the initial road section, and the number of second road sections between the next intersection corresponding to the initial road section in the reference map is greater than or equal to the second road section number threshold.

[0294] The third preset condition may also represent an initial road section, and a second distance value between the next intersection corresponding to the initial road section in the reference map is greater than or equal to a second distance threshold.

[0295] It is understandable that if the number of sections between the initial section and the next intersection is too small, and / or the distance between the initial section and the next intersection is too short, it is considered that the initial section cannot be used as the starting section of the trajectory.

[0296] Correspondingly, if the number of sections between the initial section and the next intersection is large enough, and / or the distance between the initial section and the next intersection is long enough, the initial section can be regarded as the starting section of the trajectory.

[0297] Optionally, in combination with the above-mentioned embodiment, whether the next section of the latest section meets the preset requirements can be understood as whether the next section of the latest section can be used as the end section of the trajectory. On the basis that the initial section meets the third preset condition and the next section of the latest section meets the preset requirements, it can also be required to set the road grade of the starting section and the end section.

[0298] Therefore, the initial road segment is used as the starting road segment if: the initial road segment meets the third preset condition and the road grade of the initial road segment is defined. The next road segment of the latest road segment is used as the ending road segment if: the next road segment meets the preset requirement and the road grade of the next road segment is defined.

[0299] In the above embodiment, by limiting the starting point and the end point, it is ensured that the starting point and the end point of the obtained complete trajectory are not too close to the intersection, so that the generated trajectory more accurately fits the actual driving scene of the user.

[0300] The trajectory generation method provided in the embodiment of the present application, by taking into account the turning state of the previous intersection in the generated trajectory when performing subsequent trajectory exploration on the current section in the reference map, selecting a subsequent section that meets the conditions from the subsequent sections of the current section as the next section, and adding the next section to the trajectory, and based on various preset conditions, ensuring that the generated complete trajectory, length, number of intersections passed, starting point and end point and other features more accurately fit the possible trajectory of the user during actual driving.

[0301] Fig.16 A schematic diagram of the structure of the trajectory generation device provided in this application, such as Fig.16 As shown, the trajectory generating device 160 provided in this embodiment includes:

[0302] The execution module 1601 is used to repeatedly execute the following steps until the obtained trajectory meets the first preset condition, and determine the obtained trajectory as the target trajectory:

[0303] For the latest section in the obtained trajectory, if a subsequent section having a topological relationship with the latest section is determined from the reference map along the first direction, then according to the turning state of the previous intersection in the obtained trajectory, the next section of the latest section is determined from the subsequent section, and the next section is added to the obtained trajectory.

[0304] In a possible implementation, according to the turning state of the previous intersection in the obtained trajectory, the next section of the latest section is determined from the subsequent sections, and the execution module 1601 is used to:

[0305] Determine a first heading angle between the latest section and the subsequent section;

[0306] According to the first heading angle and the turning state, a section is selected from a plurality of subsequent sections as the next section of the latest section.

[0307] In a possible implementation, according to the first heading angle and the turning state, a road section is selected from a plurality of subsequent road sections as the next road section of the latest road section, and the execution module 1601 is used to execute at least one of the following:

[0308] If it is determined that the turning state indicates that there is a turn at the previous intersection, then determining that the subsequent road segment corresponding to the first heading angle of the multiple subsequent road segments whose first heading angle is less than or equal to the first preset angle threshold is the next road segment of the latest road segment;

[0309] If it is determined that the turning state indicates that there is a turn at the previous intersection, and it is determined that there is no subsequent road section corresponding to the first heading angle whose first heading angle is less than or equal to the first preset angle threshold among the multiple subsequent road sections, a road section is randomly selected from the multiple subsequent road sections as the next road section of the latest road section;

[0310] If it is determined that the turning state indicates that there is no turn at the previous intersection, then a subsequent section corresponding to a first heading angle in a first preset angle range among multiple subsequent sections is determined to be the next section of the latest section; wherein the first preset angle range is greater than a first preset angle threshold and less than a second preset angle threshold; and the second preset angle threshold is greater than the first preset angle threshold;

[0311] If it is determined that the turning state indicates that there is no turn at the previous intersection, and it is determined that there is no subsequent section corresponding to the first heading angle whose first heading angle belongs to the first preset angle range among multiple subsequent sections, then a section is randomly selected from the multiple subsequent sections as the next section of the latest section.

[0312] In a possible implementation, the execution module 1601 is further configured to:

[0313] If it is determined that the second heading angle between the latest section and the section next to the latest section is less than or equal to the first preset angle threshold, then the number of straight lines corresponding to the obtained trajectory is accumulated by 1; if it is determined that the second heading angle between the latest section and the section next to the latest section belongs to the first preset angle range, then the number of turns corresponding to the obtained trajectory is accumulated by 1, and the connection point between the latest section and the section next to the latest section is determined to be a waypoint; wherein the first preset angle range is greater than the first preset angle threshold and less than the second preset angle threshold; the second preset angle threshold is greater than the first preset angle threshold; and / or

[0314] If it is determined that the third heading angle between the next section of the latest section and the starting section of the obtained trajectory does not belong to the second preset angle range, then determine the connection point between the latest section and the next section of the latest section as a waypoint; wherein the second preset angle range is greater than the third preset angle threshold and less than the fourth preset angle threshold; wherein the third preset angle threshold is the negative of the fourth preset angle threshold; and / or

[0315] If it is determined that the number of straight lines corresponding to the obtained trajectory is accumulated by 1, or the number of turns corresponding to the obtained trajectory is accumulated by 1, then it is determined that the number of fork intersections corresponding to the obtained trajectory is accumulated by 1.

[0316] In a possible implementation, a subsequent road segment having a topological relationship with the latest road segment is determined from the reference map along the first direction, and the execution module 1601 is used to:

[0317] A subsequent road segment having a topological relationship with the latest road segment is determined from a preset land area in a reference map along a first direction.

[0318] In a possible implementation, the execution module 1601 is further configured to:

[0319] If no subsequent road segment having a topological relationship with the latest road segment is determined from the reference map along the first direction, a predecessor fork intersection node of the latest road segment is determined from the obtained trajectory; wherein the predecessor fork intersection node includes multiple road segments, and multiple road segments in the predecessor fork intersection node have a topological relationship with a previous road segment of the latest road segment; determine the other road segments in the obtained predecessor fork intersection node except the latest road segment as the new latest road segment; and / or

[0320] If the predecessor fork intersection node of the latest segment is not determined from the obtained trajectory, the starting segment of the obtained trajectory is determined as the new latest segment; starting from the second direction, the steps of determining a subsequent segment having a topological relationship with the latest segment from the reference map for the latest segment in the obtained trajectory are started; wherein the second direction is the reverse of the first direction.

[0321] In one possible implementation, the first preset condition includes at least one of the following: the length of the obtained trajectory meets the preset length, the number of fork intersections in the obtained trajectory meets the preset number of fork intersections, the number of merge intersections in the obtained trajectory meets the preset number of merge intersections, and the next section of the latest section meets the preset requirements.

[0322] In a possible implementation manner, the preset length includes a first length and a second length, and the first length is smaller than the second length; the preset number of forked intersections includes a first number of forked intersections and a second number of forked intersections, and the first number of forked intersections is smaller than the second number of forked intersections;

[0323] The preset requirement represents that the next road segment of the latest road segment and the previous intersection corresponding to the next road segment in the reference map, and the first condition information between the two meet the second preset condition; wherein the first condition information includes the first road segment number and / or the first distance value;

[0324] The obtained trajectory meets the first preset condition, including at least one of the following:

[0325] The length of the obtained trajectory is greater than or equal to the second length, and the next section of the latest section is determined to meet the preset requirements;

[0326] The length of the obtained trajectory is greater than or equal to the first length and less than the second length, and the number of forked intersections in the obtained trajectory is greater than or equal to the second number of forked intersections, and the next segment of the latest segment meets the preset requirements;

[0327] The length of the obtained trajectory is greater than or equal to the first length and less than the second length, and the number of forked intersections in the obtained trajectory is greater than or equal to the first number of forked intersections and less than the second number of forked intersections, and the number of straight lines in the obtained trajectory is greater than a first preset number, and the number of turns in the obtained trajectory is greater than a second preset number, and the number of merged intersections in the obtained trajectory is greater than or equal to the preset number of merged intersections, and the next segment of the latest segment meets the preset requirements.

[0328] In a possible implementation, the execution module 1601 is further configured to:

[0329] Selecting an initial road section from the reference map, determining the initial road section, a next intersection corresponding to the initial road section in the reference map, and second condition information between the two; wherein the second condition information includes the number of second road sections and / or a second distance value;

[0330] If it is determined that the second condition information meets the third preset condition, the initial section is determined to be the starting section of the trajectory.

[0331] The trajectory generation device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be described in detail here.

[0332] Fig.17 This is a schematic diagram of the structure of the electronic device provided in this application. Fig.17As shown, the electronic device 170 provided in this embodiment includes: at least one processor 1701 and a memory 1702. Optionally, the device 170 further includes a communication component 1703. The processor 1701, the memory 1702 and the communication component 1703 are connected via a bus 1704.

[0333] In a specific implementation process, at least one processor 1701 executes the computer-executable instructions stored in the memory 1702, so that at least one processor 1701 executes the above method.

[0334] The specific implementation process of the processor 1701 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.

[0335] In the above embodiments, it should be understood that the processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the invention can be directly implemented as a hardware processor, or can be implemented by a combination of hardware and software modules in the processor.

[0336] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (NVM), such as at least one disk storage.

[0337] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of this application is not limited to only one bus or one type of bus.

[0338] The present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.

[0339] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above method is implemented.

[0340] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.

[0341] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.

[0342] The division of units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.

[0343] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0344] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0345] If the function 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 technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0346] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

[0347] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention, which follow the general principles of the present invention and include common knowledge or customary technical means in the art not disclosed by the present invention, are not limited to the precise structure described above and shown in the drawings, and may be modified and changed in various ways without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.

Claims

1. A trajectory generation method, characterized in that: The method comprises: Repeat the following steps until the obtained trajectory meets the first preset condition, and determine the obtained trajectory as the target trajectory: For the latest road segment in the obtained trajectory, if a subsequent road segment having a topological relationship with the latest road segment is determined from the reference map along the first direction, a next road segment of the latest road segment is determined from the subsequent road segment according to a turning state of a previous intersection in the obtained trajectory, and the next road segment is added to the obtained trajectory; According to the turning state of the previous intersection in the obtained trajectory, determining the next section of the latest section from the subsequent sections includes: Determining a first heading angle between the latest road segment and the subsequent road segment; According to the first heading angle and the turning state, selecting a road section from the plurality of subsequent road sections as the next road section of the latest road section; According to the first heading angle and the turning state, a road segment is selected from the plurality of subsequent road segments as the next road segment of the latest road segment, including at least one of the following: If it is determined that the turning state indicates that there is no turn at the previous intersection, then determine that the subsequent road section corresponding to the first heading angle of the first heading angle in the multiple subsequent road sections belongs to the first preset angle range as the next road section of the latest road section; wherein the first preset angle range is greater than the first preset angle threshold and less than the second preset angle threshold; the second preset angle threshold is greater than the first preset angle threshold; If it is determined that the turning state indicates that there is no turn at the previous intersection, and it is determined that there is no successor section corresponding to the first heading angle whose first heading angle belongs to the first preset angle range among the multiple successor sections, then a section is randomly selected from the multiple successor sections as the next section of the latest section.

2. The method according to claim 1, characterized in that When a road segment is selected from the plurality of subsequent road segments according to the first heading angle and the turning state as the next road segment of the latest road segment, the method further includes at least one of the following: If it is determined that the turning state indicates that there is a turn at the previous intersection, then determining that the subsequent road segment corresponding to the first heading angle of the plurality of subsequent road segments whose first heading angle is less than or equal to the first preset angle threshold is the next road segment of the latest road segment; If it is determined that the turning state indicates that there is a turn at the previous intersection, and it is determined that there is no successor section corresponding to the first heading angle whose first heading angle is less than or equal to the first preset angle threshold among the multiple successor sections, then a section is randomly selected from the multiple successor sections as the next section of the latest section.

3. The method according to claim 1, characterized in that The method further comprises: If it is determined that the second heading angle between the latest section and the next section of the latest section is less than or equal to the first preset angle threshold, then the number of straight-line trips corresponding to the obtained trajectory is accumulated by 1; if it is determined that the second heading angle between the latest section and the next section of the latest section belongs to the first preset angle range, then the number of turns corresponding to the obtained trajectory is accumulated by 1, and the connection point between the latest section and the next section of the latest section is determined to be a waypoint; wherein the first preset angle range is greater than the first preset angle threshold and less than the second preset angle threshold; the second preset angle threshold is greater than the first preset angle threshold; and / or, If it is determined that the third heading angle between the next section of the latest section and the starting section of the obtained trajectory does not belong to the second preset angle range, then the connection point between the latest section and the next section of the latest section is determined to be a waypoint; wherein the second preset angle range is greater than the third preset angle threshold and less than the fourth preset angle threshold; wherein the third preset angle threshold is the negative of the fourth preset angle threshold; and / or, If it is determined that the number of straight lines corresponding to the obtained trajectory is accumulated by 1, or the number of turns corresponding to the obtained trajectory is accumulated by 1, then it is determined that the number of fork intersections corresponding to the obtained trajectory is accumulated by 1.

4. The method according to claim 1, characterized in that: Determining a subsequent road segment having a topological relationship with the latest road segment from a reference map along a first direction, comprising: A subsequent road segment having a topological relationship with the latest road segment is determined from a preset land area in a reference map along a first direction.

5. The method according to claim 1, characterized in that The method further comprises: If no subsequent road segment having a topological relationship with the latest road segment is determined from the reference map along the first direction, a predecessor fork intersection node of the latest road segment is determined from the obtained trajectory; wherein the predecessor fork intersection node includes multiple road segments, and the multiple road segments in the predecessor fork intersection node have a topological relationship with the previous road segment of the latest road segment; determine the other road segments in the obtained predecessor fork intersection node except the latest road segment as the new latest road segment; and / or, If the predecessor fork intersection node of the latest section is not determined from the obtained trajectory, the starting section of the obtained trajectory is determined as the new latest section; starting from the second direction, the steps of determining a successor section having a topological relationship with the latest section from the reference map for the latest section in the obtained trajectory are started; wherein the second direction is the reverse of the first direction.

6. The method according to any one of claims 1 to 5, characterized in that in, The first preset condition includes at least one of the following: the length of the obtained trajectory meets the preset length, the number of fork intersections in the obtained trajectory meets the preset number of fork intersections, the number of merge intersections in the obtained trajectory meets the preset number of merge intersections, and the next section of the latest section meets the preset requirements.

7. The method according to claim 6, characterized in that The preset length includes a first length and a second length, and the first length is smaller than the second length; the preset number of forked intersections includes a first number of forked intersections and a second number of forked intersections, and the first number of forked intersections is smaller than the second number of forked intersections; The preset requirement represents that the first condition information between the next road section of the latest road section and the previous intersection corresponding to the next road section in the reference map meets the second preset condition; wherein the first condition information includes the first road section number and / or the first distance value; The obtained trajectory meets the first preset condition, including at least one of the following: The length of the obtained trajectory is greater than or equal to the second length, and it is determined that the next section of the latest section meets the preset requirements; The length of the obtained trajectory is greater than or equal to the first length and less than the second length, and the number of forked intersections in the obtained trajectory is greater than or equal to the second number of forked intersections, and the next segment of the latest segment meets the preset requirements; The length of the obtained trajectory is greater than or equal to the first length and less than the second length, and the number of forked intersections in the obtained trajectory is greater than or equal to the first number of forked intersections and less than the second number of forked intersections, and the number of straight lines in the obtained trajectory is greater than a first preset number, and the number of turns in the obtained trajectory is greater than a second preset number, and the number of merged intersections in the obtained trajectory is greater than or equal to the preset number of merged intersections, and the next segment of the latest segment meets the preset requirements.

8. The method according to any one of claims 1 to 5, characterized in that The method further comprises: Selecting an initial road section from a reference map, and determining second condition information between the initial road section and a next intersection corresponding to the initial road section in the reference map; wherein the second condition information includes the number of second road sections and / or a second distance value; If it is determined that the second condition information meets the third preset condition, the initial section is determined to be the starting section of the trajectory.

9. An electronic device, characterized in that: include: Memory, processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 8 when executed by a processor.

11. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 8 when being executed by a processor.

Citation Information

Patent Citations

  • Track matching method and device

    CN112857378A

  • Intelligent Driving Method and Apparatus, and Vehicle Including Same

    US20240337499A1