CN110233902B - Session processing method and device, electronic equipment and machine-readable storage medium - Google Patents

Session processing method and device, electronic equipment and machine-readable storage medium Download PDF

Info

Publication number
CN110233902B
CN110233902B CN201910577047.7A CN201910577047A CN110233902B CN 110233902 B CN110233902 B CN 110233902B CN 201910577047 A CN201910577047 A CN 201910577047A CN 110233902 B CN110233902 B CN 110233902B
Authority
CN
China
Prior art keywords
session
client
source
cookie
session 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
CN201910577047.7A
Other languages
Chinese (zh)
Other versions
CN110233902A (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.)
Hangzhou DPTech Technologies Co Ltd
Original Assignee
Hangzhou DPTech Technologies 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 Hangzhou DPTech Technologies Co Ltd filed Critical Hangzhou DPTech Technologies Co Ltd
Priority to CN201910577047.7A priority Critical patent/CN110233902B/en
Publication of CN110233902A publication Critical patent/CN110233902A/en
Application granted granted Critical
Publication of CN110233902B publication Critical patent/CN110233902B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • 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/1023Server selection for load balancing based on a hash applied to IP addresses or costs
    • 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
    • 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/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding

Abstract

The application provides a session processing method, a session processing device, an electronic device and a machine-readable storage medium. In the application, a first session request carrying an inserted cookie of the client is received; creating a source IP session holding table entry corresponding to the inserted cookie of the first session request; and if a second session request which does not carry the inserted cookie and is received from the client is received, executing corresponding session processing of source IP session maintenance on the second session request based on the source IP session maintenance table entry. Based on the association of the cookie and the source IP session holding list item, the session request corresponding to the cookie is forwarded to the last accessed server through the associated source IP session holding list item after the cookie is lost, so that the session interruption is prevented, and the service continuity is ensured.

Description

