Graph subdivision method and device based on road attributes, computer equipment and medium

By considering the road attributes in navigation path planning to adjust the weight of the graph structure, the problem of inaccurate segmentation results caused by only considering the road length in the prior art is solved, and the navigation calculation performance is improved.

CN119803496APending Publication Date: 2025-04-11上海依时派运输有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411959946.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

The PUNCH algorithm used in navigation path planning in the prior art only considers the length attributes of the road and lacks consideration of other road attributes, resulting in a large difference between the classification results and the actual situation, which in turn affects the calculation performance.

Method used

A graph segmentation method based on road attributes is proposed. By obtaining road attribute information (such as number of lanes, lane width, speed level, road level, road form, charging information, etc.), the weights of the corresponding edges are determined, and the cutting edges of the graph structure are determined based on these weights, and then the graph structure is traversed to obtain the current level segmentation results.

Benefits of technology

By considering the influence of road attributes on weights, the rationality of the graph segmentation algorithm results are improved, making the segmentation results closer to the reality, thereby improving query performance during the routing request query stage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119803496A_ABST
    Figure CN119803496A_ABST
Patent Text Reader

Abstract

The invention discloses a road attribute-based graph subdivision method and device, computer equipment and a storage medium, and the method comprises the steps: obtaining road network map data, and generating a graph structure corresponding to the road network map data; obtaining the attribute information of each road, and determining the weight of the corresponding edge based on the attribute information of each road; determining a cut edge of the graph structure based on the weight; and on the basis of edge cutting, traversing the graph structure to obtain a subdivision result of the current hierarchy. The method comprises the following steps: adjusting a weight coefficient of an edge according to road attribute information to obtain a weight of the edge, carrying out edge cutting calculation based on the weight, traversing a graph structure, determining a subdivision result of a current hierarchy based on a traversal result, and determining the subdivision result of the current hierarchy in a graph subdivision process by considering the influence of road attributes on the weight. The reasonability of a graph subdivision algorithm result can be improved, the subdivision result is closer to the actual situation, and then the query performance is improved in the path calculation request query stage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of navigation technology, and in particular to a road attribute-based graph segmentation method, device, computer equipment and medium. Background Art

[0002] In today's navigation path planning field, with the increasing abundance of geographic information data and the increasing requirements of users for navigation accuracy and efficiency, multi-level graph segmentation technology has emerged. Multi-level graphs can effectively organize and represent complex geographic spatial data, and through different levels of division, they attempt to accurately depict the structure and characteristics of the transportation network at both the macro and micro levels.

[0003] Currently, the PUNCH algorithm is commonly used for graph segmentation. The PUNCH algorithm relies on the maximum flow minimum cut algorithm and usually uses the length of the edge as the weight for segmentation. However, since it only considers the length attribute of the edge (road link) and lacks consideration of other attributes, the segmentation result is quite different from the actual situation, which ultimately leads to the problem of decreased path calculation performance in the path calculation request query stage. Summary of the invention

[0004] Based on this, it is necessary to provide a road attribute-based graph segmentation method, device, computer equipment and storage medium to address the above technical issues, so as to solve at least one problem existing in the above-mentioned prior art.

[0005] In a first aspect, a graph segmentation method based on road attributes is provided, comprising the following steps:

[0006] Acquire road network map data, and generate a graph structure corresponding to the road network map data, wherein the edges in the graph structure are roads, and different roads are connected by nodes;

[0007] Acquire attribute information of each road, and determine the weight of the corresponding edge based on the attribute information of each road;

[0008] Based on the weight, determining the cut edge of the graph structure;

[0009] Based on the cut edges, the graph structure is traversed to obtain a partitioning result of the current level.

[0010] In one embodiment, determining the weight of the corresponding edge based on each of the road attribute information includes:

[0011] Determining a weight coefficient of each edge of the graph data structure based on each of the road attribute information;

[0012] Obtain the length of each edge of the graph data structure;

[0013] Based on the weighting coefficient and the length, a weight of each edge of the graph data structure is calculated.

[0014] In one embodiment, the road attribute information includes at least one of the number of lanes, lane width, speed level, road level, road shape, and toll information.

[0015] In one embodiment, the traversing the graph structure based on the cutting edge to obtain the partitioning result of the current level includes:

[0016] Step a: Select a target node in the graph structure, start traversal from the target node, and until the cut edge is encountered, the traversal ends, and all nodes obtained in the traversal are used as the segmentation results obtained in the traversal;

