Disclosure of Invention
In order to overcome the defects of the prior art, the invention provides a test route generation method, a test method and a test device based on a semantic map, which can automatically generate a test route for intersections in a test area of the semantic map in a whole coverage manner, and are beneficial to improving the test efficiency of the semantic map.
In order to solve the above technical problem, in a first aspect, an embodiment of the present invention provides a test route generating method based on a semantic map, including:
loading a semantic map according to the test area to obtain a test map;
for each intersection on the test map, matching the entering navigation points of the intersection with the exiting navigation points of the reachable intersection one by one to generate a plurality of navigation point pairs of each intersection;
Traversing a plurality of navigation point pairs of each intersection, and matching each navigation point pair of the current intersection with each navigation point pair of the next intersection which can be reached by the current intersection to obtain a plurality of first matching pairs;
taking each navigation point pair of each intersection as a node, and adding a connecting edge between two navigation point pairs of each first matching pair to construct a directed graph;
and connecting all the connection edges according to the directed graph to connect all the nodes in series, and generating a test route.
Further, the test route generating method based on the semantic map further comprises the following steps:
When the boundary of the tested area of the current intersection reaches the navigation point pair of the next intersection, matching the navigation point pair of the current intersection with each navigation point pair of the reachable target intersection to obtain a plurality of second matching pairs, wherein the distance between the current intersection and the target intersection is smaller than the preset outside-domain distance;
And taking each navigation point pair of each intersection as a node, adding a connecting edge between the two navigation point pairs of each first matching pair, and adding a connecting edge between the two navigation point pairs of each second matching pair to construct the directed graph.
Further, for each intersection on the test map, pairing the entry navigation points of the intersection with the exit navigation points of the reachable intersection one by one to generate a plurality of navigation point pairs of each intersection, specifically:
for each intersection on the test map, matching the entering navigation points of the intersection with the exiting navigation points of the reachable intersection one by one to generate a plurality of initial navigation point pairs, and respectively selecting one initial navigation point pair from all the initial navigation point pairs on each side of the intersection as a navigation point pair to obtain a plurality of navigation point pairs.
Further, the connecting all the connection edges according to the directed graph to connect all the nodes in series, and a test route is generated, which specifically comprises:
Traversing a plurality of navigation point pairs of each intersection based on the directed graph, judging whether the navigation point pair of the current intersection passes through the boundary of the test area and does not reach the navigation point pair of the other intersection, if so, eliminating the navigation point pair of the current intersection to obtain an intermediate graph;
Traversing a plurality of navigation point pairs of each intersection based on the intermediate graph, matching each navigation point pair of the current intersection with each navigation point pair of another intersection reached by the current intersection to obtain a plurality of third matching pairs, and adding a connecting edge between two navigation point pairs of each third matching pair to generate a complete graph;
And connecting all the connecting edges according to the complete graph to connect all the nodes in series, and generating a test route.
Further, after the connecting all the connection edges according to the directed graph to connect all the nodes in series and generating a test route, the method further includes:
according to the speed limit information of the test map and the length of the test route, dividing the test route into a plurality of test sub-routes with test duration smaller than the preset test duration, and obtaining a test route set.
Further, after the semantic map is loaded according to the test area to obtain the test map, before pairing the entry navigation points of the intersections with the exit navigation points of the intersections which can be reached by the intersection one by one for each intersection on the test map to generate a plurality of navigation point pairs of each intersection, the method further comprises:
Traversing each intersection in the semantic map, and collecting the intersections in the test area into an intersection set of the test map.
In a second aspect, an embodiment of the present invention provides a test route generating device based on a semantic map, including:
the test map acquisition module is used for loading a semantic map according to the test area to obtain a test map;
the navigation point pair generating module is used for matching the entering navigation points of the intersections with the exiting navigation points of the intersections which can be reached by the entering navigation points of the intersections one by one for each intersection on the test map to generate a plurality of navigation point pairs of each intersection;
the navigation point pair matching module is used for traversing a plurality of navigation point pairs of each intersection, and matching each navigation point pair of the current intersection with each navigation point pair of the next intersection which can be reached by the current intersection to obtain a plurality of first matching pairs;
The directed graph construction module is used for taking each navigation point pair of each intersection as a node, adding a connecting edge between two navigation point pairs of each first matching pair and constructing a directed graph;
and the test route generation module is used for connecting all the connection edges according to the directed graph to connect all the nodes in series and generating a test route.
In a third aspect, an embodiment of the present invention provides a semantic map-based testing method, including:
loading a semantic map according to the test area to obtain a test map;
for each intersection on the test map, matching the entering navigation points of the intersection with the exiting navigation points of the reachable intersection one by one to generate a plurality of navigation point pairs of each intersection;
Traversing a plurality of navigation point pairs of each intersection, and matching each navigation point pair of the current intersection with each navigation point pair of the next intersection which can be reached by the current intersection to obtain a plurality of first matching pairs;
taking each navigation point pair of each intersection as a node, and adding a connecting edge between two navigation point pairs of each first matching pair to construct a directed graph;
connecting all the connection edges according to the directed graph to connect all the nodes in series, and generating a test route;
and sending the test route to the vehicle, so that the vehicle performs automatic driving test according to the test route, and correcting the test map according to the acquired test data.
Further, the semantic map-based testing method further comprises the following steps:
When the boundary of the tested area of the current intersection reaches the navigation point pair of the next intersection, matching the navigation point pair of the current intersection with each navigation point pair of the reachable target intersection to obtain a plurality of second matching pairs, wherein the distance between the current intersection and the target intersection is smaller than the preset outside-domain distance;
And taking each navigation point pair of each intersection as a node, adding a connecting edge between the two navigation point pairs of each first matching pair, and adding a connecting edge between the two navigation point pairs of each second matching pair to construct the directed graph.
In a fourth aspect, an embodiment of the present invention provides a semantic map-based testing apparatus, including:
the test map acquisition module is used for loading a semantic map according to the test area to obtain a test map;
the navigation point pair generating module is used for matching the entering navigation points of the intersections with the exiting navigation points of the intersections which can be reached by the entering navigation points of the intersections one by one for each intersection on the test map to generate a plurality of navigation point pairs of each intersection;
the navigation point pair matching module is used for traversing a plurality of navigation point pairs of each intersection, and matching each navigation point pair of the current intersection with each navigation point pair of the next intersection which can be reached by the current intersection to obtain a plurality of first matching pairs;
The directed graph construction module is used for taking each navigation point pair of each intersection as a node, adding a connecting edge between two navigation point pairs of each first matching pair and constructing a directed graph;
the test route generation module is used for connecting all the connecting edges according to the directed graph to connect all the nodes in series so as to generate a test route;
and the automatic driving test module is used for sending a test route to the vehicle, so that the vehicle can perform automatic driving test according to the test route, and the test map is corrected according to the acquired test data.
The embodiment of the invention has the following beneficial effects:
According to the method, a semantic map is loaded according to a test area to obtain a test map, for each intersection on the test map, the entering navigation points of the intersection are paired with the exiting navigation points of the intersection which can be reached by the intersection one by one to generate a plurality of navigation point pairs of each intersection, the plurality of navigation point pairs of each intersection are traversed, each navigation point pair of the current intersection is matched with each navigation point pair of the next intersection which can be reached by the current intersection to obtain a plurality of first matching pairs, each navigation point pair of each intersection is used as a node, connecting edges are added between two navigation point pairs of each first matching pair to construct a directed graph, all nodes are connected in series according to the directed graph, and a test route is generated to realize automatic generation of the test route. Compared with the prior art, the embodiment of the invention traverses each intersection in the test area on the semantic map by using the marked semantic map, automatically generates the test route in the left turn, right turn, straight and turning directions covering each intersection, can automatically generate the test route in the intersection in the test area of the semantic map in a whole coverage way, and is beneficial to improving the test efficiency of the semantic map.
Detailed Description
The following description of the embodiments of the present invention will be made more apparent and fully hereinafter with reference to the accompanying drawings, in which some, but not all embodiments of the invention are shown. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be noted that, the step numbers herein are only for convenience of explanation of the specific embodiments, and are not used as limiting the order of execution of the steps. The method provided in this embodiment may be performed by a relevant terminal device, and the following description will take a server as an execution body as an example.
As shown in fig. 1, a first embodiment of the present invention provides a test route generating method based on a semantic map, including steps S11 to S15:
s11, loading a semantic map according to the test area to obtain a test map;
s12, for each intersection on the test map, matching the entering navigation points of the intersection with the exiting navigation points of the reachable intersection one by one to generate a plurality of navigation point pairs of each intersection;
S13, traversing a plurality of navigation point pairs of each intersection, and matching each navigation point pair of the current intersection with each navigation point pair of the next intersection which can be reached by the current intersection to obtain a plurality of first matching pairs;
S14, taking each navigation point pair of each intersection as a node, and adding a connecting edge between two navigation point pairs of each first matching pair to construct a directed graph;
And S15, connecting all the connection edges according to the directed graph to connect all the nodes in series, and generating a test route.
The semantic map is a marked semantic map, and the semantic map is marked with a traffic direction, an intersection label, intersection coordinates, scale information, speed limit information and the like.
Illustratively, in step S11, the user initiates a test route generation request to the server by selecting a test area on the semantic map through the user terminal according to the actual test requirements. The server responds to a test route generation request initiated by the user terminal, and loads a semantic map corresponding to the test area according to the marked semantic map to obtain the test map.
According to the actual test requirement, a user can directly select a test area on the semantic map through the user terminal, or can designate a plurality of test points on the semantic map through the user terminal, and the server determines the test area according to the designated plurality of test points, for example, determines a polygonal area formed by connecting the plurality of test points as the test area, or determines a minimum circular area containing the plurality of test points as the test area.
In step S12, after the test map is obtained, intersections located in the test area are screened out according to coordinates of each intersection on the semantic map, so as to obtain all intersections on the test map. For each intersection on the test map, all the entering navigation points and all the leaving navigation points of the same intersection are found, then the arrival relation between all the entering navigation points and all the leaving navigation points of the intersection is determined according to the passing direction on the semantic map, finally the entering navigation points of the intersection and the leaving navigation points of the intersection which can be reached by the entering navigation points are paired one by one, a plurality of navigation point pairs of the intersection are generated, and a plurality of navigation point pairs of each intersection are generated.
For example, as shown in fig. 2, for intersection a on the test map, all the entering navigation points a 01、A02、A03 of intersection a and all the leaving navigation points a 11、A12、A13 of intersection a are found, the arrival relationship between all the entering navigation points a 01、A02、A03 and all the leaving navigation points a 11、A12、A13 is determined according to the passing direction on the semantic map, and since a 01 can reach a 11、A12、A13,A03 and a 11、A12、A13 can reach a 11、A12、A13,A02, a 01 is paired with a 11、A12、A13 respectively to obtain a navigation point pair (a 01,A11)、(A01,A12)、(A01,A13), a 02 is paired with a 11、A12、A13 respectively to obtain a navigation point pair (a 02,A11)、(A02,A12)、(A02,A13), a 03 is paired with a 11、A12、A13 respectively to obtain a navigation point pair (a 03,A11)、(A03,A12)、(A03,A13), thereby generating several navigation point pairs of intersection a. When traversing each intersection on the test map, generating a plurality of navigation point pairs of each intersection.
In step S13, a plurality of navigation point pairs of each intersection are traversed, for one navigation point pair of the traversed current intersection, an exiting navigation point is extracted from the navigation point pair, then according to the passing direction on the semantic map, the arrival relationship between the exiting navigation point and all the entering navigation points of the next intersection which can be reached by the exiting navigation point is determined, finally, the navigation point pair to which all the entering navigation points of the next intersection which can be reached by the exiting navigation point belong is found, and the navigation point pair is matched with each navigation point pair of the next intersection which can be reached by the exiting navigation point, so as to obtain a plurality of first matching pairs.
For example, as shown in fig. 3, when traversing to the navigation point pair (a 01,A11) of the intersection a, the departure navigation point a 11 is extracted from the navigation point pair (a 01,A11), the arrival relationship between the departure navigation point a 11 and all the entry navigation points B 01、B02、B03 of the next intersection B reachable by the departure navigation point a 11 is determined according to the passing direction on the semantic map, since a 11 can reach B 01 and B 02 and B 03 can not be reached, the navigation point pair (B 01,B11)、(B01,B12)、(B01,B13) to which B 01 belongs is found, the navigation point pair (a 01,A11) is respectively matched with the navigation point pair (B 01,B11)、(B01,B12)、(B01,B13), and a plurality of first matching pairs are obtained by the three first matching pairs [(A01,A11),(B01,B11)]、[(A01,A11),(B01,B12)]、[(A01,A11),(B01,B13)]. when traversing all the navigation point pairs of the respective intersections on the test map.
In step S14, each navigation point pair of each intersection is taken as a node, and a connection edge is added between two navigation point pairs in each first matching pair, so as to construct a directed graph.
Wherein the length of the connecting edge between two navigation point pairs in the first matching pair is the distance between the two navigation point pairs. The server may calculate the distance between the two navigation point pairs based on the scale information on the test map and the path length of traffic between the two navigation point pairs on the test map.
In step S15, all the connection edges are connected in series according to the directed graph to generate a test route, so that the test route is automatically generated in the left-turn, right-turn, straight-going and turning directions covering each intersection.
According to the embodiment, the marked semantic map is utilized to traverse each intersection in the test area on the semantic map, and the left turn, right turn, straight run and turning directions of each intersection are covered to automatically generate the test route, so that the intersection in the test area of the semantic map can be fully covered to automatically generate the test route, and the test efficiency of the semantic map is improved.
In a preferred embodiment, the method for generating the test route based on the semantic map further comprises the steps of matching the navigation point pair of the current intersection with each navigation point pair of a target intersection which can be reached by the navigation point pair of the current intersection when the boundary of the tested area reaches the navigation point pair of the next intersection, obtaining a plurality of second matching pairs, wherein the distance between the current intersection and the target intersection is smaller than the preset outside distance, taking each navigation point pair of each intersection as a node, adding a connecting edge between two navigation point pairs of each first matching pair, and adding a connecting edge between two navigation point pairs of each second matching pair, so as to construct the directed graph.
As an example, in step S13, if one navigation point pair of the current intersection traversed is a navigation point pair reaching the next intersection through the boundary of the test area, then an exit navigation point is extracted from the navigation point pair, then the arrival relationship between the exit navigation point and all the entry navigation points of the target intersection reachable by the exit navigation point is determined according to the passing direction on the semantic map and the preset outside-domain distance, finally the navigation point pair to which all the entry navigation points of the target intersection reachable by the exit navigation point belong is found, and the navigation point pair is matched with each navigation point pair of the target intersection reachable by the exit navigation point, so as to obtain a plurality of second matching pairs.
For example, as shown in fig. 4, when traversing to the navigation point pair (a 01,A12) of the intersection a, since the navigation point pair (a 01,A12) is the navigation point pair (B 03,B13) that passes through the boundary of the test area and reaches the intersection B, it is required to confirm whether the navigation point pair (a 01,A12) returns to the test area after passing through the boundary of the test area, and confirm whether the passing path length between the navigation point pair (a 01,A12) and each intersection in the test area exceeds the preset outside distance, extract the departure navigation point a 12 from the navigation point pair (a 01,A12), determine the arrival relationship between the departure navigation point a 12 and all the entry navigation points B 01、B02、B03 of the target intersection B that it can reach according to the passing direction and the preset outside distance on the semantic map, find the navigation point pair (B 03,B11)、(B03,B12)、(B03,B13) to which B 03 can not reach B 01 and B 02, match the navigation point pair (a 01,A12) with the navigation point pair (B 03,B11)、(B03,B12)、(B03,B13) respectively, and obtain all the navigation points on the second matched pair [(A01,A12),(B03,B11)]、[(A01,A12),(B03,B12)]、[(A01,A12),(B03,B13)]. when traversing the second intersection.
In step S14, each navigation point pair of each intersection is taken as a node, a connection edge is added between two navigation point pairs in each first matching pair, and a connection edge is added between two navigation point pairs in each second matching pair, so as to construct a directed graph.
Wherein the length of the connecting edge between the two navigation point pairs in the second matching pair is the distance between the two navigation point pairs. The server may calculate the distance between the two navigation point pairs based on the scale information on the test map and the path length of traffic between the two navigation point pairs on the test map.
According to the method and the device, when the navigation point pair of the current intersection reaches the navigation point pair of the next intersection through the boundary of the test area, the number of target intersections which can reach the current intersection is increased to automatically generate the test route, the intersections in the test area on the semantic map can be fully covered to automatically generate the test route, and the test efficiency of the semantic map is improved.
In a preferred embodiment, for each intersection on the test map, the entering navigation points of the intersection and the exiting navigation points of the reachable intersection are paired one by one to generate a plurality of navigation point pairs of each intersection, specifically, for each intersection on the test map, the entering navigation points of the intersection and the exiting navigation points of the reachable intersection are paired one by one to generate a plurality of initial navigation point pairs, and an initial navigation point pair is selected from all the initial navigation point pairs on each side of the intersection as a navigation point pair to obtain a plurality of navigation point pairs.
Illustratively, after the test map is obtained, intersections located in the test area are screened out according to the coordinates of all the intersections on the semantic map, so that all the intersections on the test map are obtained. For each intersection on the test map, all the entering navigation points and all the leaving navigation points of the same intersection are found, then the arrival relation between all the entering navigation points and all the leaving navigation points of the intersection is determined according to the passing direction on the semantic map, then the entering navigation points of the intersection and the leaving navigation points of the intersection which can be reached by the entering navigation points are paired one by one to generate a plurality of initial navigation point pairs of the intersection, finally one initial navigation point pair is selected from all the initial navigation point pairs on each side of the intersection as a navigation point pair to obtain a plurality of navigation point pairs, and a plurality of navigation point pairs of each intersection are generated.
For example, as shown in FIG. 2, As shown in fig. 5, for the intersection a on the test map, all the entering navigation points a 01、A02、A03 of the intersection a and all the leaving navigation points a 11、A12、A13 of the intersection a are found, the arrival relationship between all the entering navigation points a 01、A02、A03 and all the leaving navigation points a 11、A12、A13 is determined according to the passing direction on the semantic map, since a 01 can reach a 11、A12、A13,A02 and a 11、A12、A13,A03 can reach a 11、A12、A13, a 01 is paired with a 11、A12、A13 respectively to obtain an initial navigation point pair (a 01,A11)、(A01,A12)、(A01,A13), a 02 is paired with a 11、A12、A13 respectively to obtain an initial navigation point pair (a 02,A11)、(A02,A12)、(A02,A13), a 03 is paired with a 11、A12、A13 respectively to obtain an initial navigation point pair (a 03,A11)、(A03,A12)、(A03,A13), a plurality of initial navigation point pairs of the intersection a are generated, since only the initial navigation point pair (a 01,A11) is located on the intersection a "U" side, the initial navigation point pair (a 01,A12)、(A01,A13) is located on the intersection a "side, the initial navigation point pair (a 02,A11)、(A03,A11) is located on the intersection a" side, the initial navigation point pair (a 37 ") is located on the intersection a" "-75) is selected as the navigation point pair (a 37) from the intersection a" pair of the intersection a "37" as the initial navigation point pair (a 35) on the side, and obtaining a plurality of navigation point pairs, thereby generating a plurality of navigation point pairs of each intersection. when traversing each intersection on the test map, generating a plurality of navigation point pairs of each intersection.
According to the embodiment, the plurality of initial navigation point pairs at each intersection are subjected to de-duplication processing to obtain the plurality of navigation point pairs, so that the data volume of subsequent traversal pairing can be reduced, the processing pressure of a server is reduced, and the testing efficiency of the semantic map is improved.
In a preferred embodiment, all the connection edges are connected in series to generate a test route according to the directed graph, specifically, a plurality of navigation point pairs of each intersection are traversed based on the directed graph, whether the navigation point pair of the current intersection does not reach the navigation point pair of the other intersection after passing through the boundary of the test area is judged, if yes, the navigation point pair of the current intersection is removed to obtain an intermediate graph, each navigation point pair of the current intersection is traversed based on the intermediate graph to be matched with each navigation point pair of the other intersection reached by the intermediate graph to obtain a plurality of third matched pairs, connection edges are added between two navigation point pairs of each third matched pair to generate a complete graph, and all the connection edges are connected in series according to the complete graph to generate the test route.
Illustratively, the middle graph is obtained by eliminating the navigation point pairs in the directed graph, which cannot return to the test area after crossing the boundary of the test area. By eliminating the navigation point pairs which cannot be returned, the interference of useless navigation point pairs can be eliminated, and the generation of an accurate test route is facilitated. Considering that only one part of navigation point pairs in the middle graph may have connection edges, and the other part of navigation point pairs have disconnection conditions, the connection edges of the part of navigation point pairs need to be completed, a complete graph is generated, all nodes are connected in series according to the complete graph, and a test route is generated.
For example, in directed graph G, the classical algorithm tarjan algorithm is used to find the strong connected component (the graph that each pair of nodes can reach each other, called the strong connected graph. And only the nodes in the strong connected component with the largest node number are left, so that the points, of which part can reach the map boundary and cannot return to the map, are removed, and an intermediate graph is obtained. And solving a single-source shortest path for each node in the intermediate graph by using a classical algorithm dijkstra to obtain the distance between each pair of nodes, and supplementing the intermediate graph into a complete graph. In order to automatically generate a test route in the left-turn, right-turn, straight-turn and u-turn directions of each intersection, the test route is required to cover all nodes in the complete graph, so that the test route is converted into a tourist problem (TRAVELLING SALESMAN problem, TSP), any intelligent algorithm (such as a genetic algorithm, an ant colony algorithm and the like) can be used for finding a shorter annular route (also called Hamiltonian loop) and all the nodes are connected in series.
According to the embodiment, the navigation point pairs which cannot be returned are removed, and then the connecting edges between the partially disconnected navigation point pairs are complemented, so that the intersections in the semantic map test area can be further covered on the whole surface, an accurate test route is automatically generated, and the improvement of the test efficiency of the semantic map is facilitated.
In a preferred embodiment, after the connection of all the connection edges according to the directed graph to connect all the nodes in series to generate a test route, the method further includes splitting the test route into a plurality of test sub-routes with test duration smaller than a preset test duration according to speed limit information of a test map and the length of the test route, so as to obtain a test route set.
As an example, considering that the generated test route may be longer, the vehicle cannot run the complete test route once to complete the test, and the driver also needs to have a rest time, after the test route is generated, the test route is split into a plurality of test sub-routes with test duration less than the preset test duration according to the speed limit information on the test map and the traffic path length of the test route, so as to obtain the test route set.
According to the embodiment, the test route is split into the plurality of test sub-routes, so that the test safety of the subsequent semantic map can be ensured.
In a preferred embodiment, after the semantic map is loaded according to the test area to obtain the test map, the method further comprises traversing each intersection in the semantic map and collecting intersections in the test area into an intersection set of the test map before pairing the entry navigation points of the intersections with the exit navigation points of the reachable intersections one by one to generate a plurality of navigation point pairs of each intersection.
As an example, according to the intersection label and intersection coordinates on the semantic map, whether each intersection on the semantic map is located in the test area is judged, if yes, the intersection is considered to be the intersection in the test area, and the intersection is collected in the intersection set of the test map.
Based on the same inventive concept as the first embodiment, a second embodiment of the present invention provides a test route generating device based on a semantic map as shown in fig. 6, which comprises a test map acquisition module 21 for loading the semantic map according to a test area to obtain a test map, a navigation point pair generating module 22 for pairing an entry navigation point of an intersection with an exit navigation point of an intersection which can be reached by the entry navigation point pair generating module for each intersection one by one to generate a plurality of navigation point pairs of each intersection, a navigation point pair matching module 23 for traversing the plurality of navigation point pairs of each intersection, matching each navigation point pair of a current intersection with each navigation point pair of a next intersection which can be reached by the navigation point pair generating module to obtain a plurality of first matching pairs, a directed graph constructing module 24 for constructing a directed graph with each navigation point pair of each intersection as one node and adding a connection edge between two navigation point pairs of each first matching pair, and a test route generating module 25 for connecting all nodes in series according to the directed graph to connect all connection edges.
In a preferred embodiment, the navigation point pair matching module 23 is further configured to match the navigation point pair of the current intersection with each navigation point pair of the target intersection that the navigation point pair of the current intersection can reach when the boundary of the tested area reaches the navigation point pair of the next intersection, so as to obtain a plurality of second matching pairs, where the distance between the current intersection and the target intersection is smaller than the preset outside distance, and the directed graph construction module 24 is configured to use each navigation point pair of each intersection as a node, add a connection edge between two navigation point pairs in each first matching pair, and add a connection edge between two navigation point pairs in each second matching pair, so as to construct the directed graph.
In a preferred embodiment, for each intersection on the test map, the entering navigation points of the intersection and the exiting navigation points of the reachable intersection are paired one by one to generate a plurality of navigation point pairs of each intersection, specifically, for each intersection on the test map, the entering navigation points of the intersection and the exiting navigation points of the reachable intersection are paired one by one to generate a plurality of initial navigation point pairs, and an initial navigation point pair is selected from all the initial navigation point pairs on each side of the intersection as a navigation point pair to obtain a plurality of navigation point pairs.
In a preferred embodiment, all the connection edges are connected in series to generate a test route according to the directed graph, specifically, a plurality of navigation point pairs of each intersection are traversed based on the directed graph, whether the navigation point pair of the current intersection does not reach the navigation point pair of the other intersection after passing through the boundary of the test area is judged, if yes, the navigation point pair of the current intersection is removed to obtain an intermediate graph, each navigation point pair of the current intersection is traversed based on the intermediate graph to be matched with each navigation point pair of the other intersection reached by the intermediate graph to obtain a plurality of third matched pairs, connection edges are added between two navigation point pairs of each third matched pair to generate a complete graph, and all the connection edges are connected in series according to the complete graph to generate the test route.
In a preferred embodiment, after the connection of all the connection edges according to the directed graph to connect all the nodes in series to generate a test route, the method further includes splitting the test route into a plurality of test sub-routes with test duration smaller than a preset test duration according to speed limit information of a test map and the length of the test route, so as to obtain a test route set.
In a preferred embodiment, after the semantic map is loaded according to the test area to obtain the test map, the method further comprises traversing each intersection in the semantic map and collecting intersections in the test area into an intersection set of the test map before pairing the entry navigation points of the intersections with the exit navigation points of the reachable intersections one by one to generate a plurality of navigation point pairs of each intersection.
As shown in fig. 7, a third embodiment of the present invention provides a semantic map-based testing method, which includes steps S31 to S36:
s31, loading a semantic map according to the test area to obtain a test map;
S32, for each intersection on the test map, matching the entering navigation points of the intersection with the exiting navigation points of the reachable intersection one by one to generate a plurality of navigation point pairs of each intersection;
S33, traversing a plurality of navigation point pairs of each intersection, and matching each navigation point pair of the current intersection with each navigation point pair of the next intersection which can be reached by the current intersection to obtain a plurality of first matching pairs;
S34, taking each navigation point pair of each intersection as a node, and adding a connecting edge between two navigation point pairs of each first matching pair to construct a directed graph;
s35, connecting all the connection edges according to the directed graph to connect all the nodes in series, and generating a test route;
S36, sending a test route to the vehicle, enabling the vehicle to perform automatic driving test according to the test route, and correcting the test map according to the acquired test data.
The semantic map is a marked semantic map, and the semantic map is marked with a traffic direction, an intersection label, intersection coordinates, scale information, speed limit information and the like.
Illustratively, in step S31, the user initiates a test route generation request to the server by selecting a test area on the semantic map through the user terminal according to the actual test requirements. The server responds to a test route generation request initiated by the user terminal, and loads a semantic map corresponding to the test area according to the marked semantic map to obtain the test map.
According to the actual test requirement, a user can directly select a test area on the semantic map through the user terminal, or can designate a plurality of test points on the semantic map through the user terminal, and the server determines the test area according to the designated plurality of test points, for example, determines a polygonal area formed by connecting the plurality of test points as the test area, or determines a minimum circular area containing the plurality of test points as the test area.
In step S32, after the test map is obtained, intersections located in the test area are screened out according to the coordinates of each intersection on the semantic map, so as to obtain all intersections on the test map. For each intersection on the test map, all the entering navigation points and all the leaving navigation points of the same intersection are found, then the arrival relation between all the entering navigation points and all the leaving navigation points of the intersection is determined according to the passing direction on the semantic map, finally the entering navigation points of the intersection and the leaving navigation points of the intersection which can be reached by the entering navigation points are paired one by one, a plurality of navigation point pairs of the intersection are generated, and a plurality of navigation point pairs of each intersection are generated.
In step S33, a plurality of navigation point pairs of each intersection are traversed, for one navigation point pair of the traversed current intersection, an exiting navigation point is extracted from the navigation point pair, then according to the passing direction on the semantic map, the arrival relationship between the exiting navigation point and all the entering navigation points of the next intersection which can be reached by the exiting navigation point is determined, finally, the navigation point pair to which all the entering navigation points of the next intersection which can be reached by the exiting navigation point belong is found, and the navigation point pair is matched with each navigation point pair of the next intersection which can be reached by the exiting navigation point, so as to obtain a plurality of first matching pairs.
In step S34, a directed graph is constructed by using each navigation point pair of each intersection as a node and adding a connecting edge between two navigation point pairs in each first matching pair.
Wherein the length of the connecting edge between two navigation point pairs in the first matching pair is the distance between the two navigation point pairs. The server may calculate the distance between the two navigation point pairs based on the scale information on the test map and the path length of traffic between the two navigation point pairs on the test map.
In step S35, all the connection edges are connected in series according to the directed graph to generate a test route, so that the test route is automatically generated in the left-turn, right-turn, straight-going and turning directions covering each intersection.
In step S36, the user may mark the generated test route with the overlay test, name the corresponding name, and upload the name to the server. When the vehicle is tested, the test route is automatically grabbed from the server, and the server sends the grabbed test route to the vehicle. The security officer may select a test route for the overlay test to automatically traverse the test route. If the vehicle breaks the test, the vehicle records the current running place, and the next test starts from the last test place. If the safety officer finds that the problem exists in the automatic driving process of the vehicle, the safety officer can report the problem to the vehicle through the user terminal, the vehicle can automatically collect test data, the test data are uploaded to the server, and an engineer can check the uploaded test data and correct the problem place. After the semantic map is corrected, the vehicle may resume the autopilot test until the problem in the test area is resolved in a very aggressive manner.
According to the embodiment, the marked semantic map is utilized to traverse each intersection in the test area on the semantic map, and the left turn, right turn, straight run and turning directions of each intersection are covered to automatically generate the test route, so that the vehicle can automatically drive the test according to the test route, and the test map is corrected according to the acquired test data, so that the intersection in the test area of the semantic map can be covered on the whole to automatically generate the test route, and the test efficiency of the semantic map is improved.
In a preferred embodiment, the method for generating the test route based on the semantic map further comprises the steps of matching the navigation point pair of the current intersection with each navigation point pair of a target intersection which can be reached by the navigation point pair of the current intersection when the boundary of the tested area reaches the navigation point pair of the next intersection, obtaining a plurality of second matching pairs, wherein the distance between the current intersection and the target intersection is smaller than the preset outside distance, taking each navigation point pair of each intersection as a node, adding a connecting edge between two navigation point pairs of each first matching pair, and adding a connecting edge between two navigation point pairs of each second matching pair, so as to construct the directed graph.
As an example, in step S33, if one navigation point pair of the current intersection traversed is a navigation point pair reaching the next intersection through the boundary of the test area, then an exit navigation point is extracted from the navigation point pair, then the arrival relationship between the exit navigation point and all the entry navigation points of the target intersection reachable by the exit navigation point is determined according to the passing direction on the semantic map and the preset outside-domain distance, finally the navigation point pair to which all the entry navigation points of the target intersection reachable by the exit navigation point belong is found, and the navigation point pair is matched with each navigation point pair of the target intersection reachable by the exit navigation point, so as to obtain a plurality of second matching pairs.
In step S34, each navigation point pair of each intersection is taken as a node, a connection edge is added between two navigation point pairs in each first matching pair, and a connection edge is added between two navigation point pairs in each second matching pair, so as to construct a directed graph.
Wherein the length of the connecting edge between the two navigation point pairs in the second matching pair is the distance between the two navigation point pairs. The server may calculate the distance between the two navigation point pairs based on the scale information on the test map and the path length of traffic between the two navigation point pairs on the test map.
According to the method and the device, when the navigation point pair of the current intersection reaches the navigation point pair of the next intersection through the boundary of the test area, the number of target intersections which can reach the current intersection is increased to automatically generate the test route, the intersections in the test area on the semantic map can be fully covered to automatically generate the test route, and the test efficiency of the semantic map is improved.
In a preferred embodiment, for each intersection on the test map, the entering navigation points of the intersection and the exiting navigation points of the reachable intersection are paired one by one to generate a plurality of navigation point pairs of each intersection, specifically, for each intersection on the test map, the entering navigation points of the intersection and the exiting navigation points of the reachable intersection are paired one by one to generate a plurality of initial navigation point pairs, and an initial navigation point pair is selected from all the initial navigation point pairs on each side of the intersection as a navigation point pair to obtain a plurality of navigation point pairs.
Illustratively, after the test map is obtained, intersections located in the test area are screened out according to the coordinates of all the intersections on the semantic map, so that all the intersections on the test map are obtained. For each intersection on the test map, all the entering navigation points and all the leaving navigation points of the same intersection are found, then the arrival relation between all the entering navigation points and all the leaving navigation points of the intersection is determined according to the passing direction on the semantic map, then the entering navigation points of the intersection and the leaving navigation points of the intersection which can be reached by the entering navigation points are paired one by one to generate a plurality of initial navigation point pairs of the intersection, finally one initial navigation point pair is selected from all the initial navigation point pairs on each side of the intersection as a navigation point pair to obtain a plurality of navigation point pairs, and a plurality of navigation point pairs of each intersection are generated.
According to the embodiment, the plurality of initial navigation point pairs at each intersection are subjected to de-duplication processing to obtain the plurality of navigation point pairs, so that the data volume of subsequent traversal pairing can be reduced, the processing pressure of a server is reduced, and the testing efficiency of the semantic map is improved.
In a preferred embodiment, all the connection edges are connected in series to generate a test route according to the directed graph, specifically, a plurality of navigation point pairs of each intersection are traversed based on the directed graph, whether the navigation point pair of the current intersection does not reach the navigation point pair of the other intersection after passing through the boundary of the test area is judged, if yes, the navigation point pair of the current intersection is removed to obtain an intermediate graph, each navigation point pair of the current intersection is traversed based on the intermediate graph to be matched with each navigation point pair of the other intersection reached by the intermediate graph to obtain a plurality of third matched pairs, connection edges are added between two navigation point pairs of each third matched pair to generate a complete graph, and all the connection edges are connected in series according to the complete graph to generate the test route.
Illustratively, the middle graph is obtained by eliminating the navigation point pairs in the directed graph, which cannot return to the test area after crossing the boundary of the test area. By eliminating the navigation point pairs which cannot be returned, the interference of useless navigation point pairs can be eliminated, and the generation of an accurate test route is facilitated. Considering that only one part of navigation point pairs in the middle graph may have connection edges, and the other part of navigation point pairs have disconnection conditions, the connection edges of the part of navigation point pairs need to be completed, a complete graph is generated, all nodes are connected in series according to the complete graph, and a test route is generated.
For example, in directed graph G, the classical algorithm tarjan algorithm is used to find the strong connected component (the graph that each pair of nodes can reach each other, called the strong connected graph. And only the nodes in the strong connected component with the largest node number are left, so that the points, of which part can reach the map boundary and cannot return to the map, are removed, and an intermediate graph is obtained. And solving a single-source shortest path for each node in the intermediate graph by using a classical algorithm dijkstra to obtain the distance between each pair of nodes, and supplementing the intermediate graph into a complete graph. In order to automatically generate a test route in the left-turn, right-turn, straight-turn and u-turn directions of each intersection, the test route is required to cover all nodes in the complete graph, so that the test route is converted into a tourist problem (TRAVELLING SALESMAN problem, TSP), any intelligent algorithm (such as a genetic algorithm, an ant colony algorithm and the like) can be used for finding a shorter annular route (also called Hamiltonian loop) and all the nodes are connected in series.
According to the embodiment, the navigation point pairs which cannot be returned are removed, and then the connecting edges between the partially disconnected navigation point pairs are complemented, so that the intersections in the semantic map test area can be further covered on the whole surface, an accurate test route is automatically generated, and the improvement of the test efficiency of the semantic map is facilitated.
In a preferred embodiment, after the connection of all the connection edges according to the directed graph to connect all the nodes in series to generate a test route, the method further includes splitting the test route into a plurality of test sub-routes with test duration smaller than a preset test duration according to speed limit information of a test map and the length of the test route, so as to obtain a test route set.
As an example, considering that the generated test route may be longer, the vehicle cannot run the complete test route once to complete the test, and the driver also needs to have a rest time, after the test route is generated, the test route is split into a plurality of test sub-routes with test duration less than the preset test duration according to the speed limit information on the test map and the traffic path length of the test route, so as to obtain the test route set.
According to the embodiment, the test route is split into the plurality of test sub-routes, so that the test safety of the subsequent semantic map can be ensured.
In a preferred embodiment, after the semantic map is loaded according to the test area to obtain the test map, the method further comprises traversing each intersection in the semantic map and collecting intersections in the test area into an intersection set of the test map before pairing the entry navigation points of the intersections with the exit navigation points of the reachable intersections one by one to generate a plurality of navigation point pairs of each intersection.
As an example, according to the intersection label and intersection coordinates on the semantic map, whether each intersection on the semantic map is located in the test area is judged, if yes, the intersection is considered to be the intersection in the test area, and the intersection is collected in the intersection set of the test map.
Based on the same inventive concept as the third embodiment, a fourth embodiment of the present invention provides a semantic map-based test apparatus as shown in fig. 8, which includes a test map acquisition module 41 for loading a semantic map according to a test area to obtain a test map, a navigation point pair generation module 42 for pairing an entry navigation point of an intersection with an exit navigation point of an intersection that it can reach one by one for each intersection on the test map to generate a plurality of navigation point pairs of each intersection, a navigation point pair matching module 43 for traversing the plurality of navigation point pairs of each intersection, matching each navigation point pair of a current intersection with each navigation point pair of a next intersection that it can reach to obtain a plurality of first matching pairs, a directed graph construction module 44 for constructing a directed graph with each navigation point pair of each intersection as one node and adding a connection edge between two navigation point pairs of each first matching pair, a test route generation module 45 for connecting all the nodes in series according to the directed graph to generate a test route, and an automatic test route transmission module 46 for automatically correcting a vehicle driving test route according to the test map and obtaining test route data.
In a preferred embodiment, the navigation point pair matching module 43 is further configured to match the navigation point pair of the current intersection with each navigation point pair of the target intersection that the navigation point pair of the current intersection can reach when the boundary of the tested area reaches the navigation point pair of the next intersection, so as to obtain a plurality of second matching pairs, where the distance between the current intersection and the target intersection is smaller than the preset outside distance, and the directed graph construction module 44 is configured to use each navigation point pair of each intersection as a node, add a connection edge between two navigation point pairs in each first matching pair, and add a connection edge between two navigation point pairs in each second matching pair, so as to construct the directed graph.
In a preferred embodiment, for each intersection on the test map, the entering navigation points of the intersection and the exiting navigation points of the reachable intersection are paired one by one to generate a plurality of navigation point pairs of each intersection, specifically, for each intersection on the test map, the entering navigation points of the intersection and the exiting navigation points of the reachable intersection are paired one by one to generate a plurality of initial navigation point pairs, and an initial navigation point pair is selected from all the initial navigation point pairs on each side of the intersection as a navigation point pair to obtain a plurality of navigation point pairs.
In a preferred embodiment, all the connection edges are connected in series to generate a test route according to the directed graph, specifically, a plurality of navigation point pairs of each intersection are traversed based on the directed graph, whether the navigation point pair of the current intersection does not reach the navigation point pair of the other intersection after passing through the boundary of the test area is judged, if yes, the navigation point pair of the current intersection is removed to obtain an intermediate graph, each navigation point pair of the current intersection is traversed based on the intermediate graph to be matched with each navigation point pair of the other intersection reached by the intermediate graph to obtain a plurality of third matched pairs, connection edges are added between two navigation point pairs of each third matched pair to generate a complete graph, and all the connection edges are connected in series according to the complete graph to generate the test route.
In a preferred embodiment, after the connection of all the connection edges according to the directed graph to connect all the nodes in series to generate a test route, the method further includes splitting the test route into a plurality of test sub-routes with test duration smaller than a preset test duration according to speed limit information of a test map and the length of the test route, so as to obtain a test route set.
In a preferred embodiment, after the semantic map is loaded according to the test area to obtain the test map, the method further comprises traversing each intersection in the semantic map and collecting intersections in the test area into an intersection set of the test map before pairing the entry navigation points of the intersections with the exit navigation points of the reachable intersections one by one to generate a plurality of navigation point pairs of each intersection.
In summary, the embodiment of the invention has the following beneficial effects:
According to the method, a semantic map is loaded according to a test area to obtain a test map, for each intersection on the test map, the entering navigation points of the intersection are paired with the exiting navigation points of the intersection which can be reached by the intersection one by one to generate a plurality of navigation point pairs of each intersection, the plurality of navigation point pairs of each intersection are traversed, each navigation point pair of the current intersection is matched with each navigation point pair of the next intersection which can be reached by the current intersection to obtain a plurality of first matching pairs, each navigation point pair of each intersection is used as a node, connecting edges are added between two navigation point pairs of each first matching pair to construct a directed graph, all nodes are connected in series according to the directed graph, and a test route is generated to realize automatic generation of the test route. According to the embodiment of the invention, the marked semantic map is utilized to traverse each intersection in the test area on the semantic map, so that the left turn, right turn, straight travel and turning directions of each intersection are covered to automatically generate the test route, the intersection in the test area of the semantic map can be fully covered to automatically generate the test route, and the test efficiency of the semantic map is improved.
While the foregoing is directed to the preferred embodiments of the present invention, it will be appreciated by those skilled in the art that changes and modifications may be made without departing from the principles of the invention, such changes and modifications are also intended to be within the scope of the invention.
Those skilled in the art will appreciate that implementing all or part of the above-described embodiments may be accomplished by way of computer programs, which may be stored on a computer readable storage medium, which when executed may comprise the steps of the above-described embodiments. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a random-access Memory (Random Access Memory, RAM), or the like.