Session processing method and device, electronic equipment and machine-readable storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a session processing method and apparatus, an electronic device, and a machine-readable storage medium.
Background
cookies, also known as cookies, are a technique that enables a Web server to store small amounts of data to or read data from the hard disk of a client (host computer where the browser resides).
When the method is implemented, when a user browses a website provided by a Web server through a browser, the Web server can record information such as user ID, password, browsed webpage, staying time and the like of the website through a very small text file arranged on a hard disk of a client side where the browser is located. When the user accesses the website again, the Web server reads the cookie to obtain the relevant information of the user, and then can make corresponding actions, such as displaying a slogan welcoming the user on a page, or allowing the user to directly log in without inputting an ID and a password, and the like. Essentially, a cookie can be considered as an identification card for a user. But cookies cannot be executed as code, do not transmit viruses, are proprietary to the user, and can only be read by the Web server that provides it. Most of the contents in the cookie are encrypted, so that the general user only looks like certain meaningless alphanumeric combinations, and only the Web processing program of the Web server knows the true meanings of the combinations.
Disclosure of Invention
The application provides a session processing method, which is applied to load balancing equipment in a load balancing system, wherein the load balancing system further comprises a client and a server; the client is connected with the server for communication through the load balancing equipment, and the method comprises the following steps:
receiving a first session request carrying an inserted cookie of the client;
creating a source IP session holding table entry corresponding to the inserted cookie of the first session request;
and if a second session request which does not carry the inserted cookie and is received from the client is received, executing corresponding session processing of source IP session maintenance on the second session request based on the source IP session maintenance table entry.
Optionally, the source IP session holding entry at least includes an IP address of a server corresponding to the client, and the performing, based on the source IP session holding entry, session processing of corresponding source IP session holding on the second session request includes:
and forwarding the second session request to an IP address of a server corresponding to the client.
Optionally, the method further includes:
updating the aging time of the source IP conversation maintaining table item according to a preset strategy; wherein the aging time is greater than an expiration time of the inserted cookie.
Optionally, the method further includes:
and if a third session request carrying the inserted cookie is received from the client, forwarding the third session request to the IP address of the server corresponding to the inserted cookie.
The application also provides a session processing device, which is applied to load balancing equipment in a load balancing system, wherein the load balancing system further comprises a client and a server; wherein, the client is connected with the server through the load balancing device for communication, and the device comprises:
the receiving module is used for receiving a first session request carrying an inserted cookie of the client;
a creating module for creating a source IP session holding table entry corresponding to the inserted cookie of the first session request;
and the session processing module is used for executing corresponding session processing of source IP session maintenance on the second session request based on the source IP session maintenance table entry if the second session request which does not carry the inserted cookie is received from the client.
Optionally, the source IP session holding table entry at least includes an IP address of a server corresponding to the client, and the session processing module further:
and forwarding the second session request to an IP address of a server corresponding to the client.
Optionally, the session processing module further:
updating the aging time of the source IP conversation maintaining table item according to a preset strategy; wherein the aging time is greater than an expiration time of the inserted cookie.
Optionally, the session processing module further:
and if a third session request carrying the inserted cookie is received from the client, forwarding the third session request to the IP address of the server corresponding to the inserted cookie.
The application also provides an electronic device, which comprises a communication interface, a processor, a memory and a bus, wherein the communication interface, the processor and the memory are mutually connected through the bus;
the memory stores machine-readable instructions, and the processor executes the method by calling the machine-readable instructions.
The present application also provides a machine-readable storage medium having stored thereon machine-readable instructions which, when invoked and executed by a processor, implement the above-described method.
Through the embodiment, based on the association of the cookie and the source IP session holding table entry, the session request corresponding to the cookie is forwarded to the last accessed server through the associated source IP session holding table entry after the cookie is lost, so that session interruption is prevented, and the service continuity is ensured.
Drawings
FIG. 1 is a networking diagram of a load balancing system provided by an exemplary embodiment;
FIG. 2 is a flow diagram of a method for session processing in accordance with an illustrative embodiment;
FIG. 3 is a block diagram of a session processing apparatus provided in an exemplary embodiment;
fig. 4 is a hardware block diagram of an electronic device according to an exemplary embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
In order to make those skilled in the art better understand the technical solution in the embodiment of the present application, the following briefly describes the related art of session processing related to the embodiment of the present application.
Referring to fig. 1, fig. 1 is a networking diagram of a load balancing system according to an embodiment of the present application.
The load balancing system shown in fig. 1 includes: load balancing equipment (SLB), clients (C1, C2, C3), servers (S1, S2, S3);
the client is connected with the server for communication through the load balancing device via the network shown in fig. 1.
In implementation, a session request from a client to a server as shown in fig. 1 may be forwarded to the server selected by the load balancing algorithm through the load balancing device.
For example: the SLB may forward the session request from the C1 client to the server through load balancing S1; the SLB may forward the session request from the C2 client to the server through load balancing S2; the SLB may forward session requests from the C3 client to the server S3 through load balancing.
On the basis of the networking architecture shown above, the present application aims to propose a technical solution of session processing based on the association of a cookie with a source IP session holding entry.
When the method is realized, the load balancing system comprises load balancing equipment, a client and a server; and the client is connected with the server for communication through the load balancing equipment.
Further, the load balancing equipment receives a first session request carrying an inserted cookie of the client; creating a source IP session holding table entry corresponding to the inserted cookie of the first session request; and if a second session request which does not carry the inserted cookie and is received from the client is received, executing corresponding session processing of source IP session maintenance on the second session request based on the source IP session maintenance table entry.
In the above scheme, based on the association of the cookie and the source IP session holding entry, the session request corresponding to the cookie is forwarded to the last accessed server through the associated source IP session holding entry after the cookie is lost, so that session interruption is prevented, and service continuity is ensured.
The present application is described below with reference to specific embodiments and specific application scenarios.
Referring to fig. 2, fig. 2 is a flowchart of a session processing method according to an embodiment of the present application, where the method is applied to a load balancing device in a load balancing system, where the load balancing system further includes a client and a server; the client is connected with the server through the load balancing equipment for communication, and the method comprises the following steps:
step 202, receiving a first session request carrying an inserted cookie from the client.
Step 204, creating a source IP session holding table entry corresponding to the inserted cookie of the first session request.
Step 206, if a second session request carrying no cookie is received from the client, executing a corresponding session process of source IP session maintenance on the second session request based on the source IP session maintenance entry.
In this specification, the load balancing device may include any device integrated with a load balancing function. For example, in practical applications, the load balancing device may specifically include a switch, a router, a firewall, a server, a load balancer, and the like, which have a load balancing function.
In this specification, the client includes one or more devices that initiate a session request to the server.
For example, the client may include one or more of C1, C2, and C3 as shown in fig. 1.
In this specification, the server includes one or more devices that receive the session initiation request from the client and execute corresponding service processing.
For example, the server may include one or a combination of S1, S2, and S3 shown in fig. 1.
In this specification, the session request refers to a http (HyperText Transfer Protocol) or https (HyperText Transfer Protocol over Secure Socket Layer) service request message that is initiated by the client to the server.
For example, as shown in fig. 1, the session request may be an http-based service request message initiated from C1 to S1, or may be an https-based service request message initiated from C1 to S1.
In this specification, the load balancing system refers to an entire network system including the load balancing device, the client, and the server; and the client is connected with the server for communication through the load balancing equipment.
For example: referring to fig. 1, the load balancing system includes an SLB (the load balancing device), the client (C1, C2, C3), and the server (S1, S2, S3); and the client is connected with the server for communication through the load balancing equipment.
The following describes the technical solution related to the present application in detail by specific embodiments and in combination with "creation of cookie associated entries", "processing of a cookie lost session", and "processing of a cookie not lost session":
in this specification, the client initiates a session request to the server; the session request is forwarded to the server through the load balancing device and a preset load balancing algorithm, so that the server executes corresponding service processing for the session request.
When the method is implemented, the load balancing equipment provides the virtual service address for the client. The client may send a session request by accessing the virtual service address, and the load balancing device may distribute the session request to the server through the virtual service address.
For example, referring to fig. 1, the virtual service address of the SLB shown in fig. 1 is 100.30.5.1, and the load balancing device SLB provides a virtual service address 100.30.5.1 to the client (C1, C2, C3). The client may send a session request by accessing the virtual service address, and the load balancing device SLB may distribute the session request to the server through the virtual service address.
It should be noted that the session request from the client to the server may have various corresponding combinations, such as: C1-S1, C2-S2, C3-S3; for another example: the correspondence relationship between the clients and the session requests of the servers is not specifically limited in this description, and the clients and the servers are C1-S2, C2-S3, and C3-S1.
In this specification, after receiving the session request from the client, the server further executes service processing corresponding to the session request, and returns a session response corresponding to the session request to the client through the load balancing device.
For example, as shown in fig. 1, the client is S1, the client is C1, and S1 further executes service processing corresponding to the session request after receiving the session request of C1, and returns a session response corresponding to the session request to C1 through the load balancing device SLB.
In this specification, the inserting a cookie refers to a cookie in which the load balancing device inserts the server information of the server into a specified position in the header of the session response after receiving the session response of the server.
Continuing the example from the above example, after the load balancing device SLB receives the session response corresponding to the session request of C1 from S1, the load balancing device SLB inserts the server information of S1 (such as the IP address of S1, the server type of S1, etc.) in the form of cookie into the header specified location of the session response.
In this specification, further, after the insertion cookie is inserted into the session response, the load balancing apparatus sends the session response to the client.
Continuing with the above example, the load balancing device sends an inserted cookie carrying the server information of S1 to C1.
In this specification, the client may further acquire the inserted cookie from the load balancing device and store the inserted cookie locally, so that when the client initiates a next session request, the client may carry the inserted cookie and the load balancing device may analyze the inserted cookie in the session request to obtain server information corresponding to a previous session request in the inserted cookie, where the server information includes: the IP address of S1 so that the next session request is forwarded by the load balancing device to S1.
In this specification, the first session request refers to the session request carrying the inserted cookie from the client.
Continuing the example from the above example, the first session request may be the session request of C1 carrying the inserted cookie (the inserted cookie carrying the server information of S1).
In this specification, the load balancing device receives the first session request carrying the inserted cookie from the client.
Continuing the example from the above example, the SLB receives the session request of C1 carrying the above-mentioned insert cookie (the insert cookie carrying the server information of S1).
For ease of understanding, the following "source IP session maintenance" concept is introduced here first. In general, when load balancing is performed by the load balancing device, the source IP address of the access request is used as a main basis for allocating a corresponding server; the term "source IP session maintenance" refers to that the load balancing device distributes all access requests of a client to the same server when load balancing all access requests of the client from the same source IP address.
When the method is realized, the load balancing equipment executes the session processing of the source IP session maintenance based on the source IP session maintenance table; the source IP session holding table at least comprises a source IP address corresponding to the session request and a server IP address correspondingly allocated to the session request.
Continuing the example from the above example, the table structure and entry contents of the source IP session holding table are shown in table 1:
Figure BDA0002112307420000081
TABLE 1
Each row shown in table 1 corresponds to a source IP session holding entry in the "source IP session holding table". When load balancing is performed on the target session request with the corresponding client device C1 from the same source IP address of 10.30.5.6, the load balancing device allocates all access requests of the client device C1 to the corresponding server device S1 with the IP address of 100.30.5.6. Similarly, as shown in table 1, C2 and S2, C3 and S3 correspond to the respective source IP session holding entries.
In this specification, the source IP session holding table entry refers to a corresponding table entry in a "source IP session holding table" that is established by the load balancing device for the client and the corresponding server; the source IP session holding table entry at least includes an IP address of a server corresponding to the client.
Continuing the example from the above example, if the client is C1, the source IP session holding entry corresponding to C1 is shown in the first row of table 1, and the IP address of the server corresponding to the source IP session holding entry is 100.30.5.6 (the IP address of S1 shown in fig. 1).
Of course, in implementation, the source IP session holding table entry further includes the source IP address of the client (see the "source IP address" field shown in table 1).
In this specification, after receiving the first session request, the load balancing device creates a source IP session holding entry corresponding to the inserted cookie of the first session request.
Continuing the example from the above example, the load balancing device SLB creates a source IP session holding entry corresponding to the insert cookie (the insert cookie carrying the server information of S1) of the first session request (C1), and a source IP session holding table associated with the insert cookie, please refer to the example in table 2:
Figure BDA0002112307420000091
Figure BDA0002112307420000101
TABLE 2
The source IP session holding table shown in table 2 is modified from table 1, and table 2 is different from table 1 in that table 2 is added with an "association insert cookie" field compared to table 1, and after the field is added, each source IP session holding table entry (corresponding to one row in table 2) can associate the "source IP session holding table entry" shown in table 1 with the "insert cookie", that is, the source IP session holding table entry also stores the corresponding relationship with the insert cookie requested by the first session on the basis of the original table entry of the "source IP session holding table".
In the conventional implementation, the load balancing method based on the "source IP session holding table" and the load balancing method based on the "cookie insertion" are independent and unrelated to each other. While
In this specification, the second session request refers to the session request that does not carry the inserted cookie, of the client after the first session request.
Continuing the example from the above example, when cookie information is manually cleared (user security is guaranteed), or the life cycle of the cookie reaches a time limit, or after the cookie is automatically cleared by the system after the user closes the browser, the client sends the session request without the cookie, such as: the second session request may be the session request of C1 after the first request, which does not carry the inserted cookie (which does not carry the server information of S1).
In this specification, after the client sends the second session request, the load balancing device, upon receiving the second session request from the client, performs a session process of holding a corresponding source IP session for the second session request based on the source IP session holding entry.
Continuing the example from the above example, if the load balancing apparatus SLB receives the second session request of C1, the load balancing apparatus SLB performs the session process of the corresponding source IP session holding on the second session request based on the corresponding source IP session holding entry as shown in table 2.
In an illustrated embodiment, the load balancing device forwards the second session request to an IP address of a server corresponding to the client.
Continuing the example from the above example, the load balancing apparatus SLB forwards the above second session request of C1 to the IP address 100.30.5.6 of the server S1 corresponding to C1.
For convenience of understanding, the "aging time" is introduced here first, and since the resource of the load balancing device is limited, the number of source IP session holding entries in the source IP session holding table is also limited, and generally, the load balancing device sets the aging time corresponding to the source IP session holding entries to delete the source IP session holding entries corresponding to sessions without message interaction after the source IP session holding entries exceed the preset aging time (i.e., aging period). Such as: the aging time is 5 minutes, and within 5 minutes, if there is no message interaction in 3 sessions corresponding to 3 source IP session holding entries shown in table 2, the load balancing device deletes the 3 source IP session holding entries after 5 minutes.
In this specification, the expiration time of the inserted cookie is a life cycle of the inserted cookie.
In implementation, a cookie is inserted as a cookie by which there is a life cycle. The cookie lifetime, i.e. the expiration time of the cookie, is usually indicated by the value of the expire field in the cookie, and the cookie is valid during the lifetime and is automatically deleted beyond the lifetime; when the value of Exprire is 0 or null, it indicates that no cookie is saved when the user exits the browser (located on the client) to ensure the information security of the user. For example, the expiration time of the cookie insertion may be more than 10 minutes, more than 2 hours, more than 2 days, more than 1 month, or the like.
In this specification, after forwarding the second session request to the IP address of the server corresponding to the client, the load balancing device needs to update the aging time of the source IP session holding entry.
In an embodiment shown in the foregoing description, the load balancing device updates the aging time of the source IP session holding entry according to a preset policy; wherein the aging time is greater than the expiration time of the inserted cookie.
Continuing the example from the above example, assuming that the expiration time of the above inserted cookie is T (any length of time), the aging time of the IP session holding entry is greater than the aging time according to a preset policy, such as: the aging time of the IP session maintaining table entry is 2T + 1. After the load balancing device SLB forwards the second session request of C1 to the IP address 100.30.5.6 of the server S1 corresponding to C1, the load balancing device SLB updates the aging time of the IP session holding entry (the first row shown in table 2) corresponding to the session to 2T +1 according to the preset policy.
In this specification, the third session request refers to the session request carrying the inserted cookie of the client after the first session request.
Continuing the example from the above example, the third session request may be the session request carrying the insert cookie (the insert cookie carrying the server information of S1) of C1 after the first session request. The third session request may be the session request carrying the insert cookie (the insert cookie carrying the server information of S2) of C1 subsequent to the first session request.
In this specification, after receiving the third session request, the load balancing device may perform forwarding on the third session request based on an inserted cookie in the third session request.
In an embodiment shown in the present invention, if the load balancing device receives the third session request carrying an inserted cookie from the client, the load balancing device forwards the third session request to an IP address of a server corresponding to the inserted cookie.
Continuing to take an example from the above example, after receiving the third session request, the load balancing device may forward the third session request to the IP address of the server corresponding to the inserted cookie carried by the third session request. Such as: if the inserted cookie corresponding to the third session request carries server information of S1, the load balancing device SLB may forward the third session request to S1 shown in fig. 1; if the inserted cookie corresponding to the third session request carries server information of S2, the load balancing device SLB may forward the third session request to S2 shown in fig. 1.
In the technical scheme, based on the association of the cookie and the source IP session holding table entry, on one hand, after the cookie is lost, the session request corresponding to the cookie is forwarded to the last accessed server through the associated source IP session holding table entry, so that the session interruption is prevented, and the service continuity is ensured; on the other hand, the load balancing device can simultaneously support the forwarding of the session request based on the cookie and the session maintenance based on the source IP session, and overcomes the defect that the existing scheme can only support the forwarding of the session request based on the cookie session or the session request based on the session maintenance of the source IP session.
Fig. 3 is a block diagram of a session processing apparatus according to an exemplary embodiment of the present application. Corresponding to the embodiment of the method, the application also provides an embodiment of a session processing device, the device is applied to load balancing equipment in a load balancing system, and the load balancing system further comprises a client and a server; the client connects to the server via the load balancing device for communication, please refer to a session processing apparatus 30 illustrated in fig. 3, which includes:
a receiving module 301, configured to receive a first session request carrying an inserted cookie from the client;
a creating module 302 for creating a source IP session holding entry corresponding to the inserted cookie of the first session request;
if a second session request carrying no inserted cookie is received from the client, the session processing module 303 executes session processing of corresponding source IP session holding on the second session request based on the source IP session holding entry.
In this embodiment, the source IP session holding entry at least includes an IP address of a server corresponding to the client, and the session processing module 303 further:
and forwarding the second session request to an IP address of a server corresponding to the client.
In this embodiment, the session processing module 303 further:
updating the aging time of the source IP conversation maintaining table item according to a preset strategy; wherein the aging time is greater than an expiration time of the inserted cookie.
In this embodiment, the session processing module 303 further:
and if a third session request carrying the inserted cookie is received from the client, forwarding the third session request to the IP address of the server corresponding to the inserted cookie.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, wherein the modules described as separate parts may or may not be physically separate, and the parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the application. One of ordinary skill in the art can understand and implement it without inventive effort.
The systems, devices, modules or modules illustrated in the above embodiments may be implemented by a computer chip or an entity, or by an article of manufacture with certain functionality. A typical implementation device is a computer, which may take the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.
The embodiment of the session processing apparatus of the present application can be applied to the electronic device shown in fig. 4. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. Taking a software implementation as an example, as a logical device, the device is a machine executable instruction formed by reading a corresponding computer program instruction in a machine readable storage medium through a processor of the electronic device where the device is located and then running the computer program instruction. From a hardware aspect, as shown in fig. 4, the present application is a hardware structure diagram of an electronic device where a session processing apparatus is located, and except for the processor, the communication interface, the bus, and the machine-readable storage medium shown in fig. 4, the electronic device where the apparatus is located in the embodiment may also include other hardware according to an actual function of the electronic device, which is not described again.
Correspondingly, an embodiment of the present application further provides a hardware structure of an electronic device of the apparatus shown in fig. 3, please refer to fig. 4, and fig. 4 is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. The apparatus comprises: a communication interface 401, a processor 402, a machine-readable storage medium 403, and a bus 404; the communication interface 401, the processor 402 and the machine-readable storage medium 403 are configured to communicate with each other via a bus 404. The communication interface 401 is used for performing network communication. The processor 402 may be a Central Processing Unit (CPU), and the processor 402 may execute machine-readable instructions stored in a machine-readable storage medium 403 to implement the methods described above.
The machine-readable storage medium 403 referred to herein may be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, and the like. For example, the machine-readable storage medium may be: volatile memory, non-volatile memory, or similar storage media. In particular, the machine-readable storage medium 403 may be a RAM (random Access Memory), a flash Memory, a storage drive (e.g., a hard disk drive), a solid state disk, any type of storage disk (e.g., a compact disk, a DVD, etc.), or similar storage medium, or a combination thereof.
Up to this point, the description of the hardware configuration shown in fig. 4 is completed.
Furthermore, the present application also provides a machine-readable storage medium, such as the machine-readable storage medium 403 in fig. 4, including machine-executable instructions, which can be executed by the processor 402 in the session processing apparatus to implement the data processing method described above.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It will be understood that the present application is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.

Claims (8)

1. A conversation processing method is characterized in that the method is applied to load balancing equipment in a load balancing system, and the load balancing system further comprises a client and a server; the client is connected with the server for communication through the load balancing equipment, and the method comprises the following steps:
receiving a first session request carrying an inserted cookie of the client;
creating a source IP session holding entry corresponding to an insert cookie of the first session request, wherein the source IP session holding entry comprises an IP address of the client, an IP address of a server corresponding to the client, and the insert cookie;
if a second session request which does not carry the inserted cookie and is received from the client is received, executing corresponding session processing of source IP session maintenance on the second session request based on the source IP session maintenance table entry;
further comprising: and if a third session request carrying the inserted cookie is received from the client, forwarding the third session request to the IP address of the server corresponding to the inserted cookie.
2. The method of claim 1, wherein the source IP session holding entry comprises at least an IP address of a server corresponding to the client, and wherein performing session processing for the corresponding source IP session holding on the second session request based on the source IP session holding entry comprises:
and forwarding the second session request to an IP address of a server corresponding to the client.
3. The method of claim 2, further comprising:
updating the aging time of the source IP conversation maintaining table item according to a preset strategy; wherein the aging time is greater than an expiration time of the inserted cookie.
4. The session processing device is applied to load balancing equipment in a load balancing system, and the load balancing system further comprises a client and a server; wherein, the client is connected with the server through the load balancing device for communication, and the device comprises:
the receiving module is used for receiving a first session request carrying an inserted cookie of the client;
a creating module that creates a source IP session holding entry corresponding to an inserted cookie of the first session request, wherein the source IP session holding entry includes an IP address of the client, an IP address of a server corresponding to the client, and the inserted cookie;
a session processing module, configured to, if a second session request that does not carry an inserted cookie is received from the client, perform, based on the source IP session holding entry, a session process of corresponding source IP session holding on the second session request;
the session processing module further: and if a third session request carrying the inserted cookie is received from the client, forwarding the third session request to the IP address of the server corresponding to the inserted cookie.
5. The apparatus of claim 4, wherein the source IP session holding entry comprises at least an IP address of a server corresponding to the client, and wherein the session processing module is further to:
and forwarding the second session request to an IP address of a server corresponding to the client.
6. The apparatus of claim 5, wherein the session processing module is further to:
updating the aging time of the source IP conversation maintaining table item according to a preset strategy; wherein the aging time is greater than an expiration time of the inserted cookie.
7. An electronic device is characterized by comprising a communication interface, a processor, a memory and a bus, wherein the communication interface, the processor and the memory are connected with each other through the bus;
the memory has stored therein machine-readable instructions, the processor executing the method of any of claims 1 to 3 by calling the machine-readable instructions.
8. A machine-readable storage medium having stored thereon machine-readable instructions which, when invoked and executed by a processor, carry out the method of any of claims 1 to 3.
CN201910577047.7A 2019-06-28 2019-06-28 Session processing method and device, electronic equipment and machine-readable storage medium Active CN110233902B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910577047.7A CN110233902B (en) 2019-06-28 2019-06-28 Session processing method and device, electronic equipment and machine-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910577047.7A CN110233902B (en) 2019-06-28 2019-06-28 Session processing method and device, electronic equipment and machine-readable storage medium

