CN108418799A - Long establishment of connection method and system - Google Patents
Long establishment of connection method and system Download PDFInfo
- Publication number
- CN108418799A CN108418799A CN201810102354.5A CN201810102354A CN108418799A CN 108418799 A CN108418799 A CN 108418799A CN 201810102354 A CN201810102354 A CN 201810102354A CN 108418799 A CN108418799 A CN 108418799A
- Authority
- CN
- China
- Prior art keywords
- client
- long
- server
- connection
- relevant parameter
- 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
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/08—Network architectures or network communication protocols for network security for authentication of entities
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/14—Session management
- H04L67/141—Setup of application sessions
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/16—Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Computer Hardware Design (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention discloses a kind of long establishment of connection method and system, is sent by client and carry the registration request of effective credential information to message center, the heart carries out client registers in the message;Message center verifies client, and according to the effective credential information carried in the registration request after verifying successfully, and it includes the long registering result information for connecting relevant parameter to client to send;Client receives the registering result information that message center is sent and parses, and obtains the long connection relevant parameter in the registering result information, and the long connection relevant parameter based on acquisition, long connection is established with server-side;It avoids client and carries the network service attack that the access address of long connection cluster may cause, improve the safety that long connection is established.
Description
Technical field
The present invention relates to internet of things field, more particularly to a kind of long establishment of connection method and system.
Background technology
Currently, being essentially all by establishing and keeping TCP in environment of internet of things, between server and client side
(Transmission Control Protocol, transmission control protocol) long connection, to carry out information exchange;Based on TCP long
Connection, communication system can ensure server in time by mission dispatching to corresponding client, so that client receives and rings
It should task.It when TCP long connections are established, is usually sent out by user end to server and establishes TCP long connection requests, server is agreed to
And create TCP long connections.During above-mentioned long establishment of connection, client is connected by long by the authority information of client
(for example, username and password) is sent to server and is verified;If server-side verifying authorization passes through, long connection is kept;
If server-side verifying authorization fails, current long connection is broken.
Mode is established in existing long connection so that when long connection is established, the access address of long connection cluster (such as IP
Location or domain name) it is exposed to client at the very start, after developer obtains client code, can easily it send out
Go out SYN Flood attacks (Denial of Service attack), causes cloud service to paralyse, safety is low.
Invention content
The present invention provides a kind of long establishment of connection method and system, it is intended to client be avoided to carry the visit of long connection cluster
It asks address, improves the safety that long connection is established.
The present invention provides a kind of long establishment of connection method, the long establishment of connection method includes:
The registration request of the effective credential information of client transmission carrying to message center, the in the message heart carries out client note
Volume;
Message center verifies client according to the effective credential information carried in the registration request, and
After verifying successfully, it includes the long registering result information for connecting relevant parameter to client to send;
Client receives the registering result information that message center is sent and parses, and obtains in the registering result information
Long connection relevant parameter, and the long connection relevant parameter based on acquisition establishes long connection with server-side.
Preferably, the length that the message center is sent after verifying successfully connects relevant parameter and includes:Server-side
Long connection cluster access address;
Wherein, the long connection cluster access address includes:IP address and domain name.
Preferably, the long connection relevant parameter of the client based on acquisition, long connection, packet are established with server-side
It includes:
The long connection relevant parameter of the client based on acquisition, establishes TCP connection with server-side, constructs and send carrying
The CONNECT data packets of client relevant parameter are to server-side;
Server-side receives the CONNECT data packets, and verifies the corresponding ginseng of client in the CONNECT data packets
Number, constructs and sends CONNACK data packets to client;
Client identifies whether the long connection with server-side is successfully established according to the CONNACK data packets received;
If the long connection with server-side is successfully established, corresponding business processing event is executed;
It is rejected if the long connection with server-side is established, breaks prompt letter corresponding to the TCP connection of server-side and transmission
Breath.
Preferably, for the message center after verifying successfully, it includes the long registering result information for connecting relevant parameter to send
To client, including:
Message center sends the corresponding heartbeat detection time to client according to the corresponding characteristic information of client;
Wherein, the characteristic information of the client includes:The type of hardware of client and/or the application scenarios of client.
Preferably, if the long connection of the client and server-side is successfully established, when client is by the heartbeat detection
Between be sent to server-side;
The long connection cluster of server-side detects whether the long connection with client disconnects according to the heartbeat detection time.
Corresponding to a kind of long establishment of connection method that above example is provided, the present invention also provides a kind of long connections
Establish system, the long establishment of connection system includes client and message center;Wherein:
The client is used for:Send and carry the registration request of effective credential information to message center, in the message the heart into
Row client registers;
The message center is used for:According to the effective credential information carried in the registration request, to client into
Row verification, and after verify successfully, it includes that length connects the registering result information of relevant parameter to client to send;
The client is additionally operable to:It receives the registering result information that message center is sent and parses, obtain the note
Long connection relevant parameter in volume result information, and the long connection relevant parameter based on acquisition, long connect is established with server-side
It connects.
Preferably, the length that the message center is sent after verifying successfully connects relevant parameter and includes:Server-side
Long connection cluster access address;
Wherein, the long connection cluster access address includes:IP address and domain name.
Preferably, the long establishment of connection system further includes server-side;Wherein:
The client is used for:The long connection relevant parameter based on acquisition, TCP connection is established with the server-side,
It constructs and sends the CONNECT data packets for carrying client relevant parameter to server-side;
The server-side is used for:The CONNECT data packets are received, and verify client in the CONNECT data packets
Relevant parameter, construct and send CONNACK data packets to client;
Client is additionally operable to:
According to the CONNACK data packets received, identify whether the long connection with server-side is successfully established;
If the long connection with server-side is successfully established, corresponding business processing event is executed;
It is rejected if the long connection with server-side is established, breaks prompt letter corresponding to the TCP connection of server-side and transmission
Breath.
Preferably, the message center is used for:
After being verified successfully to client, according to the corresponding characteristic information of the client, corresponding heartbeat detection is sent
Time is to the client;
Wherein, the characteristic information of the client includes:The type of hardware of client and/or the application scenarios of client.
Preferably, the client is used for:If the long connection of the client and server-side is successfully established, by the heart
It jumps detection time and is sent to server-side;
The server-side is used for:According to the heartbeat detection time, long connection cluster detection and the client are utilized
Whether long connection disconnects.
A kind of long establishment of connection method and system of the present invention can reach following advantageous effect:
It is sent by client and carries the registration request of effective credential information to message center, the heart carries out client in the message
End registration;Message center verifies client according to the effective credential information carried in the registration request, and
After verifying successfully, it includes the long registering result information for connecting relevant parameter to client to send;Client receives message center hair
The registering result information sent simultaneously parses, and obtains the long connection relevant parameter in the registering result information, and based on obtaining
The long connection relevant parameter, establish long connection with server-side;Avoid the access address that client carries long connection cluster
The network service attack that may cause improves the safety that long connection is established.
Other features and advantages of the present invention will be illustrated in the following description, also, partly becomes from specification
It obtains it is clear that understand through the implementation of the invention.The purpose of the present invention and other advantages can be by the explanations write
Pointed content is realized and is obtained in book, claims and attached drawing.
Below by drawings and examples, technical scheme of the present invention is described further.
Description of the drawings
Attached drawing is used to provide further understanding of the present invention, and a part for constitution instruction, the reality with the present invention
It applies example to be used to explain the present invention together, not be construed as limiting the invention.In the accompanying drawings:
Fig. 1 is a kind of flow diagram of embodiment of the long establishment of connection method of the present invention;
Fig. 2 is a kind of implementation that long connection relevant parameter of the client of the present invention based on acquisition establishes long connection with server-side
The flow diagram of mode;
Fig. 3 is a kind of high-level schematic functional block diagram of embodiment of the long establishment of connection system of the present invention;
Fig. 4 is the high-level schematic functional block diagram of the another embodiment of the long establishment of connection system of the present invention.
Specific implementation mode
Hereinafter, preferred embodiments of the present invention will be described with reference to the accompanying drawings, it should be understood that preferred reality described herein
Apply example only for the purpose of illustrating and explaining the present invention and is not intended to limit the present invention.
The long establishment of connection method and system that the present invention provides a kind of under environment of internet of things, it is intended to avoid client
The access address for carrying long connection cluster improves the safety that long connection is established.The long establishment of connection method and system of the present invention
In, client code does not embody the access address of long connection cluster, needs client to provide effective voucher and message center is gone to carry out
Client registers, and after client registers success, different long connection cluster access address is issued to client by message center
End, ensures the use of normal client.Therefore, this processing of long establishment of connection method and system disclosed by the invention
Mode will not influence message center and issue different long connection clusters even if the long connection cluster of Cloud Server is under attack
Access address is to client, to ensure that the use of normal client.
As shown in Figure 1, Fig. 1 is a kind of a kind of flow diagram of embodiment of long establishment of connection method of the present invention;
A kind of long establishment of connection method of the present invention may be implemented as the step S10-S30 of description:
Step S10, the registration request of the effective credential information of client transmission carrying to message center, the in the message heart carries out
Client registers;
In the long establishment of connection method of the present invention, in long establishment of connection flow, message center is introduced, and will be in message
Validity check of the heart as client.Therefore, during long connection is established, client need to send corresponding registration request
To message center, to which the heart carries out the registration of client in the message.
In the embodiment of the present invention, client is sent in the registration request of message center, carries that the client is corresponding to be had
Credential information is imitated, validity check is carried out to the client of the registration for message center.
Step S20, message center carries out client according to the effective credential information carried in the registration request
Verification, and after verify successfully, it includes growing to connect the registering result information of relevant parameter to client to send;
Message center receives the registration request of client transmission, is believed according to the effective voucher carried in the registration request
Breath, verifies the client;And after verifying successfully, corresponding registering result information is sent to client;Above-mentioned registration
Result information includes that client establishes the long connection relevant parameter needed for long connection with server-side.The length connects relevant parameter packet
It includes but is not limited to:The access address of the long connection cluster of server-side, such as IP address and domain name etc..
If message center is unsuccessful to effective credential information verification of the client, it is related that corresponding long connection is not sent
Parameter;For example, for abnormal client, message center is unsuccessful to the verification of above-mentioned abnormal client side, then does not send corresponding
Long connection relevant parameter;To effectively prevent:Because corresponding long connected reference cluster address is exposed to visitor in long Connecting quantity
Family end and the SYN Flood attack (Denial of Service attack) that may occur.
Step S30, client receives the registering result information of message center transmission and parses, and obtains the registration knot
Long connection relevant parameter in fruit information, and the long connection relevant parameter based on acquisition, long connection is established with server-side.
After the heart succeeds in registration client in the message, client receives the corresponding note of the client that message center is sent
Volume result information;Client parses above-mentioned registering result, obtains the related ginseng of long connection in the registering result information
Number, and the long connection relevant parameter based on acquisition, establish TCP connection, and the TCP connection based on foundation, visitor with server-side
Family end carries out data interaction with server-side, to judge whether the connection foundation of client and server-side succeeds;If with server-side
Connection be successfully established, client then carries out subsequent business processing, if unsuccessful, client is established in the connection with server-side
TCP connection is broken with server-side;Meanwhile client sends out corresponding prompt.
In a preferred embodiment of the invention, long connection relevant parameter of the client based on acquisition is established with server-side to be grown
Connection, can be implemented by mode shown in Fig. 2.Fig. 2 is please referred to, Fig. 2 is long connection phase of the client of the present invention based on acquisition
Related parameter establishes a kind of flow diagram of embodiment of long connection with server-side;As shown in Fig. 2, the present invention grows building for connection
In cube method, the long connection relevant parameter of the client based on acquisition establishes long connection with server-side, may be implemented as
Step S31-S35 described below:
Step S31, the long connection relevant parameter of the client based on acquisition, establishes TCP connection, construction is simultaneously with server-side
The CONNECT data packets for carrying client relevant parameter are sent to server-side;
In the embodiment of the present invention, the registering result that client is issued by parsing message center obtains corresponding long connection
Relevant parameter;According to the long connection cluster access address in the long connection relevant parameter of acquisition, TCP connection is established with server-side,
And the TCP connection based on foundation, client construct and send corresponding CONNECT data packets to server-side;Wherein, should
The relevant parameter of the client is carried in CONNECT data packets.Wherein, CONNECT data packets must be that TCP connection is established
Afterwards, first message that client is sent to server-side, it is currently which is used for identifying for which client connection
Message center and message center has been arrived to verify the associated rights of the client.
Step S32, server-side receives the CONNECT data packets, and verifies client in the CONNECT data packets
Relevant parameter constructs and sends CONNACK data packets to client;
Server-side receives the CONNECT data packets of client transmission, verifies visitor corresponding in the CONNECT data packets
The relevant parameter at family end;If the relevant parameter for verifying client in the CONNECT data packets is effective, agreement is built with the client
Vertical long connection;If the relevant parameter for verifying client in the CONNECT data packets is invalid, refusal establishes long connect with the client
It connects;And break the TCP connection of server-side.
After the completion of server-side is to the CONNECT packet authentications of client, according to verification result, server-side construction
CONNACK data packets, and CONNACK data packets are sent to client;The CONNACK data packets are server-sides
The no confirmation message for establishing long connection.
Step S33, client identifies whether the long connection with server-side establishes according to the CONNACK data packets received
Success;If the long connection with server-side is successfully established, S34 is thened follow the steps;It is rejected if the long connection with server-side is established,
Execute step S35;
Step S34, corresponding business processing event is executed;
Step S35, it breaks and the TCP connection of server-side and sends corresponding prompt message.
Client receives the CONNACK data packets of server-side return, identifies whether the long connection with server-side is created as
Work(;If the long connection with server-side is successfully established, follow-up corresponding business processing event is executed;If long with server-side connects
Foundation is rejected, then breaks and the TCP connection of server-side and send corresponding prompt message, to pass through prompt message prompt use
The long connection of family and server-side is not successfully established.
In the embodiment of the present invention, the long establishment of connection message of client and server-side is two-way, i.e., above-mentioned long connection
It includes CONNECT data packets and CONNACK data packets to establish message, thus, which client and server-side are well understood by that
Long establishment of connection state between this, and long the reason of connecting when establishing unsuccessful.For example, when client receives server-side
When the CONNACK data packets of return, if data content status is not equal to 0, corresponding error condition can be converted to and be carried
Show that language is reported to user, to improve the efficiency solved the problems, such as, while the user experience is improved.For example, in a specific applied field
Jing Zhong, status value are as follows:0, connection is successfully established;1:Connection refusal, version number do not support;2:Connection refusal, client
ID is illegal;3:Connection refusal, service are unavailable;4:Connection refusal, user name or password mistake;5:Connection refusal, current visitor
Family end is uncommitted;6:Connection refusal, heartbeat detection time are illegal.Thus, which the long connection of client and server-side is built
Founding unsuccessful reason can be very clear.
In a preferred embodiment of the invention, for message center after being verified successfully to client, transmission includes long connection
While registering result information to the client of relevant parameter, message center sends phase according to the corresponding characteristic information of client
The heartbeat detection time KeepAlive answered is to client;Wherein, the characteristic information of the client includes:The hardware of client
The application scenarios of type and/or client.If the long connection of client and server-side is successfully established, client is again by the client
The corresponding specific heartbeat detection time is held to be sent to server-side;The long connection cluster of server-side according to the heartbeat detection time,
Detect whether the long connection with client disconnects.Thus, after client and server-side establish TCP connection success, client
End is sent to above-mentioned heartbeat detection time KeepAlive the long connection cluster of server-side;So, the long connection of server-side
Cluster can be attached broken detection according to the specific value of heartbeat detection time KeepAlive, so as to anti-in time
The broken situation of feedback connection.This mode of operation, realize client and server-side length connection establish whether break it is two-way anti-
Conditional code is established in feedback, the connection that client also can be best understood from server-side.Since distinct device or identical equipment exist
Different scenes, detecting period has different demands after being broken to TCP long connections, passes through above-mentioned heartbeat detection time KeepAlive
Specific value, you can the different demands being adapted to well in Internet of Things avoid after the length connection of existing Internet of Things is established only
There can be unified connection to break the deficiency of detection time.
A kind of long establishment of connection method of the present invention sends the registration request of the effective credential information of carrying extremely by client
Message center, in the message the heart carry out client registers;Message center according to carried in the registration request it is described effectively with
Information is demonstrate,proved, client is verified, and after verifying successfully, it includes that length connects the registering result information of relevant parameter extremely to send
Client;Client receives the registering result information that message center is sent and parses, and obtains in the registering result information
Long connection relevant parameter, and the long connection relevant parameter based on acquisition establishes long connection with server-side;Avoid client
End carries the network service attack that the access address of long connection cluster may cause, and improves the safety that long connection is established.
Corresponding to a kind of long establishment of connection method that Fig. 1 and Fig. 2 are provided, the present invention also provides a kind of long connections
Establish system.As shown in figure 3, the long establishment of connection system of the present invention includes:Client 100 and message center 200;Wherein:
The client 100 is used for:It sends and carries the registration request of effective credential information to message center, in the message the heart
Carry out client registers;
The message center 200 is used for:According to the effective credential information carried in the registration request, to client
100 are verified, and after verifying successfully, and it includes the long registering result information for connecting relevant parameter to client 100 to send;
The client 100 is additionally operable to:It receives the registering result information that message center 200 is sent and parses, obtain
Long connection relevant parameter in the registering result information, and the long connection relevant parameter based on acquisition, build with server-side
Vertical long connection.
In a preferred embodiment of the invention, the length that the message center 200 is sent after verifying successfully connects
Relevant parameter includes:The long connection cluster access address of server-side;
Wherein, the long connection cluster access address includes:IP address and domain name.
In a preferred embodiment of the invention, as shown in figure 4, the long establishment of connection system further includes server-side
300;Wherein:
The client 100 is used for:The long connection relevant parameter based on acquisition, TCP is established with the server-side 300
Connection constructs and sends the CONNECT data packets for carrying 100 relevant parameter of client to server-side 300;
The server-side 300 is used for:The CONNECT data packets are received, and verify client in the CONNECT data packets
The relevant parameter at end 100, constructs and sends CONNACK data packets to client 100;
Client 100 is additionally operable to:
According to the CONNACK data packets received, identify whether the long connection with server-side 300 is successfully established;
If the long connection with server-side 300 is successfully established, corresponding business processing event is executed;
It is rejected, breaks corresponding to the TCP connection of server-side 300 and transmission if the long connection with server-side 300 is established
Prompt message.
In a preferred embodiment of the invention, the message center 200 is used for:
After being verified successfully to client 100, according to 100 corresponding characteristic information of the client, the corresponding heart is sent
Detection time is jumped to the client 100;
Wherein, the characteristic information of the client 100 includes:The type of hardware of client 100 and/or client 100
Application scenarios.
In a preferred embodiment of the invention, the client 100 is used for:If the client 100 and server-side 300
Long connection be successfully established, then the heartbeat detection time is sent to server-side 300;
The server-side 300 is used for:According to the heartbeat detection time, long connection cluster detection and the client are utilized
Whether 100 long connection disconnects.
A kind of long establishment of connection system of the present invention sends the registration request of the effective credential information of carrying extremely by client
Message center, in the message the heart carry out client registers;Message center according to carried in the registration request it is described effectively with
Information is demonstrate,proved, client is verified, and after verifying successfully, it includes that length connects the registering result information of relevant parameter extremely to send
Client;Client receives the registering result information that message center is sent and parses, and obtains in the registering result information
Long connection relevant parameter, and the long connection relevant parameter based on acquisition establishes long connection with server-side;Avoid client
End carries the network service attack that the access address of long connection cluster may cause, and improves the safety that long connection is established.
It should be understood by those skilled in the art that, the embodiment of the present invention can be provided as method, system or computer program
Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the present invention
Apply the form of example.
The present invention be with reference to according to the method for the embodiment of the present invention, the flow of equipment (system) and computer program product
Figure and/or block diagram describe.It should be understood that can be realized by computer program instructions every first-class in flowchart and/or the block diagram
The combination of flow and/or box in journey and/or box and flowchart and/or the block diagram.These computer programs can be provided
Instruct the processor of all-purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce
A raw machine so that the instruction executed by computer or the processor of other programmable data processing devices is generated for real
The device for the function of being specified in present one flow of flow chart or one box of multiple flows and/or block diagram or multiple boxes.
These computer program instructions, which may also be stored in, can guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works so that instruction generation stored in the computer readable memory includes referring to
Enable the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one box of block diagram or
The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device so that count
Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, in computer or
The instruction executed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one
The step of function of being specified in a box or multiple boxes.
Obviously, various changes and modifications can be made to the invention without departing from essence of the invention by those skilled in the art
God and range.In this way, if these modifications and changes of the present invention belongs to the range of the claims in the present invention and its equivalent technologies
Within, then the present invention is also intended to include these modifications and variations.
Claims (10)
1. a kind of long establishment of connection method, which is characterized in that the long establishment of connection method includes:
The registration request of the effective credential information of client transmission carrying to message center, the in the message heart carries out client registers;
Message center verifies client, and according to the effective credential information carried in the registration request in school
After testing successfully, it includes the long registering result information for connecting relevant parameter to client to send;
Client receives the registering result information that message center is sent and parses, and obtains the length in the registering result information
Relevant parameter, and the long connection relevant parameter based on acquisition are connected, long connection is established with server-side.
2. long establishment of connection method as described in claim 1, which is characterized in that the message center is sent out after verifying successfully
The length sent connects relevant parameter and includes:The long connection cluster access address of server-side;
Wherein, the long connection cluster access address includes:IP address and domain name.
3. long establishment of connection method as described in claim 1, which is characterized in that the length of the client based on acquisition
Relevant parameter is connected, long connection is established with server-side, including:
The long connection relevant parameter of the client based on acquisition, establishes TCP connection with server-side, constructs and send carrying client
Hold the CONNECT data packets of relevant parameter to server-side;
Server-side receives the CONNECT data packets, and verifies the relevant parameter of client in the CONNECT data packets, structure
It makes and sends CONNACK data packets to client;
Client identifies whether the long connection with server-side is successfully established according to the CONNACK data packets received;
If the long connection with server-side is successfully established, corresponding business processing event is executed;
It is rejected if being established with the long connection of server-side, breaks and the TCP connection of server-side and sends corresponding prompt message.
4. the long establishment of connection method as described in claims 1 or 2 or 3, which is characterized in that the message center verification at
After work(, it includes the long registering result information for connecting relevant parameter to client to send, including:
Message center sends the corresponding heartbeat detection time to client according to the corresponding characteristic information of client;
Wherein, the characteristic information of the client includes:The type of hardware of client and/or the application scenarios of client.
5. long establishment of connection method as claimed in claim 4, which is characterized in that if the client connects with the long of server-side
It connects and is successfully established, then the heartbeat detection time is sent to server-side by client;
The long connection cluster of server-side detects whether the long connection with client disconnects according to the heartbeat detection time.
6. a kind of long establishment of connection system, which is characterized in that the long establishment of connection system includes in client and message
The heart;Wherein:
The client is used for:The registration request for carrying effective credential information is sent to message center, heart progress is objective in the message
It registers at family end;
The message center is used for:According to the effective credential information carried in the registration request, school is carried out to client
It tests, and after verifying successfully, it includes the long registering result information for connecting relevant parameter to client to send;
The client is additionally operable to:It receives the registering result information that message center is sent and parses, obtain the registration knot
Long connection relevant parameter in fruit information, and the long connection relevant parameter based on acquisition, long connection is established with server-side.
7. long establishment of connection system as claimed in claim 6, which is characterized in that the message center is sent out after verifying successfully
The length sent connects relevant parameter and includes:The long connection cluster access address of server-side;
Wherein, the long connection cluster access address includes:IP address and domain name.
8. long establishment of connection system as claimed in claim 6, which is characterized in that the long establishment of connection system further includes
Server-side;Wherein:
The client is used for:The long connection relevant parameter based on acquisition, establishes TCP connection with the server-side, constructs
And the CONNECT data packets for carrying client relevant parameter are sent to server-side;
The server-side is used for:The CONNECT data packets are received, and verify the phase of client in the CONNECT data packets
Parameter is answered, construct and sends CONNACK data packets to client;
Client is additionally operable to:
According to the CONNACK data packets received, identify whether the long connection with server-side is successfully established;
If the long connection with server-side is successfully established, corresponding business processing event is executed;
It is rejected if being established with the long connection of server-side, breaks and the TCP connection of server-side and sends corresponding prompt message.
9. the long establishment of connection system as described in claim 6 or 7 or 8, which is characterized in that the message center is used for:
After being verified successfully to client, according to the corresponding characteristic information of the client, the corresponding heartbeat detection time is sent
To the client;
Wherein, the characteristic information of the client includes:The type of hardware of client and/or the application scenarios of client.
10. long establishment of connection system as claimed in claim 9, which is characterized in that the client is used for:If the client
It holds the long connection with server-side to be successfully established, then the heartbeat detection time is sent to server-side;
The server-side is used for:According to the heartbeat detection time, connected with the long of the client using long connection cluster detection
It connects and whether disconnects.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810102354.5A CN108418799A (en) | 2018-02-01 | 2018-02-01 | Long establishment of connection method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810102354.5A CN108418799A (en) | 2018-02-01 | 2018-02-01 | Long establishment of connection method and system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108418799A true CN108418799A (en) | 2018-08-17 |
Family
ID=63127629
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810102354.5A Pending CN108418799A (en) | 2018-02-01 | 2018-02-01 | Long establishment of connection method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108418799A (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109327527A (en) * | 2018-10-30 | 2019-02-12 | 北京摩拜科技有限公司 | Control method for vehicle, server, client, vehicle and Vehicular system |
CN110448892A (en) * | 2019-07-18 | 2019-11-15 | 江西中业光文化科技有限公司 | Game implementation method and system based on augmented reality |
CN111212117A (en) * | 2019-12-24 | 2020-05-29 | 曙光信息产业(北京)有限公司 | Remote interaction method and device |
CN111953791A (en) * | 2020-08-17 | 2020-11-17 | 浪潮云信息技术股份公司 | High-concurrency message dynamic synchronous processing scheme based on webSocket |
CN114172946A (en) * | 2021-12-06 | 2022-03-11 | 京东科技信息技术有限公司 | Request result sending method and device, electronic equipment and computer readable medium |
CN114979237A (en) * | 2022-05-16 | 2022-08-30 | 咪咕文化科技有限公司 | Long connection verification method, device, equipment and readable storage medium |
CN116260653A (en) * | 2023-03-20 | 2023-06-13 | 浪潮智慧科技有限公司 | Data transmission method, device and medium |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103051724A (en) * | 2012-12-28 | 2013-04-17 | 北京思特奇信息技术股份有限公司 | Socket synchronization method based on long connection |
CN103944923A (en) * | 2014-05-14 | 2014-07-23 | 沈文策 | Network information processing system and method |
CN105337935A (en) * | 2014-07-09 | 2016-02-17 | 阿里巴巴集团控股有限公司 | Method of establishing long connection of client and server and apparatus thereof |
CN105577507A (en) * | 2014-11-10 | 2016-05-11 | ***通信集团广东有限公司 | Heartbeat packet transmission interval adjustment method, device and server |
CN106797391A (en) * | 2014-07-21 | 2017-05-31 | 康维达无线有限责任公司 | Use service layer's interworking of MQTT agreements |
CN106851799A (en) * | 2017-01-19 | 2017-06-13 | 珠海市魅族科技有限公司 | The sending method and device of heartbeat packet in a kind of connection long |
CN106878446A (en) * | 2017-03-10 | 2017-06-20 | 大盛微电科技股份有限公司 | The means of communication |
CN107360187A (en) * | 2017-08-21 | 2017-11-17 | 网宿科技股份有限公司 | A kind of processing method of network abduction, apparatus and system |
-
2018
- 2018-02-01 CN CN201810102354.5A patent/CN108418799A/en active Pending
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103051724A (en) * | 2012-12-28 | 2013-04-17 | 北京思特奇信息技术股份有限公司 | Socket synchronization method based on long connection |
CN103944923A (en) * | 2014-05-14 | 2014-07-23 | 沈文策 | Network information processing system and method |
CN105337935A (en) * | 2014-07-09 | 2016-02-17 | 阿里巴巴集团控股有限公司 | Method of establishing long connection of client and server and apparatus thereof |
CN106797391A (en) * | 2014-07-21 | 2017-05-31 | 康维达无线有限责任公司 | Use service layer's interworking of MQTT agreements |
CN105577507A (en) * | 2014-11-10 | 2016-05-11 | ***通信集团广东有限公司 | Heartbeat packet transmission interval adjustment method, device and server |
CN106851799A (en) * | 2017-01-19 | 2017-06-13 | 珠海市魅族科技有限公司 | The sending method and device of heartbeat packet in a kind of connection long |
CN106878446A (en) * | 2017-03-10 | 2017-06-20 | 大盛微电科技股份有限公司 | The means of communication |
CN107360187A (en) * | 2017-08-21 | 2017-11-17 | 网宿科技股份有限公司 | A kind of processing method of network abduction, apparatus and system |
Non-Patent Citations (2)
Title |
---|
任亨: "基于MQTT协议的消息推送集群***的设计与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑(2015)》 * |
刘复源: "基于MATT协议的消息推送平台的设计与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑(2015)》 * |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109327527A (en) * | 2018-10-30 | 2019-02-12 | 北京摩拜科技有限公司 | Control method for vehicle, server, client, vehicle and Vehicular system |
CN110448892A (en) * | 2019-07-18 | 2019-11-15 | 江西中业光文化科技有限公司 | Game implementation method and system based on augmented reality |
CN110448892B (en) * | 2019-07-18 | 2023-08-22 | 江西中业光文化科技有限公司 | Game realization method and system based on augmented reality |
CN111212117A (en) * | 2019-12-24 | 2020-05-29 | 曙光信息产业(北京)有限公司 | Remote interaction method and device |
CN111953791A (en) * | 2020-08-17 | 2020-11-17 | 浪潮云信息技术股份公司 | High-concurrency message dynamic synchronous processing scheme based on webSocket |
CN114172946A (en) * | 2021-12-06 | 2022-03-11 | 京东科技信息技术有限公司 | Request result sending method and device, electronic equipment and computer readable medium |
CN114979237A (en) * | 2022-05-16 | 2022-08-30 | 咪咕文化科技有限公司 | Long connection verification method, device, equipment and readable storage medium |
CN114979237B (en) * | 2022-05-16 | 2024-05-24 | 咪咕文化科技有限公司 | Long connection verification method, device, equipment and readable storage medium |
CN116260653A (en) * | 2023-03-20 | 2023-06-13 | 浪潮智慧科技有限公司 | Data transmission method, device and medium |
CN116260653B (en) * | 2023-03-20 | 2023-10-13 | 浪潮智慧科技有限公司 | Data transmission method, device and medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108418799A (en) | Long establishment of connection method and system | |
US9021570B2 (en) | System, control method therefor, service providing apparatus, relay apparatus and computer-readable medium | |
CN106063222B (en) | The method and apparatus classified for the TCP connection to transmission HTTP business | |
EP1934780B1 (en) | Creating secure interactive connections with remote resources | |
US6473798B1 (en) | Method and system for testing a layer-2 tunnel in a data communication network | |
CN109309683A (en) | The method and system of client identity verifying based on token | |
EP2347559B1 (en) | Service access control | |
US20100306547A1 (en) | System and methods for providing stateless security management for web applications using non-http communications protocols | |
CN109525461B (en) | Network equipment testing method, device, equipment and storage medium | |
CN107493344A (en) | A kind of method and system of web access Docker containers | |
CN106254377B (en) | Support the soft load-balancing method and system of the long connection of magnanimity | |
CN106034104A (en) | Verification method, verification device and verification system for network application accessing | |
US9936027B2 (en) | Methods, systems, and computer readable media for application session sharing | |
EP4120109A1 (en) | Cluster access method and apparatus, electronic device, and medium | |
CN104426656B (en) | Data receiving-transmitting method and system, the processing method and processing device of message | |
JP2007310512A (en) | Communication system, service providing server, and user authentication server | |
CN111935276B (en) | Remote host access method, device and equipment | |
CN107426339A (en) | A kind of cut-in method, the apparatus and system of data interface channel | |
CN105337967B (en) | Realize that user logs in method, system and the central server of destination server | |
CN110138779B (en) | Hadoop platform safety management and control method based on multi-protocol reverse proxy | |
CN104283681B (en) | The method, apparatus and system that a kind of legitimacy to user is verified | |
EP2430562A2 (en) | Interactive authentication challenge | |
CN102271136A (en) | Access control method and equipment under NAT (Network Address Translation) network environment | |
CN107360187A (en) | A kind of processing method of network abduction, apparatus and system | |
US20190278681A1 (en) | Secure Method for Managing a Virtual Test Platform |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180817 |