[0017] Step b: Determine whether there are untraversed nodes in the graph structure;

[0018] Step c: If there are untraversed nodes, traverse from the untraversed nodes until the cut edge is encountered. This traversal ends and all nodes obtained in this traversal are used as the segmentation results obtained in this traversal.

[0019] Repeat the above steps bc until all nodes are traversed, and use all the segmentation results obtained by traversal as the segmentation results of the current level.

[0020] In one embodiment, after traversing the graph structure based on the cutting edge to obtain the partitioning result of the current level, the method further includes:

[0021] Based on the partitioning structure of the current level, determining whether it is necessary to perform partitioning at the next level;

[0022] If it is necessary to perform segmentation at the next level, multiple graph structures are constructed according to the segmentation result of the current level, and each graph structure is segmented respectively to obtain the segmentation structure corresponding to the next level.

[0023] In one embodiment, constructing multiple graph structures according to the segmentation results of the current level includes:

[0024] Removing the cut edges from the segmentation result of the current level to obtain a plurality of connected components;

[0025] Treat each connected component as a graph structure.

[0026] In one embodiment, determining the cut edge of the graph structure based on the weight includes:

[0027] Converting the graph structure into a flow network, and finding a maximum flow in the flow network based on the weights;

[0028] Dividing all nodes of the flow network into a source point set and a sink point set;

[0029] The edge connecting the source point set and the sink point set is used as the cut edge.

[0030] In a second aspect, a graph segmentation device based on road attributes is provided, comprising:

[0031] A graph structure generating unit, used to obtain road network map data and generate a graph structure corresponding to the road network map data, wherein the edges in the graph structure are roads, and different roads are connected by nodes;

[0032] A weight determination unit, used to obtain each road attribute information, and determine the weight of the corresponding edge based on each road attribute information;

[0033] A cutting edge determining unit, configured to determine the cutting edges of the graph structure based on the weights;

[0034] A partitioning result generating unit is used to traverse the graph structure based on the cut edges to obtain a partitioning result of the current level.

[0035] In a third aspect, a computer device is provided, comprising a memory, a processor, and computer-readable instructions stored in the memory and running on the processor, wherein when the processor executes the computer-readable instructions, the graph segmentation method based on road attributes as described above is implemented.

[0036] In a fourth aspect, a readable storage medium is provided, on which computer-readable instructions are stored, and when the computer-readable instructions are executed by a processor, the graph segmentation method based on road attributes as described above is implemented.

[0037] The above-mentioned graph segmentation method, device, computer equipment and storage medium based on road attributes, the method implementation includes: obtaining road network map data, generating a graph structure corresponding to the road network map data, the edges in the graph structure are roads, and different roads are connected by nodes; obtaining attribute information of each road, and determining the weight of the corresponding edge based on the attribute information of each road; determining the cut edge of the graph structure based on the weight; traversing the graph structure based on the cut edge to obtain the segmentation result of the current level. In the embodiment of the present application, the weight coefficient of the edge is adjusted by the road attribute information to obtain the weight of the edge, and the cut edge calculation is performed based on the weight, and then the graph structure is traversed, and the segmentation result of the current level is determined based on the traversal result. By considering the influence of road attributes on the weight, the rationality of the graph segmentation algorithm results can be improved during the graph segmentation execution process, making the segmentation results closer to the actual situation, thereby improving the query performance in the road calculation request query stage. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0039] Figure 1 It is a schematic diagram of a process of a graph segmentation method based on road attributes in an embodiment of the present application;

[0040] Figure 2 It is a structural schematic diagram of a graph segmentation device based on road attributes according to an embodiment of the present application;

[0041] Figure 3 It is a schematic diagram of a computer device in one embodiment of the present application. DETAILED DESCRIPTION

[0042] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0043] In one embodiment, if Figure 1 As shown, a graph segmentation method based on road attributes is provided, comprising the following steps:

[0044] In step S110, road network map data is obtained, and a graph structure corresponding to the road network map data is generated, where the edges in the graph structure are roads, and different roads are connected by nodes;

[0045] Optionally, obtain the road network map data to be segmented. There are two main types of elements in the road network map data, node and link. Node represents a node, link represents a road, and links are connected through nodes. Specifically, nodes and links are input into a computer to construct a graph. In the graph, edge e corresponds to a link in the road network data.

[0046] Specifically, the node information and edge information in the road network map data can be determined. The node information may include the node number, geographical location (such as longitude and latitude), node type (such as intersection, toll station, etc.). The edge information may include the numbers of the two connected nodes, the length of the edge, the road grade, the number of lanes, etc. Then each node can be assigned a unique identifier, such as a number, letter, etc. Find the part that describes the connection relationship between the nodes in the road network data. Specify which two nodes an edge connects, and may also include other attributes of the edge, such as length, road type, etc.

[0047] Then, the graph structure can be constructed using the adjacency matrix or adjacency list. For example, in the adjacency matrix method, a two-dimensional matrix can be created, and the rows and columns of the matrix correspond to the node numbers. If there is an edge connecting node i and node j, the attributes of the edge (such as the length and weight of the edge) are recorded in the i-th row and j-th column of the matrix (and the j-th row and i-th column for undirected graphs); if there is no edge connection, a value indicating no connection (such as 0 or infinity) is recorded. When the graph structure is constructed in the form of an adjacency list, a list can be created for each node. In the list of each node, the attributes of other nodes and edges connected to the node are recorded. For example, for node A, its adjacency list may contain nodes B, C, etc. connected to it, as well as the attributes of edges AB and AC. In this way, a graph structure corresponding to the road network map data can be generated, in which the edges in the graph structure are roads, and different roads are connected through nodes.

[0048] In step S120, the attribute information of each road is obtained, and the weight of the corresponding edge is determined based on the attribute information of each road;

[0049] The road attribute information includes at least one of the number of lanes, lane width, speed level, road level, road shape, and toll information.

[0050] Optionally, for each edge, that is, a road, the road attribute information corresponding to the road may be obtained, and then based on the road attribute information corresponding to the road, the weight coefficient λ of the edge may be calculated. e Make adjustments and then determine the length of the edge based on the weight coefficient λ e The product of the length is the weight of the edge.

[0051] It should be noted that the weight coefficient can be adjusted accordingly based on the road attribute information according to the weight coefficient adjustment rules. e The larger the lane width, the smaller e The higher the speed level, the smaller the e The smaller the speed is. (For example, the speed level of 120km / h is higher than the speed level of 30km / h). The higher the road level, the smaller the speed is. eThe smaller the λ is. (For example, the grade of expressway is higher than provincial road.) In terms of road form, the λ of main road is smaller than that of auxiliary road. e Small, the λ of non-regional roads is smaller than that of regional roads. e Small, the roadway is smaller than the pedestrian road e The λ of fully enclosed roads is smaller than that of non-fully enclosed roads. e Small, non-bridge tunnel than bridge tunnel λ e Small. (Follow the easier path, λ e In terms of charging information, the more the road is charged per 100 meters, the smaller the e The bigger.

[0052] In step S130, based on the weight, the cut edge of the graph structure is determined;

[0053] Optionally, the PUNCH algorithm can be used to calculate the cut edges of the graph structure using the maximum flow minimum cut method. The nodes of the graph structure can be divided into a source point set and a sink point set, and the edges spanning between the source point set and the sink point set are used as cut edges.

[0054] It should be noted that the cut edges of the graph structure can also be calculated by other methods, such as the depth-first search (DFS) method. When calculating the cut edges, two timestamps are recorded for each node by performing a depth-first search on the graph: the discovery time and the discovery time of the earliest ancestor node that can be traced back (low time). The discovery time refers to the time when the node is first visited, and the low time is the discovery time of the earliest ancestor node that can be traced back through the child nodes of the node. During the search process, for a node u and one of its child nodes v, if the low time of v is greater than the discovery time of u, then the edge (u, v) is a cut edge. This is because it means that there is no other path from v to the ancestor node of u, and deleting this edge will change the connectivity of the graph. Alternatively, the Tarjan algorithm can be used to determine the cut edges by calculating the root node of each subtree in the depth-first search tree of the node (also called the representative node of the strongly connected component). During the search process, the discovery time and low time are also recorded. If the low time of a child node of a node is greater than the discovery time of the node, then the edge connecting this node and the child node is a cut edge.

[0055] In step S140, the graph structure is traversed based on the cut edges to obtain a partitioning result of the current level.

[0056] Optionally, after determining the cut edge of the graph structure, the graph structure can be traversed by a breadth-first search (BFS) algorithm. Exemplarily, a node is selected in the graph structure to determine whether the node is a traversed node. If so, the next node is reselected. If not, the node is used as the starting node and diffused outward to visit other nodes until a cut edge is encountered. BFS stops traversing, at which point all traversed nodes can be placed in a partition point set. Then, a node is selected again from the remaining untraversed nodes to start traversing until all nodes are traversed. A partition sub-set can be obtained during each traversal process. All partition sub-sets are used as the partition results of the current level.

[0057] It should be noted that the graph structure can also be traversed by depth-first search (DFS), Tarjan algorithm, etc.

[0058] It should be noted that, assuming that there are three points p1, p2, and p3 on the map, if the traditional graph segmentation method is used, only the distance on the map is considered, the segmentation result will be: p1 and p2 are divided into the same set A, and p3 is divided into set B (this is because the distance between p1 and p2 is close, and p3 is far from both p1 and p2. The traditional graph segmentation method does not consider the various attributes of the road, such as: number of lanes, lane width, speed level, road level, road shape, toll information, etc. The segmentation result obtained by the present application is to divide p1, p2, and p3 into the same set. This is because the various road attributes are also considered in the segmentation process. For example, if the vehicle travels faster on the target road and the target road has a higher capacity, it is believed that the connectivity between the three points p1, p2, and p3 is strong, so they are divided into the same set, thereby achieving the purpose of improving the rationality of the segmentation result.

[0059] In an implementation scenario of the present application, a set S can be obtained, and each element (point) i in the set S is the point to be segmented. Then the output of a single layer, that is, the segmentation result of the current level is: n sets (S 1 ,S 2 ,...,S n ), each set represents a class, all points in this set are classified into the same class, and the number of output sets n means that all points in the input set S are divided into n classes. In addition, each point can only be divided into one set (for example, there is a point i, which has been divided into set S 2 , it cannot be divided into any other set). The multi-layer output is to recursively perform single-layer partitioning according to the partitioning intention and output m single-layer output results.

[0060] In one embodiment of the present application, a graph partitioning method based on road attributes includes: obtaining road network map data, generating a graph structure corresponding to the road network map data, wherein the edges in the graph structure are roads, and different roads are connected by nodes; obtaining attribute information of each road, and determining the weight of the corresponding edge based on the attribute information of each road; determining the cut edge of the graph structure based on the weight; and traversing the graph structure based on the cut edge to obtain the partitioning result of the current level. In an embodiment of the present application, the weight coefficient of the edge is adjusted by the road attribute information to obtain the weight of the edge, and the cut edge calculation is performed based on the weight, and then the graph structure is traversed, and the partitioning result of the current level is determined based on the traversal result. By considering the influence of road attributes on the weight, the rationality of the graph partitioning algorithm result can be improved during the execution of the graph partitioning, and the partitioning result can be closer to the actual situation, thereby improving the query performance in the query stage of the route calculation request.

[0061] In an embodiment of the present application, determining the weight of the corresponding edge based on each of the road attribute information includes:

[0062] Determining a weight coefficient of each edge of the graph data structure based on each of the road attribute information;

[0063] Obtain the length of each edge of the graph data structure;

[0064] Based on the weighting coefficient and the length, a weight of each edge of the graph data structure is calculated.

[0065] The road attribute information includes at least one of the number of lanes, lane width, speed level, road level, road shape, and toll information.

[0066] Optionally, since road attributes will affect the final segmentation results, an adjustment relationship between road attributes and weighting coefficients can be established. The weighting coefficients of the edges can be adjusted by the road attributes corresponding to different edges to obtain the weighting coefficients of each edge. The length of an edge refers to the actual physical length between two nodes, which can be calculated based on the coordinates of the two nodes in the road network map. The weight of the edge can be expressed as:

[0067] w e =λ e × e

[0068] Among them: e represents the length of edge e, λ e The road attributes of edge e are the number of lanes, lane width, speed level, road level, road shape, and toll information. e The weighting coefficient of .

[0069] For example, the method for adjusting the weighting coefficient based on the road attribute may be specifically as follows:

[0070] 010: Let the weighting coefficient λ e The initial value of is 1.0;

[0071] 011: Adjust the weighting coefficient λ according to the number of lanes e The specific adjustment methods are:

[0072] If the number of lanes on edge e is 1, then: e =1.05×λ e ;

[0073] If the number of lanes on edge e is 2, then: e =1.0×λ e ;

[0074] If the number of lanes on edge e is 3, then: e =0.95×λ e ;

[0075] If the number of lanes on edge e is 4, then: e =0.90×λ e ;

[0076] If the number of lanes on edge e is greater than 4, then: e =0.85×λ e ;

[0077] 012: Based on 011, adjust the weighting coefficient λ according to the lane width e The specific adjustment methods are:

[0078] If the average lane width of edge e is less than 2.75 meters, then: e =1.15×λ e ;

[0079] If the average lane width of side e is 2.75m to 3.00m (closed on the left and open on the right), then: e =1.10×λ e ;

[0080] If the average lane width of side e is 3.00m to 3.25m (closed on the left and open on the right), then: e =1.05×λ e ;

[0081] If the average lane width of side e is 3.25m to 3.50m (closed on the left and open on the right), then: e =1.00×λ e ;

[0082] If the average lane width of edge e is 3.5m to 3.75m (closed on the left and open on the right), then: e =0.95×λ e ;

[0083] If the average lane width of edge e is greater than or equal to 3.75 meters, then: e =0.90×λ e ;

[0084] 013: Based on 012, adjust the weighting coefficient λ according to the speed level e The specific adjustment methods are:

[0085] If the speed level of edge e is: >130km / h, then: e =0.80×λ e ;

[0086] If the speed level of edge e is: (100km / h, 130km / h], then: λ e =0.85×λ e ;

[0087] If the speed level of edge e is: (90km / h, 100km / h], then: λ e =0.90×λ e ;

[0088] If the speed level of edge e is: (70km / h, 90km / h], then: λ e =0.95×λ e ;

[0089] If the speed level of edge e is: (50km / h, 70km / h], then: λ e =1.00×λ e ;

[0090] If the speed level of edge e is: (30km / h, 50km / h], then: λ e =1.05×λ e ;

[0091] If the speed level of edge e is: [11km / h, 30km / h], then: λ e =1.10×λ e ;

[0092] If the speed level of edge e is: <11km / h, then: λ e =1.15×λ e ;

[0093] 014: Based on 013, adjust the weighting coefficient λ according to the road grade e The specific adjustment methods are:

[0094] If the road grade of edge e is: expressway, then: e =0.80×λ e ;

[0095] If the road grade of edge e is: urban highway, then: e =0.85×λ e ;

[0096] If the road grade of edge e is: national highway, then: e =0.90×λ e ;

[0097] If the road grade of edge e is: provincial road, then: e =0.95×λ e ;

[0098] If the road grade of edge e is: county road, then: e =1.00×λ e ;

[0099] If the road level of edge e is: town or rural road, then: e =1.05×λ e ;

[0100] If the road level of edge e is: Other, then: e =1.10×λ e ;

[0101] 015: Based on 014, adjust the weighting coefficient λ according to the road shape e The specific adjustment methods are:

[0102] 0150: If the road shape of edge e is: main road, then: λ e =1.00×λ e , otherwise: λ e =1.05×λ e .

[0103] 0151: Based on 0150, if the road shape of edge e is: road within the region, then: λ e =1.05×λ e , otherwise: λ e =1.00×λ e .

[0104] 0152: Based on 0151, if the road shape of edge e is: roadway, then: λ e =1.00×λe, otherwise: λ=1.05×λ.

[0105] 0153: Based on 0152, if the road shape of edge e is: fully closed road, then: λ e =0.95×λ e , otherwise: λ e =1.00×λ e .

[0106] 0154: Based on 0153, if the road shape of edge e is: non-bridge-tunnel road, then: λ e =1.00×λ e , otherwise: λ e =1.05×λ e .

[0107] 016: Based on 015, adjust the weighting coefficient λ according to the charging information e The specific adjustment methods are:

[0108] If edge e is a toll road, then: e =1.05×λ e , otherwise: λ e =1.00×λ e .

[0109] In an embodiment of the present application, the graph structure is traversed based on the edge cutting to obtain a partitioning result of the current level, including:

[0110] Step a: Select a target node in the graph structure, start traversal from the target node, and until the cut edge is encountered, the traversal ends, and all nodes obtained in the traversal are used as the segmentation results obtained in the traversal;

[0111] Step b: Determine whether there are untraversed nodes in the graph structure;

[0112] Step c: If there are untraversed nodes, traverse from the untraversed nodes until the cut edge is encountered. This traversal ends and all nodes obtained in this traversal are used as the segmentation results obtained in this traversal.

[0113] Repeat the above steps bc until all nodes are traversed, and use all the segmentation results obtained by traversal as the segmentation results of the current level.

[0114] Optionally, the graph structure can be traversed by a breadth-first search (BFS) algorithm. Exemplarily, a target node is selected in the graph structure to determine whether the target node is a traversed node. If so, the next node is reselected. If not, the target node is used as the starting node and diffuses outward to visit other nodes until a cut edge is encountered. BFS stops traversal, at which point all traversed nodes can be placed in a partition point set. Then, a node is selected again from the remaining untraversed nodes to start traversal until all nodes are traversed. A partition sub-set can be obtained in each traversal process. All partition sub-sets are used as the partition results of the current level.

[0115] In an embodiment of the present application, after traversing the graph structure based on the cutting edge to obtain the segmentation result of the current level, the method further includes:

[0116] Based on the partitioning structure of the current level, determining whether it is necessary to perform partitioning at the next level;

[0117] If it is necessary to perform segmentation at the next level, multiple graph structures are constructed according to the segmentation result of the current level, and each graph structure is segmented respectively to obtain the segmentation structure corresponding to the next level.

[0118] Optionally, after obtaining the split structure of the current level, if the graph structure after the current split is still relatively complex, the amount of data is large, and the processing capacity allows for further subdivision for better analysis, then you can choose to continue splitting. For example, you can set a convergence condition to decide whether to stop splitting. For example, it is stipulated that the number of nodes in each subgraph is less than a preset threshold, or the number of edges is less than a preset number. If the graph structure obtained by the current split does not meet these convergence conditions, continue to the next level of splitting. When splitting, if the split structure of the current level is an overall graph containing multiple connected components, then each connected component can be treated as an independent graph, and then each graph can be split separately.

[0119] In an embodiment of the present application, the multiple graph structures are constructed according to the segmentation results of the current level, including:

[0120] Removing the cut edges from the segmentation result of the current level to obtain a plurality of connected components;

[0121] Treat each connected component as a graph structure.

[0122] Optionally, if it is necessary to perform subdivision of the subdivision result of the current level to the next level, the cut edges in the subdivision result of the current level can be removed, so that multiple connected components can be obtained, and each connected component can be used as a graph of the next level. Therefore, multiple graph structures of the next level can be obtained, and each graph structure can be subdivided separately.

[0123] In an embodiment of the present application, determining the cutting edge of the graph structure based on the weight includes:

[0124] Based on the weights, all nodes of the graph structure are divided into a source point set and a sink point set;

[0125] The edge connecting the source point set and the sink point set is used as the cut edge.

[0126] Optionally, the graph structure can be converted to a flow network, and a source and a sink need to be additionally specified. The source usually indicates the starting position of the flow, and the sink indicates the end position of the flow. The edges in the original graph structure should also be set accordingly in the flow network, and each edge should be assigned a non-negative capacity value, that is, a weight value, which indicates the maximum flow allowed to pass through the edge. At the beginning, the flow on each edge in the flow network is initialized to 0. Through methods such as breadth-first search (BFS) or depth-first search (DFS), a path from the source to the sink is found in the residual network (a network consisting of the residual capacity obtained by subtracting the current flow from the capacity of the edges in the original network). This path is the augmenting path. As long as the augmenting path can be found, it means that the flow from the source to the sink can be increased. Along the augmenting path found, determine the flow value that can be increased (this value is the minimum value of the remaining capacity of each edge on the augmenting path), and then update the flow of each edge on this path and the flow of the reverse edge (the edge in the remaining network that is opposite to the original edge, used to achieve flow backflow, etc.). Repeat the operation of finding augmenting paths and updating flow allocation until no augmenting paths from the source to the sink can be found in the remaining network. At this point, the flow in the network is the maximum flow.

[0127] Then, all nodes in the flow network can be divided into two sets, usually denoted as S and T, so that the source points belong to the S set and the sink points belong to the T set. The division method is to start from the source point and mark the nodes with the existing flow information. For example, using the idea of ​​breadth-first search, starting from the source point, the nodes that can be reached by the edges of non-full flow (that is, the current flow is less than the capacity) are divided into the S set, and the remaining nodes are divided into the T set. Then the edges spanning between the S set and the T set (that is, the edges from the nodes in S to the nodes in T) are cut edges. These cut edges constitute the minimum cut, which plays a key role in maintaining network connectivity and limiting the maximum flow. If these cut edges are removed from the graph, the source and sink points are no longer connected, and the sum of the capacities of these cut edges is exactly equal to the value of the maximum flow.

[0128] In the embodiment of the present application, the weight coefficient of the edge is adjusted through the road attribute information to obtain the weight of the edge, and the edge cutting calculation is performed based on the weight, and then the graph structure is traversed. Based on the traversal result, the segmentation result of the current level is determined. By considering the influence of the road attribute on the weight, the rationality of the graph segmentation algorithm results can be improved during the graph segmentation execution process, and the segmentation results can be closer to the actual situation, thereby improving the query performance in the route calculation request query stage. And the idea of ​​weighted coefficient is used to modify the edge weight, so that the program has strong scalability; recursion is used to realize the segmentation of multi-level graphs, which is convenient for program reuse.

[0129] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0130] In one embodiment, a graph segmentation device based on road attributes is provided, and the graph segmentation device based on road attributes corresponds one-to-one to the graph segmentation method based on road attributes in the above embodiment. Figure 2 As shown, the graph segmentation device based on road attributes includes a graph structure generation unit 10, a weight determination unit 20, a cut edge determination unit 30 and a segmentation result generation unit 40. The functional modules are described in detail as follows:

[0131] A graph structure generating unit 10 is used to obtain road network map data and generate a graph structure corresponding to the road network map data, wherein the edges in the graph structure are roads, and different roads are connected by nodes;

[0132] A weight determination unit 20, configured to obtain attribute information of each road, and determine the weight of the corresponding edge based on the attribute information of each road;

[0133] A cutting edge determining unit 30, configured to determine the cutting edges of the graph structure based on the weights;

[0134] The segmentation result generating unit 40 is used to traverse the graph structure based on the cut edges to obtain the segmentation result of the current level.

[0135] In one embodiment of the present application, the weight determination unit 20 is further configured to:

[0136] Determining a weight coefficient of each edge of the graph data structure based on each of the road attribute information;

[0137] Obtain the length of each edge of the graph data structure;

[0138] Based on the weighting coefficient and the length, a weight of each edge of the graph data structure is calculated.

[0139] In one embodiment of the present application, the road attribute information includes at least one of the number of lanes, lane width, speed level, road level, road shape, and toll information.

[0140] In one embodiment of the present application, the segmentation result generating unit 40 is further used to:

[0141] Step a: Select a target node in the graph structure, start traversal from the target node, and until the cut edge is encountered, the traversal ends, and all nodes obtained in the traversal are used as the segmentation results obtained in the traversal;

[0142] Step b: Determine whether there are untraversed nodes in the graph structure;

[0143] Step c: If there are untraversed nodes, traverse from the untraversed nodes until the cut edge is encountered. This traversal ends and all nodes obtained in this traversal are used as the segmentation results obtained in this traversal.

[0144] Repeat the above steps bc until all nodes are traversed, and use all the segmentation results obtained by traversal as the segmentation results of the current level.

[0145] In one embodiment of the present application, the device further includes a splitting unit, which is used to:

[0146] Based on the partitioning structure of the current level, determining whether it is necessary to perform partitioning at the next level;

[0147] If it is necessary to perform segmentation at the next level, multiple graph structures are constructed according to the segmentation result of the current level, and each graph structure is segmented respectively to obtain the segmentation structure corresponding to the next level.

[0148] In one embodiment of the present application, the subdivision unit is further used for:

[0149] Removing the cut edges from the segmentation result of the current level to obtain a plurality of connected components;

[0150] Treat each connected component as a graph structure.

[0151] In one embodiment of the present application, the edge cutting determination unit 30 is further configured to:

[0152] Converting the graph structure into a flow network, and finding a maximum flow in the flow network based on the weights;

[0153] Dividing all nodes of the flow network into a source point set and a sink point set;

[0154] The edge connecting the source point set and the sink point set is used as the cut edge.

[0155] In the embodiment of the present application, the weight coefficient of the edge is adjusted through the road attribute information to obtain the weight of the edge, and the edge cutting calculation is performed based on the weight, and then the graph structure is traversed. Based on the traversal result, the segmentation result of the current level is determined. By considering the influence of the road attribute on the weight, the rationality of the graph segmentation algorithm results can be improved during the graph segmentation execution process, and the segmentation results can be closer to the actual situation, thereby improving the query performance in the route calculation request query stage. And the idea of ​​weighted coefficient is used to modify the edge weight, so that the program has strong scalability; recursion is used to realize the segmentation of multi-level graphs, which is convenient for program reuse.

[0156] For the specific limitations of the graph segmentation device based on road attributes, please refer to the limitations of the graph segmentation method based on road attributes above, which will not be repeated here. Each module in the above-mentioned graph segmentation device based on road attributes can be implemented in whole or in part through software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0157] In one embodiment, a computer device is provided. The computer device may be a terminal device, and its internal structure diagram may be as follows: Figure 3 As shown. The computer device includes a processor, a memory, and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a readable storage medium. The readable storage medium stores computer-readable instructions. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer-readable instructions are executed by the processor, a graph segmentation method based on road attributes is implemented. The readable storage medium provided in this embodiment includes a non-volatile readable storage medium and a volatile readable storage medium.

[0158] In an embodiment of the present application, a computer device is provided, including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor. When the processor executes the computer-readable instructions, the steps of the road attribute-based graph segmentation method as described above are implemented.

[0159] In an embodiment of the application, a readable storage medium is provided, wherein the readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the graph segmentation method based on road attributes as described above are implemented.

[0160] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing related hardware through computer-readable instructions, and the computer-readable instructions can be stored in a non-volatile readable storage medium or a volatile readable storage medium. When the computer-readable instructions are executed, they may include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0161] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0162] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A graph segmentation method based on road attributes, characterized in that: The method comprises: Acquire road network map data, and generate a graph structure corresponding to the road network map data, wherein the edges in the graph structure are roads, and different roads are connected by nodes; Acquire attribute information of each road, and determine the weight of the corresponding edge based on the attribute information of each road; Based on the weight, determining a cut edge of the graph structure; Based on the cut edges, the graph structure is traversed to obtain a partitioning result of the current level.

2. The graph segmentation method based on road attributes according to claim 1, characterized in that: The step of determining the weight of the corresponding edge based on each of the road attribute information comprises: Determining a weight coefficient of each edge of the graph data structure based on each of the road attribute information; Obtaining the length of each edge of the graph data structure; Based on the weighting coefficient and the length, a weight of each edge of the graph data structure is calculated.