Publications (2)

Publication Number Publication Date
CN110233902A CN110233902A (en) 2019-09-13
CN110233902B true CN110233902B (en) 2022-03-01

Family

ID=67857759

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910577047.7A Active CN110233902B (en) 2019-06-28 2019-06-28 Session processing method and device, electronic equipment and machine-readable storage medium

Country Status (1)

Country Link
CN (1) CN110233902B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111953700B (en) * 2020-08-18 2023-04-07 中国工商银行股份有限公司 Session keeping method and device
CN113612851A (en) * 2021-08-11 2021-11-05 山石网科通信技术股份有限公司 Remote connection method and device, storage medium and processor
CN114363397A (en) * 2021-12-14 2022-04-15 阿里巴巴(中国)有限公司 Session processing method, device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101340371A (en) * 2008-08-12 2009-01-07 杭州华三通信技术有限公司 Session keeping method and load balance apparatus
CN104811488A (en) * 2015-04-13 2015-07-29 深信服网络科技(深圳)有限公司 Load balancing equipment-based session keeping method and system and load balancing equipment
CN107360251A (en) * 2017-08-16 2017-11-17 中国工商银行股份有限公司 Method, system and the load balancing apparatus that session is kept
CN107995304A (en) * 2017-12-13 2018-05-04 杭州迪普科技股份有限公司 A kind of session keeping method and device based on cookie
CN109743357A (en) * 2018-12-13 2019-05-10 杭州迪普科技股份有限公司 A kind of successional implementation method of business access and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10778668B2 (en) * 2017-06-02 2020-09-15 Dell Products L.P. HTTP session validation module

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101340371A (en) * 2008-08-12 2009-01-07 杭州华三通信技术有限公司 Session keeping method and load balance apparatus
CN104811488A (en) * 2015-04-13 2015-07-29 深信服网络科技(深圳)有限公司 Load balancing equipment-based session keeping method and system and load balancing equipment
CN107360251A (en) * 2017-08-16 2017-11-17 中国工商银行股份有限公司 Method, system and the load balancing apparatus that session is kept
CN107995304A (en) * 2017-12-13 2018-05-04 杭州迪普科技股份有限公司 A kind of session keeping method and device based on cookie
CN109743357A (en) * 2018-12-13 2019-05-10 杭州迪普科技股份有限公司 A kind of successional implementation method of business access and device

Also Published As

Publication number Publication date
CN110233902A (en) 2019-09-13

Similar Documents

Publication Publication Date Title
CN104137511B (en) Method, equipment and client device for the dynamic select of security protocol
US9325785B2 (en) Device, system, and method for client-governed session persistency between one or more clients and servers of a data center
CN110233902B (en) Session processing method and device, electronic equipment and machine-readable storage medium
CN110166570B (en) Service session management method and device, and electronic device
CN110191031B (en) Network resource access method and device and electronic equipment
US8364124B2 (en) Methods, systems, and computer readable media for tokenization of multimedia messages
US8843758B2 (en) Migrating authenticated content towards content consumer
US8494520B2 (en) Systems and methods for providing centralized subscriber session state information
WO2019237594A1 (en) Session persistence method and apparatus, and computer device and storage medium
US8914510B2 (en) Methods, systems, and computer program products for enhancing internet security for network subscribers
US20070204031A1 (en) Storing and retrieving user context data
CN106899564A (en) A kind of login method and device
CN105592083A (en) Method and device for terminal to have access to server by using token
CN109743357B (en) Method and device for realizing service access continuity
CN110855726B (en) Communication method, device, gateway, computing device and medium
CN102857547A (en) Distributed caching method and device
CN110351364A (en) Date storage method, equipment and computer readable storage medium
CN105224541A (en) The uniqueness control method of data, information storage means and device
CN110581784B (en) Node health check method, device and equipment
CN111147235A (en) Object access method and device, electronic equipment and machine-readable storage medium
CN113179251B (en) Front-end file processing method, device, equipment and machine-readable storage medium
US11277481B1 (en) Content selection through intermediary device
CN111107142B (en) Service access method and device
CN110944037B (en) Method, computer device and storage medium for client cache change configuration
CN112637106B (en) Method and device for terminal to access website

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant