CN104811488B - Session keeping method and system based on load-balancing device and load-balancing device - Google Patents

Session keeping method and system based on load-balancing device and load-balancing device Download PDF

Info

Publication number
CN104811488B
CN104811488B CN201510173425.7A CN201510173425A CN104811488B CN 104811488 B CN104811488 B CN 104811488B CN 201510173425 A CN201510173425 A CN 201510173425A CN 104811488 B CN104811488 B CN 104811488B
Authority
CN
China
Prior art keywords
session
session identification
http
identification
request
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.)
Active
Application number
CN201510173425.7A
Other languages
Chinese (zh)
Other versions
CN104811488A (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.)
Sangfor Technologies Co Ltd
Original Assignee
Sangfor Network Technology Shenzhen 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 Sangfor Network Technology Shenzhen Co Ltd filed Critical Sangfor Network Technology Shenzhen Co Ltd
Priority to CN201510173425.7A priority Critical patent/CN104811488B/en
Publication of CN104811488A publication Critical patent/CN104811488A/en
Application granted granted Critical
Publication of CN104811488B publication Critical patent/CN104811488B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/142Managing session states for stateless protocols; Signalling session states; State transitions; Keeping-state mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1014Server selection for load balancing based on the content of a request

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a kind of session keeping method based on load-balancing device and system and load-balancing devices, and this approach includes the following steps:Receive the HTTP request from client;Judge HTTP request URL and/or HTTP request head in whether be embedded with the session identification of session for identification;If being embedded with session identification, session identification is extracted using key quality control point or regular expressions method;And judge currently to whether there is server corresponding with session identification;If in the presence of server corresponding with session identification, HTTP request is sent to server corresponding with session identification;If not being embedded with session identification or server corresponding with session identification being not present, HTTP request is sent to by server according to load balance scheduling algorithm;It receives the HTTP responses of the server feedback and transfers to client.The present invention can effectively improve the process performance of load-balancing device, be kept without requiring client that session can be realized using the browser of support cookie.

Description

