登录

  • 登录
  • 忘记密码?点击找回

注册

  • 获取手机验证码 60
  • 注册

找回密码

  • 获取手机验证码60
  • 找回
毕业论文网 > 毕业论文 > 电子信息类 > 通信工程 > 正文

基于JAVA的分布式爬虫设计与实现毕业论文

 2021-03-01 01:03  

摘 要

随着互联网的快速发展,网络上的信息以惊人的速度增长,同时各种新型技术移动互联网,大数据、云计算、人工智能的逐渐成熟。作为采集数据的重要方式的web爬虫也需要迎接新的挑战。国内外的大公司像各大搜索引擎服务商已经做出了很成熟的爬虫,但是都是针对搜索引擎设计,且不可定制。本文的目的在于设计一个针对特定需求的垂直型的分布式爬虫。

本文主要研究了分布式爬虫系统的基本原理,设计并实现了一个基于redis缓存数据库的分布式网络爬虫。本文结合webmagic爬虫框架,设计了针对特定网页解析的包装器。研究了爬虫去重策略,并给出了最优解决方案,利用布隆过滤器去重,且给出了具体实现。同时对于分布式里的单个爬虫支持多线程爬取。论文还研究了词向量的应用,在爬取的数据基础上,利用word2vec文本分析工具对文本完成分析工作。

本文利用java语言实现了全部功能,成功爬取了目标网站的指定数据,没有出现重复数据,说明去重效果良好,且实现了多客户端的分布式爬取,能够提高爬行效率。

关键字:分布式爬虫;布隆过滤;词向量;redis

Abstract

With the rapid development of the Internet, the information on the network at an alarming rate of growth, while a variety of new technology mobile Internet, large data, cloud computing, artificial intelligence gradually mature. As an important means of gathering information, web crawlers are also facing new challenges. Large companies at home and abroad for the reptile has a very mature solution, but are designed for search engines, and can not be customized. The purpose of this paper is to design a vertical type of distributed crawler for a specific requirement.

This paper mainly research the basic principle of distributed reptile system, designs and implements a distributed web crawler based on redis cache database. This paper combines the webmagic crawler framework to design a wrapper for specific web page parsing. The rehearsal strategy is studied, and the optimal solution is given, which is deduced by Blooming filter, and the concrete realization is given. While supporting multi-threaded crawling for a single crawler in the distribution. The paper also studies the application of word vector. Based on the data of crawling, the word2vec text analysis tool is used to analyze the text.

In this paper, the use of java language to achieve all the features, successfully crawled the target site of the specified data, there is no duplication of data, indicating that the heavy effect is good, and to achieve a multi-client distributed crawl, can improve the crawling efficiency.

Keywords: distributed crawler; bloom filter; word vector; redis

目 录

摘 要 I

Abstract II

第1章绪论 1

1.1 研究目的及意义 1

1.2 国内外研究现状 1

1.3 论文内容安排 2

第2章相关技术分析 4

2.1爬虫技术分析 4

2.2数据采集技术 6

2.3 URL去重策略 7

2.4常见反爬取措施与应对方法 9

2.4.1 添加登录机制 9

2.4.2 使用验证码 9

2.4.3 进行 IP 封锁 9

2.5分布式爬虫设计原理 10

2.6 word2vec技术分析 11

2.6.1词向量 11

2.6.2语言模型 11

第3章分布式爬虫系统的设计与实现 13

3.1系统概要设计 13

3.2网页解析策略 15

3.3网页解析思路 16

3.4分布式实现与URL去重 16

3.5数据处理 17

3.6系统结果展示 18

第4章总结与展望 22

4.1论文工作总结 22

4.2未来工作计划 22

参考文献 23

附录 24

致谢 28

第1章绪论

研究目的及意义

网络爬虫是一种可以批量下载网页的程序。Web爬虫有多种应用途径。最突出的应用方式是作为网页搜索引擎的主要组成部分之一,搜索引擎搜集大量网页,将网页进行索引,并允许用户针对索引发出查询并查找匹配查询的页面。还有一种相关用途是Web归档,其中大量的网页被定期收集和归档用于后代使用。第三个用途就是是网页数据挖掘,分析网页的统计特性[[1]]。

随着互联网的不断发展,智能手机的普及,使得网上的信息不断增加,以及移动互联网,大数据、云计算、人工智能等新兴技术的发展,网络爬虫同样也需要更快的发展,以应对迅速增长的互联网容量,甚至需要对网络爬虫的框架以及爬取策略做出调整,例如采用分布式的结构以提高爬行效率,研究垂直式爬虫获取更精确的信息[[2]]。此外,网络爬虫快速发展的同时,也提高了业内对数据保护和反爬技术的重视,国内外各大网站纷纷采取了相应的反爬虫技术,增加了爬取信息的难度,对web爬虫提出了新的挑战。

基本的网络爬虫算法很简单:给定一组种子URL,爬虫程序会下载所有网页,提取页面中包含的超链接,并迭代地下载这些根据超链接寻址的网页。虽然基本算法很简单,网络爬虫还有许多固有的挑战:

您需要先支付 80元 才能查看全部内容!立即支付

企业微信

Copyright © 2010-2022 毕业论文网 站点地图