Road network data detection method, device, medium, equipment and computer program product
By grouping and distributing road network data to slave nodes in a distributed data processing system, the problem of difficulty in directly checking global connectivity in the existing technology is solved, and efficient and independent road network data connection is achieved. Property inspection reduces hardware resource requirements.
Patent Information
- Application Number
- CN202410289129.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-13
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2044-03-13
AI Technical Summary
The existing road network data connectivity quality inspection methods are difficult to directly check global connectivity, and traditional solutions require a large amount of memory, resulting in hardware resource dependence, and it is impossible to realize independently running quality inspection modules.
In the distributed data processing system, undirected graph generation and connectivity detection are performed by grouping the master node and allocating the road network data to the slave node. The results of the slave node are fused to obtain the global connectivity quality inspection results, and distributed quality inspection is realized. And optimize the detection efficiency through the simultaneous set algorithm.
It realizes distributed quality inspection with global connectivity, reduces hardware resource requirements, supports horizontal expansion, improves detection performance, and the quality inspection module can be run independently without external dependencies.
Smart Images

Figure CN118012976B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of road network data processing, and in particular, to a road network data detection method, device, medium, equipment and computer program product. Background Art
[0002] Road network data refers to a data set that describes the road network structure in a certain area. These data are usually stored in a digital format and contain information such as road geometry, connection relationships, road grades, road names, travel directions, and road section lengths. Road network data plays an important role in geographic information systems and navigation applications.
[0003] In the process of road network data collection, cleaning, and production, dirty data due to system failures or human factors is inevitable. In order to ensure the production quality of road network data and avoid dirty data from being stored, it is necessary to perform a pre-emptive full data check on the road network data. The check content includes, for example, the shape, attributes, topological relationships, and connectivity of the road network data. Among them, the goal of connectivity detection is to verify whether the global road network data is connected. Summary of the invention
[0004] This summary is provided to introduce concepts in a brief form that will be described in detail in the detailed description below. This summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.
[0005] In a first aspect, the present disclosure provides a road network data detection method, which is applied to a first slave node in a distributed data processing system, and the method comprises:
[0006] Receiving boundary information of road network data sent by a master node in the distributed data processing system, wherein the road network data is any one group of road network data among a plurality of groups of road network data obtained after the master node groups the road network data to be detected;
[0007] Loading the road network data according to the boundary information, and generating an undirected graph corresponding to the road network data, wherein the undirected graph represents a connection relationship between vertices, and the vertices correspond to preset road network elements in the road network data;
[0008] Performing a connectivity test on the undirected graph to obtain a first connectivity test result;
[0009] The first connectivity detection result is sent to the master node, so that the master node determines the target connectivity detection result corresponding to the road network data to be detected according to the first connectivity detection result sent by each of the first slave nodes.
[0010] In a second aspect, a road network data detection method is provided, which is applied to a master node in a distributed data processing system, and the method comprises:
[0011] Perform boundary segmentation on the road network data to be detected to obtain boundary information corresponding to multiple groups of road network data;
[0012] For each group of the road network data, the boundary information of the group of road network data is sent to the first slave node in the distributed data processing system, so that the first slave node generates an undirected graph corresponding to the group of road network data after loading the group of road network data according to the boundary information; the undirected graph represents the connection relationship between vertices, and the vertices correspond to preset road network elements in the road network data;
[0013] Receive a connectivity detection result sent by a target slave node; wherein the target slave node includes the first slave node or the second slave node, and the second slave node is any slave node other than the first slave node in the distributed data processing system; the connectivity detection result includes a first connectivity detection result or a second connectivity detection result, the first connectivity detection result is a connectivity detection result obtained after the first slave node performs a connectivity detection on the undirected graph, and the second connectivity detection result is a connectivity detection result obtained after the second slave node performs a result fusion on the first connectivity detection results sent by multiple first slave nodes;
[0014] The target connectivity detection result corresponding to the road network data to be detected is determined according to the connectivity detection result sent by each of the target slave nodes.
[0015] In a third aspect, a road network data detection device is provided, which is applied to a first slave node in a distributed data processing system, and the device includes:
[0016] A first receiving module is used to receive boundary information of road network data sent by a master node in the distributed data processing system, wherein the road network data is any one group of road network data among a plurality of groups of road network data obtained after the master node groups the road network data to be detected;
[0017] An undirected graph generation module, used to load the road network data according to the boundary information, and generate an undirected graph corresponding to the road network data, wherein the undirected graph represents the connection relationship between vertices, and the vertices correspond to preset road network elements in the road network data;
[0018] A detection module, used to perform connectivity detection on the undirected graph to obtain a first connectivity detection result;
[0019] The first sending module is used to send the first connectivity detection result to the master node, so that the master node determines the target connectivity detection result corresponding to the road network data to be detected according to the first connectivity detection result sent by each of the first slave nodes.
[0020] In a fourth aspect, a road network data detection device is provided, which is applied to a master node in a distributed data processing system, and the device includes:
[0021] A boundary determination module is used to perform boundary segmentation on the road network data to be detected, and obtain boundary information corresponding to multiple groups of road network data;
[0022] A second sending module is used to send the boundary information of each group of the road network data to the first slave node in the distributed data processing system, so that the first slave node generates an undirected graph corresponding to the group of road network data after loading the group of road network data according to the boundary information; the undirected graph represents the connection relationship between vertices, and the vertices correspond to preset road network elements in the road network data;
[0023] A second receiving module is used to receive a connectivity detection result sent by a target slave node; wherein the target slave node includes the first slave node or the second slave node, and the second slave node is any slave node other than the first slave node in the distributed data processing system; the connectivity detection result includes a first connectivity detection result or a second connectivity detection result, the first connectivity detection result is a connectivity detection result obtained after the first slave node performs a connectivity detection on the undirected graph, and the second connectivity detection result is a connectivity detection result obtained after the second slave node performs a result fusion on the first connectivity detection results sent by multiple first slave nodes;
[0024] The detection result determination module is used to determine the target connectivity detection result corresponding to the road network data to be detected according to the connectivity detection result sent by each of the target slave nodes.
[0025] In a fifth aspect, a computer-readable medium is provided, on which a computer program is stored, and when the program is executed by a processing device, the steps of the method described in the first aspect or the second aspect of the present disclosure are implemented.
[0026] In a sixth aspect, an electronic device is provided, including:
[0027] a storage device having a computer program stored thereon;
[0028] A processing device is used to execute the computer program in the storage device to implement the steps of the method described in the first aspect or the second aspect of the present disclosure.
[0029] In a seventh aspect, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the steps of the method described in the first aspect or the second aspect of the present disclosure.
[0030] Through the above technical solution, the first slave node in the distributed data processing system can receive the boundary information of the road network data sent by the master node in the distributed data processing system, and the road network data is any one of the multiple groups of road network data obtained after the master node groups the road network data to be detected; load the road network data according to the boundary information, and generate an undirected graph corresponding to the road network data, the undirected graph represents the connection relationship between vertices, and the vertices correspond to the preset road network elements in the road network data; perform connectivity detection on the undirected graph to obtain a first connectivity detection result; send the first connectivity detection result to the master node, so that the master node determines the target connectivity detection result corresponding to the road network data to be detected according to the first connectivity detection result sent by each of the first slave nodes. In this way, distributed quality inspection of global connectivity is realized based on the graph connectivity detection algorithm, the master node can directly obtain the global connectivity of the road network data to be detected, and the connectivity quality inspection module implemented by this method can run independently without introducing external dependencies.
[0031] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale. In the drawings:
[0033] Figure 1 The figure is a flow chart of a road network data detection method according to an exemplary embodiment.
[0034] Figure 2 is based on Figure 1 The illustrated embodiment shows a flow chart of a road network data detection method.
[0035] Figure 3 It is a schematic diagram of an undirected graph according to an exemplary embodiment.
[0036] Figure 4 is based on Figure 1 The illustrated embodiment shows a flow chart of a road network data detection method.
[0037] Figure 5 The figure is a schematic diagram of a road network data loading process according to an exemplary embodiment.
[0038] Figure 6 is based on Figure 1 The illustrated embodiment shows a flow chart of a road network data detection method.
[0039] Figure 7 The figure is a flow chart of a road network data detection method according to an exemplary embodiment.
[0040] Figure 8 is based on Figure 7 The illustrated embodiment shows a flow chart of a road network data detection method.
[0041] Fig. 9 is based on Figure 7 The illustrated embodiment shows a flow chart of a road network data detection method.
[0042] Fig.10 It is a block diagram of a road network data detection device according to an exemplary embodiment.
[0043] Fig.11 It is a block diagram of a road network data detection device according to an exemplary embodiment.
[0044] Fig.12 A schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0045] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0046] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0047] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0048] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0049] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0050] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0051] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0052] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0053] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0054] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0055] At the same time, it is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
[0056] The present disclosure is mainly applied to the scenario of connectivity detection of road network data. The large-scale road network data connectivity detection method provided in the related art is: first perform a local connectivity detection. Since the road network data is a graph data, the data are connected and interdependent with each other, and the connectivity detection belongs to the global topology detection item, and the data needs to be loaded into the memory at one time before performing the quality inspection. However, due to the huge scale of national road network data, the conventional connectivity detection method is to select a segmentation granularity, divide the full amount of data into several parts, and perform local connectivity detection on each road network data in parallel. For example, the national road network data can be divided into multiple data according to administrative divisions, and each data is quality checked on a separate terminal instance. After completing the connectivity detection in the local area, the coordinate points of different areas are prepared, and the connectivity between regions is verified based on whether the path planning service can plan the route normally.
[0057] However, the large-scale road network data connectivity quality inspection method provided in the relevant technology has the following problems: in the existing schemes that consider global connectivity, the connectivity between regions is usually verified with the assistance of path planning services, and the global connectivity of the road network data cannot be directly checked, thereby introducing additional external dependent services, and the data quality inspection module cannot run independently.
[0058] In addition, when faced with large-scale road network data in related technologies, if one hopes to directly obtain the global connectivity detection results, the traditional solution needs to load all the road network data into the memory at one time for quality inspection, which will result in high memory usage and thus rely on large-scale hardware resources.
[0059] In order to solve the above problems, the present invention provides a road network data detection method, device, medium, equipment and computer program product. The specific implementation of the present invention is described in detail below with reference to the accompanying drawings.
[0060] It should be noted that the road network data detection method provided in the present disclosure is applied to a pre-configured distributed data processing system. The distributed data processing system includes a master node and multiple slave nodes. The master node is mainly responsible for the coordination and control of the entire system, while the slave node performs the tasks assigned by the master node. In the present disclosure, distributed data processing refers to the simultaneous quality inspection and analysis of road network data on multiple computers (i.e., slave nodes), and each slave node sends its own data quality inspection results to the master node so that the master node can determine the quality inspection results of the global road network data.
[0061] Figure 1 It is a flowchart of a road network data detection method according to an exemplary embodiment. The method can be applied to the first slave node in a distributed data processing system. The first slave node can be any slave node in the distributed data processing system that has not been assigned road network data.
[0062] like Figure 1 As shown, the method comprises the following steps:
[0063] In step S101, the boundary information of the road network data sent by the master node in the distributed data processing system is received, and the road network data is any group of road network data among multiple groups of road network data obtained after the master node groups the road network data to be detected.
[0064] Among them, the road network data to be detected may include a data set describing the road network structure in a certain area, and the data set may include, for example, data such as road connection relationships, road grades, travel directions, road names, section lengths, and names of intersections at both ends of the road.
[0065] In the embodiments of the present disclosure, the OSM model (ie, OpenStreetMap XML model) may be used as a data model for carrying road data. Of course, other data models may also be used, including but not limited to Shapefile, GeoJSON, KML, GML and other data models.
[0066] Taking the case where the road network data to be tested is nationwide road network data, due to the large amount of data, it is necessary to divide the road network data to be tested into multiple groups of data through the master node, and then distribute different groups of road network data to different slave nodes in the distributed data processing system for connectivity detection.
[0067] In the present disclosure, the master node can obtain the area range corresponding to the road network data to be detected, and then obtain the road network boundary of the area range on the corresponding map (the road network boundary can be represented by a sequence of position points on the boundary), and then after grid segmentation on the map, multiple map sheets can be obtained, and the map sheet within the road network boundary range is used as the first map sheet, and each first map sheet corresponds to a group of road network data after grouping. Therefore, the boundary information can include the map sheet boundary of the first map sheet corresponding to each group of road network data on the map.
[0068] In step S102, the road network data is loaded according to the boundary information, and an undirected graph corresponding to the road network data is generated, wherein the undirected graph represents the connection relationship between vertices, and the vertices correspond to preset road network elements in the road network data.
[0069] In one embodiment of the present disclosure, the first slave node may obtain location information corresponding to the road network data, and then load the road network data located within and intersecting the map frame boundary to the first slave node based on the location information and the boundary information.
[0070] In addition, the road network data includes data corresponding to at least one road network element, and the road network element may include, for example, an intersection, a road, etc. The preset road network element may include, for example, an intersection and other road network elements that may be abstracted as vertices.
[0071] Since road network data is a kind of graph data, the data are interdependent and interconnected. The points (such as intersections) and lines (such as roads) in the road network data can be abstracted into vertices and edges in an undirected graph. The undirected graph can characterize the connection relationship between vertices, and the network topology relationship of the road network data can be determined based on the undirected graph. Therefore, the road network data may include edge entity data corresponding to the undirected graph and vertex entity data corresponding to the undirected graph. Among them, edge entity data can be understood as road network data corresponding to the edges in the undirected graph (such as roads), and vertex entity data can be understood as road network data corresponding to the vertices in the undirected graph (such as intersections).
[0072] In this way, in the process of generating an undirected graph corresponding to the road network data, this step can use the edge entity data as the edge in the undirected graph, and use the vertex entity data as the vertex in the undirected graph to generate the undirected graph.
[0073] In step S103, a connectivity check is performed on the undirected graph to obtain a first connectivity check result.
[0074] In the present disclosure, connectivity detection of an undirected graph can be achieved by determining the number of connected components included in the undirected graph. A connected component refers to a set consisting of multiple vertices, and there is a path between any two vertices in the same connected component in the undirected graph, that is, these vertices can reach each other. That is, connected components are usually used to describe the connectivity in a graph.
[0075] For an undirected graph, if a graph has only one connected component, then it is a connected graph, otherwise it is a non-connected graph. Any two vertices in a connected graph are connected to each other, so the road network data corresponding to the connected graph is also connected.
[0076] Therefore, the first connectivity detection result may include at least one connected component included in the corresponding undirected graph.
[0077] In step S104, the first connectivity detection result is sent to the master node, so that the master node determines the target connectivity detection result corresponding to the road network data to be detected according to the first connectivity detection result sent by each of the first slave nodes.
[0078] In one implementation, the master node may merge the first connectivity detection results sent by each first slave node to obtain the target connectivity detection result. The target connectivity detection result represents the global connectivity detection result of the road network data to be detected.
[0079] Through the above method, the first slave node in the distributed data processing system can load the road network data based on the boundary information of the road network data sent by the master node, generate an undirected graph of the road network data, and perform connectivity detection on the undirected graph to obtain a first connectivity detection result, and then send the first connectivity detection result to the master node. The master node can determine the target connectivity detection result corresponding to the road network data to be detected based on the first connectivity detection result sent by each of the first slave nodes. In this way, distributed quality inspection of global connectivity is implemented based on the graph connectivity detection algorithm. The master node can directly obtain the global connectivity of the road network data to be detected, rather than the connectivity of multiple local areas corresponding to the road network data to be detected, and the connectivity quality inspection module implemented by this method can run independently without introducing external dependencies.
[0080] In addition, based on the distributed data processing system, the number of slave nodes required can be automatically adjusted according to the amount of road network data to be detected (i.e., supporting the horizontal expansion of slave nodes). And when there are sufficient slave node resources, the detection performance of road network data can be quickly improved without relying on large-scale hardware nodes, thus being able to efficiently, comprehensively, scalably and scalably complete the road network connectivity detection of any scale data set.
[0081] Figure 2 is based on Figure 1 The embodiment shown is a flow chart of a road network data detection method. Figure 2 As shown, step S103 includes the following sub-steps:
[0082] In step S1031, at least one connected component corresponding to the undirected graph is determined according to the connection relationship between each vertex and edge in the undirected graph.
[0083] In this step, at least one connected component corresponding to the undirected graph can be determined by a preset union-find algorithm according to the connection relationship between each vertex and edge in the undirected graph.
[0084] Among them, the union-find set is a data structure used to handle the merging and querying of disjoint sets. The preset union-find set algorithm supports two operations: Find, which finds the representative element of the set where a certain element is located, that is, the root node. Union, which merges two sets into a new set.
[0085] In one implementation of this step, for each vertex in the undirected graph, the vertex can be taken as a set to obtain multiple sets corresponding to the undirected graph; for each edge in the undirected graph, the two vertices corresponding to the edge are determined according to the connection relationship, and the root nodes corresponding to the two vertices are found; when the root nodes corresponding to the two vertices are different, the sets corresponding to the two vertices are merged to obtain multiple initial connected components; for each of the initial connected components, the root node of the initial connected component is determined; at least one initial connected component with the same root node is merged to obtain at least one connected component corresponding to the undirected graph.
[0086] Among them, the process of finding the root nodes corresponding to the two vertices and the root node of each initial connected component can be implemented based on a preset function in a preset union-find algorithm. The specific implementation method can be referred to relevant literature and will not be described in detail here.
[0087] For example, Figure 3 is a schematic diagram of an undirected graph according to an exemplary embodiment. Figure 3 As shown, the undirected graph includes three vertices w1, n1, and n2, as well as edges a and b. For the three vertices w1, n1, and n2 in the undirected graph, the three vertices can be respectively regarded as a set, namely, set A{w1}, set B{n1}, and set C{n2}. For each edge in the undirected graph, according to the connection relationship between each edge and the vertex in the undirected graph, determine the two vertices corresponding to the edge, and find the root nodes corresponding to the two vertices respectively. That is, for edge a, the two vertices connected by edge a are w1 and n1, the set where vertex w1 is located is A{w1}, and the root node of vertex w1 is itself (that is, w1), and the set where vertex n1 is located is B{n1}, and the root node of vertex n1 is itself (that is, n1). It can be seen that the root nodes corresponding to vertices w1 and n1 are different. Since vertices w1 and n1 are connected by edge a, the two sets where vertices w1 and n1 are located are connected. In this way, the set A{w1} can be merged with the set B{n1} to obtain the merged set {w1, n1}. Similarly, based on the two vertices w1 and n2 connected by edge b, the merged set {w1, n2} can be obtained. In this way, based on Figure 3 The undirected graph shown can determine two initial connected components {w1, n1} and {w1, n2}. The above examples are only for illustration and the present disclosure does not limit this.
[0088] After obtaining the initial connected components, for each vertex in the undirected graph, the root node of the initial connected component where the vertex is located can be found, and at least one initial connected component with the same root node can be merged to obtain at least one connected component corresponding to the undirected graph.
[0089] For example, continue with Figure 3 For example, corresponding to Figure 3 The two initial connected components are {w1, n1} and {w1, n2}. The root node of the initial connected component {w1, n1} is w1, and the root node of the initial connected component {w1, n2} is also w1. Then we can continue to merge the two initial connected components to get Figure 3 The undirected graph shown corresponds to a connected component {w1, n1, n2}. The above example is only for illustration and the present disclosure does not limit this.
[0090] In step S1032, the at least one connected component is used as the first connected detection result.
[0091] Figure 4 is based on Figure 1 The embodiment shown is a flow chart of a method for detecting road network data. As described above, the boundary information includes the map frame boundary of the map frame corresponding to the road network data on the map. Figure 4 As shown, step S102 includes the following sub-steps:
[0092] In step S1021, the location information corresponding to the road network data in the map is determined.
[0093] In step S1022, the road network data is loaded according to the location information and the map boundary.
[0094] In one implementation, the road network data located within the map sheet boundary and intersecting with the map sheet boundary may be loaded as target road network data according to the location information.
[0095] As described above, the road network data may include edge entity data in the corresponding undirected graph and vertex entity data in the corresponding undirected graph. Therefore, in this step, the first entity data located within the map frame boundary and intersecting with the map frame boundary may be loaded into the first slave node, the first entity data including the edge entity data and / or the vertex entity data; the second entity data other than the first entity data that has a connection relationship with the first entity data is loaded into the slave node; the third entity data that has a connection relationship with the first entity data and has a connection relationship with the second entity data is loaded into the slave node.
[0096] For example, Figure 5 is a schematic diagram of a road network data loading process according to an exemplary embodiment. Figure 5 As shown, the first slave node needs to load the road network data corresponding to map sheet 1. Figure 5A, B, C, etc. shown in the figure represent vertex entity data, and the line segments a, b, c, d, etc. connecting two vertex entity data represent edge entity data. In order to completely load the road network data, in the present disclosure, the first slave node can perform two steps of data loading: 1. According to the map boundary, recall the first entity data within the boundary and / or intersecting the boundary (such as Figure 5 , and the node entity data A, B in the figure and the edge entity data a, b, c, d, e intersecting the boundary of the map sheet 1, as well as the second entity data (such as Figure 5 2. The third entity data (such as the node entity data C, D, E, F in the figure) that has a dependency relationship with the first entity data and has a dependency relationship with the second entity data and has not yet been loaded into the slave node Figure 5 The edge entity data f, g, h, i, j, k) associated with C, D, E, and F are additionally loaded. The above examples are only for illustration and are not limited in the present disclosure.
[0097] In order to improve the detection efficiency of road network data, in another possible implementation of the present disclosure, it is not necessary to wait for all first slave nodes to complete their respective road network connectivity detection. By setting multiple second slave nodes, each second slave node fuses the first connectivity detection results of multiple first slave nodes that have partially completed the road network connectivity detection, and then the second slave node sends the fused second connectivity detection results to the master node, so that the master node merges them into a large union-find set through a multi-path merging algorithm, thereby obtaining the final global connectivity detection result.
[0098] Figure 6 is based on Figure 1 The embodiment shown is a flow chart of a road network data detection method, such as Figure 6 As shown, the method further comprises the following steps:
[0099] In step S105, the first connectivity detection result is sent to the second slave node in the distributed data processing system, so that the second slave node obtains a second connectivity detection result after fusing the first connectivity detection results received from multiple first slave nodes, and sends the second connectivity detection result to the master node.
[0100] In this way, the master node can also determine the target connectivity detection result according to the second connectivity detection result sent by each of the second slave nodes.
[0101] The second slave node is any slave node in the distributed data processing system except the first slave node.
[0102] For example, assuming that a second slave node can fuse the first connectivity detection results obtained by 10 first slave nodes, then the first second slave node can fuse the first connectivity detection results obtained after the first 10 connectivity detections are completed to obtain the second connectivity detection result, and the second second slave node can fuse the first connectivity detection results obtained after the 11th to 20th connectivity detections are completed to obtain the second connectivity detection result, and so on. Each second slave node sends the second connectivity detection result obtained after fusion to the master node, so that the master node obtains the target connectivity detection result after fusion of multiple second connectivity detection results.
[0103] In one embodiment, the first connectivity detection result includes at least one connectivity component corresponding to the undirected graph, and each connectivity component includes at least one vertex in the undirected graph corresponding to the road network data. In the process of fusing the multiple first connectivity detection results to obtain the second connectivity detection result, the second slave node can determine the first connectivity components containing the same vertex from the connectivity components received from the multiple first slave nodes, and then merge the first connectivity components to obtain the second connectivity detection result.
[0104] As described above, any two vertices in the same connected component are connected in an undirected graph, so if two connected components contain the same vertex, the two connected components are also connected. Therefore, the first connected components containing the same vertex can be merged to obtain a second connectivity detection result.
[0105] By adopting the above method, the first slave node in the distributed data processing system can load the road network data according to the boundary information of the road network data sent by the master node, generate an undirected graph of the road network data, and perform connectivity detection on the undirected graph to obtain a first connectivity detection result, and then send the first connectivity detection result to the master node. The master node can determine the target connectivity detection result corresponding to the road network data to be detected based on the first connectivity detection result sent by each of the first slave nodes. In this way, distributed quality inspection of global connectivity is implemented based on the graph connectivity detection algorithm. The master node can directly obtain the global connectivity of the road network data to be detected, rather than the connectivity of multiple local areas corresponding to the road network data to be detected, and the connectivity quality inspection module implemented by this method can run independently without introducing external dependencies.
[0106] In addition, based on the distributed data processing system, the number of slave nodes required can be automatically adjusted according to the amount of road network data to be detected (i.e., supporting the horizontal expansion of slave nodes). And when there are sufficient slave node resources, the detection performance of road network data can be quickly improved without relying on large-scale hardware nodes, thus being able to efficiently, comprehensively, scalably and scalably complete the road network connectivity detection of any scale data set.
[0107] The following describes the implementation of the road network data detection method by taking the master node in the distributed file system as the execution subject.
[0108] Figure 7 is a flow chart of a road network data detection method according to an exemplary embodiment. The method can be applied to a master node in a distributed data processing system, such as Figure 7 As shown, the method comprises the following steps:
[0109] In step S701, the road network data to be detected is segmented by boundaries to obtain boundary information corresponding to multiple groups of road network data.
[0110] Among them, the road network data to be detected may include a data set describing the road network structure in a certain area, and the data set may include, for example, data such as road connection relationships, road grades, travel directions, road names, section lengths, and names of intersections at both ends of the road.
[0111] Taking the case where the road network data to be tested is nationwide road network data, due to the large amount of data, it is necessary to divide the road network data to be tested into multiple groups of data, and then assign different groups of road network data to different slave nodes in the distributed data processing system for separate data processing.
[0112] In one implementation of this step, the road network boundary of the road network data to be detected and the zoom parameters of the map corresponding to the road network data to be detected can be obtained; the map is divided according to the zoom parameters and the road network boundary to obtain multiple map sheets, each map sheet within the road network boundary corresponds to a group of road network data after grouping, that is, the map sheets within the road network boundary correspond one-to-one to each group of the road network data, and the boundary information includes the map sheet boundaries of the map sheets corresponding to each group of road network data on the map.
[0113] In the process of dividing the map corresponding to the road network data to be detected into grids, the size of the grid after division is also related to the zoom parameter of the map, which may include the map zoom level (or "zoom level"). Generally, there is a preset corresponding relationship between the zoom level of the map and the number of sheets obtained by dividing the map into grids, and the higher the zoom level of the map, the more sheets of the corresponding sheets after division, and accordingly, the smaller the area corresponding to a single sheet of the map.
[0114] In step S702, for each group of the road network data, the boundary information of the group of road network data is sent to the first slave node in the distributed data processing system, so that the first slave node generates an undirected graph corresponding to the group of road network data after loading the group of road network data according to the boundary information; the undirected graph represents the connection relationship between vertices, and the vertices correspond to preset road network elements in the road network data.
[0115] After executing step S701, the area corresponding to the road network data to be detected may be divided into a plurality of map sheets on the map, and the road network data corresponding to the area corresponding to each map sheet is a group of road network data.
[0116] In this step, the master node can send the map boundary of each group of road network data corresponding to the map to the first slave node. The first slave node can be any slave node in the distributed data processing system that is not assigned with road network data, and the master node can randomly assign the first slave node to each group of road network data.
[0117] It should be noted that the process management layer can be configured on the master node, which is responsible for resource scheduling, configuration management, data processing reporting, monitoring and alarming when the road network data detection tasks of multiple slave nodes in the distributed data processing system are executed in parallel.
[0118] In addition, the road network data includes data corresponding to at least one road network element, and the road network element may include, for example, an intersection, a road, etc. The preset road network element may include, for example, an intersection and other road network elements that may be abstracted as vertices.
[0119] Since road network data is a kind of graph data, the data are interdependent and interconnected. The points (such as intersections) and lines (such as roads) in the road network data can be abstracted into vertices and edges in an undirected graph. The undirected graph can characterize the connection relationship between vertices, and the network topology relationship of the road network data can be determined based on the undirected graph. Therefore, the road network data may include edge entity data corresponding to the undirected graph and vertex entity data corresponding to the undirected graph. Among them, edge entity data can be understood as road network data corresponding to the edges in the undirected graph (such as roads), and vertex entity data can be understood as road network data corresponding to the vertices in the undirected graph (such as intersections).
[0120] In step S703, a connectivity detection result sent by a target slave node is received; wherein the target slave node includes the first slave node or the second slave node.
[0121] Among them, the second slave node is any slave node in the distributed data processing system except the first slave node; the connectivity detection result includes a first connectivity detection result sent by the first slave node or a second connectivity detection result sent by the second slave node, the first connectivity detection result is a connectivity detection result obtained after the first slave node performs a connectivity detection on the undirected graph, and the second connectivity detection result is a connectivity detection result obtained after the second slave node fuses the first connectivity detection results sent by multiple first slave nodes.
[0122] That is to say, in one embodiment of the present disclosure, the first slave node can directly send the first connectivity detection result after the connectivity detection of the road network data assigned by the master node to the master node, so that the master node can obtain the target connectivity detection result after the result fusion of multiple first connectivity detection results sent by multiple first slave nodes. Among them, the first connectivity detection result represents the regional connectivity quality inspection result corresponding to the road network data configured to the first slave node. The target connectivity detection result represents the global connectivity quality inspection result of the road network data to be detected.
[0123] In another embodiment of the present disclosure, the first slave node may also send the first connectivity detection result after performing connectivity detection on the road network data allocated by the master node to the second slave node, so that the second slave node obtains the second connectivity detection result after fusing the first connectivity detection results sent by multiple first slave nodes, and then the second slave node sends the second connectivity detection result to the master node, so that the master node obtains the target connectivity detection result after fusing the multiple second connectivity detection results sent by multiple second slave nodes. It should be noted that the second connectivity detection result is obtained by fusing the first connectivity detection results determined by some of the first slave nodes in the distributed data processing system, but the target connectivity detection result is obtained by fusing the first connectivity detection results determined by all the first slave nodes in the distributed data processing system.
[0124] In step S704, the target connectivity detection result corresponding to the road network data to be detected is determined according to the connectivity detection result sent by each of the target slave nodes.
[0125] In this step, the master node may perform result fusion on the first connectivity detection result sent by the first slave node to obtain the target connectivity detection result. Alternatively, the master node may perform result fusion on the second connectivity detection result sent by the second slave node to obtain the target connectivity detection result.
[0126] By adopting the above method, the first slave node in the distributed data processing system can load the road network data based on the boundary information of the road network data sent by the master node, generate an undirected graph of the road network data, and perform connectivity detection on the undirected graph to obtain a first connectivity detection result, and then send the first connectivity detection result to the master node. The master node can determine the target connectivity detection result corresponding to the road network data to be detected based on the first connectivity detection result sent by each of the first slave nodes, or can also determine the target connectivity detection result based on the second connectivity detection result sent by each of the second slave nodes. In this way, distributed quality inspection of global connectivity is implemented based on the graph connectivity detection algorithm. The master node can directly obtain the global connectivity of the road network data to be detected, rather than the connectivity of multiple local areas corresponding to the road network data to be detected, and the connectivity quality inspection module implemented by this method can run independently without introducing external dependencies.
[0127] In addition, based on the distributed data processing system, the number of slave nodes required can be automatically adjusted according to the amount of road network data to be detected (i.e., supporting the horizontal expansion of slave nodes). And when there are sufficient slave node resources, the detection performance of road network data can be quickly improved without relying on large-scale hardware nodes, thus being able to efficiently, comprehensively, scalably and scalably complete the road network connectivity detection of any scale data set.
[0128] Figure 8 is based on Figure 7 The embodiment shown is a flow chart of a road network data detection method. In the present disclosure, the first connectivity detection result includes at least one connected component corresponding to the undirected graph, and each connected component includes at least one vertex in the undirected graph. Figure 8 As shown, step 704 includes the following sub-steps:
[0129] In step S7041, a second connected component including the same vertex is determined from the connected components sent by the plurality of first slave nodes.
[0130] A connected component usually refers to a set of multiple vertices. In an undirected graph, there is a path between any two vertices in the same connected component, that is, these vertices can reach each other. If two connected components contain the same vertices, the two connected components are also connected, so the second connected components containing the same vertices can be merged.
[0131] In step S7042, after merging the second connected components, the number of connected components is determined, and the number of connected components is used as the target connectivity detection result.
[0132] It can be understood that if the undirected graph corresponding to the road network data to be detected includes only one connected component, then the undirected graph is a connected graph, otherwise it is a non-connected graph. Any two vertices in the connected graph are connected to each other, so the road network data to be detected corresponding to the connected graph is also connected.
[0133] Therefore, the number of connected components can be used as the target connectivity detection result, so that when it is determined that the number of connected components is a preset number (such as 1), it is determined that the road network data to be detected is connected. When it is determined that the number of connected components is greater than the preset number, it is determined that the road network data to be detected is not connected.
[0134] In order to improve the detection efficiency of road network data, in another possible implementation of the present disclosure, it is not necessary to wait for all first slave nodes to complete their respective road network connectivity detection. By setting multiple second slave nodes, each second slave node fuses the first connectivity detection results of multiple first slave nodes that have partially completed the road network connectivity detection, and then the second slave node sends the fused second connectivity detection results to the master node, so that the master node merges them into a large union-find set through a multi-path merging algorithm, thereby obtaining the final global connectivity detection result.
[0135] Fig. 9 is based on Figure 7 The embodiment shown is a flow chart of a road network data detection method. In the present disclosure, the second connectivity detection result includes at least one connected component after the second slave node merges the first connected components; the first connected component is a connected component containing the same vertex determined by the second slave node from the connected components sent by the multiple first slave nodes.
[0136] like Fig. 9 As shown, step S704 includes the following sub-steps:
[0137] In step S7043, a third connected component including the same vertex is determined from the connected components sent by the plurality of second slave nodes;
[0138] In step S7044, after merging the third connected components, the number of connected components is determined, and the number of connected components is used as the target connectivity detection result.
[0139] If two connected components contain the same vertex, the two connected components are also connected. Therefore, the master node can merge the third connected component containing the same vertex to obtain the target connectivity detection result that represents the global connectivity of the road network data to be detected.
[0140] Fig.10is a block diagram of a road network data detection device according to an exemplary embodiment, the device can be applied to the first slave node in a distributed data processing system, such as Fig.10 As shown, the device comprises:
[0141] The first receiving module 1001 is used to receive the boundary information of the road network data sent by the master node in the distributed data processing system, wherein the road network data is any one group of road network data among the multiple groups of road network data obtained after the master node groups the road network data to be detected;
[0142] An undirected graph generation module 1002, used to load the road network data according to the boundary information, and generate an undirected graph corresponding to the road network data, wherein the undirected graph represents the connection relationship between vertices, and the vertices correspond to preset road network elements in the road network data;
[0143] A detection module 1003 is used to perform a connectivity detection on the undirected graph to obtain a first connectivity detection result;
[0144] The first sending module 1004 is used to send the first connectivity detection result to the master node, so that the master node determines the target connectivity detection result corresponding to the road network data to be detected according to the first connectivity detection result sent by each of the first slave nodes.
[0145] Optionally, the detection module 1003 is used to determine at least one connected component corresponding to the undirected graph according to the connection relationship between each vertex and edge in the undirected graph; and use the at least one connected component as the first connectivity detection result.
[0146] Optionally, the detection module 1003 is used to determine at least one connected component corresponding to the undirected graph by a preset union-find algorithm according to the connection relationship between each vertex and edge in the undirected graph.
[0147] Optionally, the detection module 1003 is used to, for each vertex in the undirected graph, take the vertex as a set to obtain multiple sets corresponding to the undirected graph; for each edge in the undirected graph, determine the two vertices corresponding to the edge according to the connection relationship, and find the root nodes corresponding to the two vertices respectively; when the root nodes corresponding to the two vertices are different, merge the sets corresponding to the two vertices respectively to obtain multiple initial connected components; for each of the initial connected components, determine the root node of the initial connected component; merge at least one initial connected component with the same root node to obtain at least one connected component corresponding to the undirected graph.
[0148] Optionally, the boundary information includes the map sheet boundary of the road network data corresponding to the map sheet on the map; the undirected graph generation module 1002 is used to determine the location information corresponding to the road network data in the map; and load the road network data according to the location information and the map sheet boundary.
[0149] Optionally, the undirected graph generating module 1002 is used to load the road network data located within the map sheet boundary and intersecting with the map sheet boundary as the target road network data according to the position information.
[0150] Optionally, the road network data includes edge entity data corresponding to the undirected graph and vertex entity data corresponding to the undirected graph; the undirected graph generation module 1002 is used to generate the undirected graph by using the edge entity data as the edges in the undirected graph and the vertex entity data as the vertices in the undirected graph.
[0151] Optionally, the first sending module 1004 is also used to send the first connectivity detection result to a second slave node in the distributed data processing system, so that the second slave node obtains a second connectivity detection result after fusing the first connectivity detection results sent by multiple first slave nodes, and sends the second connectivity detection result to the master node, so that the master node determines the target connectivity detection result based on the second connectivity detection result sent by each second slave node; wherein the second slave node is any slave node in the distributed data processing system except the first slave node.
[0152] Optionally, the first connectivity detection result includes at least one connected component corresponding to the undirected graph, each connected component includes at least one vertex in the undirected graph corresponding to the road network data, and the result fusion includes:
[0153] Determining, from the connected components sent by the plurality of first slave nodes, first connected components including the same vertex;
[0154] After merging the first connected components, the second connected detection result is obtained.
[0155] Fig.11 is a block diagram of a road network data detection device according to an exemplary embodiment, the device is applied to a master node in a distributed data processing system, such as Fig.11 As shown, the device comprises:
[0156] The boundary determination module 1101 is used to perform boundary segmentation on the road network data to be detected, and obtain boundary information corresponding to multiple groups of road network data;
[0157] The second sending module 1102 is used to send the boundary information of each group of the road network data to the first slave node in the distributed data processing system, so that the first slave node generates an undirected graph corresponding to the group of road network data after loading the group of road network data according to the boundary information; the undirected graph represents the connection relationship between vertices, and the vertices correspond to the preset road network elements in the road network data;
[0158] The second receiving module 1103 is used to receive a connectivity detection result sent by a target slave node; wherein the target slave node includes the first slave node or the second slave node, and the second slave node is any slave node other than the first slave node in the distributed data processing system; the connectivity detection result includes a first connectivity detection result or a second connectivity detection result, the first connectivity detection result is a connectivity detection result obtained after the first slave node performs a connectivity detection on the undirected graph, and the second connectivity detection result is a connectivity detection result obtained after the second slave node performs a result fusion on the first connectivity detection results sent by multiple first slave nodes;
[0159] The detection result determination module 1104 is used to determine the target connectivity detection result corresponding to the road network data to be detected according to the connectivity detection result sent by each of the target slave nodes.
[0160] Optionally, the first connectivity detection result includes at least one connected component corresponding to the undirected graph, and each connected component includes at least one vertex in the undirected graph;
[0161] The detection result determination module 1104 is used to determine the second connected components containing the same vertices from the connected components sent by multiple first slave nodes; after merging the second connected components, determine the number of connected components; and use the number of connected components as the target connectivity detection result.
[0162] Optionally, the second connectivity detection result includes at least one connected component after the second slave node merges the first connected components; the first connected component is a connected component containing the same vertex determined by the second slave node from the connected components sent by the multiple first slave nodes;
[0163] The detection result determination module 1104 is used to determine the third connected components containing the same vertices from the connected components sent by multiple second slave nodes; after merging the third connected components, determine the number of connected components; and use the number of connected components as the target connectivity detection result.
[0164] Optionally, when the number of connected components is a preset number, it is determined that the road network data to be detected is connected.
[0165] Optionally, the boundary determination module 1101 is used to obtain the road network boundary of the road network data to be detected, and the zoom parameter of the map corresponding to the road network data to be detected; the map is divided according to the zoom parameter and the road network boundary to obtain multiple map sheets, and the map sheets correspond one-to-one to each group of the road network data, and the boundary information includes the map sheet boundaries of the map sheets corresponding to each group of road network data on the map.
[0166] Reference below Fig.12 , which shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig.12 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0167] like Fig.12 As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0168] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Fig.12 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0169] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0170] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0171] In some embodiments, the server can communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0172] The computer-readable medium may be included in the electronic device, or may exist independently without being installed in the electronic device.
[0173] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: receives the boundary information of the road network data sent by the master node in the distributed data processing system, and the road network data is any group of road network data in the multiple groups of road network data obtained after the master node groups the road network data to be detected; loads the road network data according to the boundary information, and generates an undirected graph corresponding to the road network data, the undirected graph represents the connection relationship between vertices, and the vertices correspond to preset road network elements in the road network data; performs connectivity detection on the undirected graph to obtain a first connectivity detection result; sends the first connectivity detection result to the master node, so that the master node determines the target connectivity detection result corresponding to the road network data to be detected according to the first connectivity detection result sent by each of the first slave nodes.
[0174] Alternatively, the computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: performs boundary segmentation on the road network data to be detected to obtain boundary information corresponding to multiple groups of road network data; for each group of the road network data, sends the boundary information of the group of road network data to the first slave node in the distributed data processing system, so that the first slave node generates an undirected graph corresponding to the group of road network data after loading the group of road network data according to the boundary information; receives the connectivity detection result sent by the target slave node; wherein the target slave node includes the first slave node or the second slave node, and the second slave node is any slave node in the distributed data processing system except the first slave node; the connectivity detection result includes the first connectivity detection result or the second connectivity detection result, the first connectivity detection result is the connectivity detection result obtained after the first slave node performs connectivity detection on the undirected graph, and the second connectivity detection result is the connectivity detection result obtained after the second slave node performs result fusion on the first connectivity detection results sent by the multiple first slave nodes; determine the target connectivity detection result corresponding to the road network data to be detected according to the connectivity detection result sent by each of the target slave nodes.
[0175] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0176] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0177] The modules involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a module does not limit the module itself in some cases. For example, the first receiving module may also be described as a "module for receiving boundary information".
[0178] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0179] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0180] According to one or more embodiments of the present disclosure, Example 1 provides a road network data detection method, which is applied to a first slave node in a distributed data processing system, and the method includes:
[0181] Receiving boundary information of road network data sent by a master node in the distributed data processing system, wherein the road network data is any one group of road network data among a plurality of groups of road network data obtained after the master node groups the road network data to be detected;
[0182] Loading the road network data according to the boundary information, and generating an undirected graph corresponding to the road network data, wherein the undirected graph represents a connection relationship between vertices, and the vertices correspond to preset road network elements in the road network data;
[0183] Performing a connectivity test on the undirected graph to obtain a first connectivity test result;
[0184] The first connectivity detection result is sent to the master node, so that the master node determines the target connectivity detection result corresponding to the road network data to be detected according to the first connectivity detection result sent by each of the first slave nodes.
[0185] According to one or more embodiments of the present disclosure, Example 2 provides the method of Example 1, wherein performing connectivity detection on the undirected graph to obtain a first connectivity detection result includes:
[0186] Determine at least one connected component corresponding to the undirected graph according to a connection relationship between each vertex and an edge in the undirected graph;
[0187] The at least one connected component is used as the first connected detection result.
[0188] According to one or more embodiments of the present disclosure, Example 3 provides the method of Example 2, wherein determining at least one connected component corresponding to the undirected graph according to the connection relationship between each vertex and the edge in the undirected graph includes:
[0189] According to the connection relationship between each vertex and the edge in the undirected graph, at least one connected component corresponding to the undirected graph is determined by a preset union-find algorithm.
[0190] According to one or more embodiments of the present disclosure, Example 4 provides the method of Example 3, wherein determining the connected components corresponding to the undirected graph by a preset union-find algorithm according to the connection relationship between each vertex and the edge in the undirected graph includes:
[0191] For each vertex in the undirected graph, take the vertex as a set to obtain multiple sets corresponding to the undirected graph;
[0192] For each edge in the undirected graph, determine two vertices corresponding to the edge according to the connection relationship, and search for root nodes corresponding to the two vertices respectively;
[0193] When the root nodes corresponding to the two vertices are different, merging the sets corresponding to the two vertices to obtain a plurality of initial connected components;
[0194] For each of the initial connected components, determining a root node of the initial connected component;
[0195] At least one initial connected component with the same root node is merged to obtain at least one connected component corresponding to the undirected graph.
[0196] According to one or more embodiments of the present disclosure, Example 5 provides the method of Example 1, wherein the boundary information includes a map sheet boundary of a map sheet corresponding to the road network data on a map; and loading the road network data according to the boundary information includes:
[0197] Determine the location information corresponding to the road network data in the map;
[0198] The road network data is loaded according to the location information and the map boundary.
[0199] According to one or more embodiments of the present disclosure, Example 6 provides the method of Example 5, wherein loading the road network data according to the location information and the map frame boundary includes:
[0200] According to the position information, the road network data located within the map sheet boundary and intersecting with the map sheet boundary is loaded as the target road network data.
[0201] According to one or more embodiments of the present disclosure, Example 7 provides the method of Example 1, wherein the road network data includes edge entity data corresponding to the undirected graph and vertex entity data corresponding to the undirected graph;
[0202] The generating of the undirected graph corresponding to the road network data comprises:
[0203] The edge entity data is used as the edge in the undirected graph, and the vertex entity data is used as the vertex in the undirected graph to generate the undirected graph.
[0204] According to one or more embodiments of the present disclosure, Example 8 provides the method of any one of Examples 1-7, wherein the method further includes:
[0205] Sending the first connectivity detection result to a second slave node in the distributed data processing system, so that the second slave node obtains a second connectivity detection result after fusing the first connectivity detection results received from multiple first slave nodes, and sending the second connectivity detection result to the master node, so that the master node determines the target connectivity detection result according to the second connectivity detection result sent by each of the second slave nodes;
[0206] The second slave node is any slave node in the distributed data processing system except the first slave node.
[0207] According to one or more embodiments of the present disclosure, Example 9 provides the method of Example 8, wherein the first connectivity detection result includes at least one connected component corresponding to the undirected graph, each connected component includes at least one vertex in the undirected graph corresponding to the road network data, and the result fusion includes:
[0208] Determining, from the connected components sent by the plurality of first slave nodes, first connected components including the same vertex;
[0209] After merging the first connected components, the second connected detection result is obtained.
[0210] According to one or more embodiments of the present disclosure, Example 10 provides a road network data detection method, which is applied to a master node of a distributed data processing system, and the method includes:
[0211] Perform boundary segmentation on the road network data to be detected to obtain boundary information corresponding to multiple groups of road network data;
[0212] For each group of the road network data, the boundary information of the group of road network data is sent to the first slave node in the distributed data processing system, so that the first slave node generates an undirected graph corresponding to the group of road network data after loading the group of road network data according to the boundary information; the undirected graph represents the connection relationship between vertices, and the vertices correspond to preset road network elements in the road network data;
[0213] Receive a connectivity detection result sent by a target slave node; wherein the target slave node includes the first slave node or the second slave node, and the second slave node is any slave node other than the first slave node in the distributed data processing system; the connectivity detection result includes a first connectivity detection result or a second connectivity detection result, the first connectivity detection result is a connectivity detection result obtained after the first slave node performs a connectivity detection on the undirected graph, and the second connectivity detection result is a connectivity detection result obtained after the second slave node performs a result fusion on the first connectivity detection results sent by multiple first slave nodes;
[0214] The target connectivity detection result corresponding to the road network data to be detected is determined according to the connectivity detection result sent by each of the target slave nodes.
[0215] According to one or more embodiments of the present disclosure, Example 11 provides the method of Example 10, wherein the first connectivity detection result includes at least one connected component corresponding to the undirected graph, and each connected component includes at least one vertex in the undirected graph;
[0216] Determining the target connectivity detection result corresponding to the road network data to be detected according to the connectivity detection result sent by each of the target slave nodes includes:
[0217] Determining, from the plurality of connected components sent from the first slave nodes, a second connected component including the same vertex;
[0218] After merging the second connected components, determining the number of connected components;
[0219] The number of connected components is used as the target connectivity detection result.
[0220] According to one or more embodiments of the present disclosure, Example 12 provides the method of Example 10, wherein the second connectivity detection result includes at least one connected component after the second slave node merges the first connected components; the first connected component is a connected component containing the same vertex determined by the second slave node from the connected components sent by the multiple first slave nodes;
[0221] Determining the target connectivity detection result corresponding to the road network data to be detected according to the connectivity detection result sent by each of the target slave nodes includes:
[0222] Determining a third connected component including the same vertex from the plurality of connected components sent from the second slave nodes;
[0223] After merging the third connected components, determining the number of connected components;
[0224] The number of connected components is used as the target connectivity detection result.
[0225] According to one or more embodiments of the present disclosure, Example 13 provides the method of Example 11 or 12, and determines that the road network data to be detected is connected when the number of the connected components is a preset number.
[0226] According to one or more embodiments of the present disclosure, Example 14 provides the method of Example 10, wherein the boundary segmentation of the road network data to be detected to obtain boundary information corresponding to multiple groups of road network data includes:
[0227] Acquire the road network boundary of the road network data to be detected and the scaling parameters of the map corresponding to the road network data to be detected;
[0228] The map is segmented according to the zoom parameter and the road network boundary to obtain a plurality of map sheets, wherein the map sheets correspond one-to-one to each group of the road network data, and the boundary information includes the map sheet boundaries on the map of the map sheets corresponding to each group of road network data.
[0229] According to one or more embodiments of the present disclosure, Example 15 provides a road network data detection device, which is applied to a first slave node in a distributed data processing system, and the device includes:
[0230] A first receiving module is used to receive boundary information of road network data sent by a master node in the distributed data processing system, wherein the road network data is any one group of road network data among a plurality of groups of road network data obtained after the master node groups the road network data to be detected;
[0231] An undirected graph generation module, used to load the road network data according to the boundary information, and generate an undirected graph corresponding to the road network data, wherein the undirected graph represents the connection relationship between vertices, and the vertices correspond to preset road network elements in the road network data;
[0232] A detection module, used to perform connectivity detection on the undirected graph to obtain a first connectivity detection result;
[0233] The first sending module is used to send the first connectivity detection result to the master node, so that the master node determines the target connectivity detection result corresponding to the road network data to be detected according to the first connectivity detection result sent by each of the first slave nodes.
[0234] According to one or more embodiments of the present disclosure, Example 16 provides a road network data detection device, which is applied to a master node in a distributed data processing system, and the device includes:
[0235] A boundary determination module is used to perform boundary segmentation on the road network data to be detected, and obtain boundary information corresponding to multiple groups of road network data;
[0236] A second sending module is used to send the boundary information of each group of the road network data to the first slave node in the distributed data processing system, so that the first slave node generates an undirected graph corresponding to the group of road network data after loading the group of road network data according to the boundary information; the undirected graph represents the connection relationship between vertices, and the vertices correspond to preset road network elements in the road network data;
[0237] A second receiving module is used to receive a connectivity detection result sent by a target slave node; wherein the target slave node includes the first slave node or the second slave node, and the second slave node is any slave node other than the first slave node in the distributed data processing system; the connectivity detection result includes a first connectivity detection result or a second connectivity detection result, the first connectivity detection result is a connectivity detection result obtained after the first slave node performs a connectivity detection on the undirected graph, and the second connectivity detection result is a connectivity detection result obtained after the second slave node performs a result fusion on the first connectivity detection results sent by multiple first slave nodes;
[0238] The detection result determination module is used to determine the target connectivity detection result corresponding to the road network data to be detected according to the connectivity detection result sent by each of the target slave nodes.
[0239] According to one or more embodiments of the present disclosure, Example 17 provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of the method described in any one of Examples 1-9 or 10-14.
[0240] According to one or more embodiments of the present disclosure, Example 18 provides an electronic device, including:
[0241] a storage device having a computer program stored thereon;
[0242] A processing device is used to execute the computer program in the storage device to implement the steps of the method described in any one of Examples 1-9 or 10-14.
[0243] According to one or more embodiments of the present disclosure, Example 19 provides a computer program product, including a computer program, which implements the steps of the method described in any one of Examples 1-9 or 10-14 when executed by a processor.
[0244] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0245] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0246] Although the subject matter has been described in language specific to structural features and / or method logic actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims. Regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Claims
1. A road network data detection method, characterized in that: Applied to a first slave node in a distributed data processing system, the method comprises: Receiving boundary information of road network data sent by a master node in the distributed data processing system, wherein the road network data is any one group of road network data among a plurality of groups of road network data obtained after the master node groups the road network data to be detected; Loading the road network data according to the boundary information, and generating an undirected graph corresponding to the road network data, wherein the undirected graph represents a connection relationship between vertices, and the vertices correspond to preset road network elements in the road network data; According to the connection relationship between each vertex and the edge in the undirected graph, determine at least one connected component corresponding to the undirected graph by a preset union-find algorithm, and use the at least one connected component as a first connectivity detection result; The first connectivity detection result is sent to the master node, so that the master node determines the target connectivity detection result corresponding to the road network data to be detected according to the first connectivity detection result sent by each of the first slave nodes.
2. The method according to claim 1, characterized in that The step of determining at least one connected component corresponding to the undirected graph by a preset union-find algorithm according to the connection relationship between each vertex and the edge in the undirected graph comprises: For each vertex in the undirected graph, take the vertex as a set to obtain multiple sets corresponding to the undirected graph; For each edge in the undirected graph, determine two vertices corresponding to the edge according to the connection relationship, and search for root nodes corresponding to the two vertices respectively; When the root nodes corresponding to the two vertices are different, merging the sets corresponding to the two vertices to obtain a plurality of initial connected components; For each of the initial connected components, determining a root node of the initial connected component; At least one initial connected component with the same root node is merged to obtain at least one connected component corresponding to the undirected graph.
3. The method according to claim 1, characterized in that The boundary information includes the map sheet boundary of the road network data corresponding to the map sheet on the map; and loading the road network data according to the boundary information includes: Determine the location information corresponding to the road network data in the map; The road network data is loaded according to the location information and the map boundary.
4. The method according to claim 3, characterized in that The loading of the road network data according to the location information and the map boundary comprises: According to the position information, the road network data located within the map sheet boundary and intersecting with the map sheet boundary is loaded as the target road network data.
5. The method according to claim 1, characterized in that The road network data includes edge entity data corresponding to the undirected graph and vertex entity data corresponding to the undirected graph; The generating of the undirected graph corresponding to the road network data comprises: The edge entity data is used as the edge in the undirected graph, and the vertex entity data is used as the vertex in the undirected graph to generate the undirected graph.
6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: Sending the first connectivity detection result to a second slave node in the distributed data processing system, so that the second slave node obtains a second connectivity detection result after fusing the first connectivity detection results received from multiple first slave nodes, and sending the second connectivity detection result to the master node, so that the master node determines the target connectivity detection result according to the second connectivity detection result sent by each of the second slave nodes; The second slave node is any slave node in the distributed data processing system except the first slave node.
7. The method according to claim 6, characterized in that The first connectivity detection result includes at least one connectivity component corresponding to the undirected graph, each connectivity component includes at least one vertex in the undirected graph corresponding to the road network data, and the result fusion includes: Determining, from the connected components sent by the plurality of first slave nodes, first connected components including the same vertex; After merging the first connected components, the second connected detection result is obtained.
8. A road network data detection method, characterized in that: Applied to a master node in a distributed data processing system, the method comprises: Perform boundary segmentation on the road network data to be detected to obtain boundary information corresponding to multiple groups of road network data; For each group of the road network data, the boundary information of the group of road network data is sent to the first slave node in the distributed data processing system, so that the first slave node generates an undirected graph corresponding to the group of road network data after loading the group of road network data according to the boundary information; the undirected graph represents the connection relationship between vertices, and the vertices correspond to preset road network elements in the road network data; Receive a connectivity detection result sent by a target slave node; wherein the target slave node includes the first slave node or the second slave node, and the second slave node is any slave node other than the first slave node in the distributed data processing system; the connectivity detection result includes a first connectivity detection result or a second connectivity detection result, and the first connectivity detection result is at least one connected component corresponding to the undirected graph determined by the first slave node through a preset union-find algorithm according to the connection relationship between each vertex and edge in the undirected graph; the second connectivity detection result is a connectivity detection result obtained by the second slave node after fusing the first connectivity detection results sent by multiple first slave nodes received; The target connectivity detection result corresponding to the road network data to be detected is determined according to the connectivity detection result sent by each of the target slave nodes.
9. The method according to claim 8, characterized in that Each connected component includes at least one vertex in the undirected graph; Determining the target connectivity detection result corresponding to the road network data to be detected according to the connectivity detection result sent by each of the target slave nodes includes: Determining, from the plurality of connected components sent from the first slave nodes, a second connected component including the same vertex; After merging the second connected components, determining the number of connected components; The number of connected components is used as the target connectivity detection result.
10. The method according to claim 8, characterized in that The second connectivity detection result includes at least one connected component after the second slave node merges the first connected components; the first connected component is a connected component containing the same vertex determined by the second slave node from the connected components sent by the plurality of first slave nodes; Determining the target connectivity detection result corresponding to the road network data to be detected according to the connectivity detection result sent by each of the target slave nodes includes: Determining a third connected component including the same vertex from the plurality of connected components sent from the second slave nodes; After merging the third connected components, determining the number of connected components; The number of connected components is used as the target connectivity detection result.
11. The method according to claim 9 or 10, characterized in that: When the number of the connected components is a preset number, it is determined that the road network data to be detected is connected.
12. The method according to claim 8, characterized in that The boundary segmentation of the road network data to be detected to obtain boundary information corresponding to the plurality of groups of road network data includes: Acquire the road network boundary of the road network data to be detected and the scaling parameters of the map corresponding to the road network data to be detected; The map is segmented according to the zoom parameter and the road network boundary to obtain a plurality of map sheets, wherein the map sheets correspond one-to-one to each group of the road network data, and the boundary information includes the map sheet boundaries on the map of the map sheets corresponding to each group of road network data.
13. A road network data detection device, characterized in that: Applied to a first slave node in a distributed data processing system, the device comprises: A first receiving module is used to receive boundary information of road network data sent by a master node in the distributed data processing system, wherein the road network data is any one group of road network data among a plurality of groups of road network data obtained after the master node groups the road network data to be detected; An undirected graph generation module, used to load the road network data according to the boundary information, and generate an undirected graph corresponding to the road network data, wherein the undirected graph represents the connection relationship between vertices, and the vertices correspond to preset road network elements in the road network data; A detection module, configured to determine at least one connected component corresponding to the undirected graph by a preset union-find algorithm according to the connection relationship between each vertex and the edge in the undirected graph, and use the at least one connected component as a first connectivity detection result; The first sending module is used to send the first connectivity detection result to the master node, so that the master node determines the target connectivity detection result corresponding to the road network data to be detected according to the first connectivity detection result sent by each of the first slave nodes.
14. A road network data detection device, characterized in that: Applied to a master node in a distributed data processing system, the device comprises: A boundary determination module is used to perform boundary segmentation on the road network data to be detected, and obtain boundary information corresponding to multiple groups of road network data; A second sending module is used to send the boundary information of each group of the road network data to the first slave node in the distributed data processing system, so that the first slave node generates an undirected graph corresponding to the group of road network data after loading the group of road network data according to the boundary information; the undirected graph represents the connection relationship between vertices, and the vertices correspond to preset road network elements in the road network data; A second receiving module is used to receive a connectivity detection result sent by a target slave node; wherein the target slave node includes the first slave node or the second slave node, and the second slave node is any slave node other than the first slave node in the distributed data processing system; the connectivity detection result includes a first connectivity detection result or a second connectivity detection result, and the first connectivity detection result is at least one connected component corresponding to the undirected graph determined by the first slave node through a preset union-find algorithm according to the connection relationship between each vertex and edge in the undirected graph; the second connectivity detection result is a connectivity detection result obtained by the second slave node after the first connectivity detection results sent by multiple first slave nodes are received and fused; The detection result determination module is used to determine the target connectivity detection result corresponding to the road network data to be detected according to the connectivity detection result sent by each of the target slave nodes.
15. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processing device, the steps of the method described in any one of claims 1-7 or 8-12 are implemented.
16. An electronic device, characterized in that: include: a storage device having a computer program stored thereon; A processing device, configured to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1 to 7 or 8 to 12.
17. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 or 8 to 12 are implemented.
