CN102571867A - Method for keeping active session in browser/server (BS) architecture portal application - Google Patents

Method for keeping active session in browser/server (BS) architecture portal application Download PDF

Info

Publication number
CN102571867A
CN102571867A CN2010106171208A CN201010617120A CN102571867A CN 102571867 A CN102571867 A CN 102571867A CN 2010106171208 A CN2010106171208 A CN 2010106171208A CN 201010617120 A CN201010617120 A CN 201010617120A CN 102571867 A CN102571867 A CN 102571867A
Authority
CN
China
Prior art keywords
request
browser
heartbeat
web server
http
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
CN2010106171208A
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.)
Zhongbo Information Technology Research Institute Co Ltd
NANJING CITY LINKAGE SYSTEM INTEGRATION CO Ltd
Original Assignee
Zhongbo Information Technology Research Institute Co Ltd
NANJING CITY LINKAGE SYSTEM INTEGRATION 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 Zhongbo Information Technology Research Institute Co Ltd, NANJING CITY LINKAGE SYSTEM INTEGRATION CO Ltd filed Critical Zhongbo Information Technology Research Institute Co Ltd
Priority to CN2010106171208A priority Critical patent/CN102571867A/en
Publication of CN102571867A publication Critical patent/CN102571867A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Computer And Data Communications (AREA)

Abstract

The invention provides a method for keeping an active session in browser/server (BS) architecture portal application. Under the condition of lowering of a BS architecture application session timeout value, a hyper text transport protocol (HTTP) message is regularly transmitted by utilizing an asynchronous script of a browser to simulate a 'heartbeat' request, so that the session overhead of a server is decreased, and the activity of the session is also ensured.

Description

