Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

HTTP and WebSocket collaborative distributed state synchronization method

A state synchronization and distributed technology, applied in the field of data communication, can solve the problems of not being simple enough, limited scalability, etc., and achieve the effect of solving user authentication and client IP tracking

Active Publication Date: 2020-12-22
FOCUS TECH
View PDF6 Cites 4 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] Patents CN2019104677729-distributed push method for single-user multi-site login based on websocket, CN2019113338150-distributed server cluster interaction method and device based on WebSocket, both provide technical solutions based on distributed scenarios, but need to use messages or storage , not concise enough for practical application
At the same time, the existing technology only uses one protocol at the same time, and the scalability is limited

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
  • HTTP and WebSocket collaborative distributed state synchronization method
  • HTTP and WebSocket collaborative distributed state synchronization method
  • HTTP and WebSocket collaborative distributed state synchronization method

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0039] The present invention will be further described below in conjunction with accompanying drawing and exemplary embodiment:

[0040] Such as figure 1 Shown is a flow chart of a distributed state synchronization method in which HTTP and WebSocket cooperate in an embodiment of the present invention, and the specific steps include:

[0041] Step S1: WebSocket server cluster initialization, each WebSocket server node initializes and generates a concurrent hash table and heartbeat detection thread: deploys a WebSocket server cluster, configures the initial URL of the server cluster, and initializes and generates a concurrent hash table and heartbeat when each WebSocket server node in the cluster starts Detection thread; the initial URL of the server cluster includes the WSS protocol applicable to the browser end, the WSS protocol applicable to the APP end, and the WS protocol; the concurrent hash table adopts a Key-Value storage structure, including a session hash table session...

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 an HTTP and WebSocket collaborative distributed state synchronization method which is characterized by comprising the following steps: step 1, initializing a WebSocket server cluster, step 2, reconstructing a URL of the WebSocket server cluster, step 3, allocating a WebSocket session to each client, step 4, detecting whether long connection is normal, step 5, determining aservice state change request. Step 6, calling a service server to process the request, and feeding back a result to the client, step 7, sending the request to the WebSocket server node, and step 8, closing the long connection. The WebSocket server is used for replacing an original client to send heartbeat detection, messages or external storage is not used, the effects of being simple in deployment and easy to expand are achieved, and meanwhile the using function requirements of different scenes are met.

Description

technical field [0001] The invention relates to the technical field of data communication, in particular to a distributed state synchronization method in which HTTP and WebSocket cooperate. Background technique [0002] In real-time communication fields such as audio and video, screen sharing, etc., for efficient collaboration between users, a real-time status synchronization system is required, which is compatible with browsers and APPs. WebSocket uses persistent connections to realize instant messaging from the server to the client. However, when the client requests the server, the operation result cannot be sensed in real time due to the use of asynchronous messages, and the operation may be wrong. Using the WebSocket protocol alone requires an additional authentication mechanism. [0003] In terms of WebSocket long connection, the existing technology mostly uses the client to send heartbeat and can only send text, which needs to be implemented simultaneously by the clien...

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/06H04L29/08
CPCH04L67/025H04L67/1097H04L67/146H04L67/1095H04L69/162
Inventor 柳栋淼黄蓉邬江明
Owner FOCUS TECH
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products