CN113656527A - Map resource processing method and device, computer equipment and storage medium - Google Patents

Map resource processing method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN113656527A
CN113656527A CN202110961869.2A CN202110961869A CN113656527A CN 113656527 A CN113656527 A CN 113656527A CN 202110961869 A CN202110961869 A CN 202110961869A CN 113656527 A CN113656527 A CN 113656527A
Authority
CN
China
Prior art keywords
map
slice
target
resource
client
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110961869.2A
Other languages
Chinese (zh)
Inventor
毛海亚
邓汝艳
钟伟华
杜玲玲
黄玲
钟家晖
吴卫
林子熙
李想
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou China Dci Co ltd
Guangzhou Planning And Natural Resources Automation Center Guangzhou Basic Geographic Information Center
Original Assignee
Guangzhou China Dci Co ltd
Guangzhou Planning And Natural Resources Automation Center Guangzhou Basic Geographic Information Center
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou China Dci Co ltd, Guangzhou Planning And Natural Resources Automation Center Guangzhou Basic Geographic Information Center filed Critical Guangzhou China Dci Co ltd
Priority to CN202110961869.2A priority Critical patent/CN113656527A/en
Publication of CN113656527A publication Critical patent/CN113656527A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/29Geographical information databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/904Browsing; Visualisation therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Remote Sensing (AREA)
  • Instructional Devices (AREA)

Abstract

The application relates to a map resource processing method, a map resource processing device, computer equipment and a storage medium. The method comprises the following steps: receiving a map slice acquisition request sent by a client; the map slice acquisition request is an acquisition request initiated by the client for a target map slice associated with a target map area; if the area corresponding to the target map slice is intersected with the target map area, judging whether the client has the acquisition permission of the target map slice; if the client has the acquisition right to the target map slice, searching whether map resources of the target map slice are cached locally; and if the map resource of the target map slice is cached locally, sending the map resource to the client. By adopting the method, the efficiency of loading the map by the client can be improved.

Description

Map resource processing method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of geographic information technology, and in particular, to a map resource processing method, apparatus, computer device, and storage medium.
Background
With the development of information technology and geographic information systems, when a map is loaded on an electronic device, a plurality of map slices of the map are called, so that complete map data is loaded on a display interface of the electronic device.
However, the client in the conventional technology needs to request the server to filter and cut the original map each time the map is loaded, which causes the server to frequently perform the original map cutting operation, and this is often not favorable for improving the efficiency of loading the map by the client because the original map cutting operation needs to be performed in a long time.
Therefore, the conventional technology has the problem that the efficiency of loading the map by the client is low.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a map resource processing method, apparatus, computer device, and storage medium capable of improving efficiency of loading a map by a client.
A map resource processing method, the method comprising:
receiving a map slice acquisition request sent by a client; the map slice acquisition request is an acquisition request initiated by the client for a target map slice associated with a target map area;
if the area corresponding to the target map slice is intersected with the target map area, judging whether the client has the acquisition permission of the target map slice;
if the client has the acquisition right to the target map slice, searching whether map resources of the target map slice are cached locally;
and if the map resource of the target map slice is cached locally, sending the map resource to the client.
In one embodiment, the map slice acquisition request carries a map service identifier, a layer identifier and an area identifier; the judging whether the client has the right to acquire the target map slice comprises the following steps:
searching a user authority table according to the map service identifier, the layer identifier and the area identifier; the user authority table comprises a list formed by users having access authority to the target map slice;
and if the user logging in the client is in the user permission table, judging that the client has the acquisition permission of the target map slice.
In one embodiment, the map slice acquisition request further carries a slice position identifier and a zoom level of the target map slice; the searching whether the map resource of the target map slice is locally cached comprises the following steps:
determining a target map resource pool of the local cache according to the map service identifier, the layer identifier, the area identifier and the zoom level;
and searching the map resource corresponding to the slice position identification in the target map resource pool as the map resource of the target map slice.
In one embodiment, if the area corresponding to the target map slice is not intersected with the target map area, the method further includes:
sending a transparent map slice to the client; the transparent map slice is a map slice without map resources.
In one embodiment, if the map resource of the target map slice is not cached locally, the method further includes:
sending an original map slice acquisition request to an original map server; the original map slice acquisition request carries map slice request parameters; the map slice request parameter is used for indicating the original map server to acquire an original map resource containing the map resource of the target map slice;
receiving the original map resource returned by the original map server;
and determining the map resource of the target map slice according to the original map resource.
In one embodiment, the map slice acquisition request carries a map service identifier, a layer identifier, a slice position identifier of the target map slice, and a zoom level; if the map service provided by the original map server is a dynamic service, before the step of sending the original map slice acquisition request to the original map server, the method further comprises: determining the map service type of the target map slice according to the map service identification, and calculating the boundary coordinate of the target map slice according to the map zoom level, the slice position identification and the slice size of the target map slice;
taking the map service type, the layer identifier, the boundary coordinate and the picture size of the map resource as the map slicing request parameter;
generating the original map slice acquisition request carrying the map slice request parameters;
if the map service provided by the original map server is a cache service, before the step of sending the original map slice acquisition request to the original map server, the method further comprises:
taking the layer identifier, the map scaling grade and the slice position identifier as the map slice request parameters;
and generating an original map slice acquisition request carrying the map slice request parameters.
In one embodiment, the map slice acquisition request carries an area identifier; the original map resource comprises map resources outside the area corresponding to the target map slice; the determining the map resource of the target map slice according to the original map resource comprises:
and cutting the original map resource according to the area identification and the area boundary data corresponding to the area identification to obtain the map resource of the target map slice.
A map resource processing apparatus, the apparatus comprising:
the receiving module is used for receiving a map slice acquisition request sent by a client; the map slice acquisition request is an acquisition request initiated by the client for a target map slice associated with a target map area;
the judging module is used for judging whether the client has the acquisition permission of the target map slice or not when the area corresponding to the target map slice is intersected with the target map area;
the searching module is used for searching whether map resources of the target map slice are locally cached or not when the client has the acquisition permission of the target map slice;
and the sending module is used for sending the map resource to the client when the map resource of the target map slice is locally cached.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
receiving a map slice acquisition request sent by a client; the map slice acquisition request is an acquisition request initiated by the client for a target map slice associated with a target map area;
if the area corresponding to the target map slice is intersected with the target map area, judging whether the client has the acquisition permission of the target map slice;
if the client has the acquisition right to the target map slice, searching whether map resources of the target map slice are cached locally;
and if the map resource of the target map slice is cached locally, sending the map resource to the client.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
receiving a map slice acquisition request sent by a client; the map slice acquisition request is an acquisition request initiated by the client for a target map slice associated with a target map area;
if the area corresponding to the target map slice is intersected with the target map area, judging whether the client has the acquisition permission of the target map slice;
if the client has the acquisition right to the target map slice, searching whether map resources of the target map slice are cached locally;
and if the map resource of the target map slice is cached locally, sending the map resource to the client.
By receiving a target map slice acquisition request which is sent by a client and is associated with a target map area, when an area corresponding to the target map slice is intersected with the target map area, the client has an acquisition authority for the target map slice, and a local cache of the map proxy server contains map resources of the target map slice, the map proxy server sends the map resources of the target map slice to the client; therefore, the map proxy server can directly return the map resource of the target map slice required by the client from the local cache, and does not need to perform map cutting on the original map resource aiming at the map slice acquisition request sent by the client every time, so that the waste of time can be avoided, and the efficiency of loading the map by the client can be effectively improved.
Drawings
FIG. 1 is a diagram of an application environment of a map resource processing method in one embodiment;
FIG. 2 is a flow diagram illustrating a method for map resource processing, according to one embodiment;
FIG. 3 is a flowchart illustrating a method for processing map resources according to another embodiment;
FIG. 4 is a timing diagram of a map resource processing method in one embodiment;
FIG. 5 is a block diagram of a map resource processing apparatus according to an embodiment;
FIG. 6 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The map resource processing method provided by the application can be applied to the application environment shown in fig. 1. Wherein the map proxy server 110 communicates with the client 120 over a network. The map proxy server 110 receives a map slice acquisition request sent by a client; the map slice acquisition request is an acquisition request initiated by a client for a target map slice associated with a target map area; then, if the area corresponding to the target map slice is intersected with the target map area, the map proxy server 110 judges whether the client has the acquisition right to the target map slice; then, if the client has the right to acquire the target map slice, the map proxy server 110 searches whether the map resource of the target map slice is cached locally; finally, if the map resource of the target map slice is cached locally, the map proxy server 110 sends the map resource to the client 120. Among other things, the client 120 may be, but is not limited to, programs on various personal computers, laptops, smartphones, tablets, and portable wearable devices. The map proxy server 110 may be implemented as a stand-alone server or as a server cluster of multiple servers.
In an embodiment, as shown in fig. 2, a method for processing map resources is provided, which is described by taking the method as an example applied to the terminal in fig. 1, and includes the following steps:
step S210, receiving a map slice acquisition request sent by the client.
The client may refer to a client installed with map service software.
The map slice acquisition request is an acquisition request initiated by a client for a target map slice associated with a target map area.
Wherein the target map region may refer to a region associated with the target map slice.
The target map slice may refer to a map slice requested to be acquired by the client.
Specifically, when the client needs to load the map of the target map area, the required map is divided into a plurality of slices, each slice generates a coordinate row number and a coordinate column number based on the same origin of the same coordinate system, and thus, the specific position of the slice can be located based on the coordinate row number and the coordinate column number. In practical applications, the same origin of the same coordinate system may be the origin of coordinates (0,0) located at the upper left corner of the same coordinate system.
Then, the client sends an acquisition request (i.e. map slice acquisition request) for a target map slice associated with the target map area to the map proxy server, so that the map proxy server receives the map slice acquisition request sent by the client.
Step S220, if the area corresponding to the target map slice intersects with the target map area, determining whether the client has the right to acquire the target map slice.
Wherein, the corresponding region of the target map slice may refer to a region that intersects with the target map region or does not intersect with the target map region at all.
Specifically, after the map proxy server receives a map slice acquisition request sent by the client, the map proxy server may determine whether the area intersects with the target map area according to an area corresponding to the target map slice requested by the client. When the area corresponding to the target map slice is intersected with the target map area, the map proxy server judges whether the client has the acquisition authority of the target map slice. Specifically, the map proxy server may obtain a user authority table corresponding to the target map slice; and judging whether the client has the acquisition authority for the target map slice or not by judging whether the user logged in by the client is in the user authority table or not.
In step S230, if the client has the right to acquire the target map slice, whether the map resource of the target map slice is cached locally is searched.
The cache contains map resources of a series of map slices within a certain map range of a scale, the map resources can be stored on a map proxy server or a Network File System (NFS) can be deployed independently, the map resources of the map slices are stored in a shared directory of the NFS, and the map proxy server mounts the shared directory on the local.
The map resource may refer to a map picture.
The scale refers to the ratio of the length of a line segment on the map to the actual length of a corresponding line segment on the ground, and the actual size of the target map slice can be determined.
In specific implementation, after the map proxy server judges that the client has the authority to acquire the target map slice, the client searches whether the map resource of the target map slice is cached in the local. Specifically, a target map resource pool is cached locally, the target map resource pool includes map resources of the target map slice, and the map proxy server can search whether the map resources of the target map slice required by the client exist in the locally cached target map resource pool.
In step S240, if the map resource of the target map slice is locally cached, the map resource is sent to the client.
In the specific implementation, when the map resource of the target map slice is locally cached, the map proxy server sends the map resource of the target map slice to the client, and the client can quickly load the map of the target map area according to the received map resource of the target map slice.
In the map resource processing method, the map proxy server receives an acquisition request for a target map slice associated with a target map area sent by the client, and when it is determined that the area corresponding to the target map slice intersects the target map area, the client has an acquisition right of the target map slice, and a local cache of the map proxy server contains a map resource of the target map slice, the map proxy server directly sends the map resource of the target map slice to the client. Therefore, the map proxy server can directly return the map resource of the target map slice required by the client from the local cache, and does not need to perform map cutting on the original map resource aiming at the map slice acquisition request sent by the client every time, so that the waste of time can be avoided, and the efficiency of loading the map by the client can be effectively improved.
In another embodiment, the map slice acquisition request carries a map service identifier, a layer identifier and an area identifier; judging whether the client has the acquisition authority for the target map slice or not, including: searching a user authority table according to the map service identifier, the layer identifier and the area identifier; the user authority table is a list consisting of users having access authority on the target map slice; and if the user logging in the client is in the user authority table, judging that the client has the acquisition authority for the target map slice.
The map service identifier may refer to a map service number, and different map service numbers correspond to map services with different purposes. In practical applications, the different map services may refer to a traffic map service, an environmental protection map service, a business map service, a tourist map service, and the like.
The layer identifier may refer to a layer number, and different layer numbers correspond to layers with different features and attributes included in the same map service, for example, the traffic map service includes a bus stop layer, a subway stop layer, a high-speed rail stop layer, and the like.
The area identifier may refer to an area number, and is used to locate a specific area corresponding to the target map slice.
The user authority list is a list formed by users with access authorities of all map slices corresponding to the map service identification, the map layer identification and the area identification.
In specific implementation, the map proxy server determines the area corresponding to the target map slice according to the area identifier carried by the map slice acquisition request sent by the customer service end. When the map proxy server judges that the area corresponding to the target map slice is intersected with the target map area, the map proxy server searches a user authority list according to the map service identification, the layer identification and the area identification carried by the map slice acquisition request, a user list is recorded in the user authority list, the users have access authority of all map slices corresponding to the map service identification, the layer identification and the area identification, and the user list comprises users having access authority on the target map slice. When a user logging in a client is in a user authority table, the client is proved to have the acquisition authority of a target map slice corresponding to a map service identifier, a layer identifier and an area identifier carried by a map slice acquisition request; when the user logging in the client is not in the user permission table, the client does not have the permission for acquiring the target map slice, the map proxy server sends a permission exception message to the client, and the permission exception message is used for informing that the client does not have the permission for acquiring the map slice, so that the client cannot acquire the target map slice.
According to the technical scheme of the embodiment, the map service identifier, the layer identifier and the area identifier carried in the acquisition request of the target map slice sent by the client are used for searching the user authority list, and the list formed by the users with the access authority of the target map slice is recorded in the user authority list. Therefore, only when the user logging in the client is recorded in the user authority table, the map proxy server can judge that the client has the acquisition authority for the target map slice, and further can search the map resource of the target map slice in the local cache, so that the safety protection of the map proxy server for the target map slice is realized, and the privacy of the target map slice is improved.
In another embodiment, the map slice acquisition request further carries a slice position identifier and a zoom level of the target map slice; searching whether a map resource of a target map slice is cached locally or not, wherein the searching comprises the following steps: determining a target map resource pool of local cache according to the map service identifier, the layer identifier and the area identifier; and searching the map resource corresponding to the slice position identification in the target map resource pool as the map resource of the target map slice.
The slice position identifier may refer to a coordinate row number and a coordinate column number generated by the target map slice based on the origin (0,0), and is used to determine a specific position of the target map slice.
The zoom level is equivalent to a scale, for example, the zoom level is n, and the corresponding scale is 1: 2n
When the target map resource pool is created, the map proxy server cuts the map into map slices at different scales, stores the map resources of the map slices in the map proxy server, and forms different map resource pools according to different map service identifiers, layer identifiers and area identifiers, wherein the map resource pools include the target map resource pool.
The target map resource pool refers to a map resource pool where the target map slice is located.
In the specific implementation, when the map proxy server judges that the client has the acquisition authority to the target map slice, the map proxy server determines the map service type of the target map slice according to the map service identifier carried in the received map slice acquisition request; determining a layer where a target map slice is located according to a layer identifier carried in a received map slice acquisition request; determining the zoom level of a target map slice according to the zoom level carried in the received map slice acquisition request; and then, the map proxy server searches map resources corresponding to the slice position identification in the target map resource pool according to the slice position identification carried in the received map slice acquisition request to serve as the map resources of the target map slice.
According to the technical scheme of the embodiment, the map proxy server firstly locates the position of the target map resource pool from the local cache through the map service identifier, the layer identifier, the area identifier and the zoom level carried by the map slice acquisition request sent by the client, and then searches the map resource of the target map slice in the target map resource pool according to the slice position identifier carried by the map slice acquisition request, so that the map resource of the target map slice required by the client can be accurately found, and the accuracy of the map proxy server for searching the map resource of the target map slice in the local cache is improved.
In another embodiment, the region corresponding to the target map slice does not intersect the target map region, and the method further comprises: and sending the transparent map slice to the client.
The transparent map slice is a map slice which does not carry map resources.
In specific implementation, the map proxy server receives an acquisition request for a target map slice associated with a target map area, which is sent by a client, where the acquisition request carries an area identifier of the target map slice, and the map proxy server can determine a specific area corresponding to the target map slice through the area identifier. And after judging that the region corresponding to the target map slice is not intersected with the target map region according to the region identifier, the map proxy server sends the transparent map slice without carrying map resources to the client, so that the client is prevented from acquiring the map resources outside the target map region, and the data transmission quantity is reduced.
According to the technical scheme of the embodiment, the map proxy server determines the area corresponding to the target map slice according to the area identification carried by the map slice acquisition request sent by the customer service end, and when the area corresponding to the target map slice is judged to be not intersected with the target map area, the map proxy server returns a transparent slice which does not carry map resources to the client, and the map proxy server does not perform subsequent operation any more. Furthermore, the efficiency of the map proxy server for processing the map slice acquisition request sent by the client is improved, meanwhile, the client is prevented from acquiring map resources outside the target map area, and the data transmission quantity is reduced.
In another embodiment, the map resource is not locally cached with the target map slice, and the method further comprises: sending an original map slice acquisition request to an original map server; the original map slice acquisition request carries map slice request parameters; the map slice request parameter is used for indicating an original map server to acquire an original map resource containing a map resource of a target map slice; receiving original map resources returned by an original map server; and determining the map resource of the target map slice according to the original map resource.
The original map slice acquisition request is an acquisition request which is sent to an original map server by a map proxy server aiming at a target map slice which is not cached locally.
Where an original map server may refer to an independent server or a cluster.
The map slicing request parameter is parameter information required by the original map server to generate original map resources.
The original map resource may refer to an original map resource including a map of the target map area.
In the specific implementation, when the map proxy server cannot find map resources of a target map slice in a local cache according to the map service identifier, the layer identifier, the area identifier, the slice position identifier and the zoom level, the map proxy server sends an original map slice acquisition request carrying map slice request parameters to the original map proxy server, and when the map service provided by the original map server is the cache service, the map proxy server takes the map service identifier, the layer identifier, the zoom level and the slice position identifier carried by the received map slice acquisition request as the map slice request parameters required by the original map server. The original map server can determine the map service type of the target map slice according to the map service identifier in the map slice request parameter; according to the layer identifier in the map slice request parameter, the layer where the target map slice is located can be determined; according to the zoom level in the map slice request parameter, the zoom level of the target map slice can be determined; according to the slice position identification in the map slice request parameter, the position of the target map slice can be determined. Therefore, the original map server can search the original map resource containing the map resource of the target map slice from the local cache of the original map server according to the original map slice acquisition request, and send the original map resource to the map proxy server. And then, the map proxy server acquires the area identification carried by the request and the area boundary data corresponding to the area identification according to the map slice sent by the client, and acquires the map resource of the target map slice from the original map resource.
In the technical scheme of this embodiment, if the map proxy server cannot find the map resource of the target map slice locally, an original map slice acquisition request carrying a map slice request parameter is sent to the original map server, so that the original map server sends the original map resource containing the map resource of the target map slice to the map proxy server, and the map proxy server can determine the map resource of the target map slice according to the received original map resource. Therefore, even under the condition that the map resource of the target map slice is not cached in the map proxy server, the client can acquire the map resource of the target map slice through the original map server, so that the client can stably and smoothly load the map resource of the target map area requested by the user, and the map loading efficiency of the client is improved.
In another embodiment, the map slice acquisition request carries a map service identifier, a layer identifier, a slice position identifier of a target map slice, and a zoom level; if the map service provided by the original map server is dynamic service, before the step of sending the original map slice acquisition request to the original map server, the method further comprises the following steps: determining the map service type of the target map slice according to the map service identification, and calculating the boundary coordinate of the target map slice according to the zoom level, the slice position identification and the slice size of the target map slice; taking the map service type, the layer identifier, the boundary coordinate and the picture size of the map resource as map slicing request parameters; generating the original map slice acquisition request carrying the map slice request parameters; if the map service provided by the original map server is the cache service, before the step of sending the original map slice acquisition request to the original map server, the method further comprises the following steps: taking the layer identifier, the zoom level and the slice position identifier as map slice request parameters; and generating an original map slice acquisition request carrying the map slice request parameters.
The dynamic service is that the original map server generates an original map resource containing map resources of a target map slice according to a map slice request parameter carried by a received original map slice acquisition request.
The slice position mark is a row number and a column number of the target map slice in a coordinate system, and the initial positions of the row number and the column number are both 0.
Wherein the unit of the slice size of the target map slice is a pixel.
The boundary coordinates of the target map slice are the boundary coordinates corresponding to the target map slice in the non-zoomed actual size, and the boundary range of the non-zoomed target map slice can be determined. It may refer to four-point coordinates (xmin, ymin, xmax, ymax), i.e., coordinates of the upper left corner (xmin, ymin) and the lower right corner (xmax, ymax), xmin representing the minimum x-coordinate of the target map slice, xmax representing the maximum x-coordinate of the target map slice, ymin representing the minimum y-coordinate of the target map slice, and ymax representing the maximum y-coordinate of the target map slice.
The picture size of the map resource is the actual size of the target map slice which is not zoomed, and is determined by the slice size and the zoom level of the target map slice.
In the specific implementation, if the original map server provides dynamic service, the map proxy server determines the map service type of the target map slice according to the map service identifier carried in the map slice acquisition request sent by the client; the map proxy server can calculate the actual size of the target map slice which is not zoomed according to the zoom level of the target map slice and the slice size of the target map slice carried by the map slice acquisition request, and further, the map proxy server calculates the four-point boundary coordinate corresponding to the actual size according to the row number and the column number, the origin coordinate and the origin position of the target map slice carried by the map slice acquisition request and the actual size of the target map slice which is not zoomed.
For example, assume that the zoom level of the target map slice is 2, the row and column number of the target map slice is (2,3), the origin coordinate (0,0) is located at the upper left corner, and the slice size of the target map slice is 256 × 256 in units of pixels. From the zoom level of 2, it can be determined that the scale is 1:4, the actual size of the target map slice is about 1000 × 1000, and then from the origin coordinates (0,0) and the row and column numbers (2,3) of the target map slice, it can be determined that the boundary coordinates of four points corresponding to the target map slice under the actual size are (2000,3000, 4000), i.e., the upper left coordinates (2000,3000), the lower right coordinates (3000,4000), the minimum x coordinates are 2000, the maximum x coordinates are 3000, the minimum y coordinates are 3000, and the maximum y coordinates are 4000.
And then, the map proxy server sends an original map slice acquisition request carrying map slice request parameters to the original map server by taking the map service type, the layer identifier carried by the map slice acquisition request, the boundary coordinates corresponding to the target map slice under the non-zoomed actual size, and the picture size of the map resource, namely the actual size of the non-zoomed target map slice as the map slice request parameters. The original map server can determine the map service type of the target map slice in the original map server according to the map service type in the map slice request parameter; according to the layer identifier in the map slice request parameter, the layer where the target map slice is located can be determined; according to the boundary coordinates corresponding to the target map slice under the actual size without zooming in the map slice request parameters, the boundary range of the target map slice under the actual size can be determined; the size of the target map slice that is not zoomed may be determined from the picture size of the map resource in the map slice request parameter. Therefore, the original map server can generate the original map resource with the specified map layer, the specified boundary range and the picture size of the specified map resource according to the original map slice acquisition request carrying the map slice request parameters, the map resource of the target map slice is contained in the original map resource, and the original map resource is sent to the map proxy server by the original map server.
According to the technical scheme of the embodiment, when the service provided by the original map server is dynamic service, the map proxy server determines the map service type of the target map slice according to the map service identification carried by the map slice acquisition request sent by the client, calculates the four-point boundary coordinates of the target map slice and the picture size of the map resource according to the zoom level, the slice position identification and the slice size of the target map slice, takes the map service type, the layer identification, the boundary coordinates and the picture size of the map resource as map slice request parameters, and sends the original map slice acquisition request carrying the map slice request parameters to the original map proxy server; when the service provided by the original map server is a cache service, the map proxy server takes the map service identifier, the layer identifier, the zoom level and the slice position identifier carried by the received map slice acquisition request as the map slice request parameter required by the original map server, and sends the original map slice acquisition request carrying the map slice request parameter to the original map proxy server. Therefore, the map proxy server can send original map slice acquisition requests carrying different map slice request parameters to the original map server aiming at different services provided by the original map server, so that the map proxy server can still receive the original map resources which are returned by the original map server and contain the map resources of the target map slice, the client can acquire the map resources of the target map slice, and the reliability of the map proxy server for processing the map slice acquisition requests is improved.
In another embodiment, the map slice acquisition request carries an area identifier; the original map resource comprises map resources outside the region corresponding to the target map slice; determining map resources of a target map slice according to original map resources, wherein the map resources comprise: and cutting the original map resource according to the area identification and the area boundary data corresponding to the area identification to obtain the map resource of the target map slice.
The area identifier may refer to an area number, and is used to locate a specific area corresponding to the target map slice.
Wherein the region boundary data is used to determine the extent of the region corresponding to the target map slice.
In specific implementation, after receiving an original map resource containing map resources outside an area corresponding to a target map slice returned by an original map server, a map proxy server determines a specific area corresponding to the target map slice according to an area identifier carried by a map slice acquisition request sent by a client. And then, the map proxy server determines the range of the area corresponding to the target map slice according to the area boundary data corresponding to the area identification. And finally, the map proxy server cuts the original map resources containing map resources outside the target map area according to the specific area corresponding to the target map slice and the range of the specific area corresponding to the target map slice, determines the area range corresponding to the target map slice, and obtains the map resources of the target map slice.
In the technical scheme of this embodiment, the map proxy server cuts the original map resource including the map resource outside the area corresponding to the target map slice through the area identifier carried by the map slice acquisition request sent by the client and the area boundary data corresponding to the area identifier, so as to obtain the map resource of the target map slice. Therefore, even if the original map resource returned by the original map server contains the map resource which is not needed by the client, the map proxy server can accurately cut the map resource of the target area slice from the original map resource, and the accuracy of the map proxy server for acquiring the map resource of the target map slice is improved.
In another embodiment, as shown in fig. 3, a map resource processing method is provided, which is described by taking the method as an example applied to the map proxy server 110 in fig. 1, and includes the following steps:
step S310, receiving a map slice acquisition request sent by a client; the map slice acquisition request is an acquisition request initiated by the client for a target map slice associated with a target map area; the map slice acquisition request carries a map service identifier, a layer identifier and a region identifier, and a slice position identifier and a zoom level of the target map slice.
Step S320, if the area corresponding to the target map slice is intersected with the target map area, searching a user authority table according to the map service identifier, the layer identifier and the area identifier; the user permission table includes a list of users having access permission to the target map slice.
Step S330, judging whether the client has the acquisition authority to the target map slice according to whether the user logging in the client is in the user authority table.
Step S340, if the client has the right to acquire the target map slice, searching whether the map resource of the target map slice is cached locally.
Step S350, if the map resource of the target map slice is not cached locally, sending an original map slice acquisition request to an original map server; the original map slice acquisition request carries map slice request parameters; the map slice request parameter is used for instructing the original map server to acquire an original map resource containing the map resource of the target map slice.
Step S360, receiving the original map resource returned by the original map server.
Step S370, determining the map resource of the target map slice according to the original map resource.
And step S380, sending the map resource of the target map slice to the client.
It should be noted that, for the specific limitations of the above steps, reference may be made to the above specific limitations of a domain resource processing method, which is not described herein again.
To facilitate understanding by those skilled in the art, FIG. 4 provides a timing diagram of a map resource processing method. Step 1, when a client needs to load a map, the required map is firstly divided into a plurality of slices. And 2, the client initiates a map slice acquisition request to the map proxy server aiming at a target map slice associated with the target map area, wherein the map slice acquisition request carries a map service identifier, a layer identifier, an area identifier, a slice position identifier and a zoom level of the target map slice. And 3, determining the area corresponding to the target map slice by the map proxy server according to the area identification, and judging whether the area corresponding to the target map slice is intersected with the target map area. And 4, when the area corresponding to the target map slice is intersected with the target map area, the map proxy server searches a user authority table according to the map service identifier, the layer identifier and the area identifier, and judges whether the client has the acquisition authority of the target map slice according to whether the user logging in the client is in the user authority table, wherein the user authority table comprises a list formed by users having access authority to the target map slice. And 5, when the user logging in the client is not in the user permission table, the map proxy server judges that the client does not have the acquisition permission of the target map slice, and sends a permission exception message to the client, wherein the permission exception message is used for informing that the client does not have the acquisition permission of the map slice. And 6, when the user logging in the client is in the user permission list, the map proxy server judges that the client has the acquisition permission of the target map slice, and locally searches whether the map resource of the target map slice is cached or not. And 7, when the map resource of the target map slice is locally cached, the map proxy server sends the map resource of the target map slice to the client. And 8, when the map resource of the target map slice is not cached locally, the map proxy server sends an original map slice acquisition request carrying map slice request parameters to the original map server, and the original map server acquires the original map resource containing the map resource of the target map slice according to the map slice request parameters. The original map resource also includes map resources outside the area corresponding to the target map slice. And 9, the original map server sends the original map resource to the map proxy server. And step 10, the map proxy server cuts the original map resource according to the area identification carried by the map slice acquisition request sent by the client and the area boundary data corresponding to the area identification to obtain the map resource of the target map slice. And step 11, caching the map resources of the target map slice in the target storage position by the map proxy server. And step 12, updating the map resource pool of the local cache after the cache is finished. And step 13, the map proxy server sends the map resource of the target map slice to the client.
Therefore, as long as the area corresponding to the target map slice required by the client is intersected with the target map area and the client has the acquisition authority of the target map slice, the map proxy server can search whether the map resource of the target map slice is cached in the local according to the target map slice information carried by the map slice acquisition request sent by the client, and send the map resource of the target map slice to the client. Even if the map resource of the target map slice is not cached locally, the map proxy server sends an original map slice acquisition request carrying map slice request parameters to the original map server, instructs the original map server to acquire the original map resource containing the map resource of the target map slice, and sends the original map resource to the map proxy server. And the map proxy server determines the map resources of the target map slice according to the original map resources and caches the map resources of the target map slice locally. And finally, the map proxy server sends the map resource of the target map slice to the client. Therefore, when the map proxy server receives a map slice acquisition request sent by the client, the map resource of the target map slice can be searched from the local cache and returned to the client, instead of acquiring the map resource of the target map slice by generating the original map resource through the original map server every time, the efficiency of loading the map of the target map area by the client can be effectively improved.
It should be understood that although the steps in the flowcharts of fig. 2 and 3 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2 and 3 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed in turn or alternately with other steps or at least some of the other steps.
In one embodiment, as shown in fig. 5, there is provided a map resource processing apparatus including: receiving module, judging module, searching module and sending module, wherein:
a receiving module 510, configured to receive a map slice obtaining request sent by a client; the map slice acquisition request is an acquisition request initiated by the client for a target map slice associated with a target map area.
A determining module 520, configured to determine whether the client has an acquisition permission for the target map slice when the area corresponding to the target map slice intersects with the target map area.
The searching module 530 is configured to search whether a map resource of the target map slice is locally cached when the client has the right to acquire the target map slice.
A sending module 540, configured to send the map resource to the client when the map resource of the target map slice is locally cached.
In one embodiment, the map slice obtaining request carries a map service identifier, a layer identifier, and an area identifier, and the determining module 520 is specifically configured to search a user permission table according to the map service identifier, the layer identifier, and the area identifier; the user authority table comprises a list formed by users having access authority to the target map slice; and if the user logging in the client is in the user permission table, judging that the client has the acquisition permission of the target map slice.
In one embodiment, the map slice obtaining request further carries a slice position identifier and a zoom level of the target map slice, and the search module 530 is specifically configured to determine the locally cached target map resource pool according to the map service identifier, the layer identifier, the area identifier, and the zoom level; and searching the map resource corresponding to the slice position identification in the target map resource pool as the map resource of the target map slice.
In one embodiment, if the area corresponding to the target map slice does not intersect with the target map area, the map resource processing apparatus further includes: the transparent slice sending module is used for sending the transparent map slice to the client; the transparent map slice is a map slice without map resources.
In one embodiment, if the map resource of the target map slice is not cached locally, the map resource processing apparatus further includes: the request sending module is used for sending an original map slice acquisition request to an original map server; the original map slice acquisition request carries map slice request parameters; the map slice request parameter is used for indicating the original map server to acquire an original map resource containing the map resource of the target map slice; the resource receiving module is used for receiving the original map resource returned by the original map server; and the determining module is used for determining the map resource of the target map slice according to the original map resource.
In one embodiment, the map slice acquisition request carries a map service identifier, a layer identifier, a slice position identifier of the target map slice, and a zoom level; the map resource processing device further comprises: the request generation module is used for determining the map service type of the target map slice according to the map service identification if the map service provided by the original map server is dynamic service, and calculating the boundary coordinate of the target map slice according to the zoom level, the slice position identification and the slice size of the target map slice; taking the map service type, the layer identifier, the boundary coordinate and the picture size of the map resource as the map slicing request parameter; and generating the original map slice acquisition request carrying the map slice request parameters. If the map service provided by the original map server is a cache service, the request generation module is used for taking the map layer identifier, the zoom level and the slice position identifier as the map slice request parameters; and generating an original map slice acquisition request carrying the map slice request parameters.
In one embodiment, the map slice acquisition request carries an area identifier; the original map resource comprises map resources outside the area corresponding to the target map slice; the determining module is specifically configured to perform cutting processing on the original map resource according to the area identifier and the area boundary data corresponding to the area identifier, so as to obtain the map resource of the target map slice.
For specific limitations of a map resource processing apparatus, reference may be made to the above limitations of a map resource processing method, which is not described herein again. The various modules in the map resource processing device can be wholly or partially implemented by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in fig. 6. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing map resource processing data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a map resource processing method.
Those skilled in the art will appreciate that the architecture shown in fig. 6 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, causes the processor to perform the steps of a map resource processing method as described above. The steps of the map resource processing method herein may be steps in the map resource processing methods of the various embodiments described above.
In one embodiment, a computer-readable storage medium is provided, in which a computer program is stored, which, when being executed by a processor, causes the processor to carry out the steps of the map resource processing method described above. Here, the steps of a map resource processing method may be steps in a map resource processing method in the above embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A map resource processing method, characterized in that the method comprises:
receiving a map slice acquisition request sent by a client; the map slice acquisition request is an acquisition request initiated by the client for a target map slice associated with a target map area;
if the area corresponding to the target map slice is intersected with the target map area, judging whether the client has the acquisition permission of the target map slice;
if the client has the acquisition right to the target map slice, searching whether map resources of the target map slice are cached locally;
and if the map resource of the target map slice is cached locally, sending the map resource to the client.
2. The method according to claim 1, wherein the map slice acquisition request carries a map service identifier, a layer identifier, and an area identifier; the judging whether the client has the right to acquire the target map slice comprises the following steps:
searching a user authority table according to the map service identifier, the layer identifier and the area identifier; the user authority table comprises a list formed by users having access authority to the target map slice;
and if the user logging in the client is in the user permission table, judging that the client has the acquisition permission of the target map slice.
3. The method of claim 2, wherein the map slice acquisition request further carries a slice position identifier and a zoom level of the target map slice; the searching whether the map resource of the target map slice is locally cached comprises the following steps:
determining a target map resource pool of the local cache according to the map service identifier, the layer identifier, the area identifier and the zoom level;
and searching the map resource corresponding to the slice position identification in the target map resource pool as the map resource of the target map slice.
4. The method of claim 1, wherein if the region corresponding to the target map slice does not intersect the target map region, the method further comprises:
sending a transparent map slice to the client; the transparent map slice is a map slice without map resources.
5. The method of claim 1, wherein if the map resource of the target map slice is not cached locally, the method further comprises:
sending an original map slice acquisition request to an original map server; the original map slice acquisition request carries map slice request parameters; the map slice request parameter is used for indicating the original map server to acquire an original map resource containing the map resource of the target map slice;
receiving the original map resource returned by the original map server;
and determining the map resource of the target map slice according to the original map resource.
6. The method according to claim 5, wherein the map slice acquisition request carries a map service identifier, a layer identifier, a slice position identifier of the target map slice, and a zoom level; if the map service provided by the original map server is a dynamic service, before the step of sending the original map slice acquisition request to the original map server, the method further comprises:
determining the map service type of the target map slice according to the map service identification, and calculating the boundary coordinate of the target map slice according to the zoom level, the slice position identification and the slice size of the target map slice;
taking the map service type, the layer identifier, the boundary coordinate and the picture size of the map resource as the map slicing request parameter;
generating the original map slice acquisition request carrying the map slice request parameters;
if the map service provided by the original map server is a cache service, before the step of sending the original map slice acquisition request to the original map server, the method further comprises:
taking the layer identifier, the zoom level and the slice position identifier as the map slice request parameters;
and generating an original map slice acquisition request carrying the map slice request parameters.
7. The method of claim 5, wherein the map slice acquisition request carries an area identifier; the original map resource comprises map resources outside the area corresponding to the target map slice; the determining the map resource of the target map slice according to the original map resource comprises:
and cutting the original map resource according to the area identification and the area boundary data corresponding to the area identification to obtain the map resource of the target map slice.
8. A map resource processing apparatus, the apparatus comprising:
the receiving module is used for receiving a map slice acquisition request sent by a client; the map slice acquisition request is an acquisition request initiated by the client for a target map slice associated with a target map area;
the judging module is used for judging whether the client has the acquisition permission of the target map slice or not when the area corresponding to the target map slice is intersected with the target map area;
the searching module is used for searching whether map resources of the target map slice are locally cached or not when the client has the acquisition permission of the target map slice;
and the sending module is used for sending the map resource to the client when the map resource of the target map slice is locally cached.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN202110961869.2A 2021-08-20 2021-08-20 Map resource processing method and device, computer equipment and storage medium Pending CN113656527A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110961869.2A CN113656527A (en) 2021-08-20 2021-08-20 Map resource processing method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110961869.2A CN113656527A (en) 2021-08-20 2021-08-20 Map resource processing method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113656527A true CN113656527A (en) 2021-11-16

