An R-tree index remote sensing data storage model
Through the combination of R-tree index technology, HDFS and MongoDB, the cross-database classification storage and efficient query of remote sensing data are realized, solving the storage and query problems of massive remote sensing data, providing a low-cost, highly scalable solution, and improving Improves storage and query efficiency.
Patent Information
- Application Number
- CN202110910728.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-09
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2041-08-09
AI Technical Summary
Existing remote sensing data storage technology suffers from high storage costs, poor user experience, and problems of fast storage and accurate query across multiple distributed storage systems. In particular, there is a lack of effective solutions for efficient management and query of massive remote sensing data.
It uses R-tree index technology combined with HDFS and MongoDB distributed storage systems to achieve cross-database classification storage and efficient query of remote sensing data through file classification algorithms, multi-level index creation and index caching mechanisms, providing low-cost and highly scalable storage. Model.
It improves the storage efficiency and query speed of massive remote sensing data, reduces the number of NameNode requests and query time, is suitable for mixed storage scenarios of large files and small files, and provides an efficient and fast storage and management solution.
Smart Images

Figure CN113722274B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of remote sensing data storage, and in particular to an R-tree index remote sensing data storage model. Background Art
[0002] With the continuous development of remote sensing technology, the storage scale of remote sensing data is also increasing. The remote sensing data of a single scene has reached the GB level and is still increasing. Overall, remote sensing data shows a trend of continuous growth in the amount of individual data and huge overall data scale. Traditional remote sensing data storage technology can no longer meet the current development needs due to various problems such as high storage costs and poor user experience; therefore, the storage of remote sensing data is an important factor affecting the development of remote sensing technology.
[0003] Using a distributed file storage system is a solution to this problem. The distributed file system solves the storage problem of massive remote sensing data. However, there is a big difference in the storage efficiency of different distributed storage systems for data files of different sizes. Distributed file storage systems can be roughly divided into two categories:
[0004] The first type is a traditional distributed file storage system. This type of storage system usually divides large files into small file blocks and then stores each small file. It uses the Hadoop distributed file system to store spatial data. This method improves data query performance based on coding technology and improves data balance in HDFS. It applies cloud computing technology to geographic information systems and uses Hadoop to implement a storage and management system for remote sensing data. It effectively processes remote sensing data and improves the storage management efficiency of remote sensing data. However, HDFS is more suitable for the storage of large data files and cannot meet the storage problem of small files in remote sensing data. When remote sensing data contains too many small data files, it will take up too much memory and increase the burden on the master node. This type of distributed file system is suitable for the storage of massive large files, and the storage of small files will consume more storage space and storage access time.
[0005] The second type of distributed storage system for massive small files aims at the storage characteristics of unstructured data, and proposes a high-availability distributed storage system based on optimized cluster MongoDB, which can not only enhance the availability of data, but also improve the scalability of the server; et al. use MongoDB to store unstructured data to address the problem of data model changes, and in order to obtain better performance, define strategies for the degree of normalization and embedding to reduce query execution time. Compared with HDFS, MongoDB is more suitable for the storage of small amounts of unstructured data. This type of storage system is mainly designed for the storage of massive small files. It is a highly available, high-performance, and easily scalable distributed file system. Its disadvantage is the lack of storage management solutions for large files.
[0006] Remote sensing data processing usually uses multiple distributed file storage systems. When processing remote sensing data, it is usually necessary to split the remote sensing data of a single scene into small files containing markers, and then split these small files again according to the plot location information or marker features to form smaller remote sensing data files with characteristic attributes. During the remote sensing data processing, many small file data will be generated. The small files in HDFS are classified using correlation analysis, and the related small files are merged into a large file for storage to effectively reduce the load of the NameNode and improve the storage and access efficiency of a large number of small files on HDFS. The small files are classified by correlation analysis, and different storage solutions are established for the three different types of classified files to achieve efficient storage and reading of small files. Establishing a small file storage strategy and classifying remote sensing data into different distributed storage systems can solve the problems of excessive storage space and low storage efficiency. Therefore, it is particularly important to develop an efficient distributed file storage model that combines large files and small files.
[0007] In addition, although the distributed storage technology of remote sensing data has developed rapidly, there is a lack of an appropriate method to achieve fast storage and accurate query of remote sensing data across multiple distributed storage systems; fast and accurate retrieval of remote sensing data for multiple distributed storage systems is also an urgent problem to be solved; the solution for storage and retrieval across multiple distributed storage systems is to establish indexes, retrieve data through indexes, and give responses after integration. This method will generate too much index data to occupy storage space, and the process of integrating responses will consume too much time; et al. proposed domain indexing, which is a new type of index structure for efficiently querying data domains across multiple repositories. Domain indexing provides a feasible method for multiple database linkage queries, but For the distributed storage of unstructured remote sensing data, it is necessary to ensure the query performance. This paper explains how the choice of the underlying index structure affects the performance of different query operations, and shows that the methods used to build indexes and the dynamic characteristics of the data set have a significant impact on the performance of these index structures. According to the spatial characteristics of remote sensing data and the mutuality between remote sensing data, we choose a multi-dimensional index structure: R-tree is the most popular index method for spatial query, which can better reflect the advantages of multi-dimensional query in cross-distributed system storage. et al. proposed a new spatial clustering algorithm and R-tree insertion algorithm. The comparative analysis of spatial index performance shows that the new method greatly reduces the overlap of R-tree brother nodes and maintains the balance of the number of nodes. The amount of index information will continue to increase with the increase of stored data. In order to query data more quickly, it is necessary to cache index data. The index buffer based on GIP+ is designed to store index information to reduce the cost of insertion and search, and the data in the cache area is changed at the user's customized access time to reduce the cost of query. Summary of the invention
[0008] The problem solved by the present invention is to provide an R-tree index remote sensing data storage model, realize cross-database classified storage of remote sensing data based on two distributed storage technologies of HDFS and MongoDB, build index information of remote sensing data based on R-Tree index technology, and realize efficient storage and fast query of massive remote sensing data by using cache technology. The purpose is to solve the data storage problem in the remote sensing data processing process, provide a low-cost, highly scalable storage model across multiple distributed storage systems, provide efficient, fast and easy-to-operate solution for massive remote sensing data storage and query, and provide a technical basis for the storage and management of massive remote sensing data.
[0009] In order to achieve the above object, the present invention adopts the following technical solutions:
[0010] An R-tree index remote sensing data storage model, the specific operation steps of the model are as follows:
[0011] Step 1: File classification algorithm;
[0012] Step 2: Establishment of primary index;
[0013] Step 3: File merging;
[0014] Step 4: Establishment of secondary index;
[0015] Step 5: Index cache.
[0016] Preferably, the specific operation steps for establishing the primary index are as follows: the remote sensing data is classified according to certain rules before storage, which can effectively improve the storage efficiency. According to the storage characteristics of HDFS and MongoDB, experiments are designed to determine the best storage solutions for the two distributed storage systems, MongoDB and HDFS. The storage efficiency of HDFS and MongoDB for files with different data volumes is compared and analyzed through experiments to determine the file classification algorithm with the highest storage efficiency.
[0017] Preferably, the specific operation steps for establishing the primary index are: using two distributed storage technologies, HDFS and MongoDB, to realize the storage of remote sensing data; after file classification, files of different levels need to be stored in different databases; establishing a primary index structure; determining the specific storage locations of files of different levels; improving the speed of data retrieval; and ensuring the security and uniqueness of data.
[0018] Preferably, the specific operation steps of the file merging are as follows: when uploading a file to HDFS, determine whether the file is larger than the data block size. When the file is larger than the data block size, the file will be directly stored in the database. When the file is smaller than the data block size, if it is directly stored in the database, it will occupy a large amount of storage space according to the file block size. By merging and storing small files through the file merging method, the data storage space can be reduced and the memory pressure of the NameNode can be alleviated, thereby improving the access efficiency of remote sensing data.
[0019] Preferably, the specific operation steps for establishing the secondary index are as follows: the establishment of the secondary index is mainly used to determine the storage location after the small files are merged, and by establishing a temporary merged storage file and an index table, the small files can be read quickly.
[0020] Preferably, the specific operation steps of the index cache are as follows: when the file data continues to increase, the total size of the index also increases, and the query time when retrieving data will increase accordingly. The index cache mechanism can effectively reduce the query time and increase the retrieval efficiency.
[0021] The beneficial effects of the present invention are: using the file classification method, the storage model of the CR-tree based on the R-tree index, through the experiment and analysis of the storage characteristics of remote sensing data, the remote sensing data is scientifically and effectively classified through the file classification method, and the storage efficiency of the storage model of this study is improved. An optimized multi-level index model based on the R-tree index is established, and a multi-level index mechanism is established for the classified remote sensing data. The accurate retrieval of remote sensing data is further realized through the index cache strategy, which reduces the number of requests to the NameNode when storing massive remote sensing data, and saves the time required for file retrieval;
[0022] The efficient storage solution for small files merges and stores small remote sensing data files, and efficiently and quickly stores and queries small files by establishing file indexes. The storage model studied in this paper improves the storage efficiency and query efficiency of massive remote sensing. When the number of files gradually increases, the storage advantage of the storage model of this study gradually becomes obvious. In addition, this study did not adopt parallel storage. The next step can be to consider using parallel storage to further improve storage efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 It is a flow chart of the present invention;
[0024] Figure 2 This is a structural diagram of the model of the present invention;
[0025] Figure 3 It is a primary index table diagram of the present invention;
[0026] Figure 4A storage structure diagram for the present invention;
[0027] Figure 5 It is a secondary index table diagram of the present invention;
[0028] Figure 6 It is a LRU algorithm diagram based on a hash table and a bidirectional linked list of the present invention;
[0029] Figure 7 The index query flow chart of the present invention;
[0030] Figure 8 This is a storage time diagram of HDFS and MongoDB under different data of the present invention;
[0031] Fig. 9 It is the efficiency statistical diagram of the present invention;
[0032] Fig.10 It is a storage time comparison diagram of the present invention;
[0033] Fig.11 It is the efficiency statistical diagram of the present invention;
[0034] Fig.12 This is a query speed comparison diagram of the present invention;
[0035] Fig.13 This is a diagram showing the efficiency improvement of the present invention;
[0036] Fig.14 It is the calculation formula diagram of the present invention. DETAILED DESCRIPTION
[0037] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0038] Specific examples are given below.
[0039] See also Figure 1 , an R-tree index remote sensing data storage model, the specific operation steps of the model are as follows:
[0040] Step 1: File classification algorithm. Remote sensing data is classified according to certain rules before storage, which can effectively improve storage efficiency. According to the storage characteristics of HDFS and MongoDB, an experiment is designed to determine the best storage solution for the two distributed storage systems, MongoDB and HDFS. The storage efficiency of HDFS and MongoDB for files with different data volumes is analyzed through experiments to determine the file classification algorithm with the highest storage efficiency.
[0041] Step 2: Establishment of the primary index. Use HDFS and MongoDB, two distributed storage technologies, to store remote sensing data. After file classification, files of different levels need to be stored in different databases. Establish a primary index structure to determine the specific storage locations of files of different levels, improve the speed of data retrieval, and ensure data security and uniqueness.
[0042] Step 3: File merging. When uploading a file to HDFS, determine whether the file is larger than the data block size. If the file is larger than the data block size, the file will be directly stored in the database. If the file is smaller than the data block size, if it is directly stored in the database, it will take up a lot of storage space according to the file block size. By merging small files and storing them together, data storage space can be reduced and the memory pressure of NameNode can be alleviated, thereby improving the access efficiency of remote sensing data.
[0043] Step 4: Establish a secondary index. The establishment of a secondary index is mainly used to determine the storage location after the small files are merged. By establishing a temporary merged storage file and an index table, small files can be read quickly.
[0044] Step 5: Index cache. As file data continues to grow, the total size of the index also increases, and the query time when retrieving data will increase accordingly. The index cache mechanism can effectively reduce the query time and increase the retrieval efficiency.
[0045] The role of file classification mainly includes two parts: through pre-classification of files, the storage model of this study can achieve the highest storage efficiency, and the classified data is convenient for indexing.
[0046] Remote sensing data is classified into three levels mainly by the size of the stored files. According to the storage characteristics of MongoDB and HDFS, corresponding experiments are designed to find out the file size range most suitable for MongoDB storage and the file size most suitable for HDFS. Based on the default file block size of HDFS being 128M, the files are divided into three categories, and the file size with the highest storage efficiency of small files in MongoDB is set to X. File classification rules are designed, and files of different levels will be indexed and stored in different databases.
[0047] The pseudo code of the file classification algorithm is as follows:
[0048]
[0049]
[0050] The idea of the R-tree spatial index model will be used to classify files with different data volumes and to implement spatial indexing by establishing multi-level indexes.
[0051] The model structure is as follows Figure 2 ;
[0052] (1) The first-level index table is as follows Figure 3 As shown in the figure, a unique ID is randomly generated when a file is stored to identify the file. The file_name field indicates the file name, the storage_location field indicates the storage location of the file, which is divided into HDFS or MongoDB, the update_time field indicates the last modification time of the file, and the field_level field indicates the level of the file after file classification.
[0053] In order to optimize the storage efficiency of small files in HDFS, small files stored in HDFS are merged and stored. When remote sensing data files are stored, if the file size is smaller than the data block size, a temporary file will be created to store small files, and the established secondary index table will be used to store the index information of small files. The storage structure is as follows: Figure 4 As shown:
[0054] Temporary files are used to store merged small files. The location information of small files in temporary files is stored in the index table. The starting position of small files is determined by the file offset offset in the index table. The entire data of the file is obtained through the file size file_size to implement the indexing of small files.
[0055] (2) The secondary index table is as follows Figure 5 As shown in the figure, the secondary index table is mainly used to solve the problem of merging and storing small files. The tempfile_id field in the table indicates the ID of the temporary file after multiple small files are combined, the tempfile_name field indicates that the name of the temporary file is usually named after the creation time, the file_name field indicates the name of the stored small file, the file_size field indicates the size of the file data, the offset field indicates the offset when the small files are merged and stored, and the update_time field indicates the last modification time of the file.
[0056] Remote sensing data can be classified and stored according to the size of the file data. By establishing indexes at different levels, the files can be effectively stored and managed, which enables fast query of remote sensing data. According to the characteristics of the storage model studied in this paper, index optimization is performed to improve the storage efficiency and reading efficiency of remote sensing data.
[0057] As the number of stored files increases, the amount of indexed data also increases, and the query efficiency decreases when performing file queries. Caching technology can effectively reduce query time. By analyzing the real-time storage characteristics of agricultural remote sensing data, the LRU strategy of the longest recent access will be adopted. That is, when a data file has not been accessed recently, it is unlikely to be accessed in the future. Based on the above cache strategy, this paper designs an LRU algorithm based on hash tables and bidirectional linked lists. Figure 6 :
[0058] The cache will use a hash table to store the file name, the value is the node in the linked list, the node stores the file index, the order of the nodes is recorded through a doubly linked list, and the most recently accessed node is the Head;
[0059] When a file is stored, the key value in the hash table is set. If the file name in the hash table does not exist, a new node is created. If the length of the linked list exceeds the limit, the last node at the tail is removed and replaced with a new node. If the node is stored, the node value is updated and the node is placed at the head of the linked list.
[0060] When searching for a file, first search for the key value in the cache. If the key value exists, retrieve the corresponding index data and move the corresponding node to the head of the linked list.
[0061] The index query process is as follows Figure 7 :
[0062] When reading remote sensing data, first check whether there is a corresponding file name in the cache. If there is, directly search for the file according to the index value. Otherwise, enter the MongoDB primary index table according to the file name to find the storage location of the file. If the data is stored in the MongoDB database, it can be determined that the stored file is a small file and directly retrieved through the secondary index table. If the data is stored in HDFS, the file size is determined by judging the file level. Large files are directly retrieved in HDFS. Small files are found through the secondary index table to find the temporary file where the small file is stored, and the file is retrieved by file offset and file size.
[0063] Through the query process, it can be seen that in the process of file retrieval, the RPC request time of NameNode is reduced. Through the established index model, the retrieval request is directly sent to the storage node, which saves the internal request and waiting time of the database and improves the efficiency of file query.
[0064] 1. Comparison of small file storage efficiency between HDFS and MongoDB
[0065] The file size of HDFS is usually in the GB to TB level. Therefore, HDFS is designed to support the storage of large files. When storing data smaller than the HDFS block size, HDFS will also store it according to the block size, which increases the storage space and also affects the access efficiency.
[0066] MongoDB is a product between relational databases and non-relational databases. It uses efficient binary data storage and automatically handles data fragmentation to achieve efficient data storage.
[0067] The experiment designs the optimal storage model by analyzing the efficiency of two distributed databases, HDFS and MongoDB, in storing small files.
[0068] Experimental protocol:
[0069] (1) Select a data set from the test data set that is smaller than the HDFS block size;
[0070] (2) Select 5 sets of test data with different numbers of sets, 100, 500, 1000, 5000, and 10000, from the re-selected test set, and record the storage time of different test data sets. Figure 8 ;
[0071] Based on the test results of HDFS and MongoDB storage time in the figure above, we can get the following through efficiency calculation formula 1: Fig. 9 The results:
[0072] The graph and table show that MongoDB has a higher storage efficiency for small files when the amount of data is the same. When using small files of different orders of magnitude, the efficiency improvement of using MongoDB database compared to HDFS shows a trend of first increasing and then decreasing. When there are 1,000 files, the efficiency improvement reaches 86.2%. In general, MongoDB is more suitable for the storage of small files than HDFS.
[0073] 2. Storage
[0074] In order to verify the difference in file storage speed between the CR-tree storage model in this paper and the original HDFS, 5 groups of test data were selected and stored in the original HDFS storage system and the heterogeneous database using the CR-tree storage model. Each group of test data was stored 3 times, and the storage time was recorded and the average value was taken. Fig.10 :
[0075] The experimental results show that the storage speed of the CR-tree storage model in this study is better than that of the original HDFS. According to the efficiency calculation formula 1, we can get the following: Fig.11 Result;
[0076] When the number of files is small, the number of large and small files is relatively balanced. Both storage models need to send requests to the NameNode node. Although the number of CR-tree requests to the NameNode is far less than that of the original HDFS, the storage time of the two is similar. As the number of files gradually increases, the advantages of the HM storage model gradually emerge. When the number of files is 300,000, the storage speed of the CR-tree storage model is much faster than that of the original HDFS. Therefore, it can be concluded from the experimental results that as the number of stored files gradually increases, the gap between the CR-tree storage model and the native HDFS gradually increases, and the storage advantage becomes more obvious. When the number of files reaches 300,000, the storage efficiency is improved by 39%.
[0077] 3. Search
[0078] In order to verify the difference in data query speed between the HM model of this study and the original HDFS, 5 groups of test data were selected from the test data and stored in HDFS and the HM heterogeneous database of this study respectively. Ten files were randomly selected from each group of test data for query operation, and the average value of 10 times was taken as the final query time;
[0079] The results are as follows Fig.12 As shown:
[0080] By using the efficiency calculation formula 1, we can get Fig.13 Result;
[0081] The experimental results show that since this study uses the CR-tree model based on the R-tree spatial index, the classified files are pre-indexed, and the merged small files are indexed. The number of requests to the NameNode is reduced when retrieving remote sensing data files, and the files are directly queried from the index, saving query time. Therefore, the query speed of the HM storage model in this study is better than the query speed of the original HDFS. In addition, when the number of files continues to increase, the query advantage of the solution in this study is more obvious. When the number of files reaches 300,000, the query efficiency is improved by 64.4%.
[0082] Calculate formulas 1, 2 and 3 as follows Fig.14 :
[0083] Formula (1) calculates the average execution time, formula (2) calculates the storage rate, and formula (3) calculates the improvement efficiency.
[0084] In formula (1), Tend is the end time of command execution, Tstart is the start time of command execution, n is the number of executions of the same experiment, and Tavg is the average execution time. In order to reduce experimental errors, the same experiment was conducted multiple times, and the value of Tavgis was calculated by averaging multiple results;
[0085] In formula (2), v represents the storage rate, p represents the total amount of data, and t represents the total storage time;
[0086] In formula (3), ρ is the improvement efficiency, and Tb and Ta are the storage times of the two methods.
[0087] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. An R-tree index remote sensing data storage model, characterized in that: The specific operation steps of this model are as follows: Step 1: File classification algorithm. Remote sensing data is classified according to certain rules before storage, which can effectively improve storage efficiency. According to the storage characteristics of HDFS and MongoDB, an experiment is designed to determine the best storage solution for the two distributed storage systems, MongoDB and HDFS. The storage efficiency of HDFS and MongoDB for files with different data volumes is analyzed through experiments to determine the file classification algorithm with the highest storage efficiency. Step 2: Establishment of primary index; Step 3: File merging; Step 4: Establishment of secondary index; Step 5: Index cache; The specific operation steps of establishing the primary index are as follows: using two distributed storage technologies, HDFS and MongoDB, to realize the storage of remote sensing data. After the files are classified, files of different levels need to be stored in different databases, and a primary index structure is established to determine the specific storage locations of files of different levels; the specific operation steps of merging files are as follows: when uploading a file to HDFS, it is determined whether the file is larger than the data block size. When the file is larger than the data block size, the file will be directly stored in the database. When the file is smaller than the data block size, if it is directly stored in the database, a large amount of storage space will be occupied according to the file block size. The small files are merged and stored by the file merging method; The specific operation steps for establishing the secondary index are as follows: the establishment of the secondary index is used to determine the storage location after the small files are merged; the specific operation steps for the index cache are as follows: when the file data continues to increase, the size of the total index also increases, and the query time when retrieving data will increase accordingly. The query time is reduced through the index cache mechanism.
Citation Information
Patent Citations
Hadoop-based mass classifiable small file association storage method
CN102332029A
Multi-dimensional interval query method and system based on cloud computing
CN103678520A
System and method for optimizing small file access of HDFS
CN107045531A
Method and device for merging small files in cloud storage
CN107168802A
Method and system for storing remote sensing data on basis of distributed file systems
CN107423431A
