登录

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

注册

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

找回密码

  • 获取手机验证码60
  • 找回
毕业论文网 > 毕业论文 > 计算机类 > 计算机科学与技术 > 正文

基于消息中间件与Redis缓存的快速响应系统的设计与实现毕业论文

 2021-11-07 08:11  

摘 要

随着互联网不断发展,互联网用户量剧烈增长,网站的访问量与日俱增,如近年来盛行的淘宝双十一秒杀活动,在秒杀那个时间点可能一瞬间涌入数十万的流量。如此庞大的计算量无法被普通的系统处理,从而导致系统出现响应慢,甚至出现处理错误、系统宕机等问题,这种现象称为高并发。

近年来,由于教学制度改革,网络选课成为了普遍趋势,而在选课过程中,成千上万学生为了选到满意的课程,往往会集中在系统开放的一瞬间涌入选课系统。针对这种高并发场景,如将Redis缓存、消息中间件与Java Web技术相结合,可以很好的解决问题。

本文基于SSM框架,采用MVC设计模式,即Model(模型)-View(视图)-Controller(控制层)设计模式,尽全力解耦了代码之间的依赖关系,使网站便于开发和后期维护。选择Mysql作为数据库服务器;选择Redis在选课事务中充当缓存,把所有将会被用户频繁读取的选课数据都加载到Redis缓存中,例如课程编号、课程名称、授课教师、学分、学时等,减少前端与后台的交互,降低数据库压力;运用消息中间件技术将选课信息异步提交以达到削峰减容的效果。在选课系统功能上,完成了用户登录功能,课程信息、学生信息、教师信息的增删改查功能,管理员与教师的排课功能,学生的选课、退选与查询选课结果功能,以及用户权限管理功能。本系统设计了三种角色,分别是:教务处管理员、教师和学生,不同角色拥有不同权限。本系统已基本达成了课题目标,不仅能实现选课事务,而且能处理一定量的高并发请求。

关键字:选课系统;SSM;Redis缓存;消息中间件

Abstract

With the continuous development of the Internet, the number of Internet users has increased dramatically, and the number of visits to the website has increased day by day. For example, the Taobao Double Eleven Spike activity, which has been popular in recent years, may have hundreds of thousands of traffic in an instant at the time of the spike. Such a huge amount of calculation cannot be processed by the ordinary system, resulting in slow response of the system, even processing errors, system downtime, etc. This phenomenon is called high concurrency.

In recent years, due to the reform of the teaching system, online course selection has become a general trend, and in the course of course selection, tens of thousands of students often concentrate on the course selection system in order to choose a satisfactory course. For this high concurrency scenario, such as combining Redis cache, message middleware and Java Web technology, it can solve the problem well.

This thesis is based on the SSM framework and adopts the MVC design pattern, that is, the Model-View-Controller design pattern. It does its best to decouple the dependencies between the codes, making the website easy to develop and maintain later. Choose Mysql as the database server; choose Redis to act as a cache in the course selection transaction, load all course selection data that will be frequently read by users into the Redis cache, such as course number, course name, lecturer, credits, hours, etc. The interaction between the front end and the background reduces the pressure on the database; the message middleware technology is used to asynchronously submit the course selection information to achieve the effect of peak reduction and volume reduction. In the course selection system function, the user login function, the addition, deletion, and modification of the course information, student information, and teacher information, the schedule arrangement function of the administrator and the teacher, the course selection, withdrawal and query of the course selection result of the student, and the user authority Management functions. This system has designed three roles, namely: the administrator of the Academic Affairs Office, teachers and students, different roles have different permissions. The system has basically achieved the goal of the project, not only can realize the course selection affairs, but also can handle a certain amount of high concurrent requests.

Key Words:Course Selection System; SSM; Redis; Message-oriented middleware

目 录

第1章 绪论 1

1.1研究背景及意义 1

1.2国内外研究现状 1

1.3论文主要工作 2

1.4论文结构 2

第2章 系统需求分析 4

2.1需求分析 4

2.1.1功能性需求 4

2.1.2非功能性需求 6

2.2技术方案需求 7

第3章 系统设计 8

3.1系统设计原则 8

3.2架构设计 8

3.3模块划分 10

3.4数据库设计 15

3.4.1系统E-R图 15

3.4.2系统物理表 20

第4章 系统实现 23

4.1功能性实现 25

4.1.1登录模块实现 25

4.1.2 排课管理模块 29

4.1.3选课管理模块实现 33

4.1.4成绩管理模块实现 38

4.1.5资源管理模块实现 39

4.1.6系统管理模块实现 40

4.2非功能性实现 40

4.2.1 Redis缓存 40

4.2.2 消息中间件 41

第5章 系统测试 43

5.1测试方法与测试环境 43

5.2测试用例和测试结果 43

5.2.1功能性测试 43

5.2.2非功能性测试 48

5.2.3高并发压力测试 49

第6章 总结与展望 51

6.1工作总结 51

6.2工作展望 51

参考文献 52

致谢 54

第1章 绪论

1.1研究背景及意义

随着淘宝双十一交易额一年比一年上涨,秒杀活动热度也随之不断上升,这同时也给电商技术人员带来严峻的挑战———高并发造成的读写冲突[1]。例如:在日常生活中,手机上会有各类秒杀活动,若1万部手机参与秒杀,在秒杀那个时间点可能涌入的流量是成千上万的,这样会造成非常严重的读写冲突[2]。秒杀系统是典型的高并发应用。在秒杀活动期间,大量用户会同时购买,网站流量剧烈增长,访问请求数远超商品库存数。系统软硬件无法处理如此巨大的计算量,进而出现响应速度慢,甚至出现处理出错、系统宕机等问题,进而导致整个系统瘫痪[3]。因此,在设计诸如此类高并发应用时,引入基于消息中间件与Redis缓存的快速响应技术可以极大缓解可能出现的处理出错、系统宕机等问题。

Redis(Remote Dictionary Server)是一个开源的使用ANSIC语言编写、遵守BSD协议、支持网络、可基于内存亦可持久化的日志型、Key-Value数据库,并提供多种语言的API[4],也是缓存的一种形式[5]。Redis的流行源于它的速度,丰富的语义和稳定性。Redis比其他无架构NoSQL数据库(例如MongoDB)要快,并且被设计用作记录系统,而不是简单易失的缓存[6]。Redis中主要有两种方法来确保数据安全:数据持久性和数据复制。数据持久性通过在数据复制时将数据写入磁盘来确保数据安全,通过在其他节点上复制数据来保持数据安全[7]。因此,Redis缓存在实现快速响应系统时至关重要,与此同时,面向消息的中间件技术是对于构建复杂的软件系统也非常重要[8]

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

企业微信

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