CN115865896A - Terrain image data storage and acquisition method and device - Google Patents

Terrain image data storage and acquisition method and device Download PDF

Info

Publication number
CN115865896A
CN115865896A CN202211480918.1A CN202211480918A CN115865896A CN 115865896 A CN115865896 A CN 115865896A CN 202211480918 A CN202211480918 A CN 202211480918A CN 115865896 A CN115865896 A CN 115865896A
Authority
CN
China
Prior art keywords
target
file
tile
block
original tile
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211480918.1A
Other languages
Chinese (zh)
Inventor
宋关福
冯振华
高峰
陈鹏
白崇锦
赵亚东
张杰夫
孙寅乐
王博
李广明
杨芳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Supermap Software Co ltd
Original Assignee
Supermap Software Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Supermap Software Co ltd filed Critical Supermap Software Co ltd
Priority to CN202211480918.1A priority Critical patent/CN115865896A/en
Publication of CN115865896A publication Critical patent/CN115865896A/en
Pending legal-status Critical Current

Links

Images

Abstract

The application discloses a method and a device for storing and acquiring topographic image data, wherein a server side stores a plurality of original tile files in a combined manner according to the geographical positions of the original tile files, namely, one block file stores a plurality of existing original tile files, each original tile file in one block file has a geographical association relationship and belongs to one area, so that a client side can send a block file acquisition request to the server side according to the geographical positions of target tiles to be acquired under the condition that topographic image data of a certain area are to be acquired, so as to acquire the block files containing a plurality of target tiles, the acquisition of the plurality of target tiles is realized through one request and response thereof, the number of requests to be sent by the client side and the number of requests to be responded by the server side are reduced, request congestion is avoided, and the loading speed of topographic image data is improved.

Description

Method and device for storing and acquiring terrain image data
Technical Field
The application relates to the technical field of geographic information, in particular to a method and a device for storing and acquiring topographic image data.
Background
The topographic image data is basic data of a Geographic Information System (GIS). For example, in the application of three-dimensional GIS, topographic operations such as data analysis, data query, and mosaicing can be performed based on topographic image data as base map data. Currently, most proxy servers store terrain image data in a tile form, and a single tile file is small, so when a client wants to load terrain image data in a certain range, a large number of tile files need to be acquired, a large number of tile file acquisition requests are sent to the proxy servers, and the proxy servers sequentially respond to the requests and send the tile files to the client one by one.
With the increase of the network transmission speed, the time required for transmitting one tile file is reduced, but because the client can only send a limited number of requests to the proxy server at the same time, and the server can only respond to the limited number of requests at the same time, the request congestion is caused, so that the loading speed of the current terrain image data is slower.
Disclosure of Invention
In view of the foregoing, the present application is proposed to provide a method and an apparatus for storing and acquiring topographic image data, so as to improve the loading speed of topographic image data at a client.
The specific scheme is as follows:
in a first aspect, a method for storing topographic image data is provided, which is applied to a server, and the method includes:
acquiring an original tile file to be stored;
grouping the original tile files according to geographic positions to obtain a plurality of data groups, wherein each data group comprises a plurality of original tile files;
for each of the data sets: and generating a block file according to each original tile file in the data group, generating a file name according to the geographical position of each original tile file in the data group, and storing the block file by using the file name.
In a second aspect, there is provided a topographic image data storage device comprising:
the tile obtaining unit is used for obtaining an original tile file to be stored;
the tile grouping unit is used for grouping the original tile files according to geographic positions to obtain a plurality of data groups, and each data group comprises a plurality of original tile files;
and the block file storage unit is used for generating a corresponding block file according to each original tile file in each data group, generating a corresponding file name according to the geographical position of each original tile file in each data group, and storing the corresponding block file according to the file name.
In a third aspect, a method for acquiring terrain image data, applied to a client, is provided, where the method is used to acquire terrain image data stored based on the above storage method, and includes:
determining a target file name according to the geographic positions of a plurality of target tiles, wherein the target tiles are original tile files to be acquired;
sending a block file acquisition request containing the target file name to a server, so that the server searches a target block file corresponding to the target file name and stored in the server, and returns a response containing the target block file to the client;
caching the target block file in the response to the local according to the received response of the server;
extracting target data in the cached target block file, the target data being data corresponding to the target tile.
In a fourth aspect, there is provided a topographic image data storage device for storing topographic image data based on the above storage method, comprising:
the file name determining unit is used for determining a target file name according to the geographic positions of a plurality of target tiles, wherein the target tiles are original tile files to be acquired;
a block file obtaining unit, configured to send a block file obtaining request including the target file name to a server, so that the server searches for a target block file stored by the server and corresponding to the target file name, returns a response including the target block file to the client, and caches the target block file in the response to the local according to the received response of the server;
and the data acquisition unit is used for extracting target data in the cached target block file, wherein the target data is data corresponding to the target tile.
By means of the technical scheme, the method and the device have the advantages that the original tile files are combined and stored according to the geographical positions of the original tile files, namely, the original tile files are stored in one block file, each original tile file in one block file has a geographical association relationship and belongs to one area, so that a client can send a block file acquisition request to a server according to the geographical position of a target tile to be acquired under the condition that topographic image data of a certain area are to be acquired, the block file including the target tiles is acquired, the acquisition of the target tiles is achieved through one request and response of the request, the number of requests sent by the client and the number of requests responded by the server are reduced, request congestion is avoided, and the loading speed of the topographic image data is improved.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the application. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a schematic flowchart of a method for storing topographic image data according to an embodiment of the present disclosure;
fig. 2 is a schematic structural diagram of a block file provided in an embodiment of the present application;
fig. 3 is a schematic flowchart illustrating another method for storing topographic image data according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a topographic image data storage device according to an embodiment of the present disclosure;
fig. 5 is a schematic flowchart of a method for acquiring topographic image data according to an embodiment of the present disclosure;
fig. 6 is a schematic flowchart of another method for acquiring topographic image data according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of a topographic image data acquisition device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The application provides a method and a device for storing and acquiring topographic image data, which can be suitable for solving the problem of low loading speed of topographic image data at a client, wherein the topographic image data can be data in a global subdivision mode or a local subdivision mode.
The terrain image data storage scheme provided by the application can be applied to a server side. Fig. 1 is a schematic flowchart of a method for storing topographic image data according to an embodiment of the present application, and as shown in fig. 1, the method may include the following steps:
and S101, acquiring an original tile file to be stored.
The original tile files store topographic image data segmented according to an existing subdivision mode, for example, each original tile file may store image data with 256 × 256 resolution or topographic data with 64 × 64 resolution, the size of the tile file is usually 20kb to 40kb, the size of each tile file after compression is usually below 20kb, and the existing tile files are suitable for transmission in a low-speed network environment.
And S102, dividing the original tile file into a plurality of data groups according to the geographical position.
Specifically, the step S102 may include: and grouping the original tile files according to the geographical position to obtain a plurality of data groups, wherein each data group comprises a plurality of original tile files. The original tile files with certain geographic association relation can be grouped into a data group by taking the geographic position as a grouping basis, so that the subsequent combined storage is facilitated.
Step S103, storing each data group in the form of a block file.
Specifically, the process of storing each of the data sets may include:
s01, generating a block file according to each original tile file in the data set;
s02, generating a file name according to the geographical position of each original tile file in the data group;
and S03, storing the block file by using the file name.
According to the terrain image data storage method, a plurality of original tile files are stored in a combined mode according to the geographic positions of the original tile files, namely, one block file stores a plurality of existing original tile files, each original tile file in one block file has a geographic association relationship and belongs to one area, the file name of the block file is generated according to the geographic position of the original tile file stored in the block file, the size of the block file generated by the method is usually 300kb-500kb and is suitable for high-speed network transmission, so that a client can determine the file name of the block file to be acquired according to the geographic position of a target tile to be acquired and send a block file acquisition request to a server under the condition that terrain image data of a certain area is to be acquired, the block file containing a plurality of target tiles is acquired, namely, acquisition of a plurality of target tiles is achieved by one request and the response of the request, the acquisition request is not required to be loaded by the original tile files along with the improvement of network bandwidth and the improvement of network transmission speed compared with the request of loading of one original tile file, the number of additional tile files is not increased, the number of requests and the number of the requests required to be loaded is reduced under the combined mode of reducing the load of the request of the client and the unit of the request, thereby reducing the load of the load.
For example, in a 17-inch display with a resolution of 1280 × 1024, if the display is tiled with an original tile file with a resolution of 256 × 256 on a full screen, 20 original tile files with 5 columns and 4 rows are needed, and at least 6 scales or levels, i.e., 6 × 20=, 120 original tile files are needed in the case of three-dimensional display for head-up, that is, in the case of a fixed camera, one terrain image data is loaded, and the client needs to request 120 original tile files from the server, and the number of requested tiles will increase by several times or even tens of times per second during the flight browsing; in the storage scheme for the terrain image data provided by the application, a plurality of original tile files are stored in one block file according to a certain geographical association relationship, optionally, 20 original tile files to be acquired at a time can be stored in one block file, and to load one terrain image data stored according to the scheme provided by the application, a client may only need to request a server for 6 times to acquire 6 scale or level block files, and under a relatively high network transmission speed, for example, under a network condition of more than 300kb/s, requesting one block file does not bring excessive additional overhead compared with requesting one original tile file, so that the request times and response times are greatly reduced, and request congestion is avoided.
In some embodiments provided by the present application, the generating a block file according to each original tile file in the data set in step S01 above may include:
s11, determining the number of each original tile file in the data group according to the geographical position of the original tile file.
It should be noted that the storage structure of the block file is a stream structure, that is, in the block file to be generated, data of each original tile file is stored continuously, so that the sequence of storing each original tile file needs to be determined, that is, the storage order of the original tile file in the block file to be generated is represented in a numbering manner. In addition, the number No of the original tile file is unique and determined within a data set, and may be, for example, an integer between 0 and (N-1) determined according to the geographic location thereof, where N is the number of the original tile files within the data set.
And S12, generating a block file by the first type information, the second type information and the third type information which are sequentially arranged.
The first type of information is the number N of the original tile files in the data group, the second type of information is the data size information of each original tile file in the data group arranged according to the numbering sequence, the memory size occupied by the first type of information and the data size information of each original tile file is a preset value, and the third type of information is the data content of each original tile file in the data group arranged according to the numbering sequence. Specifically, the arrangement according to the numbering sequence may be an ascending arrangement according to the numbering sequence.
Optionally, the block file may further store header information used for representing file information such as a current version number before the first type of information, and a size of a memory occupied by the header information is the preset value.
Fig. 2 illustrates a storage structure of a block file. As shown in fig. 2, a block file includes a first type of information, a second type of information, and a third type of information, which are sequentially arranged, where the first type of information is the number N of original tile files to be stored in the block file, the second type of information is data size information TileSize [0], tileSize [1], \ 8230, tileSize [ N-1], the first type of information and data size information TileSize [ i ], i =1, \8230ofeach original tile file, the memory sizes occupied by N-1 are preset values, which may be X bytes, X is a positive integer, and the third type of information is data contents TileData [0], tileData [1],. 8230, tileData [ N-1] of each original tile file arranged in the numbering sequence.
Fig. 3 is a flowchart illustrating another method for storing topographic image data according to an embodiment of the present disclosure. As shown in connection with fig. 3, the method may include the steps of:
step S201, obtaining original tile files to be stored, and determining a preset number N according to a preset block factor.
The block factor is a parameter for characterizing the number of stored original tile files of a block file, and the preset number N may be the number of the original tile files included in the block file to be generated. It should be noted that, the method may store the original tile files to be stored according to different block factors to meet data loading requirements in network environments with different speeds, and then, in the case that the preset block factors are multiple, execute steps S202 to S203 for each block factor and the preset number N determined by the block factor.
Step S202, the original tile files which meet preset geographical position conditions and are not more than the preset number N are classified into a data group.
It should be noted that the number of original tile files to be stored is not infinite, that is, if the terrain image data to be stored is data in a limited geographical range, the number of original tiles meeting the preset geographical location condition may be less than the preset number N, that is, the number of original tile files stored in the generated block file may not be the preset number N.
Step S203, storing each data group in the form of a block file.
Specifically, each block file generated in step S203 is stored in a directory corresponding to the block factor, and the other expressions in step S203 may refer to step S103 described above.
The storage method of the topographic image data provides a storage method matched with a network environment when the topographic image data are loaded through the preset block factors. For example, referring to the quadtree subdivision mode, a value of a blocking factor BlockFactor may be set to be 0, 1, 2, or 3, and on the basis, the preset number N = (2) of original tile files to be stored in the block file may be determined by a preset blocking factor BlockFactor BlockFactor ) 2 For example, a block file with a block factor of 2, N = (2) is to be stored 2 ) 2 =16 original tile files. If the network environment is better when the topographic image data is to be acquired, a block file with a larger preset number can be requested to be acquired, because the network transmission speed is higher in the better network environment, the influence of the size of the block file on the time required for transmission is smaller, and the request for acquiring the block file with the larger preset number can reduce the request times.
In a possible implementation manner, the preset number N may be equal to a product of a first parameter a and a second parameter b, where the first parameter a and the second parameter b may be positive integers set according to the block factor. For example, the first parameter a and the second parameter b may be the same or different.
On the basis of the above, the step S202 of grouping the original tile files that satisfy the preset geographic location condition and do not exceed the preset number N into a data group may include:
step S21, for each of the original tile files: acquiring the number of layers TiLELevel, the number of rows TiLERow and the number of columns TiLEColumn of the original tile file, wherein the number of layers TiLELevel, the number of rows TiLERow and the number of columns TiLEColumn are used for representing the geographic position of the original tile file; taking the line number TileRow of the original tile file as a dividend, and taking the first parameter a as a divisor to perform integer division to obtain a first quotient of the original tile file; and taking the column number TileColumn of the original tile file as a dividend, and taking the second parameter b as a divisor to perform integer division to obtain a second quotient of the original tile file.
And S22, grouping the original tile files with the same layer number, the same first quotient and the same second quotient into a data group.
It should be noted that, for an original tile file in an existing local subdivision manner, the number of layers of the original tile file is a parameter that can characterize a scale of the original tile file, for example, 0 layer may correspond to the coarsest scale, and the number of layers increases as the scale increases.
In the above method, in addition to obtaining the first quotient and the second quotient by integer division, the first quotient and the corresponding first remainder a 'and the second quotient and the corresponding second remainder b' may also be obtained by ordinary division, and the array (a ', b') formed by the first remainders a 'and b' may represent the relative geographic location of the original tile file in the data array. For example, if the original tile file is numbered from 0 and the block file is the original tile file stored in row-first order, the number No = b a '+ b' of the original tile file may be determined from the first remainder a 'and the second remainder b'; if the block file is the original tile file stored in row-first order, no = a × b '+ a'.
Optionally, when the original tile files are grouped according to the geographic location, other grouping schemes may also be used, for example, for original tile files of the same layer number, the original tile files are arranged in ascending order according to the number of rows and columns, starting from the original tile file with the minimum number of rows and columns, a and B original tile files in each row a and each column B are grouped into one data group, where a and B are positive integers.
In a possible implementation manner, the generating a file name according to a geographic location of each original tile file in the data group may include:
and S30, generating a file name according to the layer number, the first quotient and the second quotient of the original tile file in the data group.
Specifically, the file name of the block file may include the number of layers, blockLevel, of the block file, a number of rows, blockRow, and a number of columns, blockColumn, of the block file, where the number of rows of the block file may be the first quotient, and the number of columns of the block file may be the second quotient. Illustratively, the number of layers of the block file, blockLevel = tillelevel-BlockFactor, and the number of lines of the block file, blockRow = tillerow/(2) BlockFactor ) The column number of the block file, blockColumn = TileColumn/(2) BlockFactor ) It should be noted that the division is integer division.
Exemplarily, assuming that the preset block factor is 3, the preset number N = (2) of block files to be generated is determined according to the block factor 3 ) 2 =64, assuming that the first parameter a =2 3 =8, second parameter b =2 3 =8, the number of layers tileLevel, the number of rows TileRow and the number of columns TileColumn of each original tile file are numbered from 0, then 64 original tile files of 7 layers, 88 rows to 95 rows, 208 columns to 215 columns are classified into one data group and stored in one block file, and each original tile file in the block file is provided with the same number of layers 7, the same first quotient 11 and the same second quotient 26, thereby realizing the purpose of calculating the number of layers TileLevel, the number of rows TileRow and the number of columns TileColumnSpecifically, the file name of the block file may be represented by the number of layers of the block file, i.e., the number of lines, i.e., the number of rows, i.e., blockRow, and the number of columns, i.e., blockColumn, of the block file, where the difference between the number of layers of the original tile file and the block factor may be used as the number of layers of the block file, specifically, blockLevel = tilevelle-BlockFactor =7-3=4, and the file name of the block file may be set to 4 xu 11_26. Assuming that said block file is a row-first sequentially stored original tile file and the number No of each of said original tile files is numbered from 0, the number No =8 x 1+0=8 of the original tile file of 7 layers 89 rows and 208 columns is the 9 th original tile file stored for said block file.
Optionally, when generating a file name according to the geographic location of each original tile file in the data group, another naming scheme may be adopted, for example, for a data group, geographic location information of each original tile in the group is obtained, the geographic location information may be represented by the number of layers, the number of rows, and the number of columns of the original tile file, a set is formed by the number of layers, the number of rows, and the number of columns of all the original tile files in the data group, the set is used as the file name of a block file generated by the data group, or a certain mapping operation is performed on the number of layers, the number of rows, and the number of columns of all the original tile files in the data group, and an operation result is used as the file name of the block file generated by the data group.
In the following, the topographic image data storage device provided in the embodiments of the present application is described, and the topographic image data storage device described below and the topographic image data storage method described above may be referred to in correspondence with each other.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a topographic image data storage device disclosed in the embodiment of the present application.
As shown in fig. 4, the apparatus may include:
a tile obtaining unit 11, configured to obtain an original tile file to be stored;
the tile grouping unit 12 is configured to group the original tile files according to geographic locations to obtain a plurality of data sets, where each data set includes a plurality of the original tile files;
and a block file storage unit 13, configured to generate a corresponding block file according to each original tile file in each data group, generate a corresponding file name according to a geographic location of each original tile file in each data group, and store the corresponding block file with the file name.
In some embodiments provided herein, the process of generating, by the block file storage unit 13, a block file according to each original tile file in the data group may include:
determining the number of each original tile file in the data group according to the geographical position of the original tile file;
generating a block file by using first type information, second type information and third type information which are sequentially arranged, wherein the first type information is the number of the original tile files in the data group, the second type information is data size information of each original tile file in the data group which is arranged according to the numbering sequence, the memory size occupied by the first type information and the data size information of each original tile file is a preset value, and the third type information is data content of each original tile file in the data group which is arranged according to the numbering sequence.
In some embodiments provided by the present application, the tile grouping unit 12 may be further configured to determine a preset number N according to a preset block factor, where the preset number N is the number of the original tile files included in the block file to be generated.
On the basis of the above, the process of grouping the original tile files according to the geographical location by the tile grouping unit 12 may include:
and classifying the original tile files which meet the preset geographical position condition and do not exceed the preset number N into a data group.
The process of the block file storage unit 13 storing the corresponding block file with the file name may include:
and storing the block file into the directory corresponding to the block factor of the block file according to the file name.
In some embodiments provided herein, the preset number N = a × b, wherein the first parameter a and the second parameter b are positive integers set according to the block factor.
On the basis of the above, the process of grouping the original tile files satisfying the preset geographical location condition and not exceeding the preset number N into one data group by the tile grouping unit 12 may include:
for each of the original tile files:
acquiring the number of layers, the number of rows and the number of columns of the original tile file, wherein the number of layers, the number of rows and the number of columns are used for representing the geographic position of the original tile file;
taking the line number of the original tile file as a dividend, and taking the first parameter a as a divisor to carry out integer division to obtain a first quotient of the original tile file;
taking the number of columns of the original tile file as a dividend, and taking the second parameter b as a divisor to perform integer division to obtain a second quotient of the original tile file;
and classifying the original tile files with the same layer number, the same first quotient and the same second quotient into a data group.
In a possible implementation manner, the process of generating, by the block file storage unit 13, a file name according to a geographic location of each original tile file in the data group may include:
and generating a file name according to the layer number, the first quotient and the second quotient of the original tile file in the data group.
According to the terrain image data storage device, the original tile files are combined and stored in a block file form, the tile files with a certain geographical association relation are stored in one block file, the file names of the block files are generated according to the geographical positions of the original tile files stored in the block files, so that the client can determine the file names of the block files to be acquired according to the geographical positions of the target tiles to be acquired under the condition that the terrain image data of a certain area is acquired, and send block file acquisition requests to the server, so that the block files containing a plurality of target tiles are acquired, the request quantity and the response quantity are reduced, request congestion is avoided, and the loading speed of the terrain image data is improved.
The following describes a method and an apparatus for acquiring topographic image data according to the present application, and the method and the apparatus for acquiring topographic image data described below may be used to acquire topographic image data stored according to the method for storing topographic image data described above.
Fig. 5 is a schematic flowchart of a method for acquiring topographic image data according to an embodiment of the present application, and as shown in fig. 5, the method may include the following steps:
step S301, the client determines the name of the target file according to the geographic positions of the target tiles.
It should be noted that the client may be a browser end or a mobile end; the target tile is an original tile file to be acquired, each original tile file is stored in the server according to the topographic image data storage method shown in fig. 1, and the geographical location information of each original tile file to be stored in the block file is utilized when generating the file name of the block file by referring to the related expressions of the steps S101-S103, so that the client can determine the target file name of the target block file to be acquired according to the geographical location of the target tile to be acquired by utilizing the same block file naming rule; the target tiles may belong to different block files, and in the case where the target file name determined in step S301 is plural, the following steps are performed for each determined target file name.
Step S302, the client sends a block file acquisition request containing the target file name to the server.
And step S303, the server returns a response containing the target block file to the client according to the block file acquisition request.
Specifically, the server may search for a target block file corresponding to the target file name stored therein according to the target file name determined by the client, and return a response including the target block file to the client.
And step S304, the client receives the response of the server and caches the target block file in the response to the local.
Step S305, the client extracts the target data in the cached target block file.
Wherein the target data is data corresponding to the target tile.
If the topographic image data to be acquired is stored according to the topographic image data storage method shown in fig. 1 and is a block file generated according to the above steps S11 to S12, the step S305 may include the step of the client extracting target data in the target block file, where the target data is cached, and the step includes:
for each of the target tiles to be obtained:
determining the storage order of target data corresponding to the target tile in a corresponding target block file according to the geographic position of the target tile;
determining a target storage position according to the first type information, the second type information and the storage bit number in the target block file, wherein the target storage position is a storage position of the target data in the target block file;
and acquiring data on the target storage position in the target block file to obtain the target data.
For example, assuming that the target data to be extracted is the data content of the 3 rd original tile file in the block file as shown in fig. 2, and the storage memory occupied by the first type information in the block file and the data size information of each original tile file is X bytes, the process of extracting the data content of the nth original tile file in the block file may include: acquiring the number N of original tile files in the block file stored on the 1 st X byte in the block file; sequentially obtaining information stored in the 2 nd, 3 rd and 4 th bytes of X in the block file to obtain respective data size information TileSize [0], tileSize [1] and TileSize [2] of the 1 st to 3 rd original tile files in the block file; and determining that a storage memory occupied by the third type information of the block file is a storage space behind the (N + 1) th X byte, wherein target data to be extracted are data behind TileSize [0] + TileSize [1], and the occupied memory is TileSize [2 ].
Fig. 6 is a schematic flowchart of another method for acquiring topographic image data according to an embodiment of the present disclosure, where the method is used to acquire topographic image data stored based on the storage method shown in fig. 3, and as shown in fig. 6, the method may include the following steps:
step S401, the client determines a target blocking factor according to the current network environment and determines a target file name according to the geographic positions of a plurality of target tiles.
The target block factor may be used to represent a preset number N of target block files to be obtained.
Step S402, the client sends a block file acquisition request containing a target file name and a target block factor to the server.
And step S403, the server returns a response containing the target block file to the client according to the block file acquisition request.
Specifically, the step S403 may include: and the server searches a target block file corresponding to the target file name in a directory corresponding to the target block factor according to the block file acquisition request, and returns a response containing the target block file to the client.
Steps S404-S405 are identical to steps S304-S305 described above and will not be described herein.
If the topographic image data to be acquired is stored according to the topographic image data storage method as shown in fig. 3, and the original tile file grouping performed according to the above steps S21 to S22 and the file name of the block file generated according to the above step S30, after determining the target block factor according to the current network environment in the above step S401, the method may further include:
and determining the first parameter a and the second parameter b according to the target block factor, wherein the first parameter a and the second parameter b are positive integers.
On the basis of the foregoing, the determining, in step S401, a target file name according to the geographic locations of the target tiles may include:
for each target tile:
taking the line number of the target tile as a dividend, and taking the first parameter a as a divisor to carry out integer division to obtain a first quotient of the target tile;
taking the number of the columns of the target tiles as dividends, and taking the second parameter b as a divisor to perform integer division to obtain a second quotient of the target tiles;
determining the file name of a target block file to which the target tile belongs according to the layer number of the target tile, the first quotient of the target tile and the second quotient of the target tile;
and determining a target file name according to the file name of the target block file to which each target tile belongs.
For example, assuming that the file name of a block file is represented by the number of layers, the number of rows, and the number of columns of the block file, where the number of layers of the block file is a difference between the stored number of layers of original tile files and a preset block factor, if the preset block factor is 3 and the corresponding preset number N =8 × 8, a block file with the number of layers 4, the number of rows 11, and the number of columns 26 stores 64 original tile files in total, which are 7 layers, 88 rows to 95 rows, and 208 columns to 215 columns, in the above case, if it is determined that the target block factor is 3 according to the current network environment, and original tile files of 7 layers, 92 rows, and 210 columns are to be obtained, it may be calculated: blockLevel = tilevelle-BlockFactor =7-3=4, blockrow = tilelow/(2) BlockFactor )=92/8=11,BlockColumn=TileColumn/(2 BlockFactor ) =210/8=26, and thus it is determined that the target block file to be acquired is a block file of 4 layers, 11 rows, and 26 columns stored in the directory corresponding to the target block factor 3.
In some embodiments provided in the present application, before sending the block file obtaining request to the server, the method may further include:
judging whether the client caches a corresponding target block file or not according to the target file name;
and determining the uncached target file name according to the judgment result.
On the basis of the foregoing, the sending the block file acquisition request including the target file name to the server may include:
and sending a block file acquisition request containing the uncached target file name to a server.
According to the method for acquiring the terrain image data, when a client wants to load a target tile, the block file containing the target tile is cached to the local in a request-response mode, the block file contains a plurality of original tile files related to the target tile, so that when the client wants to load other tiles related to the target tile, a part of other tiles can be extracted from the cached block file, the number of subsequent requests is reduced, the data loading speed is increased, and the loading and browsing performance of the terrain image data on the client is improved.
The following describes a topographic image data acquisition device provided in an embodiment of the present application, and the topographic image data acquisition device described below and the topographic image data acquisition method described above may be referred to in correspondence with each other.
Referring to fig. 7, fig. 7 is a schematic structural diagram of a topographic image data acquiring device disclosed in the embodiment of the present application, which may be used to acquire topographic image data stored based on the storage method shown in fig. 1.
As shown in fig. 7, the apparatus may include:
a file name determining unit 21, configured to determine a target file name according to geographic locations of a plurality of target tiles, where the target tiles are original tile files to be obtained;
a block file obtaining unit 22, configured to send a block file obtaining request including the target file name to a server, so that the server searches for a target block file stored by the server and corresponding to the target file name, returns a response including the target block file to the client, and caches the target block file in the response to the local according to the received response of the server;
a data obtaining unit 23, configured to extract target data in the cached target block file, where the target data is data corresponding to the target tile.
In some embodiments provided herein, the process of extracting the cached target data in the target block file by the data obtaining unit 23 may include:
for each of the target tiles to be obtained:
determining the storage order of target data corresponding to the target tile in a corresponding target block file according to the geographic position of the target tile;
determining a target storage position according to the first type information, the second type information and the storage bit number in the target block file, wherein the target storage position is a storage position of the target data in the target block file;
and acquiring data on the target storage position in the target block file to obtain the target data.
In some embodiments provided by the present application, the apparatus further includes a blocking factor determining unit, configured to determine a target blocking factor according to a current network environment, where the target blocking factor is used to characterize a preset number N of target block files to be obtained.
On the basis of the foregoing, the process of sending, by the block file obtaining unit 22, a block file obtaining request including the target file name to a server, so that the server searches for a target block file stored by the server and corresponding to the target file name may include:
the block file obtaining unit 22 sends a block file obtaining request including the target file name and the target block factor to the server, so that the server searches for the target block file corresponding to the target file name in the directory corresponding to the target block factor.
In some embodiments provided herein, the block factor determining unit is further configured to determine the first parameter a and the second parameter b according to the target block factor, where the first parameter a and the second parameter b are positive integers.
On the basis of the above, the process of determining the target file name by the file name determining unit 21 according to the geographic locations of the target tiles may include:
for each target tile:
taking the line number of the target tile as a dividend, and taking the first parameter a as a divisor to carry out integer division to obtain a first quotient of the target tile;
taking the number of the columns of the target tiles as dividends, and taking the second parameter b as a divisor to perform integer division to obtain a second quotient of the target tiles;
determining the file name of a target block file to which the target tile belongs according to the layer number of the target tile, the first quotient of the target tile and the second quotient of the target tile;
and determining a target file name according to the file name of the target block file to which each target tile belongs.
In some embodiments provided by the present application, the apparatus may further include a cache determining unit, configured to determine, before the sending of the block file obtaining request to the server, whether the client caches the corresponding target block file according to the target file name, and determine, according to a result of the determination, an uncached target file name.
On the basis of the above, the process of sending, by the data obtaining unit 23, the block file obtaining request including the target file name to the server may include:
and sending a block file acquisition request containing the uncached target file name to a server.
According to the topographic image data acquisition device, the file name of the target block file to be acquired can be determined according to the geographical position of the target tile to be acquired, the target block file containing at least one target tile is acquired by sending a request to the server and receiving a corresponding response, then data extraction is carried out on each target tile file cached to the local, and the target data corresponding to each target tile is acquired, so that the topographic image data acquisition task is realized.
Based on the storage scheme and the acquisition scheme of the terrain image data provided by the application, a terrain/image data loading test is carried out at a browser end, and the test result is shown in table 1.
TABLE 1
Figure BDA0003961538140000181
Table 1 shows the time spent on loading terrain/image data at the browser end, comparing the recording times of data stored in the existing global subdivision mode and the block file storage mode provided by the present application, and according to the test result, the terrain image data storage scheme and the acquisition scheme provided by the present application can be applied to the current network environment, and the loading speed and performance of terrain image data at the client end can be improved under the limitation of unit request times and unit response times.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, the embodiments may be combined as needed, and the same and similar parts may be referred to each other.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (12)

