CN102523177A - Method and system for realization of message push service - Google Patents

Method and system for realization of message push service Download PDF

Info

Publication number
CN102523177A
CN102523177A CN2011104278690A CN201110427869A CN102523177A CN 102523177 A CN102523177 A CN 102523177A CN 2011104278690 A CN2011104278690 A CN 2011104278690A CN 201110427869 A CN201110427869 A CN 201110427869A CN 102523177 A CN102523177 A CN 102523177A
Authority
CN
China
Prior art keywords
message
push
client
module
state
Prior art date
Application number
CN2011104278690A
Other languages
Chinese (zh)
Inventor
康光磊
Original Assignee
北京新媒传信科技有限公司
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 北京新媒传信科技有限公司 filed Critical 北京新媒传信科技有限公司
Priority to CN2011104278690A priority Critical patent/CN102523177A/en
Publication of CN102523177A publication Critical patent/CN102523177A/en

Links

Abstract

The invention discloses a method and a system for realization of a message push service. The method comprises the following steps that: step1, a push message queue reception module stores a message that needs to be pushed into the queue; step two, a push logic processing module carries out polling on the queue and stores the message into a Key-Value key value corresponding to a user in a state storage module; step three, after the user logs in, a client initiates a push service request to a long connection communication module; step four, the long connection communication module establishes and maintains long connection with the client as well as writes a user state in the state storage module; and step 5, the long connection communication module inquires the state storage module whether there is any message that needs to be pushed to the user; if so, the message is taken out from the state storage module and is sent to the client as well as a state of connection with the client and the state storage module is maintained; if not, long connection with the client is maintained. According to the invention, a polling request of a client is converted into long connection for network communication between the client and a server, so that availability of the system can be improved.

Description

A kind of implementation method of message Push Service and system
Technical field
The present invention relates to internet arena, particularly a kind of implementation method of message Push Service and system.
Background technology
Continuous development along with the Internet; Client and service end transmission of messages are more and more general, in order better to improve user experience, improve the real-time of message; Usually can be when client represents; Information and data to changing are carried out the partial update conversion, avoid refreshing or the request again of total data of overall page, and the design of message Push Service system and realization just become more and more important.
The messenger service pattern of internet arena main flow is that client is according to certain time interval at present; Service end is carried out polling request, data pull is represented to the client line asynchronous of going forward side by side, this kind mode realizes simply; But also have the following shortcoming and defect: 1) poll services of client can cause the lasting pressure to service end; Be that the service end service ability is limited, responding ability descends, to the peak value difficulty of request; 2) polling request of client can cause the decline of client performance, like the continuous poll services end of cell-phone customer terminal, can cause the increase of power consumption and network traffics, also can cause the influence of overall performance simultaneously to the more weak terminal of performance; 3) real-time of message has certain influence, because of poll needs month blanking time of agreement poll, blanking time therebetween, any message that newly arrives can not received and handle to client, can impact user experience; 4) non real-time polled async request also can cause the puzzlement of Network Transmission, may have no message therebetween twice polling interval, causes the waste of request; Simultaneously, the message of a large amount of accumulations possibly arranged also in phase blanking time, in next client-requested, once obtain, give the Network Transmission build-up of pressure.
Summary of the invention
Provided by the invention, at a certain time interval service end is carried out the problem that polling request causes to solve.
The invention provides a kind of implementation method of message Push Service, comprising:
Step 1, the message stores that PUSH message formation receiver module will push is in message queue;
Step 2, push the said formation of logic processing module poll and with message stores in the state-storage module in the pairing Key-Value key-value pair of user;
Step 3, behind user's logging on client, client is initiated the Push Service request to the long communication module that connects;
Step 4, long connection communication module are set up and are kept with the long of client and be connected, and write state of user to state-storage module;
Step 5; Whether the long communication module inquiry state-storage module that connects has message to be pushed to the user; If the long communication module message that then taking-ups needs to push from state-storage module that connects is sent to client, and keep the connection status with client and state-storage module; Otherwise long connection communication module is kept with the long of client and is connected.
In one example, in the step 1, the message that PUSH message formation receiver module will push stores in the message queue at random.
In one example, in the step 2, push logic processing module and cease to the sequential read cancellation in the message queue according to message stores; Push the state adjustment thread resources of logic processing module according to message queue.
In one example, in the step 2, state-storage module is a key assignments with user's identifier, and key assignments is write by the long communication module that connects; The message of the value that key-value pair is answered for needing to push, this message writes by pushing logic processing module.
In one example, in the step 3, the long communication module that connects adopts based on http protocol.
The invention provides a kind of realization system of message Push Service, comprising:
PUSH message formation receiver module, the message stores that is used for needs are pushed is to message queue;
Push logic processing module, be used for the said message queue of poll and with message stores in the pairing Key-Value key-value pair of state-storage module user;
The long communication module that connects is used for behind user's logging on client, receives client and initiates the Push Service request to the long communication module that connects; Set up and keep with the long of client and be connected, and write state of user to state-storage module; Whether the inquiry state-storage module has message to be pushed to the user; When having message to be pushed to the user, the message that taking-up need to push from state-storage module is sent to client, and keeps the connection status with client and state-storage module; When not having message to be pushed to the user, keep with the long of client and be connected.
In one example, PUSH message formation receiver module is used for storing the data that needs push into message queue at random.
In one example, push logic processing module, be used for according to the sequential read cancellation breath of message stores to message queue; Push logic processing module, be used for state adjustment thread resources according to message queue.
In one example, state-storage module comprises key-value pair, and key-value pair is a key assignments with user's identifier, and key assignments is write by the long communication module that connects; The message of the value that key-value pair is answered for needing to push, this message writes by pushing logic processing module.
In one example, the long communication module that connects adopts based on http protocol.
The beneficial effect of the embodiment of the invention is: change the clients poll request into client and be connected with the length that service end is carried out network communication, can carry out the deployment of a plurality of instances, each instance can be shared client-requested visit pressure, has improved the availability of system.
Description of drawings
Fig. 1 is a message Push Service system schematic of the present invention;
Fig. 2 is a message Push Service method flow diagram of the present invention.
Embodiment
For making the object of the invention, technical scheme and advantage clearer, embodiment of the present invention is done to describe in detail further below in conjunction with accompanying drawing.
Referring to Fig. 1, be the message Push Service system schematic that the embodiment of the invention provides, this system is divided into following several module:
PUSH message formation receiver module: this module mainly is made up of message queue, is used for receiving the message that need push from each external system.Utilize message queue to write the buffering of pressure peak, and can carry out asynchronous read and write operation, the flexibility that improves system.Aspect availability, this module adopts random write to a plurality of formation instances, and the mode of sequential read had both guaranteed the high availability of this module, had also avoided the maintenance cost of complicated architectures.
Push logic processing module: this module mainly adopts the thread pool technology; Be used for reading the PUSH message information in the message queue; With the key assignments form of this information, according to self-defining extendible structural data storage organization, the asynchronous state-storage module that stores into ID.This module can be carried out the increase and decrease of thread resources automatically according to the state of message queue, and it is busy both can to have avoided the concurrent peak value of message to handle, can reduce again size of message when very little to the waste of main frame thread resources etc.This module existence not can carry out the distributed deployment of many instances simultaneously, carries out load balancing etc. and improves system availability.
State-storage module: this module is the high speed key-value pair buffer memory engine of realizing voluntarily; Function is for being key assignments with the ID; Storage is in requisition for the structural data of the message that pushes; The key assignments ID of this module is written as the long communication module that connects and safeguards, the propelling movement logic processing module that is written as of the pairing value of key assignments writes maintenance.The user profile that storage engines is safeguarded also is the online user, and it is nonsensical carrying out the message propelling movement for non-online user on the business.The persistence information of deferred information can be safeguarded in other memory module.This module can be carried out strategies such as consistency Hash according to the characteristics of key assignments storage engines, carries out the deployment of many instances, both can reduce single instance system bottleneck, can improve the availability of system again.
The long communication module that connects: this module is based on http protocol; The inner long Connection Service of HTTP based on formation and the realization of message trigger mechanism; When the user reached the standard grade, when receiving user's Push Service interface requests of client transmission, this module was kept with the HTTP of client is long and is connected; User's ID and other information write state memory modules will be asked simultaneously, quasi real time communication will be kept subsequently always with state-storage module.When finding to have new information to push, then from state-storage module, take out the message that desire pushes, be pushed to client simultaneously, if the information that need not push, then keep long the connection always and do not carry out data communication.This module adopts http protocol simultaneously, be convenient to client realize with front end based on the strategies such as agreement distribution of HTTP Proxy, can carry out the deployment of a plurality of instances, each instance can be shared client-requested visit pressure, can high the availability of system.
The workflow of concrete request response is as shown in Figure 2:
Step 10, PUSH message formation receiver module receive the data that need propelling movement in real time and mix and deposit in the formation.
Step 11 pushes the logic processing module snoop queue, and data set is dressed up the structural data of propelling movement, asynchronous storing in the state-storage module in the pairing key-value pair of this ID.
Step 12, the client login is reached the standard grade, and initiates interface requests to Push Service;
Step 13, the long communication module that connects is received client-requested, sets up and keep with the long of client to be connected, and writes information such as state of user simultaneously to state-storage module.
Step 14, long connection communication module is kept always and is inquired whether state-storage module has latest news to be pushed to this user, if there is not latest news, execution in step 15 is if having new information, execution in step 16.
Step 15, long connection communication module then can be kept with the long of client and be connected, and do not carry out data interaction, also can keep the inquiry state with state-storage module simultaneously.
Step 16, the structured message data that taking-up need to push from state-storage module return to client, continue to keep the linking status with client and state-storage module then.
The above is merely preferred embodiment of the present invention, is not to be used to limit protection scope of the present invention.All any modifications of within spirit of the present invention and principle, being done, be equal to replacement, improvement etc., the for example change of module title or replacement all is included in protection scope of the present invention.

Claims (10)

1. the implementation method of a message Push Service is characterized in that, comprising:
Step 1, the message stores that PUSH message formation receiver module will push is in message queue;
Step 2, push the said message queue of logic processing module poll and with message stores in the state-storage module in the pairing Key-Value key-value pair of user;
Step 3, behind user's logging on client, client is initiated the Push Service request to the long communication module that connects;
Step 4, long connection communication module are set up and are kept with the long of client and be connected, and write state of user to state-storage module;
Step 5; Whether the long communication module inquiry state-storage module that connects has message to be pushed to the user; If the long communication module message that then taking-ups needs to push from state-storage module that connects is sent to client, and keep the connection status with client and state-storage module; Otherwise long connection communication module is kept with the long of client and is connected.
2. the implementation method of message Push Service as claimed in claim 1 is characterized in that, in the step 1, the message that PUSH message formation receiver module will push stores in the message queue at random.
3. the implementation method of message Push Service as claimed in claim 1 is characterized in that, in the step 2, pushes logic processing module and ceases to the sequential read cancellation in the message queue according to message stores; Push the state adjustment thread resources of logic processing module according to message queue.
4. the implementation method of message Push Service as claimed in claim 1 is characterized in that, in the step 2, state-storage module is a key assignments with user's identifier, and key assignments is write by the long communication module that connects; The message of the value that key-value pair is answered for needing to push, this message writes by pushing logic processing module.
5. the implementation method of message Push Service as claimed in claim 1 is characterized in that, in the step 3, the long communication module that connects adopts http protocol.
6. the realization system of a message Push Service is characterized in that, comprising:
PUSH message formation receiver module, the message stores that is used for needs are pushed is to message queue;
Push logic processing module, be used for the said formation of poll and with message stores in the pairing Key-Value key-value pair of state-storage module user;
The long communication module that connects is used for behind user's logging on client, receives client and initiates the Push Service request to the long communication module that connects; Set up and keep with the long of client and be connected, and write state of user to state-storage module; Whether the inquiry state-storage module has message to be pushed to the user; When having message to be pushed to the user, the message that taking-up need to push from state-storage module is sent to client, and keeps the connection status with client and state-storage module; When not having message to be pushed to the user, keep with the long of client and be connected.
7. the realization system of message Push Service as claimed in claim 6 is characterized in that, PUSH message formation receiver module is used for storing the data that needs push into message queue at random.
8. the realization system of message Push Service as claimed in claim 6 is characterized in that, pushes logic processing module, is used for according to the sequential read cancellation breath of message stores to message queue; Push logic processing module, be used for state adjustment thread resources according to message queue.
9. the realization system of message Push Service as claimed in claim 6 is characterized in that state-storage module comprises key-value pair, and key-value pair is a key assignments with user's identifier, and key assignments is write by the long communication module that connects; The message of the value that key-value pair is answered for needing to push, this message writes by pushing logic processing module.
10. the realization system of message Push Service as claimed in claim 6 is characterized in that, the long communication module that connects adopts http protocol.
CN2011104278690A 2011-12-19 2011-12-19 Method and system for realization of message push service CN102523177A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2011104278690A CN102523177A (en) 2011-12-19 2011-12-19 Method and system for realization of message push service

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2011104278690A CN102523177A (en) 2011-12-19 2011-12-19 Method and system for realization of message push service

Publications (1)

Publication Number Publication Date
CN102523177A true CN102523177A (en) 2012-06-27

Family

ID=46293976

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2011104278690A CN102523177A (en) 2011-12-19 2011-12-19 Method and system for realization of message push service

Country Status (1)

Country Link
CN (1) CN102523177A (en)

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103546543A (en) * 2013-09-29 2014-01-29 北京京东尚科信息技术有限公司 Client device for electronic commerce and method and system for supplying information
CN103944979A (en) * 2014-04-09 2014-07-23 Tcl集团股份有限公司 Method, device and system for message pushing
CN104144098A (en) * 2013-05-07 2014-11-12 腾讯科技(深圳)有限公司 Information pushing method and system and pushing server equipment
CN104333573A (en) * 2012-06-29 2015-02-04 北京奇虎科技有限公司 Processing method and processing system for highly-concurrent requests
CN104378419A (en) * 2014-11-10 2015-02-25 四川长虹电器股份有限公司 High-speed data push method and system
CN104717133A (en) * 2015-03-16 2015-06-17 墨仕(厦门)电子商务有限公司 Distributed message push system and method
CN105553871A (en) * 2015-12-15 2016-05-04 厦门贝启科技有限公司 Method and system for remotely managing equipment parameters
CN105607927A (en) * 2015-12-18 2016-05-25 小米科技有限责任公司 Page display method and apparatus
CN105740418A (en) * 2016-01-29 2016-07-06 杭州亿方云网络科技有限公司 File monitoring and message pushing based real-time synchronization system
CN106161586A (en) * 2016-06-07 2016-11-23 四川长虹电器股份有限公司 Realize the intelligent terminal's long polling system system and method to car machine
CN103677844B (en) * 2013-12-20 2017-02-01 国云科技股份有限公司 Lightweight class data processing method based on message chain
CN106534241A (en) * 2015-09-11 2017-03-22 北京奇虎科技有限公司 Real-time data updating method, device and system
CN106656658A (en) * 2016-11-17 2017-05-10 许继集团有限公司 Substation information pushing system
CN107168808A (en) * 2017-03-30 2017-09-15 太仓鸿策腾达网络科技有限公司 A kind of interprocess communication intelligently pushing system
CN107181821A (en) * 2017-07-05 2017-09-19 广州华多网络科技有限公司 A kind of information push method and device based on SSE specifications
CN109547511A (en) * 2017-09-22 2019-03-29 中国移动通信集团浙江有限公司 A kind of real-time method for pushing of WEB message, server, client and system
CN109684111A (en) * 2018-12-28 2019-04-26 安徽同徽网络技术有限公司 Information push method, message push system and computer readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101431734A (en) * 2008-11-07 2009-05-13 中兴通讯股份有限公司 Method and system for group sending short messages
CN101917490A (en) * 2010-09-16 2010-12-15 北京开心人信息技术有限公司 Method and system for reading cache data
CN102035880A (en) * 2010-11-02 2011-04-27 中兴通讯股份有限公司 Method and device for maintaining connection
CN102045171A (en) * 2010-12-30 2011-05-04 北京世纪互联工程技术服务有限公司 Unified authentication system and login method based on same

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101431734A (en) * 2008-11-07 2009-05-13 中兴通讯股份有限公司 Method and system for group sending short messages
CN101917490A (en) * 2010-09-16 2010-12-15 北京开心人信息技术有限公司 Method and system for reading cache data
CN102035880A (en) * 2010-11-02 2011-04-27 中兴通讯股份有限公司 Method and device for maintaining connection
CN102045171A (en) * 2010-12-30 2011-05-04 北京世纪互联工程技术服务有限公司 Unified authentication system and login method based on same

Cited By (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104333573B (en) * 2012-06-29 2018-04-17 北京奇虎科技有限公司 A kind of processing method and processing system of large concurrent request
CN104333573A (en) * 2012-06-29 2015-02-04 北京奇虎科技有限公司 Processing method and processing system for highly-concurrent requests
CN104144098A (en) * 2013-05-07 2014-11-12 腾讯科技(深圳)有限公司 Information pushing method and system and pushing server equipment
CN104144098B (en) * 2013-05-07 2018-04-03 腾讯科技(深圳)有限公司 Information push method, system and push server equipment
CN103546543A (en) * 2013-09-29 2014-01-29 北京京东尚科信息技术有限公司 Client device for electronic commerce and method and system for supplying information
CN103677844B (en) * 2013-12-20 2017-02-01 国云科技股份有限公司 Lightweight class data processing method based on message chain
CN103944979A (en) * 2014-04-09 2014-07-23 Tcl集团股份有限公司 Method, device and system for message pushing
CN104378419A (en) * 2014-11-10 2015-02-25 四川长虹电器股份有限公司 High-speed data push method and system
CN104717133A (en) * 2015-03-16 2015-06-17 墨仕(厦门)电子商务有限公司 Distributed message push system and method
CN106534241A (en) * 2015-09-11 2017-03-22 北京奇虎科技有限公司 Real-time data updating method, device and system
CN105553871A (en) * 2015-12-15 2016-05-04 厦门贝启科技有限公司 Method and system for remotely managing equipment parameters
CN105607927A (en) * 2015-12-18 2016-05-25 小米科技有限责任公司 Page display method and apparatus
CN105740418A (en) * 2016-01-29 2016-07-06 杭州亿方云网络科技有限公司 File monitoring and message pushing based real-time synchronization system
CN106161586B (en) * 2016-06-07 2019-03-19 四川长虹电器股份有限公司 Realize intelligent terminal to the long poll control system and method for vehicle device
CN106161586A (en) * 2016-06-07 2016-11-23 四川长虹电器股份有限公司 Realize the intelligent terminal's long polling system system and method to car machine
CN106656658A (en) * 2016-11-17 2017-05-10 许继集团有限公司 Substation information pushing system
CN107168808A (en) * 2017-03-30 2017-09-15 太仓鸿策腾达网络科技有限公司 A kind of interprocess communication intelligently pushing system
CN107181821A (en) * 2017-07-05 2017-09-19 广州华多网络科技有限公司 A kind of information push method and device based on SSE specifications
CN109547511A (en) * 2017-09-22 2019-03-29 中国移动通信集团浙江有限公司 A kind of real-time method for pushing of WEB message, server, client and system
CN109684111A (en) * 2018-12-28 2019-04-26 安徽同徽网络技术有限公司 Information push method, message push system and computer readable storage medium

Similar Documents

Publication Publication Date Title
US10862989B2 (en) Push notification delivery system
CN106453288B (en) A kind of distributed micro services frame system that supporting asynchronous mode and its implementation
Kaul et al. Real-time status: How often should one update?
EP2871809B1 (en) Message processing method, device and system for internet of things
US10063623B2 (en) Channel ownership in a publish-subscribe system
US9621620B2 (en) Apparatus and method for providing content with a distributed architecture, and system for providing content with the said apparatus
CN101668031B (en) Message processing method and message processing system
CN103095724B (en) The method that the multiple interest packet compression of a kind of content center network sends and processes
CN102760074B (en) Method and its system for high load capacity operation flow scalability
WO2018103709A1 (en) Group conversation processing method, terminal, server, and system, and storage medium
US20180191854A1 (en) Systems and methods for providing messages to multiple subscribers
CN106230896B (en) A kind of information push method, apparatus and system
CN101488928B (en) Internet enterprise group communication device and internet enterprise group communication method
CN102708173B (en) Method and system for processing user requests of accessing to web pages
CN108353020A (en) System and method for transmitting message data
CN103546584A (en) Information pushing method and system
CN102255934B (en) Cloud service dissemination method and cloud service intermediary
JP2010231759A (en) Mobile terminal device including mobile cloud platform
KR20090006077A (en) Delayed downloading video service using peer-to-peer(p2p) content distribution network
CN105556496B (en) Pass through the method and apparatus for the expansible direct inter-node communication that quick peripheral component interconnection high speed (Peripheral Component Interconnect-Express, PCIe) carries out
CN102426542B (en) Resource management system for data center and operation calling method
CN102684986B (en) Method and system for displaying pictures at terminal
CN101425969B (en) Scheduling method, apparatus and system
Yang et al. On 3G mobile e-commerce platform based on cloud computing
CN108141404A (en) Expansible real-time Message Passing system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20120627