Unlock instant, AI-driven research and patent intelligence for your innovation.

Implementation method of communication mode, server and client

A technology of implementation method and communication method, applied in the field of data communication, can solve the problems of cumbersome configuration process, increasing the attack surface of illegal network access, and large memory resources, etc.

Pending Publication Date: 2021-05-11
深圳市位元领航科技有限公司
View PDF7 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0007] The communication method based on HTTP or HTTPS protocol has formed a stable programming model and deployment model, which has been widely used, and a large number of software systems are developed based on this set of programming model and deployment model; but in this mode It is difficult to realize that the server can actively send messages to the client, so in order to realize that the server can actively send messages to the client, the existing development model based on a new RPC (Remote Procedure Call) mode between the server and the client is generally used to implement WebSocket. Communication method, but the existing WebSocket communication method uses large memory resources, and needs to set network listening ports on both the server and the client
A network listening port is set on each client, and corresponding information needs to be configured on firewalls, routers, VPNs, and other devices on the network channel. This configuration process is very cumbersome and error-prone, and it also increases illegal attack surface of access

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
  • Implementation method of communication mode, server and client
  • Implementation method of communication mode, server and client
  • Implementation method of communication mode, server and client

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0082] This embodiment involves the interaction between the client and the server, please refer to figure 1 , image 3 , a method for implementing a communication method, comprising the steps of:

[0083] S1. The server establishes an HTTP or HTTPS connection with the client;

[0084] Among them, in this embodiment, a distributed computer system supporting a broad scope of client-server mode, the client includes but is not limited to network servers, PCs, mobile devices such as mobile phones and tablets, and Internet of Things terminal devices, servers include but not limited to It is limited to servers in the Internet, local area network, or Internet of Things and other networks; in the implementation of specific applications, the server and the client are a virtual definition, not the physical concept of the server and the client, their roles can be switched, and the originator of the heartbeat information can be The client can also be the server; in the same way, the resp...

Embodiment 2

[0099] The difference between this embodiment and Embodiment 1 is that it defines how to send a connection upgrade request to the client through the HTTP or HTTPS connection:

[0100] In an optional implementation manner, the sending a connection upgrade request to the client through the HTTP or HTTPS connection includes:

[0101] receiving the heartbeat information sent by the client through the HTTP or HTTPS connection;

[0102] Send response information for the heartbeat information to the client through the HTTP or HTTPS connection, where the response information carries the connection upgrade request;

[0103]Specifically, in this embodiment, the client regularly sends one-way heartbeat data to the server, and its heartbeat data can be TCP heartbeats including TCP protocol layer heartbeats and application layer heartbeats, or UDP-based application layer heartbeats, and the server sends The client sends the response information for the heartbeat information, which can con...

Embodiment 3

[0113] The difference between this embodiment and Embodiment 1 and Embodiment 2 is that it defines how to switch a WebSocket connection to an HTTP or HTTPS connection:

[0114] Among them, HTTP or HTTPS communication is widely used, mature and reliable, especially in a large amount of data transmission scenarios; while WebSocket communication is short and compact, with low overhead, and data transmission can be duplexed in real time, so it can be used in command transmission or small data transmission Has a strong competitive advantage;

[0115] Specifically, in this embodiment, two modes of WebSocket connection and HTTP or HTTPS connection are provided at the same time, and a specific communication mode is selected according to business requirements. The instruction information or a small amount of data between the client and the server can be communicated through the WebSocket connection; if there is a large amount of data to be transmitted between the client and the server,...

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 implementation method of a communication mode, a server and a client, and the method comprises the steps: firstly building HTTP or HTTPS connection with the client, sending a connection upgrading request to the client through the HTTP or HTTPS connection when the WebSocket connection needs to be built, receiving a WebSocket connection building request sent by the client through the HTTP or HTTPS, and therefore, the HTTP or HTTPS connection can be dynamically upgraded into the WebSocket connection according to the WebSocket connection establishment request as required, the WebSocket connection is established by utilizing a mature development framework and resources of the HTTP or HTTPS, the traditional effective deployment mode and development mode of the HTTP or HTTPS can be continued, a brand-new development mode and deployment mode of the WebSocket do not need to be introduced, the development steps are simplified, and the resources are saved; and moreover, the switching between the HTTP or HTTPS connection and the WebSocket connection can be realized, the connection mode is selected according to the actual situation, and the transmission efficiency and the flexibility of communication connection are improved.

Description

technical field [0001] The present invention relates to the technical field of data communication, in particular to a method for realizing a communication mode, a server and a client. Background technique [0002] Now network communication usually adopts TCP protocol transmission or UDP protocol transmission. TCP transmission is usually used for reliable transmission services, providing congestion control, error control and flow control. UDP transmission does not require connection establishment, and does not provide flow control, data response and state maintenance. The biggest advantage is that it is fast and does not guarantee the correctness of data. Sex and sequence, often used for video or voice functions. Based on the TCP protocol, there is a TCP heartbeat mechanism at the protocol layer, and a TCP application heartbeat mechanism can also be established at the application layer above the TCP protocol; based on the connectionless UDP protocol, there is no heartbeat me...

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/08
CPCH04L67/02H04L67/141H04L67/145
Inventor 李杏萍郭道远
Owner 深圳市位元领航科技有限公司
Features
  • R&D
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More