Bidirectional real-time communication system and method based on WebSocket and message queue

A message queue and real-time communication technology, applied in the field of communication, can solve the problem of being unable to locate the location of the client WebSocket service

Inactive Publication Date: 2019-02-19
苏州创旅天下信息技术有限公司
View PDF9 Cites 14 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0007] The first object of the invention is to provide a system for two-way real-time communication based on WebSocket and message queue, which has the advantage that the server receives messages in a passive manner, which solves the performance problem caused by polling;
[0008] The second purpose of the invention is to provide a method for tw

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Bidirectional real-time communication system and method based on WebSocket and message queue
  • Bidirectional real-time communication system and method based on WebSocket and message queue
  • Bidirectional real-time communication system and method based on WebSocket and message queue

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0064] refer to figure 1 , is a two-way real-time communication system based on WebSocket and message queue disclosed in the present invention, including a server 10, a client 20, an identification module 30 and a classification data set 40. The server 10 is deployed in a cluster and used to establish a WebSocket service, and the client 20 is used to initiate a WebSocket connection to the server 10 .

[0065] refer to figure 1 , the server 10 includes a marking module 11 and an indexing module 12 . The marking module 11 is used for establishing a unique identifier for the client 20 when the client 20 is connected to the server 10 . The indexing module 12 is configured to establish an index according to the unique identifier established by the marking module 11, and the index is used to locate the position of the client 20 in the WebSocket service. When the server 10 receives the message published by the message producer from the subscribed message queue in the form of messa...

Embodiment 2

[0077] refer to image 3 , is a method for realizing two-way real-time communication based on WebSocket and message queue disclosed in the present invention. The method for realizing two-way real-time communication based on WebSocket and message queue is based on the system for realizing two-way real-time communication based on WebSocket and message queue in Embodiment 1. Include the following steps:

[0078] S10, establishing a WebSocket service through the server 10. Specifically, the server 10 is deployed in a cluster.

[0079] S20, establishing a WebSocket connection between the client 20 and the server 10.

[0080] S30. Establish a unique identifier for the connected client 20 through the server 10.

[0081] S40. Establish an index for locating the location of the client 20 in the WebSocket service according to the corresponding unique identifier.

[0082] S50. Receive the message published by the message producer from the subscribed message queue through the server 1...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a bidirectional real-time communication system and method based on a WebSocket and a message queue and relates to the technical field of communication. The problem that an existing real-time communication scheme based on the WebSocket protocol is liable to result in the condition that rear end service and a database need to bear a great deal of concurrent pressure is solved. According to the technical scheme key point, the system comprises a server and clients. The server comprises a marking module which is used for establishing unique identifications for the clients connected with the server, and an index module which is used for establishing indexes according to the unique identifications established by the marking module, wherein the indexes are used for positioning positions of the clients in WebSocket service. The server receives messages issued by a receiving message producer from a subscribed message queue in a message queue consumer mode and pushes the received messages to the clients according to the indexes. The server receives the messages passively and then pushes the messages to the corresponding clients, so the performance problem resulting from polling is solved.

Description

technical field [0001] The invention relates to the field of communication technology, in particular to a system and method for realizing two-way real-time communication based on WebSocket and message queue. Background technique [0002] Currently, the most widely used network protocol on the Internet is Hypertext Transfer Protocol (HTTP, HyperText Transfer Protocol). The working principle of HTTP is that the client keeps sending Ajax requests to the server (that is, let the client send a request every few seconds to ask the server if there is new information), and the server immediately returns the response information and closes the connection after receiving the request . At this point, the connection between the client and the server is terminated. If the client does not obtain the expected data, it needs to repeat the above steps to establish a connection again. [0003] Although the client can obtain the latest data as soon as possible (depending on the polling inter...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): H04L29/08H04L29/06
CPCH04L65/1069H04L67/02H04L67/141H04L69/162H04L67/55
Inventor 肖昆吴相武
Owner 苏州创旅天下信息技术有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products