The method that keeps active sessions in a kind of BS framework portal application
1, technical field
The constructing technology that the present invention is the relevant service management of value-added service and the user serves the WEB door.Especially the method that keeps active sessions in a kind of BS framework portal application.
2, background technology
BS framework door applications exploiting http protocol as the service end logic of managing business, as client, utilizes html document to realize user's operation, browser interface with browser with the WEB application server.
Http protocol is a kind of request formula interaction protocol, and basic interactive mode is:
1) user submits the HTTP access request of visit related pages/resource to through browser.
2) the WEB server receives the HTTP request of browser, and analysis request is also returned desired page/resource.
3) browser is received the http response that the WEB server returns, and resolves HTML content wherein, and carries out the interface and appear.
Http protocol is a stateless protocol, and the function that the session life cycle keeps (like the foundation of session, keep, terminate) is not provided, and these functions are provided by application layer module usually; Peace preservation association's speech phase generally adopts browser Cookie data to combine service end session tracking data to accomplish, and generally is when the user logins the door success, to set up session, termination session when withdrawing from door; Because the stateless character of http protocol, even the user closes browser, its session tracking data still is present in the server.
For guaranteeing session jd, the promptness of keeping; A large amount of session tracking datas generally is directly to deposit in the internal memory of server, for the more portal application of number of users, is peace preservation association's speech phase; Usually to consume a large amount of server memory and/or be used to transmit the network traffics of Cookie data; When situation was serious, the door response was slow, the Business Processing inefficiency; This moment, general solution was that the as far as possible little session timeout time limit is set; Consequently surpass the session in overtime time limit for inoperation of a specified duration; Its status data is removed from service end,, thereby server is freed from the low internal storage state that continues with the memory requirements of reduction service end.Because session timeout must land when relevant user operates once more, to rebulid session once more.
The cost of above-mentioned way is, when the user wouldn't operate, is easy to take place session timeout, at this moment needs the user to re-enter user name/password and lands; Frequent login causes user experience not good.
3, summary of the invention
The objective of the invention is: in the BS framework applications, each login user all can be safeguarded a session state data in the WEB service end, for a large amount of concurrent users' situation; The memory cost that is used for session is very big; And because http protocol is easy to generate invalid session, and can not get removing timely; For guaranteeing the handling property of server; Generally can set an inefficacy timeout value for inactive session, at this moment produced a problem: timeout value is provided with oversize, reclaims the DeGrain of service end memory cost; Be provided with too shortly, session is easy to overtime, needs the user to land again frequently, and user experience is not good.Keep the method for active sessions well to solve the problems referred to above in a kind of BS framework of the present invention portal application.
Technical scheme of the present invention is: adopt the browser of main flow all to support asynchronous script calls technology.For the portal application of using HTML framework interface tech (FrameSet&Frame or IFrame or DIV layer); Hold in the frame page that does not upgrade that within it asynchronous HTTP invoke script being set, and regularly trigger " heartbeat " request through DHTML script timer.For the portal application of not using HTML framework interface tech, can in each related pages, insert above-mentioned asynchronous script.Do not have specific (special) requirements on server end " heartbeat " processing of request, simply return the HTTP success response and get final product browser.
" heartbeat " interactive relation of browser and WEB application server is following, as shown in Figure 1:
1) timer in the browser page regularly triggers, and asks to WEB application server asynchronous transmission " heartbeat ".
2) the WEB server end is accepted " heartbeat " request, upgrades session status, returns " heartbeat " and confirms response.
The transmission frequency of " heartbeat " message should be simulated the frequency of ordinary people's normal running, cannot be shorter than this frequency, in order to avoid cause unnecessary additional networks expense, and increase the weight of the service end load; Should on the basis of artificial average operation frequency, prolong slightly, once be advisable with 5 to 10 minutes.
Utilize the method, require the session failed timeout value of configuration server end, suitably turn this value down; But still need requesting interval greater than " heartbeat " script; Consider network delay, can on " heartbeat " interval basis, add 5 minutes in addition, and optimize with the fine setting of practical business running environment.
The invention has the beneficial effects as follows:
(1) alleviates the memory cost of server end, promote response performance and concurrent capacity that WEB uses.
(2) avoid frequent and overtimely land again, guarantee that user's excellent operation experiences.
4, description of drawings
" heartbeat " interactive relation figure of Fig. 1 browser and WEB application server
Fig. 2 asynchronous " heartbeat " Request Processing sequence chart
Fig. 3 " heartbeat " asynchronous call timer installation procedure figure
5, embodiment
The part of several keys below the method for maintenance active sessions has mainly comprised in a kind of BS framework portal application:
(1) HTML asynchronous " heartbeat " processing scripts: " heartbeat " asynchronous request timer is installed, is triggered to the WEB application server with timer and send " heartbeat " request, handle " response " result.
(2) the WEB application module of WEB server-side processes " heartbeat " response: accept " heartbeat " request, return success response, application server can help to upgrade session status simultaneously.
Asynchronous " heartbeat " Request Processing sequence is following, as shown in Figure 2:
1) timer in the browser page triggers, and sends " heartbeat " request to the WEB application server.
2) WEB uses and receives " heartbeat " request, upgrades the state of response session, returns success and confirms response.
3) browser receives that " heartbeat " confirm response, waits for that next timer triggers, and changes step 1 and continues, if overtime or receive the response failure, then continues to attempt, attempt certain number of times (, configurable) as 3 times after, if still failure, the prompting user conversation lost efficacy.
" heartbeat " asynchronous call timer installation procedure is following, as shown in Figure 3 in the browser page:
1) browser loads the html page that returns from server.
2) page initialization script begins to carry out.
3) create the script timer that regularly calls " heartbeat " request.
4) accomplish other initialization operations.
5) page initialization is accomplished.

Claims (3)

1. method that in BS framework portal application, keeps active sessions; It is characterized in that: the DHTML script in the browser page regularly (utilizing DHTML script timer) sends asynchronous HTTP request to the WEB application server, loses efficacy because of overtime to avoid current login sessions.Utilize the course of work of door of the method following:
1) user passes through browser to the WEB server requests page.
2) the WEB server returns the page of browse request.
3) the browser initialization page, the DHTML script in the page are called " heartbeat " request here periodically to the specific URL of the asynchronous request of WEB server.
4) WEB server update session status, and respond the request of step 3 with simple success (HTTP return state sign indicating number 200).
2. a kind of method that in BS framework portal application, keeps active sessions according to claim 1 is characterized in that: the time cycle of step 3 said " heartbeat " request is lower than the session timeout settings of WEB server.
3. a kind of method that in BS framework portal application, keeps active sessions according to claim 1; It is characterized in that: step 3 said " heartbeat " request; The protocol header control WEB server and the institute that utilize http protocol to provide forbid this request of buffer memory through gateway, agent equipment, perhaps use HTTP query argument (HTTP QueryString) at random to avoid request to be buffered simultaneously or separately.
CN2010106171208A 2010-12-31 2010-12-31 Method for keeping active session in browser/server (BS) architecture portal application Pending CN102571867A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2010106171208A CN102571867A (en) 2010-12-31 2010-12-31 Method for keeping active session in browser/server (BS) architecture portal application

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2010106171208A CN102571867A (en) 2010-12-31 2010-12-31 Method for keeping active session in browser/server (BS) architecture portal application

Publications (1)

Publication Number Publication Date
CN102571867A true CN102571867A (en) 2012-07-11

Family

ID=46416338

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2010106171208A Pending CN102571867A (en) 2010-12-31 2010-12-31 Method for keeping active session in browser/server (BS) architecture portal application

Country Status (1)

Country Link
CN (1) CN102571867A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102739680A (en) * 2012-06-28 2012-10-17 用友软件股份有限公司 Session life prolonging device and method
CN105100113A (en) * 2015-08-26 2015-11-25 浪潮集团有限公司 Session timeout control method based on in-cloud OS
CN108322524A (en) * 2018-01-22 2018-07-24 杭州迪普科技股份有限公司 A kind of load-balancing device session keeps test method and device
CN112202878A (en) * 2020-09-29 2021-01-08 新华三信息安全技术有限公司 Session processing method, device, server and machine-readable storage medium
CN114531471A (en) * 2020-11-09 2022-05-24 航天信息股份有限公司 Login state maintenance method, device, equipment and medium
CN115134237A (en) * 2022-08-30 2022-09-30 建信金融科技有限责任公司 Data updating method, heartbeat detection method, device, equipment and medium

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102739680A (en) * 2012-06-28 2012-10-17 用友软件股份有限公司 Session life prolonging device and method
CN105100113A (en) * 2015-08-26 2015-11-25 浪潮集团有限公司 Session timeout control method based on in-cloud OS
CN108322524A (en) * 2018-01-22 2018-07-24 杭州迪普科技股份有限公司 A kind of load-balancing device session keeps test method and device
CN112202878A (en) * 2020-09-29 2021-01-08 新华三信息安全技术有限公司 Session processing method, device, server and machine-readable storage medium
CN112202878B (en) * 2020-09-29 2022-03-22 新华三信息安全技术有限公司 Session processing method, device, server and machine-readable storage medium
CN114531471A (en) * 2020-11-09 2022-05-24 航天信息股份有限公司 Login state maintenance method, device, equipment and medium
CN115134237A (en) * 2022-08-30 2022-09-30 建信金融科技有限责任公司 Data updating method, heartbeat detection method, device, equipment and medium

Similar Documents

Publication Publication Date Title
CN102571867A (en) Method for keeping active session in browser/server (BS) architecture portal application
CN103369601B (en) For cell-phone customer terminal provides the method for large concurrent processing and flow control
Bandyopadhyay et al. Lightweight Internet protocols for web enablement of sensors using constrained gateway devices
US8917641B2 (en) Systems, structures and associated processes for optimization of state transitions within wireless networks
CN102710748B (en) Data capture method, system and equipment
CN102045270A (en) Chat server system, method for constructing chat server system and chat system
CN103001860A (en) Achieving system for converged communication Web instant messages
CN107612987B (en) A kind of service provision optimization method towards edge calculations based on caching
CN106453288A (en) Asynchronous mode supporting distributed micro service framework system and implementation method thereof
CN104994079B (en) The treating method and apparatus of access request accelerates server
US9172765B2 (en) Polling-based secure network message notification system and method with performance enhancing features
CN102333065A (en) Cloud interaction protocol design
CN102891877A (en) Online processing system and method for implementing terminal application
CN102118325B (en) Method and device for configuring chat client terminal, as well as chat client terminal
CN102355458B (en) Method for increasing success rate of network access
US20100057939A1 (en) Delivering Partially Processed Results Based on System Metrics in Network Content Delivery Systems
CN101119385A (en) Method for enhancing HTTP network velocity using WebPush
CN110099035B (en) Network advertisement data high-concurrency access service method
Herrerı et al. Optimal configuration of energy-efficient Ethernet
Zhang et al. Research and development of real-time monitoring system based on WebSocket technology
CN104378399A (en) Data push method, platform server, client terminal and system
CN100359474C (en) Method for constructing Web server based on soft flow construction and server thereof
CN103166871A (en) System and method of large-scale internet server network to achieve load balancing
CN106850384A (en) A kind of method and mobile terminal for realizing accessing equipment in LAN
CN104320405A (en) Internet surfing optimization method applicable to star satellite network

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20120711