CN116383451B - Map segmentation method and device, electronic equipment and storage medium - Google Patents
Map segmentation method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN116383451B CN116383451B CN202310658601.0A CN202310658601A CN116383451B CN 116383451 B CN116383451 B CN 116383451B CN 202310658601 A CN202310658601 A CN 202310658601A CN 116383451 B CN116383451 B CN 116383451B
- Authority
- CN
- China
- Prior art keywords
- connection point
- filled
- sub
- road
- graph
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 230000011218 segmentation Effects 0.000 title claims abstract description 64
- 238000000034 method Methods 0.000 title claims abstract description 45
- 238000012545 processing Methods 0.000 claims abstract description 21
- 238000004891 communication Methods 0.000 claims description 6
- 238000000605 extraction Methods 0.000 claims description 6
- 238000004590 computer program Methods 0.000 claims description 4
- 238000004422 calculation algorithm Methods 0.000 description 18
- 238000010586 diagram Methods 0.000 description 8
- 238000006243 chemical reaction Methods 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 2
- 230000000295 complement effect Effects 0.000 description 2
- 230000007613 environmental effect Effects 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000000638 solvent extraction Methods 0.000 description 2
- 241000274965 Cyrestis thyodamas Species 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000005192 partition Methods 0.000 description 1
- 238000005295 random walk Methods 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 230000000452 restraining effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/901—Indexing; Data structures therefor; Storage structures
- G06F16/9024—Graphs; Linked lists
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/29—Geographical information databases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N5/00—Computing arrangements using knowledge-based models
- G06N5/01—Dynamic search techniques; Heuristics; Dynamic trees; Branch-and-bound
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Remote Sensing (AREA)
- Artificial Intelligence (AREA)
- Computational Linguistics (AREA)
- Evolutionary Computation (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Processing Or Creating Images (AREA)
- Instructional Devices (AREA)
Abstract
The application provides a map segmentation method, a device, electronic equipment and a storage medium, which relate to the technical field of map segmentation and comprise the following steps: for each sub-graph to be filled, the following processing is performed: determining a first difference set between a first connection point set and a second connection point set corresponding to the sub-graph to be filled; determining a target connection point from the first set of differences; filling the multi-item mark road corresponding to the target connection point in the road set to be divided into the sub-map to be filled, and deleting the multi-item mark road from the road set to be divided; constraining the roads in the sub-graph to be filled by using preset constraint conditions to finish filling the sub-graph to be filled; and finishing the segmentation processing of the map to be processed by the filled multiple sub-graphs to be filled. The application splits the subgraph of the road in the map through the integral relation between the connection point and the road, ensures the integrity of the road topological structure and improves the segmentation efficiency.
Description
Technical Field
The present application relates to the field of map segmentation technologies, and in particular, to a map segmentation method, a map segmentation device, an electronic device, and a storage medium.
Background
Map segmentation refers to the process of dividing a large-scale map data set or picture into many small blocks, and in map applications, map segmentation can help users load and view map data more quickly, while also facilitating processing and analysis of the map data.
The map segmentation method in the prior art mainly comprises the following steps:
gridding map segmentation algorithm: the map is divided into rectangular grids of fixed size, each grid typically containing the same number of pixels or geographic cells.
Navigation mesh (navigation mesh) algorithm: a complex three-dimensional space map is partitioned into one or more convex polygon areas that can be used for path planning for efficient navigation.
Graph-based road network partitioning algorithm: the graph is divided into a plurality of connected subgraphs by using a segmentation algorithm of the graph, and each subgraph represents a divided subarea.
For the gridding map segmentation algorithm and the navigation grid algorithm: the road integrity is damaged by utilizing grid division, the world coordinates of each point on the road are not given by the Opendrive format map, the conversion calculation amount is large, and the segmentation efficiency is reduced;
for graph-based road network division algorithms, only the road junction (junction) is used as a vertex for division, and the processed object is used as a vertex, so that the road integrity is also destroyed.
Disclosure of Invention
Accordingly, the present application is directed to at least a method, an apparatus, an electronic device, and a storage medium for dividing a map, wherein the method, the apparatus, the electronic device, and the storage medium divide a road in the map in a sub-graph manner through an overall relationship between a connection point and the road, so as to ensure the integrity of a road topology structure and improve the dividing efficiency.
The application mainly comprises the following aspects:
in a first aspect, an embodiment of the present application provides a map segmentation method, including: acquiring a to-be-divided road set, a to-be-divided connection point set and a plurality of to-be-filled subgraphs, wherein the to-be-divided road set comprises a plurality of roads, and the to-be-divided connection point set comprises a plurality of connection points among the plurality of roads; for each sub-graph to be filled, the following processing is performed: determining a first difference set between a first connection point set and a second connection point set corresponding to the sub-graph to be filled, wherein the first connection point set comprises a plurality of connection points covering all roads in the sub-graph to be filled, and the second connection point set comprises a plurality of connection points with all adjacent edges in the sub-graph to be filled; determining a target connection point from the first set of differences; filling the multi-item mark road corresponding to the target connection point in the road set to be divided into the sub-map to be filled, and deleting the multi-item mark road from the road set to be divided; constraining the roads in the sub-graph to be filled by using preset constraint conditions to finish filling the sub-graph to be filled; and finishing the segmentation processing of the map to be processed by the filled multiple sub-graphs to be filled.
In one possible embodiment, the step of determining the target connection point from the first set of differences comprises:
judging whether the first difference set is empty; if the first difference set is empty, determining a second difference set between the to-be-divided connection point set and the first connection point set; randomly extracting a connection point from a plurality of connection points corresponding to the second difference set according to the extraction probability corresponding to each connection point in the second difference set to determine the connection point as a target connection point; if the first difference set is not empty, determining, for each connection point in the first difference set, a target number of adjacent connection points for the connection point in the second difference set; the connection point in the first difference set with the smallest number of target adjacent connection points is determined as the target connection point.
In one possible implementation manner, the target roads include a first target road and a second target road, wherein a plurality of target roads corresponding to target connection points in the road set to be divided are filled into each sub-graph to be filled by the following ways: respectively merging the target connection points corresponding to the sub-graph to be filled into a first connection point set and a second connection point set; merging a plurality of target adjacent connection points corresponding to the target connection points into a first connection point set; and for each target adjacent connection point, merging a first target road corresponding to the target adjacent connection point and the target connection point and a second target road corresponding to the target adjacent connection point and each connection point in the first connection point set into the sub-graph to be filled.
In one possible implementation manner, the step of constraining the road in the sub-graph to be filled by using a preset constraint condition to complete filling of the sub-graph to be filled includes: obtaining the number of roads and the weight sum of the roads corresponding to the subgraph to be filled; respectively judging whether the number of roads corresponding to the sub-graph to be filled is smaller than a preset road number and a road weight sum is smaller than a first balance factor, wherein the preset road number is the ratio between the product of a second balance factor and the total road number corresponding to the map to be processed and the number of the sub-graph to be filled; if the number of roads corresponding to the sub-graph to be filled is smaller than the preset road number, the road weight and the first balance factor, determining that the sub-graph to be filled meets the preset constraint condition, and returning to execute the first difference set to determine a target connection point; if the number of roads corresponding to the sub-graph to be filled is greater than the preset road number and/or the road weight sum is greater than the first balance factor, determining that the sub-graph to be filled does not meet the preset constraint condition, and completing filling of the sub-graph to be filled.
In one possible implementation, after completing the filling of each sub-graph to be filled, the method further includes: judging whether the road set to be divided is empty or not; if the road set to be divided is empty, directly completing the segmentation processing of the map to be processed; and if the road set to be divided is not empty, reassigning the rest roads in the road set to be divided until the road set to be divided is empty.
In one possible embodiment, the remaining roads in the set of roads to be divided are reassigned by: if the first difference set corresponding to each sub-graph to be filled is empty, randomly selecting one sub-graph to be filled from the plurality of sub-graphs to be filled, and randomly selecting one connection point to be filled from all connection points contained in the rest roads of the road set to be divided; and filling the multi-item mark roads corresponding to the target connection points in the road set to be divided into target sub-images to be filled.
In one possible implementation, for each sub-graph to be filled, the following process is performed: and if the first difference set corresponding to the sub-graph to be filled is not empty, determining a target connection point from the first difference set so as to fill the multi-item target road corresponding to the target connection point in the road set to be divided into the sub-graph to be filled.
In a second aspect, an embodiment of the present application further provides a map segmentation apparatus, including: the first acquisition module is used for acquiring a road set to be divided, a connection point set to be divided and a plurality of sub-graphs to be filled, wherein the road set to be divided corresponds to the map to be processed, the road set to be divided comprises a plurality of roads, and the connection point set to be divided comprises a plurality of connection points among the plurality of roads; the first determining module is used for determining a first difference set between a first connection point set and a second connection point set corresponding to each sub-graph to be filled, wherein the first connection point set comprises a plurality of connection points covering all roads in the sub-graph to be filled, and the second connection point set comprises a plurality of connection points with all adjacent edges in the sub-graph to be filled; the second determining module is used for determining a target connection point from the first difference set aiming at each sub-graph to be filled; the first filling module is used for filling the multi-item mark roads corresponding to the target connection points in the road set to be divided into the sub-images to be filled according to each sub-image to be filled, and deleting the multi-item mark roads from the road set to be divided; the constraint module is used for constraining the roads in each sub-graph to be filled by utilizing preset constraint conditions so as to finish filling the sub-graph to be filled; and the second filling module is used for completing the segmentation processing of the map to be processed by the filled multiple sub-images to be filled.
In a third aspect, an embodiment of the present application further provides an electronic device, including: a processor, a memory and a bus, the memory storing machine readable instructions executable by the processor, the processor and the memory in communication via the bus when the electronic device is running, the machine readable instructions when executed by the processor performing the steps of the map segmentation method as described in the first aspect or any of the possible implementation manners of the first aspect.
In a fourth aspect, the present embodiment further provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor performs the steps of the map segmentation method described in the first aspect or any possible implementation manner of the first aspect.
The map segmentation method, the map segmentation device, the electronic equipment and the storage medium provided by the embodiment of the application comprise the following steps: for each sub-graph to be filled, the following processing is performed: determining a first difference set between a first connection point set and a second connection point set corresponding to the sub-graph to be filled; determining a target connection point from the first set of differences; filling the multi-item mark road corresponding to the target connection point in the road set to be divided into the sub-map to be filled, and deleting the multi-item mark road from the road set to be divided; constraining the roads in the sub-graph to be filled by using preset constraint conditions to finish filling the sub-graph to be filled; and finishing the segmentation processing of the map to be processed by the filled multiple sub-graphs to be filled. The application splits the subgraph of the road in the map through the integral relation between the connection point and the road, ensures the integrity of the road topological structure and improves the segmentation efficiency.
The application has the advantages that:
1. the rapid processing of the map data in the Opendrive format is realized, and the map segmentation efficiency is improved;
2. maintaining road integrity and road topology integrity (e.g., intersections tend to be divided on the same map);
3. and ensuring the load balance of the split small map.
In order to make the above objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 shows a flowchart of a map segmentation method according to an embodiment of the present application;
FIG. 2 shows a schematic diagram of a G (V, E) format provided by an embodiment of the present application;
fig. 3 is a schematic structural diagram of a map segmentation apparatus according to an embodiment of the present application;
Fig. 4 shows a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described with reference to the accompanying drawings in the embodiments of the present application, and it should be understood that the drawings in the present application are for the purpose of illustration and description only and are not intended to limit the scope of the present application. In addition, it should be understood that the schematic drawings are not drawn to scale. A flowchart, as used in this disclosure, illustrates operations implemented according to some embodiments of the present application. It should be appreciated that the operations of the flow diagrams may be implemented out of order and that steps without logical context may be performed in reverse order or concurrently. Moreover, one or more other operations may be added to or removed from the flow diagrams by those skilled in the art under the direction of the present disclosure.
In addition, the described embodiments are only some, but not all, embodiments of the application. The components of the embodiments of the present application generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the application, as presented in the figures, is not intended to limit the scope of the application, as claimed, but is merely representative of selected embodiments of the application. All other embodiments, which can be made by a person skilled in the art based on embodiments of the application without making any inventive effort, fall within the scope of the application.
For an environmental vehicle of 10 ten thousand units of traffic flow/virtual city to run on a map, simulation software needs to divide the map for performance reasons to simulate rendering in parallel. The specific description is as follows: given an arbitrary large map (such as an Opendrive standard format), the map is uniformly divided into K sub-graphs, so that points at any position (the position of a traffic vehicle given by software such as Vissim) can quickly query the number of the sub-graph where the map is located.
In the prior art, the research work of the map segmentation algorithm is mainly divided into the following methods:
1. gridding map segmentation algorithm: is a common map segmentation method that segments a map into multiple regular grids for efficient data loading and processing. The algorithm generally includes the steps of: gridding, dividing the map into rectangular grids of fixed size, each grid typically containing the same number of pixels or geographic cells; grid index: each grid is numbered and an index table is built to quickly access the data of each grid.
2. Navigation grid algorithm: the map segmentation algorithm is used for the fields of game development, robot navigation, virtual reality and the like, and mainly aims to segment a complex three-dimensional space map into one or more convex polygon areas which can be used for path planning so as to perform efficient navigation.
3. Graph-based road network partitioning algorithm: an algorithm for dividing a road grid into subregions with certain attributes is characterized in that the road grid is expressed as a graph by using a graph theory method, the road grid is divided into a plurality of connected subgraphs by using a graph dividing algorithm, and each subgraph represents a divided subregion. Ali Kemal Sinop first aggregates the highly connected road ports by performing random walk, and then uniformly partitions the road network into two parts using inertial flow algorithm.
Map segmentation by a gridding algorithm/navigation grid, the drawbacks of which include:
the Opendrive format map does not give world coordinates of each point on the road, and the conversion calculation amount is large;
b. grid division will destroy the road integrity, and the environmental vehicle jumps back and forth between different small maps;
c. it is difficult to control traffic flow of different grids, creating a data imbalance problem.
The road network dividing algorithm based on the graph has the following defects:
A. dividing by using a road connection point (junction) as a vertex, and damaging the integrity of the road by using a processed object as the vertex;
B. focusing on road communication among different divided areas, and not restricting the load and flow in the same area;
C. The different areas after division can generate larger differences (such as road number and other information).
Based on this, the embodiment of the application provides a map segmentation method, a device, an electronic device and a storage medium, wherein the sub-graph splitting is performed on the roads in the map through the integral relation between the connection points and the roads, so that the road topology structural integrity is ensured, and the segmentation efficiency is improved, and the method specifically comprises the following steps:
referring to fig. 1, fig. 1 shows a flowchart of a map segmentation method according to an embodiment of the present application. As shown in fig. 1, the map segmentation method provided by the embodiment of the application includes the following steps:
s100, acquiring a road set to be divided, a connection point set to be divided and a plurality of sub-graphs to be filled, which correspond to a map to be processed.
In the application, the map to be processed is in an open format, the map to be processed in the open format can be converted into a data format of a graph G (V, E) according to the connection point (junction) attribute and the road attribute,representing a set of connection points to be divided, E representing a set of roads to be divided, the set of roads to be divided E comprising a plurality of roads, the set of connection points to be divided +.>Including multiple connection points between multiple roads.
According to the application, the map is directly segmented based on the Opendrive format, so that the data conversion cost is reduced, and the segmentation efficiency is improved.
Referring to fig. 2, fig. 2 shows a schematic diagram of a G (V, E) format according to an embodiment of the application. In FIG. 2, the road system comprises a plurality of roads L1-L12 and a plurality of connection points T1-T12 corresponding to the roads L1-L12.
S200, determining a first difference set between a first connection point set and a second connection point set corresponding to each sub-graph to be filled.
The first connection point set comprises a plurality of connection points covering all roads in the sub-graph to be filled, and the second connection point set comprises a plurality of connection points with all adjacent edges in the sub-graph to be filled.
In one embodiment, for the firstFirst connection point set corresponding to sub-graph to be filled +.>Wherein->Indicate->Opening a road set in a sub-graph to be filled, +.>I.e. indicate the overlay->First connection point set formed by a plurality of connection points of all roads in the sub-map to be filled +.>,/>Then indicate +.>The second set of connection points corresponding to the sub-graph to be filled, the first difference set can be expressed as +.>。
In the embodiment, if the firstFirst connection point set corresponding to sub-graph to be filled +.>All roads in->Comprising a road L1 and a roadRoad L2 and road L3, first connection point set +. >Comprising a connection point T1, a connection point T2, a connection point T3 and a connection point T4, a second connection point set +.>Including connection point T1, connection point T2, and connection point T3, then the first difference set includes connection point T4.
In the method, after a plurality of sub-images to be filled are obtained, a first connection point set, a second connection point set and a road set corresponding to each sub-image to be filled are initialized to be empty, and then each sub-image to be filled is filled.
S300, determining target connection points from the first difference set for each sub-graph to be filled.
In a preferred embodiment, the step of determining the target connection point from the first set of differences comprises:
and judging whether the first difference set is empty, if the first difference set is empty, determining a second difference set between the to-be-divided connection point set and the first connection point set, and randomly extracting a connection point from a plurality of connection points corresponding to the second difference set according to the extraction probability corresponding to each connection point in the second difference set to determine the connection point as a target connection point.
Specifically, if the first difference set corresponding to the sub-graph to be filled is empty, it is stated that, for each connection point in the sub-graph to be filled, all adjacent edges related to the connection point are in the sub-graph to be filled or the sub-graph to be filled is not yet filled at the moment, at this moment, one needs to be extracted from the second difference set between the connection point set to be divided and the first connection point set as a target connection point, where the extraction probability = corresponding to each connection point in the second difference set Representing the number of contiguous connection points of the connection point T.
If the first difference set is not empty, determining the number of target adjacent connection points of the connection point in the second difference set for each connection point in the first difference set, and determining the connection point with the minimum number of target adjacent connection points in the first difference set as the target connection point.
Wherein for each connection point in the first difference set, a portion of its corresponding plurality of adjacent connection points may already exist in the first difference set, and the target adjacent connection point refers to an adjacent connection point existing in the second difference set, and the intersection between the first difference set and the second difference set is always empty.
If at firstFirst connection point set corresponding to sub-graph to be filled +.>Comprising a junction T6 and a junction T7, a second junction set +.>If the first difference set is empty, the first difference set includes a connection point T6 and a connection point T7, that is, the first difference set is not empty, the number of adjacent connection points corresponding to the connection point T6 is 1, the number of target adjacent connection points is also 1, the number of adjacent connection points corresponding to the connection point T7 is 2, and the number of target adjacent connection points is also 2, and then the connection point T6 is determined as the target connection point.
S400, filling the multi-item target roads corresponding to the target connection points in the road set to be divided into the sub-map to be filled according to each sub-map to be filled, and deleting the multi-item target roads from the road set to be divided.
In a preferred embodiment, the target roads include a first target road and a second target road, and the multiple target roads corresponding to the target connection points in the road set to be divided are filled into each sub-graph to be filled by:
and respectively merging the target connection points corresponding to the sub-graph to be filled into a first connection point set and a second connection point set, merging a plurality of target adjacent connection points corresponding to the target connection points into the first connection point set, and merging a first target road corresponding to each target adjacent connection point and each target connection point and a second target road corresponding to each target adjacent connection point and each connection point in the first connection point set into the sub-graph to be filled.
Specifically, after the multiple target adjacent connection points are integrated into the first connection point set, at this time, for each target adjacent connection point, if a road exists between each connection point in the target connection point or the first connection point set and the target adjacent connection point, the road is added to the road set corresponding to the sub-graph to be filled, that is, each time the target connection point is added to the second connection point set, all the roads (including the first target road and the second target road) related to the target connection point are also added to the road set corresponding to the sub-graph to be filled, so that the topology structure of the road intersection is helped to be maintained.
As in the above embodiment, for the target connection point T6, the target adjacent connection point T5 corresponding to the target connection point T6 is incorporated into the firstIn the sub-graph to be filled, T5 is simultaneously incorporated in the +.>First connection point set corresponding to sub-graph to be filled +.>And a second set of connection points->Then the road L5 between the target adjacent connection points T5 corresponding to the target connection point T6 is incorporated +.>Road set corresponding to sub-graph to be filled>Is a kind of medium.
S500, restraining the roads in each sub-graph to be filled by using preset constraint conditions so as to finish filling the sub-graph to be filled.
In a preferred embodiment, step S500 includes:
acquiring the number of roads and the sum of road weights corresponding to the sub-graph to be filled, respectively judging whether the number of roads and the sum of road weights corresponding to the sub-graph to be filled are smaller than a preset road number and a first balance factor, if the number of roads corresponding to the sub-graph to be filled is smaller than the preset road number, the sum of road weights and the first balance factor, determining that the sub-graph to be filled meets a preset constraint condition, and returning to execute the sub-graph to be filled from the first difference set to determine a target connection point; if the number of roads corresponding to the sub-graph to be filled is greater than the preset road number and/or the road weight sum is greater than the first balance factor, determining that the sub-graph to be filled does not meet the preset constraint condition, and completing filling of the sub-graph to be filled.
The preset road number is the ratio between the product of the second equalization factor and the total road number corresponding to the map to be processed and the number of sub-images to be filled, specifically, for the ith sub-image to be filled, the constraint corresponding to the preset road number can be expressed as judgment:
wherein,,representing the number of roads in the ith sub-graph to be filled, < +.>The number of the preset road ways is indicated,
representing a second equalization factor, ">Representing the total road number corresponding to the map to be processed, K represents the sub-map to be filledNumber of parts.
For road weights and corresponding constraints, this can be expressed as a decision:
wherein,,representing the weight corresponding to the road between the connection point m and the connection point n in the ith sub-graph to be filled,the road weight sum corresponding to the road set representing the ith sub-graph to be filled, +.>Representing a first equalization factor.
If the sub-graph to be filled meets the preset constraint condition, the method can return to the step S300 if the space available for filling exists in the sub-graph to be filled, and if the sub-graph to be filled does not meet the preset constraint condition, the method can finish filling of the sub-graph to be filled.
The method and the device can ensure that the sub-graph to be filled obtained by final segmentation is in a load balance state through the constraint condition.
In a preferred embodiment, after completing the filling of each sub-graph to be filled, the method further comprises:
judging whether the road set to be divided is empty or not, if the road set to be divided is empty, directly completing the segmentation processing of the map to be processed, and if the road set to be divided is not empty, reassigning the rest roads in the road set to be divided until the road set to be divided is empty.
After all the sub-graphs to be filled meet the corresponding preset constraint conditions, unallocated roads may still exist in the road set to be divided, and division and complementation are needed for the unallocated roads, namely the unallocated roads are divided into the corresponding sub-graphs to be filled, so that the allocation of all the roads in the map to be processed is completed.
In another preferred embodiment, the remaining roads in the set of roads to be divided are reassigned by:
and if the first difference set corresponding to each sub-graph to be filled is empty, randomly selecting one sub-graph to be filled which is determined to be a target sub-graph to be filled from the plurality of sub-graphs to be filled, randomly selecting one connection point which is determined to be a target connection point from all connection points contained in the rest roads of the road set to be divided, and filling the multi-item target roads corresponding to the target connection points in the road set to be divided into the target sub-graph to be filled.
In a preferred embodiment, for each sub-graph to be filled, the following is performed:
and if the first difference set corresponding to the sub-graph to be filled is not empty, executing to determine a target connection point from the first difference set so as to fill the multi-item target road corresponding to the target connection point in the road set to be divided into the sub-graph to be filled.
Specifically, if the sub-graph to be filled does not meet the preset constraint condition and the first difference set is not empty, all roads corresponding to the connection points in the first difference set are integrated into the sub-graph to be filled under the condition that the preset constraint condition is not considered, so that the integrity of the sub-graph to be filled is ensured.
S600, completing the segmentation processing of the map to be processed by the filled multiple sub-graphs to be filled.
Based on the same application conception, the embodiment of the application also provides a map segmentation device corresponding to the map segmentation method provided by the embodiment, and because the principle of solving the problem of the device in the embodiment of the application is similar to that of the map segmentation method of the embodiment of the application, the implementation of the device can be referred to the implementation of the method, and the repetition is omitted.
Referring to fig. 3, fig. 3 is a schematic structural diagram of a map segmentation apparatus according to an embodiment of the present application. As shown in fig. 3, the map dividing apparatus includes:
The first obtaining module 700 is configured to obtain a to-be-divided road set, a to-be-divided connection point set and a plurality of to-be-filled subgraphs, where the to-be-divided road set corresponds to the to-be-processed map, and the to-be-divided connection point set includes a plurality of roads and a plurality of connection points between the plurality of roads.
The first determining module 710 is configured to determine, for each sub-graph to be filled, a first difference set between a first connection point set and a second connection point set corresponding to the sub-graph to be filled, where the first connection point set includes a plurality of connection points covering all roads in the sub-graph to be filled, and the second connection point set includes a plurality of connection points where all adjacent edges are in the sub-graph to be filled.
A second determining module 720, configured to determine, for each sub-graph to be filled, a target connection point from the first difference set.
The first filling module 730 is configured to fill, for each sub-graph to be filled, multiple target roads corresponding to the target connection point in the road set to be divided into the sub-graph to be filled, and delete the multiple target roads from the road set to be divided.
The constraint module 740 is configured to constrain, for each sub-graph to be filled, a road in the sub-graph to be filled by using a preset constraint condition, so as to complete filling of the sub-graph to be filled.
The second filling module 750 completes the segmentation processing of the map to be processed by the filled multiple sub-graphs to be filled.
Preferably, the second determining module 720 is further configured to: judging whether the first difference set is empty;
if the first difference set is empty, a second difference set between the to-be-divided connection point set and the first connection point set is determined, and according to the extraction probability corresponding to each connection point in the second difference set, a connection point is randomly extracted from a plurality of connection points corresponding to the second difference set to be determined as a target connection point;
if the first difference set is not empty, determining the number of target adjacent connection points of the connection point in the second difference set for each connection point in the first difference set, and determining the connection point with the minimum number of target adjacent connection points in the first difference set as the target connection point.
Preferably, the target link includes a first target link and a second target link, and the first filling module 730 is further configured to:
respectively merging target connection points corresponding to the sub-graph to be filled into a first connection point set and a second connection point set, and merging a plurality of target adjacent connection points corresponding to the target connection points into the first connection point set; and for each target adjacent connection point, merging a first target road corresponding to the target adjacent connection point and the target connection point and a second target road corresponding to the target adjacent connection point and each connection point in the first connection point set into the sub-graph to be filled.
Preferably, the constraint module 740 is further configured to:
obtaining the number of roads and the weight sum of the roads corresponding to the subgraph to be filled;
and respectively judging whether the number of roads corresponding to the sub-image to be filled is smaller than a preset road number and a road weight sum and smaller than a first balance factor, wherein the preset road number is the ratio between the product of the second balance factor and the total road number corresponding to the map to be processed and the number of the sub-image to be filled, if the number of roads corresponding to the sub-image to be filled is smaller than the preset road number, the road weight sum and smaller than the first balance factor, determining that the sub-image to be filled meets the preset constraint condition, returning to execute the first difference set, determining a target connection point, and if the number of roads corresponding to the sub-image to be filled is larger than the preset road number and/or the road weight sum and larger than the first balance factor, determining that the sub-image to be filled does not meet the preset constraint condition, and finishing filling the sub-image to be filled.
The map segmentation apparatus further includes a segmentation completion module (not shown in the figure) for:
judging whether the road set to be divided is empty or not, if the road set to be divided is empty, directly completing the segmentation processing of the map to be processed, and if the road set to be divided is not empty, reassigning the rest roads in the road set to be divided until the road set to be divided is empty.
Preferably, the division complement module is further configured to:
if the first difference set corresponding to each sub-graph to be filled is empty, randomly selecting one sub-graph to be filled from the plurality of sub-graphs to be filled, and randomly selecting one connection point to be filled from all connection points contained in the rest roads of the road set to be divided;
and filling the multi-item mark roads corresponding to the target connection points in the road set to be divided into target sub-images to be filled.
Preferably, the division complement module is further configured to: for each sub-graph to be filled: and if the first difference set corresponding to the sub-graph to be filled is not empty, determining a target connection point from the first difference set so as to fill the multi-item target road corresponding to the target connection point in the road set to be divided into the sub-graph to be filled.
Based on the same application concept, referring to fig. 4, fig. 4 shows a schematic structural diagram of an electronic device provided by an embodiment of the present application, and the electronic device 800 includes: a processor 810, a memory 820 and a bus 830, the memory 820 storing machine-readable instructions executable by the processor 810, the processor 810 and the memory 820 communicating via the bus 830 when the electronic device 800 is running, the machine-readable instructions being executed by the processor 810 to perform the steps of the map segmentation method as provided in the embodiments above.
Based on the same application concept, the embodiment of the present application also provides a computer readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the steps of the map segmentation method provided in the above embodiment are executed.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described system and apparatus may refer to corresponding procedures in the foregoing method embodiments, which are not described herein again. In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. The above-described apparatus embodiments are merely illustrative, for example, the division of the units is merely a logical function division, and there may be other manners of division in actual implementation, and for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some communication interface, device or unit indirect coupling or communication connection, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of 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.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer readable storage medium executable by a processor. Based on this understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely illustrative of the present application, and the present application is not limited thereto, and any person skilled in the art will readily appreciate variations or alternatives within the scope of the present application. Therefore, the protection scope of the application is subject to the protection scope of the claims.
Claims (6)
1. A map segmentation method, the method comprising:
acquiring a to-be-divided road set, a to-be-divided connection point set and a plurality of to-be-filled subgraphs, wherein the to-be-divided road set comprises a plurality of roads, and the to-be-divided connection point set comprises a plurality of connection points among the plurality of roads;
for each sub-graph to be filled, the following processing is performed:
determining a first difference set between a first connection point set and a second connection point set corresponding to the sub-graph to be filled, wherein the first connection point set comprises a plurality of connection points covering all roads in the sub-graph to be filled, and the second connection point set comprises a plurality of connection points with all adjacent connection edges in the sub-graph to be filled;
determining a target connection point from the first set of differences;
Filling the multi-item target road corresponding to the target connection point in the road set to be divided into the sub-graph to be filled, and deleting the multi-item target road from the road set to be divided;
constraining the roads in the sub-graph to be filled by using preset constraint conditions to finish filling the sub-graph to be filled;
completing the segmentation processing of the map to be processed by the filled multiple sub-graphs to be filled;
wherein the step of determining a target connection point from the first difference set comprises:
judging whether the first difference set is empty;
if the first difference set is empty, determining a second difference set between the to-be-divided connection point set and the first connection point set;
randomly extracting a connection point from a plurality of connection points corresponding to the second difference set according to the extraction probability corresponding to each connection point in the second difference set to determine the connection point as a target connection point;
if the first difference set is not empty, determining, for each connection point in the first difference set, a target number of adjacent connection points for the connection point in the second difference set;
determining the connection point with the least number of target adjacent connection points in the first difference set as a target connection point;
The target links include a first target link and a second target link,
the method comprises the following steps of filling a plurality of target roads corresponding to the target connection point in the road set to be divided into each sub-graph to be filled:
respectively merging the target connection points corresponding to the sub-graph to be filled into the first connection point set and the second connection point set;
merging a plurality of target adjacent connection points corresponding to the target connection points into the first connection point set;
for each target adjacent connection point, merging a first target road corresponding to the target adjacent connection point and the target connection point and a second target road corresponding to the target adjacent connection point and each connection point in the first connection point set into the sub-graph to be filled;
the step of constraining the roads in the sub-graph to be filled by using the preset constraint condition to complete filling of the sub-graph to be filled comprises the following steps:
obtaining the number of roads and the weight sum of the roads corresponding to the subgraph to be filled;
respectively judging whether the number of roads corresponding to the sub-graph to be filled is smaller than a preset road number and whether the sum of the road weights is smaller than a first balance factor, wherein the preset road number is the ratio between the product of a second balance factor and the total road number corresponding to the map to be processed and the number of the sub-graph to be filled;
If the number of roads corresponding to the sub-graph to be filled is smaller than the preset road number, the road weight and the first balance factor, determining that the sub-graph to be filled meets the preset constraint condition, and returning to execute the first difference set to determine a target connection point;
if the number of roads corresponding to the sub-graph to be filled is greater than a preset road number and/or the sum of the road weights is greater than a first balance factor, determining that the sub-graph to be filled does not meet a preset constraint condition, and completing filling of the sub-graph to be filled;
after completing the filling of each sub-graph to be filled, the method further comprises:
judging whether the road set to be divided is empty or not;
if the road set to be divided is empty, directly completing the segmentation processing of the map to be processed;
and if the road set to be divided is not empty, reassigning the rest roads in the road set to be divided until the road set to be divided is empty.
2. The method of claim 1, wherein the remaining roads in the set of roads to be partitioned are reassigned by:
if the first difference set corresponding to each sub-graph to be filled is empty, randomly selecting one sub-graph to be filled from a plurality of sub-graphs to be filled, and randomly selecting one connection point to be filled from all connection points contained in the rest roads of the road set to be divided, wherein the connection point is determined as a target connection point;
And filling the multi-item target road corresponding to the target connection point in the road set to be divided into the target sub-graph to be filled.
3. The method according to claim 2, characterized in that for each sub-graph to be filled the following is performed:
and if the first difference set corresponding to the sub-graph to be filled is not empty, executing the first difference set, and determining a target connection point so as to fill the multi-item target road corresponding to the target connection point in the road set to be divided into the sub-graph to be filled.
4. A map segmentation apparatus, the apparatus comprising:
the first acquisition module is used for acquiring a road set to be divided, a connection point set to be divided and a plurality of sub-graphs to be filled, wherein the road set to be divided corresponds to a map to be processed, the road set to be divided comprises a plurality of roads, and the connection point set to be divided comprises a plurality of connection points among the plurality of roads;
the first determining module is used for determining a first difference set between a first connection point set and a second connection point set corresponding to each sub-graph to be filled, wherein the first connection point set comprises a plurality of connection points covering all roads in the sub-graph to be filled, and the second connection point set comprises a plurality of connection points with all adjacent edges in the sub-graph to be filled;
A second determining module, configured to determine, for each sub-graph to be filled, a target connection point from the first difference set;
the first filling module is used for filling the multi-item target roads corresponding to the target connection points in the road set to be divided into the sub-images to be filled for each sub-image to be filled, and deleting the multi-item target roads from the road set to be divided;
the constraint module is used for constraining the roads in each sub-graph to be filled by utilizing preset constraint conditions so as to finish filling the sub-graph to be filled;
the second filling module is used for completing the segmentation processing of the map to be processed by the filled multiple sub-graphs to be filled;
wherein the second determining module is further configured to:
judging whether the first difference set is empty;
if the first difference set is empty, determining a second difference set between the to-be-divided connection point set and the first connection point set;
randomly extracting a connection point from a plurality of connection points corresponding to the second difference set according to the extraction probability corresponding to each connection point in the second difference set to determine the connection point as a target connection point;
if the first difference set is not empty, determining, for each connection point in the first difference set, a target number of adjacent connection points for the connection point in the second difference set;
Determining the connection point with the least number of target adjacent connection points in the first difference set as a target connection point;
the target links include a first target link and a second target link,
wherein the first filling module is further configured to:
respectively merging the target connection points corresponding to the sub-graph to be filled into the first connection point set and the second connection point set;
merging a plurality of target adjacent connection points corresponding to the target connection points into the first connection point set;
for each target adjacent connection point, merging a first target road corresponding to the target adjacent connection point and the target connection point and a second target road corresponding to the target adjacent connection point and each connection point in the first connection point set into the sub-graph to be filled;
the constraint module is also for:
obtaining the number of roads and the weight sum of the roads corresponding to the subgraph to be filled;
respectively judging whether the number of roads corresponding to the sub-graph to be filled is smaller than a preset road number and whether the sum of the road weights is smaller than a first balance factor, wherein the preset road number is the ratio between the product of a second balance factor and the total road number corresponding to the map to be processed and the number of the sub-graph to be filled;
If the number of roads corresponding to the sub-graph to be filled is smaller than the preset road number, the road weight and the first balance factor, determining that the sub-graph to be filled meets the preset constraint condition, and returning to execute the first difference set to determine a target connection point;
if the number of roads corresponding to the sub-graph to be filled is greater than a preset road number and/or the sum of the road weights is greater than a first balance factor, determining that the sub-graph to be filled does not meet a preset constraint condition, and completing filling of the sub-graph to be filled;
the map segmentation module further comprises a segmentation completion module, wherein the segmentation completion module is used for:
judging whether the road set to be divided is empty or not;
if the road set to be divided is empty, directly completing the segmentation processing of the map to be processed;
and if the road set to be divided is not empty, reassigning the rest roads in the road set to be divided until the road set to be divided is empty.
5. An electronic device, comprising: a processor, a memory and a bus, the memory storing machine readable instructions executable by the processor, the processor and the memory in communication via the bus when the electronic device is running, the machine readable instructions when executed by the processor performing the steps of the map segmentation method according to any one of claims 1 to 3.
6. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a computer program which, when executed by a processor, performs the steps of the map segmentation method as defined in any one of claims 1 to 3.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310658601.0A CN116383451B (en) | 2023-06-06 | 2023-06-06 | Map segmentation method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310658601.0A CN116383451B (en) | 2023-06-06 | 2023-06-06 | Map segmentation method and device, electronic equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN116383451A CN116383451A (en) | 2023-07-04 |
CN116383451B true CN116383451B (en) | 2023-08-18 |
Family
ID=86975452
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310658601.0A Active CN116383451B (en) | 2023-06-06 | 2023-06-06 | Map segmentation method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116383451B (en) |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2010217459A (en) * | 2009-03-17 | 2010-09-30 | Nec Corp | Device, system, program, and method for managing road network diagram |
CN105222793A (en) * | 2015-10-23 | 2016-01-06 | 华中科技大学 | A kind of city stratification region partitioning method based on map vector data model |
CN107564098A (en) * | 2017-08-17 | 2018-01-09 | 中山大学 | A kind of Fast rendering method of big Local Area Network three-dimensional noise map |
CN110083670A (en) * | 2019-03-26 | 2019-08-02 | 长安大学 | A kind of map grid division methods based on section density |
CN110827048A (en) * | 2018-08-08 | 2020-02-21 | 菜鸟智能物流控股有限公司 | Geographic region segmentation method and device based on road network and electronic equipment |
CN113066150A (en) * | 2020-01-02 | 2021-07-02 | 沈阳美行科技有限公司 | Map data processing method, device, equipment and storage medium |
CN114581620A (en) * | 2022-02-25 | 2022-06-03 | 腾讯科技(深圳)有限公司 | Road virtual elevation generation method and device, computer equipment and storage medium |
CN115408410A (en) * | 2022-08-30 | 2022-11-29 | 合肥四维图新科技有限公司 | Method, device and equipment for matching electronic map data and map acquisition data |
CN115509141A (en) * | 2022-09-13 | 2022-12-23 | 深圳市无限动力发展有限公司 | Map segmentation method, device and equipment |
-
2023
- 2023-06-06 CN CN202310658601.0A patent/CN116383451B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2010217459A (en) * | 2009-03-17 | 2010-09-30 | Nec Corp | Device, system, program, and method for managing road network diagram |
CN105222793A (en) * | 2015-10-23 | 2016-01-06 | 华中科技大学 | A kind of city stratification region partitioning method based on map vector data model |
CN107564098A (en) * | 2017-08-17 | 2018-01-09 | 中山大学 | A kind of Fast rendering method of big Local Area Network three-dimensional noise map |
CN110827048A (en) * | 2018-08-08 | 2020-02-21 | 菜鸟智能物流控股有限公司 | Geographic region segmentation method and device based on road network and electronic equipment |
CN110083670A (en) * | 2019-03-26 | 2019-08-02 | 长安大学 | A kind of map grid division methods based on section density |
CN113066150A (en) * | 2020-01-02 | 2021-07-02 | 沈阳美行科技有限公司 | Map data processing method, device, equipment and storage medium |
CN114581620A (en) * | 2022-02-25 | 2022-06-03 | 腾讯科技(深圳)有限公司 | Road virtual elevation generation method and device, computer equipment and storage medium |
CN115408410A (en) * | 2022-08-30 | 2022-11-29 | 合肥四维图新科技有限公司 | Method, device and equipment for matching electronic map data and map acquisition data |
CN115509141A (en) * | 2022-09-13 | 2022-12-23 | 深圳市无限动力发展有限公司 | Map segmentation method, device and equipment |
Also Published As
Publication number | Publication date |
---|---|
CN116383451A (en) | 2023-07-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Müller et al. | Area-patch generalisation: a competitive approach | |
EP3951321B1 (en) | Method, system, terminal, and storage medium for rapid generation of reference lines | |
CN113112603B (en) | Method and device for optimizing three-dimensional model | |
US20170116780A1 (en) | Method for rendering terrain | |
CN112329789B (en) | Point cloud extraction method and device, computer equipment and storage medium | |
CN110135014B (en) | Automatic modeling method and device for linear road elements | |
CN110368694A (en) | Data processing method, device, equipment and the readable storage medium storing program for executing of scene of game | |
CN110428386B (en) | Map grid merging method and device, storage medium and electronic device | |
CN113034663A (en) | GIM model lightweight processing method, device, equipment and storage medium | |
CN111429560A (en) | Three-dimensional terrain service fusion method and device and server | |
CN114463499B (en) | Building three-dimensional modeling method and device | |
CN114359231A (en) | Parking space detection method, device, equipment and storage medium | |
CN116383451B (en) | Map segmentation method and device, electronic equipment and storage medium | |
JP2017156251A (en) | Topographic variation point extraction system and topographic variation point extraction method | |
CN116246069B (en) | Method and device for self-adaptive terrain point cloud filtering, intelligent terminal and storage medium | |
CN112269848A (en) | Crowdsourcing trajectory data fusion method and device | |
CN115779424B (en) | Navigation grid path finding method, device, equipment and medium | |
KR101947646B1 (en) | Method for processing road information and method for simulating virtual combat simulation | |
Namouchi et al. | Piecewise horizontal 3d roof reconstruction from aerial lidar | |
JP6634769B2 (en) | Voxel processing method, voxel processing program and information processing apparatus | |
CN115269600A (en) | Airplane data management method and device, electronic equipment and storage medium | |
CN113658338A (en) | Point cloud tree monomer segmentation method and device, electronic equipment and storage medium | |
CN110610544A (en) | Drilling data thinning method and device, equipment and storage medium | |
CN111790152A (en) | Method and device for loading object in scene, storage medium and electronic equipment | |
CN116628828B (en) | Method, medium and system for determining dismantling points of large building |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |