[go: up one dir, main page]

CN114615315A - Communication method, device, equipment and storage medium for online conversation - Google Patents

Communication method, device, equipment and storage medium for online conversation Download PDF

Info

Publication number
CN114615315A
CN114615315A CN202210283166.3A CN202210283166A CN114615315A CN 114615315 A CN114615315 A CN 114615315A CN 202210283166 A CN202210283166 A CN 202210283166A CN 114615315 A CN114615315 A CN 114615315A
Authority
CN
China
Prior art keywords
client
communication
target
session
instance
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210283166.3A
Other languages
Chinese (zh)
Inventor
姚定国
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen One Account Technology Co ltd
Original Assignee
Shenzhen One Account Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen One Account Technology Co ltd filed Critical Shenzhen One Account Technology Co ltd
Priority to CN202210283166.3A priority Critical patent/CN114615315A/en
Publication of CN114615315A publication Critical patent/CN114615315A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/04Real-time or near real-time messaging, e.g. instant messaging [IM]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3247Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer And Data Communications (AREA)

Abstract

The application relates to the technical field of communication, and discloses a communication method, a device, equipment and a storage medium for online conversation, which establish conversation connection with first clients corresponding to N first clients of N first communication instances distributed by a proxy server according to received connection request information of the N first clients; then according to a communication request between a second client and a target first client generated by the proxy server, determining a target first communication instance corresponding to the target first client from the N first communication instances; after the communication request with the target first client and the signature information of the target first client are verified, session communication connection between the second client and the target first client is established based on the target first communication instance, the expansibility of the communication system in different application scenes is improved by using the proxy server, and meanwhile, the communication connection is carried out through a plurality of communication instances, so that the performance of the communication system is ensured.

Description

线上会话的通讯方法、装置、设备及存储介质Communication method, device, device and storage medium for online session

技术领域technical field

本申请涉及通讯技术领域,尤其涉及一种线上会话的通讯方法、装置、计算机设备及存储介质。The present application relates to the field of communication technologies, and in particular, to a communication method, device, computer equipment and storage medium for an online session.

背景技术Background technique

目前PC端通讯业务更多需要应用程序下载安装等繁琐的操作,降低了沟通效率,而现有的Web即时通讯(InstantMessaging,IM)技术中,具有无需安装客户端,穿透防火墙多个优势,可以通过Ajax短轮询、Comet,WebSocket,SSE等实现客户端从服务端接收消息的场景。通过使用开源技术Socket.io进行封装,即时通讯系统可兼容不同浏览器,但在利用集群服务器时,即时通讯系统仍存在对不同业务场景的系统性能和系统扩展性较差的问题。At present, PC-side communication services require more tedious operations such as application download and installation, which reduces communication efficiency. In the existing Web Instant Messaging (IM) technology, it has the advantages of not needing to install a client and penetrating firewalls. The scenario where the client receives messages from the server can be implemented through Ajax short polling, Comet, WebSocket, SSE, etc. By using the open source technology Socket.io for encapsulation, the instant messaging system is compatible with different browsers, but when using cluster servers, the instant messaging system still has the problem of poor system performance and system scalability for different business scenarios.

发明内容SUMMARY OF THE INVENTION

本申请提供一种线上会话的通讯方法、装置、计算机设备及存储介质,解决了现有技术在不同业务场景下,即时通讯系统存在系统性能和系统扩展性较差的问题。The present application provides an online session communication method, device, computer equipment and storage medium, which solve the problems of poor system performance and system scalability of the instant messaging system in the prior art in different business scenarios.

第一方面,本申请实施例提供了一种线上会话的通讯方法,包括:In a first aspect, an embodiment of the present application provides a communication method for an online session, including:

在根据代理服务器分配的N个第一通讯实例接收到N个第一客户端的连接请求信息时,建立N个所述第一通讯实例与N个所述第一客户端的第一客户端会话连接,其中,N为大于1的整数;When receiving the connection request information of the N first clients according to the N first communication instances allocated by the proxy server, establishing first client session connections between the N first communication instances and the N first clients, Among them, N is an integer greater than 1;

根据所述代理服务器所生成的第二客户端的与目标第一客户端通讯请求,从N个所述第一通讯实例中确定目标第一客户端所对应的目标第一通讯实例;According to the communication request of the second client and the target first client generated by the proxy server, the target first communication instance corresponding to the target first client is determined from the N first communication instances;

核验所述与目标第一客户端通讯请求中的目标第一客户端ID与所述目标第一客户端的目标第一客户端签名信息,通过所述目标第一通讯实例建立所述第二客户端和目标第一客户端的会话通讯连接。Verifying the target first client ID in the communication request with the target first client and the target first client signature information of the target first client, and establishing the second client through the target first communication instance A session communication connection with the target first client.

第二方面,本申请实施例还提供了一种线上会话的通讯装置,包括:In a second aspect, an embodiment of the present application further provides a communication device for an online session, including:

通讯建立模块,在根据代理服务器分配的N个第一通讯实例接收到N个第一客户端的连接请求信息时,建立N个所述第一通讯实例与N个所述第一客户端的第一客户端会话连接,其中,N为大于1的整数;The communication establishment module, when receiving the connection request information of the N first clients according to the N first communication instances allocated by the proxy server, establishes the N first communication instances and the N first clients of the first clients End session connection, where N is an integer greater than 1;

目标通讯匹配模块,根据所述代理服务器所生成的第二客户端的与目标第一客户端通讯请求,从N个所述第一通讯实例中确定目标第一客户端所对应的目标第一通讯实例;The target communication matching module determines the target first communication instance corresponding to the target first client from the N first communication instances according to the communication request of the second client and the target first client generated by the proxy server ;

与目标通讯连接模块,核验所述与目标第一客户端通讯请求中的目标第一客户端ID与所述目标第一客户端的目标第一客户端签名信息,通过所述目标第一通讯实例建立所述第二客户端和目标第一客户端的会话通讯连接。A communication connection module with the target, verifying the target first client ID in the communication request with the target first client and the target first client signature information of the target first client, and establishing the target first communication instance through the target first client A session communication connection between the second client and the target first client.

第三方面,本申请实施例还提供了一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现上述线上会话的通讯方法的步骤。In a third aspect, embodiments of the present application further provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program When implementing the steps of the above-mentioned communication method of the online session.

第四方面,本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现上述线上会话的通讯方法的步骤。In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, implements the steps of the above-mentioned communication method for an online session .

本申请提供的线上会话的通讯方法、装置、计算机设备及存储介质,其中,一种线上会话的通讯方法,通过根据收到的N个第一客户端的连接请求信息,建立与代理服务器分配的N个第一通讯实例的N个第一客户端所对应的第一客户端会话连接;再根据代理服务器生成的第二客户端与目标第一客户端通讯请求,从N个第一通讯实例中确认目标第一客户端所对应的目标第一通讯实例;当与目标第一客户端通讯请求中的目标第一客户端ID与目标第一客户端的目标第一客户端签名信息核验通过后,通过目标第一通讯实例建立第二客户端和目标第一客户端的会话通讯连接,在利用代理服务器提高了在不同应用场景下的通讯系统的扩展性的同时,通过多个通讯实例进行通讯连接,进而保证了通讯系统的性能。The communication method, device, computer equipment and storage medium for an online session provided by the present application, wherein, a communication method for an online session is to establish a distribution with a proxy server according to the received connection request information of N first clients. The first client session connections corresponding to the N first clients of the N first communication instances; and then according to the communication request between the second client and the target first client generated by the proxy server, from the N first communication instances Confirm the target first communication instance corresponding to the target first client; when the target first client ID in the communication request with the target first client and the target first client signature information of the target first client are verified and passed, The session communication connection between the second client and the target first client is established through the target first communication instance, and the communication connection is performed through multiple communication instances while using the proxy server to improve the scalability of the communication system in different application scenarios, This ensures the performance of the communication system.

附图说明Description of drawings

为了更清楚地说明本申请实施例的技术方案,下面将对本申请实施例的描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions of the embodiments of the present application more clearly, the following briefly introduces the drawings that are used in the description of the embodiments of the present application. Obviously, the drawings in the following description are only some embodiments of the present application. , for those of ordinary skill in the art, other drawings can also be obtained from these drawings without creative labor.

图1是本申请一实施例提供的一种线上会话的通讯方法的应用环境示意图;1 is a schematic diagram of an application environment of a communication method for an online session provided by an embodiment of the present application;

图2是本申请一实施例提供的一种线上会话的通讯方法的实现流程图;2 is a flowchart of an implementation of a communication method for an online session provided by an embodiment of the present application;

图3是本申请一实施例提供的一种线上会话的通讯方法中步骤S20的流程图;3 is a flowchart of step S20 in an online session communication method provided by an embodiment of the present application;

图4是本申请一实施例提供的线上会话的通讯装置的结构示意图;4 is a schematic structural diagram of a communication device for an online session provided by an embodiment of the present application;

图5是本申请一实施例提供的计算机设备的示意图。FIG. 5 is a schematic diagram of a computer device provided by an embodiment of the present application.

具体实施方式Detailed ways

下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.

本申请实施例提供的线上会话的通讯方法,可应用在如图1示出的应用环境中。如图1所示,客户端(计算机设备)通过网络与服务器进行通信。其中,客户端(计算机设备)包括但不限于为各种个人计算机、笔记本电脑、智能手机、平板电脑、摄像头和便携式可穿戴设备。服务器可以用独立的服务器,也可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、内容分发网络(Content DeliveryNetwork,CDN)、以及大数据和人工智能平台等基础云计算服务的云服务器。The communication method for an online session provided by the embodiment of the present application can be applied in the application environment shown in FIG. 1 . As shown in Figure 1, a client (computer device) communicates with a server through a network. Among them, the client (computer equipment) includes but is not limited to various personal computers, notebook computers, smart phones, tablet computers, cameras and portable wearable devices. The server can be an independent server, or it can provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, and Content Delivery Network (CDN). ), as well as cloud servers for basic cloud computing services such as big data and artificial intelligence platforms.

本实施例提供的线上会话的通讯方法可以由服务端执行,例如,通过第一客户端将连接请求信息发送至服务端,服务端基于该连接请求信息,执行本实施例提供的线上会话的通讯方法,建立第一通讯实例,使第二客户端连接服务器,通过与目标第一客户端通讯请求连接至第一通讯实例,进而与第一客户端进行会话通讯连接。The communication method for an online session provided by this embodiment may be performed by a server. For example, the first client sends connection request information to the server, and the server executes the online session provided by this embodiment based on the connection request information. In the communication method of the invention, a first communication instance is established, the second client is connected to the server, the connection is made to the first communication instance through a communication request with the target first client, and the session communication connection is performed with the first client.

在图1之外的一些场景中,还可以是由第一客户端执行该线上会话的通讯方法,直接根据第二客户端及与目标第一客户端通讯请求连接,通过执行本实施例提供的线上会话的通讯方法,建立与第一客户端进行会话通讯连接,然后将该线上会话的通讯结果发送至服务端进行存储。In some scenarios other than FIG. 1 , the communication method of the online session may also be performed by the first client, and the connection is directly requested by the second client and the communication with the target first client. The communication method of the online session is to establish a session communication connection with the first client, and then send the communication result of the online session to the server for storage.

本实施例中,基于WebSocket协议建立Web即时通讯(InstantMessaging,IM),WebSocket是HTML5中的一种基于单个TCP连接上进行全双工通信的协议,其特点是服务端可以主动向客户端推送信息,客户端也可以主动向服务端发送信息,是真正的双向平等对话,属于服务器推送技术的一种。In this embodiment, Web Instant Messaging (IM) is established based on the WebSocket protocol. WebSocket is a protocol in HTML5 for full-duplex communication based on a single TCP connection. Its feature is that the server can actively push information to the client , the client can also actively send information to the server, which is a real two-way equal dialogue, which belongs to a kind of server push technology.

其中,还利用了Socket.io技术,Socket.io是一个跨浏览器支持WebSocket的实时通讯的JS,Socket.io支持及时、双向、基于事件的交流,可在不同平台、浏览器、设备上工作,可靠性和速度稳定。Socket.io的常见应用场景包括实时分析,将数据推送到客户端,客户端表现为实时计数器、图表、日志客户;实时通讯;二进制流传输,Socket.io支持任何形式的二进制文件传输,例如图片、视频、音频等;文档合并:允许多个用户同时编辑一个文档,并能够看到每个用户做出的修改。Among them, Socket.io technology is also used. Socket.io is a JS that supports real-time communication of WebSocket across browsers. Socket.io supports timely, two-way, event-based communication, and can work on different platforms, browsers, and devices. , reliability and speed stability. Common application scenarios of Socket.io include real-time analysis, push data to the client, and the client behaves as a real-time counter, chart, log client; real-time communication; binary streaming transmission, Socket.io supports any form of binary file transmission, such as pictures , video, audio, etc.; document merging: allows multiple users to edit a document at the same time and be able to see the changes made by each user.

图2示出了本申请一实施例提供的线上会话的通讯方法的实现流程图。如图2所示,提供一种线上会话的通讯方法,其技术方案主要包括以下步骤S10-S30:FIG. 2 shows a flowchart of an implementation of a communication method for an online session provided by an embodiment of the present application. As shown in FIG. 2, a communication method for an online session is provided, and its technical solution mainly includes the following steps S10-S30:

步骤S10、在根据代理服务器分配的N个第一通讯实例接收到N个第一客户端的连接请求信息时,建立N个所述第一通讯实例与N个所述第一客户端的第一客户端会话连接,其中,N为大于1的整数。Step S10, when receiving connection request information of N first clients according to N first communication instances allocated by the proxy server, establishing N first communication instances and first clients of N first clients Session connection, where N is an integer greater than 1.

在步骤S10中,服务器与客户端之间采用Web即时通讯(InstantMessaging,IM)技术进行通信。其中,web即时通讯技具有无需安装客户端、穿透防火墙以及与社区的紧密结合的特点。通过在服务器设置多个服务器实例作为通讯实例以进行服务器与客户端的服务,以完成系统对于各客户端通讯的任务。In step S10, a Web instant messaging (Instant Messaging, IM) technology is used for communication between the server and the client. Among them, web instant messaging technology has the characteristics of not needing to install a client, penetrating firewalls, and being closely integrated with the community. By setting multiple server instances on the server as communication instances to perform services between the server and the client, the system can complete the task of communicating with each client.

在一实施例中,当集群服务器的代理服务器接收到N个第一客户端的连接请求信息时,该代理服务器为各第一客户端分配对应的第一通讯实例,以用于建立服务器与第一客户端所对应的第一客户端会话连接。In one embodiment, when the proxy server of the cluster server receives the connection request information of the N first clients, the proxy server allocates a corresponding first communication instance to each first client for establishing the connection between the server and the first client. The first client session connection corresponding to the client.

在一实施例中,由于即时通讯系统具有访问量大,且具有实时性,通过分散式集群服务器的方式部署通讯系统,从而减少服务器成本、提高服务器可拓展性以及服务器的稳定性。In one embodiment, since the instant messaging system has a large number of visits and is real-time, the communication system is deployed in a distributed cluster server manner, thereby reducing server costs, improving server scalability and server stability.

可以理解地,服务器实例又被称为service,又可以理解为一种虚拟机,通常用于根据用户环境的不同,可能需要创建一个或多个附加应用程序服务器实例,当服务器实例基于集群服务器时,服务器实例只能属于一个集群服务器。Understandably, a server instance is also called a service, and it can also be understood as a virtual machine. It is usually used to create one or more additional application server instances depending on the user environment. When the server instance is based on a cluster server , a server instance can only belong to one cluster server.

可以理解地,集群(Cluster)服务器为若干个相互独立的计算机,利用高速通信网络组成的一个较大的计算机服务系统,每个集群节点(即集群中的每台计算机)都是运行各自服务的独立服务器。这些服务器之间可以彼此通信,协同向用户提供应用程序,系统资源和数据,并以单一系统的模式加以管理。当用户请求集群系统时,集群给用户的感觉就是一个单一独立的服务器,而实际上用户请求的是一组集群服务器。Understandably, a cluster server is a large computer service system composed of several independent computers using a high-speed communication network. Each cluster node (ie, each computer in the cluster) runs its own service. Standalone server. These servers can communicate with each other, collaboratively provide applications, system resources and data to users, and manage them as a single system. When a user requests a cluster system, the cluster feels to the user as a single independent server, but in fact the user requests a group of cluster servers.

当使用集群服务器可以通过在多台计算机上分发负载来促进负载平衡,并可以通过实例级别的故障转移来提供高可用性。计算机集群架构按功能和结构通常有以下几类:负载均衡集群、高可用性集群、高性能计算集群和网格计算集群。When using clustered servers can facilitate load balancing by distributing the load across multiple machines and can provide high availability through instance-level failover. Computer cluster architecture usually has the following categories according to function and structure: load balancing cluster, high availability cluster, high performance computing cluster and grid computing cluster.

本实施例步骤S10:在根据代理服务器分配的N个第一通讯实例接收到N个第一客户端的连接请求信息时,建立N个所述第一通讯实例与N个所述第一客户端的第一客户端会话连接,其中,N为大于1的整数。作为一个示例,步骤S10中,包括:Step S10 in this embodiment: when receiving connection request information of N first clients according to N first communication instances allocated by the proxy server, establish a first communication between N first communication instances and N first clients A client session connection, where N is an integer greater than 1. As an example, step S10 includes:

步骤S101、所述代理服务器根据通讯系统所对应集群服务器的负载状态为N个所述第一客户端分配对应N个所述第一通讯实例。Step S101 , the proxy server allocates the corresponding N first communication instances to the N first clients according to the load state of the cluster server corresponding to the communication system.

在步骤S101中,由于通讯系统部署在集群服务器上,代理服务器根据通讯系统所使用的集群服务器的各个节点的负载状态,为各个第一客户端分配节点上的某一第一通讯实例,从而保证系统的负载均衡。In step S101, since the communication system is deployed on the cluster server, the proxy server allocates a first communication instance on the node to each first client according to the load status of each node of the cluster server used by the communication system, thereby ensuring that System load balancing.

在一实施例中,集群服务器利用负载均衡集群,通过负载均衡集群可以把很多客户集中的访问请求负载压力尽可能平均地分摊在计算机集群中处理,客户访问请求负载通常包括应用程序处理负载和网络流量负载。使用同一组应用程序为大量用户提供服务的模式,每个节点都可以承担一定的访问请求负载压力,并且可以实现访问请求在各节点之间动态分配,以实现负载均衡。In one embodiment, the cluster server utilizes a load balancing cluster, and through the load balancing cluster, the load pressure of access requests concentrated by many clients can be distributed as evenly as possible in the computer cluster for processing, and the client access request load usually includes application processing load and network processing load. traffic load. Using the same set of applications to serve a large number of users, each node can bear a certain load of access requests, and access requests can be dynamically distributed among nodes to achieve load balancing.

可以理解地,负载均衡集群(Load Balance Cluster,LB或LBC)为集群服务器中的一种,一般是通过一个或多个前端负载均衡器将客户访问请求分发到后端的一组服务器上,从而达到整个系统的高性能和高可用性,高可用性集群和负载均衡集群会使用类似的技术,或同时具有高可用性与负载均衡的特点。Understandably, a Load Balance Cluster (LB or LBC) is a type of cluster server, which generally distributes client access requests to a set of servers at the back end through one or more front-end load balancers, so as to achieve For the high performance and high availability of the entire system, the high availability cluster and the load balancing cluster will use similar technologies, or have the characteristics of high availability and load balancing at the same time.

步骤S102、根据N个所述第一客户端签名信息建立N个所述第一通讯实例与N个所述第一客户端的第一客户端会话连接。Step S102: Establish first client session connections between the N first communication instances and the N first clients according to the N first client signature information.

在步骤S102中,在建立服务器与第一客户端的连接时,需要将第一客户端对应的第一客户端签名信息进行获取,并保存至服务器从而用于与客户端之间的会话连接认证。In step S102, when establishing the connection between the server and the first client, the first client signature information corresponding to the first client needs to be acquired and stored in the server for authentication of the session connection with the client.

在一实施例中,接收N个所述第一客户端所发出的N个所述第一客户端签名信息,通过N个所述第一通讯实例进行签名信息核验,建立N个所述第一通讯实例与N个所述第一客户端的第一客户端会话连接;将N个所述第一通讯实例的第一通讯实例地址、N个所述第一客户端签名信息和N个所述第一客户端会话连接ID保存至所述集群服务器。In one embodiment, N pieces of the first client signature information sent by the N first clients are received, the signature information is verified through the N first communication instances, and N pieces of the first client are established. The communication instance is connected with the first client sessions of the N first clients; the first communication instance address of the N first communication instances, the N signature information of the first client, and the N first communication instances A client session connection ID is stored to the cluster server.

其中,第一通讯实例地址为第一通讯实例对应的IP地址,用于后续连接第二客户端查找目标第一通讯实例使用;第一客户端签名信息通常包括第一客户端对应的客户端ip和mac地址等;第一客户端会话连接ID为第一客户端与服务器所建立的第一客户端会话连接的ID号,用于保持会话状态;所保存集群服务器中的Redis服务器,基于内存存储的Redis服务器能极大提升数据存储查询性能,集群架构也能保证系统的高可用和大量数据的存储。Wherein, the address of the first communication instance is the IP address corresponding to the first communication instance, which is used for subsequent connection to the second client to find the target first communication instance; the signature information of the first client usually includes the client ip corresponding to the first client and mac address, etc.; the first client session connection ID is the ID number of the first client session connection established by the first client and the server, which is used to maintain the session state; the Redis server in the saved cluster server is based on memory storage The Redis server can greatly improve the performance of data storage and query, and the cluster architecture can also ensure the high availability of the system and the storage of large amounts of data.

可以理解地,Redis(Remote Dictionary Server)即远程字典服务,是一种高性能的key-value数据库,支持存储的value类型较多,包括string(字符串)、list(链表)、set(集合)、zset(sorted set--有序集合)和hash(哈希类型)。redis支持各种不同方式的排序,为了保证效率,数据都是缓存在内存中,并且会周期性的把更新的数据写入磁盘或者把修改操作写入追加的记录文件,并且在此基础上实现了master-slave(主从)同步。在客户端通讯过程中由于对及时性要求比较高,基于Redis内存服务器的存储和查询数据能够减少数据io的时间,集群模式下的Reids也能承载大数据量消息的存储,并且保证高可用。Understandably, Redis (Remote Dictionary Server) is a remote dictionary service. It is a high-performance key-value database that supports many types of stored values, including string (string), list (linked list), and set (collection). , zset (sorted set - ordered set) and hash (hash type). Redis supports sorting in various ways. In order to ensure efficiency, data is cached in memory, and it will periodically write updated data to disk or write modification operations to appended record files, and implement it on this basis. Master-slave (master-slave) synchronization. In the process of client communication, due to the high requirement for timeliness, the storage and query data based on the Redis memory server can reduce the time of data io, and Reids in cluster mode can also carry the storage of large data volume messages and ensure high availability.

步骤S20、根据所述代理服务器所生成的第二客户端的与目标第一客户端通讯请求,从N个所述第一通讯实例中确定目标第一客户端所对应的目标第一通讯实例。Step S20 , determining a target first communication instance corresponding to the target first client from the N first communication instances according to the communication request between the second client and the target first client generated by the proxy server.

在步骤S20中、通过代理服务器接收各客户端的请求,进行预处理以达到集群服务器的负载均衡,在本实施例中,代理服务器还具有根据第二客户端的业务请求分配对应的目标第一客户端,并生成与目标第一客户端通讯请求的目标客户端匹配应用,但该目标客户端匹配应用并不限于设置于代理服务器,还可以设置在其他服务器或服务实例上,以满足第二客户端与第一客户端的通讯业务。In step S20, the request of each client is received through the proxy server, and preprocessing is performed to achieve load balancing of the cluster server. In this embodiment, the proxy server also has a corresponding target first client allocated according to the service request of the second client , and generate a target client matching application that communicates with the target first client, but the target client matching application is not limited to being set on the proxy server, but can also be set on other servers or service instances to meet the needs of the second client Communication service with the first client.

由于服务器具有N个第一通讯实例,第二客户端连接目标第一客户端需要找到连接目标第一客户端对应的第一通讯实例,也就是目标第一通讯实例,进而建立第二客户端与目标第一客户端的通讯连接。Since the server has N first communication instances, when the second client connects to the target first client, it needs to find the first communication instance corresponding to the connection target first client, that is, the target first communication instance, and then establish the connection between the second client and the target first client. The communication connection of the target first client.

在一实施例中,代理服务器利用Nginx作为反向代理服务器,代理服务器在负载均衡集群的反向代理模式下作作为负载均衡设备,当代理服务器收到客户端请求后,会记录下此报文(通常包括源IP地址、目的IP地址、协议号、源端口、目的端口,服务类型以及接口索引),将报文目的地址更改为优选后的集群服务器的IP地址,目的端口号不变,源地址修改为代理服务器下行与对应集群服务器设备接口的IP地址,源端口号随机发送给集群服务器;In one embodiment, the proxy server uses Nginx as a reverse proxy server, and the proxy server acts as a load balancing device in the reverse proxy mode of the load balancing cluster. When the proxy server receives the client request, it will record the message. (usually including source IP address, destination IP address, protocol number, source port, destination port, service type, and interface index), change the destination address of the packet to the IP address of the optimized cluster server, the destination port number remains unchanged, the source The address is modified to the IP address of the proxy server downlink and the corresponding cluster server device interface, and the source port number is randomly sent to the cluster server;

可以理解地,Nginx(engine x)是一种高性能的HTTP和反向代理web服务器,同时也提供了IMAP/POP3/SMTP服务,其中,当Nginx作为负载均衡服务时,Nginx既可以在内部直接支持Rails和PHP程序对外进行服务,也可以支持作为HTTP代理服务对外进行服务。Understandably, Nginx (engine x) is a high-performance HTTP and reverse proxy web server, and also provides IMAP/POP3/SMTP services. When Nginx is used as a load balancing service, Nginx can directly directly It supports Rails and PHP programs to provide external services, and can also support external services as HTTP proxy services.

如图3所示,出了本实施例步骤S20:根据所述代理服务器所生成的第二客户端的与目标第一客户端通讯请求,从N个所述第一通讯实例中确定目标第一客户端所对应的目标第一通讯实例的具体实现流程,作为一个示例,步骤S20中,包括:As shown in FIG. 3 , step S20 of this embodiment is shown: according to the communication request of the second client and the target first client generated by the proxy server, determine the target first client from the N first communication instances The specific implementation process of the target first communication instance corresponding to the terminal, as an example, in step S20, including:

步骤S201、接收所述代理服务器根据第二客户端的通讯业务需求所生成的所述与目标第一客户端通讯请求;Step S201, receiving the communication request with the target first client generated by the proxy server according to the communication service requirements of the second client;

步骤S202、根据所述与目标第一客户端通讯请求中的目标第一客户端ID在集群服务器中匹配所述目标第一客户端ID所对应的目标第一客户端会话连接ID;Step S202, matching the target first client session connection ID corresponding to the target first client ID in the cluster server according to the target first client ID in the communication request with the target first client;

步骤S203、根据所述目标第一客户端会话连接ID从N个所述第一通讯实例中确定目标第一客户端所对应的目标第一通讯实例。Step S203: Determine a target first communication instance corresponding to the target first client from the N first communication instances according to the session connection ID of the target first client.

在步骤S201中,通过接收代理服务器根据第二客户端的通讯业务需求匹配对应的目标第一客户端,生成具有目标第一客户端ID、业务相关等信息的与目标第一客户端通讯请求,进而解决第二客户端的通讯业务需求。In step S201, by receiving the proxy server matching the corresponding target first client according to the communication service requirements of the second client, a communication request with the target first client having information such as the target first client ID, business related information, etc. is generated, and then The communication service requirements of the second client are solved.

在一实施例中,所述代理服务器根据所接收所述第二客户端的通讯业务需求进行业务需求目标匹配,得到所述目标第一客户端;根据所述目标第一客户端和所述第二客户端生成所述与目标第一客户端通讯请求。其中,代理服务器根据第二客户端的通讯业务需求种的关键字进行对应的检索,以匹配对应的目标第一客户端。In one embodiment, the proxy server performs business requirement target matching according to the received communication service requirement of the second client, and obtains the target first client; according to the target first client and the second client The client generates the communication request with the target first client. Wherein, the proxy server performs corresponding retrieval according to the keywords of the communication service requirements of the second client, so as to match the corresponding target first client.

在另一实施例中,通过配件询价场景进行示例,配件商(第一客户端)通过浏览器与服务器建立连接后,发布自身配件供应业务,修理厂用户(第二客户端)通过浏览器发布咨询价格请求,通过代理服务器处理询价相关业务,或利用代理服务器转发到询价交易系统处理询价相关业务,处理成功后将询价相关信息和需要通知的目标配件商id请求到生成对应的与目标第一客户端通讯请求,进而进行下一步的连接,以满足用户和商家的业务沟通寻求。In another embodiment, using an accessory inquiry scenario as an example, after the accessory dealer (the first client) establishes a connection with the server through the browser, it publishes its own accessory supply business, and the user of the repair shop (the second client) uses the browser Publish the inquiry price request, process the inquiry-related business through the proxy server, or use the proxy server to forward it to the inquiry transaction system to process the inquiry-related business. The communication request with the target first client, and then the next connection is carried out to meet the business communication seeking of the user and the merchant.

在步骤S202中,由于第一客户端基于第一通讯实例生成对应的第一客户端会话连接,通过目标第一客户端ID在集群服务器查询到目标第一客户端对应的目标第一客户端会话连接ID,进而通过目标第一客户端会话连接ID找到对应的目标第一通讯实例,进行客户端之间的通讯连接。In step S202, since the first client generates a corresponding first client session connection based on the first communication instance, the target first client session corresponding to the target first client is queried on the cluster server through the target first client ID connection ID, and then find the corresponding target first communication instance through the target first client session connection ID, and perform communication connection between clients.

在步骤S203中,从服务器中的多个第一通讯实力中确定目标第一客户端所对应的目标第一通讯实例,从而建立第二客户端与目标第一客户端之间的通讯连接。In step S203, the target first communication instance corresponding to the target first client is determined from the plurality of first communication capabilities in the server, thereby establishing a communication connection between the second client and the target first client.

在一实施例中,若所述第二客户端连接所述集群服务器所使用的第一通讯实例的第一通讯实例ID为所述目标第一通讯实例时,直接确定所述目标第一客户端所对应的目标第一通讯实例;In one embodiment, if the first communication instance ID of the first communication instance used by the second client to connect to the cluster server is the target first communication instance, the target first client is directly determined the corresponding target first communication instance;

若所述第二客户端所使用的第一通讯实例不为所述目标第一通讯实例,将所述目标第一客户端会话连接ID从N个所述第一通讯实例中确定所述目标第一通讯实例。If the first communication instance used by the second client is not the target first communication instance, the target first client session connection ID is determined from the N first communication instances to determine the target first communication instance. A communication instance.

在一实施例中,目标第一通讯实例会监听服务器所发出的报文,当监听到服务器所发出的报文为具有目标第一客户端会话连接ID的与目标第一客户端通讯请求时,则响应服务器从而确定目标第一通讯实例。In one embodiment, the target first communication instance will monitor the message sent by the server, and when monitoring that the message sent by the server is a communication request with the target first client having the session connection ID of the target first client, Then the response server determines the target first communication instance.

步骤S30、核验所述与目标第一客户端通讯请求中的目标第一客户端ID与所述目标第一客户端的目标第一客户端签名信息,通过所述目标第一通讯实例建立所述第二客户端和目标第一客户端的会话通讯连接。Step S30, verifying the target first client ID in the communication request with the target first client and the target first client signature information of the target first client, and establishing the first target communication instance through the target first communication instance. A session communication connection between the second client and the target first client.

在步骤S30中,当确定第一通讯实例时,核验根据目标第一客户端签名信息核验与目标第一客户端通讯请求中的信息,若核对通过则通过目标第一通讯实例建立第二客户端和目标第一客户端的会话通讯连接,若核验存在问题,则校对与目标第一客户端通讯请求。通过签名核验的方式,保证了第二客户端和目标第一客户端连接的安全性,同时也让消息系统在应对恶意请求有了更好的防护拦截。In step S30, when the first communication instance is determined, the information in the communication request with the target first client is verified according to the signature information of the target first client, and if the verification is passed, the second client is established through the target first communication instance It is connected to the session communication connection with the target first client, and if there is a problem in the verification, the communication request with the target first client is verified. By means of signature verification, the security of the connection between the second client and the target first client is ensured, and at the same time, the message system has better protection and interception in response to malicious requests.

在一实施例中,通过所述目标第一通讯实例将所述与目标第一客户端通讯请求中的所述目标第一客户端ID与所述目标第一客户端的目标第一客户端签名信息中的所述目标第一客户端ID进行核验;通过所述目标第一通讯实例建立所述第二客户端和目标第一客户端的会话通讯连接。In one embodiment, the target first client ID in the communication request with the target first client is combined with the target first client signature information of the target first client through the target first communication instance The target first client ID in is verified; the session communication connection between the second client and the target first client is established through the target first communication instance.

在另一实施例中,配件商通过目标第一客户端会话连接所在的目标第一通讯实例,基于服务器发布订阅功能及时监听到的与配件商的业务请求,以及已建立的会话,在业务中,根据目标第一客户端会话连接ID将询价消息传输给客户端的配件商用户。In another embodiment, the accessory dealer connects to the target first communication instance where the target first client session is located, based on the service request with the accessory dealer that is monitored in time by the server publish and subscribe function, and the established session, in the service , according to the session connection ID of the target first client terminal, the inquiry message is transmitted to the accessories dealer user of the client terminal.

在一实施例中,提供一种线上会话的通讯装置,该线上会话的通讯装置与上述实施例中线上会话的通讯方法一一对应。如图4所示,该线上会话的通讯装置包括通讯建立模块11、目标通讯匹配模块12和与目标通讯连接模块13,各功能模块详细说明如下:In an embodiment, a communication device for an online session is provided, and the communication device for an online session corresponds one-to-one with the communication method for an online session in the above embodiment. As shown in FIG. 4 , the communication device for the online session includes a communication establishment module 11, a target communication matching module 12 and a target communication connection module 13. The detailed description of each functional module is as follows:

通讯建立模块,在根据代理服务器分配的N个第一通讯实例接收到N个第一客户端的连接请求信息时,建立N个所述第一通讯实例与N个所述第一客户端的第一客户端会话连接,其中,N为大于1的整数;The communication establishment module, when receiving the connection request information of the N first clients according to the N first communication instances allocated by the proxy server, establishes the N first communication instances and the N first clients of the first clients End session connection, where N is an integer greater than 1;

目标通讯匹配模块,根据所述代理服务器所生成的第二客户端的与目标第一客户端通讯请求,从N个所述第一通讯实例中确定目标第一客户端所对应的目标第一通讯实例;The target communication matching module determines the target first communication instance corresponding to the target first client from the N first communication instances according to the communication request of the second client and the target first client generated by the proxy server ;

与目标通讯连接模块,核验所述与目标第一客户端通讯请求中的目标第一客户端ID与所述目标第一客户端的目标第一客户端签名信息,通过所述目标第一通讯实例建立所述第二客户端和目标第一客户端的会话通讯连接。A communication connection module with the target, verifying the target first client ID in the communication request with the target first client and the target first client signature information of the target first client, and establishing the target first communication instance through the target first client A session communication connection between the second client and the target first client.

在另一实施例中,提供一种线上会话的通讯装置,还包括:In another embodiment, a communication device for online conversation is provided, further comprising:

代理服务模块,所述代理服务器根据所接收所述第二客户端的通讯业务需求进行业务需求目标匹配,得到所述目标第一客户端;根据所述目标第一客户端和所述第二客户端生成所述与目标第一客户端通讯请求。A proxy service module, wherein the proxy server performs business requirement target matching according to the received communication service requirements of the second client to obtain the target first client; according to the target first client and the second client The communication request with the target first client is generated.

关于线上会话的通讯装置的具体限定可以参见上文中对于线上会话的通讯方法的限定,在此不再赘述。上述线上会话的通讯装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。For the specific limitation of the communication device of the online session, reference may be made to the limitation of the communication method of the online session above, which will not be repeated here. All or part of the modules in the communication device for the above online session can be implemented by software, hardware and combinations thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

在一个实施例中,提供了一种计算机设备,该计算机设备可以是客户端或者服务端,其内部结构图可以如图5所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括可读存储介质、内存储器。该可读存储介质存储有操作系统、计算机程序和数据库。该内存储器为可读存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种线上会话的通讯方法。In one embodiment, a computer device is provided, the computer device may be a client or a server, and its internal structure diagram may be as shown in FIG. 5 . The computer device includes a processor, memory, a network interface, and a database connected by a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a readable storage medium, an internal memory. The readable storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the execution of the operating system and computer programs in the readable storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, an online conversation communication method is realized.

在一个实施例中,提供了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,处理器执行计算机程序时实现上述实施例中线上会话的通讯方法。In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, the communication method for an online session in the above embodiment is implemented .

在一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现上述实施例中线上会话的通讯方法。In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the communication method of the online session in the above-mentioned embodiment is implemented.

本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DD集群服务器DRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage In the medium, when the computer program is executed, it may include the processes of the above-mentioned method embodiments. Wherein, any reference to memory, storage, database or other medium used in the various embodiments provided in this application may include non-volatile and/or volatile memory. Nonvolatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DD cluster server DRAM), enhanced SDRAM (ESDRAM) , Synchlink DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。Those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. Module completion, that is, dividing the internal structure of the device into different functional units or modules to complete all or part of the functions described above.

以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。The above-mentioned embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the above-mentioned embodiments, those of ordinary skill in the art should understand that: it can still be used for the above-mentioned implementations. The technical solutions described in the examples are modified, or some technical features thereof are equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions in the embodiments of the application, and should be included in the within the scope of protection of this application.

Claims (10)

1.一种线上会话的通讯方法,其特征在于,包括:1. a communication method of online session, is characterized in that, comprises: 在根据代理服务器分配的N个第一通讯实例接收到N个第一客户端的连接请求信息时,建立N个所述第一通讯实例与N个所述第一客户端的第一客户端会话连接,其中,N为大于1的整数;When receiving the connection request information of the N first clients according to the N first communication instances allocated by the proxy server, establishing first client session connections between the N first communication instances and the N first clients, Among them, N is an integer greater than 1; 根据所述代理服务器所生成的第二客户端的与目标第一客户端通讯请求,从N个所述第一通讯实例中确定目标第一客户端所对应的目标第一通讯实例;According to the communication request of the second client and the target first client generated by the proxy server, the target first communication instance corresponding to the target first client is determined from the N first communication instances; 核验所述与目标第一客户端通讯请求中的目标第一客户端ID与所述目标第一客户端的目标第一客户端签名信息,通过所述目标第一通讯实例建立所述第二客户端和目标第一客户端的会话通讯连接。Verifying the target first client ID in the communication request with the target first client and the target first client signature information of the target first client, and establishing the second client through the target first communication instance A session communication connection with the target first client. 2.如权利要求1所述的线上会话的通讯方法,其特征在于,所述在根据代理服务器分配的N个第一通讯实例接收到N个第一客户端的连接请求信息时,建立N个所述第一通讯实例与N个所述第一客户端的第一客户端会话连接,其中,N为大于1的整数,包括:2. The communication method of online session as claimed in claim 1, wherein, when receiving the connection request information of N first clients according to N first communication instances allocated by the proxy server, establish N The first communication instance is connected with the first client sessions of N first clients, where N is an integer greater than 1, including: 所述代理服务器根据通讯系统所对应集群服务器的负载状态为N个所述第一客户端分配对应N个所述第一通讯实例;The proxy server allocates the corresponding N first communication instances to the N first clients according to the load state of the cluster server corresponding to the communication system; 根据N个所述第一客户端签名信息建立N个所述第一通讯实例与N个所述第一客户端的第一客户端会话连接。Establish first client session connections between the N first communication instances and the N first clients according to the N first client signature information. 3.如权利要求2所述的线上会话的通讯方法,其特征在于,所述根据N个所述第一客户端签名信息建立N个所述第一通讯实例与N个所述第一客户端的第一客户端会话连接,包括:3. The communication method for an online session according to claim 2, wherein the N first communication instances and the N first clients are established according to the N first client signature information. side of the first client session connection, including: 接收N个所述第一客户端所发出的N个所述第一客户端签名信息,通过N个所述第一通讯实例进行签名信息核验,建立N个所述第一通讯实例与N个所述第一客户端的第一客户端会话连接;Receive the N first client signature information sent by the N first clients, verify the signature information through the N first communication instances, and establish the N first communication instances and the N first communication instances. the first client session connection of the first client; 将N个所述第一通讯实例的第一通讯实例地址、N个所述第一客户端签名信息和N个所述第一客户端会话连接ID保存至所述集群服务器。The N first communication instance addresses, the N first client signature information and the N first client session connection IDs of the N first communication instances are saved to the cluster server. 4.如权利要求1所述的线上会话的通讯方法,其特征在于,所述根据所述代理服务器所生成的第二客户端的与目标第一客户端通讯请求,从N个所述第一通讯实例中确定目标第一客户端所对应的目标第一通讯实例,包括:4 . The communication method for an online session according to claim 1 , wherein, according to the communication request between the second client and the target first client generated by the proxy server, from N said first clients. 5 . In the communication instance, the target first communication instance corresponding to the target first client is determined, including: 接收所述代理服务器根据第二客户端的通讯业务需求所生成的所述与目标第一客户端通讯请求;receiving the communication request with the target first client generated by the proxy server according to the communication service requirements of the second client; 根据所述与目标第一客户端通讯请求中的目标第一客户端ID在集群服务器中匹配所述目标第一客户端ID所对应的目标第一客户端会话连接ID;Match the target first client session connection ID corresponding to the target first client ID in the cluster server according to the target first client ID in the communication request with the target first client; 根据所述目标第一客户端会话连接ID从N个所述第一通讯实例中确定目标第一客户端所对应的目标第一通讯实例。The target first communication instance corresponding to the target first client is determined from the N first communication instances according to the session connection ID of the target first client. 5.如权利要求1所述的线上会话的通讯方法,其特征在于,所述核验所述与目标第一客户端通讯请求中的目标第一客户端ID与所述目标第一客户端的目标第一客户端签名信息,通过所述目标第一通讯实例建立所述第二客户端和目标第一客户端的会话通讯连接,包括:5 . The communication method for an online session according to claim 1 , wherein the verifying the target first client ID in the communication request with the target first client and the target of the target first client. 6 . The first client signature information, establishing a session communication connection between the second client and the target first client through the target first communication instance, including: 通过所述目标第一通讯实例将所述与目标第一客户端通讯请求中的所述目标第一客户端ID与所述目标第一客户端的目标第一客户端签名信息中的所述目标第一客户端ID进行核验;Through the target first communication instance, the target first client ID in the communication request with the target first client is compared with the target first client ID in the target first client signature information of the target first client A client ID for verification; 通过所述目标第一通讯实例建立所述第二客户端和目标第一客户端的会话通讯连接。A session communication connection between the second client and the target first client is established through the target first communication instance. 6.如权利要求4所述的线上会话的通讯方法,其特征在于,所述根据所述目标第一客户端会话连接ID从N个所述第一通讯实例中确定目标第一客户端所对应的目标第一通讯实例,包括:6 . The communication method for an online session according to claim 4 , wherein, according to the session connection ID of the target first client, determining the address of the target first client from the N first communication instances. 7 . The corresponding target first communication instance includes: 若所述第二客户端连接所述集群服务器所使用的第一通讯实例的第一通讯实例ID为所述目标第一通讯实例时,直接确定所述目标第一客户端所对应的目标第一通讯实例;If the first communication instance ID of the first communication instance used by the second client to connect to the cluster server is the target first communication instance, directly determine the target first communication instance corresponding to the target first client communication instance; 若所述第二客户端所使用的第一通讯实例不为所述目标第一通讯实例,将所述目标第一客户端会话连接ID从N个所述第一通讯实例中确定所述目标第一通讯实例。If the first communication instance used by the second client is not the target first communication instance, the target first client session connection ID is determined from the N first communication instances to determine the target first communication instance. A communication instance. 7.如权利要求4所述的线上会话的通讯方法,其特征在于,所述接收所述代理服务器根据第二客户端的通讯业务需求所生成的所述与目标第一客户端通讯请求,所述代理服务器根据第二客户端的通讯业务需求所生成的所述与目标第一客户端通讯请求包括:7. The communication method for an online session according to claim 4, wherein the receiving the communication request with the target first client generated by the proxy server according to the communication service requirements of the second client, the The communication request with the target first client generated by the proxy server according to the communication service requirements of the second client includes: 所述代理服务器根据所接收所述第二客户端的通讯业务需求进行业务需求目标匹配,得到所述目标第一客户端;The proxy server performs business requirement target matching according to the received communication business requirement of the second client to obtain the target first client; 根据所述目标第一客户端和所述第二客户端生成所述与目标第一客户端通讯请求。The communication request with the target first client is generated according to the target first client and the second client. 8.一种线上会话的通讯装置,其特征在于,包括:8. A communication device for an online session, comprising: 通讯建立模块,在根据代理服务器分配的N个第一通讯实例接收到N个第一客户端的连接请求信息时,建立N个所述第一通讯实例与N个所述第一客户端的第一客户端会话连接,其中,N为大于1的整数;The communication establishment module, when receiving the connection request information of the N first clients according to the N first communication instances allocated by the proxy server, establishes the N first communication instances and the N first clients of the first clients End session connection, where N is an integer greater than 1; 目标通讯匹配模块,根据所述代理服务器所生成的第二客户端的与目标第一客户端通讯请求,从N个所述第一通讯实例中确定目标第一客户端所对应的目标第一通讯实例;The target communication matching module determines the target first communication instance corresponding to the target first client from the N first communication instances according to the communication request of the second client and the target first client generated by the proxy server ; 与目标通讯连接模块,核验所述与目标第一客户端通讯请求中的目标第一客户端ID与所述目标第一客户端的目标第一客户端签名信息,通过所述目标第一通讯实例建立所述第二客户端和目标第一客户端的会话通讯连接。A communication connection module with the target, verifying the target first client ID in the communication request with the target first client and the target first client signature information of the target first client, and establishing the target first communication instance through the target first client A session communication connection between the second client and the target first client. 9.一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1至7任一项所述线上会话的通讯方法。9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the computer program as claimed in the claims The communication method for the online conversation described in any one of 1 to 7. 10.一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至7任一项所述线上会话的通讯方法。10. A computer-readable storage medium storing a computer program, characterized in that, when the computer program is executed by a processor, the online session according to any one of claims 1 to 7 is implemented method of communication.
CN202210283166.3A 2022-03-22 2022-03-22 Communication method, device, equipment and storage medium for online conversation Pending CN114615315A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210283166.3A CN114615315A (en) 2022-03-22 2022-03-22 Communication method, device, equipment and storage medium for online conversation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210283166.3A CN114615315A (en) 2022-03-22 2022-03-22 Communication method, device, equipment and storage medium for online conversation

Publications (1)

Publication Number Publication Date
CN114615315A true CN114615315A (en) 2022-06-10

Family

ID=81865731

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210283166.3A Pending CN114615315A (en) 2022-03-22 2022-03-22 Communication method, device, equipment and storage medium for online conversation

Country Status (1)

Country Link
CN (1) CN114615315A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115473866A (en) * 2022-09-14 2022-12-13 康键信息技术(深圳)有限公司 Session management method, system, device and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101543012A (en) * 2006-11-27 2009-09-23 斯凯普有限公司 Communication system
CN110995829A (en) * 2019-11-29 2020-04-10 广州市百果园信息技术有限公司 Instance calling method and device and computer storage medium
WO2022002209A1 (en) * 2020-07-01 2022-01-06 中兴通讯股份有限公司 Data transmission method, proxy server, storage medium, and electronic device
CN114064780A (en) * 2021-11-26 2022-02-18 中国工商银行股份有限公司 Session information processing method, system, device, storage medium and electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101543012A (en) * 2006-11-27 2009-09-23 斯凯普有限公司 Communication system
CN110995829A (en) * 2019-11-29 2020-04-10 广州市百果园信息技术有限公司 Instance calling method and device and computer storage medium
WO2022002209A1 (en) * 2020-07-01 2022-01-06 中兴通讯股份有限公司 Data transmission method, proxy server, storage medium, and electronic device
CN114064780A (en) * 2021-11-26 2022-02-18 中国工商银行股份有限公司 Session information processing method, system, device, storage medium and electronic equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115473866A (en) * 2022-09-14 2022-12-13 康键信息技术(深圳)有限公司 Session management method, system, device and storage medium

Similar Documents

Publication Publication Date Title
US11102125B2 (en) Securing communications between services in a cluster using load balancing systems and methods
US8533453B2 (en) Method and system for configuring a server and dynamically loading SSL information
US20080176536A1 (en) Enterprise web service data to mobile device synchronization
KR102208935B1 (en) Messaging api over http protocol to establish context for data exchange
CN113810349B (en) Data transmission method, device, computer equipment and storage medium
WO2013060210A1 (en) Sharing control system and method for network resources download information
CN106797384B (en) Routing requests to the same endpoint in a cluster in different protocols
CN114979097B (en) Message pushing method and device based on MQTT and electronic equipment
US11206207B1 (en) Managed multicast communications across isolated networks
WO2023000940A1 (en) Data processing method and apparatus, and network element device, storage medium and program product
US11843642B1 (en) Serverless signaling in peer-to-peer session initialization
CN114301872B (en) Domain name based access method and device, electronic equipment and storage medium
CN114615315A (en) Communication method, device, equipment and storage medium for online conversation
CN106487643A (en) A kind of information storage means of instant messaging and device
CN113612811B (en) Method, system, equipment and medium for client mounting in multiple channels
CN114025005B (en) Data communication method, system, electronic equipment and storage medium
CN103731506B (en) A kind of content injection method, the first business service node and content distributing network
CN115202894A (en) Interface service calling method and device, computer equipment and storage medium
Toth Design of a social messaging system using stateful multicast
US11765240B1 (en) Distributed publication/subscription as a service computing system
CN115633082B (en) Identification processing method, device, equipment and storage medium for calling middle service
US12010140B1 (en) Metering interactive electronic activities
Wang et al. NCDN: A Node‐Failure Resilient CDN Solution with Reinforcement Learning Optimization
US20240333814A1 (en) Data processing method based on blockchain, computer device, and storage medium
CN114500485B (en) Data processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20220610