CN101141474A - Hypertext transfer protocol based communication system and method - Google Patents

Hypertext transfer protocol based communication system and method Download PDF

Info

Publication number
CN101141474A
CN101141474A CNA2007101236878A CN200710123687A CN101141474A CN 101141474 A CN101141474 A CN 101141474A CN A2007101236878 A CNA2007101236878 A CN A2007101236878A CN 200710123687 A CN200710123687 A CN 200710123687A CN 101141474 A CN101141474 A CN 101141474A
Authority
CN
China
Prior art keywords
message
link
wap
application protocol
wireless application
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
CNA2007101236878A
Other languages
Chinese (zh)
Other versions
CN101141474B (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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN2007101236878A priority Critical patent/CN101141474B/en
Publication of CN101141474A publication Critical patent/CN101141474A/en
Application granted granted Critical
Publication of CN101141474B publication Critical patent/CN101141474B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Mobile Radio Communication Systems (AREA)

Abstract

The present invention discloses a communication system and a method based on a hypertext transmission protocol, the system comprises a WAP server terminal, a WAP gateway and a terminal, the WAP gateway comprises a HTTP module and a WAP application terminal, the HTTP module comprises a general control thread, at least a message queue, a working thread and a link pool, each working thread respectively manages one link pool; the general control thread is used to complete a message interaction of the WAP application terminal and the WAP server terminal or between the terminals, and to deposit the message to the message queue; the working thread is used to receive the message from the message queue, and to put a link corresponding to the message in the link pool managed by the working thread, and used to select the link in the link pool managed by the working thread, to complete the data sending and receiving of the WAP application terminal and the WAP server terminal, and between the terminal. The system and the method described in the present invention can improve the efficiency and the reliability of the short connection processed by the HTTP module and ensures the high-efficient and stable operation of the system.

Description

A kind of communication system and method based on HTML (Hypertext Markup Language)
Technical field
The present invention relates to field of wireless communication, relate in particular to a kind of communication system and method based on HTTP (HyperTextTransfer Protocol, HTML (Hypertext Markup Language): be used for transportation protocol) from Internet Server transmission hypertext to local browser.
Background technology
WAP (Wireless Application Protocol, WAP (wireless application protocol): appearance a kind of global unified open protocol that internet content and advanced value-added service are provided to portable terminal) realized the 21 century people whenever and wherever possible " surf the web " and dream, be one of optimal mode of radio communication and Internet (the Internet) combination.The WAP gateway conduct is an equipment of most critical wherein, its performance and stability directly have influence on the perceptibility of user in using the WAP process, comprise WAP application end and HTTP module in the WAP gateway, various WAP use by the transfer of WAP application end, and the HTTP module is as a nucleus module on the WAP gateway equipment, it is a bridge block that connects Internet, it (connects each user's request by short connected mode when service request is arranged, disconnection connection after request disposes) is connected to the WAP server end (WAP site) on the network, and the result returned to terminal (cellphone subscriber or service provider), the framework of whole system is as shown in Figure 1.
User's WEB (based on the attendant application of the Internet) request sends on the WAP gateway to lack connected mode by http protocol, after WAP gateway is received request, with its parsing and send to the WAP site request msg, and the result is returned to the terminal use.Each request of user is substantially all in the following order: connect-" send request-" receive response-" disconnect and connecting.
WAP gateway is in peak period, need bear up to ten thousand user's requests of per minute and conduct interviews simultaneously, adopt aforesaid way concerning the HTTP module, in the unit interval, need to handle a large amount of link setup and chain rupture request, also have lot of data to send and to receive simultaneously.The general framework that adopts of HTTP module all is based on multiplexed polling technique, and adopts multithreading to realize sharing of load, and each thread is responsible for the management of a part of connection resource, comprises the transmitting-receiving of chain rupture, link setup and data.The typical architecture of HTTP module as shown in Figure 2.
Among Fig. 2, the master control thread receives each HTTP that uses request, each request need be set up a HTTP link to the website, after the master control thread is finished link setup, mode by the internal memory coupling will be asked, promptly should ask link corresponding, mean allocation is in the link pond of each worker thread, the link that each worker thread will have been set up at every turn joins in the link set, adopt SELECT (the API function that system provides) mode to be blocked on the link set in link pond, whether the SELCET function has data to receive and dispatch to the all-links inspection in the link set, after in case the SELECT function returns and receives data, then rescan the link in the link pond, and join in the link set once more.Because worker thread and master control thread all need the link circuit resource in the link pond is operated, therefore need all read-write operations in link pond be locked, the link that prevents to link in the pond occurs unusual.But the defective of this method also is conspicuous, the mutual exclusion of between master control thread and each worker thread resource being used, cause each worker thread that the operation in link pond is become very complicated, cause linking the confusion of pond internal resource easily, greatly reduce the operational efficiency of system.
Summary of the invention
In view of this, technical problem to be solved by this invention provides a kind of communication system based on HTML (Hypertext Markup Language), and this system can improve short efficient and the reliability that connects of HTTP resume module, guarantees the efficient and even running of system.
The present invention provides a kind of means of communication based on HTML (Hypertext Markup Language) simultaneously.
To achieve these goals, described system of the present invention adopts following technical scheme:
A kind of communication system based on HTML (Hypertext Markup Language), comprise wireless application protocol server end, Wireless Application Protocol Gateway and terminal, described Wireless Application Protocol Gateway comprises HTML (Hypertext Markup Language) module and WAP (wireless application protocol) application end, described HTML (Hypertext Markup Language) module is used to finish the mutual of described WAP (wireless application protocol) application end and described wireless application protocol server end or terminal room, described HTML (Hypertext Markup Language) module comprises master control thread, at least one message queue, worker thread and link pond, the corresponding management of each worker thread one link pond; Described master control thread is used to finish the interacting message of described WAP (wireless application protocol) application end and described wireless application protocol server end or terminal room and deposits message to described message queue; Described worker thread is used for receiving message from message queue, and the message link corresponding put into the link pond of its management, and the link in link pond that is used for selecting its management is to finish the data transmit-receive of described WAP (wireless application protocol) application end and described wireless application protocol server end or terminal room.
Preferably, described message queue is a plurality of, and the different messages formation has different message attributes, the corresponding at least worker thread from its reception message of each message queue.
The invention also discloses a kind of means of communication, comprise following steps based on HTML (Hypertext Markup Language):
A, master control thread are set up the communication link of WAP (wireless application protocol) application end and wireless application protocol server end or terminal room, finish the interacting message of WAP (wireless application protocol) application end and wireless application protocol server end or terminal room;
B, master control thread with message deposit to message queue;
C, worker thread receive message from message queue, and the message link corresponding are put into the link pond of its management;
D, worker thread are selected the link in the link pond of its management, finish the data transmit-receive of WAP (wireless application protocol) application end and wireless application protocol server end or terminal room.
Among the described step C, the message that worker thread receives in the message queue is to adopt the unblock mode.
Described unblock mode realizes as follows: receiving message continuously is that sky or received quantity surpass setting threshold up to message queue.
Among the described step D, worker thread is selected link and is utilized SELECT obstruction mode to realize from the link pond.
Described SELCET blocks mode when carrying out the link selection processing, and SELECT is overtime to be returned if take place, and then carries out the overtime detection of Link State is handled.
Beneficial effect of the present invention is: by message queue is set, the master control thread only with message deposit to message queue, worker thread receives message by message queue.The master control thread no longer conducts interviews to the link pond of worker thread, thus, has avoided between master control thread and each worker thread mutual exclusion that resource is used, and the link pond no longer needs to read and write to lock, thereby has simplified the operation of worker thread for the link pond.Thereby the present invention can carry out interacting message efficiently, farthest improves the concurrent number of handling link in the unit interval, reduces the consumption of system resource, improves the stability of entire system.
Further, the message queue of a plurality of tool different messages attributes is set, the feasible processing that more helps message, the efficient of raising interacting message.
Description of drawings
Fig. 1 is the system architecture diagram of the communication system of http protocol of the prior art;
Fig. 2 is the HTTP module rack composition of the communication system of http protocol of the prior art;
Fig. 3 is the HTTP module rack composition of communication system of the http protocol of the specific embodiment of the invention;
Fig. 4 is the process chart of the means of communication of the http protocol of the specific embodiment of the invention.
Embodiment
The invention will be further described in conjunction with embodiment for the contrast accompanying drawing below.
Shown in Fig. 1,3, the communication system of the http protocol of the specific embodiment of the invention comprises WAP server end (WAP site), terminal, WAP gateway; Comprise HTTP module and WAP application end in the WAP gateway, wherein the HTTP module comprises master control thread, message queue, link pond, worker thread.Worker thread is one or more, the corresponding management of each worker thread one link pond.Message queue can be one, also can be for a plurality of; For a plurality of message queues, each message queue has different message attributes, this message attributes can be carried out different settings according to different needs, type that for example can requested service, and for example type of service may be that the difference of video, audio frequency or data service is distinguished.
System architecture is not a stationary, but may carry out dynamic change with actual conditions, for example during system initialization, the master control thread may only be created a message queue, the link pond of a worker thread and corresponding management thereof, along with the increase of linking request number, and create the more work thread thereupon and link the pond to adapt to the needs of real system carrying.
Above-mentioned message, usually can be understood as request, for example in the PULL business, terminal to certain certain business of WAP site request, is at first set up link between terminal and the WAP application end by the HTTP module of WAP gateway by WAP gateway, the HTTP module is according to request, setting up the link of the WAP application end and the WAP site of asking, thus, is transfer with the WAP application end, under the control of HTTP module, terminal and the success of WAP server end link setup.In the PUSH business, may no longer include the request of terminal, and may select different terminals to carry out issuing message by the WAP server end.
The server end address that generally comprises link in the message, information such as requested service type, it is stored in the message queue by the master control thread, possible set-up mode is: a plurality of message queues that different messages attribute (for example aforementioned distinguish with the requested service type) is set, the master control thread with different message deposits in the message queue of corresponding attribute, these message queues are all corresponding at least one worker thread, and worker thread receives message from its corresponding message queue.Another kind of mode: in message queue, do not distinguish, and carry out this processing by worker thread, for example regularly query messages formation of worker thread receives the message that is provided with in the message queue by the message attributes of its processing, has finished the differentiating and processing to the different messages attribute message equally.
Said process can be described as message interaction process, to distinguish mutually with following data transmit-receive process.Worker thread is after obtaining message, link corresponding in the message is put in the link pond of its corresponding management, like this, may comprise multilink in the link pond, i.e. link set, worker thread adopts the SELECT function to be blocked on the link set in link pond in the obstruction mode, whether the SELCET function has data to receive and dispatch to all link checks in the link set, after in case the SELECT function returns and receives data, then rescan the link in the link pond, and join in the link set once more, thereby by the link of worker thread to selecting, also being that WAP server end and terminal room (see through the transfer of WAP application end, so also can think WAP application end and WAP server end or terminal room) are actual has the link of data transmit-receive request to finish data transmit-receive.
In sum, the main setting of communication system of the present invention is:
● no longer include the coupling between internal memory between master control thread and the worker thread, but adopt the master control process to send a message to each worker thread by message queue.The master control thread is put into message queue with message, and each worker thread gets off message sink from message queue, and the message corresponding link is put in the link pond, thereby has avoided the conflict in action link pond simultaneously of worker thread and master control thread.
● the processing of worker thread is divided into two parts, and first half mainly is to receive message from message queue, and link wherein is stored in the link pond, if there is not message just to return immediately, no longer receives the content of message queue, and carries out follow-up processing.Latter half is to adopt the SELECT mode to be blocked on the link set in link pond, and after being provided with overtime 100 milliseconds, time-out time is not limited thereto certainly, also can be according to the corresponding adjustment of actual conditions.If without any socket (two programs are carried out the end points of communication) data transmit-receive is arranged in the set, after overtime, return immediately, again receive message on the message queue to first half, and carry out before the SELECT at every turn, all the active link in the link pond to be formed a link set, be blocked on this link set by the SELECT function.
● the link in the link pond has only a worker thread to read and write, and has got rid of multithreading and has read while write the collision problem that causes.
● the quantity of worker thread and the quantity of message queue can on-the-fly modify according to user's configuration, to satisfy performance demands.
For the means of communication of the specific embodiment of the invention, as shown in Figure 4, its concrete handling process can comprise the following step:
1) after the master control thread starts, creates corresponding message queue, worker thread and link pond.This is the process of system initialization.The master control thread is set up the communication link of WAP application end and WAP server end or terminal room according to the message of terminal or WAP server end, finishes the interacting message of WAP application end and WAP server end or terminal room; And with message deposit to message queue.
2) worker thread receives message on the message queue by the unblock mode, if receive new message, exceed certain threshold value with receiving continuously for quantity empty or that receive up to message queue, after Message Processing, the message link corresponding is stored in the link pond of this worker thread management.In the present embodiment, the threshold value that receives message gets 200.
3) worker thread adopts multiplexing technique, and all links that belong in the link pond of this thread are added in the set, is blocked in the set with SELECT, if having data transmit-receive or time to surpass 100 milliseconds, will return immediately.
4) if there are data to need to receive, then carry out receiver function and will receive complete data sending to the WAP application end.If there are data to need to send, then carry out the transmission function and send the data to terminal.
5) if SELECT is overtime to be returned, then carry out the overtime detection of Link State, prevent that the long-time free time of link from causing connection to be hung.
Adopt after the communication system based on HTTP of the present invention, the performance of whole system and stability have all had significantly raising, find that through contrast test the treatment effeciency of system architecture of the present invention is about the twice of existing systems framework; And aspect stable, adopt the WAP gateway of existing system framework, after operation a period of time, the leakage of a large amount of connection resources can appear, cause the paralysis of WAP gateway, and adopt system architecture of the present invention, long-play does not all have to occur above problem, ruuning situation is normal fully, has improved the overall performance and the reliability of WAP gateway greatly.
The present invention has optimized the overall performance of HTTP module from system architecture, has improved short efficient and the reliability that connects of HTTP resume module, guarantees the efficient and even running of using.The present invention can carry out interacting message efficiently, has farthest improved and has handled the concurrent number that connects in the unit interval, has reduced the consumption of system resource, has reduced the mutual exclusion of system, has improved whole stability.

Claims (7)

1. communication system based on HTML (Hypertext Markup Language), comprise the wireless application protocol server end, Wireless Application Protocol Gateway and terminal, described Wireless Application Protocol Gateway comprises HTML (Hypertext Markup Language) module and WAP (wireless application protocol) application end, described HTML (Hypertext Markup Language) module is used to finish the mutual of described WAP (wireless application protocol) application end and described wireless application protocol server end or terminal room, it is characterized in that, described HTML (Hypertext Markup Language) module comprises the master control thread, at least one message queue, worker thread and link pond, the corresponding management of each worker thread one link pond; Described master control thread is used to finish the interacting message of described WAP (wireless application protocol) application end and described wireless application protocol server end or terminal room and deposits message to described message queue; Described worker thread is used for receiving message from message queue, and the message link corresponding put into the link pond of its management, and the link in link pond that is used for selecting its management is to finish the data transmit-receive of described WAP (wireless application protocol) application end and described wireless application protocol server end or terminal room.
2. communication system as claimed in claim 1 is characterized in that, described message queue is a plurality of, and the different messages formation has different message attributes, the corresponding at least worker thread from its reception message of each message queue.
3. the means of communication based on HTML (Hypertext Markup Language) is characterized in that, comprise following steps:
A, master control thread are set up the communication link of WAP (wireless application protocol) application end and wireless application protocol server end or terminal room, finish the interacting message of WAP (wireless application protocol) application end and wireless application protocol server end or terminal room;
B, master control thread with message deposit to message queue;
C, worker thread receive message from message queue, and the message link corresponding are put into the link pond of its management;
D, worker thread are selected the link in the link pond of its management, finish the data transmit-receive of WAP (wireless application protocol) application end and wireless application protocol server end or terminal room.
4. the means of communication as claimed in claim 3 is characterized in that, among the described step C, the message that worker thread receives in the message queue is to adopt the unblock mode.
5. the means of communication as claimed in claim 4 is characterized in that, described unblock mode realizes as follows: receiving message continuously is that sky or received quantity surpass setting threshold up to message queue.
6. as the arbitrary described means of communication of claim 3 to 5, it is characterized in that among the described step D, worker thread is selected link and utilized SELECT obstruction mode to realize from the link pond.
7. the means of communication as claimed in claim 6 is characterized in that, described SELCET blocks mode when carrying out the link selection processing, and SELECT is overtime to be returned if take place, and then carries out the overtime detection of Link State is handled.
CN2007101236878A 2007-09-27 2007-09-27 Hypertext transfer protocol based communication system and method Expired - Fee Related CN101141474B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2007101236878A CN101141474B (en) 2007-09-27 2007-09-27 Hypertext transfer protocol based communication system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2007101236878A CN101141474B (en) 2007-09-27 2007-09-27 Hypertext transfer protocol based communication system and method

Publications (2)

Publication Number Publication Date
CN101141474A true CN101141474A (en) 2008-03-12
CN101141474B CN101141474B (en) 2010-06-16

Family

ID=39193215

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2007101236878A Expired - Fee Related CN101141474B (en) 2007-09-27 2007-09-27 Hypertext transfer protocol based communication system and method

Country Status (1)

Country Link
CN (1) CN101141474B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101917525A (en) * 2010-09-15 2010-12-15 烽火通信科技股份有限公司 Method and device for processing notification message tasks in presence service
CN102202094A (en) * 2011-05-13 2011-09-28 中兴通讯股份有限公司 Method and device for processing service request based on HTTP (hyper text transfer protocol)
CN102710743A (en) * 2012-04-16 2012-10-03 杭州斯凯网络科技有限公司 Self-adapting wireless access method of handheld terminal APN (Access Point Name)
CN102984016A (en) * 2012-12-24 2013-03-20 上海斐讯数据通信技术有限公司 Asynchronous processing method of management protocol
CN103716253A (en) * 2013-12-27 2014-04-09 广州华多网络科技有限公司 Method and device for requesting data
CN106850740A (en) * 2016-12-19 2017-06-13 中国科学院信息工程研究所 A kind of throughput data method for stream processing high

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1277196C (en) * 2004-06-09 2006-09-27 中兴通讯股份有限公司 Method for applied server of computer system

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101917525A (en) * 2010-09-15 2010-12-15 烽火通信科技股份有限公司 Method and device for processing notification message tasks in presence service
CN102202094A (en) * 2011-05-13 2011-09-28 中兴通讯股份有限公司 Method and device for processing service request based on HTTP (hyper text transfer protocol)
CN102710743A (en) * 2012-04-16 2012-10-03 杭州斯凯网络科技有限公司 Self-adapting wireless access method of handheld terminal APN (Access Point Name)
CN102984016A (en) * 2012-12-24 2013-03-20 上海斐讯数据通信技术有限公司 Asynchronous processing method of management protocol
CN102984016B (en) * 2012-12-24 2017-07-25 上海斐讯数据通信技术有限公司 A kind of management agreement asynchronous processing method
CN103716253A (en) * 2013-12-27 2014-04-09 广州华多网络科技有限公司 Method and device for requesting data
CN106850740A (en) * 2016-12-19 2017-06-13 中国科学院信息工程研究所 A kind of throughput data method for stream processing high
CN106850740B (en) * 2016-12-19 2019-07-23 中国科学院信息工程研究所 A kind of high throughput data method for stream processing

Also Published As

Publication number Publication date
CN101141474B (en) 2010-06-16

Similar Documents

Publication Publication Date Title
CN101141474B (en) Hypertext transfer protocol based communication system and method
CN103188574B (en) method and system for transmitting network video
CN101262372B (en) Method for video monitoring platform to operate and control front-end device based on SIP server cluster
CN101925045B (en) Method and system for providing user service data
CN100421431C (en) Method for realizing instant message communication
US8495173B2 (en) Mobile radio communication device and method of managing connectivity status for the same
CN101184056A (en) Distributed enterprise service bus message switching method
CN101599982A (en) Cellphone information browsing apparatus, system and implementation method
CN101383839A (en) Data distribution system based on data server and implementation method
CN101582861B (en) Method of IM specific customer service call, as well as server, client and system thereof
CN101917394B (en) Middleware system for sharing data in mobile phone equipment and working method
CN101185070B (en) Device management system and method for setting configuration-value therein
CN101426181A (en) Intelligent multimedia information mobile phone viewing system having instant interaction and implementation method
CN102412998A (en) Operation service system and maintenance method and device thereof
CN101796774A (en) Method and system for checking automatically connectivity status of an IP link on IP network
CN101631127A (en) File transfer method and clients
CN103716230A (en) Message sending method, device and server
CN111124717A (en) Message delivery method, system and computer storage medium
CN102523236B (en) Method and equipment for establishing dynamic connection
CN1972276A (en) A management method and system for protocol access
CN101626348A (en) System and method for realizing service support of enterprise convergence communication
CN101695049A (en) Method and device for processing businesses in monitoring system
CN101521682A (en) Synthesized remote monitoring system and processing method of remote monitoring data
CN101436953B (en) Management method and processing module for on-line announcement message of network appliance
CN104639379A (en) Proxy testing method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20100616

Termination date: 20160927

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