A map data packet generation method, acquisition method, device and electronic equipment
By employing a pre-merging and iterative exploration algorithm for adaptive merging based on road connectivity within the governance area during map data packet generation, the problem of uneven map data packet partitioning is solved, improving file access and navigation search efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- AUTONAVI SOFTWARE CO LTD
- Filing Date
- 2026-01-08
- Publication Date
- 2026-06-30
AI Technical Summary
In existing technologies, generating map data packages based on road data divided by administrative regions results in low efficiency for file access and navigation search, or the map data packages are too fragmented, affecting navigation search efficiency.
By acquiring road data within the target area, pre-merging is performed based on the road connectivity between the governance areas to generate an initial merged area. The initial unit area is selected as the starting point for iteration, and adaptive merging is performed through an iterative exploration algorithm to generate a uniformly distributed map data package.
It achieves uniform division of map data packets, improves file access and navigation search efficiency, and ensures that map data packets are neither too large nor too small, adapting to navigation needs in different network environments.
Smart Images

Figure CN121475252B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electronic map technology, specifically to a method, apparatus, and electronic device for generating map data packets. This application also relates to a method for acquiring map data packets. Background Technology
[0002] Currently, electronic maps have become a common tool in people's daily lives. Map data packages are the underlying data foundation of electronic maps. They are used to store geospatial information of specific areas, supporting map rendering, navigation, geographic information query services, and other spatial analysis and applications. In practical applications, map data packages are generated based on road data. Road data for a large area is often segmented to generate multiple map data packages. How to segment road data to generate relatively balanced map data packages is particularly important for the efficiency and overall performance of electronic maps.
[0003] In current technology, road data for world maps is divided according to administrative divisions, such as generating map data packages by country and state level. This division method may lead to the following problems: First, if the amount of road data for a certain administrative division is too large, it reduces the efficiency of accessing map data package files and navigation search efficiency; second, if the amount of road data for a single administrative division is too small, but the number of administrative divisions is large, it makes the map data package files too fragmented, affecting navigation search efficiency.
[0004] Therefore, how to evenly distribute road data to generate a more uniform map data package is a problem that needs to be solved. Summary of the Invention
[0005] This application provides a method for generating map data packets, a method for acquiring map data packets, an apparatus, an electronic device, and a computer-readable storage medium. It can provide map data packets with a relatively balanced distribution of road data, preventing the map data packet files from becoming overly fragmented. Simultaneously, it improves the efficiency of map data access and traversal, avoiding the problem of decreased navigation search efficiency caused by uneven road distribution. The specific solution is as follows:
[0006] In a first aspect, this application provides a method for generating map data packets, the method comprising: acquiring road data belonging to each governance area within a target area; performing pre-merging based on the road connection relationships between the governance areas to generate multiple initial merged areas; selecting multiple initial unit areas from the initial merged areas as iteration starting points, merging the initial merged areas until a division result of the target area is obtained, wherein the division result includes at least one target unit area; and generating a corresponding map data packet based on the road data belonging to each target unit area.
[0007] Secondly, this application also provides a method for obtaining map data packets, comprising: obtaining unit area identifiers; wherein each unit area identifier represents a map data packet for a corresponding unit area, the map data packet being generated according to the map data packet generation method described in the first aspect; in response to a map data packet download instruction for a target area identifier in the unit area identifiers, sending a map data packet acquisition request; and receiving the map data packet of the target area identifier.
[0008] Thirdly, this application also provides a map data packet generation apparatus, comprising: a road data acquisition unit for acquiring road data belonging to each governance area within a target area; a preprocessing unit for pre-merging based on the road connection relationships between the governance areas to generate multiple initial merged areas; a road data partitioning unit for selecting multiple initial unit areas from the initial merged areas as iteration starting points, merging the initial merged areas until a partitioning result of the target area is obtained, wherein the partitioning result includes at least one target unit area; and a generation unit for generating a corresponding map data packet based on the road data belonging to each target unit area.
[0009] Fourthly, this application also provides a map data packet acquisition device, comprising: a region identifier acquisition unit for acquiring unit region identifiers; wherein each unit region identifier represents a map data packet for a corresponding unit region, and the map data packet is generated according to the map data packet generation method described in the first aspect; a data request unit for sending a map data packet acquisition request in response to a map data packet download instruction for a target region identifier in the unit region identifiers; and a data receiving unit for receiving the map data packet of the target region identifier.
[0010] Fifthly, this application also provides an electronic device, comprising: a processor, a memory, and computer program instructions stored in the memory and executable on the processor; wherein the processor, when executing the computer program instructions, implements the method provided in any one of the first and / or second aspects of this application.
[0011] In a sixth aspect, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method provided in any one of the first and / or second aspects of this application.
[0012] In a seventh aspect, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the method provided in any one of the first and / or second aspects.
[0013] Compared with the prior art, this application has the following advantages:
[0014] This application provides a method, apparatus, electronic device, computer-readable storage medium, and computer program product for generating map data packets. The method for generating map data packets includes: acquiring road data belonging to each governance area within a target area; performing pre-merging based on the road connection relationships between the governance areas to generate multiple initial merged areas; selecting multiple initial unit areas from the initial merged areas as iteration starting points, merging the initial merged areas until a division result of the target area is obtained, wherein the division result includes at least one target unit area; and generating a corresponding map data packet based on the road data belonging to each target unit area. The initial merged areas are generated based on the pre-merging of governance areas, which can maintain the management attributes of governance areas during road data division; simultaneously, merging the initial merged areas can ensure that roads are distributed as evenly as possible in each map data packet during road data division, avoiding situations where some map data packets are too large or too small. Preferably, before merging the initial merged areas, pre-merging the governance areas using the number of road connections between areas and an adaptive threshold can minimize the number of road connections between different areas, thereby improving navigation planning performance.
[0015] Furthermore, in the process of selecting the initial unit region as the starting point of the iteration, the selected initial unit regions are spread out as much as possible by controlling the distance between the candidate initial unit regions, so that the iterative exploration algorithm can converge quickly and improve the efficiency of map data packet generation.
[0016] This application provides a method, apparatus, electronic device, computer-readable storage medium, and computer program product for acquiring map data packets. The method for acquiring map data packets includes: acquiring unit area identifiers; wherein each unit area identifier represents a map data packet for a corresponding unit area, and the map data packet is generated according to the map data packet generation method described in any of the first aspects above; in response to a map data packet download instruction for a target area identifier among the unit area identifiers, sending a map data packet acquisition request; and receiving the map data packet for the target area identifier. Thus, a device sending the map data packet acquisition request can acquire the map data packet. If the device sending the map data packet acquisition request is a terminal, the terminal can use the map data packet offline, enabling the use of offline maps even in scenarios without a network, thus improving the usability of navigation in network-free scenarios. If the device sending the map data packet acquisition request is a navigation server providing online navigation functionality, the navigation server obtains a map data packet with a more balanced road distribution, and the map data packet file is not too fragmented or has uneven data volume, which can improve navigation search efficiency. Attached Figure Description
[0017] Figure 1 This is a flowchart illustrating the method for generating map data packets according to one embodiment of this application.
[0018] Figure 2 This is a schematic diagram of the selection process of the initial unit region as the initial iteration point provided in one embodiment of this application.
[0019] Figure 3 This is a schematic diagram illustrating an example of an adaptive merging process provided in one embodiment of this application.
[0020] Figure 4 This is a schematic diagram illustrating an example of an adaptive merging result provided in one embodiment of this application.
[0021] Figure 5 This is a flowchart illustrating the process of obtaining map data packets according to one embodiment of this application.
[0022] Figure 6 This is a schematic diagram of a map data packet generation apparatus provided in one embodiment of this application.
[0023] Figure 7 This is a schematic diagram of a map data packet acquisition device provided in one embodiment of this application.
[0024] Figure 8 This is a structural block diagram of the electronic device provided in this application. Detailed Implementation
[0025] To enable those skilled in the art to better understand the technical solutions of this application, the application will be clearly and completely described below with reference to the accompanying drawings of the embodiments. However, this application can be implemented in many other ways different from those described below. Therefore, based on the embodiments provided in this application, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this application.
[0026] It should be noted that the terms "first," "second," "third," etc., in the claims, specification, and drawings of this application are used to distinguish similar objects and are not used to describe a specific order or sequence. Such data are interchangeable where appropriate so that the embodiments of this application described herein can be implemented in a sequence other than that shown or described herein. Furthermore, the terms "comprising," "having," and their variations are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products, or apparatuses.
[0027] It should be noted that the user information and data involved in this application, including but not limited to road data, navigation terminal information, location information, etc., are all data and information that have been fully authorized by all parties or authorized by the user. Furthermore, the collection, use and processing of the relevant data must comply with relevant laws, regulations and standards, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0028] To facilitate understanding of the various embodiments of this application, relevant terms and application backgrounds related to the embodiments are provided.
[0029] Offline maps are electronic maps that have pre-acquired map data packages, allowing the use of geographic information services based on the map data packages in environments without network access.
[0030] Online maps are electronic maps that provide online geographic information services such as geographic information search, navigation, and location services via the internet. Online geographic information services are provided by the map service provider's server based on the user's geographic information needs, by searching for accessible or retrieved map data packages.
[0031] An in-vehicle navigation platform is a system that provides real-time navigation based on the vehicle's location and electronic maps. The in-vehicle navigation platform can pre-acquire map data packages and provide geographic information services based on these packages; it can also obtain online geographic information services through communication networks.
[0032] Offline maps, online map rendering, navigation, traffic, and in-vehicle navigation platforms, as users of electronic maps, need to obtain map data packages to provide users with relevant map search, navigation, and other services using the geospatial information stored in the map data packages. In related technologies, road data is typically divided according to administrative divisions to generate multiple map data packages. This can lead to uneven road distribution within the map data packages, thereby reducing file access efficiency and navigation search efficiency.
[0033] To address the aforementioned issues, this application provides a method for generating and acquiring map data packets. This method achieves balanced division of road data to generate map data packets with a more uniform road distribution, and also facilitates the acquisition of these map data packets. The method involves pre-merging roads based on their connectivity relationships within the target area's road data to obtain an initial merged area. An initial unit area is selected from this initial merged area as the starting point for iteration, and an iterative exploration algorithm is used to adaptively merge the initial merged area to obtain the target area's division result. This division result includes at least one target unit area. A map data packet is generated for each target unit area. This approach ensures that roads are distributed as evenly as possible across the map data packets during the road data division process, while simultaneously maintaining the administrative attributes of the governance areas.
[0034] The method for generating map data packets can be applied to devices that generate map data packets. These devices are referred to as the first device. The first device can be the device corresponding to the map data packet provider. The first device can be an independent physical server, a server cluster or distributed system, a cloud server that provides geographic information processing capabilities / various computing capabilities / storage capabilities, an artificial intelligence platform, or other server-side electronic devices.
[0035] The method for acquiring map data packets can be applied to a device that acquires map data packets, referred to as a second device. The second device can be the device corresponding to the map data packet requester, and can be a terminal electronic device or a server-side device different from the first device. The terminal can be, but is not limited to, smartphones, wearable devices, smart vehicle devices, desktop computers, laptops, tablets, smart home devices, and other electronic devices. Other server-side devices can be independent physical servers, server clusters or distributed systems, cloud servers providing online navigation capabilities / various computing / storage capabilities, artificial intelligence platforms, and other server-side electronic devices. This application does not impose specific limitations.
[0036] Taking the map data packet generation method applied to offline maps as an example, the first device corresponding to the map data packet provider uses the map data packet generation method to divide road data into multiple unit areas and generate a map data packet for each unit area. The terminal can provide a map data packet download entry, for example, the terminal displays a "download map" control as the map data packet download entry. In response to the map data packet download entry being triggered, the terminal displays a unit area identifier. In response to a map data packet download instruction triggered for one or more target area identifiers among the unit area identifiers, the terminal requests the server to download the corresponding map data packet. Thus, the terminal can use the offline map of the unit area corresponding to the target area identifier. It is understood that this application scenario is merely an illustrative example and is not intended to limit the specific application scenario. The purpose of providing this scenario embodiment is to facilitate understanding of the method provided in this application embodiment, and not to limit the method. The second device corresponding to the map data packet requester can be a terminal such as a mobile phone or vehicle terminal, or other servers such as a navigation server. The method for generating and obtaining the map data package can be applied to various scenarios. For example, it can be applied to scenarios where map data packages are automatically downloaded in the absence of a network, or to scenarios where a navigation server (map requester) requests map data packages or requests updates to map data packages from the server of the map generator. This application does not specifically limit these scenarios.
[0037] It should be noted that the information disclosed above is only for the purpose of helping to understand this application, and does not mean that it constitutes prior art known to those skilled in the art, nor does it limit the methods provided in this application.
[0038] Example 1
[0039] The first embodiment of this application provides a method for generating map data packets. This method can be executed by an electronic device with corresponding processing capabilities. The following is a description of the method in conjunction with... Figures 1 to 4 The method for generating the map data package is described.
[0040] Figure 1 The method for generating the map data package shown includes steps S101 to S104.
[0041] Step S101: Obtain road data for each governance area within the target area.
[0042] Specifically, the governance area is formed by dividing a geographical region into different levels of areas to facilitate regional governance. Different levels of governance areas form a parent-child relationship, with a higher-level governance area containing a lower-level one. For example, a four-level zoning geographical region is divided into four levels of governance areas. A first-level governance area includes one or more second-level governance areas, a second-level governance area includes one or more third-level governance areas, and so on, with the fourth-level governance area being the lowest level of governance area in the four-level zoning. The lowest-level governance area is the basic governance area, that is, the smallest granularity of governance area. The term "regional scope" refers to the geographical area encompassing the hierarchical governance areas. For example, a regional scope can be the geographical scope of a first-level governance area, or it can be the scope of a second-level or other level governance area. In this embodiment, the governance area data corresponding to hierarchical governance includes the zoning spatial data of the corresponding geographical area for each governance area and the management attribute data of hierarchical governance. The zoning spatial data represents the geographical location and shape of a governance area, such as geometric information like boundaries and center points. The management attribute data is the descriptive information of the non-spatial features of a governance area, such as its name, code, and area. For example, the area under governance can be equivalent to an administrative division.
[0043] Specifically, the aforementioned target area refers to the geographical range within which road data needs to be divided into multiple target unit areas to generate a map data package for each target unit area. The road data within the target area includes road network data and governance area data within the target area. The target unit area is a unit area obtained by adaptively merging road data from a given area. In this embodiment, one map data package is provided for each unit area.
[0044] The method for obtaining road data for each governance area within the target area is not specifically limited. It can be receiving road data sent by a third party, or downloading road data for the target area from a road data website. For example, road data can be obtained from OpenStreetMap. The file format of the road data can be .osm or .shp files, or other types of road or road network files. After obtaining the road data, the process also includes: data cleaning and optimization, such as deleting redundant road nodes and repairing topology connections.
[0045] Furthermore, after obtaining the road data, the process also includes determining the governance area to which each road belongs, and determining the number of roads in each governance area and the number of road connections between governance areas. Determining the governance area to which a road belongs includes: for roads that intersect with a governance area, determining the governance area to which the road belongs based on the intersection relationship; and / or, for roads that do not intersect with a governance area, determining the governance area to which the road belongs based on the topological connections of the road data; and / or, for roads whose governance area cannot be determined based on topological connections, determining the governance area to which the road belongs based on the distance between the road and the governance area. In the road data, roads in the road network data are linear elements such as line segments or curves, and the spatial data of governance areas in the governance area data are polygonal elements, that is, polygonal elements represent the boundaries of each governance area. The intersection relationship is determined by spatial matching between the linear elements representing roads and the polygonal elements representing governance areas. After determining the governance area to which a road belongs, the number of roads contained in each governance area and the number of road connections between governance areas can be obtained. By determining the governance area to which a road belongs, the problem of not being able to define the governance area in a scheme that simply divides the data evenly based on the number of roads is avoided.
[0046] The following example illustrates a specific implementation method for assigning roads to governance areas, using a basic governance area as the governance area. Determining the basic governance area to which a road belongs based on the intersection relationship includes: calculating the intersection relationship between the linear element representing the road and the polygonal element representing the basic governance area based on spatial matching; if the intersection relationship indicates an inclusion relationship, the road belongs to the basic governance area; if the intersection relationship indicates an intersection, the road belongs to the basic governance area with the larger intersection distance. The intersection distance can be the length of the linear element within the polygon or measured by the proportion of the length within the linear element. Specifically, if the linear element representing the road and the polygonal element representing the basic governance area have no intersection relationship (e.g., a ferry), then other roads connected by the linear element are determined recursively based on topological connections, and the basic governance area to which these other roads belong is taken as the basic governance area to which the linear element belongs. Furthermore, for roads assigned based on topological connections, the distance between the road and the center point of the basic governance area is calculated as the distance between the road and the basic governance area, and the road is assigned to the nearest basic governance area. Furthermore, the number of roads contained within the polygon and the number of road connections between polygons can be calculated.
[0047] Step S102: Based on the road connection relationship between the governance areas, perform pre-merging to generate multiple initial merged areas.
[0048] Specifically, the initial merge region refers to the region participating in the adaptive merge. Preferably, the initial merge region is a region generated by merging the governance regions in advance.
[0049] Of course, the initial merge region can also be a hierarchical governance region. Specifically, one level of governance region can be selected as the initial merge region. For example, the basic governance region can be used as the initial merge region.
[0050] Preferably, a threshold can be set based on the number of road connections between regions before adaptive merging. Regions with more road connections than the threshold are merged. This "merging" step is called pre-merging, and the regions included in the pre-merging result are used as the initial merged regions. The purpose of pre-merging is to minimize the number of road connections between different generated unit regions while ensuring a uniform road distribution, preventing a rapid increase in the number of road topology connections between unit regions after partitioning. The number of road connections affects subsequent navigation planning performance and map search performance. The threshold set for different target region ranges can be different. If the threshold is too small, the road distribution may not be uniform enough; if the threshold is too large, the effect of reducing the number of road connections between regions will be insignificant. Therefore, the threshold is preferably an adaptive threshold, that is, an adjustable variable. An initial value for the threshold is given, and it can be gradually adjusted according to the threshold adjustment step size until a suitable value is obtained. The pre-merging based on the road connectivity between the governance areas to generate multiple initial merged areas includes: merging governance areas where the number of road connections between areas exceeds an adaptive threshold to obtain pre-merged areas; if the pre-merged areas do not meet the road uniformity standard, increasing the adaptive threshold by a step size adjustment according to the threshold; re-merging the governance areas using the new adaptive threshold; and so on, until the pre-merged areas meet the road uniformity standard, and then using the pre-merged areas that meet the road uniformity standard as initial merged areas. Before pre-merging, the method further includes: setting an initial value for the adaptive threshold, starting the merging process, and adjusting the adaptive threshold. Re-merging the governance areas using the new adaptive threshold includes: after obtaining a new round of adaptive thresholds, returning to the governance areas where the number of road connections between merged areas exceeds the adaptive threshold to obtain a new round of pre-merged areas. The threshold adjustment step size is preferably an adjustable variable, i.e., using a non-fixed step size to adjust the value of the adaptive threshold; the road uniformity standard includes: under the condition that the number of roads in each area is less than the upper limit of the number of roads in a single map data packet, the ratio of the number of roads between the area with the largest number of roads and the area with the smallest number of roads is within a preset ratio range. The road uniformity standard for pre-merging areas specifically includes: under the condition that the number of roads in each pre-merging area is less than the upper limit of the number of roads, the ratio of the number of roads in the first pre-merging area to the number of roads in the second pre-merging area is within a preset ratio range; the first pre-merging area refers to the pre-merging area with the largest number of roads, and the second pre-merging area refers to the pre-merging area with the smallest number of roads.
[0051] For example: The initial value of the preset adaptive threshold is 20, and the threshold adjustment step is +10. If, under the current value of the adaptive threshold, the calculated road distribution meets the road uniformity standard, then this current value is used as the value of the adaptive threshold; otherwise, the current value is increased by 10, and the road distribution is pre-merged and calculated again until the road distribution meets the road uniformity standard. The road uniformity standard is that the ratio of the maximum to the minimum number of roads in the pre-merged area is between 1 and 1.2, and the maximum value of each pre-merged area is less than the preset upper limit of the number of roads, such as 100,000.
[0052] Step S103: Select multiple initial unit regions from the initial merged region as the starting point of the iteration, merge the initial merged region until the division result of the target region range is obtained, wherein the division result includes at least one target unit region.
[0053] This step adaptively merges the initial merge regions using an iterative exploration algorithm. After pre-merging based on the governance regions within the target region and further merging based on the pre-merging results, the target region is ultimately divided into multiple unit regions, each of which can be understood as a target unit region. The iterative exploration algorithm is an algorithm that searches and optimizes the solution space by repeatedly executing specific steps to gradually approach the target result. In addition, the initial merge regions can also be merged based on distance relationships between them.
[0054] In this embodiment, the goal of the iterative search algorithm is to adaptively merge each initially merged region with connectivity to form multiple target unit regions. The resulting target unit regions have a relatively balanced road distribution, for example, meeting the road uniformity standard for target unit regions: the ratio of the number of roads in each target unit region to the target unit region with the fewest roads is within a preset range, such as 1 to 1.2, provided that the number of roads in each target unit region is less than the maximum number of roads in a single map data package. Connectivity refers to the presence of roads connecting regions; roads can include routes such as ferry routes.
[0055] In this embodiment, the processing steps of the iterative search algorithm include: an initialization step, which is to select the initial unit region in the first iteration as the starting point of the iteration, that is, to select the initial information of the iteration; an iterative optimization step, which is to repeatedly perform the search optimization operation, determine the initial unit region and the initial merge region in each iteration, and obtain a new initial unit region; and set a termination condition to explore and complete each initial merge region with connectivity.
[0056] The initialization step includes selecting multiple initial unit regions from the initial merged region as iteration starting points. In practice, candidate initial unit regions are first selected from the initial merged region, and then the initial unit region used as the iteration starting point is selected from the candidate initial unit regions. Specifically, this includes: determining candidate initial unit regions based on the number of roads in each initial merged region and the target number of initial unit regions; wherein, the target number of initial unit regions is determined based on the total number of roads in the target area and the upper limit of the number of roads in a single map data package; and determining the initial unit region from the candidate initial unit regions. The target number refers to the number of target unit regions ultimately generated after adaptive merging of the initial merged regions in the target area. Specifically, the target number can be obtained by dividing the total number of roads by the upper limit of the number of roads and rounding up. For example, taking a target area with a total of 380,000 roads and an upper limit of 100,000 roads per unit region, the target area needs to be divided into 4 unit regions, thus requiring 4 iteration points. The first iteration starts with these 4 initial iteration points, meaning 4 need to be selected from the initial merged region as initial unit regions (i.e., initial iteration points).
[0057] The step of determining candidate initial unit regions based on the number of roads in each initial merged region and the target number of initial unit regions includes: determining a pre-selected number N of initial unit regions based on the target number of initial unit regions; and selecting the top N initial merged regions with the most roads as candidate initial unit regions. In practice, the pre-selected number is determined as a multiple of the target number. For example, if the target number of initial iteration points is 'a' (e.g., 4), the pre-selected number can be 2*a (e.g., 8); the top N initial merged regions with the most roads (e.g., the top 8 with the most roads) can be selected as candidate initial unit regions.
[0058] The process of determining the initial unit region from the candidate initial unit regions includes: selecting the two candidate initial unit regions with the largest distance from each other as the two selected initial unit regions; if the number of selected initial unit regions does not reach the target number of initial unit regions, then selecting the region with the largest sum of distances to each selected initial unit region from the remaining candidate initial unit regions as the newly selected initial unit region; and so on, until the number of selected initial unit regions reaches the target number. In practice, the geometric distances between the candidate initial iteration points (i.e., candidate initial unit regions) are calculated sequentially, and the two points with the largest geometric distances are selected as initial iteration points; if the target number is greater than two, the distances from other candidate initial iteration points to these two points are calculated, and the point with the largest sum of distances is selected as the third initial iteration point; if the target number is more than three, the geometric distances from the remaining candidate initial iteration points to these three points are calculated, and the point with the largest sum of distances is selected as the fourth initial iteration point, and so on, until all initial iteration points as the starting point of the iteration are selected.
[0059] Please refer to Figure 2 The figure shows an example of a selection process for the initial unit region as the initial iteration point, including: candidate initial iteration points 1 to 8 (i.e., 8 candidate initial unit regions), and initial iteration points 1 to 4 selected from them as the initial iteration points (i.e., 4 selected initial unit regions as the iteration start point).
[0060] The iterative optimization steps include merging the initial merged regions until the target region is determined. Specifically, this includes: identifying the initial unit region with the smallest number of roads from the multiple initial unit regions as the target initial unit region; for initial merged regions connected to the target initial unit region, selecting the one furthest from other initial unit regions and merging it into the target initial unit region; using the merged region as the initial unit region to obtain a new iteration starting point for the next iteration; and so on, until every initial merged region connected to the road data is merged to form the target region. In other words, the region with the smallest number of roads is selected for merging, and the process is iterated repeatedly until all initially merged regions connected to the road data are merged.
[0061] Please refer to Figure 3 The figure illustrates an example of the adaptive merging process, including: In this iteration, if the initial unit region with the smallest number of roads is the initial iteration point 1 in the upper left corner, then the initial merged region m to its left has the largest distance from the other initial iteration points 2, 3, and 4. Therefore, m is merged into the initial iteration point 1. The distance between regions can refer to the distance between the center of the regions.
[0062] Furthermore, after merging each initially merged region with connectivity in the road data, the process further includes merging initially merged regions that are not connected to other initially merged regions into the nearest target unit region. Initially merged regions that are not connected to other initially merged regions are relatively independent regions, such as islands without ferry routes. Please refer to [reference needed]. Figure 4 The relatively independent initial merge region n shown in the figure is merged into the nearest target unit region 4.
[0063] Step S104: Generate a corresponding map data package based on the road data of each target unit area.
[0064] Specifically, each target unit area corresponds to a map data package.
[0065] This step generates map data packages for each target unit area, which can be provided to the requester. Specifically, data packages in any of the following formats can be generated as map data packages: .mpkx format map data packages, .mxd or .aprx format map files, offline navigation packages, etc. Offline navigation packages are data packages in a specific format (such as .bpk or .sbw) packaged according to the target unit area, containing map data packages and corresponding navigation data. The navigation data includes point-of-interest information, route planning information, etc. Furthermore, this step also includes generating unit area identifiers based on the characteristics of the coverage area of each target unit area. These unit area identifiers can identify the map data packages for the corresponding target unit area. For example, if the target area is a secondary governance area A, and it is divided into three target unit areas, three unit area identifiers are generated to represent the corresponding areas: "Eastern Area A", "Western Area A", and "Central Area A". When road data is updated, the method described above can be used to regenerate map data packages, thereby adjusting the road data division in real time, rather than specifying governance zoning to provide map data packages, achieving the goal of dynamically balancing the road data division.
[0066] The method for generating map data packets can be applied to a server corresponding to a map data packet provider, referred to as a first device. The party requesting map data packets from the first device is the map data packet requester, who can use a second device, such as a terminal or other server device, to send a map data packet retrieval request, causing the first device to respond with map data packets in response to the request. In response to the map data packet retrieval request sent by the second device, the first device parses the unit area identifier from the request and sends the corresponding map data packet to the second device based on the unit area identifier. This allows the terminal to use map data packets offline in a network-free environment, thus improving the usability of navigation in network-free scenarios. If the second device is a navigation server providing online navigation functionality, the navigation server obtains map data packets with a more balanced road distribution, and the map data packet files are not too fragmented or have uneven data volume, which can improve the efficiency of online map search and navigation route planning.
[0067] When the road data within the target area is world map road data, the governance area can refer to different countries, as well as states and cities within those countries. The method described above dynamically divides road data to generate map data packets, ensuring that the map data packet files are neither too fragmented nor too large, thereby improving data access and traversal efficiency. Pre-merging allows for the early merging of governance areas with a large number of road connections, reducing the number of road connections between the final generated unit areas and preventing a rapid increase in the number of road topology connections between unit areas after partitioning. By retaining the management attribute data of the governance area to which the road belongs, the problem of not being able to define the governance area to which the road belongs is avoided. Thus, combining governance area affiliation with balanced road distribution, and adaptively merging the initial merged areas, road data segmentation is achieved, reducing uneven road distribution and improving the operating efficiency of the device engine of the map data packet requester.
[0068] It should be noted that, unless otherwise specified, the features given in this embodiment and other embodiments of this application can be combined with each other, and steps S101 and S102 or similar terms do not limit the steps to be performed in a specific order.
[0069] The method provided in this embodiment has been described above. In this method, an initial merged area of the road data is obtained by pre-merging the governance areas in the road data within the target area. An initial unit area is selected from the initial merged area as the starting point for iteration, and the initial merged area is adaptively merged using an iterative exploration algorithm to obtain the division result of the target area, which includes at least one target unit area. A map data package is generated for each target unit area. This ensures that roads are distributed as evenly as possible across the map data packages during the road data division process, while maintaining the management attributes of the governance areas.
[0070] Example 2
[0071] Based on the above embodiments, this embodiment provides a method for obtaining map data packets. For related technical features and effects, please refer to the corresponding sections of the above embodiments. Figure 5 The method for obtaining the map data package shown includes steps S501 to S503.
[0072] Step S501: Obtain unit area identifiers; wherein each unit area identifier represents a map data packet for the corresponding unit area, and the map data packet is generated according to the map data packet generation method.
[0073] Step S502: In response to the map data packet download instruction for the target area identifier in the unit area identifier, a map data packet acquisition request is sent;
[0074] Step S503: Receive the map data packet identifying the target area.
[0075] The device that generates the map data packet by executing the map data packet generation method can be referred to as a first device, and the electronic device that executes the map data packet acquisition method can be referred to as a second device. Of course, the generated map data packet can be stored in the first device or other devices, and the device storing the map data packet can be referred to as a third device.
[0076] The second device may be a terminal or other server different from the first and third devices. In response to a map data packet download instruction for the target area identifier, the second device may send a map data packet acquisition request to the first or third device, and receive a map data packet for the target area identifier from the first or third device in response to the map data packet acquisition request.
[0077] When the second device is a terminal, one scenario is that a user initiates the download of an offline map. This scenario also includes: displaying a map data package download entry; and displaying unit area identifiers in response to a trigger operation on the map data package download entry. A control similar to "Offline Map" is an example of a map data package download entry. The user pre-determines the offline area and identifies the target area identifier. When the download control associated with the target area identifier in the displayed unit area identifiers is triggered, the download instruction is generated; or, when one or more target area identifiers are selected, the download control is triggered, generating the download instruction.
[0078] When the second device is a terminal, one scenario is a network-free navigation scenario. This scenario further includes: the terminal sending its starting and destination locations to a navigation server providing route planning; the navigation server predicting offline areas (i.e., areas without network access) based on the starting and destination locations, and sending information about unit areas containing the offline areas to the terminal, so that the terminal displays the unit area identifier corresponding to the offline area; the terminal generating a download instruction in response to a confirmation download operation for the unit area identifier. This automatically downloads a map data package covering the offline area.
[0079] Example 3
[0080] Corresponding to Embodiment 1, this embodiment provides a map data packet generation apparatus. Since the apparatus embodiment is basically similar to the method embodiment, the description is relatively simple. For details of the relevant technical features and their effects, please refer to the corresponding descriptions of the method embodiments provided above. Please refer to... Figure 6 The map data packet generation apparatus shown includes:
[0081] The road data acquisition unit 601 is used to acquire road data belonging to each governance area within the target area;
[0082] Preprocessing unit 602 is used to pre-merge based on the road connection relationship between the governance areas to generate multiple initial merged areas;
[0083] The road data partitioning unit 603 is used to select multiple initial unit regions as iteration starting points from the initial merged region, merge the initial merged region, and obtain the partitioning result of the target region range, wherein the partitioning result includes at least one target unit region;
[0084] The generation unit 604 is used to generate a corresponding map data package based on the road data of each target unit area.
[0085] Optionally, the road data partitioning unit 603 is specifically used for: determining the initial unit region with the smallest number of roads from the plurality of initial unit regions as the target initial unit region; for the initial merged regions that have a connectivity relationship with the target initial unit region, selecting the one that is farthest away from other initial unit regions and merging it into the target initial unit region; using the merged region as the initial unit region to obtain a new iteration starting point, and performing the next iteration; and so on, until each initial merged region with a connectivity relationship in the road data is merged to form the partitioning result of the target region range.
[0086] Optionally, the road data partitioning unit 603 is specifically used to: after merging each initial merged region with connectivity in the road data, merge the initial merged regions that do not have connectivity with other initial merged regions into the nearest target unit region.
[0087] Optionally, the road data segmentation unit 603 is specifically used to: determine candidate initial unit regions based on the number of roads in each initial merged region and the target number of the initial unit region; wherein, the target number of the initial unit region is determined based on the total number of roads in the target region and the upper limit of the number of roads in a single map data packet; and determine the initial unit region from the candidate initial unit regions.
[0088] Optionally, the road data segmentation unit 603 is specifically used to: if the number of selected initial unit areas does not reach the target number of initial unit areas, then determine the area with the largest sum of distances to each selected initial unit area from the remaining candidate initial unit areas, and use it as a newly selected initial unit area; and so on, until the number of selected initial unit areas reaches the target number.
[0089] Optionally, the road data partitioning unit 603 is specifically used to: determine the pre-selected number N of the initial unit regions based on the target number of the initial unit regions; and select the top N initial merged regions with the most roads as the candidate initial unit regions.
[0090] Optionally, the preprocessing unit 602 is specifically used to: merge governance areas where the number of road connections between areas exceeds an adaptive threshold to obtain a pre-merged area; if the pre-merged area does not meet the road uniformity standard, increase the adaptive threshold by adjusting the step size according to the threshold; re-merge the governance areas using the new adaptive threshold; and so on, until the pre-merged area meets the road uniformity standard, and use the pre-merged area as the initial merged area.
[0091] Example 4
[0092] Corresponding to Embodiment 2, this embodiment provides a map data packet acquisition device. Since the device embodiment is basically similar to the method embodiment, the description is relatively simple. For details of the relevant technical features and their effects, please refer to the corresponding descriptions of the method embodiments provided above. Please refer to... Figure 7 The map data packet acquisition device shown includes:
[0093] The area identifier acquisition unit 701 is used to acquire unit area identifiers; wherein each unit area identifier represents a map data packet of the corresponding unit area, and the map data packet is generated according to the map data packet generation method.
[0094] The data request unit 702 is configured to send a map data packet acquisition request in response to a map data packet download instruction for a target area identifier in the unit area identifier;
[0095] The data receiving unit 703 is used to receive the map data packet of the target area identifier.
[0096] Based on the above embodiments, one embodiment of this application provides an electronic device; for relevant parts, please refer to the corresponding descriptions of the above embodiments. Figure 8 The schematic diagram of the electronic device shows that the electronic device includes a processor and a memory; the memory is used to store computer instructions for data processing, which, when read and executed by the processor, perform the method provided in the embodiments of this application. The computer instructions may be computer programs.
[0097] Based on the above embodiments, one embodiment of this application also provides a computer-readable storage medium. For relevant parts, please refer to the corresponding descriptions of the above embodiments. The schematic diagram of the computer-readable storage medium is similar to that of an electronic device, and the memory in the diagram can be understood as the readable storage medium. The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method provided in the embodiments of this application.
[0098] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0099] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0100] 1. Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include non-transitory computer-readable media, such as modulated data signals and carrier waves.
[0101] 2. Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0102] Although this application discloses preferred embodiments as described above, it is not intended to limit this application. Any person skilled in the art can make possible changes and modifications without departing from the spirit and scope of this application. Therefore, the scope of protection of this application should be determined by the scope defined in the claims of this application.
Claims
1. A method for generating map data packets, characterized in that, The method includes: Obtain road data belonging to each governance area within the target area; the road data includes management attribute data of each governance area; Based on the road connectivity relationships between the various governance areas, a pre-merging process is performed to generate multiple initial merged areas. This includes: merging governance areas where the number of road connections between areas exceeds an adaptive threshold to obtain pre-merged areas; if the pre-merged areas do not meet the road uniformity standard, increasing the adaptive threshold step size according to the threshold; re-merging the governance areas using the new adaptive threshold; and so on, until the pre-merged areas meet the road uniformity standard, at which point the pre-merged areas are used as the initial merged areas. Multiple initial unit regions are selected from the initial merged region as the starting point for iteration, and the initial merged region is merged until the division result of the target region range is obtained, wherein the division result includes at least one target unit region; Based on the road data of each target unit area, a corresponding map data package is generated; The step of merging the initial merged regions until the target region is obtained includes: From the plurality of initial unit regions, the initial unit region containing the smallest number of roads is determined as the target initial unit region; For initial merge regions that are connected to the target initial unit region, select the one that is furthest away from other initial unit regions and merge it into the target initial unit region; The merged region is used as the initial unit region to obtain the new iteration starting point for the next iteration; This process continues until each initially merged region with connectivity in the road data is merged to form the division result of the target region.
2. The method according to claim 1, characterized in that, After merging each initially merged region with connectivity in the road data, the process further includes: Merge initial merge regions that are not connected to other initial merge regions into the nearest target unit region.
3. The method according to claim 1, characterized in that, The step of selecting multiple initial unit regions from the initial merged region as iteration starting points includes: Candidate initial unit regions are determined based on the number of roads in each initial merge region and the target number of the initial unit region; wherein, the target number of the initial unit region is determined based on the total number of roads in the target region and the upper limit of the number of roads in a single map data packet; The initial unit region is determined from the candidate initial unit regions.
4. The method according to claim 3, characterized in that, Determining the initial unit region from the candidate initial unit regions includes: The two candidate initial unit regions with the largest distance among the candidate initial unit regions are selected as the initial unit regions; If the number of selected initial unit regions does not reach the target number of initial unit regions, then the region with the largest sum of distances to each selected initial unit region is determined from the remaining candidate initial unit regions and is selected as the new initial unit region. This process continues until the number of selected initial unit regions reaches the target number.
5. The method according to claim 3, characterized in that, The step of determining candidate initial unit regions based on the number of roads in each initial merged region and the target number of initial unit regions includes: Based on the target number of the initial unit regions, determine the pre-selected number N of the initial unit regions; The first N initial merge regions with the most roads are selected as the candidate initial unit regions.
6. A method for acquiring map data packets, characterized in that, include: Obtain unit area identifiers; wherein each unit area identifier represents a map data packet for the corresponding unit area, and the map data packet is generated by the map data packet generation method according to any one of claims 1-5; In response to a map data packet download instruction for a target area identifier in the unit area identifier, a map data packet acquisition request is sent; Receive the map data packet identifying the target area.
7. A map data package generation apparatus, characterized in that, include: The road data acquisition unit is used to acquire road data belonging to each governance area within the target area; The road data includes management attribute data for each governance area; A preprocessing unit is used to pre-merge based on the road connectivity relationships between the various governance areas to generate multiple initial merged areas; including: merging governance areas where the number of road connections between areas exceeds an adaptive threshold to obtain pre-merged areas; if the pre-merged areas do not meet the road uniformity standard, increasing the adaptive threshold by adjusting the step size according to the threshold; re-merging the governance areas using the new adaptive threshold; and so on, until the pre-merged areas meet the road uniformity standard, and using the pre-merged areas as the initial merged areas; merging governance areas where the number of road connections between areas exceeds the adaptive threshold, and using the resulting pre-merged areas as the initial merged areas. A road data partitioning unit is used to select multiple initial unit regions as iteration starting points from the initial merged regions, merge the initial merged regions, and obtain the partitioning result of the target area range. The partitioning result includes at least one target unit region. The process includes: determining the initial unit region with the smallest number of roads from the multiple initial unit regions as the target initial unit region; for initial merged regions connected to the target initial unit region, selecting the one furthest from other initial unit regions and merging it into the target initial unit region; using the merged region as the initial unit region to obtain a new iteration starting point for the next iteration; and so on, until each initial merged region connected to the road data is merged to form the partitioning result of the target area range. The generation unit is used to generate a corresponding map data package based on the road data of each target unit area.
8. An electronic device, characterized in that, include: A memory and a processor; the memory is used to store a computer program, and the processor, when running the computer program, implements the method as described in any one of claims 1-6.