分布式客服微服务系统设计

 2022-06-12 08:06

论文总字数:26931字

摘 要

随着互联网的不断发展,越来越多的企业将自身的运作、销售、管理都与网络结合起来。客服微服务系统是一种帮助企业更方便与用户沟通的新型互联网工具。使用客服微服务系统,企业可以通过浏览器和用户沟通,解决用户售前和售后问题,节省人力资源成本、提升服务满意度、驱动企业业务增长的价值。现阶段,客服微服务系统面临着如何分布式部署、快速接入、实时对话、消息可靠、安全等诸多挑战。

针对客服微服务系统如何分布式部署、快速接入、用户和客服之间对话实时性和可靠性等问题,设计并实现了一种基于redis缓存、长轮询通信方式的分布式客服微服务系统。考虑到几十万客服同时在线的并发需求,提出了一种nginx redis的集群部署方案;为了让企业用户能够快速接入客服服务,提出并实现了通过js脚本将客服客户端入口嵌到网站的方案;通过分析客服服务以sass形式提供给企业用户,通过js api进行接入,企业网络状态无法保证、浏览器版本等因素,选择长轮询方式作为消息接收方式;针对集群条件下可能出现网络异常的情况,提出并实现了基于消息重发和网络异常提示的消息可靠性方案;针对XSS前端攻击,设计并实现了基于白名单的安全防御方案。

详细阐述了客服微服务系统的设计和实现过程。采用spring、redis、ajax、长轮询等技术,实现了技能队列管理、开通Web渠道、实时对话、查询交谈记录等功能。最后通过对系统各模块进行测试,发现系统功能完全满足预期要求。

关键词:redis,分布式,消息可靠性,长轮询

Abstract

With the continuous development of the Internet, more and more enterprises combine their operations, sales and management with the Internet. Customer service micro-service system is a new Internet tool to help enterprises communicate with users more conveniently. Using the customer service system, the enterprise can communicate with users through the browser, solve the problems of user pre-sale and after-sale, save human resource cost, enhance the value of service satisfaction, drive business growth. At the present stage, the customer service micro-service system faces many challenges such as distributed deployment, fast access, real-time dialogue, reliable information and security.

For problems such as how to plan the distributed deployment, rapid access,the real-time and reliability of the dialogue between user and agent, design and implement a distributed customer service system based on redis cache and long polling. Considering the concurrent demands of hundreds of thousands of agents, a cluster deployment scheme of nginx and redis is proposed. In order to enable enterprise users to access customer service quickly, a scheme to embed customer service client entry into the website through js script is proposed and implemented. Through the analysis of customer service provided to the enterprise customers in the form of sass, through the js API access, enterprise network status cannot be guaranteed, browser version, choose long polling way as message reception mode; A message reliability scheme based on message resending and network exception prompt is proposed and implemented in case of network abnormality under cluster condition. A security defense scheme based on white list is designed and implemented for XSS front-end attack.

The design and implementation process of customer service micro-service system are described in detail. Using spring, redis, ajax, long polling and other technologies, it has realized such functions as skill queue management, opening Web channels, real-time dialogue and query conversation records. Finally, the system is tested and the running effect is given. After inspection, the system function meets the design requirements.

KEY WORDS: redis, distribution, the reliability solution of message, long polling

目录

摘要 III

Abstract IV

第一章 绪论 7

1.1 论文背景和意义 7

1.2 研究现状 7

1.3 主要工作 7

1.4 本文结构 7

第二章 开发环境和技术概述 8

2.1 Tomcat概述 8

2.2 Redis概述 8

2.3 Spring框架概述 8

2.4 jQuery概述 8

2.5 长轮询概述 8

2.6 本章小结 8

第三章 系统概要设计 9

3.1 系统整体组成 9

3.2 系统框架设计 9

3.3 对象模型设计 10

3.3.1 对象简介 11

3.3.2 对象之间关系 11

3.4 数据库选型 12

3.4.1 主流数据库之间对比 12

3.4.2 选择MySQL的原因 12

3.5 模块设计 13

3.5.1 前端模块设计 13

3.5.2 后端模块设计 16

3.6 系统非功能性保障 17

3.6.1 系统安全性 17

3.6.2 系统可靠性 17

3.7 本章小结 17

第四章 系统详细设计与实现 18

4.1 前端模块实现 18

4.2 后端模块实现 23

4.3 消息接收方式实现 26

4.3.1 通信方式对比 26

4.3.2 选择长轮询原因 27

4.3.3 长轮询实现 28

4.4 集群方式下消息的可靠性方案 30

4.4.1 消息收发机制 30

4.4.2 消息异常场景分析 30

4.4.3 消息收发可靠性解决方案 31

4.5 前端安全防御实现 33

4.5.1 XSS攻击简介 33

4.5.2 防御手段 33

4.6 本章小结 33

第五章 系统测试 34

5.1 测试用例设计 34

5.2 测试结果 34

5.2.1 技能队列管理测试 34

5.2.2 开通Web渠道测试 34

5.2.3 发送和接收消息测试 35

5.2.4 查看交谈记录测试 36

5.2.5 XSS安全防御测试 37

5.3 本章小结 37

第六章 总结与展望 38

6.1 论文总结 38

6.2 工作展望 38

致谢 39

参考文献 40

绪论

论文背景和意义

随着互联网的不断发展,越来越多的企业将自身的运作、销售、管理都与网络结合起来。客服微服务系统是一种帮助企业更方便与用户沟通的新型互联网工具。使用客服微服务系统,企业可以通过浏览器和用户沟通,解决用户售前和售后问题,节省人力资源成本、提升服务满意度、驱动企业业务增长的价值。现阶段,国内主流的客服系统一般采用“客服机器人+人工客服”的模式。当客户进入客服系统客户端与客服聊天时,首先客服机器人为他提供服务;当客服机器人无法解决客户问题时,系统会提供多种转人工客服的方式。现阶段,客服微服务系统面临着如何分布式部署、快速接入、实时对话、消息可靠、安全等诸多挑战。

研究现状

根据现在国内主流客服系统发展现状,可以看出客服系统未来发展的一个重要趋势就是对web、社交、移动端等渠道进行整合,打造一个全渠道的云端客服系统。近几年不同服务商之间在客服系统领域展开了激烈的竞争,国内主流客服系统服务提供商比如环信、逸创、美洽等,虽然在产品策略和功能特性有一些差异,但是如何保证客服功能可靠稳定、灵活部署、数据安全等仍是它们需要关注的核心。

主要工作

本文在分析公司某项目实际需求的基础上,开发一个分布式环境下多人协同交谈的客户服务软件,支持客服人员同时与多名客户进行文字交谈,支持多个不同客户的请求平均分配到多个不同的客服人员,支持按照技能进行呼叫分配,支持集群方式下消息的可靠传递和异常处理。

本文分析了该客服微服务系统的整体组成、系统框架、对象模型和前后端设计思路和具体实现。针对客服微服务系统如何分布式部署、快速接入、用户和客服之间对话实时性和可靠性等问题提出了具体的解决方案。采用spring、redis、ajax、长轮询等技术,实现了技能队列管理、开通Web渠道、实时对话、查询交谈记录等功能。

本文结构

本文一共分为六章,具体如下:

剩余内容已隐藏,请支付后下载全文,论文总字数:26931字

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

该课题毕业论文、开题报告、外文翻译、程序设计、图纸设计等资料可联系客服协助查找;