A method, device and readable storage medium for generating a distributed electronic map
By adopting distributed computing and multi-threaded processing in electronic map technology, combined with map tile fusion computing, the problems of high burden and low efficiency of the client are solved, and the access efficiency and user experience of electronic maps are improved.
Patent Information
- Application Number
- CN202110157774.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-05
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2041-02-05
AI Technical Summary
In the existing electronic map technology, the client has a large burden and low efficiency, especially when it is necessary to access multiple electronic map services, which leads to poor user browsing the map experience and increasing the burden on client loading the map.
The distributed electronic map generation method is adopted to pre-generate distributed electronic map request address cache, and cache address calculation is accelerated using distributed computing resources and multi-threaded methods. Map tile fusion calculation is used to accurately process maps intersecting different boundary areas.
It significantly improves the speed of cache address calculation, reduces the burden and inefficiency of clients when accessing distributed electronic maps, and improves the user's map browsing experience.
Smart Images

Figure CN112948379B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electronic maps, and in particular to a method and device for generating a distributed electronic map and a readable storage medium. Background Art
[0002] The timeliness of image data plays a vital role in users' use of data. Due to the large capacity of image data, the acquired image data is usually sliced and published as an electronic map, which is provided to users through network sharing.
[0003] So far, surface feature information can be obtained through remote sensing satellites, aerial surveys, drones and other methods, and these data are distributed in different units. If you want to use a global electronic map that is up-to-date and up-to-date, you must access electronic map services distributed in different places. There are two known methods. First, access multiple electronic maps and overlay different maps in order. In this way, if there are too many electronic map services, the client will have to draw multiple times in the same area, which will seriously affect the user's experience of browsing the map. The number of times the client requests the electronic map will be relatively large, which will also increase the burden of loading the map on the client. Second, the electronic map service locations distributed at different addresses are stored in the database to provide users with a unique exit. When requesting a certain number of electronic map tiles, the unified exit server will request the electronic maps distributed in different areas to the server and then return them to the client. This method stores the tile locations in the database, which will result in low request efficiency. If you want to control the permissions for map tile requests, the efficiency will be even lower. Summary of the invention
[0004] Based on this, it is necessary to provide a method and device for generating a distributed electronic map to address the problems of heavy client burden and low efficiency in existing electronic maps.
[0005] The present invention provides a method for generating a distributed electronic map, comprising the steps of:
[0006] Pre-generate distributed electronic map request address cache: number each distributed electronic map of the global electronic map, generate a cache index of the electronic map request address, perform statistics and calculation analysis on the pre-generated regions and areas, estimate the time required to generate the cache index in a single-threaded situation, add computer resources for executing index information, dynamically obtain performance information of computer resources, arrange tasks according to the performance information of each computer, and divide the tasks arranged on each computer into multiple subtasks, where each subtask is a thread;
[0007] Pre-generate distributed electronic map cache address algorithm, which can calculate the electronic map number within an irregular polygon;
[0008] Merge the tiles of the intersecting boundaries of the distributed electronic maps: use the boundary range to extract the tiles that intersect with the boundary, convert the spatial position coordinates of the intersecting tiles into plane pixel coordinates, calculate the intersection point of the tile and the boundary for the boundary intersecting tiles, and clear the pixel map outside the intersection area; for the intersecting tiles, use the bitmap overlay fusion method to form a regional boundary tile;
[0009] The boundary tile is stored in the new map service. When the tile is obtained, it is not obtained from the distributed electronic map, but is obtained from the new map service.
[0010] Preferably, the tile location index of the electronic map is stored in a redis memory database; and the user information, role information, authority information, electronic map service address and configuration information are stored in a relational database.
[0011] Preferably, the step of pre-generating a distributed electronic map cache address calculation comprises:
[0012] Get the outer rectangular range of the irregular polygon, which is composed of the coordinates of the four corner points. Calculate the maximum and minimum row and column numbers according to the level and spatial resolution of the current map.
[0013] Each row is converted into a straight line, and the intersection points of the straight line and the irregular polygon are calculated. According to the number of intersection points, the column number of the intersection point is determined; when the number of intersection points is two, the starting point and the end point are the maximum column number and the minimum column number respectively; when the number of intersection points is greater than two, from the largest to the smallest column number, the column numbers that are not within the range of the map are eliminated, and each of the remaining rows is the column number within the record range.
[0014] Preferably, the distributed electronic map is also provided with authority control, and the authority control includes:
[0015] Regional boundary permissions, only allow preset IP addresses to access map services, or restrict set IP addresses from accessing map service resources;
[0016] IP address permission, convert the row and column numbers in the request address into spatial coordinates, and determine whether the coordinates are within the polygonal area. If they are within the area, the map request is allowed; if not, the map service request is rejected;
[0017] Application access restriction: Determine whether the map service has access rights by accessing the application. If so, the map tile information is returned; if not, access is denied and the application is returned.
[0018] Preferably, the service request method of the distributed electronic map is accessed in accordance with OGC WMTS regulations.
[0019] On the other hand, the present invention also proposes a distributed electronic map generation device, comprising:
[0020] Address cache module: pre-generate distributed electronic map request address cache: number each distributed electronic map of the global electronic map, generate a cache index of the electronic map request address, perform statistics and calculation analysis on the pre-generated regions and areas, estimate the time required to generate the cache index in a single-threaded situation, add computer resources for executing index information, dynamically obtain performance information of computer resources, arrange tasks according to the performance information of each computer, and divide the tasks arranged on each computer into multiple subtasks, where each subtask is a thread;
[0021] Calculation module: pre-generates a distributed electronic map cache address calculation algorithm, which can calculate the electronic map number within the irregular polygon range;
[0022] Fusion module: Fusing tiles at intersecting boundaries of distributed electronic maps: Apply boundary range to extract tiles that intersect with boundaries, convert spatial coordinates of intersecting tiles into plane pixel coordinates, calculate the intersection point of the tile with the boundary, and clear the pixel map outside the intersection area; for intersecting tiles, use bitmap overlay fusion method to form a regional boundary tile;
[0023] Storage module: Store boundary tiles in the new map service. When the tile is obtained, it is not obtained from the distributed electronic map, but is obtained from the new map service.
[0024] Preferably, the tile location index of the electronic map is stored in a redis memory database; and the user information, role information, authority information, electronic map service address and configuration information are stored in a relational database.
[0025] Preferably, the calculation module includes:
[0026] Row and column number calculation unit: obtain the outer rectangular range of the irregular polygon, which is composed of the coordinates of the four corner points, and calculate the maximum and minimum row and column numbers according to the level and spatial resolution of the current map;
[0027] Intersection calculation unit: each row is converted into a straight line, and the intersection points of the straight line and the irregular polygon are calculated. According to the number of intersection points, the column number of the intersection point is determined; when the number of intersection points is two, the starting point and the end point are the maximum column number and the minimum column number respectively; when the number of intersection points is greater than two, from the largest to the smallest column number, the column numbers that are not included in the map are eliminated, and each of the remaining rows is the column number within the record range.
[0028] Preferably, the distributed electronic map generating device further includes an authority control module, and the authority control module includes:
[0029] Regional boundary permissions, only allow preset IP addresses to access map services, or restrict set IP addresses from accessing map service resources;
[0030] IP address permission, convert the row and column numbers in the request address into spatial coordinates, and determine whether the coordinates are within the polygonal area. If they are within the area, the map request is allowed; if not, the map service request is rejected;
[0031] Application access restriction: Determine whether the map service has access rights by accessing the application. If so, the map tile information is returned; if not, access is denied and the application is returned.
[0032] The present invention also provides a readable storage medium of a distributed electronic map, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for generating a distributed electronic map as described above are implemented.
[0033] The present invention proposes a method for generating a distributed electronic map, which uses distributed computing resources and multi-threading to greatly increase the calculation speed of cache addresses. In addition, the present invention adopts map tile fusion calculation, and the intersection map of different boundary areas is accurate to the pixel point. The problem of heavy client burden and low efficiency when accessing non-distributed electronic maps is solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 The following is a schematic diagram of the steps of an embodiment of a method for generating a distributed electronic map according to the present invention;
[0035] Figure 2 for Figure 1 The specific flow chart of step S20 is shown. DETAILED DESCRIPTION
[0036] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and understandable, the specific implementation methods of the present invention are described clearly and completely below in conjunction with the accompanying drawings. Obviously, the specific details described below are only part of the embodiments of the present invention, and the present invention can also be implemented in many other embodiments different from those described herein. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work belong to the protection scope of the present invention.
[0037] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be a central element. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be a central element at the same time. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are for illustrative purposes only and do not represent the only implementation method.
[0038] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.
[0039] In one embodiment, see Figure 1 The present invention provides a method for generating a distributed electronic map, comprising the steps of:
[0040] S10: pre-generate distributed electronic map request address cache: number each distributed electronic map of the global electronic map, generate a cache index of the electronic map request address, perform statistics and calculation analysis on the pre-generated regions and areas, estimate the time required for generating the cache index in a single-threaded situation, add computer resources for executing the index information, dynamically obtain the performance information of the computer resources, arrange tasks according to the performance information of each computer, and divide the tasks arranged on each computer into multiple subtasks, where each subtask is a thread;
[0041] S20: pre-generate a distributed electronic map cache address algorithm, which can calculate the electronic map number within the irregular polygon range;
[0042] The steps of pre-generating the distributed electronic map cache address calculation include:
[0043] S21: Obtain the outer rectangular range of the irregular polygon, which is composed of the coordinates of four corner points, and calculate the maximum row and column number and the minimum row and column number according to the level and spatial resolution of the current map;
[0044] S22: Each row is converted into a straight line, and the intersection points of the straight line and the irregular polygon are calculated. According to the number of intersection points, the column number of the intersection points is determined; when the number of intersection points is two, the starting point and the end point are the maximum column number and the minimum column number respectively; when the number of intersection points is greater than two, from the largest to the smallest column number, the column numbers that are not included in the map are eliminated, and each of the remaining rows is the column number within the record range.
[0045] S30: Fusing the tiles of the intersecting boundaries of the distributed electronic map: extracting the tiles intersecting the boundaries by applying the boundary range, converting the spatial position coordinates of the intersecting tiles into plane pixel coordinates, calculating the intersection points of the tiles and the boundaries for the boundary intersecting tiles, and clearing the pixel maps outside the intersection area; for the intersecting tiles, adopting the bitmap overlay fusion method to form a regional boundary tile;
[0046] S40: The boundary tile is stored in the new map service. When the tile is obtained, it is not obtained from the distributed electronic map but is obtained from the new map service.
[0047] The present invention proposes a method for generating a distributed electronic map, which uses distributed computing resources and multi-threading to greatly increase the calculation speed of cache addresses. In addition, the present invention adopts map tile fusion calculation, and the intersection map of different boundary areas is accurate to the pixel point. The problem of heavy client burden and low efficiency when accessing non-distributed electronic maps is solved.
[0048] On the basis of this embodiment, further, the tile location index of the electronic map is stored in the redis memory database; and the user information, role information, authority information, electronic map service address and configuration information are stored in the relational database.
[0049] Specifically, the distributed electronic map is also provided with authority control, which includes:
[0050] Regional boundary permissions, only allow preset IP addresses to access map services, or restrict set IP addresses from accessing map service resources;
[0051] IP address permission, convert the row and column numbers in the request address into spatial coordinates, and determine whether the coordinates are within the polygonal area. If they are within the area, the map request is allowed; if not, the map service request is rejected;
[0052] Application access restriction: Determine whether the map service has access rights by accessing the application. If so, the map tile information is returned; if not, access is denied and the application is returned.
[0053] Among them, the service request method of this distributed electronic map is accessed in accordance with the OGC WMTS regulations.
[0054] On the other hand, the present invention also proposes a distributed electronic map generation device, comprising:
[0055] Address cache module: pre-generate distributed electronic map request address cache: number each distributed electronic map of the global electronic map, generate a cache index of the electronic map request address, perform statistics and calculation analysis on the pre-generated regions and areas, estimate the time required to generate the cache index in a single-threaded situation, add computer resources for executing index information, dynamically obtain performance information of computer resources, arrange tasks according to the performance information of each computer, and divide the tasks arranged on each computer into multiple subtasks, where each subtask is a thread;
[0056] Calculation module: pre-generates a distributed electronic map cache address calculation algorithm, which can calculate the electronic map number within the irregular polygon range; wherein, the calculation module includes:
[0057] Row and column number calculation unit: obtain the outer rectangular range of the irregular polygon, which is composed of the coordinates of the four corner points, and calculate the maximum and minimum row and column numbers according to the level and spatial resolution of the current map;
[0058] Intersection calculation unit: each row is converted into a straight line, and the intersection points of the straight line and the irregular polygon are calculated. According to the number of intersection points, the column number of the intersection point is determined; when the number of intersection points is two, the starting point and the end point are the maximum column number and the minimum column number respectively; when the number of intersection points is greater than two, from the largest to the smallest column number, the column numbers that are not included in the map are eliminated, and each of the remaining rows is the column number within the record range.
[0059] Fusion module: Fusing tiles at intersecting boundaries of distributed electronic maps: Apply boundary range to extract tiles that intersect with boundaries, convert spatial coordinates of intersecting tiles into plane pixel coordinates, calculate the intersection point of the tile with the boundary, and clear the pixel map outside the intersection area; for intersecting tiles, use bitmap overlay fusion method to form a regional boundary tile;
[0060] Storage module: Store boundary tiles in the new map service. When the tile is obtained, it is not obtained from the distributed electronic map, but is obtained from the new map service.
[0061] Specifically, the tile location index of the electronic map is stored in the redis memory database; while the user information, role information, authority information, electronic map service address and configuration information are stored in the relational database.
[0062] Specifically, the distributed electronic map generation device also includes an authority control module, and the authority control module includes:
[0063] Regional boundary permissions, only allow preset IP addresses to access map services, or restrict set IP addresses from accessing map service resources;
[0064] IP address permission, convert the row and column numbers in the request address into spatial coordinates, and determine whether the coordinates are within the polygonal area. If they are within the area, the map request is allowed; if not, the map service request is rejected;
[0065] Application access restriction: Determine whether the map service has access rights by accessing the application. If so, the map tile information is returned; if not, access is denied and the application is returned.
[0066] Specifically, the service request method of this distributed electronic map is accessed in accordance with the OGC WMTS regulations.
[0067] The present invention also provides a readable storage medium of a distributed electronic map, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for generating a distributed electronic map as described above are implemented.
[0068] The technical solution of the present invention has several advantages. First, it adopts a memory database combined with a relational database to effectively manage the electronic map cache information. Second, it uses distributed computing resources and multi-threading to greatly increase the calculation speed of the cache address. Third, it adopts a map access control method with multiple strategies to accurately control user access rights. Fourth, the present invention adopts map tile fusion calculation, which is accurate to pixel points for the intersection of maps in different boundary areas.
[0069] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0070] The above embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for those of ordinary skill in the art, several variations, substitutions and improvements can be made without departing from the concept of the present invention, and these should all be included in the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the claims.
Claims
1. A method for generating a distributed electronic map, characterized in that: Includes steps: Pre-generate distributed electronic map request address cache: number each distributed electronic map of the global electronic map, generate a cache index of the electronic map request address, perform statistics and calculation analysis on the pre-generated regions and areas, estimate the time required to generate the cache index in a single-threaded situation, add computer resources for executing index information, dynamically obtain performance information of computer resources, arrange tasks according to the performance information of each computer, and divide the tasks arranged on each computer into multiple subtasks, where each subtask is a thread; Pre-generate distributed electronic map cache address algorithm, which can calculate the electronic map number within an irregular polygon; It includes: obtaining the outer rectangular range of the irregular polygon, which is composed of the coordinates of the four corner points, and calculating the maximum row and column number and the minimum row and column number according to the level and spatial resolution of the current map; converting each row into a straight line, calculating the intersection of the straight line and the irregular polygon, and determining the column number of the intersection according to the number of intersections; when the number of intersections is two, the starting point and the end point are the maximum column number and the minimum column number respectively; when the number of intersections is greater than two, from the largest to the smallest column number, the column numbers that are not included in the map are eliminated, and each of the remaining rows is the column number within the record range; Merge the tiles of the intersecting boundaries of the distributed electronic maps: use the boundary range to extract the tiles that intersect with the boundary, convert the spatial position coordinates of the intersecting tiles into plane pixel coordinates, calculate the intersection point of the tile and the boundary for the boundary intersecting tiles, and clear the pixel map outside the intersection area; for the intersecting tiles, use the bitmap overlay fusion method to form a regional boundary tile; The boundary tile is stored in the new map service. When the tile is obtained, it is not obtained from the distributed electronic map, but from the new map service. The distributed electronic map is also provided with authority control, and the authority control includes: Regional boundary permissions, only allow preset IP addresses to access map services, or restrict set IP addresses from accessing map service resources; IP address permission, convert the row and column numbers in the request address into spatial coordinates, and determine whether the coordinates are within the polygonal area. If they are within the area, the map request is allowed; if not, the map service request is rejected; Application access restriction: Determine whether the map service has access rights by accessing the application. If so, the map tile information is returned; if not, access is denied and the application is returned.
2. The method for generating a distributed electronic map according to claim 1, characterized in that: The tile location index of the electronic map is stored in the redis memory database; while the user information, role information, permission information, electronic map service address and configuration information are stored in the relational database.
3. The method for generating a distributed electronic map according to claim 1, characterized in that: The service request method of this distributed electronic map is accessed in accordance with the OGC WMTS regulations.
4. A distributed electronic map generation device, characterized in that: include, Address cache module: pre-generate distributed electronic map request address cache: number each distributed electronic map of the global electronic map, generate a cache index of the electronic map request address, perform statistics and calculation analysis on the pre-generated regions and areas, estimate the time required to generate the cache index in a single-threaded situation, add computer resources for executing index information, dynamically obtain performance information of computer resources, arrange tasks according to the performance information of each computer, and divide the tasks arranged on each computer into multiple subtasks, where each subtask is a thread; Calculation module: pre-generates a distributed electronic map cache address calculation algorithm, which can calculate the electronic map number within the irregular polygon range; The computing module includes: Row and column number calculation unit: obtain the outer rectangular range of the irregular polygon, which is composed of the coordinates of the four corner points, and calculate the maximum and minimum row and column numbers according to the level and spatial resolution of the current map; Intersection calculation unit: each row is converted into a straight line, and the intersections of the straight line and the irregular polygon are calculated. According to the number of intersections, the column number of the intersection is determined; when the number of intersections is two, the starting point and the end point are the maximum column number and the minimum column number respectively; when the number of intersections is greater than two, from the largest to the smallest column number, the column numbers that are not included in the map are eliminated, and each of the remaining rows is the column number within the record range; Fusion module: Fusing tiles at intersecting boundaries of distributed electronic maps: Apply boundary range to extract tiles that intersect with boundaries, convert spatial coordinates of intersecting tiles into plane pixel coordinates, calculate the intersection point between the tile and the boundary for boundary intersecting tiles, and clear the pixel map outside the intersection area; For intersecting tiles, use bitmap overlay fusion method to form a regional boundary tile; Storage module: Store boundary tiles in the new map service. When the tile is obtained, it is not obtained from the distributed electronic map, but from the new map service. Authority control module: The authority control module includes: Regional boundary permissions, only allow preset IP addresses to access map services, or restrict set IP addresses from accessing map service resources; IP address permission, convert the row and column numbers in the request address into spatial coordinates, and determine whether the coordinates are within the polygonal area. If they are within the area, the map request is allowed; if not, the map service request is rejected; Application access restriction: Determine whether the map service has access rights by accessing the application. If so, the map tile information is returned; if not, access is denied and the application is returned.
5. The distributed electronic map generation device according to claim 4, characterized in that: The tile location index of the electronic map is stored in the redis memory database; while the user information, role information, permission information, electronic map service address and configuration information are stored in the relational database.
6. A readable storage medium of a distributed electronic map, on which a computer program is stored, characterized in that: When the computer program is executed by a processor, the steps of the method for generating a distributed electronic map according to claims 1 to 3 are implemented.