CN104333577A - Message pushing system and method based on HTTP - Google Patents

Message pushing system and method based on HTTP Download PDF

Info

Publication number
CN104333577A
CN104333577A CN201410570675.XA CN201410570675A CN104333577A CN 104333577 A CN104333577 A CN 104333577A CN 201410570675 A CN201410570675 A CN 201410570675A CN 104333577 A CN104333577 A CN 104333577A
Authority
CN
China
Prior art keywords
http
long
server
browser
connection
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201410570675.XA
Other languages
Chinese (zh)
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.)
Individual
Original Assignee
Individual
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 Individual filed Critical Individual
Priority to CN201410570675.XA priority Critical patent/CN104333577A/en
Publication of CN104333577A publication Critical patent/CN104333577A/en
Pending legal-status Critical Current

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
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/40Support for services or applications
    • H04L65/4061Push-to services, e.g. push-to-talk or push-to-video

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention relates to a message pushing system based on HTTP. The message pushing system comprises a browser side module which is for sending a request for establishing a browser HTTP long connection to a server side and establishing the browser side HTTP long connection, and is also used for receiving and displaying messages pushed by the server side; a long connection module which is used for establishing a server side HTTP long connection and storing the server side HTTP long connection to a long connection Map, and is also used for establishing a long connection channel between the browser HTTP long connection and the server side HTTP long connection; and a message pushing module which is used for receiving messages needing to be pushed, and pushing the messages to the browser side module through a Continuation mechanism of Jetty and the long connection channel. According to the message pushing system and method, the Continuation scheme is utilized to solve an asynchronous request, thereby realizing maintaining a large amount of concurrent connection with little thread, improving the performance of the message pushing system and reducing the running load of the server.

Description

A kind of message push system based on HTTP and method
Technical field
The present invention relates to internet message supplying system and method, particularly a kind of message push system based on HTTP and method.
Background technology
Along with internet, applications development in pluralism, net application technology is also constantly developing, various server info push technology obtains fast development in fields such as webpage instant messagings, increasing website platform supplier needs in time Transaction Information, renewal data message to be sent to different users, existing message push system is in order to safeguard a large amount of threads, the pressure of server is comparatively large, and efficiency is lower.
Summary of the invention
The invention provides a kind of message push system based on HTTP and method, to solve above-mentioned message push system to safeguard a large amount of threads, the pressure of server is comparatively large, the technical problem that efficiency is lower.
In order to solve the problems of the technologies described above, the invention provides a kind of message push system based on HTTP, comprising:
Browser end module: set up the long connection request of browser HTTP for sending to server end, and set up the long connection of browser end HTTP; Also push the message of coming for receiving with display server end;
The long link block of HTTP: set up the long connection request of server end HTTP for sending to server end, connects by the Continuation Mechanism establishing server end HTTP of Jetty is long, and connects in Map by the long link information of described server end HTTP stored in long; Also for setting up the long long interface channel connected between the long connection of server end HTTP of browser HTTP;
Message push module: for receiving the message needing to push, take out from the described long Map of connection and be connected Continuation object with the described length of the information matches pushed that needs, by the Continuation of Jetty machine-processed and described long interface channel by message push to browser end module.
Further, described long link block also comprises and connects Inspection and maintenance module: for periodically checking the described long long connection connected in Map, deleting the long of time-out and connecting, reconnecting surprisingly disconnect long and connect.
The invention has the beneficial effects as follows: have employed continuity (Continuation) scheme and solve Asynchronous Request, realize safeguarding a large amount of concurrently to connect with a small amount of thread, improve the performance of message push system, reduce the operating load of server.
The present invention also provides the information push method based on HTTP, comprises the following steps:
Step S1: user to be sent to server end by browser end and sets up the long connection request of browser HTTP;
Step S2: user to be sent to server end by browser end and sets up the long connection request of server HTTP, connects by the Continuation Mechanism establishing server HTTP of Jetty is long, and connects in Map by the long link information of described server end HTTP stored in long;
Step S3: set up the long long interface channel connected between the long connection of server end HTTP of browser HTTP;
Step S4: receive the message needing to push, takes out and needs the long of the information matches pushed to be connected Continuation object with described from the long Map of connection;
Step S5: by the Continuation of Jetty mechanism and long interface channel by message push to browser end.
Further, also comprise and connect Inspection and maintenance step, the described long long connection connected in Map is periodically checked, deletes the long of time-out and connect, reconnect surprisingly disconnect long and connect.
Further, the described long Connection Step of browser HTTP of setting up specifically comprises:
Browser end sends to server end and sets up the long connection request of browser HTTP;
Server end return messages are to browser end;
If server end return messages set up failure, then browser end again sends to server end and sets up the long connection request of browser HTTP;
If server end return messages are the message be successfully established, then start timer, complete the long connection establishment of browser HTTP.
Further, the described long Connection Step of server HTTP of setting up specifically comprises:
Browser end sends to server end and sets up the long connection request of server HTTP;
Analysis request object, if request object is empty, then returns failed message and terminates;
If request object is not empty, then obtain, the ID value in analysis request object, if ID value is empty, then returns failed message and terminate;
If ID value is not empty, set up the Continuation object of Jetty according to request object, and set up the long connection of server HTTP;
Long for server HTTP connection is connected in Map stored in long.
Further, also comprise and server HTTP long connection check step, comprising:
Check whether described ID has set up long connection, if described ID presence server HTTP length connection, then disconnect original server HTTP length and connect, the new long connection of server HTTP is added in long connection Map;
If the described ID long connection of presence server HTTP, then add long connection in Map by the long connection of described server HTTP.
The invention has the beneficial effects as follows: have employed continuity (Continuation) method and solve Asynchronous Request, realize safeguarding a large amount of concurrently to connect with a small amount of thread, improve the performance of message push system; By connecting Inspection and maintenance step, deleting the long of time-out and connecting, reducing the operating load of server; Checked by the corresponding ID in the long Map of connection, disconnect original long connection, when avoiding PUSH message, the new obstruction connected.
Accompanying drawing explanation
Fig. 1 is the structured flowchart of the message push system that the present invention is based on HTTP,
Fig. 2 is the flow chart of the information push method that the present invention is based on HTTP,
Fig. 3 is the flow chart that the present invention sets up the long method connected of browser HTTP,
Fig. 4 is the flow chart that the present invention sets up the long method connected of server HTTP.
Embodiment
Below in conjunction with drawings and Examples, the present invention is further illustrated.
Fig. 1 is the structured flowchart of the message push system that the present invention is based on HTTP, comprising:
Browser end module: set up the long connection request of browser HTTP for sending to server end, and set up the long connection of browser end HTTP; Also push the message of coming for receiving with display server end;
The long link block of HTTP: set up the long connection request of server end HTTP for sending to server end, connects by the Continuation Mechanism establishing server end HTTP of Jetty is long, and connects in Map by the long link information of described server end HTTP stored in long; Also for setting up the long long interface channel connected between the long connection of server end HTTP of browser HTTP;
Message push module: for receiving the message needing to push, take out from the described long Map of connection and be connected Continuation object with the described length of the information matches pushed that needs, by the Continuation of Jetty machine-processed and described long interface channel by message push to browser end module.
Further, described long link block also comprises and connects Inspection and maintenance module: for periodically checking the described long long connection connected in Map, deleting the long of time-out and connecting, reconnecting surprisingly disconnect long and connect.
The invention has the beneficial effects as follows: have employed continuity (Continuation) scheme and solve Asynchronous Request, realize safeguarding a large amount of concurrently to connect with a small amount of thread, improve the performance of message push system, reduce the operating load of server.
Fig. 2 is the flow chart of the information push method that the present invention is based on HTTP, comprises the following steps:
Step S1: user to be sent to server end by browser end and sets up the long connection request of browser HTTP;
Step S2: user to be sent to server end by browser end and sets up the long connection request of server HTTP, connects by the Continuation Mechanism establishing server HTTP of Jetty is long, and connects in Map by the long link information of described server end HTTP stored in long;
Step S3: set up the long long interface channel connected between the long connection of server end HTTP of browser HTTP;
Step S4: receive the message needing to push, takes out and needs the long of the information matches pushed to be connected Continuation object with described from the long Map of connection;
Step S5: by the Continuation of Jetty mechanism and long interface channel by message push to browser end.
Fig. 3 is the flow chart that the present invention sets up the long method connected of browser HTTP, specifically comprises:
Browser end sends to server end and sets up the long connection request of browser HTTP;
Server end return messages are to browser end;
If server end return messages set up failure, then browser end again sends to server end and sets up the long connection request of browser HTTP;
If server end return messages are the message be successfully established, then start timer, complete the long connection establishment of browser HTTP.
Fig. 4 is the flow chart that the present invention sets up the long method connected of server HTTP, and body comprises:
Browser end sends to server end and sets up the long connection request of server HTTP;
Analysis request object, if request object is empty, then returns failed message and terminates;
If request object is not empty, then obtain, the ID value in analysis request object, if ID value is empty, then returns failed message and terminate;
If ID value is not empty, set up the Continuation object of Jetty according to request object, and set up the long connection of server HTTP;
Long for server HTTP connection is connected in Map stored in long.
The invention has the beneficial effects as follows: have employed continuity (Continuation) method and solve Asynchronous Request, realize safeguarding a large amount of concurrently to connect with a small amount of thread, improve the performance of message push system; By connecting Inspection and maintenance step, deleting the long of time-out and connecting, reducing the operating load of server; Checked by the corresponding ID in the long Map of connection, disconnect original long connection, when avoiding PUSH message, the new obstruction connected.
Above the present invention is divided and be described in detail based on the message push system of HTTP and method, apply specific case herein to set forth principle of the present invention and execution mode, the explanation of above embodiment just understands core concept of the present invention for helping; Meanwhile, for one of ordinary skill in the art, according to thought of the present invention, all will change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.

Claims (7)

1. based on a message push system of HTTP, it is characterized in that, comprising:
Browser end module: set up the long connection request of browser HTTP for sending to server end, and set up the long connection of browser end HTTP; Also push the message of coming for receiving with display server end;
The long link block of HTTP: set up the long connection request of server end HTTP for sending to server end, connects by the Continuation Mechanism establishing server end HTTP of Jetty is long, and connects in Map by the long link information of described server end HTTP stored in long; Also for setting up the long long interface channel connected between the long connection of server end HTTP of browser HTTP;
Message push module: for receiving the message needing to push, take out from the described long Map of connection and be connected Continuation object with the described length of the information matches pushed that needs, by the Continuation of Jetty machine-processed and described long interface channel by message push to browser end module.
2. the message push system based on HTTP according to claim 1, it is characterized in that, described long link block also comprises and connects Inspection and maintenance module: for periodically checking long connection the in the described long Map of connection, delete the long of time-out to connect, reconnect surprisingly disconnect long and connect.
3. based on an information push method of HTTP, it is characterized in that, comprise the following steps:
Step S1: user to be sent to server end by browser end and sets up the long connection request of browser HTTP;
Step S2: user to be sent to server end by browser end and sets up the long connection request of server HTTP, connects by the Continuation Mechanism establishing server HTTP of Jetty is long, and connects in Map by the long link information of described server end HTTP stored in long;
Step S3: set up the long long interface channel connected between the long connection of server end HTTP of browser HTTP;
Step S4: receive the message needing to push, takes out and needs the long of the information matches pushed to be connected Continuation object with described from the long Map of connection;
Step S5: by the Continuation of Jetty mechanism and long interface channel by message push to browser end.
4. the information push method based on HTTP according to claim 3, it is characterized in that, also comprise and connect Inspection and maintenance step, the long connection in the described long Map of connection is periodically checked, delete the long of time-out to connect, reconnect surprisingly disconnect long and connect.
5. the information push method based on HTTP according to claim 3, is characterized in that, the described long Connection Step of browser HTTP of setting up specifically comprises:
Browser end sends to server end and sets up the long connection request of browser HTTP;
Server end return messages are to browser end;
If server end return messages set up failure, then browser end again sends to server end and sets up the long connection request of browser HTTP;
If server end return messages are the message be successfully established, then start timer, complete the long connection establishment of browser HTTP.
6. the information push method based on HTTP according to claim 3, is characterized in that, the described long Connection Step of server HTTP of setting up specifically comprises:
Browser end sends to server end and sets up the long connection request of server HTTP;
Analysis request object, if request object is empty, then returns failed message and terminates;
If request object is not empty, then obtain, the ID value in analysis request object, if ID value is empty, then returns failed message and terminate;
If ID value is not empty, set up the Continuation object of Jetty according to request object, and set up the long connection of server HTTP;
Long for server HTTP connection is connected in Map stored in long.
7. the information push method based on HTTP according to claim 6, is characterized in that, also comprises and server HTTP long connection checks step, comprising:
Check whether described ID has set up long connection, if described ID presence server HTTP length connection, then disconnect original server HTTP length and connect, the new long connection of server HTTP is added in long connection Map;
If the described ID long connection of presence server HTTP, then add long connection in Map by the long connection of described server HTTP.
CN201410570675.XA 2014-10-23 2014-10-23 Message pushing system and method based on HTTP Pending CN104333577A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410570675.XA CN104333577A (en) 2014-10-23 2014-10-23 Message pushing system and method based on HTTP

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410570675.XA CN104333577A (en) 2014-10-23 2014-10-23 Message pushing system and method based on HTTP

Publications (1)

Publication Number Publication Date
CN104333577A true CN104333577A (en) 2015-02-04

Family

ID=52408226

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410570675.XA Pending CN104333577A (en) 2014-10-23 2014-10-23 Message pushing system and method based on HTTP

Country Status (1)

Country Link
CN (1) CN104333577A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105391776A (en) * 2015-10-20 2016-03-09 上海斐讯数据通信技术有限公司 Communication method and system for long connection message
CN106899652A (en) * 2016-07-20 2017-06-27 阿里巴巴集团控股有限公司 A kind of method and device of transmission service result
CN107105064A (en) * 2017-06-02 2017-08-29 上海艾融软件股份有限公司 The method for pushing and system of a kind of Transaction Information
CN109040296A (en) * 2018-08-30 2018-12-18 上海艾融软件股份有限公司 A kind of data push method and system based on long connection
CN109547511A (en) * 2017-09-22 2019-03-29 中国移动通信集团浙江有限公司 A kind of real-time method for pushing of WEB message, server, client and system
CN114125026A (en) * 2021-11-24 2022-03-01 四川长虹电器股份有限公司 Communication method for advertising player and advertising player

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040111510A1 (en) * 2002-12-06 2004-06-10 Shahid Shoaib Method of dynamically switching message logging schemes to improve system performance
CN102447719A (en) * 2010-10-12 2012-05-09 上海遥薇(集团)有限公司 Dynamic load balancing information processing system for Web GIS service

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040111510A1 (en) * 2002-12-06 2004-06-10 Shahid Shoaib Method of dynamically switching message logging schemes to improve system performance
CN102447719A (en) * 2010-10-12 2012-05-09 上海遥薇(集团)有限公司 Dynamic load balancing information processing system for Web GIS service

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
杨文婷: "《基于HTTP长连接的消息推送平台的研究与实现》", 《中国优秀硕士学位论文全文数据库信息科技辑》 *

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105391776A (en) * 2015-10-20 2016-03-09 上海斐讯数据通信技术有限公司 Communication method and system for long connection message
CN106899652A (en) * 2016-07-20 2017-06-27 阿里巴巴集团控股有限公司 A kind of method and device of transmission service result
CN107105064A (en) * 2017-06-02 2017-08-29 上海艾融软件股份有限公司 The method for pushing and system of a kind of Transaction Information
CN109547511A (en) * 2017-09-22 2019-03-29 中国移动通信集团浙江有限公司 A kind of real-time method for pushing of WEB message, server, client and system
CN109547511B (en) * 2017-09-22 2022-02-22 中国移动通信集团浙江有限公司 WEB message real-time pushing method, server, client and system
CN109040296A (en) * 2018-08-30 2018-12-18 上海艾融软件股份有限公司 A kind of data push method and system based on long connection
CN109040296B (en) * 2018-08-30 2021-04-06 上海艾融软件股份有限公司 Data pushing method and system based on long connection
CN114125026A (en) * 2021-11-24 2022-03-01 四川长虹电器股份有限公司 Communication method for advertising player and advertising player
CN114125026B (en) * 2021-11-24 2023-09-05 四川长虹电器股份有限公司 Communication method for advertising machine and advertising machine

Similar Documents

Publication Publication Date Title
CN104333577A (en) Message pushing system and method based on HTTP
US9087071B2 (en) Gathering transaction data associated with locally stored data files
CN104980289B (en) Information push method, device and system
CN103534980B (en) Feedback message is utilized to provide the system and method for Push Service
CN103179133B (en) Based on the client of entity class and the method for server communication
CN103281359A (en) Cloud desktop system and operating method
CN103530160A (en) Page loading method and device
CN103179099B (en) A kind ofly access the uniform authentication method of open website platform and a kind of website platform
CN104539682A (en) Debug method, device, mobile terminal, server and system for mobile webpage
CN103685269A (en) Method and system for both-way communication between web browser and server
CN103347092A (en) Method and device for recognizing cacheable file
Pande et al. Enhanced web application and browsing performance through service-worker infusion framework
CN103024013A (en) Differentiation transmission method, differentiation transmission system and differentiation transmission device
CN103324735A (en) Method and device for loading abnormal page in browser and client
CN102790727A (en) Method and system for dynamically pushing personal labels of users
CN104123125A (en) Webpage resource acquisition method and device
CN104243285A (en) Message pushing method and server
CN105099796A (en) Detection method and device for multimedia content replacement and resource spreading system
CN104270362A (en) Request handling method and device
CN113704004B (en) Method, device, equipment and storage medium for realizing notification service
CN203301532U (en) Cloud desktop system
CN104408178A (en) Device and method for WEB control loading
CN103138871B (en) The server data processing system of application program and method in mobile communcations system
CN104243272A (en) Media message pushing method and device
CN103488480A (en) Method and system for page display

Legal Events

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

Application publication date: 20150204

RJ01 Rejection of invention patent application after publication