3. The graph segmentation method based on road attributes according to claim 2, characterized in that: The road attribute information includes at least one of the number of lanes, lane width, speed level, road level, road shape, and toll information.

4. The graph segmentation method based on road attributes according to claim 1, characterized in that: The step of traversing the graph structure based on the edge cutting to obtain the partitioning result of the current level includes: Step a: Select a target node in the graph structure, start traversal from the target node, and until the cut edge is encountered, the traversal ends, and all nodes obtained in the traversal are used as the segmentation results obtained in the traversal; Step b: Determine whether there are untraversed nodes in the graph structure; Step c: If there are untraversed nodes, traverse from the untraversed nodes until the cut edge is encountered. This traversal ends and all nodes obtained in this traversal are used as the segmentation results obtained in this traversal. Repeat the above steps bc until all nodes are traversed, and use all the segmentation results obtained by traversal as the segmentation results of the current level.

5. The graph segmentation method based on road attributes according to claim 1, characterized in that: After traversing the graph structure based on the cutting edge to obtain the partitioning result of the current level, the method further includes: Based on the partitioning structure of the current level, determining whether it is necessary to perform partitioning at the next level; If it is necessary to perform segmentation at the next level, multiple graph structures are constructed according to the segmentation result of the current level, and each graph structure is segmented respectively to obtain the segmentation structure corresponding to the next level.

