CN105337973B - Method for message interaction and its system - Google Patents

Method for message interaction and its system Download PDF

Info

Publication number
CN105337973B
CN105337973B CN201510705356.XA CN201510705356A CN105337973B CN 105337973 B CN105337973 B CN 105337973B CN 201510705356 A CN201510705356 A CN 201510705356A CN 105337973 B CN105337973 B CN 105337973B
Authority
CN
China
Prior art keywords
message
client side
information client
server
message server
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.)
Active
Application number
CN201510705356.XA
Other languages
Chinese (zh)
Other versions
CN105337973A (en
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.)
Shanghai Looking For Steel Network Information Polytron Technologies Inc
Original Assignee
Shanghai Looking For Steel Network Information Polytron Technologies Inc
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 Shanghai Looking For Steel Network Information Polytron Technologies Inc filed Critical Shanghai Looking For Steel Network Information Polytron Technologies Inc
Priority to CN201510705356.XA priority Critical patent/CN105337973B/en
Publication of CN105337973A publication Critical patent/CN105337973A/en
Application granted granted Critical
Publication of CN105337973B publication Critical patent/CN105337973B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • 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/14Session management
    • H04L67/141Setup of application sessions

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer And Data Communications (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

A kind of method for message interaction of present disclosure and its system.The described method includes: (1) information client side sends the handshake request of Transmission Control Protocol to message server;(2) message server returns to a handshake response to information client side, to establish permanently effective link;(3) information client side sends user's logging request to message server, and contains Token token in login request message;(4) message server receives login request message, and carries out user's checking;(5) when determining user is legitimate user, message server saves the connection status of user, while returning to the user identifier ID of user to information client side, to allow to be communicated between information client side and message server.The present invention not only guarantees that the physical link of user during message interaction is opened for a long time, but also ensures that user is able to carry out the interaction of real-time;A kind of compensation mechanism is provided, when physical link is unstable to ensure that transmitted message is reliable, complete.

Description

Method for message interaction and its system
Technical field
The present invention relates to communication technique field more particularly to a kind of method for message interaction and its systems.
Background technique
With the rapid development of internet technology, people are logical in many occasions (such as company, school, family, open air etc.) It crosses using Internet to carry out file transmission, message broadcast, long-range control and interacting message etc..Especially in some large-scale enterprises Industry, the message interactive between internal staff and external client is very frequent, and the prior art is by timing JOB or to ask It is synchronous to complete the data between client-server to seek poll, therefore, lacks between a kind of client-server or services Real-time communication mechanism between device-server, and then data when also not can guarantee interacting message can safely and reliably reach Destination.Furthermore with the continuous growth of user volume, the interaction between user proposes the real-time and reliability of message larger Challenge.
Summary of the invention
To solve the above-mentioned problems, the present invention provides a kind of method for message interaction and its system, can not only guarantee to use The physical link of family during message interaction is opened for a long time, and ensures that user is able to carry out the interaction of real-time, avoid because Latency issue caused by number of users is more;Furthermore when physical link is unstable, a kind of compensation mechanism is also provided, to ensure The message transmitted is reliable, complete.
One side according to the present invention provides a kind of method for message interaction, the described method comprises the following steps: (1) disappearing It ceases client and sends the handshake request of Transmission Control Protocol to message server;(2) message server returns to a handshake response to message visitor Family end, to establish a permanently effective link;(3) information client side sends user's logging request to message server, and logs in Contain Token token in request message;(4) message server receives the login request message, and carries out user's checking; (5) when determining the user is legitimate user, message server saves the connection status of the user, while described in return The user identifier ID of user is to the information client side, to allow to carry out between the information client side and the message server Communication.
Another aspect according to the present invention additionally provides a kind of message exchange system, the system comprises: handshake request list Member, for from the handshake request of information client side transmission Transmission Control Protocol to message server;Handshake response unit is used for from message Server returns to a handshake response to information client side, to establish a permanently effective link;Logging request unit, for from disappearing It ceases client and sends user's logging request to message server, and contain Token token in login request message;User's checking list Member for making message server receive the login request message, and carries out user's checking;Unit is established in communication, for working as Determine the user be legitimate user when, message server saves the connection status of the user, while returning to the user User identifier ID to the information client side, to allow to be led between the information client side and the message server News.
It is an advantage of the current invention that provide a kind of method for message interaction and its system, independent of poll or timing In the case of, it can not only guarantee that user carries out prolonged interacting message in the effective situation of physical link, and ensure User is able to carry out the interaction of real-time, avoids because of the delay caused by more than number of users or loses problem;Furthermore when physics chain When road is unstable, a kind of compensation mechanism is also provided, to ensure that message safely and reliably arrives at the destination.In addition, the message is handed over Mutual system also supports the interacting message between a variety of clients (such as mobile terminal, mobile phone terminal, the end PC etc.).
Detailed description of the invention
According to the following detailed description of specific embodiments of the present invention in conjunction with the accompanying drawings, those skilled in the art will be brighter The white present invention is above-mentioned and other purposes, advantages and features.
By reading the detailed description of following detailed description, various other advantages and benefits are common for this field Technical staff will become clear.Attached drawing is only used for showing the purpose of specific embodiment, and is not considered as to the present invention Limitation.And throughout the drawings, the same reference numbers will be used to refer to the same parts.
Fig. 1 is the step flow diagram of method for message interaction described in one embodiment of the invention;
Fig. 2 is the configuration diagram of message exchange system described in one embodiment of the invention;
Fig. 3 is the configuration diagram of message exchange system described in another embodiment of the present invention;
Fig. 4 is the configuration diagram of message exchange system described in another embodiment of the present invention;
Fig. 5 is the configuration diagram of message exchange system described in another embodiment of the present invention;
Fig. 6 is the configuration diagram of message local lower unit in another embodiment of the present invention;
Fig. 7 is the configuration diagram of message exchange system described in another embodiment of the present invention;
Fig. 8 is the configuration diagram of message exchange system described in another embodiment of the present invention;
Fig. 9 is the configuration diagram of message exchange system described in another embodiment of the present invention.
Specific embodiment
The exemplary embodiment that the present invention will be described in more detail below with reference to the accompanying drawings.Although showing the present invention in attached drawing Exemplary embodiment, it being understood, however, that may be realized in various forms the present invention without answering illustrated embodiment to limit. It is to be able to thoroughly understand the present invention on the contrary, providing these embodiments, and can be by the scope of the present invention completely It is communicated to those skilled in the art.
Shown in Figure 1, the present invention provides a kind of method for message interaction, comprising:
Step S110: the handshake request of information client side transmission Transmission Control Protocol to message server.
Step S120: message server returns to a handshake response to information client side, to establish a permanently effective link.
In step S110 and step S120, the respective port that information client side and message server is arranged is open shape State, and when occurring physical link disconnection between information client side and message server, the information client side can be automatically Actively connect the message server, thus guarantee between the two signaling link connection, and then can make message server with Carry out real-time working between multiple information client sides, link 100% it is reliable, and communication time delay between the two is smaller. That is, the prior art is just to be closed within a short period of time after link request, using short link mode to guarantee to service Device uses generation loss, message when short link mode that can only could send under connection situation without performance bottleneck problem, and When physical link disconnection occur (i.e. timeout), other modes is needed to compensate, entire embodiment is more complicated.And The application is established long link (i.e. link is opened for a long time) by Transmission Control Protocol, and then can real-time monitoring information client and message The state of both servers.TCP standard connection (three-way handshake agreement) is established as due to initial physical link, hereby it is ensured that disappearing The message transmitted between breath client and message server is reliably and complete.
Step S130: information client side transmission user's logging request to message server, and contain in login request message Token token.
Step S140: message server receives the login request message, and carries out user's checking.
Step S150: when determining the user is legitimate user, message server saves the connection shape of the user State, while the user identifier ID of the user is returned to the information client side, to allow the information client side to disappear with described It is communicated between breath server.
In step S130 into step S150, information client side sends user's logging request to message server.It is described to disappear Server is ceased by the token token passing in login request message into login authentication server, to carry out inquiring and authenticating.When sentencing Making user is illegal user, then returns to an authentication failed message to the information client side, while forcing to close the border the message Long link (i.e. permanently effective link) between client and the message server, and kick except the illegal user.When sentencing Make the user be legitimate user when, save the connection status of user, and the connection status is sent to message router, To register the User Status of the legitimate user;And the message server returns to the message containing user identifier ID to described Information client side, to allow to carry out to be communicated between the information client side and the message server.The Messaging clients The user identifier ID is kept at end, this user identifier ID is carried when carrying out interacting message.
In the present embodiment, further comprise after the step s 150: step (61), the information client side receive user The message inputted, and the message server that the messaging is extremely connected with the information client side;Step (62), institute Message server is stated according to the receiving end ID in the message in the local message client being connected with the message server It searches;Step (63) finds corresponding local message visitor according to the receiving end ID in the message when the message server When the end of family, the message server is by the messaging to corresponding local message client.
Wherein, the information client side is when receiving message transmitted by an information client side (such as the end A), first root It is searched in the local message client being connected with the message server according to the receiving end ID in the message, when found, The message server is by the messaging to corresponding local message client (such as the end B).Optionally, in the message Server is found in the local message client being connected with the message server according to the receiving end ID in the message After corresponding local message client, further comprise: step (631), the message server calculate the Messaging clients Hold the access times within preset first time;Step (632), when the information client side is within preset first time When access times are more than a preset threshold, then the message server sends a limitation access message to the information client side, And it terminates and sends the message to receiving end.By executing step (631) and step (632), the message visitor can be prevented Family end excessively sends the problem of message (i.e. transmission message frequency is excessively high), described to disappear only in the case where meeting situation as defined in limitation Breath client could normally send a message to receiving end.
In the present embodiment, after step (62), further comprise: step (64), when the message server according to When receiving end ID in the message does not find corresponding local message client, the message server will be in the message Go to message router;Step (65), the message router route the message according to the receiving end ID in the message To corresponding strange land message server;Step (66), the strange land message server are looked into according to the receiving end ID in the message Look for corresponding strange land information client side, and by the messaging to corresponding strange land information client side.
Since general message service device can carry 100,000 users (preferential 5~8 general-purpose family) and in view of number of users meeting It gradually increases, therefore, by distributed arrangement, installation has equipment (the i.e. message routing of routing function on message server Device).The message server and message router carry out long link connection, between each message router and message server By unique identification to distinguish message server and message router.The unique identification can be the number section distributed.Namely It says, the interactive mode between the message router and the message server is by number section matching method (or geographical set) With carry out interacting message with it is synchronous.The grade of multiple message routers is sane level, rather than the superior and the subordinate.In the present embodiment, described Message router and the message server may each be distributed deployment.The routing rule of the message router can be with object The routing rule for managing router is similar.Each message router can correspond to multiple message servers.Equally, each message Server can also correspond to multiple message routers.The message server type includes the messaging service of tcp socket interface The message server of device and web socket interface (message server uses html5 agreement, can interact with browser).It is described Message server loads on to be communicated on the message router, for example, web page user can with message server rear end its His user (end PC) communicates, and the purpose of transfer message is realized by message router.Executing above-mentioned steps (62) after, i.e., message server judges that receiving end ID and current message service device in the received message are identified Inconsistent, that is, showing that receiving end is not is home messaging server, and then the message is uploaded to institute by the message server Message router is stated, the message is issued to accordingly by built-in routing table and receiving end ID to determine by the router Strange land message server, the corresponding strange land message server after receiving the message, search corresponding strange land message visitor Family end, and the message is pushed to corresponding strange land information client side.Preferably, among step (65), further comprise: step Suddenly (651), when the message is routed to corresponding strange land message server by the message router, find corresponding strange land Information client side is in off-line state, then by the messaging to offline service device to save;Step (652), when described When offline service device determines the strange land information client side and is online, then the offline service device will be saved institute Messaging is stated to the strange land message server, and is forwarded to corresponding strange land information client side.
Specifically, when the user of receiving end is offline or not on current strange land message server, the message road The message is considered as offline message by device, and the message is stored into offline service device.When receiving end user again When secondary online, other than establishing physical link again, it will receive from offline to offline transmitted by online period other users Message, to guarantee the reliable, complete of message.
To sum up, when carrying out interacting message between two information client sides for being connected to same message server, it is only necessary to logical It crosses user identifier ID to be transmitted, is not required to pass through message router.And as two message visitors for being connected to different messages server When carrying out interacting message between the end of family, carry out needing message router when message forwarding.The message router can with sane level Forward the message to corresponding strange land message server.
In addition, other than the message server is connected with the message router, the message server can also be with It is connected with service server.Upon request by a user, special instruction is sent to service server, the phase of the service server rear end Pass personnel load some business processings by programming mode on the service server in real time, then the service server Information is extracted from network of relation, and intelligently feeds back corresponding information.
In other embodiments of the invention, after the step s 150, further comprise: step (71), message visitor Family end sends one and exits session request to the message server;Step (72), the message server remove corresponding user's User Status, and send one and exit conversational response to the information client side, wherein described exit in conversational response containing moving back It identifies out;It sends a synchronization routing device simultaneously to request to message router, to delete the User Status of corresponding user.
In an embodiment of the present invention, in step S120 and step S130, further comprise: step (81) described disappears It ceases client and sends heartbeat request to the message server at interval of the second time, swashed with showing that the information client side is in State living;When step (82), the message server do not receive heartbeat request within the second time, then it is considered as the message visitor Family end is in off-line state, while forcing to disconnect the permanently effective link between the information client side;Step (83), when Permanently effective link between the information client side discovery and the message server is to retransmit TCP association when disconnecting The handshake request of view is to the message server, to re-establish permanently effective link.
The implementation of (81) to step (83) through the above steps, it is ensured that between information client side and message server Physical link it is permanently effective, and be in stable state.
In an embodiment of the present invention, after the step s 150, further comprise: step (91), when the Messaging clients End sends an at least message later and after the preset third time, and the information client side sends message sink confirmation and asks It asks to the message server;Step (92), the information client side receive the message server returns one and disappear with described The corresponding message vector of the last item message received by server is ceased, and transmitted by the information client side with storage The corresponding message vector of the last item message be compared;Step (93) determines described disappear when the information client side Breath server does not receive part messages (that is, two message vector values are inconsistent), then the information client side is again Send the part messages;Step (94), after the message server sends an at least message and at the preset 4th Between after, the message server sends a message sink confirmation request to the information client side;Step (95), the message It is corresponding with the last item message received by the information client side that server receives the information client side returns one Message vector, and message vector corresponding with the last item message transmitted by the message server of storage is compared Compared with;Step (96) does not receive part messages (that is, two when the message server determines the information client side A message vector value is inconsistent), then the message server retransmits the part messages.
Specifically, not considering system level under normal circumstances in order to ensure whether message normally receives and dispatches, application is only considered Level, when transmitting terminal sends a request to receiving end each time, the receiving end in preset response lag receipt to described Transmitting terminal, to show whether receiving end receives message, wherein the response lag can be in the communication format of the message It is defined.In the embodiment of the present invention, in the case where physical link shake, chain rupture or in network transmission, message data It may lose, use the compensation mechanism based on Transmission Control Protocol, then to guarantee the stability of message data.As above-mentioned steps (91) to described in step (96), the message server can save the message vector that the information client side is sent every time, equally, The information client side similarly saves the message vector that the message server is sent every time.It is automatic after long link disconnects When reconnect, i.e., after both the described information client side and the message server successful handshake, the two can compare message to Amount is reissued the part messages that other side does not receive again to other side if discovery has information drop-out, to disappear described in guaranteeing It is complete for ceasing the data of both client and the message server on physical link, and is not lost.
Therefore, a kind of method for message interaction provided by the present invention, independent of poll or timing, not only It can guarantee that user carries out prolonged interacting message in the effective situation of physical link, and ensure that user is able to carry out reality The interaction of when property avoids because of the delay caused by more than number of users or loses problem;Furthermore when physical link is unstable, A kind of compensation mechanism is provided, to ensure that message safely and reliably arrives at the destination.
Referring to fig. 2, the present invention also provides a kind of message exchange systems, comprising: handshake request unit 210, handshake response list Unit 330 is established in member 310, logging request unit 220, user authentication unit 320 and communication.Wherein, the handshake request unit 210 for from the handshake request of the transmission Transmission Control Protocol of information client side 200 to message server 300;The handshake response unit 310 for returning to a handshake response to information client side 200, to establish a permanently effective link from message server 300;Institute It states logging request unit 220 to be used for from the transmission user's logging request of information client side 200 to message server 300, and logs in and ask It asks and contains Token token in message;The user authentication unit 320 is for making message server 300 receive the logging request Message, and carry out user's checking;The communication establishes unit 330 for disappearing when determining the user is legitimate user Breath server 300 saves the connection status of the user, while returning to the user identifier ID of the user to the Messaging clients End 200, to allow to be communicated between the information client side 200 and the message server 300.
Above-mentioned handshake request unit 210, logging request unit 220 may be provided in information client side 200, above-mentioned sound of shaking hands Unit 310, user authentication unit 320, communication is answered to establish unit 330 and may be provided in message server 300.Messaging clients are set End 200 and the respective port of message server 300 are in an open state, and when information client side 200 and message server 300 it Between when there is physical link disconnection, the information client side 200 automatically can actively connect the message server 300, thus Guarantee signaling link connection between the two, and then can make to carry out between message server 300 and multiple information client sides 200 Real-time working, link 100% it is reliable, and communication time delay between the two is smaller.That is, the prior art is to use It is just closed after short link mode, i.e. link request within a short period of time, to guarantee that server without performance bottleneck problem, but is adopted With loss is generated when short link mode, message can only could be sent under connection situation, and (i.e. when there is physical link disconnection Timeout), other modes are needed to compensate, entire embodiment is more complicated.And the application is established by Transmission Control Protocol and is grown Link (i.e. link is opened for a long time), so can both monitoring information client 200 and message server 300 in real time state. TCP standard connection (three-way handshake agreement) is established as due to initial physical link, hereby it is ensured that information client side 200 and message The message transmitted between server 300 is reliably and complete.Information client side 200 sends user's logging request to message server 300.The message server 300 by the token token passing in login request message into login authentication server, with carry out Inquiring and authenticating.It is illegal user when determining user, then returns to an authentication failed message to the information client side 200, simultaneously It forces to close the border the long link between the information client side 200 and the message server 300, and kicks except the illegal user. When determining the user is legitimate user, the connection status of user is saved, and the connection status is sent to message road By device, to register the User Status of the legitimate user;And the message server 300 returns to disappearing containing user identifier ID Breath is to the information client side 200, to allow to carry out to carry out between the information client side 200 and the message server 300 Communication.The information client side 200 keeps in the user identifier ID, this user identifier ID is carried when carrying out interacting message.
In an alternative embodiment of the invention, the system can further comprise: message uploading unit 230, local client Searching unit 340, message local issuance unit 350, it is shown in Figure 3.Wherein, the message uploading unit 230, which is set to, disappears It ceases in client 200.The local client searching unit 340, message local issuance unit 350 are set to message server In 300.
The message uploading unit 230 is used to that the information client side 200 to be made to receive the message that user is inputted, and will The message server 300 that the messaging is extremely connected with the information client side 200;The local client searching unit 340 are used for the message server 300 according to the receiving end ID in the message in the sheet being connected with the message server 300 It is searched in ground information client side 200;Message local issuance unit 350 is used for when the message server 300 is according to described When receiving end ID in message finds corresponding local message client 200, the message server 300 passes the message It send to corresponding local message client 200.
In an alternative embodiment of the invention, the system can further comprise: message relay unit 360, routing are directed toward single First 410, message strange land issuance unit 370, it is shown in Figure 4.Wherein, bill under the message relay unit 360, message strange land Member 370 is set in message server 300.The routing is directed toward unit 410 and is set in message router 400.
The message relay unit 360 be used for when the message server 300 according to the receiving end ID in the message not When finding corresponding local message client 200, the message server 300 will go to message router in the message 400;Unit 410 is directed toward in the routing, for making the message router 400 will be described according to the receiving end ID in the message Message routes to corresponding strange land message server 300;Message strange land issuance unit 370 is used for the strange land messaging service Device 300 searches corresponding strange land information client side 200 according to the receiving end ID in the message, and extremely by the messaging Corresponding strange land information client side 200.
Since general message service device 300 can carry 100,000 users (preferential 5~8 general-purpose family) and in view of number of users It can gradually increase, therefore, by distributed arrangement, installation has equipment (the i.e. message of routing function on message server 300 Router 400).The message server 300 carries out long link connection, each message router 400 with message router 400 By unique identification to distinguish message server 300 and message router 400 between message server 300.The unique identification It can be the number section distributed.That is, the interaction side between the message router 400 and the message server 300 Formula is synchronous to carry out interacting message by number section matching method (or geographical set).The grade of multiple message routers 400 is Sane level, rather than the superior and the subordinate.In the present embodiment, the message router 400 and the message server 300 may each be distribution Formula deployment.The routing rule of the message router 400 can be similar with the routing rule of physical router.Each message road Multiple message servers 300 can be corresponded to by device 400.Equally, each message server 300 can also correspond to multiple message roads By device 400.300 type of message server includes that the message server 300 of tcp socket interface and web socket connect The message server 300 of mouth (message server 300 uses html5 agreement, can interact with browser).The message server 300 load on and are communicated on the message router 400, for example, web page user can with 300 rear end of message server its His user (end PC) communicates, and the purpose of transfer message is realized by message router 400.The message server The 300 receiving end ID for judging in the received message identify inconsistent with current message service device 300, that is, show to connect Receiving end is not home messaging server 300, and then the message is uploaded to the message and routed by the message server 300 Device 400, the router is by built-in routing table and receiving end ID to determine that the message, which is issued to corresponding strange land, to disappear Server 300 is ceased, which after receiving the message, searches corresponding strange land message visitor Family end 200, and the message is pushed to corresponding strange land information client side 200.
In an alternative embodiment of the invention, the routing direction unit 410 further comprises: offline message preserving module 411, offline message sending module 510, it is shown in Figure 5.Wherein, the offline message preserving module 411 is set to message road It is directed toward in unit 410 by the routing of device 400, the offline message sending module 510 is set in offline service device 500.
The offline message preserving module 411 is used to route to the message accordingly when the message router 400 When the message server 300 of strange land, it is found that corresponding strange land information client side 200 is in off-line state, then by the messaging To offline service device 500 to save;The offline message sending module 510 is used to determine when the offline service device 500 When the strange land information client side 200 is online, then the offline service device 500 will be saved the messaging The extremely strange land message server 300, and it is forwarded to corresponding strange land information client side 200.That is, working as the use of receiving end Family is offline or not when on current strange land message server 300, and the message is considered as by the message router 400 to disappear offline Breath, and the message is stored into offline service device 500.When user when receiving end is online again, in addition to establishing again It except physical link, will receive from offline to offline message transmitted by online period other users, so that guarantee message can It leans on, completely.
In an alternative embodiment of the invention, message local issuance unit 350 further comprises: access times calculate mould Block 351 and limitation access notifications module 352, it is shown in Figure 6.Wherein, the access times computing module 351 and the limitation Access notifications module 352 is set in the message local issuance unit 350 of the message server 300.
Specifically, the access times computing module 351 calculates the Messaging clients for the message server 300 Access times of the end 200 within preset first time.The limitation access notifications module 352 is used to work as the information client side When 200 access times within preset first time are more than a preset threshold, then the message server 300 sends a limitation Message is accessed to the information client side 200, and terminates and sends the message to receiving end.
In an alternative embodiment of the invention, the system can further comprise: exit session request unit 240 and the meeting of exiting Response unit 3100 is talked about, it is shown in Figure 7.Wherein, the session request unit 240 that exits is set in information client side 200. The conversational response unit 3100 that exits is set in message server 300.
The session request unit 240 that exits is for making the transmission of information client side 200 one exit session request to institute State message server 300.The conversational response unit 3100 that exits is for making the message server 300 remove corresponding user's User Status, and send one and exit conversational response to the information client side 200, wherein described exit in conversational response is contained Exit mark;It sends a synchronization routing device simultaneously to request to message router, to delete the User Status of corresponding user.
In an alternative embodiment of the invention, the system can further comprise: heartbeat request unit 250, link disconnect single Member 3110 and link re-establishment unit 260, it is shown in Figure 8.Wherein, the heartbeat request unit 250 and the link re-establishment list Member 260 is set in information client side 200.The link switching units 3110 are set in message server 300.
The heartbeat request unit 250 sends heartbeat request extremely at interval of the second time for the information client side 200 The message server 300, to show that the information client side 200 is active.The link switching units 3110 are used When the message server 300 does not receive heartbeat request within the second time, then it is considered as the information client side 200 and is in Off-line state, while forcing to disconnect the permanently effective link between the information client side 200.The link re-establishment unit 260 for being to disconnect when the permanently effective link between the information client side 200 discovery and the message server 300 When, the handshake request of Transmission Control Protocol is retransmitted to the message server 300, to re-establish permanently effective link.This Sample, it is ensured that physical link between information client side 200 and message server 300 it is permanently effective, and in stablizing shape State.
In an alternative embodiment of the invention, the system can further comprise: client message transmission unit 270, client End message comparing unit 280, client message retransmission unit 290, server message transmission unit 3120, server message compare Unit 3130 and server message retransmission unit 3140, it is shown in Figure 9.Wherein, the client message transmission unit 270, The client message comparing unit 280 and the client message retransmission unit 290 are arranged in the information client side 200 In.The server message transmission unit 3120, the server message comparing unit 3130 and the server message are retransmitted Unit 3140 is set in message server 300.
The client message transmission unit 270 be used for when the information client side 200 transmission an at least message after and After the preset third time, the information client side 200 sends a message sink confirmation request to the message server 300.The client message comparing unit 280 receives what the message server 300 returned for the information client side 200 One message vector corresponding with the last item message received by the message server 300, and disappear with described in storage The corresponding message vector of the last item message transmitted by breath client 200 is compared.The client message is retransmitted single Member 290 is for not receiving part messages when the information client side 200 determines the message server 300, then described to disappear Breath client 200 retransmits the part messages.The server message transmission unit 3120 is used to work as the messaging service Device 300 sends an at least message later and after preset 4th time, and the message server 300 sends a message sink Confirmation request is to the information client side 200.The server message comparing unit 3130 connects for the message server 300 Receive that the information client side 200 returns one with the last item message is corresponding received by the information client side 200 disappears Vector is ceased, and message vector corresponding with the last item message transmitted by the message server 300 of storage carries out Compare.The server message retransmission unit 3140 is used to determine the information client side 200 when the message server 300 Part messages are not received, then the message server 300 retransmits the part messages.
Specifically, not considering system level under normal circumstances in order to ensure whether message normally receives and dispatches, application is only considered Level, when transmitting terminal sends a request to receiving end each time, the receiving end in preset response lag receipt to described Transmitting terminal, to show whether receiving end receives message, wherein the response lag can be in the communication format of the message It is defined.In the embodiment of the present invention, in the case where physical link shake, chain rupture or in network transmission, message data It may lose, use the compensation mechanism based on Transmission Control Protocol, then to guarantee the stability of message data.As said units, institute The message vector that the information client side 200 is sent every time, equally, the information client side can be saved by stating message server 300 200 similarly save the message vector that the message server 300 is sent every time.It is automatic after long link disconnects to reconnect When, i.e., after both the described information client side 200 and the message server 300 successful handshake, the two can compare message vector, If it was found that the part messages that other side does not receive are reissued to other side again when having information drop-out, to guarantee the message The data of both client 200 and the message server 300 on physical link are complete, and are not lost.
Obviously, it will be understood by those skilled in the art that each module or each step of the embodiments of the present invention can be with logical Computer installation realizes that they can concentrate on single computer installation, or is distributed in multiple computers dresses Set it is combined at network on, optionally, they can be realized with the software package source code that computer installation can be performed, from And can be stored in storage device and be executed by computer installation, and in some cases, it can be to be different from Sequence herein executes shown or described step, perhaps by they be respectively prepared each integrated circuit modules or by it In multiple modules or step be fabricated to single integrated circuit module to realize.In this way, the embodiment of the present invention be not limited to it is any Specific hardware and software combines.
The above is only a preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art Member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications also should be regarded as Protection scope of the present invention.

Claims (12)

1. a kind of method for message interaction characterized by comprising
(1) information client side sends the handshake request of Transmission Control Protocol to message server;
(2) message server returns to a handshake response to information client side, to establish a permanently effective link;
(3) information client side sends user's logging request to message server, and contains Token token in login request message;
(4) message server receives the login request message, and carries out user's checking;
(5) when determining the user is legitimate user, message server saves the connection status of the user, returns simultaneously The user identifier ID of the user is to the information client side, to allow between the information client side and the message server It is communicated;
Further comprise after step (5):
(61) information client side receives the message that user is inputted, and by the messaging to the Messaging clients The connected message server in end;
(62) message server disappears according to the receiving end ID in the message in the local being connected with the message server It is searched in breath client;
(63) when the message server finds corresponding local message client according to the receiving end ID in the message, The message server is by the messaging to corresponding local message client;
After step (62), further comprise:
(64) when the message server does not find corresponding local message client according to the receiving end ID in the message When, the message server will go to message router in the message;
(65) message router obtains unique mark by the number section distributed, and according to connecing in the message The message is routed to corresponding strange land message server by receiving end ID and described identify;
(66) the strange land message server searches corresponding strange land information client side according to the receiving end ID in the message, and And by the messaging to corresponding strange land information client side.
2. method for message interaction according to claim 1, which is characterized in that among step (65), further comprise: (651) when the message is routed to corresponding strange land message server by the message router, it is found that corresponding strange land disappears Breath client is in off-line state, then by the messaging to offline service device to save;
(652) when the offline service device, which determines the strange land information client side, to be online, then offline clothes Device be engaged in for the messaging saved to the strange land message server, and is forwarded to corresponding strange land information client side.
3. method for message interaction according to claim 1, which is characterized in that further comprise in step (63):
(631) message server calculates access times of the information client side within preset first time;
(632) when the access times when the information client side within preset first time are more than a preset threshold, then described Message server sends a limitation access message to the information client side, and terminates and send the message to receiving end.
4. method for message interaction according to claim 1, which is characterized in that after step (5), further comprise:
(71) information client side sends one and exits session request to the message server;
(72) message server removes the User Status of corresponding user, and sends one and exit conversational response to the message Client, wherein described exit in conversational response containing exiting mark;A synchronization routing device is sent simultaneously to request to message to route Device, to delete the User Status of corresponding user.
5. method for message interaction according to claim 1, which is characterized in that in step (2) and step (3), further Include:
(81) information client side sends heartbeat request to the message server, to show described disappear at interval of the second time Breath client is active;
(82) when the message server does not receive heartbeat request within the second time, then it is considered as the information client side and is in Off-line state, while forcing to disconnect the permanently effective link between the information client side;
(83) when the permanently effective link between information client side discovery and the message server is to disconnect, again The handshake request of Transmission Control Protocol is sent to the message server, to re-establish permanently effective link.
6. method for message interaction according to claim 1, which is characterized in that after step (5), further comprise:
(91) after the information client side sends an at least message and after the preset third time, the Messaging clients End sends a message sink confirmation request to the message server;
(92) information client side receives last received by one and the message server that the message server returns The corresponding message vector of a piece of news, and it is corresponding with the last item message transmitted by the information client side of storage Message vector be compared;
(93) part messages are not received when the information client side determines the message server, then the information client side Retransmit the part messages;
(94) after the message server sends an at least message and after preset 4th time, the messaging service Device sends a message sink confirmation request to the information client side;
(95) message server receives last received by one and the information client side that the information client side returns The corresponding message vector of a piece of news, and it is corresponding with the last item message transmitted by the message server of storage Message vector be compared;
(96) part messages are not received when the message server determines the information client side, then the message server Retransmit the part messages.
7. a kind of message exchange system characterized by comprising
Handshake request unit, for from the handshake request of information client side transmission Transmission Control Protocol to message server;
Handshake response unit is used to return to a handshake response from message server to information client side, permanently effective to establish one Link;Logging request unit is used for from information client side transmission user's logging request to message server, and logging request disappears Contain Token token in breath;
User authentication unit for making message server receive the login request message, and carries out user's checking;
Unit is established in communication, for when determining the user is legitimate user, message server to save the company of the user State is connect, while returning to the user identifier ID of the user to the information client side, to allow the information client side and institute It states and is communicated between message server
The system further comprises:
Message uploading unit, for making the information client side receive the message that user is inputted, and by the messaging To the message server being connected with the information client side;
Local client searching unit, for the message server according to the receiving end ID in the message with the message It is searched in the connected local message client of server;
Message local issuance unit, for being found accordingly when the message server according to the receiving end ID in the message When local message client, the message server is by the messaging to corresponding local message client;
Message relay unit, for not finding corresponding sheet according to the receiving end ID in the message when the message server When ground information client side, the message server will go to message router in the message;
Unit is directed toward in routing, for making the message router according to the receiving end ID in the message and by number section matching side The message is routed to corresponding strange land message server by formula;
Message strange land issuance unit is searched accordingly for the strange land message server according to the receiving end ID in the message Strange land information client side, and by the messaging to corresponding strange land information client side.
8. message exchange system according to claim 7, which is characterized in that the routing is directed toward unit and further comprises:
Offline message preserving module, for the message to be routed to corresponding strange land message server when the message router When, it is found that corresponding strange land information client side is in off-line state, then by the messaging to offline service device to save;
Offline message sending module, for being online when the offline service device determines the strange land information client side When, then the offline service device is by the messaging saved to the strange land message server, and is forwarded to corresponding Strange land information client side.
9. message exchange system according to claim 7, which is characterized in that message local issuance unit is further wrapped Include: access times computing module calculates the information client side within preset first time for the message server Access times;
Access notifications module is limited, for being more than one pre- when access times of the information client side within preset first time If when threshold value, then the message server sends a limitation access message to the information client side, and terminates described in transmission Message is to receiving end.
10. message exchange system according to claim 7, which is characterized in that the system further comprises:
Session request unit is exited, exits session request to the message server for making the information client side send one;
Conversational response unit is exited, for making the message server remove the User Status of corresponding user, and one is sent and moves back Conversational response is to the information client side out, wherein described exit in conversational response containing exiting mark;It is synchronous that one is sent simultaneously Router solicitation is to message router, to delete the User Status of corresponding user.
11. message exchange system according to claim 7, which is characterized in that the system further comprises:
Heartbeat request unit sends heartbeat request to the messaging service at interval of the second time for the information client side Device, to show that the information client side is active;
Link switching units when not receiving heartbeat request within the second time for the message server, are then considered as described Information client side is in off-line state, while forcing to disconnect the permanently effective link between the information client side;
Link re-establishment unit, for when the permanently effective link between information client side discovery and the message server When to disconnect, the handshake request of Transmission Control Protocol is retransmitted to the message server, to re-establish permanently effective link.
12. message exchange system according to claim 7, which is characterized in that the system further comprises:
Client message transmission unit, for after the information client side sends an at least message and in preset third Between after, the information client side sends a message sink confirmation request to the message server;
Client message comparing unit receives one and the message that the message server returns for the information client side The corresponding message vector of the last item message received by server, and transmitted by the information client side with storage The corresponding message vector of the last item message is compared;
Client message retransmission unit, for partially disappearing when the information client side determines the message server and do not receive Breath, then the information client side retransmits the part messages;
Server message transmission unit is used for after the message server sends an at least message and at the preset 4th Between after, the message server sends a message sink confirmation request to the information client side;
Server message comparing unit receives one and the message that the information client side returns for the message server The corresponding message vector of the last item message received by client, and transmitted by the message server with storage The corresponding message vector of the last item message is compared;
Server message retransmission unit, for partially disappearing when the message server determines the information client side and do not receive Breath, then the message server retransmits the part messages.
CN201510705356.XA 2015-10-27 2015-10-27 Method for message interaction and its system Active CN105337973B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510705356.XA CN105337973B (en) 2015-10-27 2015-10-27 Method for message interaction and its system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510705356.XA CN105337973B (en) 2015-10-27 2015-10-27 Method for message interaction and its system

Publications (2)

Publication Number Publication Date
CN105337973A CN105337973A (en) 2016-02-17
CN105337973B true CN105337973B (en) 2019-07-09

Family

ID=55288256

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510705356.XA Active CN105337973B (en) 2015-10-27 2015-10-27 Method for message interaction and its system

Country Status (1)

Country Link
CN (1) CN105337973B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107172275A (en) * 2017-04-28 2017-09-15 太仓鸿策腾达网络科技有限公司 A kind of information interacting method for mobile terminal
CN108230654A (en) * 2018-01-18 2018-06-29 华立科技股份有限公司 ammeter data transmission method and device
CN108989438A (en) * 2018-07-26 2018-12-11 青柠智云(杭州)科技有限责任公司 Implementation method, the device and system of data distribution network
CN109302496A (en) * 2018-11-28 2019-02-01 南昌百恒信息技术有限公司 A kind of novel real time information stream exchange method
CN113596147B (en) * 2021-07-27 2023-10-24 奇安信科技集团股份有限公司 Message pushing method, device, equipment and storage medium
CN113568936B (en) * 2021-07-30 2023-06-13 多点生活(成都)科技有限公司 Real-time stream data storage method, device and terminal equipment
CN115623079B (en) * 2022-12-19 2023-06-02 中科政汇(北京)科技有限公司 Data access processing method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102143091A (en) * 2010-08-06 2011-08-03 华为技术有限公司 Cross-domain operation realization method, system, server and browser
CN103546584A (en) * 2013-11-13 2014-01-29 深圳市中兴移动通信有限公司 Information pushing method and system
CN104717133A (en) * 2015-03-16 2015-06-17 墨仕(厦门)电子商务有限公司 Distributed message push system and method
CN104980898A (en) * 2014-04-04 2015-10-14 中兴通讯股份有限公司 Information pushing method, system and equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8914449B2 (en) * 2011-11-07 2014-12-16 Cellco Partnership Push messaging platform with high scalability and high availability

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102143091A (en) * 2010-08-06 2011-08-03 华为技术有限公司 Cross-domain operation realization method, system, server and browser
CN103546584A (en) * 2013-11-13 2014-01-29 深圳市中兴移动通信有限公司 Information pushing method and system
CN104980898A (en) * 2014-04-04 2015-10-14 中兴通讯股份有限公司 Information pushing method, system and equipment
CN104717133A (en) * 2015-03-16 2015-06-17 墨仕(厦门)电子商务有限公司 Distributed message push system and method

Also Published As

Publication number Publication date
CN105337973A (en) 2016-02-17

Similar Documents

Publication Publication Date Title
CN105337973B (en) Method for message interaction and its system
CN108833487B (en) TCP transmission protocol proxy method
US6178453B1 (en) Virtual circuit switching architecture
KR101662352B1 (en) System and method for managing multiple queues of non-persistent messages in a networked environment
US8438307B2 (en) Method and device of load-sharing in IRF stack
CN103916311B (en) A kind of information transmission and control method, Apparatus and system
US20030126213A1 (en) Establishing direct instant messaging communication between wireless devices
CN101997826A (en) Routing methods of control net element, forwarding net element and internet protocol network
CA2691167A1 (en) Access and control system for network-enabled devices
CN104954245A (en) Service function chaining (SFC) processing method and device
CN104539531A (en) Data transmission method and device
CN117041140B (en) Data message transmission method, related device, equipment and storage medium
Nakamura et al. A LoRa-based protocol for connecting IoT edge computing nodes to provide small-data-based services
CN102801824B (en) Method and system for processing NAT equipment, NAPT equipment and TCP application drainage
JP2006203575A (en) Communicating method
CN102215231A (en) Data forwarding method and gateway
CN105991629B (en) TCP connection method for building up and device
CN106209517A (en) A kind of method realizing multi-hop BFD single armed echo function
JP2006165879A (en) Call control system, call control method and call control program
KR20200072941A (en) Method and apparatus for handling VRRP(Virtual Router Redundancy Protocol)-based network failure using real-time fault detection
CN105049481B (en) A kind of method for supporting multi-heterogeneous system intelligent interaction
CN107968825A (en) A kind of message transmission control method and device
JP3682439B2 (en) Data communication system and method, server device, client device, and program
Cisco
Cisco

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 201815 Shanghai Industrial Zone, Jiading Huiyuan Road, No. 6, building 2, room E, room, 208

Applicant after: Shanghai looking for steel network information Polytron Technologies Inc

Address before: 201815 Shanghai, Jiading Industrial Zone, Huiyuan Road, No. F, building, room 2, floor E, room 208

Applicant before: Shanghai steel electron rich commercial affairs company limited

COR Change of bibliographic data
GR01 Patent grant
GR01 Patent grant