Map loading method and related device

By introducing global tile set element information and splitting tile data into multiple archive files, the management and loading speed problems in traditional map loading methods are solved, efficient map loading and rendering is achieved, and user experience is improved.

CN120508331APending Publication Date: 2025-08-19BEIJING SUPERMAP SOFTWARE CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202510612862.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-13
Publication Date
2025-08-19

AI Technical Summary

Technical Problem

Traditional raster tile storage and loading methods face problems such as excessive tile files that are difficult to manage, limited by local hardware resources, and slow loading speed when processing massive map data. They are still slow to load map data based on cloud-native technology.

Method used

Introduce global tile set meta information, including basic information of tile data, tile segmentation information and encryption related information, split the map data into multiple tile archive files, load it through the meta information and index information of tile archive files, optimize the processing of data-free and solid color tiles, and use HTTP range requests to load tile data.

Benefits of technology

Map loading and rendering with any coordinate system, arbitrary segmentation rules, and arbitrary scale is realized, which improves map loading speed, reduces network latency and server load, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120508331A_ABST
    Figure CN120508331A_ABST
Patent Text Reader

Abstract

The invention discloses a map loading method and a related device, and relates to the field of map data processing. According to the application, global tile set element information is introduced, and the information comprises complete tile set element information, such as basic information of tile data, tile subdivision information, encryption related information and the like, so that the loading and rendering requirements of any coordinate system, any subdivision rule and any scale tile set can be met. According to the method, the tile data set is split into the plurality of tile archive files to be stored, and the number of tiles in each tile archive file is small, so that the offset of the tile data in the tile archive files is small, and the reading speed of the tile data is increased. The map loading speed is increased, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of map data processing, and in particular to a map loading method and related devices. Background Art

[0002] With the continuous development of geographic information system technology, the demand for fast rendering of large-scale map data is increasing. Map data loading and rendering performance has become a key factor affecting the user experience. Traditional raster tile storage and loading methods often face many problems when processing massive data, such as excessive tile files, difficult management, limited local hardware resources, and slow loading speeds.

[0003] The emergence of cloud-native technology has provided a new approach to addressing these issues. The combination of cloud-native and raster tiles provides users with a smooth map browsing experience. However, current cloud-native solutions are still very slow when loading map data. Summary of the Invention

[0004] In view of the above problems, this application provides a map loading method and related devices to solve the above problems. The specific solution is as follows:

[0005] In a first aspect, the present application provides a map data loading method, applied to a terminal device, the method comprising:

[0006] Initiate a map data loading request to the server to obtain tile set metadata corresponding to the map to be loaded, wherein the tile set metadata includes global metadata of the tile data set;

[0007] Determining a grid number sequence of grids to be drawn corresponding to the map to be loaded according to the tile set metadata;

[0008] Determine a tile archive file sequence containing tile data associated with each grid in the grid number sequence, wherein one tile archive file stores multiple tile data, and map data of the same scale in the same area is stored in multiple tile archive files;

[0009] Obtaining meta information and index information corresponding to each tile archive file in the tile archive file sequence;

[0010] Determining loading information of tile data corresponding to the grid to be drawn based on the metadata and index information of the tile archive file;

[0011] Based on the loading information of the tile data corresponding to each grid to be drawn, the corresponding tile data is obtained.

[0012] In a possible implementation, the loading information includes tile data status of tile data, and the tile data status includes pure color tiles, no-data tiles, and common tiles;

[0013] The step of obtaining corresponding tile data based on the loading information of the tile data corresponding to each grid to be drawn includes:

[0014] If the tile data state corresponding to the tile data associated with the to-be-drawn mesh is a solid color tile, obtaining the RGBA value corresponding to the to-be-drawn mesh from the index information of the tile data associated with the to-be-drawn mesh, and rendering the corresponding solid color tile data according to the RGBA value;

[0015] If the tile data state corresponding to the tile data associated with the grid to be drawn is a tile with no data, generating transparent data;

[0016] If the tile data status corresponding to the tile data associated with the grid to be drawn is a common tile, the corresponding tile data is obtained from the server based on the index information of the tile data associated with the grid to be drawn.

[0017] In a possible implementation, obtaining corresponding tile data from a server based on index information of tile data associated with the grid to be drawn includes:

[0018] Obtaining the offset and data length of the tile data associated with the grid to be drawn from the index information of the tile archive file where the tile data is located;

[0019] Construct an HTTP range request based on the offset and data length;

[0020] The HTTP range request is sent to the server, and tile data returned by the server in response to the HTTP range request is received.

[0021] In a possible implementation, after obtaining corresponding tile data from a server based on index information of tile data associated with the grid to be drawn, the method further includes:

[0022] Obtaining encryption information and compression information corresponding to the tile data from the metadata of the tile archive file containing the tile data associated with the grid to be drawn;

[0023] determining whether the tile data in the tile archive file is encrypted based on the encryption information, and determining whether the tile data in the tile archive file is compressed based on the compression information;

[0024] If the tile data in the tile archive file has been encrypted and compressed, decrypting the tile data obtained from the server according to the encryption information to obtain decrypted tile data, and decompressing the decrypted tile data according to the compression information to obtain target tile data associated with the grid to be drawn;

[0025] If the tile data in the tile archive file is encrypted and uncompressed, decrypting the tile data obtained from the server according to the encryption information to obtain target tile data associated with the grid to be drawn;

[0026] If the tile data in the tile archive file is not encrypted and has been compressed, decompressing the tile data obtained from the server according to the compression information to obtain target tile data associated with the grid to be drawn;

[0027] If the tile data in the tile archive file is not encrypted and not compressed, it is determined that the tile data obtained from the server is not the target tile data associated with the grid to be drawn.

[0028] In a possible implementation, determining the grid number sequence of the grids to be drawn corresponding to the map to be loaded according to the tile set metadata includes:

[0029] Determine a current viewport according to the display level corresponding to the map to be loaded and the designated center point, wherein the current viewport refers to the current display range of the map to be loaded;

[0030] A grid number sequence corresponding to the current viewport is determined according to the scale and subdivision information corresponding to the display level.

[0031] In a possible implementation, the grid number includes a column number x and a row number y, and each tile archive file includes m*n tile data;

[0032] The determining of the tile archive file sequence containing tile data associated with each grid in the grid number sequence includes:

[0033] For each grid, divide the column number x corresponding to the grid number by m and round down to obtain a first integer i, divide the row number x of the grid number by n and round down to obtain a second integer j, and obtain the file name of the tile archive file containing the tile data associated with the grid number based on the first integer i and the second integer j;

[0034] The tile archive file sequence is obtained by determining a set of tile archive files containing tile data associated with each grid in the grid number sequence.

[0035] In a possible implementation, obtaining metadata and index information corresponding to each tile archive file in the tile archive file sequence includes:

[0036] According to the file names corresponding to each tile archive file in the tile archive file sequence, a request is made to the server to load the metadata and index information corresponding to the tile archive file corresponding to the file name, wherein the metadata includes the file header and index header information of the tile archive file, and the index information is the information of the index field in the tile archive file.

[0037] A second aspect of the present application provides a map data loading method, which is applied to a server, wherein the server stores tile set metadata and multiple tile archive files for map data of the same area, wherein map data of different scales of the same area are stored in different first-level folders, each first-level folder includes one or more second-level folders, each second-level folder includes multiple tile archive files, and one tile archive file stores multiple tile data; the method comprises:

[0038] In response to a request for loading map data sent by a terminal device, tile set metadata corresponding to the map to be loaded is sent to the terminal device;

[0039] In response to a tile data loading request sent by the terminal device, the requested tile data is sent to the terminal device, wherein the tile data loading request includes loading information of the tile data, and the loading information is obtained based on the metadata and index information of the tile archive file where the tile data is located.

[0040] In one possible implementation, the method further includes:

[0041] Obtain tile update information, where the tile update information includes the geographic range to be updated, the name of the tile set to be updated, and the name of the map where the tile set to be updated is located;

[0042] The tile data that needs to be updated is partially updated according to the tile update information.

[0043] In a possible implementation, locally updating tile data that needs to be updated according to the tile update information includes:

[0044] Acquire target tile set metadata according to the name of the tile set to be updated, and determine a target tile archive file sequence that needs to be updated according to the target tile set metadata and the geographical range to be updated;

[0045] For each tile archive file in the target tile archive file sequence, new tile data contained in the tile archive file is generated in batches to obtain an updated tile archive file.

[0046] In a possible implementation, locally updating tile data that needs to be updated according to the tile update information includes:

[0047] Acquire target tile set metadata according to the name of the tile set to be updated, and determine a target tile archive file sequence that needs to be updated according to the target tile set metadata and the geographic location to be updated;

[0048] For each tile archive file in the target tile archive file sequence, performing a spatial intersection operation on the geographical range corresponding to each tile archive file and the geographical range to be updated, to obtain tile sequences to be updated corresponding to all tile archive files in the target tile archive file sequence;

[0049] Batch generating all tile data in the tile sequence to be updated to obtain an updated tile sequence;

[0050] The corresponding tile archive file in the target tile archive file sequence is updated according to the updated tile sequence to obtain an updated tile archive file.

[0051] In a possible implementation, determining the target tile archive file sequence that needs to be updated according to the target tile set metadata and the to-be-updated range includes:

[0052] Obtaining the geographical range and tile-level sequence of the tile set to be updated from the target tile set metadata;

[0053] For each tile level in the tile level sequence, perform the following steps:

[0054] Obtaining, according to the resolution corresponding to the tile level, the number of tiles in the column direction and the number of tiles in the row direction of the tile set to be updated;

[0055] Obtaining a tile archive file sequence included in the tile set to be updated according to the number of tiles in the column direction and the number of tiles in the row direction corresponding to the tile level;

[0056] Determine the geographical range of each tile archive file in the tile archive file sequence of the tile set to be updated;

[0057] According to the geographical scope of each tile archive file, determining tile archive files that have an intersection relationship with the geographical scope of the tile set to be updated to obtain a sequence of tile archive files to be updated;

[0058] The target tile archive file sequence is the to-be-updated tile archive file sequence corresponding to each tile level in the tile level sequence.

[0059] A third aspect of the present application provides a map data loading device, applied to a terminal device, the device comprising:

[0060] A first acquisition module is configured to initiate a map data loading request to a server and obtain tile set metadata corresponding to a map to be loaded, wherein the tile set metadata includes global metadata of a tile data set;

[0061] A first determining module is configured to determine a grid number sequence of grids to be drawn corresponding to the map to be loaded according to the tile set metadata;

[0062] A second determining module is used to determine a tile archive file sequence containing tile data associated with each grid in the grid number sequence, wherein a tile archive file stores multiple tile data, and map data of the same scale in the same area is stored in multiple tile archive files;

[0063] A second acquisition module is used to obtain meta information and index information corresponding to each tile archive file in the tile archive file sequence;

[0064] A third determining module is configured to determine loading information of tile data corresponding to the to-be-drawn mesh based on the metadata and index information of the tile archive file;

[0065] The third acquisition module is used to acquire corresponding tile data based on the loading information of the tile data corresponding to each grid to be drawn.

[0066] A fourth aspect of the present application provides a map data loading device, applied to a server, wherein the server stores a tile set metadata and a plurality of tile archive files for map data of the same area, wherein map data of different scales of the same area are stored in different first-level folders, each first-level folder includes one or more second-level folders, each second-level folder includes a plurality of tile archive files, and a tile archive file stores a plurality of tile data; the device comprises:

[0067] A first sending module, configured to respond to a request for loading map data sent by a terminal device and send tile set metadata corresponding to the map to be loaded to the terminal device;

[0068] The second sending module is used to respond to the tile data loading request sent by the terminal device and send the requested tile data to the terminal device, wherein the tile data loading request includes loading information of the tile data, and the loading information is obtained based on the metadata and index information of the tile archive file where the tile data is located.

[0069] A fifth aspect of the present application provides an electronic device, characterized in that it includes at least one processor and a memory connected to the processor, wherein:

[0070] The memory is used to store computer programs;

[0071] The processor is used to execute the computer program so that the electronic device can implement the map loading method as described in any one of the first aspect or any one of the second aspect.

[0072] The sixth aspect of the present application provides a computer storage medium, characterized in that the storage medium carries one or more computer programs, and when the one or more computer programs are executed by an electronic device, the electronic device can implement the map loading method as described in any one of the first aspect or any one of the second aspect.

[0073] By means of the above technical solution, the map loading method provided by this application introduces global tile set metadata, which includes complete tile set metadata, such as basic information of tile data, tile segmentation information, encryption-related information, etc. In this way, it can meet the loading and rendering requirements of tile sets of any coordinate system, any segmentation rules, and any scale. This method splits the tile data set into multiple tile archive files for storage, and the number of tiles in each tile archive file is small. In this way, the offset of tile data in the tile archive file is relatively small, which speeds up the reading speed of tile data. It improves the map loading speed and improves the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0074] The above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that the originals and elements are not necessarily drawn to scale.

[0075] Figure 1 A schematic diagram of tile data at different levels provided for this application;

[0076] Figure 2 A schematic diagram of a tile archive file name provided for this application;

[0077] Figure 3 A schematic diagram of a tile archive file format provided by this application;

[0078] Figure 4 A schematic diagram of another tile archive file format provided for this application;

[0079] Figure 5 A flowchart of a map loading method provided in this application;

[0080] Figure 6 A schematic diagram of grid numbers in a map provided for this application;

[0081] Figure 7 A schematic diagram of requesting tile data provided by this application;

[0082] Figure 8 A schematic diagram of the encryption and compression-related tile data processing process provided by this application;

[0083] Figure 9 A flowchart of a local update process of a tile set provided by this application;

[0084] Figure 10 Provided for this application Figure 9 Schematic diagram of the tile archive file update range corresponding to the tile set local update process shown;

[0085] Figure 11 A flowchart of another tile set local update process provided by this application;

[0086] Figure 12 Provided for this application Figure 11 Schematic diagram of tile update range corresponding to the local update process of tile set shown;

[0087] Figure 13 A schematic structural diagram of a map loading device provided in this application;

[0088] Figure 14 A schematic structural diagram of another map loading device provided in this application;

[0089] Figure 15 A schematic diagram of the structure of a terminal device provided in this application;

[0090] Figure 16 A schematic diagram of the structure of a server provided for this application. DETAILED DESCRIPTION

[0091] The following describes the embodiments of the present application in conjunction with the accompanying drawings. The terms used in the implementation methods of the present application are only used to explain the specific embodiments of the present application and are not intended to limit the present application.

[0092] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0093] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, and this is merely a way of distinguishing the objects of the same attributes when describing them in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0094] First, the relevant technologies involved in this application are introduced:

[0095] Map tiling technology involves segmenting map data into tiles with various formats and storage options. Tiles are the specific storage form of map tiles. Pre-segmented tiles can significantly improve online map access efficiency. Common map tile types include raster tiles and vector tiles. Raster tiles essentially render spatial data (raster and vector data) into map images at different zoom levels. These images at each zoom level are then segmented and organized according to specific rules and stored on disk or in a database.

[0096] like Figure 1 The figure below is a schematic diagram of the tile map pyramid model, a multi-resolution hierarchical model. Within a unified spatial reference, it stores and displays data at different resolutions based on user needs, forming a pyramid structure with increasing resolution and increasing data size. While the geographic scope remains unchanged, tiles at the bottom of the map represent more detailed map information and have larger scales.

[0097] The raster tiles (also known as tile data) generated by a map typically consist of hundreds of thousands or millions of image files. This means that when a user views a map, they only need to request the images for the portion they are currently viewing. When a client (such as a browser, mobile app, or desktop application) loads the map, it calculates the index of the tile to be rendered based on the visible geographic range and tile organization rules. It then retrieves the corresponding tile through a map service and draws it onto the canvas, thus constructing a complete map.

[0098] The map loading method provided in the embodiment of the present application first needs to store the map data in multiple archive files according to a preset data format and publish them to the Web server.

[0099] The tile data provided by this application includes the following files:

[0100] (1) A tile set metadata file (SCI file for short)

[0101] The tile set metadata file includes at least the following global metadata: basic global information (format version information, tile set name, vendor information), tile information (such as image format, image compression type, tile set range, coordinate system information), tile subdivision information (tile subdivision origin, subdivision direction, scale or resolution at each level), encryption-related information (whether encryption, encryption algorithm, key name, key acquisition channel), etc.

[0102] (2) Multiple tile archive files

[0103] The map data of the same area are stored in different first-level folders according to different scales. The first-level folders can be named according to certain rules based on the scale denominator of the map. For example, the scale denominator is rounded up and taken as the name of the first-level folder corresponding to the map data.

[0104] Each first-level folder is split into one or more subfolders (or second-level folders) according to the column index xIndex of the tile data. The name of the second-level folder is obtained according to a certain rule based on the row index of the tile data. For example, xIndex is divided by 128 and rounded down as the name of the second-level file name.

[0105] Each secondary folder is split into multiple tile archive files (CF files for short) based on the row index yIndex of the tile data. The name of the tile archive file is obtained according to a certain rule based on the row index yIndex of the tile data. For example, yIndex is divided by 128 and rounded down as the name of the tile archive file. Figure 2 As shown in FIG, a schematic diagram of tile data is shown, where m / n.cf represents a tile archive file, and each CF file may include up to 128*128 pieces of tile data.

[0106] The file format of the tile archive file is as follows:

[0107] The tile archive file includes a file header area, an index header area, an index area, and a data area. It supports multiple tile index types, and different index types and index area layouts are allowed to be different. Among them, the index type may include a grid index type (such as Figure 3 ) and Hilbert index types (such as Figure 4 shown).

[0108] like Figure 3 FIG. 1 shows a schematic diagram of a grid index type file format provided by an embodiment of the present application. The information included in each area of the tile archive file in this format is as follows:

[0109] The file header area mainly includes: version, update time, index type, index location, encryption information, and compression information. Among them, the version indicates the version information of the tile archive file. The update time indicates the update time of the tile archive file. The index type indicates the index type used by the tile archive file, such as Figure 3 Using a grid index type, it can be represented by a corresponding numerical value. The index position is used to locate the index header. Encryption information may include the encryption algorithm, encryption mode, block length, key length, padding method, etc. Compression information indicates whether the tile data in the archive file is compressed, and the compression type used.

[0110] The index header area mainly includes the number of rows and columns. For example, Figure 3 The example of map data grid division shown includes 4 rows and 4 columns.

[0111] The index area mainly includes index-related information of tile data corresponding to index 1 to index n. The index-related information of ordinary tile data includes tile data status (for example, status 0, which can occupy 1 byte) and offset (which can occupy 7 bytes). According to the offset, the corresponding tile data can be read from the subsequent data area. The index-related information of pure color tile data includes tile data status (such as status 1, which can occupy 1 byte) and RGBA value (i.e. red, green, blue, and transparent color) which can occupy 4 bytes. The index-related information of dataless tiles includes tile data status, such as status 2, which can occupy 1 byte.

[0112] The data area contains data blocks for the rendering data of n raster tiles. Each data block includes the total length, data length, actual data length, and data content. The data length refers to the length of the data content, and the actual data length refers to the length of the data content that has been successfully written. Because writing may fail, the actual data length may not match the data length. The data content refers to the rendering data content of the tile data and can include unencrypted plaintext data or encrypted ciphertext data.

[0113] like Figure 4 FIG. 1 shows a schematic diagram of a Hilbert index type file format provided by an embodiment of the present application. The information included in each area of the tile archive file in this format is as follows:

[0114] The file header area includes: version, update time, index type, index location, encryption information, etc., among which the meaning of each information is the same as Figure 3 The same fields shown have the same meanings and are not described here again.

[0115] The index header area includes: the number of indexes, maximum size, reserved length, and status flag. The number of indexes indicates the number of indexes corresponding to the tile data contained in the tile archive file. The maximum size is used to record the number of bytes occupied by all index data. The reserved length refers to the reserved bits in the index area. For example, the reserved length can occupy 8 bytes to facilitate expansion. The status flag is used to record the overall status of the index area. For example, it can include states such as complete and correct indexes, partial data not being indexed, and partial indexes not being associated with data.

[0116] The index area includes the index data of the tile data corresponding to indexes 1 to n. For example, each index data may include an index number, an index state, a data offset, and a reserved bit. The index number indicates the index sequence number of the tile data corresponding to the index data. Figure 4 In the example shown, index numbers range from 0 to 63. The index status indicates the status of the index, including normal index, empty index, and index of index. A normal index indicates that the index is associated with a data area. An empty index indicates that the data area corresponding to the index has no data content. An index of index indicates that the index points to another index. The data offset is used to locate the tile data corresponding to the index in the data area.

[0117] The data area includes n data, where data n includes: total file length, file name encoding, file name length, data length, actual data length and data content. The total file length is the total length of the current tile archive file. The file name encoding is the file name encoding of the current tile archive file. The file name length is the length of the file name of the current tile archive file. The file name is the file name of the current tile archive file. Other fields are the same as Figure 3 The same fields in the examples shown have the same meanings and are not described here again.

[0118] Tile data can be used Figure 3 or Figure 4 The raster tile set data is then published to the web through a web server, obtaining a URL address for the cloud-native tile set. The client can then request to load the corresponding map data through this URL.

[0119] In an exemplary embodiment, the raster tile set data may be directly stored in a file system, and the tile set data in a directory of the file system may be published on the Web through a Web server.

[0120] In another exemplary embodiment, the grid tile set data may be stored in an object storage, and the map data may be published on the Web through an object storage client.

[0121] The following will be combined Figure 5This section describes the process of loading and rendering tile datasets on demand in a WebGIS client.

[0122] like Figure 5 As shown, the method may include the following steps:

[0123] S101: Initiate a map data loading request to a GIS server.

[0124] This embodiment uses a WebGIS client as an example. GIS stands for Geographic Information System. This embodiment can also be applied to mobile applications or desktop applications that have the ability to load maps. Mobile applications refer to applications installed on mobile devices (such as smartphones and tablets), while desktop applications refer to applications installed on terminal devices (such as computers). Mobile applications or desktop applications can be map applications or other applications with map plug-ins, such as shopping applications and instant messaging applications.

[0125] When a WebGIS client opens a map, it can send an HTTP request to the GIS server according to the URL address of the Web publication corresponding to the tile dataset D1 corresponding to the current map, and load the tile set metadata file (i.e., SCI file) of the tile dataset D1.

[0126] For example, a WebGIS client opens a map (containing multiple web layers), where the data source of at least one web layer is an online tile dataset, and initiates an HTTP request to the URL address corresponding to the tile dataset, requesting to load the tile dataset metadata file corresponding to the URL address.

[0127] S102: Receive the tile set meta information file (SCI file) returned by the GIS server and obtain the tile set meta information object M1.

[0128] The tile set metadata object M1 contains the global metadata of the tile data set, including but not limited to the following: format version information, tile set name, vendor information, tile information (such as tile set range, coordinate system information, etc.), tile partitioning information (such as global partitioning, local partitioning), encryption-related information, etc.

[0129] The WebGIS client can initialize the map layer according to the tile set metadata object M1 and cache M1 on the browser side.

[0130] S103: Determine a grid number sequence to be drawn according to the display level corresponding to the map layer to be loaded and the current viewport.

[0131] When the WebMap of the WebGIS client renders data for the map layer L1, the center point and display level can be specified. The current viewport (i.e., the display range of the currently displayed map) can be calculated based on the center point and display level, and the grid number sequence corresponding to the current viewport can be further determined based on the display level and the current viewport.

[0132] Each display level corresponds to a scale. The map image of each scale is divided into multiple grids according to a specific subdivision rule (such as global subdivision), and the grids are coded (such as using zxy coding, where z represents the display level, x represents the column, and y represents the row), so that each grid corresponds to a unique grid number. For example, Figure 6 In the example of the map image grid division shown, the grid number z3x4y2 represents the grid in the 5th column and 3rd row of the third-level map image. Based on the current viewport, the grid number sequence corresponding to the current viewport can be determined from the grids corresponding to the entire map image. For example, Figure 6 The map grid range corresponding to the current viewport is shown. The corresponding grid number sequence is {z3x4y1, z3x5y1, z3x6y1, z3x4y2, z3x5y2, z3x6y2, z3x4y3, z3x5y3, z3x6y3}.

[0133] S104: Determine a tile archive file sequence containing tile data associated with the grid to be drawn.

[0134] The tile archive file sequence corresponding to each grid in the grid number sequence is determined based on the tile archive file naming rules. Each tile archive file contains at most m*n (e.g., m=128, n=128, 128*128) tiles. The x value in the grid number is divided by n and rounded down to get an integer i, and the y value is divided by m and rounded down to get another integer j. Based on the values of i and j, the tile archive file name i / j.cf for the tile data corresponding to the grid is obtained.

[0135] For example, if the grid number is z3x400y200, with m=128 and n=128, the x-numbering rule for tile archive files is 400 / 128, rounded down to 3. The y-numbering rule for tile archive files is 200 / 128, rounded down to 1. The tile archive file for this grid is named 3 / 1.cf. This method is used to determine the file names of the tile archive files corresponding to all grids in the grid number sequence, thus forming a tile archive file sequence.

[0136] S105: Obtain meta information and index information of each target tile archive file based on the tile archive file sequence.

[0137] The target tile archive file is the tile archive file where the tile data corresponding to the grid to be drawn is located, and based on the name of the target tile archive file, the client requests the GIS server to load the metadata and index information corresponding to the archive file.

[0138] The metadata of a tile archive file refers to the file header and index header information of the file. The index information is the information stored in the index field of the tile archive file.

[0139] The WebGIS client initiates an HTTP request to the URL address corresponding to the tile dataset on the GIS server. The HTTP request carries the name of the target tile archive file. The GIS server responds to the HTTP request by returning the metadata and index information corresponding to the target tile archive file name.

[0140] S106 , selecting the number of the currently drawn grid from the grid number sequence, and determining the loading information of the tile data according to the grid number and the meta information and index information of the corresponding tile archive file.

[0141] The loading information includes at least the tile data status (e.g., normal tile, solid color tile, dataless tile), the offset R of the tile data in the tile archive file, and the data length L. In addition, the loading information may also include compression information (e.g., whether compression is used and the compression type), and encryption information (e.g., whether encryption is used, the encryption algorithm, the key name, the key acquisition channel, etc.).

[0142] The compression information and encryption information can be obtained by parsing the information at the specified position in the file header of the tile archive file, and the tile data status, offset and data length can be obtained by parsing the information at the specified position in the index information of the tile archive file.

[0143] In a tile archive file using the Hilbert index type, the tile data status is determined according to the index status.

[0144] The WebGIS client can select the current drawing grid in the order of x from small to large and then y from small to large in the grid number sequence.

[0145] S107, determine the tile data status corresponding to the currently drawn grid; if the tile data status is a solid color tile, execute S108; if it is a data-free tile, execute S109; if it is a normal tile, execute S110.

[0146] S108 , reading the RGBA values of the tile data corresponding to the current drawing grid from the index information, and rendering the pure color tile data according to the RGBA values.

[0147] In an exemplary embodiment, after the client reads the RGBA value of a solid color tile, it first determines whether the solid color tile data corresponding to the RGBA value is stored in the client's local cache. If so, the tile data content is directly read from the cache. If the local cache does not contain the tile data content corresponding to the RGBA value, a solid color tile data with a specified size (e.g., 256*256 pixels) and a specified RGBA value is generated and written to the local cache.

[0148] S109, rendering the tile data without data.

[0149] The client determines whether there is background transparent tile data stored in the local cache. If there is, the client reads the background transparent tile data directly from the cache. If not, the client generates a transparent data of the specified size (256*256 pixels) and writes it to the local cache.

[0150] S110 , reading the offset and data length of the tile data corresponding to the current drawing grid from the index information, and requesting the GIS server to load the tile data based on the offset and data length.

[0151] The client reads the offset and data length of the tile data corresponding to the currently drawn grid from the index information of the tile archive file, constructs an HTTP range request, and sends the request to the cloud object storage. The cloud object storage returns the tile data content of the requested range. For example, Figure 7 As shown, when the client draws the grid z4x13y6, it determines from the index information that the offset of the tile data corresponding to the grid is 20001, and the data length is 1000 bytes. Then the HTTP range request is: bytes20001-21001 / 1000.

[0152] Furthermore, based on parsing the encryption information and compression information corresponding to the tile data associated with the currently drawn grid, it is determined whether the first tile data (denoted as RDC) returned by the cloud object storage needs to be further processed. Figure 8 As shown, this judgment process may include the following steps S201 to S205:

[0153] S201, judging whether the tile data in the tile archive file is encrypted according to the encryption information; if so, executing S202; if not, executing S203.

[0154] S202 : Decrypt the received first tile data RDC according to the obtained encryption information to obtain second tile data (denoted as RDC1 ).

[0155] S203, judging whether the tile data in the tile archive file has been compressed according to the compression information; if it has been compressed, executing S204, if not, executing S205.

[0156] S204: Decompress the tile data according to the obtained compression information to obtain third tile data.

[0157] In one scenario, the tile data in the tile archive file is encrypted and compressed, and then decrypted to obtain the second tile data, and then decompressed to obtain the third tile data.

[0158] In another scenario, the tile data in the tile archive file is not encrypted and compressed, and the first tile data is directly decompressed to obtain the third tile data.

[0159] S205: directly return the first / second tile data.

[0160] In the case where the tile data in the tile archive file is encrypted and uncompressed, the second tile data obtained by decryption is directly used as the tile data corresponding to the grid.

[0161] In the case that the tile data in the tile archive file is not encrypted and not compressed, the received first tile data is directly used as the tile data corresponding to the grid.

[0162] S111 , rendering tile data corresponding to the current drawing grid to a position corresponding to the current drawing grid in the canvas.

[0163] S112, rendering the remaining grids in sequence according to the grid number sequence until all grids are drawn.

[0164] After rendering the current drawing grid, obtain the next grid number to be drawn from the grid number sequence, and repeat S107 to S111 until all grids corresponding to numbers in the grid number sequence are rendered, completing the current drawing work of the layer.

[0165] The map loading method provided in this embodiment introduces a global tile set metadata file, which includes complete tile set metadata, such as basic information of tile data, tile segmentation information, encryption-related information, etc., so that it can meet the loading and rendering requirements of tile sets of any coordinate system, any segmentation rules, and any scale. Moreover, the method relies on the global tile set metadata, the metadata of the tile archive file, the tile index in the tile archive file, and the HTTP range request to directly load the raster tile rendering data without the need for additional deployment of tile services. Moreover, the method splits the tile data set into multiple tile archive files for storage, and the number of tiles in each tile archive file is relatively small. In this way, the offset of the tile data in the tile archive file is relatively small, which speeds up the reading speed of the tile data.

[0166] Furthermore, this method optimizes the loading process for data-free and solid-color tiles. For data-free tiles, the client directly draws the tile data without requesting data. For solid-color tiles, there's no need to request tile data from the server; the client can directly render the solid-color tile area. This significantly reduces the impact of network latency, lowers server load, and makes map loading smoother.

[0167] In addition, this method can load multiple tile data through a single HTTP range request, further reducing the impact of network latency, reducing server load, and making map loading smoother.

[0168] This method also provides encrypted storage and publishing, making the storage and publishing of tile data more secure.

[0169] In addition, splitting the tile dataset into multiple tile archive files for storage can achieve on-demand partial updates of the tile set. Figure 9 , shows a flow chart of a local update of a tile set provided by an embodiment of the present application. This method is applied to the GIS server side. For example, after some data in the map data is updated, the tile data corresponding to the local map on the server side needs to be updated. For example, an inspection booth is added to a certain intersection, and the tile data near the intersection needs to be updated.

[0170] This embodiment fully updates the tile archive files within the update range, and is suitable for scenarios that are not computationally intensive but IO intensive. For example, the map content is relatively simple, and the CPU usage is not intensive during rendering, but the tile level is high, resulting in a large number of tiles and requiring a large number of tile IO operations.

[0171] like Figure 9 As shown, the method may include the following steps:

[0172] S301: Obtain tile update information.

[0173] The tile update information includes the geographical range to be updated, the name of the tile set to be updated, the name of the map where the tile set to be updated is located, and other update instruction parameters.

[0174] In an exemplary embodiment, a tile update module is deployed on the server side. After receiving a tile update instruction, the tile update module parses the above-mentioned tile update information from the instruction.

[0175] S302: Obtain global tile set metadata according to the name of the tile set to be updated, and determine a tile archive file sequence to be updated according to the tile set metadata and the geographical range to be updated.

[0176] In an exemplary embodiment, the process of determining the tile archive file sequence to be updated based on the tile set metadata and the geographical range to be updated may include the following steps:

[0177] (1) Read the geographical range and tile level sequence of the tile set to be updated from the tile set metadata;

[0178] (2) For any tile level in the tile level sequence, obtain the level number and resolution corresponding to the any tile level;

[0179] (3) Calculate the number of tiles in the x and y directions for any tile level;

[0180] Among them, the number of tiles in the x direction xcout = the geographical width of the tile set to be updated / (resolution * 256), where the geographical width refers to the length in the x direction; the number of tiles in the y direction ycout = the geographical height of the tile set to be updated / (resolution * 256), where the geographical height refers to the length in the y direction.

[0181] (4) Calculate the tile archive file sequence contained in any tile level;

[0182] For example, each tile archive file contains a maximum of 128*128 tile data. The number of tile archive files in the x-direction within the geographic range of the tile set to be updated is cfxcout = xcout / 128, and the number of tile archive files in the y-direction is cfycout = ycout / 128. At this level, the geographic range of the tile set to be updated contains a total of cfxcout*cfycout tile archive files.

[0183] The name of each tile archive file is cfxcout / cfycout.cf, for example, 5 / 7.cf.

[0184] (5) Determine the geographic span (xSpan, ySpan) of each tile archive file, where xSpan = resolution * 256 * 128, ySpan = resolution * 256 * 128.

[0185] (6) Determine the geographic scope of each tile archive file. Taking the file name 5 / 7.cf as an example, the calculation process is as follows:

[0186] The minimum value in the x direction xmin = Xmin of the geographical range of the tile set to be updated + 5*xSpan;

[0187] The maximum value in the x direction xmax=xmin+xSpan;

[0188] The minimum value in the y direction ymin = Ymin of the geographical range of the tile set to be updated + 7*ySpan;

[0189] The maximum value in the y direction ymax=ymin+ySpan;

[0190] The geographic extent of the 5 / 7.cf file is (xmin, ymin, xmax, ymax).

[0191] According to the above steps, the geographical locations corresponding to all tile archive files at this level of the tile set to be updated can be calculated.

[0192] (7) Determine whether the range to be updated intersects with the geographical range of each tile archive file at the level of the tile set to be updated, and determine that all tile archive files that have an intersecting relationship with the range to be updated are the tile archive file sequence to be updated.

[0193] If the geographic range CFBSi of any tile archive file of the tile set to be updated at this level intersects with the range to be updated BB1, the tile archive file is retained in the sequence.

[0194] If the geographic range CFBSi of the tile archive file does not intersect with the range to be updated BB1, the name of the archive file is deleted from the queue. The files retained in the final sequence are the tile archive file sequence to be updated.

[0195] For example, Figure 10 As shown, the area to be updated has an intersection relationship with the four files 1 / 1.cf, 1 / 2.cf, 2 / 1.cf, and 2 / 2.cf, and the sequence of tile archive files to be updated is (1 / 1.cf, 1 / 2.cf, 2 / 1.cf, and 2 / 2.cf). That is, this embodiment needs to update all tile data in these four tile archive files. There may be no change in the tile data, but new tile data needs to be regenerated, and the data content of the new tile data is the same as that of the original tile data.

[0196] Repeat the above steps to obtain the tile archive file sequence to be updated at all levels corresponding to the area to be updated.

[0197] S303, for any file in the tile archive file sequence to be updated, batch generate tiles based on the map associated with the tile to be updated, the geographical range corresponding to the tile archive file to be updated, and the path of the tile archive file to be updated; if the generation is successful, execute S304.

[0198] The tile update module takes out the name CFi of the tile archive file to be updated in sequence according to the sequence of the tile archive files to be updated, and reads the geographical range CFBi of CFi from the geographical range CFBS of all tile archive files corresponding to the tile set to be updated. If CFi and CFBi can be read out, it means that there is a tile archive file that needs to be updated; if CFi and CFBi cannot be read, it means that the update job of the file has been completed and continues to read the next one.

[0199] In an exemplary embodiment, in order to avoid tile archive file update failure, the tile update module may back up the existing tile archive files (ie, the original tile archive files) to a designated backup directory.

[0200] Exemplarily, the tile update module sends a tile batch generation instruction to the tile batch generation module, and passes in the associated map, the geographical range corresponding to the tile archive file, the full path of the tile archive file to be generated, and other generation parameters, so that the tile batch generation module responds to the tile batch generation instruction and batch generates the tile data contained in the tile archive file based on the associated map image data.

[0201] S304: Batch generate the full amount of tile data in the tile archive file to be updated to obtain the updated tile archive file.

[0202] If the full tile data of the tile archive file to be updated is generated successfully, that is, a new tile archive file corresponding to the file name is successfully generated on the full path of the tile archive file, then the generation success flag is returned and the update task of the next tile archive file is continued.

[0203] In addition, if a new tile archive file corresponding to the file name is not successfully generated on the full path of the tile archive file, the original tile archive file is copied from the backup directory to the source directory, that is, the tile archive file is restored, and the generation failure flag is returned, and the update task of the next tile archive file is continued.

[0204] S305: Update the tile data in the next tile document file in the tile archive file sequence until all files in the tile archive sequence are updated.

[0205] S306: Count the update status of each file in the tile archive file sequence.

[0206] The update status may include the following information: which tile archive files have actually been fully updated, which tile archive files have actually failed to update, and the total time taken for this partial update.

[0207] See Figure 11, shows a schematic diagram of another process for partially updating a tile set provided by an embodiment of the present application. This method, applied to the server, can accurately update tile data in the area to be updated without having to update the tile data in the entire tile archive file. This method is suitable for scenarios that are computationally intensive but not IO intensive.

