CN113360281B - Multithreading tile downloading and reading method for offline map - Google Patents
Multithreading tile downloading and reading method for offline map Download PDFInfo
- Publication number
- CN113360281B CN113360281B CN202110616176.XA CN202110616176A CN113360281B CN 113360281 B CN113360281 B CN 113360281B CN 202110616176 A CN202110616176 A CN 202110616176A CN 113360281 B CN113360281 B CN 113360281B
- Authority
- CN
- China
- Prior art keywords
- tile
- file
- queue
- map
- offline map
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 24
- 230000009191 jumping Effects 0.000 claims description 12
- 230000008520 organization Effects 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 3
- 239000007787 solid Substances 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/29—Geographical information databases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/17—Details of further file system functions
- G06F16/176—Support for shared access to files; File sharing support
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2228—Indexing structures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/546—Message passing systems or structures, e.g. queues
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/50—Indexing scheme relating to G06F9/50
- G06F2209/5018—Thread allocation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/54—Indexing scheme relating to G06F9/54
- G06F2209/548—Queue
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Remote Sensing (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention belongs to the field of offline maps, in particular to a multithreading tile downloading and reading method of an offline map, which aims at the problems that the existing method is inconvenient for storing index data, tile data and a multi-level map into a single file, so that map distribution is inconvenient, map copying and moving are inconvenient, and tiles are easy to lose.
Description
Technical Field
The invention relates to the technical field of offline maps, in particular to a multithreaded tile downloading and reading method of an offline map.
Background
With the development of mobile interconnection technology, most APP software functions are closely related to map services, the file storage structure, downloading and reading mode of an offline map are one of basic functions provided by a mobile terminal APP, and the method for optimizing the file storage structure, downloading and reading of the offline map has practical significance, so that the downloading and storing of the offline map of the mobile terminal provides an effective solving way for map application and quick tile loading in an off-network environment, and user experience is greatly improved; the off-line map loading and accessing mode is suitable for personnel in a field working environment; the ground clearance map involves three aspects: namely, three aspects of offline map file structure, tile downloading and tile reading and loading of offline map files.
In the prior art, the index data, the tile data and the multi-level map are inconvenient to store in a single file, so that the map is inconvenient to distribute, the map is very inconvenient to copy and move, and the tiles are easy to lose, so that a multi-thread tile downloading and reading method of an offline map is provided for solving the problems.
Disclosure of Invention
The invention aims to solve the defects that in the prior art, index data, tile data and a multi-level map are inconvenient to store in a single file, so that map distribution is inconvenient, map copying and moving are inconvenient, and tiles are easy to lose.
In order to achieve the above purpose, the present invention adopts the following technical scheme:
The file organization structure of the offline map comprises a file header part, a tile index part and a tile storage part, wherein the file header part comprises creation time, map name, map source information, map coordinate range, coordinate system type, number of start-stop layers of a tile library and data format type of tile images, and the file header is an entry for loading offline map tile data by a GIS software system; the tile index part comprises a layer number, a line number, a column number and tile address information; the tile storage portion includes tile numbers and tile image information.
The multithreading tile downloading method comprises the following steps:
S1: selecting an offline map boundary range to be downloaded from a map upper frame;
S2: setting the number of levels of the offline map to be downloaded, and storing information of a format, an offline map name, a file path, a coordinate type and a map source;
S3: creating file header information of an offline map file;
S4: according to the map boundary range, calculating the number of tile indexes from the lowest level to the highest level, and creating all index queues;
S5: if all the hierarchical tiles are written into the offline map file, if yes, jumping to S8, otherwise jumping to S6;
S6: judging whether the current-level tile data is downloaded and written into an offline map file, if yes, jumping to a fifth step, otherwise, jumping to S7;
s7: continuing to download the tiles and writing in the files, and returning to S6;
s8: writing the index information into an offline map file, and completing the downloading of the offline map;
the multithreading tile reading method comprises the following steps:
Step one, a tile reading and scheduling module generates a tile queue according to a screen display level, a range and tile index information;
step two, the file reading controller module informs the tile reading thread Chi Wapian that the reading queue is ready, and can start to read the tile;
step three, a tile reading thread pool obtains file sharing read permission, and tile data in the offline map file are read according to a tile reading queue sequence;
step four, notifying a file read controller to complete read work after the tile read thread pool finishes all tile reads;
step five, the file read controller informs the tile read scheduling module that the tile data read operation is completed.
Preferably, the file header part is written into the offline map file through the scheduling module, the scheduling module writes the index data into the offline map file from the low level to the high level, and judges whether the writing of the tiles of all levels is completed through the scheduling module, and the tiles of the next highest level are sequentially obtained and written into the offline map file.
Preferably, in the first step, the tile writing scheduling module transfers the tile queue a filled with the tile index information and without the tile data to the tile request thread pool according to the situations of the tile queues a and B, and the tile request thread pool calls a plurality of threads to request the tile data from the remote server at the same time.
Preferably, in the second step, the requested tile data is written into the tile data of the corresponding unit in the tile queue a by the tile thread pool, and when it is confirmed that all the tile data in the queue are requested to be completed, the tile request thread pool sends a tile request completion message to the tile write scheduling module, and after receiving the notification message, the tile write scheduling module sends a tile write file command for the queue a to the write file controller, and simultaneously notifies the tile request thread pool to request the tile data for the tile queue B.
Preferably, in the third step, the file writing controller writes the tile data of the tile queue a into the offline map file, and updates the writing address into the corresponding index data queue, and the file writing controller notifies the tile writing scheduling module that the tile queue a is written.
Preferably, in the third step, after the tile writing scheduling module receives the completion message of the write file controller, the tile writing scheduling module writes the next batch of tile information to be requested into the queue a, and the tile writing scheduling controller waits for the tile request thread pool to complete the tile request of the queue B.
Preferably, in the fourth step, the tile request thread pool sends a queue B tile request completion message to the tile write scheduling module.
Preferably, in the fifth step, the tile write scheduling module will notify the write file controller to complete writing to the tile of the queue B, and will notify the tile request thread pool to perform the tile request job of the queue a.
Compared with the prior art, the invention has the beneficial effects that:
according to the scheme, the index data, the tile data and the multi-level map are stored in the single file, so that map distribution is facilitated, map copying and moving are very convenient, the problem of tile loss does not exist, after the index information is stored in the file header according to the layer sequence, the index loading speed is high, and the index building cost is reduced;
According to the scheme, the tile parts are stored according to the sequence of the maps of different levels, so that the tile reading module can be used for carrying out multi-thread quick positioning and reading, the IO (input/output) expense of a disk is small, the map loading time is shortened, and the file storage structure is specially designed for the solid state disk. The concurrent reading characteristic of the solid state disk is utilized to the maximum extent;
the invention is convenient for storing the index data, the tile data and the multi-level map into a single file, thereby being convenient for map distribution, being convenient for map copying and moving and avoiding the problem of tile loss.
Drawings
FIG. 1 is a diagram illustrating offline map file storage in a method for downloading and reading multithreaded tiles of an offline map according to the present invention;
FIG. 2 is a flow chart of offline map data download in the method for offline map multi-threaded tile download and reading of the present invention;
FIG. 3 is a flowchart of offline map data writing files in the method for downloading and reading offline map multithreading tiles according to the present invention;
FIG. 4 is a flow chart of multi-line Cheng Wapian data file reading in the multi-line tile downloading and reading method of the offline map according to the present invention;
FIG. 5 is a flow chart of writing a multithread Cheng Wapian data file in the method for downloading and reading a multithread tile of an offline map according to the present invention;
FIG. 6 is a diagram of the correspondence between tile levels in the offline map multithreading tile download and read method of the present invention;
FIG. 7 is a sequence diagram of the same-level tile index data storage in the offline map multi-threaded tile download and read method of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments.
1-7, A file organization structure of an offline map comprises a file header part, a tile index part and a tile storage part, wherein the file header part comprises creation time, map name, map source information, map coordinate range, coordinate system type, tile library start-stop layer level number and data format type of tile image, and the file header is an entry for loading offline map tile data by a GIS software system; the tile index part comprises a layer number, a line number, a column number and tile address information; the tile storage portion includes tile numbers and tile image information.
The multithreading tile downloading method comprises the following steps:
S1: selecting an offline map boundary range to be downloaded from a map upper frame;
S2: setting the number of levels of the offline map to be downloaded, and storing information of a format, an offline map name, a file path, a coordinate type and a map source;
S3: creating file header information of an offline map file;
S4: according to the map boundary range, calculating the number of tile indexes from the lowest level to the highest level, and creating all index queues;
s5: if all the hierarchical tiles are written into the offline map file, if yes, jumping to the eighth step, otherwise, jumping to the sixth step;
S6: judging whether the current-level tile data is downloaded and written into an offline map file, if yes, jumping to a fifth step, otherwise, jumping to a seventh step;
s7: continuing to download the tiles and writing the files; ;
S8: and writing the index information into an offline map file, and completing the downloading of the offline map.
The multithreading tile reading method comprises the following steps:
1. The tile reading scheduling module generates a tile queue according to the screen display level, the range and the tile index information;
2. The read file controller module notifies the tile read thread Chi Wapian that the read queue is ready, and can begin reading tiles;
3. the tile reading thread pool acquires file sharing read permission, and reads tile data in the offline map file according to the sequence of the tile reading queues;
4. after the tile reading thread pool finishes all the tile reading, notifying a file reading controller to finish the reading work;
5. The file read controller notifies the tile read scheduling module that the tile data read job has been completed.
In this embodiment, the file header portion is written into the offline map file through the scheduling module, the scheduling module writes the index data into the offline map file in the order from the low level to the high level, and determines whether to complete writing of tiles of all levels through the scheduling module, and sequentially obtains tiles of the next highest level to write into the offline map file.
In this embodiment, the tile write scheduling module transfers the tile queue a filled with the tile index information but without the tile data to the tile request thread pool according to the conditions of the tile queues a and B, and the tile request thread pool calls a plurality of threads to request the tile data from the remote server at the same time.
In this embodiment, the requested tile data is written into the tile data of the corresponding unit in the tile queue a by the tile thread pool, and when it is confirmed that all the tile data in the queue are requested, the tile request thread pool sends a tile request completion message to the tile write scheduling module, and after receiving the notification message, the tile write scheduling module sends a tile write file command for writing the tile of the queue a to the write file controller, and simultaneously notifies the tile request thread pool to request the tile data for the tile queue B.
In this embodiment, the file writing controller writes the tile data of the tile queue a into the offline map file, and updates the writing address into the corresponding index data queue at the same time, and the file writing controller notifies the tile writing scheduling module that the tile queue a is completed.
In this embodiment, after receiving the completion message of the write file controller, the tile write scheduling module writes the next batch of tile information to be requested into the queue a, and the tile write scheduling controller waits for the tile request thread pool to complete the tile request of the queue B.
In this embodiment, the tile request thread pool sends a queue B tile request completion message to the tile write scheduling module.
In this embodiment, the tile write scheduling module will notify the write file controller to complete writing to the tile of queue B, and will notify the tile request thread pool to perform the tile request job of queue a.
In this embodiment, the tile write scheduling module will notify the write file controller to complete writing to the tile of queue B, and will notify the tile request thread pool to perform the tile request job of queue a
Index data, tile data and a multi-level map can be conveniently stored in a single file, so that map distribution can be facilitated, map copying and moving are very convenient, and the problem of tile loss is avoided.
The foregoing is only a preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art, who is within the scope of the present invention, should make equivalent substitutions or modifications according to the technical scheme of the present invention and the inventive concept thereof, and should be covered by the scope of the present invention.
Claims (2)
1. The multithreading tile downloading and reading method of the offline map is characterized by comprising a multithreading tile downloading method and a multithreading Cheng Wapian reading method;
The multithreading tile downloading method comprises the following steps:
S1: selecting an offline map boundary range to be downloaded from a map upper frame;
S2: setting the number of levels of the offline map to be downloaded, and storing information of a format, an offline map name, a file path, a coordinate type and a map source;
S3: creating file header information of an offline map file;
S4: according to the map boundary range, calculating the number of tile indexes from the lowest level to the highest level, and creating all index queues;
S5: if all the hierarchical tiles are written into the offline map file, if yes, jumping to S8, otherwise jumping to S6;
S6: judging whether the current-level tile data is downloaded and written into an offline map file, if yes, jumping to a fifth step, otherwise, jumping to S7;
s7: continuing to download the tiles and writing in the files, and returning to S6;
s8: writing the index information into an offline map file, and completing the downloading of the offline map;
the multithreading tile reading method comprises the following steps:
Step one: the tile reading scheduling module generates a tile queue according to the screen display level, the range and the tile index information;
Step two: the read file controller module notifies the tile read thread Chi Wapian that the read queue is ready, and can begin reading tiles;
step three: the tile reading thread pool acquires file sharing read permission, and reads tile data in the offline map file according to the sequence of the tile reading queues;
Step four: after the tile reading thread pool finishes all the tile reading, notifying a file reading controller to finish the reading work;
step five: the file read controller informs the tile read scheduling module that the tile data read operation is completed;
The file organization structure of the offline map comprises a file header part, a tile index part and a tile storage part, wherein the file header part comprises creation time, map name, map source information, map coordinate range, coordinate system type, start-stop layer number of a tile library and data format type of a tile image, and the file header is an entry for loading offline map tile data by a GIS software system; the tile index part comprises a layer number, a line number, a column number and tile address information; the tile storing part comprises a tile number and tile image information;
In the first step, the tile writing scheduling module transmits a tile queue a filled with tile index information but without tile data to a tile request thread pool according to the conditions of the tile queues a and B, and the tile request thread pool calls a plurality of threads and requests the tile data from a remote server;
In the second step, the requested tile data is written into the tile data of the corresponding unit in the tile queue a through the tile thread pool, when all the tile data in the queue are confirmed to be requested, the tile request thread pool sends a tile request completion message to the tile write scheduling module, and after receiving the notification message, the tile write scheduling module sends a tile write file command of the queue a to the write file controller, and simultaneously notifies the tile request thread pool to request the tile data for the tile queue B;
In the third step, the file writing controller writes the tile data of the tile queue A into the offline map file, and updates the writing address into the corresponding index data queue, and the file writing controller informs the tile writing scheduling module that the tile queue A is written;
After receiving the completion message of the write file controller, the tile write scheduling module writes the next batch of tile information to be requested into the queue A, and the tile write scheduling controller waits for the tile request thread pool to complete the tile request of the queue B;
In the fourth step, the tile request thread pool sends a queue B tile request completion message to the tile write scheduling module;
in the fifth step, the tile write scheduling module notifies the write file controller to complete writing of the tile in the queue B, and simultaneously notifies the tile request thread pool to perform the tile request work of the queue a.
2. The method for downloading and reading multi-thread tiles of an offline map according to claim 1, wherein the file header part is written into the offline map file through a scheduling module, the scheduling module writes index data into the offline map file in a sequence from a low level to a high level, and the scheduling module judges whether to complete writing of tiles of all levels, and sequentially obtains tiles of a next highest level to write into the offline map file.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110616176.XA CN113360281B (en) | 2021-06-02 | 2021-06-02 | Multithreading tile downloading and reading method for offline map |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110616176.XA CN113360281B (en) | 2021-06-02 | 2021-06-02 | Multithreading tile downloading and reading method for offline map |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113360281A CN113360281A (en) | 2021-09-07 |
CN113360281B true CN113360281B (en) | 2024-05-07 |
Family
ID=77531670
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110616176.XA Active CN113360281B (en) | 2021-06-02 | 2021-06-02 | Multithreading tile downloading and reading method for offline map |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113360281B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115102948A (en) * | 2022-06-24 | 2022-09-23 | 阿波罗智联(北京)科技有限公司 | Automatic downloading method, device and equipment of map tiles and storage medium |
CN117271691B (en) * | 2023-10-07 | 2024-06-14 | 扬州万方科技股份有限公司 | Construction method, system and computer readable medium for tile map service based on domestic platform |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102819530A (en) * | 2011-06-10 | 2012-12-12 | 中兴通讯股份有限公司 | Method and device for displaying electronic map |
CN103744855A (en) * | 2013-11-29 | 2014-04-23 | 航天恒星科技有限公司 | Tile map storage method based on aggregation files |
CN107239531A (en) * | 2017-05-31 | 2017-10-10 | 国电南瑞科技股份有限公司 | A kind of extension GeoServer issues the implementation method of self-defined tile WMS services |
CN110019636A (en) * | 2019-04-17 | 2019-07-16 | 重庆同汇勘测规划有限公司 | A kind of storage mode of GIS tile map |
EP3799639A1 (en) * | 2018-10-05 | 2021-04-07 | Google LLC | Improving offline map data availability |
-
2021
- 2021-06-02 CN CN202110616176.XA patent/CN113360281B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102819530A (en) * | 2011-06-10 | 2012-12-12 | 中兴通讯股份有限公司 | Method and device for displaying electronic map |
CN103744855A (en) * | 2013-11-29 | 2014-04-23 | 航天恒星科技有限公司 | Tile map storage method based on aggregation files |
CN107239531A (en) * | 2017-05-31 | 2017-10-10 | 国电南瑞科技股份有限公司 | A kind of extension GeoServer issues the implementation method of self-defined tile WMS services |
EP3799639A1 (en) * | 2018-10-05 | 2021-04-07 | Google LLC | Improving offline map data availability |
CN110019636A (en) * | 2019-04-17 | 2019-07-16 | 重庆同汇勘测规划有限公司 | A kind of storage mode of GIS tile map |
Non-Patent Citations (1)
Title |
---|
移动终端离线电子地图应用框架研究;李锋;明镜;王昌翰;;测绘科学(06);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN113360281A (en) | 2021-09-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113360281B (en) | Multithreading tile downloading and reading method for offline map | |
US10133598B2 (en) | Systems and methods of using a hypervisor to assign virtual processor priority based on task priority and to schedule virtual processors for guest operating systems | |
JP3160149B2 (en) | Non-stop program change method of disk controller and disk controller | |
JP3659062B2 (en) | Computer system | |
US10831387B1 (en) | Snapshot reservations in a distributed storage system | |
US8418181B1 (en) | Managing program execution based on data storage location | |
US9135060B2 (en) | Method and apparatus for migrating task in multicore platform | |
US9477591B2 (en) | Memory access requests in hybrid memory system | |
US9367247B2 (en) | Memory access requests in hybrid memory system | |
US20240264940A1 (en) | Write data cache method and system, device, and storage medium | |
WO2005114375A1 (en) | Systems and methods for tracking screen updates | |
KR101901587B1 (en) | Method and apparatus to guarantee real time processing of soft real-time operating system | |
US20110029930A1 (en) | Distributed processing device and distributed processing method | |
CN102446072B (en) | System and method for DAID array transformation in a pooled storage system | |
JP6051721B2 (en) | Execution control method and multiprocessor system | |
US20050149608A1 (en) | Adaptive queue scheduling | |
JP2007102436A (en) | Storage controller and storage control method | |
CN116028226A (en) | Quantum computing device-based DPDK component image data ordering method, storage device and intelligent terminal | |
CN115794352A (en) | Method and system for online migration of S3 object storage bucket level data | |
CN107422990A (en) | A kind of dynamic migration method and device | |
JP3138575B2 (en) | File copy transfer method | |
JP3385407B2 (en) | Non-stop program change method for multiprocessor system and multiprocessor system | |
JP4754531B2 (en) | Device access control method and processing apparatus | |
CN112199044B (en) | Multi-tenant-oriented FTL setting method, system, computer program and storage medium | |
CN110333823A (en) | Data migration method, device, equipment and storage medium based on nbd equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |