您好, 访客   登录/注册

一种基于大数据架构的地震科普资源库的设计和开发

来源:用户上传      作者:刘勇 赵军 张乐

  摘  要:当今时代,愈发庞大的数据难以有效处理运用和管理,需要一种更加合适的资源获取处理方式。该文基于大数据架构结合网络爬虫、数据清洗、信息检索等前沿技术,设计开发了地震科普知识资源库系统。其中运用了J2EE、Python、Hadoop、Elasticsearch、MySQL等技术。通过网络爬蟲和人工上传的方式采集地震科普相关信息资源,经过数据清洗转换后对信息资源进行自动分类,最后将资源上传至资源库hdfs分布式文件系统并将文件信息保存至Elasticsearch分布式文件索引系统,由此实现大数据架构下的全文检索。同时,建立资源库的后台管理系统,用于网站的日常管理和维护。相比以前的集群文件系统更加高速便捷、更加的安全稳定。
  关键词:大数据  Hadoop  Elasticsearch  MySQL  Python
  Abstract: In today's era, the increasingly large data is difficult to effectively handle the application and management, and a more appropriate resource acquisition and processing method is needed. Based on the big data architecture combined with web reptile, data cleaning, information retrieval and other cutting-edge technologies, this paper designs and develops the seismic science knowledge resource database system. It uses technologies such as J2EE, Python, Hadoop, Elasticsearch, and MySQL. The seismic science related information resources are collected by means of web crawling and manual uploading, and the information resources are automatically classified after data cleaning and conversion, and finally the resources are uploaded to the resource library hdfs ,distributed file system, and the file information is saved to the Elasticsearch ,distributed file index. So the system enables full-text retrieval under the big data architecture. At the same time, the background management system of the resource library is established for daily management and maintenance of the website. It is more convenient and safer than the previous cluster file system.
  1  科普知识资源库的建设现状
  1.1 资源库数据时效性低
  一些资源在采集时没有考虑到数据资源的不断更新性特征,数据资源缺乏时代性和建设性,造成数据库的资源质量低[1]。
  1.2 资源库数据利用率低
  由于资源库的建设缺乏先进的理念和技术架构,造成各类资源库分散在不同的系统中,数据资源的整合缺乏层次性和规律性,整体上体现出综合性差。在使用搜索功能时,一切与搜索目标相关的资源都会呈现出来,但是这些资源,衡量的标准、规划的层次不统一,造成实际应用中的搜索难度大,利用率低。
  1.3 资源库数据冗杂质量低
  为了提高资源库的可用性和有效性,在资源库的建设中,往往采用大批量、大规模资源采购的方式,希望能够提高资源的应用水平。但是在实际应用中,这些采购的资源观点重复、模式相仿、形式单一,甚至有些存在明显的学术性错误,资源库的整体数量较多但是质量较低,无法有效地服务于用户。
  2  地震科普资源库的架构
  地震科普资源库是通过网络爬虫和人工上传两种方式进行数据采集并将记录保存至数据库中,然后对采集到的数据进行数据清洗,清洗之后根据既有分类标准将资源划分到对应的类别,最后,将文件上传至HDFS中,同时将资源信息保存至Elasticsearch中,以便用户进行全文检索和资源下载,资源库的整体架构如图1所示。
  3  地震科普资源库的功能模块
  3.1 数据采集
  数据采集分人工上传和网络爬虫两种,使用爬虫抓取数据可以提高数据采集的效率。网络爬虫会根据给定网址进行爬取,通过spiderkeeper对爬虫进行管理。该文运用spiderkeeper配合scrapyd管理爬虫,支持一键式部署、定时爬取任务、启动、暂停等一系列的操作。
  3.2 数据处理
  由于爬取的数据或上传的数据存在重复或不符合资源库的需求等问题,因此需要对资源进行清洗,将不符合要求的资源过滤掉。该文通过计算文本内容的相关度,将那些内容相关度低的资源过滤掉。数据清洗整体流程如图2所示。
转载注明来源:https://www.xzbu.com/8/view-15189560.htm