CN107395767A - Message push system and method based on long connection - Google Patents

Message push system and method based on long connection Download PDF

Info

Publication number
CN107395767A
CN107395767A CN201710774218.6A CN201710774218A CN107395767A CN 107395767 A CN107395767 A CN 107395767A CN 201710774218 A CN201710774218 A CN 201710774218A CN 107395767 A CN107395767 A CN 107395767A
Authority
CN
China
Prior art keywords
push
server
message
user
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
CN201710774218.6A
Other languages
Chinese (zh)
Other versions
CN107395767B (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 QIYUAN 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 CN201710774218.6A priority Critical patent/CN107395767B/en
Publication of CN107395767A publication Critical patent/CN107395767A/en
Application granted granted Critical
Publication of CN107395767B publication Critical patent/CN107395767B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/55Push-based network services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • H04L63/0478Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload applying multiple layers of encryption, e.g. nested tunnels or encrypting the content with a first key and then with at least a second key
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/06Network architectures or network communication protocols for network security for supporting key management in a packet data network
    • H04L63/062Network architectures or network communication protocols for network security for supporting key management in a packet data network for key distribution, e.g. centrally by trusted party
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities

Abstract

The invention discloses a kind of message push system and method based on long connection.Wherein system includes:Gateway server, at least one push server, message central server and configuration server;Gateway server and at least one push server complete registration in configuration server in advance;Message push service based on long connection, it can ensure that message is pushed to client in real time, the accurate push for realizing message is also helped, overcomes the message push service in the prior art based on short connection, it is necessary to which client is actively initiated, frequency is too high, and larger burden is caused to server, frequency is relatively 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, for some important safe category informations, the time delay of short connection push is also fatal.

Description

Message push system and method based on long connection
Technical field
The present invention relates to field of computer technology, and in particular to a kind of message push system and method based on long connection.
Background technology
In existing message push service, the Push Service of short connection is much all based on, short connection Push Service needs Want client to be needed actively to initiate push request according to business, disconnected after the completion of push, if client initiates frequency mistake It is high then larger burden is easily caused to server, but if it is relatively low then it cannot be guaranteed that PUSH message is real-time by client to initiate frequency Ground receives, and for some important message, the time delay for being transmitted and being occurred based on short connection is fatal.
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 message push system based on long connection of problem and the message accordingly based on long connection pushes and method.
According to an aspect of the invention, there is provided a kind of message push system based on long connection, including:Gateway service Device, at least one push server, message central server and configuration server;Gateway server and at least one push clothes Being engaged in, device in advance register in configuration server by completion;
Configuration server, suitable for storing the information on services of at least one push server;
Message central server, suitable for management message push strategy, strategy configuration push task is pushed according to message;
Long connection is established between gateway server, with client, suitable for getting the use of at least one client offer After the log-on message of family, the information on services of push server, the user that at least one client is provided are obtained from configuration server Log-on message reports online at least one push server;
At least one push server, suitable for according to the user login information received, recording user's identification list;With And the push task issued according to 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 gateway server.
According to another aspect of the present invention, there is provided a kind of information push method based on long connection, including:
Gateway server and at least one push server complete registration in configuration server in advance;
Long connection is established between gateway server and client, is logged in the user for getting at least one client offer After information, the information on services of push server is obtained from configuration server, the user that at least one client is provided logs in letter Breath reports online at least one push server;
At least one push server records user's identification list according to the user login information received;And according to The push task that message central server issues, PUSH message is sent to gateway server according to user's identification list, for PUSH message is forwarded to client by gateway server.
According to scheme provided by the invention, based on the message push service of long connection, it can ensure that message pushes in real time To client, the accurate push for realizing message is also helped, overcomes the message push service in the prior art based on short connection, Client is needed actively to initiate, frequency is too high, and larger burden, the relatively low reality that then cannot be guaranteed message of frequency are caused to server Shi Xing, 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 pushes away The time delay sent is also fatal.
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 message push system based on long connection Figure;
Fig. 2 shows a kind of structural representation of according to embodiments of the present invention two message push system based on long connection Figure;
Fig. 3 shows a kind of block diagram of according to embodiments of the present invention two message push system based on long connection;
Fig. 4 shows a kind of structural representation of according to embodiments of the present invention three long Connection Service system;
Fig. 5 shows a kind of structural representation of according to embodiments of the present invention four long Connection Service system;
Fig. 6 shows a kind of structural representation 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 a kind of flow signal of according to embodiments of the present invention six information push method based on long connection Figure;
Fig. 9 shows the schematic flow sheet of a kind of according to embodiments of the present invention seven long Connection Service method;
Figure 10 shows the schematic flow sheet of a kind of according to embodiments of the present invention eight 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 message push system based on long connection Figure.As shown in figure 1, the system includes:Configuration server 100, message central server 110, gateway server 120 and at least One push server 130;Wherein, gateway server 120 and at least one push server 130 are in advance in configuration server Registration is completed in 100.
Configuration server 100, suitable for storing the information on services of at least one push server 130.
Message central server 110, 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 120, long connection is established between client, suitable for getting what at least one client provided After user login information, the information on services of push server 130 is obtained from configuration server 100, at least one client is carried The user login information of confession reports online at least one push server 130.
After client establishes long connection with gateway server 120, gateway server 120 needs will get at least one The user login information (session) of individual client reports push server 130, and specifically, gateway server 120 is from configuration Server 100 obtains the information on services of push server 130, and online at least one push away is found according to the information on services of acquisition Server 130 is sent, the user login information that at least one client provides is reported to online at least one push server 130, wherein, user login information can include:User's mark, login time, log in IP, log in client etc..
At least one push server 130 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 110, PUSH message is sent to gateway according to user's identification list Server 120, so that PUSH message is forwarded to client by gateway server 120.
Specifically, at least one push server 130 is receiving the user login information of the transmission of gateway server 120 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 130 is according to user's identification list Client corresponding to selection receives PUSH message.
Message central server 110 pushes strategy configuration push task according to message, and will push mission dispatching at least One push server 130, at least one push server 130 receive the push task from message central server 110, and The push task is handled, obtains corresponding PUSH message, then, according to user's identification list by PUSH message send to Gateway server 120, PUSH message is forwarded to client by gateway server 120.
The message push system based on long connection provided according to the above embodiment of the present invention, the message based on long connection push away Business is taken, can ensure that message is pushed to client in real time, the accurate push for realizing message is also helped, overcomes existing skill For message push service based on short connection in art, it is necessary to which client is actively initiated, frequency is too high, server is caused larger negative Load, frequency is relatively 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, for Some important safe category informations, the time delay of short connection push is also fatal.
Configuration service implement body can be Zookeeper servers, and it stores push server as configuration server Information on services, for example, IP port numbers, service type, and/or presence etc., are merely illustrative of here, without any Restriction effect.The service type and port numbers that at least one push server is provided are registered to Zookeeper servers, and Gateway server then obtains the information on services of push server from Zookeeper servers, and user login information is reported and pushed away Server is sent, wherein, the service server composition cluster of Zookeeper servers typically configuration three to five, there is disaster tolerance energy Power, ensure that service invariant can use, described in detail below in conjunction with specific embodiment:
Fig. 2 shows a kind of structural representation of according to embodiments of the present invention two message push system based on long connection Figure, Fig. 3 show a kind of block diagram of according to embodiments of the present invention two message push system based on long connection.With reference to Fig. 2 and Fig. 3 is described further to the message push system based on long connection, and the system includes:Zookeeper servers 200, gateway Server 210, message central server 220, at least one push server 230, status center server 240, dispensing device 250 and statistic device 260;Wherein, gateway server 210 and at least one push server 230 take in Zookeeper in advance It is engaged in completing registration in device 200.
Zookeeper servers 200, suitable for storing the information on services of at least one push server 230.
Gateway server 210, long connection is established between client, suitable for getting what at least one client provided After user login information, the information on services of push server 230 is obtained from Zookeeper servers 200, by least one client The user login information that end provides reports online at least one push server 230.
Message central server 220 is further adapted for:At least one Push Service is obtained from Zookeeper servers 200 The information on services of device 230, the push task of broadcast mode is sent to online push server 230, 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 200 store the information on services of at least one push server 230, in message Central server 220 is by obtaining the information on services of at least one push server 230 from Zookeeper servers 200, according to clothes Information searching of being engaged in arrives online push server 230, to the push task of the online transmission of push server 230 broadcast mode, Wherein, broadcasting process has two stages, and message central server 220 also needs setting one phase messages of execution push and two-stage to disappear The push server 230 of push is ceased, in online push server push server is specifically set and performs a stage and disappear Breath push, all online push server perform the push of two-stage message.
Client and gateway server 210 are established long connection and completed after the two-stage logs in, gateway server 210 need by User login information (session) reports push server 230, and specifically, gateway server 210 services from Zookeeper Device 200 obtains the information on services of push server 230, and finding online at least one push according to the information on services of acquisition takes Business device 230, the user login information that at least one client provides is reported online at least one push server 230, Wherein, user login information can include:User's mark, login time, log in IP, log in client etc..
At least one push server 230 includes:Pushing module 231, suitable for PUSH message is sent by broadcast mode To gateway server 210, so that PUSH message is forwarded to all clients for establishing long connection to complete by gateway server 210 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 210, so that gateway server 210 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 220 pushes strategy configuration push task according to message, and will push mission dispatching To online push server 230, 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 by broadcast mode by pushing module 231 and taken Business device 210, PUSH message is forwarded to all clients for establishing long connection to complete a phase messages by gateway server 210 Push.
During a phase messages push is carried out or after the completion of, gateway server 210 is also possible to report new user to step on Information is recorded, it is known that push server 230 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 231 obtains, increment user is identified List and PUSH message are sent to gateway server 210, will be pushed according to increment user identification list by gateway server 210 Message is forwarded to corresponding client to complete the push of two-stage message, wherein, pushing module 231 needs to perform the two-stage always Message pushes, until PUSH message is expired.
In addition, message central server 220 is further adapted for:At least one push is obtained from Zookeeper servers 200 The information on services of server 230, 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 200 store the information on services of at least one push server 230, in message Central server 220 is by obtaining the information on services of at least one push server 230 from Zookeeper servers 200, according to clothes Information searching of being engaged in arrives online push server, to the push task of online push server transmission multicast, wherein, it is more The process of broadcasting has two stages, and message central server 220 also needs setting to perform phase messages push and the push of two-stage message Push server, the specific each online push server of setting performs phase messages push and the push of two-stage message.
At least one push server 230 includes:Pushing module 231, 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 210, For gateway server 210 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 210, for gateway server 210 PUSH message is forwarded to according to increment user identification list corresponding to client with complete two-stage message push.
Specifically, pushing module 231 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 210 PUSH message is forwarded to corresponding client to complete phase messages push according to the user's identification list for meeting pushing condition;
During a phase messages push is carried out or after the completion of, gateway server 210 is also possible to report new user to step on Information is recorded, it is known that push server 230 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 231 obtains, increment user is identified List and PUSH message are sent to gateway server 210, will be pushed according to increment user identification list by gateway server 210 Message is forwarded to corresponding client to complete the push of two-stage message, wherein, pushing module 231 needs to perform the two-stage always Message pushes, until the PUSH message is expired.
In embodiments of the present invention, parallel expansion push server 230 can be needed according to business, for gateway server 210 and message central server 220 for, increase newly push server, do not interfere with the operation of whole system.
Status center server 240, 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 240 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, should be connected based on long The message push system connect can utilize dispensing device screening to meet increment corresponding to the new user login information of pushing condition and use Family identification list, specifically, dispensing device 250, meet pushing condition suitable for inquiry status center server 240 to filter out Increment user's identification list corresponding to new user login information, and increment user's identification list is sent to pushing module, in order to Dispensing device repeatedly access state central server 240 is avoided, dispensing device 250 will also inquiry status center server 240 Inquiry record storage into its caching, so as to it is follow-up need to screen meet corresponding to the new user login information of pushing condition During increment user's identification list, its caching can be first inquired about, if inquire does not have corresponding to new user login information in caching The record of user's mark, then inquire about status center server 240, and update caching again.
Dispensing device 250, 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 230, pushing away at least one push server 230 Send module 231 that increment user identification list and PUSH message are sent into gateway server 210, for gateway server 210 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 supplying system, in embodiments of the present invention, status center clothes Business device 240 have recorded succeed the user's identification list pushed and the user's identification list pushed, therefore, statistic device 260 By inquire about status center server 240 can have been succeeded push user's identification list and user's identity column for having pushed Table;The user's identification list pushed according to succeeding and the user's identification list pushed calculate the arrival rate of PUSH message, this Outside, when calculating the arrival rate of message, it is also necessary to disappeared and handled again, to avoid same client from repeatedly receiving PUSH message, And cause result of calculation inaccurate.
In embodiments of the present invention, at least one push server 230 includes:Cache module 232, when being preset suitable for storing Between the PUSH message identification list pushed and the user's identification list pushed in section.Specifically, cache module 232 can be with 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 230 also includes:Configuration module 233, suitable for push is taken The information on services of business 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 230 also includes:Command process module 234, suitable for basis The message processing instruction that message central server is sent, is correspondingly handled PUSH message.
Specifically, message central server 220 can send corresponding Message Processing to push server 230 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 234 receives message central server The cancellation message push instruction of transmission, searches corresponding message, and new information state stops pushing to having cancelled, and updates and has pushed away Send 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 230 includes:Information storage module 235, connect suitable for basis The user login information received, record user's identification list and thread identification.
In embodiments of the present invention, at least one push server 230 is further adapted for:If the visitor that gateway server reports Family end is off-line state, then it is offline to record the presence that user corresponding to the client identifies;Or if detect and net The link closed between the thread of server disconnects, then deletes the thread identification and all user login informations that the thread reports Corresponding user's mark.
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 Family is completed after the two-stage logs in, and gateway server 210 needs user to login successfully information reporting to push server 230, when When long connection between client and gateway server disconnects, gateway server 210 will delete corresponding to user login information, also Off-line state is reported to push server 230.Although push server is distributed, same user's is upper offline Same push server is offered, and to have sequential, that is, needs first to report presence, then report off-line state, it is easy to Understand, if first having reported off-line state, then report presence, that corresponding user just forever can not be from the internal memory of push server In fall clearly.Gateway server ensures sequential when sending, and can realize message coalescing Batch sending, every log messages by Very big expense is had if one transmission, 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 210 is further adapted for:If detecting, thread takes with least one push When link between association's journey of device of being engaged in disconnects, then start retry mechanism and established the link again with push server, for example, can weigh Examination 3 times;If 3 links all fail, the user login information of the threads store is transmitted to other threads.
The message push system based on long connection provided according to the above embodiment of the present invention, the message based on long connection push away Business is taken, can ensure that message is pushed to client in real time, the accurate push for realizing message is also helped, overcomes existing skill For message push service based on short connection in art, it is necessary to which client is actively initiated, frequency is too high, server is caused larger negative Load, frequency is relatively 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, for Some important safe category informations, the time delay of short connection push is also fatal, in addition, the pushing efficiency of message is also improved, Can also accurately statistical message arrival rate.
Embodiment three
Fig. 4 shows a kind of structural representation of according to embodiments of the present invention three long Connection Service system.Such as Fig. 4 institutes Show, the system includes:Configuration server 400, gateway server 410 and at least one service server 420;Wherein, gateway Server 410 and at least one service server 420 complete registration in configuration server 400 in advance.
Configuration server 400, suitable for storing the information on services of at least one service server 420.
Specifically, the information on services of at least one service server 420 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 410, long connection is established between client, suitable for obtaining business service from configuration server 400 The information on services of device, by client using long linkup transmit user's logging request or business processing request be transmitted to it is online extremely A few service server 420.
Wherein, gateway server 410 is the outlet of long Connection Service and client communication, client and gateway server TCP length connections, the bridge to be communicated after gateway server 410 as client with service server, there is provided steady are established between 410 Fixed reliable message transparent transmission service.
Specifically, client sends use using long connection is established between gateway server 410 to gateway server 410 Family logging request or business processing request, gateway server 410 receive user's logging request or business processing request after, from Configuration server 400 obtains the information on services of service server, is found according to the information on services of acquisition online at least one Service server, user's logging request or business processing request are transmitted to online at least one service server 420.
At least one service server 420, 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 410.
Specifically, at least one service server 420 is after user's logging request or business processing request is received, response User's logging request or business processing request, gateway server 410 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 410.
Alternatively, gateway server 410 is further adapted for:Sent out every the 4th preset time at least one service server Business processing is sent to ask, to detect the upstate linked between gateway server and at least one service server, wherein, 4th preset time can be set according to being actually needed, for example, 0.1 second, it is merely illustrative of here, without any limit It is set for using.
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, configuration server Can be specifically Zookeeper servers, it stores the information on services of service server as configuration server, for example, IP Port numbers, service type, and/or presence etc., are merely illustrative of here, without any restriction effect.Each business clothes The service type and port numbers that business device is provided are registered to Zookeeper servers, and gateway server is then from Zookeeper Server obtains the information on services of service server, and particular data packet is gone into corresponding service server, wherein, The service server composition cluster of Zookeeper servers typically configuration three to five, has redundancy ability, ensures service invariant It can use, be described in detail below in conjunction with specific embodiment:
Example IV
Fig. 5 shows a kind of structural representation of according to embodiments of the present invention four long Connection Service system.Such as Fig. 5 institutes Show, the system includes:Zookeeper servers 500, gateway server 510 and at least one login service device 520, at least One key server 530;Wherein, gateway server 510, at least one login service device 520 and at least one cipher key service Device 530 completes registration in Zookeeper servers 500 in advance.
Zookeeper servers 500, suitable for storing the information on services and at least one of at least one login service device 520 The information on services of individual key server 530.
Gateway server 510, long connection is established between client, is logged in suitable for being obtained from Zookeeper servers 500 The information on services of server, client is used using the stage for carrying the user login information after encrypting of long linkup transmit Family logging request is transmitted to online at least one login service device 520.
After long connection is established between client and gateway server 510, client can utilize long connection to gateway service Device 510 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 510 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 is obtained from Zookeeper servers 500, according to the information on services of acquisition Online at least one login service device 520 is found, the phase user logging request is transmitted to online at least one Login service device 520.
At least one login service device 520 is suitable to:In response to a phase user logging request, a Session Key is passed through into net Close server 510 and be forwarded to client.
Specifically, at least one login service device 520 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 520 logs in response to a phase user please Ask, to gateway server 510 send a Session Key with by the gateway server 510 by a stage key forwarding to client End, wherein, what a Session Key was randomly generated, gateway server 510 can also record a Session Key.
Gateway server 510 is further adapted for:The information on services of key server is obtained from Zookeeper servers 500, Two-stage user's logging request after Session Key encryption that client is sent is transmitted to online at least one key Server 530;
Client is calculated after a Session Key of the forwarding of gateway server 510 is received using NaclEC asymmetric encryption Two-stage user's logging request is encrypted method, while using the Session Key that login service device returns to asking after encrypting Data carry out XOR encryption, by by a Session Key encryption after two-stage user's logging request be sent to gateway server 510, online at least one key server 530 is transmitted to by gateway server 510, here primarily to preventing public key from letting out Dew, while improve the complexity of link playback request.
At least one key server 530 is suitable to:In response to two-stage user's logging request, two-stage key is passed through into net Close server 510 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 530 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 510 is given, with can by two-stage key forwarding to client, subsequent client by the gateway server 510 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 510 request time, specifically, gateway server 510 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 510 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 five
Fig. 6 shows a kind of structural representation of according to embodiments of the present invention five long Connection Service system.Such as Fig. 6 institutes Show, the system includes:Zookeeper servers 600, gateway server 610 and at least one cloud killing server 620;Its In, gateway server 610 and at least one cloud killing server 620 complete registration in Zookeeper servers 600 in advance.
Zookeeper servers 600, suitable for storing the information on services of at least one cloud killing server 620.
Gateway server 610, long connection is established between client, looked into suitable for obtaining cloud from Zookeeper servers 600 The information on services of server is killed, client is carried into the business data packet through the encryption of two-stage key using long linkup transmit Business processing request be transmitted to online at least one cloud killing server 620.
Specifically, after long connection is established between client and gateway server 610, client can utilize long connection to net Close server 610 and send business processing request, the request carries the business data packet encrypted through two-stage key, gateway service After device 610 receives business processing request, the information on services of cloud killing server is obtained from Zookeeper servers 600, according to The information on services of acquisition finds online at least one cloud killing server 620, by cloud killing request be transmitted to it is online extremely A few cloud killing server 620, wherein, business processing request can be cloud killing request.
At least one cloud killing server 620 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 610.
Wherein, at least one cloud killing server 620 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 620 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 returns to client.
In order to prevent cloud killing server updating, restart etc. request is failed caused by influence, for gateway server increase The function of retry mechanism, specifically, gateway server is further adapted for:If at least one cloud is not received in the first preset time The service processing result that killing server returns, then start retry mechanism and sent out again to online at least one cloud killing server Business processing is sent to ask, wherein it is possible to the number of retries of gateway server is pre-set, such as 3 times, fail if retrying 3 times, Disconnected it can be assumed that being linked between gateway server and cloud killing server.
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.
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 Block and the mode of worker thread module separation, the operation shape of watcher thread module not processing business, only responsible monitoring thread State, once finding worker thread collapse, worker thread is re-created immediately.In addition, watcher thread module 701 monitors to grow connection When servicing unavailable, 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 702 recorded the error message of inside among daily record, in addition, such as running into fatal error, worker thread module is also Coredump files can be generated, and are saved in assigned catalogue, to facilitate developer to track mistake and debugging;And by pre- If interface checks the running status of gateway server;Client heartbeat is detected, heartbeat timeout disconnects the long company between client Connect;Verify whether user login information is effective.
Embodiment six
Fig. 8 shows a kind of flow signal of according to embodiments of the present invention six information push method based on long connection Figure.As shown in figure 8, this method comprises the following steps:
Step S800, gateway server and at least one push server complete registration in configuration server in advance.
Step S801, long connection is established between gateway server and client, provided getting at least one client User login information after, from configuration server obtain push server information on services, at least one client is provided User login information reports online at least one push server.
Step S802, 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.
The information push method based on long connection provided according to the above embodiment of the present invention, the message based on long connection push away Business is taken, can ensure that message is pushed to client in real time, the accurate push for realizing message is also helped, overcomes existing skill For message push service based on short connection in art, it is necessary to which client is actively initiated, frequency is too high, server is caused larger negative Load, frequency is relatively 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, for Some important safe category informations, the time delay of short connection push is also fatal.
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.Such as Fig. 9 institutes Show, this method comprises the following steps:
Step S900, gateway server and at least one service server complete registration in configuration server in advance.
Step S901, 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 S902, 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 eight
Figure 10 shows the schematic flow sheet of a kind of according to embodiments of the present invention eight 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 S1000, 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 S1001, 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 S1002, 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 S1003, 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 S1004, 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 S1005, 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 S1006, gateway server by the user login information that at least one client provides report it is online extremely A few push server.
Step S1007, at least one push server record user's identity column according to the user login information received Table;And the push task issued according to 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 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) set to realize that the message according to embodiments of the present invention based on long connection pushes The some or all functions of some or all parts in standby.The present invention is also implemented as described here for performing Method some or all equipment or program of device (for example, computer program and computer program product).This The program of the realization present invention of sample can store on a computer-readable medium, or can have one or more signal Form.Such signal can be downloaded from internet website and obtained, and either be provided or with any other on carrier signal Form provides.
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 message push system based on long connection, including:Gateway server, at least one push server, disappear Cease central server and configuration server;The gateway server and at least one push server are matched somebody with somebody described in advance Put and registration is completed in server;
Configuration server, suitable for storing the information on services of at least one push server;
Message central server, suitable for management message push strategy, strategy configuration push task is pushed according to the message;
Long connection is established between gateway server, with client, suitable for getting the use of at least one client offer After the log-on message of family, the information on services of push server is obtained from the configuration server, at least one client is provided User login information reports online at least one push server;
At least one push server, suitable for according to the user login information received, recording user's identification list;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.
A2. the message push system according to A1, wherein, the message central server is further adapted for:From configuration Server obtains the information on services of at least one push server, and the push that broadcast mode is sent to online push server is appointed Business, and set a push server in online push server and perform phase messages push, all online push Server performs the push of two-stage message.
A3. the message push system according to A2, wherein, at least one push server includes:Pushing module, Suitable for PUSH message is sent into gateway server by broadcast mode, so that PUSH message is forwarded to by the gateway server All clients for establishing long connection are pushed with completing a phase messages;And obtain the new user login information that screening obtains Corresponding increment user identification list, the increment user identification list and PUSH message are sent to gateway server, with Client corresponding to for the gateway server according to increment user identification list PUSH message is forwarded to is to complete the two-stage Message pushes.
A4. the message push system according to A1, wherein, the message central server is further adapted for:From configuration Server obtains the information on services of at least one push server, and the push that multicast is sent to online push server is appointed Business, and set each online push server and perform phase messages push and the push of two-stage message.
A5. the message push system according to A4, wherein, at least one push server includes:Pushing module, Suitable for meeting user's identification list of pushing condition according to preparatory condition screening, by the user's identification list for meeting pushing condition with And PUSH message is sent to gateway server, so that the gateway server will according to the user's identification list for meeting pushing condition PUSH message is forwarded to corresponding client to complete phase messages push;And obtain screening obtain meet push bar Increment user's identification list, increment user identification list and PUSH message are sent to corresponding to the new user login information of part Gateway server, so that PUSH message is forwarded to corresponding client by the gateway server according to increment user identification list To complete the push of two-stage message.
A6. the message push system according to A3 or A5, wherein, the system also includes:Status center server, fit In the record PUSH message identification list pushed and the user's identification list pushed, and the use of record successful push Family identification list.
A7. the message push system according to A6, wherein, the system includes:Dispensing device, suitable in inquiry state Central server meets increment user identification list corresponding to the new user login information of pushing condition to filter out, by increment user Identification list is sent to pushing module, and stores inquiry record;
The pushing module is further adapted for: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 message push system according to A6, the message push system also include:Statistic device, suitable for inquiry The status center server succeeded push user's identification list and user's identification list for having pushed;
The user's identification list pushed according to succeeding and the user's identification list pushed calculate the arrival of PUSH message Rate.
A9. the message push system according to any one of A1-A8, wherein, at least one push server includes: Cache module, suitable for the PUSH message identification list pushed and the user's identity column pushed in storage preset time period Table.
A10. the message push system according to any one of A1-A9, wherein, at least one push server is also wrapped Include:Configuration module, suitable for the information on services of push server is registered into configuration server.
A11. the message push system according to any one of A1-A10, wherein, at least one push server is also Including:Command process module, suitable for the message processing instruction sent according to message central server, PUSH message is carried out corresponding Ground processing.
A12. the message push system according to any one of A1-A10, wherein, the gateway server includes multiple lines Journey, each push server includes connection association journey, between a thread of gateway server and the connection association journey of push server Establish the link;
The user login information that the gateway server provides at least one client balancedly distributes to each thread, The link that each thread is established between the connection association journey based at least one push server reports user login information Online at least one push server, wherein, the user login information that each thread reports is mutual exclusion.
A13. the message push system according to A12, wherein, at least one push server includes:Information is deposited Module is stored up, suitable for according to the user login information received, recording user's identification list and thread identification.
A14. the message push system according to A13, wherein, at least one push server is further adapted for: If the client that the gateway server reports is off-line state, the presence that user corresponding to the client identifies is recorded To be offline;Or
If detecting and linking disconnection between the thread of gateway server, delete on the thread identification and the thread User's mark corresponding to all user login informations of report.
A15. the message push system according to A13 or A14, wherein, the gateway server is further adapted for:If inspection Measure between thread and association's journey of at least one push server linking disconnection when, then start retry mechanism again with push take Business device establishes the link;
If link failure, other threads are transmitted to by the user login information of the threads store.
B16. a kind of information push method based on long connection, including:
Gateway server and at least one push server complete registration in configuration server in advance;
Long connection is established between gateway server and client, is logged in the user for getting at least one client offer After information, the information on services of push server is obtained from the configuration server, the user that at least one client provides is stepped on Information reporting is recorded to online at least one push server;
At least one push server records user's identification list according to the user login information received;And according to The push task that the message central server issues, PUSH message is sent to gateway server according to user's identification list, So that PUSH message is forwarded to client by the gateway server.
B17. the information push method according to B16, wherein, methods described also includes:Message central server from 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.
B18. the information push method according to B17, wherein, at least one push server is according to the message The push task that central server issues, PUSH message is sent to gateway server according to user's identification list, for described PUSH message is forwarded to client and further comprised by gateway server:
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 obtain Increment user's identification list corresponding to taking the new user login information that screening obtains, by the increment user identification list and is pushed away Message is sent to be sent to gateway server, so that PUSH message is forwarded to by the gateway server according to increment user's identification list Corresponding client is pushed with completing two-stage message.
B19. the information push method according to B16, wherein, methods described also includes:Message central server from 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.
B20. the information push method according to B19, wherein, at least one push server is according to the message The push task that central server issues, PUSH message is sent to gateway server according to user's identification list, for described PUSH message is forwarded to client and further comprised by gateway server:
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;With And obtain screening obtain meet increment user identification list corresponding to the new user login information of pushing condition, increment is used Family identification list and PUSH message are sent to gateway server, so that the 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.
B21. the information push method according to B18 or B20, wherein, methods described also includes:The push that will have been pushed Message identifier list and the user's identification list pushed, and the user's identification list pushed that succeeds recorded in state Central server.
B22. the information push method according to B21, wherein, methods described includes:Dispensing device inquires about status center Server meets increment user identification list corresponding to the new user login information of pushing condition to filter out, and increment user is marked Know list and be sent at least one push server, and store inquiry record;
Increment user identification list and PUSH message are sent to gateway server by least one push server, For the gateway server according to increment user identification list PUSH message is forwarded to corresponding to client to complete second order Section message push.
B23. the information push method according to B21, methods described also include:Statistic device inquires about the status center Server succeeded push user's identification list and user's identification list for having pushed;
The user's identification list pushed according to succeeding and the user's identification list pushed calculate the arrival of PUSH message Rate.
B24. the information push method according to any one of B16-B23, wherein, methods described also includes:It is described at least The PUSH message identification list pushed and the user's identity column pushed in one push server storage preset time period Table.
B25. the information push method according to any one of B16-B24, wherein, methods described also includes:It is described at least Information on services is registered to configuration server by one push server.
B26. the information push method according to any one of B16-B25, wherein, methods described also includes:It is described at least The message processing instruction that one push server is sent according to message central server, PUSH message is correspondingly handled.
B27. the information push method according to any one of B16-B26, wherein, the gateway server includes multiple lines Journey, each push server includes connection association journey, between a thread of gateway server and the connection association journey of push server Establish the link;
Methods described also includes:The user login information that the gateway server provides at least one client is balancedly Distribute to each thread, the link that each thread is established between the connection association journey based at least one push server is by user Log-on message reports online at least one push server, wherein, the user login information that each thread reports is mutual exclusion 's.
B28. the information push method according to B27, wherein, methods described also includes:At least one push clothes Device be engaged according to the user login information received, records user's identification list and thread identification.
B29. the information push method according to B28, wherein, methods described also includes:If on the gateway server The client of report is off-line state, at least one push server record that user corresponding to the client identifies in wire State is offline;Or
If detecting the disconnection that links between the thread of gateway server, at least one push server is deleted should User corresponding to all user login informations that thread identification and the thread report identifies.
B30. the information push method according to B28 or B29, wherein, methods described also includes:If detect thread with When link between association's journey of at least one push server disconnects, the gateway server start retry mechanism again with push Server establishes the link;If link failure, other threads are transmitted to by the user login information of the threads store.

Claims (10)

1. a kind of message push system based on long connection, including:In gateway server, at least one push server, message Central server and configuration server;The gateway server and at least one push server are in advance in the configuration clothes It is engaged in completing registration in device;
Configuration server, suitable for storing the information on services of at least one push server;
Message central server, suitable for management message push strategy, strategy configuration push task is pushed according to the message;
Long connection is established between gateway server, with client, suitable for being stepped in the user for getting at least one client offer After recording information, the information on services of push server, the user that at least one client is provided are obtained from the configuration server Log-on message reports online at least one push server;
At least one push server, suitable for according to the user login information received, recording user's identification list;And root 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.
2. message push system according to claim 1, 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.
3. message push system according to claim 2, 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.
4. message push system according to claim 1, 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.
5. message push system according to claim 4, 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.
6. the message push system according to claim 3 or 5, wherein, the system also includes:Status center server, Succeed what is pushed suitable for the record PUSH message identification list pushed and the user's identification list pushed, and record User's identification list.
7. message push system according to claim 6, wherein, the system includes:Dispensing device, suitable for inquiring about state Central server meets increment user identification list corresponding to the new user login information of pushing condition to filter out, and increment is used Family identification list is sent to pushing module, and stores inquiry record;
The pushing module is further adapted for:Increment user identification list and PUSH message are sent to gateway server, with Client corresponding to for the gateway server according to increment user identification list PUSH message is forwarded to is to complete the two-stage Message pushes.
8. message push system according to claim 6, the message push system also includes:Statistic device, suitable for looking into Ask the status center server succeeded push user's identification list and user's identification list for having pushed;
The user's identification list pushed according to succeeding and the user's identification list pushed calculate the arrival rate of PUSH message.
9. according to the message push system described in claim any one of 1-8, wherein, at least one push server bag Include:Cache module, suitable for the PUSH message identification list pushed in storage preset time period and the user's mark pushed List.
10. a kind of information push method based on long connection, including:
Gateway server and at least one push server complete registration in configuration server in advance;
Long connection is established between gateway server and client, the user login information of at least one client offer is being provided Afterwards, the information on services of push server is obtained from the configuration server, the user that at least one client is provided logs in letter Breath reports online at least one push server;
At least one push server records user's identification list according to the user login information received;And according to described The push task that message central server issues, PUSH message is sent to gateway server according to user's identification list, for PUSH message is forwarded to client by the gateway server.
CN201710774218.6A 2017-08-31 2017-08-31 Message pushing system and method based on long connection Active CN107395767B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710774218.6A CN107395767B (en) 2017-08-31 2017-08-31 Message pushing system and method based on long connection

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710774218.6A CN107395767B (en) 2017-08-31 2017-08-31 Message pushing system and method based on long connection

Publications (2)

Publication Number Publication Date
CN107395767A true CN107395767A (en) 2017-11-24
CN107395767B CN107395767B (en) 2021-02-05

Family

ID=60347472

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710774218.6A Active CN107395767B (en) 2017-08-31 2017-08-31 Message pushing system and method based on long connection

Country Status (1)

Country Link
CN (1) CN107395767B (en)

Cited By (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108093076A (en) * 2017-12-29 2018-05-29 北京奇虎科技有限公司 Information push method and device
CN108093060A (en) * 2017-12-26 2018-05-29 陈占辉 A kind of method for pushing of Intelligent housing background system message
CN108234631A (en) * 2017-12-29 2018-06-29 北京奇虎科技有限公司 Message pushes platform and information push method
CN108243112A (en) * 2018-01-11 2018-07-03 杭州朗和科技有限公司 Chat group method for controlling network flow and device, storage medium and computing device
CN108322521A (en) * 2018-01-17 2018-07-24 腾讯科技(深圳)有限公司 Message content method for pushing, device, system, computer equipment and storage medium
CN108390950A (en) * 2018-05-28 2018-08-10 中国建设银行股份有限公司 A kind of information push method, device and equipment
CN109922101A (en) * 2017-12-12 2019-06-21 北京奇虎科技有限公司 A kind of method, apparatus and server for realizing specific transactions in the terminal
CN110166576A (en) * 2019-06-28 2019-08-23 飞天诚信科技股份有限公司 It is a kind of to realize that cloud speaker message mends the method and system pushed away
WO2019200714A1 (en) * 2018-04-17 2019-10-24 平安科技(深圳)有限公司 Server connection method, computer readable storage medium, terminal device, and apparatus
CN110545327A (en) * 2019-09-20 2019-12-06 北京达佳互联信息技术有限公司 information pushing method and system
CN110753070A (en) * 2018-07-23 2020-02-04 北京国双科技有限公司 Data communication method, client, server and data communication system
CN111131443A (en) * 2019-12-23 2020-05-08 中国平安财产保险股份有限公司 Task pushing method and system
CN111866095A (en) * 2020-07-01 2020-10-30 合肥森亿智能科技有限公司 Unified pushing platform, method and terminal based on private cloud
CN112134783A (en) * 2020-08-11 2020-12-25 广州市贺氏办公设备有限公司 Instant messaging system, method, device and medium based on user intimacy
CN112883261A (en) * 2021-01-28 2021-06-01 北京百度网讯科技有限公司 Configuration data pushing method and device, electronic equipment and medium
CN113127236A (en) * 2021-05-10 2021-07-16 广州欢网科技有限责任公司 Message pushing method and device and server
CN113238808A (en) * 2020-01-22 2021-08-10 北京沃东天骏信息技术有限公司 Message pushing method and device
CN114051037A (en) * 2021-11-02 2022-02-15 珠海读书郎软件科技有限公司 Method for managing and distributing push message
CN114095465A (en) * 2021-11-17 2022-02-25 北京同城必应科技有限公司 Method for realizing efficient IM message time sequence guarantee mechanism under distributed environment
CN115134404A (en) * 2021-03-22 2022-09-30 花瓣云科技有限公司 Method for managing push connection and electronic equipment
CN115296822A (en) * 2022-09-28 2022-11-04 飞天诚信科技股份有限公司 Method and system for realizing service processing

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20070014350A (en) * 2005-07-28 2007-02-01 에스케이 텔레콤주식회사 Authentification method in the push proxy gateway and the contents provider server
CN102209302A (en) * 2011-07-07 2011-10-05 深圳市金立通信设备有限公司 System and method for realizing information push of mobile terminal
CN103051715A (en) * 2012-12-24 2013-04-17 东软熙康健康科技有限公司 Method for releasing notice to terminal, relevant device and system
CN105099882A (en) * 2015-07-09 2015-11-25 杭州电子科技大学 MQTT-based cloud pushing method and system
CN105141452A (en) * 2015-08-07 2015-12-09 北京思特奇信息技术股份有限公司 High-performance service system and method based on CXF
CN105407180A (en) * 2015-12-29 2016-03-16 曙光信息产业(北京)有限公司 Server message pushing method and device
CN106385435A (en) * 2016-08-30 2017-02-08 乐视控股(北京)有限公司 Service treatment method and system of service system
CN107086954A (en) * 2017-05-23 2017-08-22 北京奇虎科技有限公司 Information push method and device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20070014350A (en) * 2005-07-28 2007-02-01 에스케이 텔레콤주식회사 Authentification method in the push proxy gateway and the contents provider server
CN102209302A (en) * 2011-07-07 2011-10-05 深圳市金立通信设备有限公司 System and method for realizing information push of mobile terminal
CN103051715A (en) * 2012-12-24 2013-04-17 东软熙康健康科技有限公司 Method for releasing notice to terminal, relevant device and system
CN105099882A (en) * 2015-07-09 2015-11-25 杭州电子科技大学 MQTT-based cloud pushing method and system
CN105141452A (en) * 2015-08-07 2015-12-09 北京思特奇信息技术股份有限公司 High-performance service system and method based on CXF
CN105407180A (en) * 2015-12-29 2016-03-16 曙光信息产业(北京)有限公司 Server message pushing method and device
CN106385435A (en) * 2016-08-30 2017-02-08 乐视控股(北京)有限公司 Service treatment method and system of service system
CN107086954A (en) * 2017-05-23 2017-08-22 北京奇虎科技有限公司 Information push method and device

Cited By (29)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109922101B (en) * 2017-12-12 2023-08-15 三六零科技集团有限公司 Method, device and server for realizing specific service in mobile terminal
CN109922101A (en) * 2017-12-12 2019-06-21 北京奇虎科技有限公司 A kind of method, apparatus and server for realizing specific transactions in the terminal
CN108093060A (en) * 2017-12-26 2018-05-29 陈占辉 A kind of method for pushing of Intelligent housing background system message
CN108234631A (en) * 2017-12-29 2018-06-29 北京奇虎科技有限公司 Message pushes platform and information push method
CN108093076A (en) * 2017-12-29 2018-05-29 北京奇虎科技有限公司 Information push method and device
CN108234631B (en) * 2017-12-29 2021-06-15 北京奇虎科技有限公司 Message pushing platform and message pushing method
CN108243112A (en) * 2018-01-11 2018-07-03 杭州朗和科技有限公司 Chat group method for controlling network flow and device, storage medium and computing device
CN108322521A (en) * 2018-01-17 2018-07-24 腾讯科技(深圳)有限公司 Message content method for pushing, device, system, computer equipment and storage medium
CN108322521B (en) * 2018-01-17 2020-10-16 腾讯科技(深圳)有限公司 Message content pushing method, device, system, computer equipment and storage medium
WO2019200714A1 (en) * 2018-04-17 2019-10-24 平安科技(深圳)有限公司 Server connection method, computer readable storage medium, terminal device, and apparatus
CN108390950A (en) * 2018-05-28 2018-08-10 中国建设银行股份有限公司 A kind of information push method, device and equipment
CN110753070A (en) * 2018-07-23 2020-02-04 北京国双科技有限公司 Data communication method, client, server and data communication system
CN110166576B (en) * 2019-06-28 2022-07-01 飞天诚信科技股份有限公司 Method and system for realizing message complementary pushing of cloud sound box
CN110166576A (en) * 2019-06-28 2019-08-23 飞天诚信科技股份有限公司 It is a kind of to realize that cloud speaker message mends the method and system pushed away
CN110545327B (en) * 2019-09-20 2022-04-29 北京达佳互联信息技术有限公司 Information pushing method and system
CN110545327A (en) * 2019-09-20 2019-12-06 北京达佳互联信息技术有限公司 information pushing method and system
CN111131443A (en) * 2019-12-23 2020-05-08 中国平安财产保险股份有限公司 Task pushing method and system
CN111131443B (en) * 2019-12-23 2023-06-30 中国平安财产保险股份有限公司 Task pushing method and system
CN113238808A (en) * 2020-01-22 2021-08-10 北京沃东天骏信息技术有限公司 Message pushing method and device
CN111866095A (en) * 2020-07-01 2020-10-30 合肥森亿智能科技有限公司 Unified pushing platform, method and terminal based on private cloud
CN112134783A (en) * 2020-08-11 2020-12-25 广州市贺氏办公设备有限公司 Instant messaging system, method, device and medium based on user intimacy
CN112883261A (en) * 2021-01-28 2021-06-01 北京百度网讯科技有限公司 Configuration data pushing method and device, electronic equipment and medium
CN115134404A (en) * 2021-03-22 2022-09-30 花瓣云科技有限公司 Method for managing push connection and electronic equipment
CN115134404B (en) * 2021-03-22 2024-01-30 花瓣云科技有限公司 Method for managing push connection and electronic equipment
CN113127236A (en) * 2021-05-10 2021-07-16 广州欢网科技有限责任公司 Message pushing method and device and server
CN114051037A (en) * 2021-11-02 2022-02-15 珠海读书郎软件科技有限公司 Method for managing and distributing push message
CN114095465A (en) * 2021-11-17 2022-02-25 北京同城必应科技有限公司 Method for realizing efficient IM message time sequence guarantee mechanism under distributed environment
CN115296822A (en) * 2022-09-28 2022-11-04 飞天诚信科技股份有限公司 Method and system for realizing service processing
CN115296822B (en) * 2022-09-28 2022-12-20 飞天诚信科技股份有限公司 Method and system for realizing service processing

Also Published As

Publication number Publication date
CN107395767B (en) 2021-02-05

Similar Documents

Publication Publication Date Title
CN107395767A (en) Message push system and method based on long connection
CN107580046A (en) Long connection service system and method
US11902311B2 (en) Communications methods and apparatus for dynamic detection and/or mitigation of threats and/or anomalies
US11924251B2 (en) System and method for cybersecurity reconnaissance, analysis, and score generation using distributed systems
CA3007844C (en) Computer network threat assessment
US10142364B2 (en) Network isolation by policy compliance evaluation
US10728216B2 (en) Web application security architecture
AU2015320692B2 (en) Distributed traffic management system and techniques
KR20160110913A (en) Cloud service security broker and proxy
US20180329771A1 (en) Identifying failed customer experience in distributed computer systems
US10812511B2 (en) Method for processing a network service
CN104539604B (en) Website protection method and device
CN107070931A (en) Cloud application data upload/access method, system and cloud proxy server
CN110113394A (en) API Calls method and apparatus
US20140189868A1 (en) Method for detecting intrusions on a set of virtual resources
CN110266650A (en) The recognition methods of Conpot industry control honey jar
CN106453355A (en) Data analysis method and apparatus thereof
CN109600395A (en) A kind of device and implementation method of terminal network access control system
KR101522139B1 (en) Method for blocking selectively in dns server and change the dns address using proxy
CN109587134A (en) Method, apparatus, equipment and the medium of the safety certification of interface bus
WO2021254622A1 (en) Methods, system and communication devices related to lawful interception
CN112882885A (en) Method, device and system for monitoring business service survival
US11968235B2 (en) System and method for cybersecurity analysis and protection using distributed systems
US11546475B2 (en) System and method for dynamic driven context management
US20220232042A1 (en) System and method for cybersecurity analysis and protection using distributed systems

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
TA01 Transfer of patent application right

Effective date of registration: 20201210

Address after: 1762, floor 17, 15 / F, building 3, 10 Jiuxianqiao Road, Chaoyang District, Beijing 100020

Applicant after: BEIJING QIYUAN TECHNOLOGY Co.,Ltd.

Address before: 100088 room 112, block D, 28 new street, new street, Xicheng District, Beijing (Desheng Park)

Applicant before: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant