A road network topology optimization method, electronic equipment and storage medium
Patent Information
- Application Number
- CN202211451588.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-21
- Publication Date
- 2026-10-13
- Estimated Expiration
- 2042-11-21
AI Technical Summary
[0005]上述现有技术并未考虑路段方向,直接对可能合并的link进行合并,导致路网属性与真实情况相比存在偏差,降低了有效性和实用性
[0016]本发明的有益效果如下:本发明通过考虑方向限制和自定义字段限制有效减少节点数量和有向边数量,减少拓扑网络计算复杂度,对于大网络计算有重要的意义。本发明还具有运行速度快、所需基础数据小操作简单的效果,解决了现有技术中存在的路网属性与真实情况相比存在偏差,有效性和实用性低的技术问题。
Smart Images

Figure CN115829094B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a road network optimization method, and more particularly to a road network topology optimization method, electronic device, and storage medium, belonging to the field of road network topology optimization technology. Background Technology
[0002] Road networks are the foundation for traffic planning and capacity allocation. As cities expand, dense road networks, while accurately reflecting the real road network and traffic conditions, become computationally intensive, leading to very low efficiency. Road network optimization is a crucial aspect of road network analysis and a fundamental aspect of traffic models. Therefore, in practice, it is often necessary to simplify the original complex road network without affecting the final calculation results. Generally, optimizing road network topology involves batch elimination of pseudo-nodes and dangling points through point merging.
[0003] Based on patent searches, the technical solution most similar to this invention is as follows: The method for generating and simplifying road networks based on KML with patent application number 201911216390.5 is to simplify the road network by combining the intersection information file and the road network topology file obtained by function calculation with graphics, and then use the melting points and latitude and longitude to divide and merge small branches to obtain the optimized road network structure.
[0004] The simplified road network KSP optimization algorithm with patent application number 202010139515.5 divides network nodes into three categories: branch nodes, intermediate nodes, and true nodes. The nodes that actually participate in the calculation are limited to true nodes. After eliminating the branch nodes and intermediate nodes, the simplified road network is obtained.
[0005] The aforementioned existing technologies do not consider the direction of road segments and directly merge links that may be merged, resulting in deviations between the road network attributes and the actual situation, thus reducing effectiveness and practicality. Summary of the Invention
[0006] A brief overview of the invention is given below to provide a basic understanding of certain aspects of it. It should be understood that this overview is not an exhaustive summary of the invention. It is not intended to identify key or essential parts of the invention, nor is it intended to limit the scope of the invention. Its purpose is merely to present certain concepts in a simplified form as a prelude to the more detailed description that follows.
[0007] In view of this, in order to solve the technical problems of deviation between the road network attributes and the actual situation, and low effectiveness and practicality of the existing technology, the present invention provides a road network topology optimization method, electronic device and storage medium.
[0008] Option 1: A road network topology optimization method, comprising the following steps: S1. Process the direction field of the road network link; S2. Obtain the subgraph G from which the road network may merge. i This includes the following steps: S21. Search the road network nodes in the road network subgraph G to find any point. ; S22. Let the midpoint of the road network subgraph G be... The set of adjacent vertices is The set of adjacent edges is S23. Initialize a set of result nodes N sub Edge set E sub S24. Traversal During the traversal of the road network nodes, for each traversed node, add... Then, find the adjacent nodes of the traversed nodes and add them to the list. Add the adjacent edge relationship to the middle section. In the middle, then from Delete the traversed node; S25. After completing one traversal, if Already for If a subset of the subset is found, then the traversal stops. no If it is a subset, then execute S24; S26. Obtain and This is the road network sub-map. ; S27. Repeat steps S21-S26 to obtain the possible merged road network subgraphs G. i , i = (1, 2, 3, ..., n); S3. Determine the road network subgraph G i The sequence of road network nodes; S4. Modify the road network subgraph G that may be merged as described in S2. i ; S5. Filtering Road Network Subgraphs Based on Directional Restrictions (G) i Can the parameters be merged? If the parameter value is False, execute S6; if the parameter value is True, execute S5. S6. Custom field restrictions for determining road network subgraphs G iCan the parameters be merged? If the parameter value is False, execute S7; if the parameter value is True, execute S6. S7. Based on road network subgraph G i Perform road network link merging and update the original road network information.
[0009] Preferably, the road network subgraph G is determined. i The method for obtaining the node sequence is as follows: assuming the road network subgraph G... i All nodes in the process have not been accessed: This includes the following steps: S31. Select road network subgraph G i The starting point is a node with a degree of 1, and its number is set to 1. S32. Starting from node 1, visit an unvisited adjacent node of node 1, and number it as 2; S33. Starting from node 2, visit an unvisited adjacent node of node 2, and number it 3. S34. Repeat the previous step, numbering sequentially, until no other unvisited nodes can be accessed, then return to the previous level node; S35. Determine whether other unvisited nodes can be accessed from the node that was returned to. If other unvisited nodes cannot be accessed, continue to return. If other unvisited nodes can be accessed, repeat S34 to continue accessing the node. S36. Repeat the above process until the road network subgraph G is obtained. i The sequence number of all nodes is obtained after all nodes have been visited.
[0010] Preferably, the subgraph G that may be merged in the modified road network i The method is: based on the road network merging subgraph G i Correct any subsequent issues that arise; When merging subgraphs G i A ring-shaped pattern then appeared: Traverse the possible merged road network subgraph G i In the set of node sequences Q, for each specific node sequence q, if a sequence q satisfies both condition 1 and condition 2, then the node sequence q is removed from the set of node sequences Q of the mergeable subgraph. Condition 1: q1=q -1 Where q1 represents the first element of the node sequence, q -1 This represents the last element of the node sequence; Condition 2: In the direction of travel: from q1 to q -2 Connected and q -2 to q -1 Connected or q -2 Connected to q1 and q -1 to q-2 Connected; where q -2 This represents the second-to-last element of the point sequence; When the road network merges subgraph G i Later, a situation arose where the paths between adjacent nodes were not unique: Iterate through the set of node sequences Q in the possible mergeable subgraph of the road network. For each specific node sequence q, let G be the possible mergeable subgraph of the road network. i The index of the node sequence set Q is i; If q1 to q -1 If there is no key-value pair (q1, q) in the ATTR hash table, then the sequence node q is connected. -1 If ), then the new element (q1, q) is added. -1 ): [i]; If the ATTR hash table contains key-value pairs (q1, q -1 If i is added to the key (q1, q), then i will be added to the key (q1, q). -1 The corresponding sequence index list; If q -1 If q1 is connected to the sequence node q, and there is no key-value pair (q) in the ATTR hash table. -1 If q1), then the new element (q) is added. -1 ,q1):[i], if the ATTR hash table contains key-value pairs (q -1 If q1), then add i to the key (q). -1 The list of sequence indices corresponding to q1); Analyzing the hash table ATTR, if a key corresponds to a list with N elements, it means that N subgraph sequences will be connected to adjacent nodes after merging. Therefore, the subgraph sequences in the list cannot be merged simultaneously. Instead, N-1 subgraphs need to be randomly selected, and the first or last node of each of these N-1 subgraph sequences needs to be recursively deleted. Simultaneously, the road network's potentially mergeable subgraph G needs to be updated. i The set of node sequences Q in the dataset.
[0011] Preferably, the filtering direction restricts the judgment of the road network subgraph G. i The method to determine if merging is possible is to find a continuous sequence of links where the direction field is 1 or 0; Link groups where all directions are 0 are directly merged; When links with all values of 1 in the direction field are combined with the from_node and to_node fields to determine whether they can be merged, the specific method is as follows: After initializing the set R of node sequences in the possible merged subgraphs to filter the direction limits, iterate through the set Q of node sequences in the possible merged subgraphs. For each specific node sequence q, obtain the dir field list of the links corresponding to adjacent nodes: dir_list=[dir(qi, qi+1)], 0≤i<q_length-1, q_length is the number of elements in sequence q; find the positions of elements that are identical at least twice in dir_list, and split q into k node sequence sets qk from the non-contiguous index positions; Iterate through each node sequence in qk: If a node sequence has a dir value of 0, it is directly added to the set R of node sequences in the possible merged subgraphs under the filtering direction constraint. If the sequence of nodes has a dir value of 1, then calculate the imbalance degree x for each node in turn: x(n)=|out_degree(n)–in_degree(n)| Where x(n) represents the imbalance degree of node n, out_degree(n) represents the out-degree of node n, and in_degree(n) represents the in-degree of node n; Split the qk sequence from the position x(n)>1 to obtain a set of m node sequences qk, and add a filtering direction constraint to the set of node sequences R in the possible merged subgraphs; Update the set of node sequences Q in the possible merged subgraphs to the set of node sequences R in the possible merged subgraphs, which are subject to filtering direction constraints.
[0012] Preferably, custom field restrictions are used to determine the road network subgraph G. i The method to determine whether merging is possible is as follows: After initializing a custom field to limit the set of node sequences Z in the possible merged subgraphs, iterate through the set of node sequences Q in the possible merged subgraphs: For each specific node sequence q, obtain the list of direction attribute fields of the road network link corresponding to the adjacent nodes: val_list=[val(qi, qi+1)], 0≤i<q_length, q_length is the number of elements in sequence q; Find the positions of elements that are identical at least twice in val_list, split q into k node sequences qk from non-contiguous index positions, and then add a custom field to limit the set Z of node sequences that may be merged in the subgraph; Update the set of node sequences Q in the possible merged subgraphs to the initial custom field constraint Z of the possible merged subgraphs.
[0013] Preferably, based on the road network subgraph G i The method for merging road network links and updating the original road network information is as follows: traverse the set of node sequences Q in the possible merged subgraphs, or filter the set of node sequences R in the possible merged subgraphs by direction restriction, or restrict the set of node sequences Z in the possible merged subgraphs by custom fields: For each specific node sequence q, obtain the set of road network link_ids 1 corresponding to the adjacent nodes. Merge the coordinate sequences of the road network links in set l, and update the original road network information; The specific method for merging the coordinate sequences of the road network links in set l is as follows: For a given set l, extract its corresponding set of coordinate sequences C. in, This represents the geometric coordinate sequence of the link between two adjacent nodes, where k is the length of the node sequence q. Iterate through each coordinate sequence c in C: The coordinate direction of the first coordinate sequence c is taken as the topological positive direction of the new road network link and added to the new coordinate sequence new_coords. The coordinates of the topological positive direction endpoint are recorded as des_coords. If it is not the first coordinate sequence, then take the coordinates of its two endpoints and calculate the distance with des_coords respectively. Take the coordinates of the endpoint closest to des_coords as the connection point, take the connection point as the starting point of the topology, add the coordinate sequence into new_coords, update des_coords to the topology endpoint coordinates of new_coords, and obtain the new road network link information.
[0014] Option 2: An electronic device includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of the method described in Option 1.
[0015] Option 3: A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method described in Option 1.
[0016] The beneficial effects of this invention are as follows: By considering directional constraints and custom field constraints, this invention effectively reduces the number of nodes and directed edges, thereby reducing the computational complexity of the topology network, which is of great significance for large-scale network computation. This invention also features fast operation speed, small required basic data, and simple operation, solving the technical problems in existing technologies where road network attributes deviate from reality, resulting in low effectiveness and practicality. Attached Figure Description
[0017] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this invention, illustrate exemplary embodiments of the invention and are used to explain the invention, but do not constitute an undue limitation of the invention. In the drawings: Figure 1 This is a schematic diagram of the method flow of the present invention; Figure 2 This is a schematic diagram of the possible merging of sub-graphs of the road network described in S2 of the present invention; Figure 3 This is a schematic diagram of the road network subgraph G node sequence described in S3 of the present invention; Figure 4 This is a schematic diagram of a link sequence where the field described in S5 of the present invention is 1 or 0; Figure 5 This is a schematic diagram of the node sequence splitting results of the present invention; Figure 6 This is a schematic diagram illustrating the effect of the present invention. Detailed Implementation
[0018] To make the technical solutions and advantages of the embodiments of the present invention clearer, the exemplary embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not an exhaustive list of all embodiments. It should be noted that, unless otherwise specified, the embodiments and features in the embodiments of the present invention can be combined with each other.
[0019] Example 1, Reference Figures 1-6 This embodiment describes a road network topology optimization method, which includes the following steps: S1. Process the direction field of the road network links; to facilitate subsequent road network link merging and judgment, links with a direction field of -1 are converted; Specifically, organize the original road network data according to the requirements. The road network table can be abstracted into a line-level table and a point-level table. The fields of the line-level table include link_id, dir, from_node, to_node, length, geometry, and custom attribute fields. link_id is the ID of the road segment and a unique index. `dir` is used to identify the direction of the road segment. If it is a two-way road, the value is 0; if it is a one-way road, the value is 1 or -1. If the one-way traffic direction is consistent with the topological direction of the line object, the value is 1; if the one-way traffic direction is opposite to the topological direction of the line object, the value is -1.
[0020] `from_node` and `to_node` are the two endpoint numbers of this line object. `from_node` is the starting endpoint number of the forward topology, and `to_node` is the ending endpoint number of the forward topology.
[0021] `length` represents the length of the line object, while `geometry` stores the line object itself, containing all its geometric information.
[0022] Custom attribute fields can be used, for example, to describe the traffic capacity of a road segment. Since a road segment may be bidirectional, and the traffic capacity in different directions of a road segment may be different, it is necessary to distinguish the attributes in the two directions. Let's assume that we use "capacity" to represent it. Then, the traffic capacity in the forward direction of the topology is represented by "ab_capacity", and the traffic capacity in the reverse direction of the topology is represented by "ba_capacity". "ab_" and "ba_" at the beginning indicate the forward and reverse attributes of the topology, respectively.
[0023] Specifically, the conversion rules are as follows: For links with a direction of 1 and 0, the data remains unchanged. For links with a direction of -1, the values of from_node and to_node are swapped, that is, the value of from_node becomes the value of to_node, and the value of to_node becomes the value of from_node. The coordinate sequence stored in the geometry is reversed, and the values of xx_ab and xx_ba are replaced. Finally, the value of direction is changed to 1.
[0024] link_id from_node to_node direction length geometry xx_ab xx_ba 1 2 3 -1 1.3 LineString((1,2),(3,4),(5,6)) 136 256 link_id from_node to_node direction length geometry xx_ab xx_ba 1 3 2 1 1.3 LineString((5,6),(3,4),(1,)) 256 136 S2. Obtain the subgraph G from which the road network may merge. i The method is as follows: Construct an undirected graph G_ALL based on the road network, find all nodes with degree 2 and construct a set M, and traverse each edge of the undirected graph G_ALL. ij Where i and j are the two endpoints, if node i ∈ set M and node j ∈ set M, then edgeij is added to the edge set N of subgraph G. Finally, subgraph G is composed of node set M and edge set N. Extract a subgraph G containing a set of nodes M from the original undirected graph. Subgraph G should contain K (K>=1) disconnected graphs. Finding a connected graph in subgraph G is equivalent to finding the subgraph. This involves the following steps: S21. Search for nodes in the road network subgraph G, and find any point. ; S22. Let the midpoint of the road network subgraph G be... The set of adjacent vertices is The set of adjacent edges is S23. Initialize a set of result nodes N sub Edge set E sub S24. Traversal During the traversal of the nodes, for each traversed node, add... Then, find the adjacent nodes of the traversed nodes and add them to the list. Add the adjacent edge relationship to the middle section. In the middle, then from Delete the traversed node; S25. After completing one traversal, if Already for If a subset of the subset is found, then the traversal stops. no If it is a subset, then S24 continues; S26. Obtain and That is, a subgraph 1; S27. Repeat steps S21-S26 to obtain the possible merged subgraphs G. i , i = (1, 2, 3, ... n).
[0025] Traverse the unvisited nodes in the undirected graph G of the road network, repeating steps S21-S26 to obtain node sets of multiple subgraphs, such as... Figure 2 In the undirected graph shown, six possible subgraphs can be obtained. Following this method, the subgraphs can be further divided into... Figure 1 It must be a chain.
[0026] S3. Determine the road network subgraph G i (Reference Figure 2 sub Figure 1 -son Figure 6 The node sequence method is as follows: assuming the road network subgraph G... i All nodes in the process have not been accessed: This includes the following steps: S31. Select road network subgraph G i The starting point is a node with a degree of 1, and its number is set to 1. S32. Starting from node 1, visit an unvisited adjacent node of node 1, and number it as 2; S33. Starting from node 2, visit an unvisited adjacent node of node 2, and number it 3. S34. Repeat the previous step, numbering sequentially, until no other unvisited nodes can be accessed, then return to the previous level node; S35. Determine whether other unvisited nodes can be accessed from the node that was returned to. If other unvisited nodes cannot be accessed, continue to return. If other unvisited nodes can be accessed, repeat S134 to continue accessing the number. S36. Repeat the above process until the road network subgraph G is obtained. i The process continues until all nodes have been visited, yielding the sequential numbers of all nodes, which can then be referenced. Figure 3 A schematic diagram of the node sequence of the road network subgraph G and a node sequence table of the subgraph in Table 1.
[0027] Table 1 shows the node sequence list of the subgraph. S4. Modify the road network subgraph G that may be merged as described in S12. i The method is as follows: based on the merged road network sub-graph G i Correct any subsequent issues that arise; When merging road network subgraphs G i A ring-shaped pattern then appeared: Traversing the road network may merge subgraphs G i In the set of node sequences Q, for each specific node sequence q, if a sequence q satisfies both condition 1 and condition 2, then the node sequence q is removed from the set of node sequences Q of the mergeable subgraph. Condition 1: q1=q -1 Where q1 represents the first element of the node sequence, q -1 This represents the last element of the point sequence; Condition 2: In the direction of travel: from q1 to q -2 Connected and q -2 to q -1 Connected or q -2 Connected to q1 and q -1 to q -2 Connected; where q -2 This represents the second-to-last element of the point sequence; q i Let q represent the i-th element of the sequence. -i This represents the i-th element from the end of the sequence, where i is a natural number.
[0028] When merging subgraphs G i The following situation occurs where adjacent node paths are not unique: The parameter dup controls whether to allow adjacent node paths to be not unique after merging, for example: child Figure 5 Kazuko Figure 6 After merging, there may be two links between nodes 11 and 14. A parameter value of True indicates that this is allowed, while a parameter value of False indicates that merging is not allowed. In this case, the following steps are performed: Iterate through the set Q of node sequences in the possible mergeable subgraphs. For each specific node sequence q, let G be a subset of the possible mergeable subgraphs. i The index of the node sequence set Q is i; If q1 to q -1 If there is no key-value pair (q1, q) in the ATTR hash table, then the sequence node q is connected. -1 If ), then the new element (q1, q) is added. -1 ): [i]; If the ATTR hash table contains key-value pairs (q1, q -1 If i is added to the key (q1, q), then i will be added to the key (q1, q). -1 The corresponding sequence index list; If q -1 If q1 is connected to the sequence node q, and there is no key-value pair (q) in the ATTR hash table. -1 If q1), then the new element (q) is added. -1 ,q1):[i], if the ATTR hash table contains key-value pairs (q -1 If q1), then add i to the key (q). -1 The list of sequence indices corresponding to q1); Analyzing the hash table ATTR, if a key corresponds to a list with N elements, it means that N subgraph sequences will be connected to adjacent nodes after merging. Therefore, the subgraph sequences in the list cannot be merged simultaneously. Instead, N-1 subgraphs need to be randomly selected, and the first or last node of these N-1 subgraph sequences needs to be recursively deleted. Simultaneously, the subgraph G that may be merged needs to be updated. i The set of node sequences Q in the dataset.
[0029] Example: Assuming that based on the connectivity of the original road network, the sub- Figure 5 The middle nodes 12-15 are connected, and the child nodes are connected. Figure 6 If nodes 12-15 are connected, then ATTR = {(12,15):[5,6]}, N = 2, and N-1 = 1 subgraphs are randomly selected, i.e., sub-... Figure 5 If node 15 is deleted from its sequence, then the child... Figure 5 The sequence of nodes that can be merged becomes {12, 13, 14}, resulting in the set of mergeable node sequences Q.
[0030] S5. Filtering Subgraphs with Direction Restrictions (G) i Whether a merge is possible is controlled by the parameter direction_limit. When the parameter value is False, S6 is executed; when the parameter value is True, S5 is executed. Filtering direction constraint judgment subgraph G i The possible method for merging links is to find consecutive links with a direction field of 1 or 0; refer to... Figure 4 ; Link groups where all directions are 0 are directly merged; For link groups where all `direction` fields are 1, the `from_node` and `to_node` fields are used to deduce the driving direction and determine whether they can be merged. For link groups with `direction` fields of 1, a directed graph is constructed, and the imbalance degree of each node is calculated. The imbalance degree is the absolute value of the difference between the node's out-degree and in-degree. Nodes with an imbalance degree of 2 are designated as split nodes. Figure 5 In an undirected graph, the sequence of nodes that can be merged is {4, 20, 21, 22, 23}. If we consider directional constraints on merging, the original mergeable sequence splits into two sets of node sequences: {4, 20, 21} and {21, 22, 23}.
[0031] The specific method is as follows: After initializing the set R of node sequences in the possible merged subgraphs to filter the direction constraints, iterate through the set Q of node sequences in the possible merged subgraphs. For each specific node sequence q, obtain the dir field list of the links corresponding to adjacent nodes: dir_list=[dir(qi, qi+1)], 0≤i<q_length-1, where q_length is the number of elements in sequence q; find the positions of elements that are identical at least twice in dir_list, and split q into k node sequence sets qk from the non-contiguous index positions. Iterate through each node sequence in qk: If a node sequence has a dir value of 0, it is directly added to the set R of node sequences in the possible merged subgraphs under the filtering direction constraint. If the sequence of nodes has a dir value of 1, then calculate the imbalance degree x for each node in turn: x(n)=|out_degree(n)–in_degree(n)| Where x(n) represents the imbalance degree of node n, out_degree(n) represents the out-degree of node n, and in_degree(n) represents the in-degree of node n; Split the qk sequence from the position x(n)>1 to obtain a set of m node sequences qk, and add a filtering direction constraint to the set of node sequences R in the possible merged subgraphs; Update the set of node sequences Q in the possible merged subgraphs to the set of node sequences R in the possible merged subgraphs, which are subject to filtering direction constraints.
[0032] S6. Custom field restrictions for judging subgraphs Gi Can it be merged? Execute S7 when the parameter value is False; execute S6 when the parameter value is True; custom field limits the determination of subgraph G. i The specific method for merging is to find links with consecutive identical attribute values and group them again; the specific implementation process is as follows: Custom field restrictions for determining subgraph G i The method to determine whether merging is possible is as follows: Initialize a custom field to limit the set of node sequences Z in the possible merged subgraphs, and then traverse the set of node sequences Q in the possible merged subgraphs: For each specific node sequence q, obtain the list of direction attribute fields of the links corresponding to adjacent nodes: val_list=[val(qi, qi+1)], 0≤i<q_length, q_length is the number of elements in sequence q; Find the positions of elements that are identical at least twice in val_list, split q into k node sequences qk from non-contiguous index positions, and then add a custom field to limit the set Z of node sequences that may be merged in the subgraph; Update the set of node sequences Q in the possible merged subgraphs to the initial custom field constraint Z of the possible merged subgraphs.
[0033] S6. Custom field restrictions for judging subgraphs G i Can the parameters be merged? If the parameter value is False, execute S6; if the parameter value is True, execute S5. Custom field restrictions for determining subgraph G i The method to determine whether merging is possible is as follows: Initialize a custom field to limit the set of node sequences Z in the possible merged subgraphs, and then traverse the set of node sequences Q in the possible merged subgraphs: For each specific node sequence q, obtain the list of direction attribute fields of the links corresponding to adjacent nodes: val_list=[val(qi, qi+1)], 0≤i<q_length, q_length is the number of elements in sequence q; S7. Subgraph-based G i Perform link merging in the road network and update the original road network information. The method is as follows: traverse the set of node sequences Q in the possible merged subgraphs, or filter the set of node sequences R in the possible merged subgraphs by direction restriction, or restrict the set of node sequences Z in the possible merged subgraphs by a custom field restriction. For each specific node sequence q, the set of link_ids corresponding to adjacent nodes can be obtained as follows: Merge the coordinate sequences of the road network links in set l, and update the original road network information; The specific method for merging the coordinate sequences of the road network links in set l is as follows: For a given set l, extract its corresponding set of coordinate sequences C. in, Let q represent the geometric coordinate sequence of the link between two adjacent nodes, where k is the length of the node sequence q. Iterate through each coordinate sequence c in C: The coordinate direction of the first coordinate sequence c is taken as the topological positive direction of the new link and added to the new coordinate sequence new_coords. The coordinates of the topological positive direction endpoint are recorded as des_coords. If it is not the first coordinate sequence, then take the coordinates of its two endpoints and calculate the distance with des_coords respectively. Take the coordinates of the endpoint closest to des_coords as the connection point, take the connection point as the starting point of the topology, add the coordinate sequence into new_coords, update des_coords to the topology endpoint coordinates of new_coords, and obtain the new link information.
[0034] Example 2: The computer device of the present invention may include a processor and a memory, such as a microcontroller containing a central processing unit. Furthermore, the processor executes the computer program stored in the memory to implement the steps of the above-described recommendation method for modifyable relationship-driven recommendation data based on CREO software.
[0035] The processor referred to can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.
[0036] The memory may primarily include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a function (such as sound playback, image playback, etc.); the data storage area may store data created based on the use of the mobile phone (such as audio data, phonebook, etc.). Furthermore, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disks, RAM, plug-in hard disks, smart media cards (SMC), secure digital cards (SD cards), flash cards, at least one disk storage device, flash memory device, or other volatile solid-state storage devices.
[0037] Example 3: Computer-readable storage medium example The computer-readable storage medium of the present invention can be any form of storage medium that can be read by the processor of a computer device, including but not limited to non-volatile memory, volatile memory, ferroelectric memory, etc. The computer-readable storage medium stores a computer program. When the processor of the computer device reads and executes the computer program stored in the memory, the steps of the above-described modeling method for modifyable relation-driven modeling data based on CREO software can be implemented.
[0038] The computer program includes computer program code, which may be in the form of source code, object code, executable file, or certain intermediate forms. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium may be appropriately added to or subtracted according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media may not include electrical carrier signals and telecommunication signals.
[0039] Although the invention has been described with reference to a limited number of embodiments, those skilled in the art will understand from the foregoing description that other embodiments are conceivable within the scope of the invention described herein. Furthermore, it should be noted that the language used in this specification has been chosen primarily for readability and instructional purposes, and not for the purpose of interpreting or limiting the subject matter of the invention. Therefore, many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the appended claims. The disclosure of the invention is illustrative and not restrictive, and the scope of the invention is defined by the appended claims.
Claims
1. A road network topology optimization method, characterized in that, Includes the following steps: S1. Process the direction field of the road network link; S2. Obtain the subgraph G from which the road network may merge. i This includes the following steps: S21. Search road network subgraph In the road network nodes, find any point ; S22. Design a road network sub-diagram midpoint The set of adjacent vertices is The set of adjacent edges is S23. Initialize a set of result nodes N sub Edge set E sub S24. Traversal During the traversal of the road network nodes, for each traversed node, add... Then, find the adjacent nodes of the traversed nodes and add them to the list. Add the adjacent edge relationship to the middle section. In the middle, then from Delete the traversed node; S25. After completing one traversal, if Already for If a subset of the subset is found, then the traversal stops. no If it is a subset, then execute S24; S26. Obtain This is the road network sub-map. 1; S27. Repeat steps S21-S26 to obtain the possible merged road network subgraphs G. i , i = (1, 2, 3, ..., n); S3. Determine the road network subgraph G i The sequence of road network nodes; S4. Modify the road network subgraph G that may be merged as described in S2. i ; S5. Filtering Road Network Subgraphs Based on Directional Constraints (G) i Can the parameters be merged? If the parameter value is False, execute S6; if the parameter value is True, execute S5. The filtering direction restricts the judgment of the road network subgraph G. i The method to determine whether merging is possible is to find a continuous sequence of links with a direction field of 1 or 0. The direction field is used to identify the direction of the road segment; if it is a two-way road, the value is 0; if it is a one-way road, the value is 1. Link groups where all directions are 0 are directly merged; When a link group whose direction field is 1 is combined with the from_node and to_node fields to deduce the driving direction, it is determined whether it can be merged. The specific method is as follows: After initializing the set R of node sequences in the possible merged subgraphs to filter the direction limit, iterate through the set Q of node sequences in the possible merged subgraphs. For each specific node sequence q, obtain the dir field list of the links corresponding to the adjacent nodes: dir_list=[dir(qi, qi+1)], 0≤i<q_length - 1, q_length is the number of elements in sequence q; find the positions of elements that are the same at least twice in dir_list, and split q into k node sequence sets qk from the non-contiguous index positions; Iterate through each node sequence in qk: If a node sequence has a dir value of 0, it is directly added to the set R of node sequences in the possible merged subgraphs under the filtering direction constraint. If the sequence of nodes has a dir value of 1, then calculate the imbalance degree x for each node in turn: x(n)=|out_degree(n)–in_degree(n)| Where x(n) represents the imbalance degree of node n, out_degree(n) represents the out-degree of node n, and in_degree(n) represents the in-degree of node n; Split the qk sequence from the position x(n)>1 to obtain a set of m node sequences qk, and add a filtering direction constraint to the set of node sequences R in the possible merged subgraphs; Update the set of node sequences Q in the possible merged subgraphs to the set of node sequences R in the possible merged subgraphs that are subject to filtering direction constraints; S6. Custom field restrictions for determining road network subgraphs G i Can the parameters be merged? If the parameter value is False, execute S7; if the parameter value is True, execute S6. S7. Based on road network subgraph G i Perform road network link merging and update the original road network information.
2. The road network topology optimization method according to claim 1, characterized in that, Determine the road network subgraph G i The method for obtaining the node sequence is as follows: assuming the road network subgraph G... i All nodes in the process have not been accessed: This includes the following steps: S31. Select road network subgraph G i The starting point is a node with a degree of 1, and its number is set to 1. S32. Starting from node 1, visit an unvisited adjacent node of node 1, and number it as 2; S33. Starting from node 2, visit an unvisited adjacent node of node 2, and number it 3. S34. Repeat the previous step, numbering sequentially, until no other unvisited nodes can be accessed, then return to the previous level node; S35. Determine whether other unvisited nodes can be accessed from the node that was returned to. If other unvisited nodes cannot be accessed, continue to return. If other unvisited nodes can be accessed, repeat S34 to continue accessing the node. S36. Repeat the above process until the road network subgraph G is obtained. i The sequence number of all nodes is obtained after all nodes have been visited.
3. The road network topology optimization method according to claim 2, characterized in that, Correcting the subgraph G that may be merged in the road network i The method is: based on the road network merging subgraph G i Correct any subsequent issues that arise; When merging subgraphs G i A ring-shaped pattern then appeared: Traversing the road network may merge subgraphs G i In the set of node sequences Q, for each specific node sequence q, if a sequence q satisfies both condition 1 and condition 2, then the node sequence q is removed from the set of node sequences Q of the mergeable subgraph. Condition 1: q1=q -1 Where q1 represents the first element of the node sequence, q -1 This represents the last element of the node sequence; Condition 2: In the direction of travel: from q1 to q -2 Connected and q -2 to q -1 Connected or q -2 Connected to q1 and q -1 to q -2 Connected; where q -2 This represents the second-to-last element of the point sequence; When merging road network subgraph G i Later, a situation arose where the paths between adjacent nodes were not unique: Iterate through the set Q of node sequences in the possible mergeable subgraphs. For each specific node sequence q, let G be the number of nodes in the possible mergeable subgraphs of the road network. i The index of the node sequence set Q is i; If q1 to q -1 If there is no key-value pair (q1, q) in the ATTR hash table, then the sequence node q is connected. -1 If ), then the new element (q1, q) is added. -1 ): [i]; If the ATTR hash table contains key-value pairs (q1, q -1 If i is added to the key (q1, q), then i will be added to the key (q1, q). -1 The corresponding sequence index list; If q -1 If q1 is connected to the sequence node q, and there is no key-value pair (q) in the ATTR hash table. -1 If q1), then the new element (q) is added. -1 ,q1):[i], if the ATTR hash table contains key-value pairs (q -1 If q1), then add i to the key (q). -1 The list of sequence indices corresponding to q1); Analyzing the hash table ATTR, if a key corresponds to a list with N elements, it means that N subgraph sequences will be connected to adjacent nodes after merging. Therefore, the subgraph sequences in the list cannot be merged simultaneously. Instead, N-1 subgraphs need to be randomly selected, and the first or last node of each of these N-1 subgraph sequences needs to be recursively deleted. Simultaneously, the road network's potentially merged subgraph G needs to be updated. i The set of node sequences Q in the dataset.
4. The road network topology optimization method according to claim 3, characterized in that, Custom field restrictions for determining road network subgraph G i The method to determine whether merging is possible is as follows: After initializing a custom field to limit the set of node sequences Z in the possible merged subgraphs, iterate through the set of node sequences Q in the possible merged subgraphs: For each specific node sequence q, obtain the list of direction attribute fields of the road network link corresponding to the adjacent nodes: val_list=[val(qi, qi+1)], 0≤i<q_length, q_length is the number of elements in sequence q; Find the positions of elements that are identical at least twice in val_list, split q into k node sequences qk from non-contiguous index positions, and then add a custom field to limit the set Z of node sequences that may be merged in the subgraph; Update the set of node sequences Q in the possible merged subgraphs to the initial custom field constraint Z of the possible merged subgraphs.
5. A road network topology optimization method according to claim 4, characterized in that, Based on road network subgraph G i The method for merging road network links and updating the original road network information is as follows: traverse the set of node sequences Q in the possible merged subgraphs, or filter the set of node sequences R in the possible merged subgraphs by direction restriction, or restrict the set of node sequences Z in the possible merged subgraphs by custom fields. For each specific node sequence q, obtain the set of road network link_ids corresponding to adjacent nodes. : Merge the coordinate sequences of the road network links in set l, and update the original road network information; The specific method for merging the coordinate sequences of the road network links in set l is as follows: For a given set l, extract its corresponding set of coordinate sequences C. in, This represents the geometric coordinate sequence of the link between two adjacent nodes, where k is the length of the node sequence q. Iterate through each coordinate sequence c in C: The coordinate direction of the first coordinate sequence c is taken as the topological positive direction of the new road network link and added to the new coordinate sequence new_coords. The coordinates of the topological positive direction endpoint are recorded as des_coords. If it is not the first coordinate sequence, then take the coordinates of its two endpoints and calculate the distance with des_coords respectively. Take the coordinates of the endpoint closest to des_coords as the connection point, take the connection point as the starting point of the topology, add the coordinate sequence into new_coords, update des_coords to the topology endpoint coordinates of new_coords, and obtain the new road network link information.
6. An electronic device, characterized in that, It includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the road network topology optimization method according to any one of claims 1-5.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements a road network topology optimization method according to any one of claims 1-5.
Citation Information
Patent Citations
Method for generating and simplifying road network through melting points based on Kml
CN110928974A
Simplified Road Network KSP Optimization Algorithm
CN111369052B
Road network matching method based on road element synthesis
CN104850824A
Intersection fitting graph, intersection fitting guide graph compilation method and device, and storage medium
CN114116949A