Family

ID=78480571

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110961869.2A Pending CN113656527A (en) 2021-08-20 2021-08-20 Map resource processing method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113656527A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116720224A (en) * 2023-06-28 2023-09-08 北京和德宇航技术有限公司 Display method, device, equipment and storage medium
CN117033533A (en) * 2023-07-21 2023-11-10 北京空间机电研究所 Multi-source map dynamic slicing and caching method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10382890B1 (en) * 2018-07-26 2019-08-13 Bluedot Innovation Pty Ltd Cacheable geographic pages
CN111159322A (en) * 2019-12-17 2020-05-15 广西交通设计集团有限公司 Dynamic slicing and server side caching method for map
CN111666365A (en) * 2020-05-27 2020-09-15 北京地林伟业科技股份有限公司 Method for rapidly filtering and displaying electronic map service according to authorized area
CN112287010A (en) * 2020-11-10 2021-01-29 天津市测绘院有限公司 Map service providing method, device, terminal and storage medium based on android system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10382890B1 (en) * 2018-07-26 2019-08-13 Bluedot Innovation Pty Ltd Cacheable geographic pages
CN111159322A (en) * 2019-12-17 2020-05-15 广西交通设计集团有限公司 Dynamic slicing and server side caching method for map
CN111666365A (en) * 2020-05-27 2020-09-15 北京地林伟业科技股份有限公司 Method for rapidly filtering and displaying electronic map service according to authorized area
CN112287010A (en) * 2020-11-10 2021-01-29 天津市测绘院有限公司 Map service providing method, device, terminal and storage medium based on android system

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116720224A (en) * 2023-06-28 2023-09-08 北京和德宇航技术有限公司 Display method, device, equipment and storage medium
CN116720224B (en) * 2023-06-28 2024-04-26 北京和德宇航技术有限公司 Display method, device, equipment and storage medium
CN117033533A (en) * 2023-07-21 2023-11-10 北京空间机电研究所 Multi-source map dynamic slicing and caching method and device