6. The graph segmentation method based on road attributes according to claim 5, characterized in that: The step of constructing multiple graph structures according to the segmentation result of the current level includes: Removing the cut edges from the segmentation result of the current level to obtain a plurality of connected components; Treat each connected component as a graph structure.

7. The graph segmentation method based on road attributes according to claim 1, characterized in that: The step of determining the cutting edge of the graph structure based on the weight includes: Converting the graph structure into a flow network, and finding a maximum flow in the flow network based on the weights; Dividing all nodes of the flow network into a source point set and a sink point set; The edge connecting the source point set and the sink point set is used as the cut edge.

8. A graph segmentation device based on road attributes, characterized in that: The device comprises: A graph structure generating unit, used to obtain road network map data and generate a graph structure corresponding to the road network map data, wherein the edges in the graph structure are roads, and different roads are connected by nodes; A weight determination unit, used to obtain each road attribute information, and determine the weight of the corresponding edge based on each road attribute information; A cutting edge determining unit, configured to determine the cutting edge of the graph structure based on the weight; A partitioning result generating unit is used to traverse the graph structure based on the cut edges to obtain a partitioning result of the current level.

9. A computer device comprising a memory, a processor, and computer-readable instructions stored in the memory and executed on the processor, characterized in that: When the processor executes the computer-readable instructions, the road attribute-based graph segmentation method according to any one of claims 1 to 7 is implemented.

10. A readable storage medium having computer readable instructions stored thereon, characterized in that: When the computer-readable instructions are executed by a processor, the road attribute-based graph segmentation method according to any one of claims 1 to 7 is implemented.