网络暴力实时监控管理系统设计与实现

目 录
摘 要 I
Abstract II
第一章 绪论 1
1.1 研究背景及意义 1
1.2 国内外相关问题研究现状 1
1.3 研究主要内容 3
第二章 关键技术 4
2.1 开发平台简述 4
2.1.1 Eclipse简介 4
2.1.2 新浪微博api 4
2.2 OAuth2.0简介 5
2.3 空间向量模型 6
2.4 文本聚类算法 9
2.5 数据库方案 11
2.5.1 MYSQL简介 11
2.5.2 MYSQL背景 12
2.5.3 MYSQL系统特性 12
第三章 系统设计 14
3.1 网络暴力分析策略 14
3. 2 系统总体设计 14
3.3 系统模块详细设计 15
3.3.1 数据获取模块 15
3.3.2 数据分析模块 24
3.4 数据库设计方案 29
第四章 系统实现 31
4.1 数据获取模块实现 31
4.1.1 核心代码 31
4.1.2 相关时序图 32
4.2 数据处理模块实现 34
4.2.1 核心代码 34
4.2.2 相关时序图 34
第五章 系统运行结果 36
5.1 源码结构展示 36
5.2 数据抓取模块运行展示 37
第六章 总结与展望 43
6.1 系统主要作用 43
6.2 系统难点与解决 43
参考文献 45
致 谢 47
微博网络暴力管理平台的主要流程如下,首先输入要查询的微博消息的关键词或核心微博,然后利用网络爬虫来收集微博中的消息内容,包括微博内容,转发关系,博主ID,发布时间等。然后进入中文分词模块,将微博内容分词后进入VSM,将微博内容的文本数据转化为计算机可以处理的结构化数据,将所有相关微博内容预处理后,进入K-means算法对微博内容进行分类,找到离关键词最近的那个类,认为这个类中的微博内容表达的是同一意思,并作为数据分析的主类,然后找出类中符合意见领袖标准的微博领袖逐一进行影响力评估,分析出各意见领袖的影响力指标,然后进入趋势分析预警模块,根据微博的走势代入趋势分析算法进行分析,得出结果将数据上传到管理平台,管理平台对数据进行处理将结果输出。
微博网络暴力预警,就是发现对微博网络暴力出现、发展和消亡具有重要影响的因素,并连续不间断地动态监测、度量、及采集它们的信息,根据预警体系内容,运用综合分析技术,对当前微博网络暴力做出评价分析并预测其发展趋势,及时做出等级预报的活动。
本系统是通过根据入口用户进行分析,力求得到入口用户最喜爱的网络暴力话题,新浪微博的一般用户都是信息接收 者,而新浪微博的大量加V的明星用户有很多,他们是信息的产生着,会有巨量的粉丝关注,并且有大量的粉丝对 其每条微博进行评论。
我们可以进行假设,本文转载自http://www.biyezuopin.vip/onews.asp?id=14320若是一条微博有巨量的评论数,无论是好评还是差评,那么它的关注度一定是很高的,可以从另一个方面反映出大家对这条微博所描述的事件的兴趣度,所以本系统的分析策略如下图描述。
信息获取模块:该模块从微博上获取大量相关数据,并且将这些数据进行简单的处理,建立倒排索引。 信息处理模块:该模块主要将信息获取模块处理过的数据进行深加工,进行聚类,以及网络暴力评价。
数据显示模块:该模块将信息处理模块处理好的数据显示出来,供用户使用。

package weibo4j;

import weibo4j.model.Comment;
import weibo4j.model.CommentWapper;
import weibo4j.model.Paging;
import weibo4j.model.PostParameter;
import weibo4j.model.WeiboException;
import weibo4j.org.json.JSONArray;
import weibo4j.util.WeiboConfig;

public class Comments extends Weibo{

	private static final long serialVersionUID = 3321231200237418256L;

	/**
	 * 根据微博ID返回某条微博的评论列表
	 * 
	 * @param id
	 *            需要查询的微博ID
	 * @return list of Comment
	 * @throws WeiboException
	 *             when Weibo service or network is unavailable
	 * @version weibo4j-V2 1.0.1
	 * @see <a
	 *      href="http://open.weibo.com/wiki/2/comments/show">comments/show</a>
	 * @since JDK 1.5
	 */
	public CommentWapper getCommentById(String id) throws WeiboException {
		return Comment.constructWapperComments(client.get(
				WeiboConfig.getValue("baseURL") + "comments/show.json",
				new PostParameter[] { new PostParameter("id", id) }));
	}

	/**
	 * 根据微博ID返回某条微博的评论列表
	 * 
	 * @param id
	 *            需要查询的微博ID
	 * @param count
	 *            单页返回的记录条数,默认为50。
	 * @param page
	 *            返回结果的页码,默认为1。
	 * @param filter_by_author
	 *            作者筛选类型,0:全部、1:我关注的人、2:陌生人,默认为0。
	 * @return list of Comment
	 * @throws WeiboException
	 *             when Weibo service or network is unavailable
	 * @version weibo4j-V2 1.0.1
	 * @see <a
	 *      href="http://open.weibo.com/wiki/2/comments/show">comments/show</a>
	 * @since JDK 1.5
	 */
	public CommentWapper getCommentById(String id, Paging page,
			Integer filter_by_author) throws WeiboException {
		return Comment.constructWapperComments(client.get(
				WeiboConfig.getValue("baseURL") + "comments/show.json",
				new PostParameter[] {
						new PostParameter("id", id),
						new PostParameter("filter_by_author", filter_by_author.toString()) }, page));
	}

	/**
	 * 获取当前登录用户所发出的评论列表
	 * 
	 * @return list of Comment
	 * @throws WeiboException
	 *             when Weibo service or network is unavailable
	 * @version weibo4j-V2 1.0.1
	 * @see <a
	 *      href="http://open.weibo.com/wiki/2/comments/by_me">comments/by_me</a>
	 * @since JDK 1.5
	 */
	public CommentWapper getCommentByMe() throws WeiboException {
		return Comment.constructWapperComments(client.get(WeiboConfig
				.getValue("baseURL") + "comments/by_me.json"));
	}

	/**
	 * 获取当前登录用户所发出的评论列表
	 * 
	 * @param count
	 *            单页返回的记录条数,默认为50
	 * @param page
	 *            返回结果的页码,默认为1
	 * @param filter_by_source
	 *            来源筛选类型,0:全部、1:来自微博的评论、2:来自微群的评论,默认为0
	 * @return list of Comment
	 * @throws WeiboException
	 *             when Weibo service or network is unavailable
	 * @version weibo4j-V2 1.0.1
	 * @see <a
	 *      href="http://open.weibo.com/wiki/2/comments/by_me">comments/by_me</a>
	 * @since JDK 1.5
	 */
	public CommentWapper getCommentByMe(Paging page, Integer filter_by_source)
			throws WeiboException {
		return Comment.constructWapperComments(client.get(
				WeiboConfig.getValue("baseURL") + "comments/by_me.json",
				new PostParameter[] { new PostParameter("filter_by_author",
						filter_by_source.toString()) }, page));
	}

	/**
	 * 获取当前登录用户所接收到的评论列表
	 * 
	 * @return list of Comment
	 * @throws WeiboException
	 *             when Weibo service or network is unavailable
	 * @version weibo4j-V2 1.0.1
	 * @see <a
	 *      href="http://open.weibo.com/wiki/2/comments/to_me">comments/to_me</a>
	 * @since JDK 1.5
	 */
	public CommentWapper getCommentToMe() throws WeiboException {
		return Comment.constructWapperComments(client.get(WeiboConfig
				.getValue("baseURL") + "comments/to_me.json"));
	}

	/**
	 * 获取当前登录用户所接收到的评论列表
	 * 
	 * @param count
	 *            单页返回的记录条数,默认为50。
	 * @param page
	 *            返回结果的页码,默认为1。
	 * @param filter_by_author
	 *            作者筛选类型,0:全部、1:我关注的人、2:陌生人,默认为0。
	 * @param filter_by_source
	 *            来源筛选类型,0:全部、1:来自微博的评论、2:来自微群的评论,默认为0。
	 * @return list of Comment
	 * @throws WeiboException
	 *             when Weibo service or network is unavailable
	 * @version weibo4j-V2 1.0.1
	 * @see <a
	 *      href="http://open.weibo.com/wiki/2/comments/to_me">comments/to_me</a>
	 * @since JDK 1.5
	 */
	public CommentWapper getCommentToMe(Paging page, Integer filter_by_source,
			Integer filter_by_author) throws WeiboException {
		return Comment.constructWapperComments(client.get(
				WeiboConfig.getValue("baseURL") + "comments/to_me.json",
				new PostParameter[] {
						new PostParameter("filter_by_source", filter_by_source
								.toString()),
						new PostParameter("filter_by_author", filter_by_author
								.toString()) }, page));
	}

	/**
	 * 获取当前登录用户的最新评论包括接收到的与发出的
	 * 
	 * @return list of Comment
	 * @throws WeiboException
	 *             when Weibo service or network is unavailable
	 * @version weibo4j-V2 1.0.1
	 * @see <a
	 *      href="http://open.weibo.com/wiki/2/comments/timeline">comments/timeline</a>
	 * @since JDK 1.5
	 */
	public CommentWapper getCommentTimeline() throws WeiboException {
		return Comment.constructWapperComments(client.get(WeiboConfig
				.getValue("baseURL") + "comments/timeline.json"));
	}

	/**
	 * 获取当前登录用户的最新评论包括接收到的与发出的
	 * 
	 * @param count
	 *            单页返回的记录条数,默认为50。
	 * @param page
	 *            返回结果的页码,默认为1。
	 * @return list of Comment
	 * @throws WeiboException
	 *             when Weibo service or network is unavailable
	 * @version weibo4j-V2 1.0.1
	 * @see <a
	 *      href="http://open.weibo.com/wiki/2/comments/timeline">comments/timeline</a>
	 * @since JDK 1.5
	 */
	public CommentWapper getCommentTimeline(Paging page) throws WeiboException {
		return Comment.constructWapperComments(client.get(
				WeiboConfig.getValue("baseURL") + "comments/timeline.json",
				null, page));
	}

	/**
	 * 获取最新的提到当前登录用户的评论,即@我的评论
	 * 
	 * @return list of Comment
	 * @throws WeiboException
	 *             when Weibo service or network is unavailable
	 * @version weibo4j-V2 1.0.1
	 * @see <a
	 *      href="http://open.weibo.com/wiki/2/comments/mentions">comments/mentions</a>
	 * @since JDK 1.5
	 */
	public CommentWapper getCommentMentions() throws WeiboException {
		return Comment.constructWapperComments(client.get(WeiboConfig
				.getValue("baseURL") + "comments/mentions.json"));
	}

	/**
	 * 获取最新的提到当前登录用户的评论,即@我的评论
	 * 
	 * @param count
	 *            单页返回的记录条数,默认为50。
	 * @param page
	 *            返回结果的页码,默认为1。
	 * @param filter_by_author
	 *            作者筛选类型,0:全部、1:我关注的人、2:陌生人,默认为0。
	 * @param filter_by_source
	 *            来源筛选类型,0:全部、1:来自微博的评论、2:来自微群的评论,默认为0。
	 * @return list of Comment
	 * @throws WeiboException
	 *             when Weibo service or network is unavailable
	 * @version weibo4j-V2 1.0.1
	 * @see <a
	 *      href="http://open.weibo.com/wiki/2/comments/mentions">comments/mentions</a>
	 * @since JDK 1.5
	 */
	public CommentWapper getCommentMentions(Paging page,
			Integer filter_by_source, Integer filter_by_author)
			throws WeiboException {
		return Comment.constructWapperComments(client.get(
				WeiboConfig.getValue("baseURL") + "comments/mentions.json",
				new PostParameter[] {
						new PostParameter("filter_by_source", filter_by_source
								.toString()),
						new PostParameter("filter_by_author", filter_by_author
								.toString()) }, page));
	}

	/**
	 * 根据评论ID批量返回评论信息
	 * 
	 * @param cids
	 *            需要查询的批量评论ID,用半角逗号分隔,最大50
	 * @return list of Comment
	 * @throws WeiboException
	 *             when Weibo service or network is unavailable
	 * @version weibo4j-V2 1.0.1
	 * @see <a
	 *      href="http://open.weibo.com/wiki/2/comments/show_batch">comments/show_batch</a>
	 * @since JDK 1.5
	 */
	public JSONArray getCommentShowBatch(String cids) throws WeiboException {
		return client.get(
				WeiboConfig.getValue("baseURL") + "comments/show_batch.json",
				new PostParameter[] { new PostParameter("cids", cids) }).asJSONArray();
	}

	/**
	 * 对一条微博进行评论
	 * 
	 * @param comment
	 *            评论内容,必须做URLencode,内容不超过140个汉字
	 * @param id
	 *            需要评论的微博ID
	 * @return Comment
	 * @throws WeiboException
	 *             when Weibo service or network is unavailable
	 * @version weibo4j-V2 1.0.1
	 * @see <a
	 *      href="http://open.weibo.com/wiki/2/comments/create">comments/create</a>
	 * @since JDK 1.5
	 */
	public Comment createComment(String comment, String id)
			throws WeiboException {
		return new Comment(client.post(WeiboConfig.getValue("baseURL")
				+ "comments/create.json", new PostParameter[] {
				new PostParameter("comment", comment),
				new PostParameter("id", id) }));
	}

	/**
	 * 对一条微博进行评论
	 * 
	 * @param comment
	 *            评论内容,必须做URLencode,内容不超过140个汉字
	 * @param id
	 *            需要评论的微博ID
	 * @param comment_ori
	 *            当评论转发微博时,是否评论给原微博,0:否、1:是,默认为0。
	 * @return Comment
	 * @throws WeiboException
	 *             when Weibo service or network is unavailable
	 * @version weibo4j-V2 1.0.1
	 * @see <a
	 *      href="http://open.weibo.com/wiki/2/comments/create">comments/create</a>
	 * @since JDK 1.5
	 */
	public Comment createComment(String comment, String id, Integer comment_ori)
			throws WeiboException {
		return new Comment(client.post(WeiboConfig.getValue("baseURL")
				+ "comments/create.json", new PostParameter[] {
				new PostParameter("comment", comment),
				new PostParameter("id", id),
				new PostParameter("comment_ori", comment_ori.toString()) }));
	}

	/**
	 * 回复一条评论 
	 * @param comment 评论内容,必须做URLencode,内容不超过140个汉字
	 * 
	 * @param cid
	 *            需要回复的评论ID
	 * @param id
	 *            需要评论的微博ID
	 * @return Comment
	 * @throws WeiboException
	 *             when Weibo service or network is unavailable
	 * @version weibo4j-V2 1.0.1
	 * @see <a
	 *      href="http://open.weibo.com/wiki/2/comments/reply">comments/reply</a>
	 * @since JDK 1.5
	 */
	public Comment replyComment(String cid, String id, String comment)
			throws WeiboException {
		return new Comment(client.post(WeiboConfig.getValue("baseURL")
				+ "comments/reply.json", new PostParameter[] {
				new PostParameter("cid", cid), 
				new PostParameter("id", id),
				new PostParameter("comment", comment) }));
	}

	/**
	 * 回复一条评论
	 * 
	 * @param comment
	 *            评论内容,必须做URLencode,内容不超过140个汉字
	 * @param cid
	 *            需要回复的评论ID
	 * @param id
	 *            需要评论的微博ID
	 * @param without_mention
	 *            回复中是否自动加入“回复@用户名”,0:是、1:否,默认为0。
	 * @param comment_ori
	 *            当评论转发微博时,是否评论给原微博,0:否、1:是,默认为0。
	 * @return Comment
	 * @throws WeiboException
	 *             when Weibo service or network is unavailable
	 * @version weibo4j-V2 1.0.1
	 * @see <a
	 *      href="http://open.weibo.com/wiki/2/comments/reply">comments/reply</a>
	 * @since JDK 1.5
	 */
	public Comment replyComment(String cid, String id, String comment,
			Integer without_mention, Integer comment_ori) throws WeiboException {
		return new Comment(
				client.post(
						WeiboConfig.getValue("baseURL") + "comments/reply.json",
						new PostParameter[] {
								new PostParameter("comment", comment),
								new PostParameter("id", id),
								new PostParameter("cid", cid),
								new PostParameter("without_mention",without_mention.toString()),
								new PostParameter("comment_ori", comment_ori.toString()) }));
	}

	/**
	 * 删除一条评论
	 * 
	 * @param cid
	 *            要删除的评论ID,只能删除登录用户自己发布的评论
	 * @return Comment
	 * @throws WeiboException
	 *             when Weibo service or network is unavailable
	 * @version weibo4j-V2 1.0.1
	 * @see <a
	 *      href="http://open.weibo.com/wiki/2/comments/destroy">comments/destroy</a>
	 * @since JDK 1.5
	 */
	public Comment destroyComment(String cid) throws WeiboException {
		return new Comment(client.post(WeiboConfig.getValue("baseURL")
				+ "comments/destroy.json",
				new PostParameter[] { new PostParameter("cid", cid) }));
	}

	/**
	 * 根据评论ID批量删除评论
	 * 
	 * @param ids
	 *            需要删除的评论ID,用半角逗号隔开,最多20个
	 * @return list of Comment
	 * @throws WeiboException
	 *             when Weibo service or network is unavailable
	 * @version weibo4j-V2 1.0.1
	 * @see <a
	 *      href="http://open.weibo.com/wiki/2/comments/destroy_batch">comments/destroy_batch</a>
	 * @since JDK 1.5
	 */
	public JSONArray destoryCommentBatch(String cids) throws WeiboException {
		return client.post(
						WeiboConfig.getValue("baseURL")
								+ "comments/destroy_batch.json",
						new PostParameter[] { new PostParameter("cids", cids) }).asJSONArray();
	}
}

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

shejizuopin

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值