1. A terrain image data storage method is applied to a server side, and comprises the following steps:
acquiring an original tile file to be stored;
grouping the original tile files according to geographic positions to obtain a plurality of data groups, wherein each data group comprises a plurality of original tile files;
for each of the data sets: and generating a block file according to each original tile file in the data group, generating a file name according to the geographical position of each original tile file in the data group, and storing the block file by using the file name.
2. The method of claim 1, wherein generating a block file from each of the original tile files in the data set comprises:
determining the number of each original tile file in the data group according to the geographical position of the original tile file;
generating a block file by using first type information, second type information and third type information which are sequentially arranged, wherein the first type information is the number of the original tile files in the data group, the second type information is data size information of each original tile file in the data group which is arranged according to the numbering sequence, the memory size occupied by the first type information and the data size information of each original tile file is a preset value, and the third type information is data content of each original tile file in the data group which is arranged according to the numbering sequence.
3. The method of claim 1 or 2, wherein prior to said geographically grouping said original tilefile, the method further comprises:
determining a preset number N according to a preset block factor, wherein the preset number N is the number of the original tile files contained in the block file to be generated;
grouping the original tile files by geographic location includes:
classifying the original tile files which meet a preset geographical position condition and do not exceed the preset number N into a data group;
the block file is stored under a directory corresponding to its block factor.
4. The method according to claim 3, wherein the preset number N = a × b, wherein the first parameter a and the second parameter b are positive integers set according to the block factor;
the grouping of the original tile files which meet the preset geographic position condition and do not exceed the preset number N into a data group comprises the following steps:
for each of the original tile files:
acquiring the number of layers, the number of rows and the number of columns of the original tile file, wherein the number of layers, the number of rows and the number of columns are used for representing the geographical position of the original tile file;
taking the line number of the original tile file as a dividend, and taking the first parameter a as a divisor to carry out integer division to obtain a first quotient of the original tile file;
taking the number of columns of the original tile file as dividends and taking the second parameter b as a divisor to carry out integer division to obtain a second quotient of the original tile file;
and grouping the original tile files with the same layer number, the same first quotient and the same second quotient into a data group.
5. The method of claim 4, wherein said generating a file name based on the geographic location of each of said original tile files in said data set comprises:
and generating a file name according to the layer number, the first quotient and the second quotient of the original tile file in the data group.
6. A topographic image data storage device comprising:
the tile obtaining unit is used for obtaining an original tile file to be stored;
the tile grouping unit is used for grouping the original tile files according to geographic positions to obtain a plurality of data groups, and each data group comprises a plurality of original tile files;
and the block file storage unit is used for generating a corresponding block file according to each original tile file in each data group, generating a corresponding file name according to the geographical position of each original tile file in each data group, and storing the corresponding block file according to the file name.
7. A topographic image data acquisition method applied to a client, for acquiring topographic image data stored based on the storage method of claim 1, the method comprising:
determining a target file name according to the geographic positions of a plurality of target tiles, wherein the target tiles are original tile files to be acquired;
sending a block file acquisition request containing the target file name to a server, so that the server searches a target block file which is stored by the server and corresponds to the target file name, and returning a response containing the target block file to the client;
caching the target block file in the response to the local according to the received response of the server;
extracting target data in the cached target block file, the target data being data corresponding to the target tile.
8. The method according to claim 7, wherein if the topographic image data stored according to the storage method of claim 2 is to be acquired, the extracting the cached target data in the target block file comprises:
for each of the target tiles to be obtained:
determining the storage order of target data corresponding to the target tile in a corresponding target block file according to the geographic position of the target tile;
determining a target storage position according to the first type information, the second type information and the storage bit number in the target block file, wherein the target storage position is a storage position of the target data in the target block file;
and acquiring data on the target storage position in the target block file to obtain the target data.
9. The method according to claim 7, wherein if the topographic image data stored according to the storage method of claim 3 is to be acquired, before the sending of the block file acquisition request including the target file name to the server, the method further comprises:
determining a target blocking factor according to the current network environment, wherein the target blocking factor is used for representing the preset number N of target block files to be acquired;
the sending a block file acquisition request including the target file name to a server for the server to search a target block file corresponding to the target file name, includes:
and sending a block file acquisition request containing the target file name and the target block factor to a server, so that the server searches a target block file corresponding to the target file name in a directory corresponding to the target block factor.
10. The method of claim 9, wherein if the topographic image data stored according to the storing method of claim 5 is to be acquired, after determining the target blocking factor according to the current network environment, the method further comprises:
determining the first parameter a and the second parameter b according to the target block factor, wherein the first parameter a and the second parameter b are positive integers;
determining a target file name according to the geographic locations of the plurality of target tiles, comprising:
for each target tile:
taking the line number of the target tile as a dividend, and taking the first parameter a as a divisor to carry out integer division to obtain a first quotient of the target tile;
taking the number of the columns of the target tiles as dividends, and taking the second parameter b as a divisor to perform integer division to obtain a second quotient of the target tiles;
determining the file name of a target block file to which the target tile belongs according to the layer number of the target tile, the first quotient of the target tile and the second quotient of the target tile;
and determining a target file name according to the file name of the target block file to which each target tile belongs.
11. The method of claim 7, wherein before sending the chunk file acquisition request to the server, the method further comprises:
judging whether the client caches a corresponding target block file or not according to the target file name;
determining the target file name which is not cached according to the judgment result;
the sending of the block file acquisition request including the target file name to the server includes:
and sending a block file acquisition request containing the uncached target file name to a server.
12. A topographic image data acquisition apparatus for acquiring topographic image data stored based on the storage method of claim 1, the apparatus comprising:
the file name determining unit is used for determining a target file name according to the geographic positions of a plurality of target tiles, wherein the target tiles are original tile files to be acquired;
a block file obtaining unit, configured to send a block file obtaining request including the target file name to a server, so that the server searches for a target block file stored by the server and corresponding to the target file name, returns a response including the target block file to a client, and caches the target block file in the response to the local according to the received response of the server;
and the data acquisition unit is used for extracting target data in the cached target block file, wherein the target data is data corresponding to the target tile.
CN202211480918.1A 2022-11-24 2022-11-24 Terrain image data storage and acquisition method and device Pending CN115865896A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211480918.1A CN115865896A (en) 2022-11-24 2022-11-24 Terrain image data storage and acquisition method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211480918.1A CN115865896A (en) 2022-11-24 2022-11-24 Terrain image data storage and acquisition method and device

Publications (1)

Publication Number Publication Date
CN115865896A true CN115865896A (en) 2023-03-28

Family

ID=85665729

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211480918.1A Pending CN115865896A (en) 2022-11-24 2022-11-24 Terrain image data storage and acquisition method and device

Country Status (1)

Country Link
CN (1) CN115865896A (en)

Similar Documents

Publication Publication Date Title
CN107515901B (en) Chain log storage structure and hash index structure thereof, data operation method, server and medium
US8745080B2 (en) Server geospatially organized flat file data
US6754800B2 (en) Methods and apparatus for implementing host-based object storage schemes
US8099421B2 (en) File system, and method for storing and searching for file by the same
CN107562757B (en) Query and access method, device and system based on distributed file system
CN108011929A (en) Data request processing method, apparatus, computer equipment and storage medium
CN102164160B (en) Method, device and system for supporting large quantity of concurrent downloading
CN107197359B (en) Video file caching method and device
CN112100185B (en) Indexing system and method for block chain data balance load
CN102446139A (en) Method and device for data storage
CN104539750A (en) IP locating method and device
CN1581114A (en) Analysis method for user's request
CN111159219A (en) Data management method, device, server and storage medium
CN109299111A (en) A kind of metadata query method, apparatus, equipment and computer readable storage medium
CN108319634B (en) Directory access method and device for distributed file system
US9779543B2 (en) Method for providing and receiving information representing physical features of a portion of a three dimensional surface
CN108920613A (en) A kind of metadata management method, system and equipment and storage medium
CN1545047A (en) Metadata hierarchy management method and system of storage virtualization system
CN115865896A (en) Terrain image data storage and acquisition method and device
CN110633053B (en) Storage capacity balancing method, object storage method and device
CN113905252B (en) Data storage method and device for live broadcasting room, electronic equipment and storage medium
US8028011B1 (en) Global UNIX file system cylinder group cache
US6412054B1 (en) Storage disk declustering method
CN111966853B (en) Management method of remote sensing image
CN104639570A (en) Resource object storage processing method and device

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