Similar Documents

Publication Publication Date Title
CN109902248B (en) Page display method and device, computer equipment and readable storage medium
CN103187003B (en) A kind of access method of electronic chart, equipment and system
US8812031B2 (en) Map tile data pre-fetching based on mobile device generated event analysis
US9798819B2 (en) Selective map marker aggregation
EP2788948B1 (en) Method and apparatus for pre-fetching place page data for subsequent display on a mobile computing device
US20150254278A1 (en) Determining points of interest using intelligent agents and semantic data
CN113656527A (en) Map resource processing method and device, computer equipment and storage medium
CN112233240B (en) Three-dimensional vector data slicing method and device of three-dimensional vector map and electronic equipment
CN107247748B (en) Page loading method and device
WO2015195923A1 (en) Tile-based distribution of searchable geospatial data to client devices
CN112069285B (en) Map generation method and device based on three-dimensional high-precision map slice and electronic equipment
CN109992406B (en) Picture request method, picture request response method and client
CN112131331B (en) Map data processing method, map data processing device, computer equipment and storage medium
US11818622B1 (en) System and method of using spatial and temporal signals to identify and prevent attacks
CN110377361A (en) Data load method, device, computer equipment and storage medium
CN112948379A (en) Method and device for generating distributed electronic map and readable storage medium
CN112153170A (en) Method, device and equipment for accessing server and storage medium
CN116910290B (en) Method, device, equipment and medium for loading slice-free remote sensing image
CN113032508B (en) Electronic map data storage method and device, computer equipment and storage medium
CN117056626A (en) Map preview method and device
CN108986031B (en) Image processing method, device, computer equipment and storage medium
CN111966853B (en) Management method of remote sensing image
CN113688339A (en) Information loading method and device, electronic equipment and computer storage medium
CN110807040A (en) Method, device, equipment and storage medium for managing data
CN117311575B (en) Page display method, page display device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20211116

RJ01 Rejection of invention patent application after publication