java网络蜘蛛_基于java网络蜘蛛程序

内容介绍

原文档由会员 刘丽 发布

基于java网络蜘蛛程序

1.2万字 42页

包括开题报告,任务书,答辩PPT和论文正文

摘 要

在互联网发展初期,网站相对较少,信息查找比较容易。然而伴随互联网爆炸性的发展,普通网络用户想找到所需的资料简直如同大海捞针,这时为满足大众信息检索需求的专业搜索网站便应运而生了。网络蜘蛛程序是Web搜索引擎技术中关键的一部分。

本论文基于现有的知识理论实现了蜘蛛程序,从给定网址开始进行爬行搜索,利用数据库队列技术管理网页链接,将访问过的网页资源下载到本地硬盘保存。通过使用Lucene工具包对下载资源。利用java.url中的类实现Spider程序与外界通讯,以及处理网页中的URL连接,对蜘蛛程序的核心类(通讯核心、蜘蛛程序工作核心),资源索引的建立与搜索新型了详细的研究。

通过设计分析,完成了自己的蜘蛛爬行程序。程序按照初始设计功能完成,实现了对网络资源的收集和整理。功能通过了测试,程序可以正常稳定运行

最后论文对全文进行了总结,并对为了发展的方向进行了展望。

关键字:HTTP,线程,Spider,Lucene

Abstract

At the initial stage of internet development, there were few websites, so information searching is comparatively easy. However, with the explosion of internet, searching for information became very hard to common website users which calls for the appearance of professional searching websites. A crucial part of web searching engine technology is web spider program.

This paper realized the following procedures from give the website address to operate searching, make use of data base lining technology to manage webpage linkage to download visited sources to the local hard drives. Lucene tool bag is used to give content to the download sources. This paper is focused on the following technology: the core of spider program (communication core, spider program working core), the establishment of sources and search.

Though the design analysis, I have finished my own spider creeping program. The program is finished based on initial design, implement the collection and arranging of net sources. These functions passed the test, and is able to run normally.

Key words: HTTP, routine, spider, Lucene

目 录

1 绪 论1

1.1课题研究背景1

1.2国内外研究现状1

1.3 本论文的结构4

2 程序设计目标及策略5

2.1程序分析5

2.1.1 多线程搜索5

2.1.2 数据库队列管理5

2.1.3 检索引擎——Lucene6

2.2功能点技术分析6

2.2.1 Spider如何获取URL链接的获取6

2.2.2 程序结构的选择6

2.2.3利用递归构造Spider6

2.2.4利用非递归构造Spider7

2.2.5 Spider程序的队列7

2.2.6全文索引8

3 程序设计与实现、测试9

3.1 HTTP类及相关类的设计与实现9

3.2 蜘蛛程序工作核心类设计与实现13

3.2.1 蜘蛛程序中线程的设计13

3.2.2 多线程同步14

3.3 Spider类及其相关类的实现15

3.3.1 ISpiderReportable接口15

3.3.2 IWorkloadStorable接口15

3.3.3 SpiderSQLWorkload类16

3.3.4 SpiderWorker类16

3.3.5 SpiderDone类18

3.3.6 Spider类19

3.4程序测试20

3.4.1硬件环境20

3.4.2软件环境20

3.4.3测试用例20

3.4.4测试结论21

4 总结22

致 谢25

参考文献26

附录:代码27

参考文献

[1]佟晓筠等.面向主题的智能机器人ROBOT研究与实现〔J〕,电子与信息学报

[2]杜亚军等,爬行虫算法设计与程序实现〔J〕,计算机应用,24卷

[3] Heaton J, Programming Spiders,Bots and Aggregators in Java.

[4]Jeff Heaton[美],董兆丰译,网络机器人JAVA编程指南〔M〕,北京电子工业出版社

附录:代码

package com.spider;

import java.util.*;

import java.io.*;

import java.lang.reflect.*;

import com.spider.*;

public class Spider extends Thread implements ISpiderReportable {

protected IWorkloadStorable workload;

protected SpiderWorker pool[]

......

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值