一种使用websocket链接状态来自动销毁资源的方法技术

技术编号:17146541 阅读:144 留言:0更新日期:2018-01-27 17:35
本发明专利技术公开了一种使用websocket链接状态来自动销毁资源的方法,包括以下步骤:首先判断顾客是否离线,包括:1)当顾客开启网页时,客户端与服务器建立websocket链接,即顾客上线;2)顾客与客服开始对话聊天;3)客户端向服务器发送websocket的链接关闭,顾客离线,包括关闭网页、电脑重启;4)顾客离线,顾客头像变灰,客服选择直接关闭对话或等一段时间自动关闭;再自动化关闭对话,包括:顾客离线后,客服通过自己根据经验设置一个关闭对话的时间,来以此关闭对话。采用本发明专利技术方法后,在顾客量少的时候达到较高的对话质量,顾客较多的时候能快速自动结束顾客离线的对话可以大幅度提升服务器的性能,提高客服接入对话数目。

A method of automatically destroying resources by using the websocket link state

The invention discloses a method for automatic destruction of resources using the websocket link state, which comprises the following steps: first to determine whether the customer is offline, including: 1) when the customer opens a web page, a websocket link to the client and the server, the customer on-line customer and customer service; 2) began to chat; 3) the client sent to the server websocket the link is closed, the customer is offline, including closing pages, restart the computer; 4) customers offline customer avatar grayed, customer service directly close the conversation or a period of time and then automatically shut down; automation closed dialogue, including: customer service offline, through their own experience according to set a time to close the dialog. Close the dialog. After adopting the method of the invention, a high quality of conversation can be achieved when a small number of customers is available. When customers are more customers, the dialogue between customers can be automatically terminate quickly, and the performance of servers can be greatly improved, and the number of customer service access dialogues can be increased.

【技术实现步骤摘要】
一种使用websocket链接状态来自动销毁资源的方法
本专利技术涉及websocket协议领域,具体是一种使用websocket链接状态来自动销毁资源的方法。
技术介绍
客服聊天对话过程中,从创建对话到聊天结束过程中,常常需要花费服务器较大资源代价来处理这一过程。在解决对话结束释放资源的问题中,提高服务器性能问题,从而节省下多余的服务器,需要解决如下问题:实时响应:用户聊天过程中突然因为意外原因,断网,断电,误操作关闭浏览器(或标签)网页,造成用户下线,通过此方法可以实时判断用户是否下线,从而决定是否实时关闭对话;自动化关闭对话:通过实时判断用户下线,客服设置好定时任务来进行自动化关闭用户对话,从而减少无用对话占用客服对话数目,导致新用户对话进不来,提高服务质量;减少资源消耗:可以通过实时判断用户下线,继而判断用户是否在配置的固定时间有没有上线,上线不结束对话,不上线结束对话,解决用户意外断掉又重新上线,不用重复结束创建对话减少资源消耗。现有技术在对话过程中,程序自动通过定时任务判断与顾客最后一句话聊天时间来进行自动化关闭对话,通过判断最后一条顾客与客服聊天的时间来自动化结束任务,本文档来自技高网...
一种使用websocket链接状态来自动销毁资源的方法

【技术保护点】
一种使用websocket链接状态来自动销毁资源的方法,其特征在于,包括以下步骤:步骤1:判断顾客是否离线1)当顾客开启网页时,客户端与服务器建立websocket链接,即顾客上线;2)顾客与客服开始对话聊天;3)客户端向服务器发送websocket的链接关闭,顾客离线,包括关闭网页、电脑重启;4)顾客离线,顾客头像变灰,客服选择直接关闭对话或等一段时间自动关闭;步骤2:自动结束对话1)顾客和客服正在聊天,如果顾客没有离线,则不结束顾客和客服的对话;2)顾客和客服正在聊天,如果顾客离线,客户端发送websocket链接关闭通知给服务器,服务器根据对话ID,触发定时任务来结束这个对话,但是顾客在...

【技术特征摘要】
1.一种使用websocket链接状态来自动销毁资源的方法,其特征在于,包括以下步骤:步骤1:判断顾客是否离线1)当顾客开启网页时,客户端与服务器建立websocket链接,即顾客上线;2)顾客与客服开始对话聊天;3)客户端向服务器发送websocket的链接关闭,顾客离线,包括关闭网页、电脑重启;4)顾客离线,顾客头像变灰,客服选择直接关闭对话或等一段时间自动关闭;步骤2:自动结束对话1)顾客和客服正在聊天,如果顾客没有离线,则不结束顾客和客服的对话;2)顾客和客服正在聊天,如果顾客离线,客户端发送websocket链接关闭通知给服务器,服务器根据对话ID,触发定时任务来结束这个对话,但是顾客在定时任务要执行结束这个对话前,顾客重新上线,客户端发送websocket链接开启通知,服务器根据对话ID...

【专利技术属性】
技术研发人员:彭涛
申请(专利权)人:成都知道创宇信息技术有限公司
类型:发明
国别省市:四川,51

网友询问留言 已有0条评论
  • 还没有人留言评论。发表了对其他浏览者有用的留言会获得科技券。

1