电子设计工程
Electronic Design Engineering
第26卷
Vol.26
第2期
No.2
2018年1月
Jan. 2018
收稿日期:2017-02-14 稿件编号:201702043
作者简介:许清媛(1986—),女,江西赣州人,硕士,讲师。研究方向:智能系统与智能应用,计算机信息处理。
随着智能手机的普及以及移动互联网的迅猛发
展,比起传统的 PC,移动娱乐和移动学习越来越受
欢迎,移动应用软件的开发也更热门。目前,最常见
的 移 动 开 发 平 台 主 要 有 Android,iPhone 以 及
Windows Phone,但无论从全球还是国内使用范围来
看,搭载 Android 移动操作系统的移动终端设备数量
都占据绝对的优势
[1]
。
移动开发者为了在 APP 中给用户提供丰富的内
容,往往需要大量的数据。网络爬虫是一种自动下
载网络资源的程序,是搜索引擎的基础构件之一
[2-3]
。
而 LeanCloud 是一个云端数据存储平台,提供多种版
本开发语言给用户存储数据,用户通过控制台可视
化看到存在云端的数据。本文的技术方案是:首先
通过 Jsoup 网络爬虫抓取移动开发需要的海量数据,
然后运用 LeanCloud 的 LeanStorage 服务,将 Jsoup 网
络爬虫框架抓取的网页数据进行筛选、过滤和封装,
然后上传到 LeanCloud 云端保存,再开发 APP 端直接
通过 LeanCloud 提供的一系列 API(应用程序编程接
口,Application Programming Interface)对数据进行访
问,可大大节省 APP 用户流量和加载等待时间。因
为上传云端的数据都是经过筛选的,并不需要用户
在 APP 上加载 整个网 页数据
[4]
,从 而软件 响应速 度
快。该技术为移动开发提供了一种通用技术方案,
通过此方案抓取不同的数据信息,则可开发出不同
的应用软件,本文以双语阅读应用软件为例。
电子翻译工具 、英 语学习平台 、Internet 在 线翻
译浏览器的应用对于英语水平不高且又需要了解外
基于爬虫和 LeanCloud 数据存储的双语阅读平台设计
许清媛,刘韦声
(中山大学 南方学院,广东 广州 510970)
摘要:针对移动开发者在移动应用开发的过程中,经常需要用到大量数据信息的问题,提出一种利
用爬虫技术获取网络上的数据,并结合 LeanCloud 进行数据存储,从而为开发者提供海量数据的技
术方案。Jsoup 是用 Java 语言开发的知名度较高的 Java 第三方类库,已经成为 Java 爱好者解析 HTML
文档的首选之一,并被广泛用于网络爬虫抓取海量网络数据。文中以 Android 双语阅读平台为例,
通过 Jsoup 网络爬虫抓取网络数据和 LeanCloud 进行数据存储开发了一款 Android 双语阅读平台,
软件响应速度快、信息处理速度快。
关键词:Jsoup 网络爬虫;LeanCloud 数据存储;移动开发;双语阅读
中图分类号:TN99 文献标识码:A 文章编号:1674-6236(2018)02-0035-04
Design of bilingual reading platform based on crawler and LeanCloud data storage
XU Qing⁃yuan,LIU Wei⁃sheng
(Nanfang College of Sun Yat⁃sen University,Guangzhou 510970,China)
Abstract: Since large amounts of data and information are needed in the mobile application development
process,a technique method is proposed for developers to get massive data,which obtains the data using
crawler technology and uses LeanCloud for data storage on network. Jsoup,which developed using Java
program technology,has received high visibility in the third party Java class library. And as one of the
first choice for the analysis of HTML documents,Jsoup is widely used in web crawler to grab massive
network data. In this paper,taking Android bilingual reading platform for example,an Android bilingual
reading platform is developed based on the data crawled by Jsoup crawler and stored by LeanCloud. Fast
response and high speed of information processing are achieved in this designed software.
Key words: Jsoup crawler;LeanCloud data storage;mobile development;bilingual reading
-- 35