测绘通报 ›› 2021, Vol. 0 ›› Issue (8): 162-165.doi: 10.13474/j.cnki.11-2246.2021.0263

• 测绘地理信息技术应用案例 • 上一篇    

基于MongoDB的空间搜索引擎设计及优化方法

潘国富   

  1. 广州市中海达测绘仪器有限公司, 广东 广州 511400
  • 收稿日期:2021-04-30 出版日期:2021-08-25 发布日期:2021-08-30
  • 作者简介:潘国富(1984-),男,硕士,高级工程师,主要从事高精度卫星导航产品设计及开发工作。E-mail:85476393@qq.com

The mehod of design and optimization of spatial search engine based on MongoDB

PAN Guofu   

  1. Guangzhou Hi-Target Navigation Tech Co., Ltd., Guangzhou 511400, China
  • Received:2021-04-30 Online:2021-08-25 Published:2021-08-30

摘要: 本文介绍了非关系型数据库MongoDB的空间查询功能,针对海量用户并发服务的应用场景,提出了一种空间近邻信息查询引擎的优化策略。该策略根据短时间内空间数据内容变化较小及相邻位置搜索结果相似度高的特征,利用格网化机制实现在等效查询结果前提下数据库操作次数减少;同时利用内存缓冲机制减少磁盘I/O读写次数,从而显著提高系统的并发数及查询速度。测试结果表明,在相同硬件设施条件下,优化后搜索引擎的效率比原生系统提高了近50倍。

关键词: 空间查询, 非关系型数据库, MongoDB, 位置服务

Abstract: This paper introduces the spatial query capabilities of MongoDB, which is No-SQL database, and proposes an optimization strategy of the spatial query engine for application scenarios with large concurrent services of massive users. According to the characteristics of little change in content in a short time and high similarity of search results in adjacent locations, this strategy uses a gridstrategy to reduce the number of database operations under the premise of equivalent query results, and uses a memory buffer strategy to reduce disk I/O reading and writing times, thereby improving the concurrency and query speed of the service system. Tests results show that under the same hardware facilities, the optimized search engine efficiency is nearly 50 times higher than that of the original system.

Key words: spatial index, No-SQL, MongoDB, location-based service

中图分类号: