CN107580046A - Long connection service system and method - Google Patents

Long connection service system and method Download PDF

Info

Publication number
CN107580046A
CN107580046A CN201710772540.5A CN201710772540A CN107580046A CN 107580046 A CN107580046 A CN 107580046A CN 201710772540 A CN201710772540 A CN 201710772540A CN 107580046 A CN107580046 A CN 107580046A
Authority
CN
China
Prior art keywords
server
push
user
service
client
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.)
Granted
Application number
CN201710772540.5A
Other languages
Chinese (zh)
Other versions
CN107580046B (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.)
Beijing Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
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 Beijing Qihoo Technology Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201710772540.5A priority Critical patent/CN107580046B/en
Publication of CN107580046A publication Critical patent/CN107580046A/en
Application granted granted Critical
Publication of CN107580046B publication Critical patent/CN107580046B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a kind of long Connection Service system and method.Wherein system includes:Gateway server, at least one service server and configuration server;Gateway server and at least one service server complete registration in configuration server in advance;Configuration server, suitable for storing the information on services of at least one service server;Long connection is established between gateway server, with client, suitable for obtaining the information on services of service server from configuration server, client is transmitted to online at least one service server using user's logging request or the business processing request of long linkup transmit;At least one service server, it is adapted for user's logging request or business processing request, response message or service processing result are forwarded to client by gateway server, asked based on long linkup transmit user logging request or business processing, user's logging request or business processing request forwarding in real time can be realized, can quickly be communicated with corresponding service server.

Description

Long Connection Service system and method
Technical field
The present invention relates to field of computer technology, and in particular to a kind of long Connection Service system and method.
Background technology
In existing service, the service of short connection is much all based on, short Connection Service needs client according to business Need actively to initiate connection, disconnected after the completion of business, initiate easily to cause server if frequency is too high if client Larger burden, but if initiation frequency is relatively low, it cannot be guaranteed that feedback result is received in real time by client, it is important for some Feedback result, be fatal based on the short time delay that is transmitted and occurs of connecting.
The content of the invention
In view of the above problems, it is proposed that the present invention so as to provide one kind overcome above mentioned problem or at least in part solve on State the long Connection Service system of problem and corresponding long Connection Service method.
According to an aspect of the invention, there is provided a kind of long Connection Service system, including:Gateway server, at least one Individual service server and configuration server;Gateway server and at least one service server are complete in configuration server in advance Into registration;
Configuration server, suitable for storing the information on services of at least one service server;
Long connection is established between gateway server, with client, suitable for obtaining the clothes of service server from configuration server It is engaged in information, client is transmitted to using user's logging request or the business processing request of long linkup transmit online at least one Service server;
At least one service server, be adapted for user's logging request or business processing request, by response message or Service processing result is forwarded to client by gateway server.
According to another aspect of the present invention, there is provided a kind of long Connection Service method, including:
Gateway server and at least one service server complete registration in configuration server in advance;
Long connection is established between gateway server and client, the service letter of service server is obtained from configuration server Breath, client is transmitted to online at least one business using user's logging request or the business processing request of long linkup transmit Server;
At least one service server is asked in response to user's logging request or business processing, at response message or business Reason result is forwarded to client by gateway server.
According to scheme provided by the invention, client is stepped on based on the long linkup transmit user established between gateway server Record request or business processing request, it is possible to achieve client state real-time perception, and realize at user's logging request or business Reason request forwarding in real time, so as to quickly be communicated with corresponding service server, lifts the security of long Connection Service.
Described above is only the general introduction of technical solution of the present invention, in order to better understand the technological means of the present invention, And can be practiced according to the content of specification, and in order to allow above and other objects of the present invention, feature and advantage can Become apparent, below especially exemplified by the embodiment of the present invention.
Brief description of the drawings
By reading the detailed description of hereafter preferred embodiment, it is various other the advantages of and benefit it is common for this area Technical staff will be clear understanding.Accompanying drawing is only used for showing the purpose of preferred embodiment, and is not considered as to the present invention Limitation.And in whole accompanying drawing, identical part is denoted by the same reference numerals.In the accompanying drawings:
Fig. 1 shows a kind of structural representation of according to embodiments of the present invention one long Connection Service system;
Fig. 2 shows a kind of structural representation of according to embodiments of the present invention two long Connection Service system;
Fig. 3 shows a kind of structural representation of according to embodiments of the present invention three long Connection Service system;
Fig. 4 shows a kind of structural representation of according to embodiments of the present invention four long Connection Service system;
Fig. 5 shows a kind of structural representation of according to embodiments of the present invention five long Connection Service system;
Fig. 6 shows a kind of block diagram of according to embodiments of the present invention five long Connection Service system;
The structural representation of gateway server during Fig. 7 is shown according to embodiments of the present invention;
Fig. 8 shows the schematic flow sheet of a kind of according to embodiments of the present invention six long Connection Service method;
Fig. 9 shows the schematic flow sheet of a kind of according to embodiments of the present invention seven long Connection Service method.
Embodiment
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although the disclosure is shown in accompanying drawing Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here Limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure Completely it is communicated to those skilled in the art.
Embodiment one
Fig. 1 shows a kind of structural representation of according to embodiments of the present invention one long Connection Service system.Such as Fig. 1 institutes Show, the system includes:Configuration server 100, gateway server 110 and at least one service server 120;Wherein, gateway Server 110 and at least one service server 120 complete registration in configuration server 100 in advance.
Configuration server 100, suitable for storing the information on services of at least one service server 120.
Specifically, the information on services of at least one service server 120 includes:IP port numbers, service type, and/or Wire state, wherein, service type can specifically be logged in and cipher key management services, all kinds of killing services, message push service with user Deng;Presence includes:It is online and offline.
Gateway server 110, long connection is established between client, suitable for obtaining business service from configuration server 100 The information on services of device 120, client is transmitted to online using user's logging request or the business processing request of long linkup transmit At least one service server 120.
Wherein, gateway server 110 is the outlet of long Connection Service and client communication, client and gateway server TCP length connections are established between 110, the bridge to be communicated after gateway server 110 as client with service server 120, are carried For reliable and stable message transparent transmission service.
Specifically, client sends use using long connection is established between gateway server 110 to gateway server 110 Family logging request or business processing request, gateway server 110 receive user's logging request or business processing request after, from Configuration server 100 obtains the information on services of service server 120, and online at least one is found according to the information on services of acquisition Individual service server 120, user's logging request or business processing request are transmitted to online at least one service server 120。
At least one service server 120, user's logging request or business processing request are adapted for, by response message Or service processing result is forwarded to client by gateway server 110.
Specifically, at least one service server 120 is after user's logging request or business processing request is received, response User's logging request or business processing request, gateway server 110 is sent to by response message or service processing result, then by Response message or service processing result are forwarded to client by gateway server 110.
Alternatively, gateway server 110 is further adapted for:Every the 4th preset time at least one service server 120 send business processings request, with detect between gateway server 110 and at least one service server 120 link can With state, wherein, the 4th preset time can be set according to being actually needed, for example, 0.1 second, it is merely illustrative of here, Without any restriction effect.
The long Connection Service system provided according to the above embodiment of the present invention, client are based on building between gateway server Vertical long linkup transmit user logging request or business processing request, it is possible to achieve client state real-time perception, and realize User's logging request or business processing request forwarding in real time, so as to quickly be communicated with corresponding service server, are carried Rise the security of long Connection Service.
At least one service server can be logged on server, key server, cloud killing server, Push Service Device, configuration service implement body can be Zookeeper servers, and it stores the service of service server as configuration server Information, for example, IP port numbers, service type, and/or presence etc., are merely illustrative of here, make without any limit With.The service type and port numbers that each service server is provided are registered to Zookeeper servers, and gateway server is then The information on services of service server is obtained from Zookeeper servers, particular data packet is gone into corresponding service server, its In, the service server composition cluster of Zookeeper servers typically configuration three to five, there is redundancy ability, ensure service It is stable available, described in detail below in conjunction with specific embodiment:
Embodiment two
Fig. 2 shows a kind of structural representation of according to embodiments of the present invention two long Connection Service system.Such as Fig. 2 institutes Show, the system includes:Zookeeper servers 200, gateway server 210 and at least one login service device 220, at least One key server 230;Wherein, gateway server 210, at least one login service device 220 and at least one cipher key service Device 230 completes registration in Zookeeper servers 200 in advance.
Zookeeper servers 200, suitable for storing the information on services and at least one of at least one login service device 220 The information on services of individual key server 230.
Gateway server 210, long connection is established between client, is logged in suitable for being obtained from Zookeeper servers 200 The information on services of server 220, the single order for carrying the user login information after encrypting by client using long linkup transmit Section user's logging request is transmitted to online at least one login service device 220.
After long connection is established between client and gateway server 210, client can utilize long connection to gateway service Device 210 sends a phase user logging request, and the request carries the user login information by encryption, wherein it is possible to using XOR enciphering and deciphering algorithm is encrypted, and used key can be fixed during encryption, be merely illustrative of, do not have here Any restriction effect.
Gateway server 210 is used in the stage for carrying the user login information after encrypting for receiving client transmission After the logging request of family, the information on services of login service device 220 is obtained from Zookeeper servers 200, is believed according to the service of acquisition Breath finds online at least one login service device 220, and the phase user logging request is transmitted into online at least one Individual login service device 220.
At least one login service device 220 is suitable to:In response to a phase user logging request, a Session Key is passed through into net Close server 210 and be forwarded to client.
Specifically, at least one login service device 220 is after a phase user logging request is received, to a phase user Logging request carries out legitimate verification, and after being verified, at least one login service device 220 logs in response to a phase user please Ask, to gateway server 210 send a Session Key with by the gateway server 210 by a stage key forwarding to client End, wherein, what a Session Key was randomly generated, gateway server 210 can also record a Session Key.
Gateway server 210 is further adapted for:The service letter of key server 230 is obtained from Zookeeper servers 200 Breath, two-stage user's logging request after Session Key encryption that client is sent are transmitted to online at least one close Key server 230;
Client is calculated after a Session Key of the forwarding of gateway server 210 is received using NaclEC asymmetric encryption Two-stage user's logging request is encrypted method, while request is added using the Session Key that login service device 220 returns Data after close carry out XOR encryption, and two-stage user's logging request after Session Key encryption is sent into gateway clothes Business device 210, online at least one key server 230 is transmitted to by gateway server 210, here primarily to preventing public affairs Key is revealed, while improves the complexity of link playback request.
At least one key server 230 is suitable to:In response to two-stage user's logging request, two-stage key is passed through into net Close server 210 and be forwarded to client, so that business data packet is encrypted using two-stage key for client.
Specifically, after at least one key server 230 receives two-stage user's logging request, first with a Session Key XOR decryption is carried out to two-stage user's logging request, after successful decryption, then NaclEC rivest, shamir, adelmans are carried out to data Decryption, successful decryption, to two-stage user's logging request carry out legitimate verification, after being verified, two-stage key is sent out Gateway server 210 is given, with can by two-stage key forwarding to client, subsequent client by the gateway server 210 So that business data packet to be encrypted using two-stage key, logged in by two benches and logging request is encrypted, can To ensure the security of communications protocol, the malicious attack cracked after being cracked with agreement for agreement is prevented.
In order to prevent linking slowly, the considered critical of gateway server 210 request time, specifically, gateway server 210 enters One step is suitable to:After long connection is established with client, judge client transmission whether is received in the second preset time One phase user logging request, if it is not, the long connection established between client is then disconnected, so as to effectively prevent malice from connecting Connect and the attack based on TCP SYN, prevent handle from wasting, wherein, the second preset time can be set according to being actually needed, For example, 0.01 second, it is merely illustrative of here, without any restriction effect.
In addition, gateway server 210 is further adapted for:After by stage key forwarding a to client, judge Whether the two-stage user logging request of client transmission is received in three preset times, if it is not, then disconnecting between client The long connection established, prevents handle from wasting, wherein, the 3rd preset time can be set according to being actually needed, for example, 0.01 second, it is merely illustrative of here, without any restriction effect.
In addition, being directed to single client, limitation can establish connection number and number of request per second, if agreement is cracked, also can It is enough effectively to prevent access service from being paralysed because of request overload.
The long Connection Service system provided according to the above embodiment of the present invention, client are based on building between gateway server Vertical long linkup transmit two benches user's logging request, login service device and key server carry out two stage login authentication, The security of long Connection Service is improved, in addition, after being established by the long connection of limitation during the transmission of two benches user's logging request Between, malice connection and the attack based on TCP SYN can be effectively prevented, further improves the security of long Connection Service.
Embodiment three
Fig. 3 shows a kind of structural representation of according to embodiments of the present invention three long Connection Service system.Such as Fig. 3 institutes Show, the system includes:Zookeeper servers 300, gateway server 310 and at least one cloud killing server 320;Its In, gateway server 310 and at least one cloud killing server 320 complete registration in Zookeeper servers 300 in advance.
Zookeeper servers 300, suitable for storing the information on services of at least one cloud killing server 320.
Gateway server 310, long connection is established between client, looked into suitable for obtaining cloud from Zookeeper servers 300 The information on services of server 320 is killed, client is carried into the business number through the encryption of two-stage key using long linkup transmit Online at least one cloud killing server 320 is transmitted to according to the business processing request of bag.
Specifically, after long connection is established between client and gateway server 310, client can utilize long connection to net Close server 310 and send business processing request, the request carries the business data packet encrypted through two-stage key, gateway service After device 310 receives business processing request, the information on services of cloud killing server 320 is obtained from Zookeeper servers 300, Online at least one cloud killing server 320 is found according to the information on services of acquisition, cloud killing request is transmitted to online At least one cloud killing server 320, wherein, business processing request can be cloud killing request.
At least one cloud killing server 320 is suitable to:Asked in response to business processing, by with cloud rules platform and depositing Storage system is interacted, and obtains cloud killing result, and cloud killing result is forwarded into client by gateway server 310.
Wherein, at least one cloud killing server 320 can provide all kinds of killing services, and it supports http, tcp, udp etc. Interface, intermediary interface layer (safeglue/trident) can be used to realize business function plug-in type management, so as to In the case of not changing (or seldom changing some statistical informations), safety service is quickly accessed into long Connection Service.
Specifically, at least one cloud killing server 320 receive cloud killing request after, by with cloud rules platform and KV storage systems interact, and obtain service processing result, complete a cloud killing request, finally pass through service processing result Gateway server 310 returns to client.
In order to prevent cloud killing server updating, restart etc. request is failed caused by influence, increase for gateway server 310 Add the function of retry mechanism, specifically, gateway server 310 is further adapted for:If do not received at least in the first preset time The service processing result that one cloud killing server 320 returns, then start retry mechanism and looked into again to online at least one cloud Kill server 320 and send business processing request, wherein it is possible to the number of retries of gateway server 310 is pre-set, such as 3 times, If retrying 3 times to fail, disconnected it can be assumed that being linked between gateway server 310 and cloud killing server 320.
In an alternate embodiment of the present invention where, at least one service server can include:Intrusion prevention server, Now, business processing request can be that Initiative Defense is asked, and specifically implementation process is similar with embodiment illustrated in fig. 3, here not Repeat again.
The long Connection Service system provided according to the above embodiment of the present invention, client are based on building between gateway server Vertical long linkup transmit business processing request, it is possible to achieve service request forwards in real time, so as to fast with cloud killing server Speed is communicated, and realizes client state real-time perception, when harm, which influences huge virus (such as blackmailer's virus), to be occurred, Client can obtain preventive means at once in the case where not upgrading by long Connection Service, reduce harm caused by virus.
Example IV
Fig. 4 shows a kind of structural representation of according to embodiments of the present invention four long Connection Service system.Such as Fig. 4 institutes Show, the system includes:Zookeeper servers 400, message central server 410, gateway server 420 and at least one Push server 430;Wherein, gateway server 420 and at least one push server 430 are in advance in Zookeeper servers Registration is completed in 400.
Zookeeper servers 400, suitable for storing the information on services of at least one push server 430.
Message central server 410, suitable for management message push strategy, strategy configuration push task is pushed according to message.
Wherein, message push strategy can specifically set which product which business will remove PUSH message, push target, push away Mode is sent, pushes task type, establishment, startup, stopping, the renewal of task is pushed, rights management, editing authority, issues authority, Authority is audited, online number is checked, checks message status.
Gateway server 420, long connection is established between client, is pushed suitable for being obtained from Zookeeper servers 400 The information on services of server 430, the user login information that at least one client provides is reported into online at least one push away Send server 430.
Client and gateway server 420 are established long connection and completed after the two-stage logs in, gateway server 420 need by User login information (session) reports push server 430, and specifically, gateway server 420 services from Zookeeper Device 400 obtains the information on services of push server 430, and finding online at least one push according to the information on services of acquisition takes Business device 430, the user login information that at least one client provides is reported online at least one push server 430, Wherein, user login information can include:User's mark, login time, log in IP, log in client etc..
At least one push server 430 is suitable to:According to the user login information received, user's identification list is recorded; And the push task issued according to message central server 410, PUSH message is sent to gateway according to user's identification list Server 420, so that PUSH message is forwarded to client by gateway server 420.
Specifically, at least one push server 430 is receiving the user login information of the transmission of gateway server 420 Afterwards, user's mark corresponding to being extracted from user login information, and recorded in user's identification list, wherein, User's identification list is used for the user's mark for recording online client, so that push server 430 is according to user's identification list Client corresponding to selection receives PUSH message.
Message central server 410 pushes strategy configuration push task according to message, and will push mission dispatching at least One push server 430, at least one push server 430 receive the push task from message central server 410, and The push task is handled, obtains corresponding PUSH message, then, according to user's identification list by PUSH message send to Gateway server 420, PUSH message is forwarded to client by gateway server 420.
The long Connection Service system provided according to the above embodiment of the present invention, based on the message push service of long connection, energy Enough ensure that message is pushed to client in real time, also helps the accurate push for realizing message, overcomes and be based in the prior art , it is necessary to which client is actively initiated, frequency is too high for the message push service of short connection, causes larger burden to server, frequency compared with It is low then it cannot be guaranteed that the real-time of message, and the defects of cause the real-time of message to be difficult to ensure that, in addition, important for some Safe category information, the time delay of short connection push is also fatal.
Embodiment five
Fig. 5 shows a kind of structural representation of according to embodiments of the present invention five long Connection Service system, and Fig. 6 is shown A kind of block diagram of according to embodiments of the present invention five long Connection Service system.Long Connection Service system is done with reference to Fig. 5 and Fig. 6 into One step introduction, the system include:Zookeeper servers 500, gateway server 510, message central server 520, at least one Individual push server 530, status center server 540, dispensing device 550 and statistic device 560;Wherein, gateway server 510 and at least one push server 530 in advance in Zookeeper servers 500 complete registration.
Zookeeper servers 500, suitable for storing the information on services of at least one push server 530.
Gateway server 510, long connection is established between client, is pushed suitable for being obtained from Zookeeper servers 500 The information on services of server 530, the user login information that at least one client provides is reported into online at least one push away Send server 530.
Message central server 520 is further adapted for:At least one Push Service is obtained from Zookeeper servers 500 The information on services of device 530, the push task of broadcast mode is sent to online push server 530, and sets online push A push server in server performs phase messages push, and all online push server perform two-stage message Push.
Specifically, Zookeeper servers 500 store the information on services of at least one push server 530, in message Central server 520 is by obtaining the information on services of at least one push server 530 from Zookeeper servers 500, according to clothes Information searching of being engaged in arrives online push server, to the push task of online push server transmission broadcast mode, wherein, extensively The process of broadcasting has two stages, and message central server 520 also needs setting to perform phase messages push and the push of two-stage message Push server, specifically set a push server in online push server and perform phase messages push, institute There is online push server to perform the push of two-stage message.
Client and gateway server 510 are established long connection and completed after the two-stage logs in, gateway server 510 need by User login information (session) reports push server 530, and specifically, gateway server 510 services from Zookeeper Device 500 obtains the information on services of push server 530, and finding online at least one push according to the information on services of acquisition takes Business device 530, the user login information that at least one client provides is reported online at least one push server 530, Wherein, user login information can include:User's mark, login time, log in IP, log in client etc..
At least one push server 530 includes:Pushing module 531, suitable for PUSH message is sent by broadcast mode To gateway server 510, so that PUSH message is forwarded to all clients for establishing long connection to complete by gateway server 510 One phase messages push;And increment user's identification list corresponding to the new user login information that screening obtains is obtained, by increment User's identification list and PUSH message are sent to gateway server 510, so that gateway server 510 identifies according to increment user PUSH message is forwarded to corresponding client to complete the push of two-stage message by list.
Specifically, message central server 520 pushes strategy configuration push task according to message, and will push mission dispatching To online push server 530, it is set and performs the push server of phase messages push to the push task that receives Handled, obtain corresponding PUSH message, and PUSH message is sent to gateway service by broadcast mode by pushing module Device, PUSH message is forwarded to all clients for establishing long connection to complete phase messages push by gateway server.
During a phase messages push is carried out or after the completion of, gateway server 510 is also possible to report new user to step on Information is recorded, it is known that push server 530 according to the user login information received, have recorded user's identification list, for Client corresponding to new user login information, it is necessary to filter out increment user identification list corresponding to new user login information, Increment user's identification list corresponding to the new user login information that the acquisition screening of pushing module 531 obtains, increment user is identified List and PUSH message are sent to gateway server 510, will be pushed according to increment user identification list by gateway server 510 Message is forwarded to corresponding client to complete the push of two-stage message, wherein, pushing module 531 needs to perform the two-stage always Message pushes, until PUSH message is expired.
In addition, message central server 520 is further adapted for:At least one push is obtained from Zookeeper servers 500 The information on services of server 530, the push task of multicast is sent to online push server, and set each online Push server performs phase messages push and the push of two-stage message.
Specifically, Zookeeper servers 500 store the information on services of at least one push server 530, in message Central server 520 is by obtaining the information on services of at least one push server 530 from Zookeeper servers 500, according to clothes Information searching of being engaged in arrives online push server 530, to the push task of the online transmission of push server 530 multicast, Wherein, multicast process has two stages, and message central server 520 also needs setting one phase messages of execution push and two-stage to disappear The push server of push is ceased, the specific each online push server of setting performs phase messages push and two-stage message Push.
At least one push server 530 includes:Pushing module 531, suitable for meeting push bar according to preparatory condition screening User's identification list of part, the user's identification list and PUSH message that meet pushing condition are sent to gateway server 510, For gateway server 510 according to corresponding to meeting user's identification list of pushing condition by PUSH message and be forwarded to client with Complete phase messages push;And obtain screening obtain meet increment corresponding to the new user login information of pushing condition User's identification list, increment user identification list and PUSH message are sent to gateway server 510, for gateway server 510 PUSH message is forwarded to according to increment user identification list corresponding to client with complete two-stage message push.
Specifically, pushing module 531 can screen the user's identification list for meeting pushing condition, example according to preparatory condition Such as, qualified user's identification list is screened according to region (IP);Screening can also be identified according to the user specified to meet User's identification list of pushing condition;User's identification list of pushing condition can also be met to screen according to specific characteristic, so Afterwards, the user's identification list and PUSH message that meet pushing condition are sent to gateway server, by gateway server according to PUSH message is forwarded to corresponding client to complete phase messages push by the user's identification list for meeting pushing condition;
During a phase messages push is carried out or after the completion of, gateway server 510 is also possible to report new user to step on Information is recorded, it is known that push server 530 according to the user login information received, have recorded user's identification list, for Client corresponding to new user login information, it is necessary to filter out increment user identification list corresponding to new user login information, Increment user's identification list corresponding to the new user login information that the acquisition screening of pushing module 531 obtains, increment user is identified List and PUSH message are sent to gateway server, and push is disappeared according to increment user's identification list by gateway server 510 Breath be forwarded to corresponding to client to complete the push of two-stage message, wherein, pushing module 531 needs to perform the two-stage always and disappeared Breath push, until the PUSH message is expired.
In embodiments of the present invention, parallel expansion push server can be needed according to business, for gateway server and For message central server, increase push server newly, do not interfere with the operation of whole system.
Status center server 540, suitable for the record PUSH message identification list pushed and the user pushed mark Know list, and user's identification list of record successful push.Wherein, status center server 540 can be that Redis is serviced Device, which user it can record to and push message, and push which message, further, it is also possible to which which user recorded It has been properly received PUSH message.
In order to prevent continually access state central server, before two-stage message push is carried out, length connection clothes Business send system that dispensing device screening can be utilized to meet increment user identity column corresponding to the new user login information of pushing condition Table, specifically, dispensing device 550, meet the new user of pushing condition to filter out suitable for inquiry status center server 540 and step on Increment user's identification list corresponding to information is recorded, and increment user's identification list is sent to pushing module 531, in order to avoid dividing Repeatedly access state central server 540, dispensing device 550 will also inquire about looking into for status center server 540 to transmitting apparatus 550 Consultation record is stored into its caching, so as to need screening to meet increment corresponding to the new user login information of pushing condition follow-up During user's identification list, its caching can be first inquired about, if inquiring in caching does not have user corresponding to new user login information The record of mark, then status center server 540 is inquired about again, and update caching.
Dispensing device 550, which filters out, meets increment user identification list corresponding to the new user login information of pushing condition Afterwards, increment user's identification list is mass-sended at least one push server 530, pushing away at least one push server 530 Send module 531 that increment user identification list and PUSH message are sent into gateway server 510, for gateway server 510 Client corresponding to PUSH message is forwarded to according to increment user identification list is to complete the push of two-stage message.
The arrival rate of message is to evaluate an important indicator of long Connection Service system, in embodiments of the present invention, state Central server 540 have recorded succeed the user's identification list pushed and the user's identification list pushed, therefore, statistics dress User's identification list of push can have been succeeded by inquiring about status center server and the user that has pushed identifies by putting 560 List;The user's identification list pushed according to succeeding and the user's identification list pushed calculate the arrival rate of PUSH message, In addition, when calculating the arrival rate of message again, it is also necessary to disappeared and handled, disappeared with avoiding same client from repeatedly receiving push Breath, and cause result of calculation inaccurate.
In embodiments of the present invention, at least one push server includes:Cache module 532, suitable for storing preset time The PUSH message identification list pushed and the user's identification list pushed in section.Specifically, cache module 532 can be deposited The nearest PUSH message identification list pushed of storage and the user's identification list pushed.
In embodiments of the present invention, at least one push server also includes:Configuration module 533, suitable for by Push Service The information on services of device is registered to configuration server.Specifically, the information on services of at least one push server includes:IP ports Number, service type, and/or presence, wherein, service type is specifically as follows message push service;Presence includes: Line and offline.
In embodiments of the present invention, at least one push server also includes:Command process module 534, disappear suitable for basis The message processing instruction that central server 520 is sent is ceased, PUSH message is correspondingly handled.
Specifically, message central server 520 can send corresponding Message Processing to push server 530 as needed Instruction, for example, push instruction, pause instruction, cancellation instruction, push server can perform according to corresponding message processing instruction Message push, pause push, cancel the processing such as push.For example, command process module 534 receives message central server The 520 cancellation message push instructions sent, search corresponding message, and new information state stops pushing to having cancelled, and updates Push user's identification list.
In embodiments of the present invention, gateway server includes multiple threads, and each push server includes connection association journey, net Close and established the link between a thread of server and the connection association journey of push server, thread passes through link and push server One-to-one relation is kept, the push of message is finally handed down to client from this connection.
The user login information that gateway server provides at least one client balancedly distributes to each thread, i.e. A certain amount of user login information is preserved in each thread, and the user login information that each thread distributes to obtain is mutual exclusion, respectively The link established reports user login information pair between connection association journey of the individual thread based at least one push server The push server answered, so as to which the user login information that each thread reports is mutual exclusion.Due to load balancing between thread, So as to which the user's mark repetitive rate recorded between push server is low;And pushing efficiency is also improved, it is also Push Service Device is capable of the key of parallel expansion.
In embodiments of the present invention, at least one push server includes:Information storage module 535, suitable for according to reception The user login information arrived, record user's identification list and thread identification.
In embodiments of the present invention, at least one push server is further adapted for:If the client that gateway server reports Hold as off-line state, then it is offline to record the presence that user corresponding to the client identifies;Or if detect and gateway Link between the thread of server disconnects, then deletes the thread identification and all user login informations pair that the thread reports The user's mark answered.
In order to ensure the accuracy of PUSH message, push server needs to obtain the upper down status of user, therefore works as and use After two-stage login is completed at family, gateway server needs user to login successfully information reporting to push server, works as client When long connection between gateway server disconnects, gateway server will delete corresponding to user login information, also to report from Wire state is to push server.Although push server is distributed, same user it is upper it is offline to offer it is same Individual push server, and to have sequential, that is, need first to report presence, then report off-line state, it is readily appreciated that if first Off-line state has been reported, then has reported presence, that corresponding user can not just fall clearly from the internal memory of push server forever.Net Close server and ensure sequential when sending, can realize message coalescing Batch sending, if every log messages are sent one by one Very big expense is had, increases the burden of gateway server.
In embodiments of the present invention, the life cycle of the thread of gateway server is equal with the life cycle linked, if pushing away Send and link disconnection between server and the thread of gateway server, then need delete push server record thread identification with And user's mark corresponding to all user login informations for reporting of the thread, specifically, push server need detection in real time with Link between the thread of gateway server whether port, link disconnection between the thread of gateway server if detecting Afterwards, then can delete the thread identification and all user login informations that the thread reports corresponding to user's mark.
In embodiments of the present invention, gateway server is further adapted for:If detect thread and at least one Push Service When link between association's journey of device disconnects, then start retry mechanism and established the link again with push server, for example, can retry 3 times;If 3 links all fail, the user login information of the threads store is transmitted to other threads.
The long Connection Service system provided according to the above embodiment of the present invention, based on the message push service of long connection, energy Enough ensure that message is pushed to client in real time, also helps the accurate push for realizing message, overcomes and be based in the prior art , it is necessary to which client is actively initiated, frequency is too high for the message push service of short connection, causes larger burden to server, frequency compared with It is low then it cannot be guaranteed that the real-time of message, and the defects of cause the real-time of message to be difficult to ensure that, in addition, important for some Safe category information, the time delay of short connection push is also fatal, in addition, also improving the pushing efficiency of message, additionally it is possible to precisely Statistical message arrival rate.
Specific introduction is done below for gateway server, gateway server during Fig. 7 is shown according to embodiments of the present invention Structural representation, as shown in fig. 7, gateway server includes:Watcher thread module 701, suitable for being obtained at least from configuration server The information on services of one service server;Long connection is established between client, and gives long connection switching to worker thread mould Block.
Worker thread module 702, suitable for client is asked using the user's logging request or business processing of long linkup transmit Ask and be transmitted to online at least one service server;And the user login information for providing at least one client reports To online at least one push server.
It is possible that the problem of collapsing, gateway server employs watcher thread mould when being run in view of gateway server The mode that block 701 and worker thread module 702 separate, the not processing business of watcher thread module 701, only responsible monitoring thread Running status, once find worker thread collapse, re-create worker thread immediately.In addition, watcher thread module 701 monitors To long Connection Service it is unavailable when, it will send SMS alarm to O&M and developer, carry out manual intervention.
In addition, worker thread module 702 is further adapted for:Error message, user when gateway server is run log in Request or business processing request recorded in daily record, and specifically, gateway server is operationally likely to encounter mistake, work Threading models recorded the error message of inside among daily record, in addition, such as running into fatal error, worker thread module can also give birth to Into coredump files, and assigned catalogue is saved in, to facilitate developer to track mistake and debugging;And connect by default Mouth checks the running status of gateway server;Client heartbeat is detected, heartbeat timeout disconnects the long connection between client;Test Whether effective demonstrate,prove user login information.
Embodiment six
Fig. 8 shows the schematic flow sheet of a kind of according to embodiments of the present invention six long Connection Service method.Such as Fig. 8 institutes Show, this method comprises the following steps:
Step S800, gateway server and at least one service server complete registration in configuration server in advance.
Step S801, establishes long connection between gateway server and client, service server is obtained from configuration server Information on services, by client using long linkup transmit user's logging request or business processing request be transmitted to it is online at least One service server.
Step S802, at least one service server are asked in response to user's logging request or business processing, and response is believed Breath or service processing result are forwarded to client by gateway server.
The long Connection Service method provided according to the above embodiment of the present invention, client are based on building between gateway server Vertical long linkup transmit user logging request or business processing request, it is possible to achieve client state real-time perception, and realize User's logging request or business processing request forwarding in real time, so as to quickly be communicated with corresponding service server, are carried Rise the security of long Connection Service.
Embodiment seven
Fig. 9 shows the schematic flow sheet of a kind of according to embodiments of the present invention seven long Connection Service method.In following step Before rapid execution, gateway server and at least one service server complete registration in configuration server in advance.In registration Afterwards, following steps are performed:
Step S900, establishes long connection between gateway server and client, at least one step on is obtained from configuration server The information on services of server is recorded, the phase user for carrying the user login information after encrypting that client is sent logs in please Ask and be transmitted to online at least one login service device.
Step S901, at least one login service device pass through a Session Key in response to a phase user logging request Gateway server is forwarded to client.
Step S902, gateway server obtains the information on services of at least one key server from configuration server, by visitor Two-stage user's logging request after Session Key encryption that family end is sent is transmitted to online at least one cipher key service Device.
Step S903, at least one key server pass through two-stage key in response to two-stage user's logging request Gateway server is forwarded to client, so that business data packet is encrypted using two-stage key for client.
Step S904, gateway server obtain the information on services of at least one cloud killing server from configuration server, will Client send carry through two-stage key encryption business data packet business processing request be transmitted to it is online at least One cloud killing server.
Step S905, at least one cloud killing server in response to business processing ask, by with cloud rules platform and Storage method is interacted, and obtains service processing result, and service processing result is forwarded into client by gateway server.
Step S906, gateway server by the user login information that at least one client provides report it is online at least One push server.
Step S907, at least one push server record user's identification list according to the user login information received; And the push task issued according to message central server, PUSH message is sent to gateway according to user's identification list and taken Business device, so that PUSH message is forwarded to client by gateway server.
Alternatively, method also includes:Whether gateway server detection receives at least one cloud in the first preset time is looked into Kill the service processing result of server return;
If not receiving the service processing result that at least one cloud killing server returns in the first preset time, start Retry mechanism sends business processing request to online at least one cloud killing server again.
Alternatively, method also includes:Message central server obtains at least one push server from configuration server Information on services, the push task of broadcast mode is sent to online push server, and is set in online push server One push server performs phase messages push, and all online push server perform the push of two-stage message.
Alternatively, the push task that at least one push server issues according to message central server, is marked according to user Know list to send PUSH message to gateway server, further wrapped so that PUSH message is forwarded to client by gateway server Include:
PUSH message is sent to gateway server by least one push server by broadcast mode, for gateway service PUSH message is forwarded to all clients for establishing long connection to complete phase messages push by device;And
Increment user's identification list corresponding to the new user login information that screening obtains is obtained, by increment user's identification list And PUSH message is sent to gateway server, so that gateway server forwards PUSH message according to increment user's identification list Pushed to corresponding client with completing two-stage message.
Alternatively, method also includes:Message central server obtains at least one push server from configuration server Information on services, the push task of multicast is sent to online push server, and set each online push server Phase messages push is performed, all online push server perform the push of two-stage message.
Alternatively, the push task that at least one push server issues according to message central server, is marked according to user Know list to send PUSH message to gateway server, further wrapped so that PUSH message is forwarded to client by gateway server Include:
At least one push server meets user's identification list of pushing condition according to preparatory condition screening, is pushed away meeting The user's identification list and PUSH message for sending condition are sent to gateway server, so that gateway server is according to meeting push bar PUSH message is forwarded to corresponding client to complete phase messages push by user's identification list of part;And
What acquisition screening obtained meets increment user identification list corresponding to the new user login information of pushing condition, will increase Amount user's identification list and PUSH message are sent to gateway server, so that gateway server is according to increment user's identification list PUSH message is forwarded to corresponding client to complete the push of two-stage message.
Alternatively, method also includes:By the PUSH message identification list pushed and the user's identification list pushed Store to status center server.
Alternatively, method also includes:After long connection is established with client, gateway server is judged when second is default The interior phase user logging request for whether receiving client transmission, if it is not, then disconnecting what is established between client Long connection.
Alternatively, method also includes:After by stage key forwarding a to client, gateway server is judged the 3rd Whether the two-stage user logging request of client transmission is received in preset time, if it is not, then disconnecting the institute between client The long connection of foundation.
Alternatively, method also includes:Gateway server is sent every the 4th preset time at least one service server Business processing is asked, to detect the upstate linked between gateway server and at least one service server.
Alternatively, gateway server includes:Watcher thread and worker thread;
Watcher thread obtains the information on services of at least one service server from configuration server;
Client is transmitted to online by worker thread using user's logging request or the business processing request of long linkup transmit At least one service server;The user login information that at least one client provides is reported into online at least one push away Send server.
Alternatively, method also includes:Long connection is established between watcher thread and client, and by long connection switching to work Make thread.
Alternatively, method also includes:Error message, user's logging request when worker thread runs gateway server or Business processing request recorded in daily record.
Alternatively, method also includes:Worker thread checks the running status of gateway server by preset interface.
Alternatively, information on services includes:IP port numbers, service type, and/or presence.
The long Connection Service method provided according to the above embodiment of the present invention, client are based on building between gateway server Vertical long linkup transmit two benches user's logging request, login service device and key server carry out two stage login authentication, The security of long Connection Service is improved, in addition, after being established by the long connection of limitation during the transmission of two benches user's logging request Between, malice connection and the attack based on TCP SYN can be effectively prevented, further improves the security of long Connection Service; Client is based on the long linkup transmit business processing request established between gateway server, it is possible to achieve service request turns in real time Hair, so as to quickly be communicated with cloud killing server, realizes client state real-time perception, when harm influence is huge When virus (such as blackmailer's virus) occurs, client can be obtained at once in the case where not upgrading by long Connection Service Preventive means, reduce harm caused by virus;Based on the message push service of long connection, it can ensure that message is pushed in real time Client, the accurate push for realizing message is also helped, overcome the message push service in the prior art based on short connection, needed Client is wanted actively to initiate, frequency is too high, and larger burden is caused to server, and frequency is relatively low then to cannot be guaranteed the real-time of message Property, and the defects of cause the real-time of message to be difficult to ensure that, in addition, for some important safe category informations, short connection push Time delay be also fatal.
Algorithm and display be not inherently related to any certain computer, virtual system or miscellaneous equipment provided herein. Various general-purpose systems can also be used together with teaching based on this.As described above, required by constructing this kind of system Structure be obvious.In addition, the present invention is not also directed to any certain programmed language.It should be understood that it can utilize various Programming language realizes the content of invention described herein, and the description done above to language-specific is to disclose this hair Bright preferred forms.
In the specification that this place provides, numerous specific details are set forth.It is to be appreciated, however, that the implementation of the present invention Example can be put into practice in the case of these no details.In some instances, known method, structure is not been shown in detail And technology, so as not to obscure the understanding of this description.
Similarly, it will be appreciated that in order to simplify the disclosure and help to understand one or more of each inventive aspect, Above in the description to the exemplary embodiment of the present invention, each feature of the invention is grouped together into single implementation sometimes In example, figure or descriptions thereof.However, the method for the disclosure should be construed to reflect following intention:I.e. required guarantor The application claims of shield features more more than the feature being expressly recited in each claim.It is more precisely, such as following Claims reflect as, inventive aspect is all features less than single embodiment disclosed above.Therefore, Thus the claims for following embodiment are expressly incorporated in the embodiment, wherein each claim is in itself Separate embodiments all as the present invention.
Those skilled in the art, which are appreciated that, to be carried out adaptively to the module in the equipment in embodiment Change and they are arranged in one or more equipment different from the embodiment.Can be the module or list in embodiment Member or component be combined into a module or unit or component, and can be divided into addition multiple submodule or subelement or Sub-component.In addition at least some in such feature and/or process or unit exclude each other, it can use any Combination is disclosed to all features disclosed in this specification (including adjoint claim, summary and accompanying drawing) and so to appoint Where all processes or unit of method or equipment are combined.Unless expressly stated otherwise, this specification (including adjoint power Profit requires, summary and accompanying drawing) disclosed in each feature can be by providing the alternative features of identical, equivalent or similar purpose come generation Replace.
In addition, it will be appreciated by those of skill in the art that although some embodiments described herein include other embodiments In included some features rather than further feature, but the combination of the feature of different embodiments means in of the invention Within the scope of and form different embodiments.For example, in the following claims, embodiment claimed is appointed One of meaning mode can use in any combination.
The all parts embodiment of the present invention can be realized with hardware, or to be run on one or more processor Software module realize, or realized with combinations thereof.It will be understood by those of skill in the art that it can use in practice Microprocessor or digital signal processor (DSP) realize some in long Connection Service equipment according to embodiments of the present invention Or some or all functions of whole parts.The present invention be also implemented as perform method as described herein one Partly or completely equipment or program of device (for example, computer program and computer program product).It is such to realize this The program of invention can store on a computer-readable medium, or can have the form of one or more signal.So Signal can download and obtain from internet website, either provide on carrier signal or provided in the form of any other.
It should be noted that the present invention will be described rather than limits the invention for above-described embodiment, and ability Field technique personnel can design alternative embodiment without departing from the scope of the appended claims.In the claims, Any reference symbol between bracket should not be configured to limitations on claims.Word "comprising" does not exclude the presence of not Element or step listed in the claims.Word "a" or "an" before element does not exclude the presence of multiple such Element.The present invention can be by means of including the hardware of some different elements and being come by means of properly programmed computer real It is existing.In if the unit claim of equipment for drying is listed, several in these devices can be by same hardware branch To embody.The use of word first, second, and third does not indicate that any order.These words can be explained and run after fame Claim.
The invention discloses:
A1. a kind of long Connection Service system, including:Gateway server, at least one service server and configuration service Device;The gateway server and at least one service server complete registration in the configuration server in advance;
Configuration server, suitable for storing the information on services of at least one service server;
Long connection is established between gateway server, with client, suitable for obtaining service server from the configuration server Information on services, by client using the long linkup transmit user's logging request or business processing request be transmitted to it is online At least one service server;
At least one service server, user's logging request or the business processing request is adapted for, response is believed Breath or service processing result are forwarded to client by the gateway server.
A2. the long Connection Service system according to A1, wherein, at least one service server includes:At least one Individual login service device and at least one key server;
The gateway server is further adapted for:The user login information carried after encrypting that the client is sent A phase user logging request be transmitted to online at least one login service device;
At least one login service device is suitable to:In response to the phase user logging request, by a Session Key Client is forwarded to by the gateway server;
The gateway server is further adapted for:The two-stage after Session Key encryption that the client is sent User's logging request is transmitted to online at least one key server;
At least one key server is suitable to:In response to the two-stage user logging request, by two-stage key Client is forwarded to by the gateway server, so that client is added using the two-stage key to business data packet Close processing.
A3. the long Connection Service system according to A2, wherein, at least one service server includes:At least one Individual cloud killing server;
The gateway server is further adapted for:The industry through the encryption of two-stage key is carried by what the client was sent The business processing request of business packet is transmitted to online at least one cloud killing server;
At least one cloud killing server is suitable to:In response to business processing ask, by with cloud rules platform and Storage system is interacted, and obtains service processing result, and the service processing result is forwarded to by the gateway server Client.
A4. the long Connection Service system according to A3, wherein, the gateway server is further adapted for:If first The service processing result that at least one cloud killing server returns is not received in preset time, then starts retry mechanism again The business processing request is sent to online at least one cloud killing server.
A5. the long Connection Service system according to A2, wherein, the system also includes:Message central server, it is suitable to Message push strategy is managed, strategy configuration push task is pushed according to the message;
At least one service server includes:At least one push server;
The gateway server is further adapted for:The user login information that at least one client provides is reported online At least one push server;
At least one push server is suitable to:According to the user login information received, user's identification list is recorded; And the push task issued according to the message central server, PUSH message is sent to net according to user's identification list Server is closed, so that PUSH message is forwarded to client by the gateway server.
A6. the long Connection Service system according to A5, wherein, the message central server is further adapted for:From with The information on services that server obtains at least one push server is put, the push of broadcast mode is sent to online push server Task, and set a push server in online push server and perform phase messages push, all online pushes away Server is sent to perform the push of two-stage message.
A7. the long Connection Service system according to A6, wherein, at least one push server includes:Push mould Block, suitable for PUSH message is sent into gateway server by broadcast mode, so that the gateway server turns PUSH message All clients for establishing long connection are sent to complete phase messages push;And obtain the new user that screening obtains and log in Increment user identification list corresponding to information, the increment user identification list and PUSH message are sent to gateway service Device, for the gateway server according to increment user identification list PUSH message is forwarded to corresponding to client to complete two Phase messages push.
A8. the long Connection Service system according to A5, wherein, the message central server is further adapted for:From with The information on services that server obtains at least one push server is put, the push of multicast is sent to online push server Task, and set each online push server and perform phase messages push and the push of two-stage message.
A9. the long Connection Service system according to A8, wherein, at least one push server includes:Push mould Block, suitable for meeting user's identification list of pushing condition according to preparatory condition screening, user's identity column of pushing condition will be met Table and PUSH message are sent to gateway server, so that the gateway server is according to the user's identity column for meeting pushing condition PUSH message is forwarded to corresponding client to complete phase messages push by table;And obtain that screening obtains meets and pushes away Increment user identification list corresponding to the new user login information of condition is sent, increment user identification list and PUSH message are sent out Gateway server is given, so that PUSH message is forwarded to corresponding visitor by the gateway server according to increment user identification list Family end is pushed with completing two-stage message.
A10. the long Connection Service system according to any one of A5-A9, wherein, the long Connection Service system is also wrapped Include:Status center server, suitable for the record PUSH message identification list pushed and the user's identification list pushed.
A11. the long Connection Service system according to A2, wherein, the gateway server is further adapted for:With client After the long connection of end foundation, judge that the phase user that client transmission whether is received in the second preset time logs in and ask Ask, if it is not, then disconnecting the long connection established between client.
A12. the long Connection Service system according to A2, wherein, the gateway server is further adapted for:By single order After section key forwarding to client, judge that the two-stage user that client transmission whether is received in the 3rd preset time steps on Record request, if it is not, then disconnecting the long connection established between client.
A13. the long Connection Service system according to any one of A1-A12, wherein, the gateway server is further fitted In:Every the 4th preset time at least one service server send business processing request, with detect gateway server with extremely The upstate of link between a few service server.
A14. the long Connection Service system according to any one of A1-A13, wherein, the gateway server includes:
Watcher thread module, suitable for obtaining the information on services of at least one service server from the configuration server;
Worker thread module, suitable for client is turned using user's logging request or the business processing request of long linkup transmit Issue online at least one service server;By the user login information that at least one client provides report it is online extremely A few push server.
A15. the long Connection Service system according to A14, wherein, the watcher thread module is further adapted for:With visitor Long connection is established between the end of family, and gives the long connection switching to worker thread module.
A16. the long Connection Service system according to A14 or A15, wherein, the worker thread module is further adapted for: Error message, user's logging request or business processing request when the gateway server is run recorded in daily record.
A17. the long Connection Service system according to any one of A14-A16, wherein, the worker thread module is further It is suitable to:The running status of the gateway server is checked by preset interface.
A18. the long Connection Service system according to any one of A1-A17, wherein, the information on services includes:IP ports Number, service type, and/or presence.
B19. a kind of long Connection Service method, including:
Gateway server and at least one service server complete registration in configuration server in advance;
Long connection is established between the gateway server and client, service server is obtained from the configuration server Information on services, by client using the long linkup transmit user's logging request or business processing request be transmitted to it is online extremely A few service server;
At least one service server is asked in response to user's logging request or business processing, by response message or industry Business result is forwarded to client by the gateway server.
B20. the long Connection Service method according to B19, wherein, at least one service server includes:At least One login service device and at least one key server;
The gateway server by client using user's logging request of the long linkup transmit be transmitted to it is online extremely A few service server further comprises:
The stage for carrying the user login information after encrypting that the gateway server sends the client is used Family logging request is transmitted to online at least one login service device;
One Session Key is passed through institute by least one login service device in response to the phase user logging request State gateway server and be forwarded to client;
The two-stage user after Session Key encryption that the gateway server sends the client logs in please Ask and be transmitted to online at least one key server;
Two-stage key is passed through institute by least one key server in response to the two-stage user logging request State gateway server and be forwarded to client, so that client business data packet is encrypted place using the two-stage key Reason.
B21. the long Connection Service method according to B20, wherein, at least one service server includes:At least One cloud killing server;
The gateway server by client using the long linkup transmit business processing request be transmitted to it is online extremely A few service server further comprises:
The gateway server is by business data packet of the carrying of sending of the client through the encryption of two-stage key Business processing request is transmitted to online at least one cloud killing server;
At least one cloud killing server in response to business processing ask, by with cloud rules platform and storage side Method is interacted, and obtains service processing result, and the service processing result is forwarded into client by the gateway server.
B22. the long Connection Service method according to B21, wherein, methods described also includes:
Whether the gateway server detection receives what at least one cloud killing server returned in the first preset time Service processing result;
If not receiving the service processing result that at least one cloud killing server returns in the first preset time, start Retry mechanism sends the business processing to online at least one cloud killing server again and asked.
B23. the long Connection Service method according to B20, wherein, at least one service server includes:At least One push server;
Methods described also includes:The gateway server reports the user login information that at least one client provides Online at least one push server;
At least one push server records user's identification list according to the user login information received;And The push task issued according to the message central server, PUSH message is sent to gateway service according to user's identification list Device, so that PUSH message is forwarded to client by the gateway server.
B24. the long Connection Service method according to B23, wherein, methods described also includes:Message central server from Configuration server obtains the information on services of at least one push server, and pushing away for broadcast mode is sent to online push server Task is sent, and sets a push server in online push server and performs phase messages push, it is all online Push server performs the push of two-stage message.
B25. the long Connection Service method according to B24, wherein, at least one push server disappears according to The push task that breath central server issues, sends PUSH message to gateway server according to user's identification list, for institute State gateway server PUSH message is forwarded to client and further comprise:
PUSH message is sent to gateway server by least one push server by broadcast mode, for described PUSH message is forwarded to all clients for establishing long connection to complete phase messages push by gateway server;And
Increment user's identification list corresponding to obtaining the new user login information that screening obtains, the increment user is identified List and PUSH message are sent to gateway server, so that the gateway server will push according to increment user identification list Message is forwarded to corresponding client to complete the push of two-stage message.
B26. the long Connection Service method according to B23, wherein, methods described also includes:Message central server from Configuration server obtains the information on services of at least one push server, and pushing away for multicast is sent to online push server Task is sent, and sets each online push server and performs phase messages push, all online push server perform Two-stage message pushes.
B27. the long Connection Service method according to B26, wherein, at least one push server disappears according to The push task that breath central server issues, sends PUSH message to gateway server according to user's identification list, for institute State gateway server PUSH message is forwarded to client and further comprise:
At least one push server meets user's identification list of pushing condition according to preparatory condition screening, will accord with The user's identification list and PUSH message for closing pushing condition are sent to gateway server, so that the gateway server is according to symbol PUSH message is forwarded to corresponding client to complete phase messages push by the user's identification list for closing pushing condition;And
What acquisition screening obtained meets increment user identification list corresponding to the new user login information of pushing condition, will increase Amount user's identification list and PUSH message are sent to gateway server, so that the gateway server identifies according to increment user PUSH message is forwarded to corresponding client to complete the push of two-stage message by list.
B28. the long Connection Service method according to any one of B23-B27, wherein, methods described also includes:It will push away The PUSH message identification list sent and the user's identification list pushed are stored to status center server.
B29. the long Connection Service method according to B20, wherein, methods described also includes:Grown being established with client After connection, the phase user that the gateway server judges whether to receive client transmission in the second preset time is stepped on Record request, if it is not, then disconnecting the long connection established between client.
B30. the long Connection Service method according to B20, wherein, methods described also includes:Turn by a Session Key It is sent to after client, the gateway server judges the two-stage of client transmission whether is received in the 3rd preset time User's logging request, if it is not, then disconnecting the long connection established between client.
B31. the long Connection Service method according to any one of B19-B30, wherein, methods described also includes:Gateway takes Be engaged in device every the 4th preset time at least one service server send business processing request, with detect gateway server with extremely The upstate of link between a few service server.
B32. the long Connection Service method according to any one of B19-B31, wherein, the gateway server includes:Prison Listen thread and worker thread;
Watcher thread obtains the information on services of at least one service server from the configuration server;
Client is transmitted to online by worker thread using user's logging request or the business processing request of long linkup transmit At least one service server;The user login information that at least one client provides is reported into online at least one push away Send server.
B33. the long Connection Service method according to B32, wherein, methods described also includes:The watcher thread and visitor Long connection is established between the end of family, and by the long connection switching to worker thread.
B34. the long Connection Service method according to B32 or B33, wherein, methods described also includes:The worker thread Error message, user's logging request or business processing request when the gateway server is run recorded in daily record.
B35. the long Connection Service method according to any one of B32-B34, wherein, methods described also includes:The work Make the running status that thread checks the gateway server by preset interface.
B36. the long Connection Service method according to any one of B19-B35, wherein, the information on services includes:IP ends Slogan, service type, and/or presence.

Claims (10)

1. a kind of long Connection Service system, including:Gateway server, at least one service server and configuration server;Institute State gateway server and at least one service server and complete registration in the configuration server in advance;
Configuration server, suitable for storing the information on services of at least one service server;
Long connection is established between gateway server, with client, suitable for obtaining the clothes of service server from the configuration server Be engaged in information, by client using the long linkup transmit user's logging request or business processing request be transmitted to it is online at least One service server;
At least one service server, be adapted for user's logging request or business processing request, by response message or Service processing result is forwarded to client by the gateway server.
2. long Connection Service system according to claim 1, wherein, at least one service server includes:At least One login service device and at least one key server;
The gateway server is further adapted for:Carry the user login information after encrypting one that the client is sent Phase user logging request is transmitted to online at least one login service device;
At least one login service device is suitable to:In response to the phase user logging request, a Session Key is passed through The gateway server is forwarded to client;
The gateway server is further adapted for:The two-stage user after Session Key encryption that the client is sent Logging request is transmitted to online at least one key server;
At least one key server is suitable to:In response to the two-stage user logging request, two-stage key is passed through The gateway server is forwarded to client, so that client business data packet is encrypted place using the two-stage key Reason.
3. long Connection Service system according to claim 2, wherein, at least one service server includes:At least One cloud killing server;
The gateway server is further adapted for:The business number through the encryption of two-stage key is carried by what the client was sent Online at least one cloud killing server is transmitted to according to the business processing request of bag;
At least one cloud killing server is suitable to:In response to business processing ask, by with cloud rules platform and storage System is interacted, and obtains service processing result, and the service processing result is forwarded into client by the gateway server End.
4. long Connection Service system according to claim 3, wherein, the gateway server is further adapted for:If The service processing result that at least one cloud killing server returns is not received in one preset time, then starts retry mechanism again It is secondary to send the business processing request to online at least one cloud killing server.
5. long Connection Service system according to claim 2, wherein, the system also includes:Message central server, fit In management message push strategy, strategy configuration push task is pushed according to the message;
At least one service server includes:At least one push server;
The gateway server is further adapted for:By the user login information that at least one client provides report it is online extremely A few push server;
At least one push server is suitable to:According to the user login information received, user's identification list is recorded;With And the push task issued according to the message central server, PUSH message is sent to gateway according to user's identification list Server, so that PUSH message is forwarded to client by the gateway server.
6. long Connection Service system according to claim 5, wherein, the message central server is further adapted for:From Configuration server obtains the information on services of at least one push server, and pushing away for broadcast mode is sent to online push server Task is sent, and sets a push server in online push server and performs phase messages push, it is all online Push server performs the push of two-stage message.
7. long Connection Service system according to claim 6, wherein, at least one push server includes:Push Module, suitable for PUSH message is sent into gateway server by broadcast mode, so that the gateway server is by PUSH message All clients for establishing long connection are forwarded to complete phase messages push;And obtain the new user that screening obtains and step on Increment user's identification list corresponding to recording information, gateway service is sent to by the increment user identification list and PUSH message Device, for the gateway server according to increment user identification list PUSH message is forwarded to corresponding to client to complete two Phase messages push.
8. long Connection Service system according to claim 5, wherein, the message central server is further adapted for:From Configuration server obtains the information on services of at least one push server, and pushing away for multicast is sent to online push server Task is sent, and sets each online push server and performs phase messages push and the push of two-stage message.
9. long Connection Service system according to claim 8, wherein, at least one push server includes:Push Module, suitable for meeting user's identification list of pushing condition according to preparatory condition screening, the user for meeting pushing condition is identified List and PUSH message are sent to gateway server, so that the gateway server identifies according to the user for meeting pushing condition PUSH message is forwarded to corresponding client to complete phase messages push by list;And obtain screening obtain meet Increment user's identification list corresponding to the new user login information of pushing condition, by increment user identification list and PUSH message Be sent to gateway server, according to increment user identification list PUSH message is forwarded to for the gateway server corresponding to Client is pushed with completing two-stage message.
10. a kind of long Connection Service method, including:
Gateway server and at least one service server complete registration in configuration server in advance;
Long connection is established between the gateway server and client, the service of service server is obtained from the configuration server Information, client is transmitted to online at least one using user's logging request or the business processing request of the long linkup transmit Individual service server;
At least one service server is asked in response to user's logging request or business processing, at response message or business Reason result is forwarded to client by the gateway server.
CN201710772540.5A 2017-08-31 2017-08-31 Long connection service system and method Expired - Fee Related CN107580046B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710772540.5A CN107580046B (en) 2017-08-31 2017-08-31 Long connection service system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710772540.5A CN107580046B (en) 2017-08-31 2017-08-31 Long connection service system and method

Publications (2)

Publication Number Publication Date
CN107580046A true CN107580046A (en) 2018-01-12
CN107580046B CN107580046B (en) 2021-02-23

Family

ID=61029909

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710772540.5A Expired - Fee Related CN107580046B (en) 2017-08-31 2017-08-31 Long connection service system and method

Country Status (1)

Country Link
CN (1) CN107580046B (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110602111A (en) * 2019-09-19 2019-12-20 湖南快乐阳光互动娱乐传媒有限公司 Interface anti-brushing method and system based on long connection
CN110855785A (en) * 2019-11-17 2020-02-28 广州荔支网络技术有限公司 Data processing method and device
CN111010722A (en) * 2019-12-22 2020-04-14 北京世福宝科技有限公司 Novel wireless networking method between intelligent repeater and lithium point
CN111447185A (en) * 2020-03-10 2020-07-24 平安科技(深圳)有限公司 Processing method of push information and related equipment
CN112600847A (en) * 2020-12-17 2021-04-02 浪潮(北京)电子信息产业有限公司 Business processing method, system, electronic equipment and storage medium
CN112714408A (en) * 2020-12-18 2021-04-27 武汉欣海远航科技研发有限公司 Ship and personnel tracking and positioning method for offshore wind farm
CN113259492A (en) * 2021-07-07 2021-08-13 天聚地合(苏州)数据股份有限公司 Service request forwarding method and system
CN113347234A (en) * 2021-05-21 2021-09-03 微民保险代理有限公司 Network information acquisition method, device, system, computer equipment and storage medium
CN113452765A (en) * 2021-06-21 2021-09-28 北京达佳互联信息技术有限公司 Long-connection communication method, system, device, storage medium and program product
CN114095559A (en) * 2021-11-17 2022-02-25 北京同城必应科技有限公司 Solution for solving online state storage consistency under long-connection high-concurrency scene
CN114938373A (en) * 2022-05-23 2022-08-23 睿云联(厦门)网络通讯技术有限公司 High-availability connection method and system for cloud platform TCP long connection service
CN115190158A (en) * 2021-03-22 2022-10-14 北京小米移动软件有限公司 Information interaction method, information interaction device, information interaction system and storage medium
CN115334144A (en) * 2022-06-29 2022-11-11 上海万物新生环保科技集团有限公司 Method, device and system for processing service state change notification

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101072102A (en) * 2007-03-23 2007-11-14 南京联创网络科技有限公司 Information leakage preventing technology based on safety desktop for network environment
CN102761864A (en) * 2011-04-29 2012-10-31 中国移动通信集团公司 Data transmission method, system and device
CN103051715A (en) * 2012-12-24 2013-04-17 东软熙康健康科技有限公司 Method for releasing notice to terminal, relevant device and system
US8875223B1 (en) * 2011-08-31 2014-10-28 Palo Alto Networks, Inc. Configuring and managing remote security devices
CN105141452A (en) * 2015-08-07 2015-12-09 北京思特奇信息技术股份有限公司 High-performance service system and method based on CXF
CN106998551A (en) * 2016-01-25 2017-08-01 中兴通讯股份有限公司 A kind of method, system, device and the terminal of application access authentication
CN107086954A (en) * 2017-05-23 2017-08-22 北京奇虎科技有限公司 Information push method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101072102A (en) * 2007-03-23 2007-11-14 南京联创网络科技有限公司 Information leakage preventing technology based on safety desktop for network environment
CN102761864A (en) * 2011-04-29 2012-10-31 中国移动通信集团公司 Data transmission method, system and device
US8875223B1 (en) * 2011-08-31 2014-10-28 Palo Alto Networks, Inc. Configuring and managing remote security devices
CN103051715A (en) * 2012-12-24 2013-04-17 东软熙康健康科技有限公司 Method for releasing notice to terminal, relevant device and system
CN105141452A (en) * 2015-08-07 2015-12-09 北京思特奇信息技术股份有限公司 High-performance service system and method based on CXF
CN106998551A (en) * 2016-01-25 2017-08-01 中兴通讯股份有限公司 A kind of method, system, device and the terminal of application access authentication
CN107086954A (en) * 2017-05-23 2017-08-22 北京奇虎科技有限公司 Information push method and device

Cited By (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110602111B (en) * 2019-09-19 2022-04-19 湖南快乐阳光互动娱乐传媒有限公司 Interface anti-brushing method and system based on long connection
CN110602111A (en) * 2019-09-19 2019-12-20 湖南快乐阳光互动娱乐传媒有限公司 Interface anti-brushing method and system based on long connection
CN110855785A (en) * 2019-11-17 2020-02-28 广州荔支网络技术有限公司 Data processing method and device
CN110855785B (en) * 2019-11-17 2022-08-09 广州荔支网络技术有限公司 Data processing method and device
CN111010722A (en) * 2019-12-22 2020-04-14 北京世福宝科技有限公司 Novel wireless networking method between intelligent repeater and lithium point
CN111447185A (en) * 2020-03-10 2020-07-24 平安科技(深圳)有限公司 Processing method of push information and related equipment
CN111447185B (en) * 2020-03-10 2023-07-28 平安科技(深圳)有限公司 Push information processing method and related equipment
CN112600847A (en) * 2020-12-17 2021-04-02 浪潮(北京)电子信息产业有限公司 Business processing method, system, electronic equipment and storage medium
CN112600847B (en) * 2020-12-17 2023-02-28 浪潮(北京)电子信息产业有限公司 Business processing method, system, electronic equipment and storage medium
CN112714408A (en) * 2020-12-18 2021-04-27 武汉欣海远航科技研发有限公司 Ship and personnel tracking and positioning method for offshore wind farm
CN112714408B (en) * 2020-12-18 2022-07-12 武汉欣海远航科技研发有限公司 Ship and personnel tracking and positioning method for offshore wind farm
CN115190158A (en) * 2021-03-22 2022-10-14 北京小米移动软件有限公司 Information interaction method, information interaction device, information interaction system and storage medium
CN113347234A (en) * 2021-05-21 2021-09-03 微民保险代理有限公司 Network information acquisition method, device, system, computer equipment and storage medium
CN113452765A (en) * 2021-06-21 2021-09-28 北京达佳互联信息技术有限公司 Long-connection communication method, system, device, storage medium and program product
CN113452765B (en) * 2021-06-21 2023-02-17 北京达佳互联信息技术有限公司 Long-connection communication method, system, device, storage medium and program product
CN113259492B (en) * 2021-07-07 2021-12-10 天聚地合(苏州)数据股份有限公司 Service request forwarding method and system
CN113259492A (en) * 2021-07-07 2021-08-13 天聚地合(苏州)数据股份有限公司 Service request forwarding method and system
CN114095559A (en) * 2021-11-17 2022-02-25 北京同城必应科技有限公司 Solution for solving online state storage consistency under long-connection high-concurrency scene
CN114938373A (en) * 2022-05-23 2022-08-23 睿云联(厦门)网络通讯技术有限公司 High-availability connection method and system for cloud platform TCP long connection service
CN114938373B (en) * 2022-05-23 2023-11-03 睿云联(厦门)网络通讯技术有限公司 High-availability connection method and system for cloud platform TCP long connection service
CN115334144A (en) * 2022-06-29 2022-11-11 上海万物新生环保科技集团有限公司 Method, device and system for processing service state change notification

Also Published As

Publication number Publication date
CN107580046B (en) 2021-02-23

Similar Documents

Publication Publication Date Title
CN107580046A (en) Long connection service system and method
CN107395767A (en) Message push system and method based on long connection
US11902311B2 (en) Communications methods and apparatus for dynamic detection and/or mitigation of threats and/or anomalies
US20150350048A1 (en) User Defined Objects for Network Devices
US11856018B2 (en) Managing traffic control in a network mitigating DDOS
EP2518940A1 (en) Automatic network topology detection and modeling
US20170223041A1 (en) Network traffic filtering and routing for threat analysis
CN100463413C (en) Management system for warranting consistency between inter-client communication logs
CN104539604B (en) Website protection method and device
CN105071989A (en) Video content distribution quality monitoring system and monitoring method therefor
US10735453B2 (en) Network traffic filtering and routing for threat analysis
CN107205026A (en) A kind of Point-to-Point Data Transmission method and system
US10812511B2 (en) Method for processing a network service
CN110266650A (en) The recognition methods of Conpot industry control honey jar
CN109525620B (en) Message pushing system, method and device
US10462190B1 (en) Virtual ethernet tap
US11563632B2 (en) User defined objects for network devices
CN109600395A (en) A kind of device and implementation method of terminal network access control system
WO2010100547A2 (en) Systems and methods for detecting and preventing denial of service attacks in an iptv system
Colelli et al. Securing connection between IT and OT: the Fog Intrusion Detection System prospective
CN109587134A (en) Method, apparatus, equipment and the medium of the safety certification of interface bus
EP4169219B1 (en) Methods, system and communication devices related to lawful interception
US20180367562A1 (en) Avoidance of weaknesses
CN113452702B (en) Micro-service traffic detection system and method
WO2017073030A1 (en) Gateway device, communication control method, communication control system, and program storage medium

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
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20210223

CF01 Termination of patent right due to non-payment of annual fee