论文总字数:30086字
摘 要
学生线上选课系统的设计者如今把精力过多地放在了选课系统的功能架构方面,却忽略了高并发这个很重要的问题,使得学生们苦不堪言。解决高并发问题对于选课系统来说是必不可少的。大量提升服务器的数量和大幅度提高服务器的性能对于应用次数少、使用周期短的选课系统很不合适,因此需要寻求软件方面的解决方案。毕业设计围绕该问题展开,主要工作如下:
首先,设计并优化与高并发模块相关的选课冲突检测算法。其次,为了解决并发下的数据一致性问题,本文使用并发场景下的乐观锁机制保证此场景下的数据操作不会出错。随后,利用缓存技术解决高并发下的传统数据库的数据读写瓶颈问题,将并发时访问量很高的信息缓存到内存中待用户访问,利用内存与数据库读写速度的巨大差异大大提升并发性能。然后,运用消息队列技术,缓解短时间内请求井喷式增长的压力。让消息队列成为消息的容器,应用程序作为消费者从容器中取出请求并进行相应处理。之后,利用负载均衡技术,采用反向代理的方式将高并发的压力分担到多个服务器上,用服务器集群的方式提升系统的整体性能。除此之外,本文还使用页面静态化、数据库优化等技术进一步提升系统性能及并发能力。
本文将以上所提及的技术综合起来,结合各技术的性能特点和选课系统所具有的特点,形成一个完整的学生选课系统高并发解决方案。
关键词:高并发,选课,缓存,消息队列,负载均衡
ABSTRACT
The designers of the online course selection system for students now focus too much on the functional architecture of the elective system, but they ignore the very important issue of high concurrency and make students miserable. Solving high concurrency issues is essential for the course selection system. The massive increase in the number of servers and the significant increase in server performance are not suitable for the short course of application and short course selection system, so we are looking for software solutions. The main work is as follows:
The designers of the online course selection system for students now focus too much on the functional architecture of the elective system, but they ignore the very important issue of high concurrency and make students miserable. Solving high concurrency issues is essential for the course selection system. Increasing the number of servers and greatly improving the performance of the servers is not appropriate for the course selection system where the number of applications is small and the period of use is short. Therefore, software solutions must be sought. Graduation design starts around this issue. The main tasks are as follows:
First, design and optimize the conflict detection algorithm for class selection related to high concurrency modules. Secondly, in order to solve the problem of data consistency under concurrency, this paper uses the optimistic locking mechanism under the concurrency scenario to ensure that the data operation under this scenario will not go wrong. Subsequently, the use of caching technology to solve the problem of high-concurrency traditional database data read and write bottleneck, the concurrent high-visit information is cached in memory for users to access, the use of memory and database read and write speed greatly enhance the concurrency performance. Then, the use of message queue technology to ease the pressure of blowout growth in a short period of time. Let the message queue be the container for the message, and the application acts as a consumer to fetch the request from the container and process it accordingly. Then, using load balancing technology, the use of reverse proxy to share the high concurrency pressure to multiple servers, the use of server clusters to enhance the overall performance of the system. In addition, this article also uses technologies such as page statics and database optimization to further improve system performance and concurrent capabilities.
This article combines the above-mentioned technologies, combines the features of each technology and the characteristics of the elective system, to form a complete high-concurrency solution for student elective courses.
KEY WORDS: high concurrency, course selecting, cache, message queue, load balancing
目 录
摘要 I
ABSTRACT II
第一章 绪论 1
1.1 课题研究背景 1
1.2 国内外研究现状 1
1.3 本文主要内容与研究意义 2
第二章 相关技术知识概述与选课系统简介 4
2.1 ThinkPHP框架 4
2.2 Redis 4
2.3 ActiveMQ 5
2.4 选课系统结构 5
2.5 选课模块简介 6
2.6 本章小结 7
第三章 高并发解决方案的设计 8
3.1 系统整体架构 8
3.2 冲突检测算法设计与优化 9
3.3 数据一致性 9
3.4 缓存 10
3.5 消息队列 12
3.6 负载均衡 14
3.7 页面静态化 15
3.8 数据库优化 16
3.9 前端优化 17
3.10 本章小结 17
第四章 高并发解决方案的实现 18
4.1 冲突检测算法实现 18
4.2 数据一致性实现 18
4.3 缓存实现 21
4.4 消息队列实现 23
4.5 负载均衡实现 26
4.6 页面静态化实现 27
4.7 本章小结 29
第五章 系统测试及分析 30
5.1 系统整体性能测试 30
5.1.1 测试方法 30
5.1.2 测试过程 30
5.2系统各部分测试 35
5.2.1 Redis测试 35
5.2.2 消息队列测试 36
5.2.3 负载均衡测试 36
5.2.4 页面静态化测试 36
5.3 界面展示 37
5.4 本章小结 37
第六章 总结与展望 39
6.1 工作总结 39
6.2 未来展望 39
致谢 40
参考文献 41
第一章 绪论
1.1 课题研究背景
剩余内容已隐藏,请支付后下载全文,论文总字数:30086字
该课题毕业论文、开题报告、外文翻译、程序设计、图纸设计等资料可联系客服协助查找;