[0208] like Figure 11 As shown, the method may include the following steps:

[0209] S401: Obtain tile update information.

[0210] The tile update information may include the geographic range to be updated (expressed by the geographic range), the name of the tile set to be updated, the name of the map where the tile set to be updated is located, and other update instruction parameters.

[0211] S402: Obtain global tile set metadata according to the name of the tile set to be updated, and determine a tile archive file sequence to be updated according to the tile set metadata and the geographical range to be updated.

[0212] S403 : For each file in the tile archive file sequence to be updated, perform a spatial intersection operation on the geographical range corresponding to each file and the geographical range to be updated to determine the tile sequence to be updated.

[0213] In this embodiment, a file is read from the tile archive file sequence to be updated in sequence, and the tile data numbers of all tile data that have two spatial intersection relationships between the geographical range of the file and the range to be updated are calculated, that is, the tile intersection of the two geographical ranges, and the tile intersection of the next tile archive file and the range to be updated is continued to be determined until all files in the tile archive file sequence to be updated are processed, and the tile sequence to be updated corresponding to the geographical range to be updated is obtained.

[0214] like Figure 12 As shown in the figure, the update area (i.e., the range of tiles to be updated) intersects with the four files 1 / 1.cf, 1 / 2.cf, 2 / 1.cf, and 2 / 2.cf. That is, the sequence of tile archive files to be updated is (1 / 1.cf, 1 / 2.cf, 2 / 1.cf, and 2 / 2.cf). First, determine the tile intersection of the 1 / 1.cf file with the update area, and then determine the tile intersection of the 1 / 2.cf, 2 / 1.cf, and 2 / 2.cf files with the update area respectively, and finally obtain the tile sequence corresponding to the update area.

[0215] S404, based on the map associated with the information to be updated, the tile sequence to be updated, and the tile archive file path to be updated, batch generate tiles; if the generation is successful, execute S405;.

[0216] Exemplarily, the tile update module issues a tile batch generation instruction to the tile batch generation module, passing in the associated map, the tile sequence to be updated, the full path to the tile archive file to be generated, and other generation parameters. The tile batch generation module responds to the tile batch generation instruction and batch-generates new tile data corresponding to each raster tile in the tile sequence to be updated based on the associated map image data. At step S405, the batch-generated new tile data replaces the corresponding original tile data in the tile archive file to be updated.

[0217] If the generation fails, the original tile data corresponding to the tile archive file to be updated will be restored. Figure 9 The process of restoring the original tile data in the illustrated embodiment is the same and will not be repeated here.

[0218] S406: Count the update status of each file in the tile archive file sequence.

[0219] The implementation process of S401-S402, S405-S406 in this embodiment is similar to Figure 9 The corresponding steps in the illustrated embodiment are the same and will not be described again here.

[0220] The local tile set update method provided in this embodiment does not need to update the tile data in the entire tile archive file corresponding to the geographic range to be updated, but only needs to update the tile data corresponding to the geographic range to be updated, thereby reducing the time consumption of the update process.

[0221] Corresponding to the above-mentioned embodiment of the map loading method, the present application also provides an embodiment of a map loading device.

[0222] See Figure 13 , shows a schematic structural diagram of a map loading device applied to a terminal device provided by the present application, which may include:

[0223] The first acquisition module 101 is used to initiate a map data loading request to the server and obtain tile set metadata corresponding to the map to be loaded, where the tile set metadata includes global metadata of the tile data set;

[0224] A first determining module 102 is configured to determine a grid number sequence of grids to be drawn corresponding to a map to be loaded according to tile set metadata;

[0225] In an exemplary embodiment, the first determination module is specifically used to: determine the current viewport based on the display level and the specified center point corresponding to the map to be loaded, where the current viewport refers to the current display range of the map to be loaded; and determine the grid number sequence corresponding to the current viewport based on the scale and segmentation information corresponding to the display level.

[0226] The second determining module 103 is used to determine the tile archive file sequence where the tile data associated with each grid in the grid number sequence is located. A tile archive file stores multiple tile data, and map data of the same scale in the same area is stored in multiple tile archive files.

[0227] In an exemplary embodiment, the grid number includes a column number x and a row number y, each tile archive file includes m*n tile data, and the second determining module is specifically configured to:

[0228] For each grid, the column number x corresponding to the grid number is divided by m and rounded down to obtain a first integer i, the row number x of the grid number is divided by n and rounded down to obtain a second integer j, and the file name of the tile archive file where the tile data associated with the grid number is located is obtained based on the first integer i and the second integer j; the set of tile archive files where the tile data associated with each grid in the grid number sequence is located is determined to obtain a tile archive file sequence.

[0229] The second acquisition module 104 is used to acquire the metadata and index information corresponding to each tile archive file in the tile archive file sequence;

[0230] A third determining module 105 is configured to determine loading information of tile data corresponding to a grid to be drawn based on the metadata and index information of the tile archive file;

[0231] The third acquisition module 106 is configured to acquire corresponding tile data based on the loading information of the tile data corresponding to each grid to be drawn.

[0232] In an exemplary embodiment, the loading information includes tile data status of the tile data, and the tile data status includes a solid color tile, a data-free tile, and a normal tile; the third acquisition module 106 is specifically configured to:

[0233] If the tile data state corresponding to the tile data associated with the grid to be drawn is a solid color tile, obtain the RGBA value corresponding to the grid to be drawn from the index information of the tile data associated with the grid to be drawn, and render the corresponding solid color tile data according to the RGBA value;

[0234] If the tile data state corresponding to the tile data associated with the grid to be drawn is a tile with no data, transparent data is generated;

[0235] If the tile data status corresponding to the tile data associated with the grid to be drawn is a common tile, the corresponding tile data is obtained from the server based on the index information of the tile data associated with the grid to be drawn.

[0236] In an exemplary embodiment, obtaining corresponding tile data from a server based on index information of tile data associated with a grid to be drawn includes:

[0237] Get the offset and data length of the tile data from the index information of the tile archive file where the tile data associated with the grid to be drawn is located;

[0238] Constructs an HTTP range request based on the offset and data length;

[0239] Send an HTTP range request to the server and receive tile data returned by the server in response to the HTTP range request.

[0240] In an exemplary embodiment, the apparatus further comprises:

[0241] A fourth acquisition module is used to obtain encryption information and compression information corresponding to tile data from the metadata of the tile archive file where the tile data associated with the grid to be drawn is located;

[0242] The fourth determination module is used to determine whether the tile data in the tile archive file is encrypted based on the encryption information, and determine whether the tile data in the tile archive file is compressed based on the compression information; if the tile data in the tile archive file is encrypted and compressed, the tile data obtained from the server is decrypted according to the encryption information to obtain the decrypted tile data, and the decompressed tile data is decompressed according to the compression information to obtain the target tile data associated with the grid to be drawn; if the tile data in the tile archive file is encrypted and not compressed, the tile data obtained from the server is decompressed according to the encryption information to obtain the target tile data associated with the grid to be drawn; if the tile data in the tile archive file is not encrypted and compressed, the tile data obtained from the server is decompressed according to the compression information to obtain the target tile data associated with the grid to be drawn; if the tile data in the tile archive file is not encrypted and not compressed, it is determined that the tile data obtained from the server is not the target tile data associated with the grid to be drawn.

[0243] The map loading device provided in this embodiment introduces a global tile set metadata file, which includes complete tile set metadata, such as basic information of tile data, tile segmentation information, encryption-related information, etc., so that it can meet the loading and rendering requirements of tile sets with any coordinate system, any segmentation rules, and any scale. Moreover, the device relies on the global tile set metadata, the metadata of the tile archive file, the tile index in the tile archive file, and the HTTP range request to directly load raster tile rendering data without the need for additional deployment of tile services. Moreover, the tile data set of the device is split into multiple tile archive files for storage, and the number of tiles in each tile archive file is small. In this way, the offset of the tile data in the tile archive file is relatively small, which speeds up the reading speed of the tile data.

[0244] On the other hand, the present application also provides an embodiment of a map loading device applied to a server.

[0245] The map loading device is applied to a server. The server stores a tile set metadata and multiple tile archive files for the map data of the same area. The map data of the same area with different scales are stored in different first-level folders. Each first-level folder includes one or more second-level folders. Each second-level folder includes multiple tile archive files. One tile archive file stores multiple tile data. Figure 14 As shown, the device may include:

[0246] The first sending module 201 is used to respond to a request for loading map data sent by a terminal device and send tile set metadata corresponding to the map to be loaded to the terminal device;

[0247] The second sending module 202 is used to respond to the tile data loading request sent by the terminal device and send the requested tile data to the terminal device, wherein the tile data loading request includes loading information of the tile data, and the loading information is obtained based on the metadata and index information of the tile archive file where the tile data is located.

[0248] In an exemplary embodiment, the apparatus may further include:

[0249] A first acquisition module is used to acquire tile update information, where the tile update information includes a geographic range to be updated, a name of a tile set to be updated, and a name of a map where the tile set to be updated is located;

[0250] The update module is used to partially update the tile data that needs to be updated according to the tile update information.

[0251] In an exemplary embodiment, the update module is specifically configured to:

[0252] Obtain target tile set metadata according to the name of the tile set to be updated, and determine the target tile archive file sequence that needs to be updated according to the target tile set metadata and the geographic range to be updated;

[0253] For each tile archive file in the target tile archive file sequence, new tile data contained in the tile archive file is generated in batches to obtain an updated tile archive file.

[0254] In another exemplary embodiment, the update module is specifically configured to:

[0255] Obtain target tile set metadata according to the name of the tile set to be updated, and determine the target tile archive file sequence that needs to be updated according to the target tile set metadata and the geographic location to be updated;

[0256] For each tile archive file in the target tile archive file sequence, perform a spatial intersection operation on the geographical range corresponding to each tile archive file and the geographical range to be updated, to obtain the tile sequences to be updated corresponding to all tile archive files in the target tile archive file sequence;

[0257] Batch generate all tile data in the tile sequence to be updated to obtain the updated tile sequence;

[0258] The corresponding tile archive file in the target tile archive file sequence is updated according to the updated tile sequence to obtain an updated tile archive file.

[0259] In an exemplary embodiment, the update module is configured to determine the target tile archive file sequence to be updated based on the target tile set metadata and the to-be-updated range, specifically to:

[0260] Get the geographical range and tile level sequence of the tileset to be updated from the target tileset metadata;

[0261] For each tile level in the tile level sequence, perform the following steps:

[0262] According to the resolution corresponding to the tile level, obtain the number of tiles in the column direction and the number of tiles in the row direction of the tile set to be updated;

[0263] Obtain the tile archive file sequence contained in the tile set to be updated according to the number of tiles in the column direction and the number of tiles in the row direction corresponding to the tile level;

[0264] Determine the geographic extent of each tile archive file in the sequence of tile archive files of the tile set to be updated;

[0265] According to the geographical scope of each tile archive file, determine the tile archive files that have an intersection relationship with the geographical scope of the tile set to be updated to obtain the tile archive file sequence to be updated;

[0266] The target tile archive file sequence is a tile archive file sequence to be updated corresponding to each tile level in the tile level sequence.

[0267] On the other hand, an electronic device is also provided in an embodiment of the present application. Figure 15 , which shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present application. The electronic device in the embodiments of the present application may include but is not limited to fixed terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Figure 15 The electronic device shown is merely an example and should not limit the functions and scope of use of the embodiments of the present application.

[0268] like Figure 15As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 302 or a program loaded from a storage device 308 into a random access memory (RAM) 303. When the electronic device is powered on, the RAM 303 also stores various programs and data required for the operation of the electronic device. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.

[0269] Typically, the following devices may be connected to the I / O interface 305: an input device 306 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 308 including, for example, a memory card, a hard disk, etc.; and a communication device 309. The communication device 309 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Figure 15 The electronic device is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.

[0270] In another aspect, the embodiment of the present application further provides a server. Figure 16 , which shows a schematic structural diagram of the server provided in this application. Figure 16 The server shown is only an example and should not limit the functions and scope of use of the embodiments of the present application.

[0271] like Figure 16 As shown, the server includes a bus 401, a processor 402, a communication interface 403, and a memory 404. The processor 402, the memory 404, and the communication interface 403 communicate with each other via the bus 401.

[0272] Bus 401 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. Buses can be categorized as address buses, data buses, and control buses. For ease of illustration, the figure uses only one thick line, but this does not imply that there is only one bus or only one type of bus.

[0273] The processor 402 may be any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

[0274] The memory 404 may include volatile memory, such as random access memory (RAM). The memory 404 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).

[0275] Among them, the memory 404 can be used to store the server-side related software code in the map loading method provided in this application, and the processor 402 can execute the steps of the method in the memory and can also schedule other units to implement corresponding functions.

[0276] An embodiment of the present application also provides a computer program product including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements any one of the map loading methods provided in the embodiments of the present application.

[0277] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any map loading method provided in the embodiment of the present application.

[0278] It should also be noted that the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed across multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment. In addition, in the drawings of the device embodiments provided in this application, the connection relationship between the modules indicates that there is a communication connection between them, which can be specifically implemented as one or more communication buses or signal lines.

[0279] Through the description of the above embodiments, those skilled in the art can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course can also be implemented by special hardware including application-specific integrated circuits, special CPUs, special memories, special components, etc. In general, all functions performed by computer programs can be easily implemented with corresponding hardware, and the specific hardware structures used to implement the same function can also be diverse, such as analog circuits, digital circuits or special circuits, etc. However, for the present application, software program implementation is a better implementation method in most cases. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer's floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk or optical disk, etc., and includes a number of instructions to enable a computer device (which can be a personal computer, training equipment, or network equipment, etc.) to execute the methods described in each embodiment of the present application.

[0280] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.

[0281] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website, a computer, a training device or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website, a computer, a training device or a data center. The computer-readable storage medium can be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).

Claims

1. A map data loading method, characterized in that: Applied to a terminal device, the method includes: Initiate a map data loading request to the server to obtain tile set metadata corresponding to the map to be loaded, wherein the tile set metadata includes global metadata of the tile data set; Determining a grid number sequence of grids to be drawn corresponding to the map to be loaded according to the tile set metadata; Determine a tile archive file sequence containing tile data associated with each grid in the grid number sequence, wherein one tile archive file stores multiple tile data, and map data of the same scale in the same area is stored in multiple tile archive files; Obtaining meta information and index information corresponding to each tile archive file in the tile archive file sequence; Determining loading information of tile data corresponding to the grid to be drawn based on the metadata and index information of the tile archive file; Based on the loading information of the tile data corresponding to each grid to be drawn, the corresponding tile data is obtained.

2. The method according to claim 1, characterized in that The loading information includes tile data status of tile data, and the tile data status includes pure color tile, no data tile and common tile; The step of obtaining corresponding tile data based on the loading information of the tile data corresponding to each grid to be drawn includes: If the tile data state corresponding to the tile data associated with the to-be-drawn mesh is a solid color tile, obtaining the RGBA value corresponding to the to-be-drawn mesh from the index information of the tile data associated with the to-be-drawn mesh, and rendering the corresponding solid color tile data according to the RGBA value; If the tile data state corresponding to the tile data associated with the grid to be drawn is a tile with no data, generating transparent data; If the tile data status corresponding to the tile data associated with the grid to be drawn is a common tile, the corresponding tile data is obtained from the server based on the index information of the tile data associated with the grid to be drawn.