Session keeping method and system based on load-balancing device and load-balancing device
Technical field
The present invention relates to computer realm more particularly to a kind of session keeping methods and system based on load-balancing device And load-balancing device.
Background technology
Load balancing (Loadbalace) is a kind of server cluster technology, is to ask a large amount of of client according to certain Strategy distribution give multiple servers processing so that the processing capacity of whole system reach or close to Servers-all processing capacity it The technology of sum.It refers to passing through certain technical methods during load balancing that session, which keeps (Session Persistence), Client request is identified so that originally belong to the request with a session, distribution always (or scheduling) as far as possible is arrived Same server technology.
In the case of to multiple servers load balancing, conversation establishing is all only sent out on a current server each time Raw, other servers are no.Load-balancing device has to identify the session in client request, and by request scheduling Onto the server for initially creating the session, if dispatched on other servers, it can cause session that can not continue, final session Request failure.
As shown in Figure 1, load-balancing device dispatches A, B two-server.Client has submitted a log on request, It is supported equalizing equipment and is dispatched to A servers, and the check password success on A servers, then create session;And then client The request of one " inquiry order " is had submitted again, load-balancing device has to the request scheduling to A servers at this time, because Only there are the session status that the client had logged on A servers, if being scheduled to B servers, which does not know simultaneously The Entered state of road client, request can then fail.
There is currently session keep technology include following several:
(1) source IP session keeps (Source Address Persistence):Session based on source IP keeps technology, leads to The method for distinguishing source IP is crossed, the identical request of source IP is distributed to same server.During this mode is realized, client It is often in intranet environment, the IP address used is private net address, and source address conversion is have passed through when accessing public network, is existed a large amount of Client uses the case where same IP.It keeps being that the source address based on data packet is realized due to source IP session, can cause big The client for measuring identical IP is dispatched to same server, unbalanced to dispatch.In addition for cell-phone customer terminal, source IP address It is alternatively, not to be suitable for source IP session holding.
(2) Cookie is inserted into session and keeps (Cookie Insert Persistence):When client accesses for the first time, lead to Insertion cookie is crossed, client is marked (server that the content of label corresponds to scheduling) so that client is subsequent to ask It is marked with cookie in asking, scheduled server is identified by cookie labels, is finally reached same client All effects for asking to be distributed to same server.Since its realization principle is the mode based on cookie, client it requires The browser at end must support Cookie.
(3) Cookie rewrites session and keeps (Cookie Rewrite Persistence):Session is inserted into cookie to protect Similar, to be identified again by making marks in Cookie client request is held, the difference is that load equalizer is not inserted Enter new cookie, but is realized by rewriting the cookie of server.This mode does not require nothing more than client browser branch Cookie is held, and server is required to use Cookie.
(4) the passive sessions of Cookie keep (Cookie Passive Persistence):Remember in the database of equipment The lower server of record closes in cookie to session id and the session id of client distribution are corresponding with server System.When client accesses again, the session id values in client cookie are got first, by searching for database, Find the server of last scheduling, the final purpose realized session and kept.This scheme also requires that client is supported Cookie, and server uses cookie record Session Id.
(5) the passive sessions of URL are kept:By obtaining the session id in URL, the service corresponding to each session is recorded Device.This mode can only record the session id in URL, client request session id not in URL, but It is not suitable for when in the list of submission.Even if session id in URL, due to different server the form of expression not Equally, its identification is made to have difficulties.
Invention content
The technical problem to be solved in the present invention is, in view of the drawbacks of the prior art, provides one kind and is set based on load balancing Standby session keeping method and system and load-balancing device.
The technical solution adopted by the present invention to solve the technical problems is:A kind of session holding based on load-balancing device Method includes the following steps:
Receive the HTTP request from client;
Judge the HTTP request URL and/or HTTP request head in whether be embedded with the session of session for identification Mark;
If being embedded with session identification, the session identification is extracted using key quality control point or regular expressions method;And sentence It is disconnected currently to whether there is server corresponding with the session identification;If in the presence of service corresponding with the session identification The HTTP request is then sent to server corresponding with the session identification by device;
It is equal according to load if not being embedded with session identification or server corresponding with the session identification being not present The HTTP request is sent to server by weighing apparatus dispatching algorithm;
It receives the HTTP responses of the server feedback and transfers to the client.
Preferably, further include judging the HTTP request for POST request or GET request;
If POST request, then the session mark that session for identification whether is embedded in the list of the POST request is judged Know;If being embedded with session identification, the session identification is extracted using key quality control point or regular expressions method;And judge current With the presence or absence of server corresponding with the session identification;If, will in the presence of server corresponding with the session identification The HTTP request is sent to server corresponding with the session identification;
It is not embedded with session identification if the list of GET request, POST request or is not present and the session identification phase The HTTP request is then sent to the server determined according to load balance scheduling algorithm by corresponding server.
Preferably, HTTP responses for receiving the server feedback and to transfer to the client include following step Suddenly:
Receive the HTTP responses;
Judge whether the HTTP reply header or HTTP response contents are embedded with the session identification of session for identification;
If being embedded with session identification, the session identification is extracted using key quality control point or regular expressions method, by institute The correspondence for stating session identification and server stores in the database, and the HTTP responses are transmitted to client;
If not being embedded with session identification, the HTTP responses are transmitted to client.
Preferably, described to be included the following steps using key quality control point or regular expressions method extraction session identification:
Keyword, offset and the default session identification format of default session identification;
Session identification is extracted according to the keyword and offset using key quality control point, and judges whether successfully to extract The session identification;
If extraction failure, the session identification is extracted according to the default session identification format using regular expressions method, Otherwise terminate the extraction of session identification.
The present invention also provides a kind of load-balancing devices, including:
Information transmit-receive unit, for receiving the HTTP request from client, and by the server feedback received HTTP responses transfer to the client;
Whether judging unit is embedded with for knowing in the URL and/or HTTP request head for judging the HTTP request The session identification of other session;
First processing units, for when being embedded with session identification, then using key quality control point or regular expressions method to carry Take the session identification;And judge currently to whether there is server corresponding with the session identification;If in the presence of with the meeting Words identify corresponding server, then the HTTP request are sent to server corresponding with the session identification;
Second processing unit, for not being embedded with session identification in the HTTP request or being not present and the session mark When sensible corresponding server, then the HTTP request is sent to by server according to load balance scheduling algorithm.
Preferably, the judging unit is additionally operable to judge the HTTP request as POST request or GET request, and When the HTTP request is POST request, the session that session for identification whether is embedded in the list of the POST request is judged Mark;
The first processing units are additionally operable to be embedded with session identification in the list of POST request, then use keyword Matching method or regular expressions method extract the session identification;And judge currently to whether there is clothes corresponding with the session identification Business device;If in the presence of server corresponding with the session identification, the HTTP request is sent to and the session identification Corresponding server;
The second processing unit, be additionally operable to the HTTP request be GET request, POST request list be not embedded in There is session identification or there is no when server corresponding with the session identification, then the HTTP request is sent to according to negative Carry the server that equalized scheduling algorithm determines.
Preferably, the judging unit is additionally operable to judge the HTTP reply header or HTTP response contents of the HTTP responses Whether the session identification of for identification session is embedded with;
The first processing units are additionally operable to, when HTTP reply header or HTTP response contents are embedded with session identification, adopt The session identification is extracted with key quality control point or regular expressions method, the correspondence of the session identification and server is deposited The HTTP responses in the database, and are transmitted to client by storage;
The second processing unit is additionally operable to when HTTP reply header or HTTP response contents are not embedded with session identification, The HTTP responses are transmitted to client.
Preferably, the first processing units are additionally operable to execute following steps:
Keyword, offset and the default session identification format of default session identification;
Session identification is extracted according to the keyword and offset using key quality control point, and judges whether successfully to extract The session identification;
If extraction failure, the session identification is extracted according to the default session identification format using regular expressions method, Otherwise terminate the extraction of session identification.
The present invention also provides a kind of, and the session based on load-balancing device keeps system, including load balancing above-mentioned to set Client and server that is standby, being connected with load-balancing device communication.
The present invention has the following advantages that compared with prior art:Implement the present invention, using key quality control point or canonical table The URL for being embedded in HTTP request and/or the session identification in HTTP request head are extracted up to method, to improve load-balancing device Process performance is kept without requiring client that session can be realized using the browser of support cookie.
Description of the drawings
Present invention will be further explained below with reference to the attached drawings and examples, in attached drawing:
Fig. 1 is the topological diagram of load-balancing device in the prior art;
Fig. 2 is the flow chart of the session keeping method based on load-balancing device in one embodiment of the invention;
Fig. 3 is the flow chart that session identification extracts in one embodiment of the invention;
Fig. 4 is the flow chart for receiving HTTP responses in one embodiment of the invention and transferring to client;
Fig. 5 is another flow chart of the session keeping method based on load-balancing device in one embodiment of the invention;
Fig. 6 is the functional block diagram of the load-balancing device in one embodiment of the invention.
In figure:10, information transmit-receive unit;20, judging unit;30, first processing units;40, second processing unit.
Specific implementation mode
For a clearer understanding of the technical characteristics, objects and effects of the present invention, now control attached drawing is described in detail The specific implementation mode of the present invention.
Embodiment 1
Fig. 2 shows the session keeping method based on load-balancing device in the present embodiment, which includes Following steps:
S11:Receive the HTTP request from client.
S12:Judge HTTP request URL and/or HTTP request head in whether be embedded with the session of session for identification Mark.It is to be appreciated that session identification can be embedded in the URL of HTTP request or HTTP request head, it can also be simultaneously The embedded session identification in the URL of HTTP request and HTTP request head.It is to be appreciated that by judging that URL and/or HTTP are asked It asks whether head is embedded in session identification, can recognize that in most of HTTP requests whether carry session identification, to realize this programme meeting Talk about the purpose kept.
S13:If being embedded with session identification in the URL of HTTP request and/or HTTP request head, keyword match is used Method or regular expressions method extract session identification, it is possible to understand that it is corresponding with server to prestore session identification in the database for ground Relationship.After extracting session identification, judged currently with the presence or absence of corresponding with session identification according to the session identification extracted Server;If in the presence of server corresponding with session identification, HTTP request is sent to clothes corresponding with session identification Business device so that its HTTP request can be dispatched to the server that first HTTP request accesses by client in a conversation procedure In, to realize that session keeps purpose.
As shown in figure 3, being included the following steps using key quality control point or regular expressions method extraction session identification:
S131:Keyword, offset and the default session identification format of default session identification.
S132:Session identification is extracted according to keyword and offset using key quality control point, and judges whether successfully to carry Take session identification.It is to be appreciated that if session identification using a certain keyword and when having fixed offset, passes through search key Word simultaneously calculates offset, can quickly check and accept the position of session identification, and extract the session identification, and key quality control point extracts session What is identified is more efficient.
S133:If session identification extraction failure extracts session using regular expressions method according to default session identification format Mark, otherwise terminates the extraction of session identification, the URL and/or HTTP request head for being considered as HTTP request are not embedded with session Mark.It is to be appreciated that when as long as session identification is using session identification format performance is preset, can extract using regular expressions method The session identification, extraction is more comprehensively.
It is to be appreciated that by key quality control point and the extraction combination of regular expressions method to extract session identification, according to Key quality control point has extracted session identification, then no longer needs to conversate marker extraction using regular expressions method, can effectively improve The extraction efficiency of session identification simultaneously ensures extraction more comprehensively.
S14:If not being embedded with session identification in the URL of HTTP request and/or HTTP request head or participant being not present Words identify corresponding server, then HTTP request are sent to server according to load balance scheduling algorithm.It is to be appreciated that If client accesses server for the first time, i.e., when sending HTTP request for the first time, the URL of HTTP request and HTTP request head Without embedded session identification, correspondingly, server corresponding with session identification is not present, therefore calculate using load balance scheduling HTTP request is sent to server by method.
S15:It receives the HTTP responses of server feedback and transfers to client.It is to be appreciated that when client first time When sending HTTP request by load-balancing device, load-balancing device sends HTTP request according to load balance scheduling algorithm To server, server creates session, and HTTP responses are sent to client, since client does not support cookie, service Session identification is embedded in all hyperlink of client, INPUT controls or other HTML codes by device.
As shown in figure 4, step S15 includes the following steps:
S151:Receive the HTTP responses that server is sent.
S152:Whether the HTTP reply header or HTTP response contents for judging HTTP responses are embedded with session for identification Session identification.It is to be appreciated that (the first time HTTP for being connected to client transmission is asked server after a new session start After asking, a session identification will be distributed for current session, which meets the requirement of preset keyword and offset, And/or meet default session identification format, in order to be inquired.Since browser does not support cookie, the session identification without Method is saved in cookie, therefore session identification is embedded into HTTP reply header or HTTP response contents and is returned by server To client so that be all embedded with the session identification in all hyperlink of client or hiding INPUT controls so that visitor It is embedded with the session identification on the URL for the HTTP request that family end is sent thereafter and/or HTTP request head.
S153:If being embedded with session identification in HTTP reply header or HTTP response contents, key quality control point is used Or the extraction of regular expressions method is embedded in the session identification in HTTP reply header or HTTP response contents, it will words mark and service HTTP responses in the database, and are transmitted to client by the correspondence storage of device, in order to be received again from same When client is embedded with the HTTP request of session identification, HTTP request can be sent in server corresponding with session identification, To realize that session is kept.
S154:If not being embedded with session identification in HTTP reply header or HTTP response contents, HTTP responses are forwarded To client.If it is to be appreciated that session identification is not embedded in HTTP reply header or HTTP response contents, directly by HTTP Response is transmitted to client, when receiving the HTTP request of client transmission again, can not directly be sent to HTTP request Corresponding server can not achieve session holding.
It is to be appreciated that server handles the HTTP request of reception, HTTP request is fed back to load-balancing device Response can be embedded with session identification in the HTTP responses, can not also be embedded with session identification.If the HTTP request of feedback is embedding Enter session identification, load-balancing device extracts the session identification, and the correspondence of session identification and server is stored in number According in library, when HTTP request in order to receive server transmission again, the direct basis session identification sends it to phase The server answered, to improve the process performance of load-balancing device.
In the present embodiment, judge HTTP request URL and/or HTTP request head in whether be embedded in session for identification Session identification, and ask HTTP request to be sent to corresponding server according to judging result, load-balancing device can be effectively improved Process performance, without requiring client using the browser for supporting cookie.
As shown in figure 5, it further includes following steps to be somebody's turn to do the session keeping method based on load-balancing device:
S16:Judge HTTP request for POST request or GET request;
S17:If POST request, then the session mark that session for identification whether is embedded in the list of POST request is judged Know.If being embedded with session identification, session identification is extracted using key quality control point or regular expressions method;And judge it is current whether In the presence of server corresponding with session identification;If in the presence of server corresponding with session identification, HTTP request is sent Give the corresponding server of session identification.
It is not embedded with session identification if the list of GET request, POST request or there is no corresponding with session identification Server, then follow the steps S14, S15, then HTTP request be sent to the service determined according to load balance scheduling algorithm Device.It is to be appreciated that if GET request, then only judge whether the URL of its HTTP request and/or HTTP request head are embedded with Session identification determines server if not being embedded with session identification according to load balance scheduling algorithm.If it is to be appreciated that visitor Automatic trigger access request in the javascript at family end, server can also be embedded in session identification in javascript.
In the present embodiment, judge HTTP request URL and/or the list of HTTP request head or POST request in it is whether embedding Enter the session identification of session for identification, and ask HTTP request to be sent to corresponding server according to judging result, can effectively carry The process performance of high load equalizing equipment, without requiring client to support the browser of cookie that session can be realized and keep.
Embodiment 2
Fig. 6 shows the load-balancing device in the present embodiment.The load-balancing device includes:
Information transmit-receive unit 10, for receiving the HTTP request from client and by the server feedback received HTTP responses simultaneously transfer to client.
Whether judging unit 20 is embedded with for identification in the URL and/or HTTP request head for judging HTTP request The session identification of session;And HTTP request is judged for POST request or GET request, when HTTP request is POST request, sentence Whether the session identification of for identification session is embedded in the list of disconnected POST request.Even HTTP request is POST request, then Judge the meeting that session for identification whether is embedded in the list of the URL of HTTP request, HTTP request head and/or POST request Words mark;If HTTP request is GET request, it is useful only to judge whether the URL of HTTP request and/or HTTP request head are embedded in In the session identification of identification session.It is to be appreciated that by judging that the list of URL and/or HTTP request head, POST request is No embedded session identification can recognize that in most of HTTP requests whether carry session identification, to realize what this programme session was kept Purpose.
First processing units 30, in the list of the URL of HTTP request, HTTP request head and/or POST request When being embedded with session identification, then URL, the HTTP request head of key quality control point or regular expressions method extraction HTTP request are used And/or the session identification in the list of POST request.It is to be appreciated that prestoring session identification and server in the database Correspondence.After extracting session identification, judge currently to whether there is and session identification phase according to the session identification extracted Corresponding server;If in the presence of server corresponding with session identification, HTTP request is sent to opposite with session identification The server answered so that its HTTP request can be dispatched to what first HTTP request accessed by client in a conversation procedure In server, to realize that session keeps purpose.
Specifically, first processing units 30 are additionally operable to execute following steps, to extract session identification:
Keyword, offset and the default session identification format of default session identification.
First key quality control point is used to extract session identification according to keyword and offset, and judges whether the successfully meeting of extraction Words mark.It is to be appreciated that if session identification is using a certain keyword and when having fixed offset, simultaneously by search key Offset is calculated, can quickly check and accept the position of session identification, and extract the session identification, key quality control point extracts session identification It is more efficient.
If extraction failure, session identification is extracted according to default session identification format using regular expressions method, is otherwise terminated The extraction of session identification is considered as in the list of the URL of HTTP request, HTTP request head and/or POST request and is not embedded with Session identification.It is to be appreciated that as long as session identification uses when presetting session identification format performance, using regular expressions method The session identification is extracted, extraction is more comprehensively.
It is to be appreciated that by key quality control point and the extraction combination of regular expressions method to extract session identification, according to Key quality control point has extracted session identification, then no longer needs to conversate marker extraction using regular expressions method, can effectively improve The extraction efficiency of session identification simultaneously ensures extraction more comprehensively.
Second processing unit 40, in the list of the URL of HTTP request, HTTP request head and/or POST request It is not embedded with session identification or there is no when server corresponding with session identification, is calculated according to load balance scheduling HTTP request is sent to server by method.It is to be appreciated that the HTTP request includes POST request and/or GET request.
Specifically, judging unit 20 is additionally operable to judge whether HTTP reply header or HTTP response contents are embedded with for knowing The session identification of other session.
First processing units 30 are additionally operable to when HTTP reply header or HTTP response contents are embedded with session identification, are used Key quality control point or regular expressions method extract session identification, it will words mark and the correspondence of server are stored in database In, and HTTP responses are transmitted to client.It is to be appreciated that the HTTP responses of load-balancing device resolution server feedback, Embedded session identification is extracted from the html codes such as HTTP reply header or HTTP response contents and by session identification and server Correspondence storage in the database so that load-balancing device receive again client transmission HTTP request when, carry Take the session identification in the list of the URL of HTTP request, HTTP request head or POST request, by HTTP request be sent to In the corresponding server of session identification, to realize that session is kept without the cookie dependent on browser.
Second processing unit 40 is additionally operable to when HTTP reply header or HTTP response contents are not embedded with session identification, will HTTP responses are transmitted to client.If it is to be appreciated that not being embedded with session mark in HTTP reply header or HTTP response contents Know, HTTP responses are directly transmitted to client, receive again the client transmission HTTP request when, can not directly by HTTP request is sent to corresponding server, can not achieve session holding.
Load-balancing device provided by the present invention is embedded in HTTP using key quality control point or the extraction of regular expressions method The URL and/or the session identification in HTTP request head of request, to improve the process performance of load-balancing device, without requiring Session holding can be realized using the browser of support cookie in client.
The present invention also provides a kind of, and the session based on load-balancing device keeps system, including load balancing above-mentioned to set Client and server that is standby, being connected with load-balancing device communication.
The present invention is illustrated by several specific embodiments, it will be appreciated by those skilled in the art that, it is not departing from In the case of the scope of the invention, various transformation and equivalent substitute can also be carried out to the present invention.In addition, being directed to particular condition or tool Body situation can do various modifications, without departing from the scope of the present invention to the present invention.Therefore, the present invention is not limited to disclosed Specific embodiment, and should include whole embodiments for falling within the scope of the appended claims.

Claims (5)

1. a kind of session keeping method based on load-balancing device, which is characterized in that including
Following steps:
Receive the HTTP request from client;
Judge the HTTP request URL and/or HTTP request head in whether be embedded with the session identification of session for identification; Further include judging the HTTP request for POST request or GET request;
If the HTTP request is POST request, judge that URL, HTTP request head and/or the POST of the HTTP request are asked Whether the session identification of for identification session is embedded in the list asked;If the HTTP request is GET request, institute is only judged It states the URL of HTTP request and/or whether HTTP request head is embedded with the session identification of session for identification;
If being embedded with session identification, the session identification, the use are extracted using key quality control point or regular expressions method Key quality control point or regular expressions method extraction session identification include the following steps:
Keyword, offset and the default session identification format of default session identification;
Session identification is extracted according to the keyword and offset using key quality control point, and judges whether successfully to extract described Session identification;
If extraction failure, the session identification is extracted according to the default session identification format using regular expressions method, otherwise Terminate the extraction of session identification;And judge currently to whether there is server corresponding with the session identification;If in the presence of with institute The corresponding server of session identification is stated, then the HTTP request is sent to server corresponding with the session identification;
If the list of the URL of the GET request or the POST request, HTTP request head and/or POST request are not embedded in It is useful for the session identification of identification session or server corresponding with the session identification is not present, then according to load balancing tune Degree algorithm determines a server, and the HTTP request is sent to the server of the determination;
It receives the HTTP responses of the server feedback and transfers to the client.
2. the session keeping method according to claim 1 based on load-balancing device, which is characterized in that the reception institute It states the HTTP responses of server feedback and transfers to the client and include the following steps:
Receive the HTTP responses;
Judge whether the HTTP reply header or HTTP response contents are embedded with the session identification of session for identification;
If being embedded with session identification, the session identification is extracted using key quality control point or regular expressions method, by the meeting Words mark and the correspondence of server store in the database, and the HTTP responses are transmitted to client;
If not being embedded with session identification, the HTTP responses are transmitted to client.
3. a kind of load-balancing device, which is characterized in that including:
Information transmit-receive unit (10), for receiving the HTTP request from client, and by the server feedback received HTTP responses transfer to the client;
Whether judging unit (20) is embedded with for knowing in the URL and/or HTTP request head for judging the HTTP request The session identification of other session;It is additionally operable to judge the HTTP request for POST request or GET request, and in the HTTP request For POST request when, then judge whether embedding in the list of the URL of the HTTP request, HTTP request head and/or POST request Enter the session identification for being useful for identification session;If the HTTP request is GET request, the URL of the HTTP request is only judged And/or whether HTTP request head is embedded with the session identification of session for identification;
First processing units (30), for when being embedded with session identification, then using key quality control point or regular expressions method to carry Take the session identification;And judge currently to whether there is server corresponding with the session identification;If in the presence of with the meeting Words identify corresponding server, then the HTTP request are sent to server corresponding with the session identification;It is described First processing units (30) are additionally operable to execute following steps:
Keyword, offset and the default session identification format of default session identification;
Session identification is extracted according to the keyword and offset using key quality control point, and judges whether successfully to extract described Session identification;
If extraction failure, the session identification is extracted according to the default session identification format using regular expressions method, otherwise Terminate the extraction of session identification;
Second processing unit (40), for not being embedded with session identification in the HTTP request or being not present and the session mark When sensible corresponding server, then the HTTP request is sent to by server according to load balance scheduling algorithm;It is additionally operable to institute The list for stating the URL of GET request or the POST request, HTTP request head and/or POST request is not embedded with for knowing Server corresponding with the session identification is not present in the session identification of other session, then true according to load balance scheduling algorithm Determine a server, and the HTTP request is sent to the server of the determination.
4. load-balancing device according to claim 3, which is characterized in that
The judging unit (20) is additionally operable to judge whether the HTTP reply header of the HTTP responses or HTTP response contents are embedding Enter the session identification for being useful for identification session;
The first processing units (30) are additionally operable to, when HTTP reply header or HTTP response contents are embedded with session identification, adopt The session identification is extracted with key quality control point or regular expressions method, the correspondence of the session identification and server is deposited The HTTP responses in the database, and are transmitted to client by storage;
The second processing unit (40) is additionally operable to when HTTP reply header or HTTP response contents are not embedded with session identification, The HTTP responses are transmitted to client.
5. a kind of session based on load-balancing device keeps system, it is characterised in that:Described in claim any one of 3-4 Load-balancing device, with the load-balancing device communicate the client and server that is connected.
CN201510173425.7A 2015-04-13 2015-04-13 Session keeping method and system based on load-balancing device and load-balancing device Active CN104811488B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510173425.7A CN104811488B (en) 2015-04-13 2015-04-13 Session keeping method and system based on load-balancing device and load-balancing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510173425.7A CN104811488B (en) 2015-04-13 2015-04-13 Session keeping method and system based on load-balancing device and load-balancing device

Publications (2)

Publication Number Publication Date
CN104811488A CN104811488A (en) 2015-07-29
CN104811488B true CN104811488B (en) 2018-09-25

Family

ID=53695976

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510173425.7A Active CN104811488B (en) 2015-04-13 2015-04-13 Session keeping method and system based on load-balancing device and load-balancing device

Country Status (1)

Country Link
CN (1) CN104811488B (en)

Families Citing this family (26)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105338063A (en) * 2015-09-30 2016-02-17 北京奇虎科技有限公司 Multi-server user session sharing method and device
CN105553870B (en) * 2015-12-11 2020-03-17 小米科技有限责任公司 Service request distribution method and device
WO2017222615A1 (en) * 2016-06-21 2017-12-28 Oracle International Corporation Internet cloud-hosted natural language interactive messaging system sessionizer
CN106101290B (en) * 2016-08-25 2020-12-11 Tcl科技集团股份有限公司 Server cluster management method and system
EP3513307A1 (en) 2016-09-16 2019-07-24 Oracle International Corporation Internet cloud-hosted natural language interactive messaging system with intent determination
CN108153761A (en) * 2016-12-05 2018-06-12 阿里巴巴集团控股有限公司 Access the method, apparatus of network picture and response to network picture access
CN106686129A (en) * 2017-01-23 2017-05-17 天地融科技股份有限公司 Load balancing method and load balancing system
CN106713499A (en) * 2017-01-23 2017-05-24 天地融科技股份有限公司 Load balancing method, equipment and system
CN108696554B (en) * 2017-04-10 2021-11-30 北京京东尚科信息技术有限公司 Load balancing method and device
CN108055312B (en) * 2017-12-07 2021-07-09 畅捷通信息技术股份有限公司 Routing method and device thereof, computer device and readable storage medium thereof
CN108076149B (en) * 2017-12-15 2021-07-23 杭州迪普科技股份有限公司 Session maintaining method and device
CN108881430A (en) * 2018-06-14 2018-11-23 平安科技(深圳)有限公司 Session keeping method, device, computer equipment and storage medium
CN109246222A (en) * 2018-09-21 2019-01-18 郑州云海信息技术有限公司 service request processing method, device, system and computer readable storage medium
CN109474705B (en) * 2018-12-28 2021-04-27 杭州迪普科技股份有限公司 Session maintaining method and device
CN109688229A (en) * 2019-01-24 2019-04-26 江苏中云科技有限公司 Session keeps system under a kind of load balancing cluster
CN110233902B (en) * 2019-06-28 2022-03-01 杭州迪普科技股份有限公司 Session processing method and device, electronic equipment and machine-readable storage medium
CN112241418B (en) * 2019-07-17 2023-04-18 金篆信科有限责任公司 Distributed database preprocessing method, agent layer, system and storage medium
CN110417876B (en) * 2019-07-17 2021-10-29 中移(杭州)信息技术有限公司 Session method, node server in distributed system and master control equipment
CN111045823A (en) * 2019-12-11 2020-04-21 上海智臻智能网络科技股份有限公司 Context data load distribution method, device, equipment and storage medium
CN111917767B (en) * 2020-07-29 2022-06-07 苏州浪潮智能科技有限公司 Client request authentication method, device, equipment and storage medium
CN112202836A (en) * 2020-09-04 2021-01-08 苏州浪潮智能科技有限公司 Method, system, terminal and storage medium for maintaining client session information
CN113014629A (en) * 2021-02-10 2021-06-22 上海牙木通讯技术有限公司 Proxy forwarding method of handle identifier, server and computer readable storage medium
CN113259429B (en) * 2021-05-11 2023-12-05 鸬鹚科技(深圳)有限公司 Session maintenance management and control method, device, computer equipment and medium
CN114338689A (en) * 2021-12-30 2022-04-12 中国工商银行股份有限公司 Session holding method, apparatus, device, medium, and program product
CN114866442B (en) * 2022-05-31 2023-05-26 杭州迪普科技股份有限公司 8583 protocol-based cross-virtual service session maintenance test method and device
CN114827239A (en) * 2022-05-31 2022-07-29 杭州迪普科技股份有限公司 Bidirectional session holding method and device based on 8583 protocol

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102075409B (en) * 2009-11-24 2013-03-20 华为技术有限公司 Method and system for processing request message as well as load balancer equipment
CN101783771A (en) * 2010-03-24 2010-07-21 杭州华三通信技术有限公司 Method and equipment for realizing load balance continuity
CN102780619B (en) * 2012-07-23 2015-03-11 北京星网锐捷网络技术有限公司 Method and device for processing message
CN102819710B (en) * 2012-08-22 2014-11-12 西北工业大学 Cross-site script vulnerability detection method based on percolation test
CN103685329B (en) * 2012-08-30 2017-11-21 华耀(中国)科技有限公司 Advanced access control system and method based on load balancing
CN103457869A (en) * 2013-08-28 2013-12-18 北京星网锐捷网络技术有限公司 Conversation maintaining method and device
CN103957207B (en) * 2014-04-29 2017-11-28 北京太一星晨信息技术有限公司 A kind of session keeping method and device

Also Published As

Publication number Publication date
CN104811488A (en) 2015-07-29

Similar Documents

Publication Publication Date Title
CN104811488B (en) Session keeping method and system based on load-balancing device and load-balancing device
US11418620B2 (en) Service request management
CN104079543B (en) The acquisition methods of intelligent domestic system supervision authority, device and system
CN104767716B (en) Service request processing method and device
US6430602B1 (en) Method and system for interactively responding to instant messaging requests
US8892768B2 (en) Load balancing apparatus and load balancing method
CN104468363B (en) Page reorientation method, routing device, terminal device and system
CN101783771A (en) Method and equipment for realizing load balance continuity
US8099510B2 (en) Relay device and program product, allowing continued communication via an alternative protocol
CN1321935A (en) Method for controlling communication between customer computer and server group and network server apparatus
CN101438263A (en) System and method for connection optimization
CN102195882B (en) According to method and the device of the routing of data flow application type
US20100174775A1 (en) Communication apparatus, communication method and computer-readable storage medium
CN107733995A (en) A kind of session keeping method, device and electronic equipment
CN104239125B (en) Object processing method, distributed file system and client device
US20030172164A1 (en) server persistence using a session identifier
CN104618388B (en) Fast registration login method and corresponding resetting server, information server
CN107872423B (en) Method, device and system for realizing CDN scheduling
CN109510878A (en) A kind of long connection session keeping method and device
CN117321589A (en) Web crawling by using proxy and application thereof
CN108111595A (en) The equalization methods and device of a kind of server load
EP3217630A1 (en) Method and associated server for providing user-friendly operation
US20030236888A1 (en) Method for improving network server load balancing
US20110093530A1 (en) Server persistence using a url identifier
KR20040012311A (en) Contents Sharing Service System and Method by Presence Information in Wireless Network

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
EXSB Decision made by sipo to initiate substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20200612

Address after: Nanshan District Xueyuan Road in Shenzhen city of Guangdong province 518000 No. 1001 Nanshan Chi Park building A1 layer

Patentee after: SANGFOR TECHNOLOGIES Inc.

Address before: Nanshan District Xueyuan Road in Shenzhen city of Guangdong province 518000 No. 1001 Nanshan Chi Park A1 building five floor

Patentee before: Shenxin network technology (Shenzhen) Co.,Ltd.