3. The method according to claim 2, characterized in that The acquiring corresponding tile data from the server based on the index information of the tile data associated with the grid to be drawn includes: Obtaining the offset and data length of the tile data associated with the grid to be drawn from the index information of the tile archive file where the tile data is located; Construct an HTTP range request based on the offset and data length; The HTTP range request is sent to the server, and tile data returned by the server in response to the HTTP range request is received.

4. The method according to claim 2 or 3, characterized in that After acquiring corresponding tile data from a server based on the index information of the tile data associated with the grid to be drawn, the method further includes: Obtaining encryption information and compression information corresponding to the tile data from the metadata of the tile archive file containing the tile data associated with the grid to be drawn; determining whether the tile data in the tile archive file is encrypted based on the encryption information, and determining whether the tile data in the tile archive file is compressed based on the compression information; If the tile data in the tile archive file has been encrypted and compressed, decrypting the tile data obtained from the server according to the encryption information to obtain decrypted tile data, and decompressing the decrypted tile data according to the compression information to obtain target tile data associated with the grid to be drawn; If the tile data in the tile archive file is encrypted and uncompressed, decrypting the tile data obtained from the server according to the encryption information to obtain target tile data associated with the grid to be drawn; If the tile data in the tile archive file is not encrypted and has been compressed, decompressing the tile data obtained from the server according to the compression information to obtain target tile data associated with the grid to be drawn; If the tile data in the tile archive file is not encrypted and not compressed, it is determined that the tile data obtained from the server is not the target tile data associated with the grid to be drawn.

5. The method according to any one of claims 1 to 3, characterized in that The determining, according to the tile set metadata, a grid number sequence of grids to be drawn corresponding to the map to be loaded, includes: Determine a current viewport according to the display level corresponding to the map to be loaded and the designated center point, wherein the current viewport refers to the current display range of the map to be loaded; A grid number sequence corresponding to the current viewport is determined according to the scale and subdivision information corresponding to the display level.

6. The method according to any one of claims 1 to 3, characterized in that The grid number includes column number x and row number y, and each tile archive file includes m*n tile data; The determining of the tile archive file sequence containing tile data associated with each grid in the grid number sequence includes: For each grid, divide the column number x corresponding to the grid number by m and round down to obtain a first integer i, divide the row number x of the grid number by n and round down to obtain a second integer j, and obtain the file name of the tile archive file containing the tile data associated with the grid number based on the first integer i and the second integer j; The tile archive file sequence is obtained by determining a set of tile archive files containing tile data associated with each grid in the grid number sequence.

7. A map data loading method, characterized in that: Applied to a server, the server stores a tile set metadata and multiple tile archive files for map data of the same area, wherein map data of different scales of the same area are stored in different first-level folders, each first-level folder includes one or more second-level folders, each second-level folder includes multiple tile archive files, and one tile archive file stores multiple tile data; the method includes: In response to a request for loading map data sent by a terminal device, tile set metadata corresponding to the map to be loaded is sent to the terminal device; In response to a tile data loading request sent by the terminal device, the requested tile data is sent to the terminal device, wherein the tile data loading request includes loading information of the tile data, and the loading information is obtained based on the metadata and index information of the tile archive file where the tile data is located.

8. The method according to claim 7, characterized in that The method further comprises: Obtain tile update information, where the tile update information includes the geographic range to be updated, the name of the tile set to be updated, and the name of the map where the tile set to be updated is located; The tile data that needs to be updated is partially updated according to the tile update information.

9. The method according to claim 8, characterized in that The locally updating the tile data that needs to be updated according to the tile update information includes: Acquire target tile set metadata according to the name of the tile set to be updated, and determine a target tile archive file sequence that needs to be updated according to the target tile set metadata and the geographical range to be updated; For each tile archive file in the target tile archive file sequence, new tile data contained in the tile archive file is generated in batches to obtain an updated tile archive file.

10. The method according to claim 8, characterized in that The locally updating the tile data that needs to be updated according to the tile update information includes: Acquire target tile set metadata according to the name of the tile set to be updated, and determine a target tile archive file sequence that needs to be updated according to the target tile set metadata and the geographic location to be updated; For each tile archive file in the target tile archive file sequence, performing a spatial intersection operation on the geographical range corresponding to each tile archive file and the geographical range to be updated, to obtain tile sequences to be updated corresponding to all tile archive files in the target tile archive file sequence; Batch generating all tile data in the tile sequence to be updated to obtain an updated tile sequence; The corresponding tile archive file in the target tile archive file sequence is updated according to the updated tile sequence to obtain an updated tile archive file.

11. The method according to claim 9 or 10, characterized in that The determining of the target tile archive file sequence to be updated according to the target tile set metadata and the to-be-updated range includes: Obtaining the geographical range and tile-level sequence of the tile set to be updated from the target tile set metadata; For each tile level in the tile level sequence, perform the following steps: Obtaining, according to the resolution corresponding to the tile level, the number of tiles in the column direction and the number of tiles in the row direction of the tile set to be updated; Obtaining a tile archive file sequence included in the tile set to be updated according to the number of tiles in the column direction and the number of tiles in the row direction corresponding to the tile level; Determine the geographical range of each tile archive file in the tile archive file sequence of the tile set to be updated; According to the geographical scope of each tile archive file, determining tile archive files that have an intersection relationship with the geographical scope of the tile set to be updated to obtain a sequence of tile archive files to be updated; The target tile archive file sequence is the to-be-updated tile archive file sequence corresponding to each tile level in the tile level sequence.

12. A map data loading device, characterized in that: Applied to a terminal device, the device includes: A first acquisition module is configured to initiate a map data loading request to a server and obtain tile set metadata corresponding to a map to be loaded, wherein the tile set metadata includes global metadata of a tile data set; A first determining module is configured to determine a grid number sequence of grids to be drawn corresponding to the map to be loaded according to the tile set metadata; A second determining module is used to determine a tile archive file sequence containing tile data associated with each grid in the grid number sequence, wherein a tile archive file stores multiple tile data, and map data of the same scale in the same area is stored in multiple tile archive files; A second acquisition module is used to obtain meta information and index information corresponding to each tile archive file in the tile archive file sequence; A third determining module is configured to determine loading information of tile data corresponding to the to-be-drawn mesh based on the metadata and index information of the tile archive file; The third acquisition module is used to acquire corresponding tile data based on the loading information of the tile data corresponding to each grid to be drawn.

13. A map data loading device, characterized in that: Applied to a server, the server stores a tile set metadata and multiple tile archive files for map data of the same area, wherein map data of different scales of the same area are stored in different first-level folders, each first-level folder includes one or more second-level folders, each second-level folder includes multiple tile archive files, and one tile archive file stores multiple tile data; the device includes: A first sending module, configured to respond to a request for loading map data sent by a terminal device and send tile set metadata corresponding to the map to be loaded to the terminal device; The second sending module is used to respond to the tile data loading request sent by the terminal device and send the requested tile data to the terminal device, wherein the tile data loading request includes loading information of the tile data, and the loading information is obtained based on the metadata and index information of the tile archive file where the tile data is located.

14. An electronic device, characterized in that: comprising at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is configured to execute the computer program so that the electronic device can implement the map loading method according to any one of claims 1 to 11.

15. A computer storage medium, characterized in that The storage medium carries one or more computer programs, and when the one or more computer programs are executed by an electronic device, the electronic device can implement the map loading method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Network map rectifying and drawing method under dynamic map projection

    CN103065544A

  • Tile type grid raster map compression storage and release methods

    CN107301194A

  • Map tile storage method based on MBTiles

    CN109492060A

  • Airborne vector map data processing method

    CN115687675A

  • Map tile storage method, query method, apparatus and device, and storage medium

    CN116561357A