CN110166570B - Service session management method and device, and electronic device - Google Patents

Service session management method and device, and electronic device Download PDF

Info

Publication number
CN110166570B
CN110166570B CN201910483489.5A CN201910483489A CN110166570B CN 110166570 B CN110166570 B CN 110166570B CN 201910483489 A CN201910483489 A CN 201910483489A CN 110166570 B CN110166570 B CN 110166570B
Authority
CN
China
Prior art keywords
client
address
server
equipment
tcpoptions
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
CN201910483489.5A
Other languages
Chinese (zh)
Other versions
CN110166570A (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 CN201910483489.5A priority Critical patent/CN110166570B/en
Publication of CN110166570A publication Critical patent/CN110166570A/en
Application granted granted Critical
Publication of CN110166570B publication Critical patent/CN110166570B/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/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
    • 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
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Abstract

The application provides a service session management method, a service session management device, electronic equipment and a machine-readable storage medium. In the application, a target service message initiated by the client device is received; analyzing the target service message to obtain a client IP address corresponding to the client equipment; using the IP address of the client as a search index, and searching whether a matched service session exists in a preset source IP address session holding table; if yes, distributing target server-side equipment corresponding to the IP address of the client-side based on the matched service session; so that the target server side equipment executes corresponding service processing aiming at the target service message; the load balancing equipment can rapidly acquire the IP address of the client at the TCP layer, so that the IP address of the client does not need to be acquired at an OSI application layer any more, the pressure of the client and the server is reduced, and the efficiency of a load balancing system is improved.

Description

Service session management method and device, and electronic device
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method and an apparatus for managing a service session, an electronic device, and a machine-readable storage medium.
Background
Load Balance (LB) is a clustering technique for servers or network devices. The load balancing device shares the specific service request to a plurality of servers or network devices connected with the load balancing device for communication, thereby improving the service processing capacity and ensuring the high availability of the service.
For example, in implementation, a server set may be formed by a plurality of servers in a symmetric manner, and each server in the server set has an equivalent status and can provide business services separately without the assistance of other servers; through the load balancing technology, the service request which is targeted to be responsible for the server set is uniformly distributed to one server in the server set, so that the server receiving the service request independently responds to the request of the client. Based on the load balancing technology, the client requests can be evenly distributed to the server array, important data can be rapidly acquired, and the problem of massive concurrent access service is solved.
NAT (Network Address Translation) is a Network technology for always converting Network addresses, and is essential to convert an intranet IP Address of a message into a public IP Address. In implementation, an internal IP address is used in an internal node of an internal network (e.g., a local area network), and when the internal node is to communicate with an external public network (e.g., the internet), the internal IP address in a message needs to be replaced by a public network IP address set by a NAT gateway on a NAT gateway from the internal network to the external public network, so that a plurality of internal nodes of the internal network can share one public network IP address to communicate with the external public network, thereby solving the problem of shortage of public network IP addresses.
Disclosure of Invention
The application provides a business session management method, which is applied to load balancing equipment in a load balancing system, wherein the load balancing system also comprises client equipment, a plurality of server equipment and intermediate network equipment; the client device is connected with the plurality of server devices for communication through the intermediate network device and the load balancing device, and the method comprises the following steps:
receiving a target service message initiated by the client equipment;
analyzing the target service message to obtain a client IP address corresponding to the client equipment;
using the client IP address as a search index, and searching whether a matched service session exists in a preset source IP address session holding table; if yes, distributing target server equipment corresponding to the IP address of the client based on the matched service session; and the target server side equipment executes corresponding service processing aiming at the target service message.
Optionally, the parsing the target service packet to obtain the client IP address corresponding to the client device includes:
Performing message analysis on the target service message based on a TCP (transmission control protocol), and acquiring a TCP field corresponding to the target service message and corresponding content of the TCP field;
determining that the target service message carries a tcpOptions field from the TCP protocol field;
acquiring tcpOptions content corresponding to the tcpOptions field; wherein the tcpOptions content includes at least the client IP address.
Optionally, the tcpOptions content further includes a kind field; wherein the kind field is used to indicate that the tcpopoperations content carries the client IP address, and the obtaining of the tcpopoperations content corresponding to the tcpopoperations field includes:
checking whether the corresponding content of the kind field in the tcpOptions content is the same as a preset value or not; and if the contents are the same, further acquiring that the contents of tcpOptions comprise the IP address of the client.
Optionally, the method further includes:
if the service session matched with the IP address of the client does not exist in the source IP address session holding table, selecting new server equipment from the plurality of server equipment based on a preset scheduling algorithm; so that the new server device executes corresponding service processing for the target service packet;
And adding a session table item corresponding to the client IP address and the new server device in the source IP address session holding table.
The application also provides a service session management device, which is applied to load balancing equipment in a load balancing system, wherein the load balancing system further comprises client equipment, a plurality of server equipment and intermediate network equipment; wherein, the client device is connected with the plurality of server devices through the intermediate network device and then through the load balancing device for communication, the apparatus includes:
the receiving module is used for receiving a target service message initiated by the client equipment;
the analysis module is used for analyzing the target service message to obtain a client IP address corresponding to the client equipment;
the distribution module is used for searching whether a matched service session exists in a preset source IP address session holding table by taking the IP address of the client as a search index; if yes, distributing target server equipment corresponding to the IP address of the client based on the matched service session; and the target server side equipment executes corresponding service processing aiming at the target service message.
Optionally, the destination service packet is a TCP packet carrying a tcpopotions field, and the parsing module further:
performing message analysis on the target service message based on a TCP (transmission control protocol), and acquiring a TCP field corresponding to the target service message and corresponding content thereof;
determining that the target service message carries a tcpOptions field from the TCP protocol field;
acquiring tcpOptions content corresponding to the tcpOptions field; wherein the tcpOptions content includes at least the client IP address.
Optionally, the tcpopoperations content further includes a kid field; wherein the kind field is used to indicate that the tcpopactions content carries the client IP address, and the parsing module further:
checking whether the corresponding content of the kind field in the tcpOptions content is the same as a preset value or not; and if the contents are the same, further acquiring that the contents of tcpOptions comprise the IP address of the client.
Optionally, the allocation module further:
if the service session matched with the IP address of the client does not exist in the source IP address session holding table, selecting new server equipment from the plurality of server equipment based on a preset scheduling algorithm; so that the new server device executes corresponding service processing for the target service packet;
And adding a session table item corresponding to the client IP address and the new server device in the source IP address session holding table.
The memory stores machine-readable instructions that the processor executes by invoking to perform the above-described method.
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.
By the embodiment, the load balancing equipment can quickly acquire the IP address of the client on a TCP layer based on the self-defined use of the TCP messages tcpOptions field; allocating server equipment for maintaining the service session corresponding to the client based on the IP address of the client and the source IP address session maintaining table so as to enable the server equipment to execute corresponding service session maintaining processing; therefore, the IP address of the client does not need to be acquired at an OSI application layer, the pressure of the client and the server is reduced, and the efficiency of the load balancing system is improved.
Drawings
FIG. 1 is a networking diagram of a load balancing system provided by an exemplary embodiment;
FIG. 2 is a flow chart of a method for service session management provided by an exemplary embodiment;
FIG. 3 is a block diagram of a business session management 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, a brief description will be given below to the related art of service session maintenance 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 disclosure. The load balancing system shown in fig. 1 includes: a plurality of server devices (S1, S2, S3), client devices (C1, C2, C3), load balancing devices (SLB), and intermediate network devices;
the client device is connected with the plurality of server devices for communication through the intermediate network device and the load balancing device.
In implementation, as shown in fig. 1, the client device may forward, by the load balancing device, a service packet to the plurality of server devices through load balancing, the server device corresponding to the service packet.
For example: the SLB may forward the service packet from the C1 client device to the server device through load balancing S1; the SLB may forward the service packet from the C2 client device to the server device through load balancing S2; the SLB may forward the traffic message from the C3 client device to the server device through load balancing S3.
On the basis of the networking architecture shown above, the present application aims to provide a technical scheme for quickly acquiring an IP address of a client on a TCP layer based on a TCP packet tcpopoptions field, and maintaining a service session based on the client IP address.
When the method is implemented, the load balancing equipment receives a target service message initiated by the client equipment; analyzing the target service message to obtain a client IP address corresponding to the client equipment; using the IP address of the client as a search index, and searching whether a matched service session exists in a preset source IP address session holding table; if yes, distributing target server equipment corresponding to the IP address of the client based on the matched service session; and the target server side equipment executes corresponding service processing aiming at the target service message.
In the scheme, based on the self-defined use of the TCP message tcpopoperations field, the load balancing device can quickly acquire the IP address of the client on the TCP layer; allocating server equipment for maintaining the service session corresponding to the client based on the IP address of the client and the source IP address session maintaining table so as to enable the server equipment to execute corresponding service session maintaining processing; therefore, the IP address of the client does not need to be acquired at an OSI application layer, the pressure of the client and the server is reduced, and the efficiency of the load balancing system is improved.
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 service session management 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 device, a plurality of server devices, and an intermediate network device; wherein, the client device is connected with the plurality of server devices for communication through the intermediate network device and the load balancing device, the method comprises the following steps:
step 202, receiving a target service packet initiated by the client device.
And 204, analyzing the target service message to obtain a client IP address corresponding to the client equipment.
Step 206, using the client IP address as a search index, and searching a preset source IP address session holding table for whether a matched service session exists; if yes, distributing target server-side equipment corresponding to the IP address of the client-side based on the matched service session; and the target server side equipment executes corresponding service processing aiming at the target service message.
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 device and the server device are a pair of devices having a request and service relationship.
For example: the Client device may be a Client in a C/S (Client/Server) architecture, and the Server device may be a Server in the C/S (Client/Server) architecture.
Of course, the client device and the Server device may be a pair of devices based on a Browser/Server (B/S) architecture.
In this specification, the intermediate network device refers to one or more network devices located between the client device and the load balancing device, and corresponding to a network path through which the client device and the plurality of server devices perform traffic communication.
In this specification, the target service packet refers to a TCP packet carrying a TCP operation field; the target service message is from the client device connected with the load balancing device, passes through the intermediate network device, is subjected to load balancing by the load balancing device, and is forwarded to a corresponding server device in the plurality of server devices, so that the server device performs corresponding service processing on the target service message.
The following describes in detail the technical solutions related to the present application by specific embodiments and in combination with "client IP address acquisition" and "service session maintenance processing":
1) client IP address acquisition
In this specification, the client device initiates a target service packet to the corresponding server device.
For example: the client device (e.g., C1 shown in fig. 1) initiates a target service packet to the corresponding server device (e.g., S1 shown in fig. 1).
The client devices (e.g., C1 and C2 shown in fig. 1) and the server devices (e.g., S1, S2 and S3 shown in fig. 1) may be combined in various ways, and are not limited in this description.
In this specification, further, the load balancing device receives a target service packet initiated by the client device.
Continuing with the above example, the load balancing device receives the target traffic packet initiated by the client device C1 and sent to the server device S1.
In this specification, after receiving a target service packet initiated by the client device, the load balancing device parses the target service packet to obtain a client IP address corresponding to the client device.
For example, continuing the example from the above example, after the load balancing device receives a target service packet initiated by the client device C1 and addressed to the server device S1, the load balancing device parses the target service packet to obtain a client IP address corresponding to the client device C1, such as: the client IP address of client device C1 is 10.30.5.6.
It should be noted that, since the IP address of the client is the real IP address of the client, in the process of forwarding the target service packet to the load balancing device through the intermediate network device, in the existing implementation, the source IP address in the target service packet is usually changed to the IP address processed by the NAT rule on the intermediate network device, so that the load balancing device cannot obtain the real IP address of the client. Certainly, the load balancing device may obtain the real IP address of the client by adding the real IP address of the client to the HTTP request based on an X-Forwarded-For technology.
In an embodiment shown in the present disclosure, the load balancing device performs packet parsing on the target service packet based on a TCP protocol, and obtains a TCP protocol field corresponding to the target service packet and corresponding content thereof.
For example, in implementation, the load balancing device performs packet parsing on the target service packet based on a TCP protocol, and obtains a TCP protocol field corresponding to a TCP header of the target service packet and corresponding content of the TCP header.
It should be noted that in the TCP protocol, the TCP header generally consists of a fixed length of 20 bytes of data content and a maximum of 40 bytes of variable length data content; the content of the fixed-length 20-byte data is relatively fixed, and mainly includes fields such as a TCP source port, a TCP destination port, a TCP sequence number, a TCP acknowledgement number, and the like, which are specifically referred to a TCP protocol document and are not described herein again; the variable-length data content, that is, the tcpopactions content corresponding to the tcpopactions field, is customizable by the user.
In this specification, further, the load balancing device determines, from the TCP protocol field, that the target service packet carries a tcpopotions field.
For example, in implementation, after performing packet parsing on the target service packet, the load balancing device finds a tcpopotions field from a parsed TCP protocol field.
In this specification, further, after finding the tcpopoperations field corresponding to the target service packet, the load balancing device obtains tcpopoperations content corresponding to the tcpopoperations field; wherein, the tcpOptions content at least comprises the client IP address.
For example, as shown in fig. 1, the content of tcpopactions corresponding to the tcpopactions field in the target service message from the client device C1 to the server device S1 is the client IP address of the client device C1 of 10.30.5.6, and the load balancing device obtains the content of tcpopactions, so as to obtain the client IP address of the client device C1.
It should be noted that, the location of the IP address of the client in the tcppocations content is not specifically limited, for example: the client IP address may be at the head or tail of the tcpopoptions content.
In an embodiment shown, the tcpopactions further includes a kid field; wherein, the kind field is used for indicating that the tcpOptions content carries the client IP address.
For example, in implementation, the kid content corresponding to the kid field may be a custom value. The tcpopoperations field structure and its content are shown in table 1, for example:
kind field Client IP address
28 10.30.5.6
TABLE 1
As shown in table 1, the tcppocations field includes a kind field and a client IP address; wherein, the kind content corresponding to the kind field is 28, and the IP address of the client is 10.30.5.6.
It should be noted that the kind content cannot be a defined usage value in the TCP protocol, for example, the kind content is 28, which is different from a defined usage type value (for example, 1, 2, 3.. 8) in the TCP protocol, and thus, by using the kind content as 28, it can be distinguished whether tcpopoperations carried by the target service packet is the tcpopoperations containing the IP address of the client or tcpopoperations corresponding to the defined kind type value in the TCP protocol.
Of course, the tcpOptions content can also follow the TLV (Tag, type; Length, Length; Value) format; on the basis of table 1, a Length field may be added to indicate the data Length of the tcpopactions content. It should be noted that the TLV format is a data format in which the data content is variable in length, that is, the length of the tcpopactions content is variable.
In an illustrated embodiment, after acquiring corresponding content of a kind field in the tcpopoptions field, the load balancing device checks whether the corresponding content of the kind field in the tcpopoptions content is the same as a preset value; if the two contents are the same, the contents of tcpOptions including the IP address of the client are further acquired.
For example, the load balancing device checks that the content corresponding to the kind field in the tcpopops content is, for example, the content 28 corresponding to the kind field shown in table 1, and if the content is the same as a preset value (for example, 28), the load balancing device further obtains the client IP address (for example, 10.30.5.6 shown in table 1) included in the tcpopops content.
It should be noted that, if the corresponding content (for example, 1) of the kid field in the tcpopops content of the destination service packet is different from the preset value (for example, 28), it indicates that the tcpopops carried by the destination service packet is the tcpopops of the existing kid type defined by the TCP protocol.
2) Business session holding process
For ease of understanding, the following "source IP address session maintenance" concept is introduced. Under normal conditions, when load balancing is carried out by the load balancing equipment, the source IP address of the access request is used as a main basis for distributing the corresponding server; the term "source IP address session maintenance" refers to that when load balancing is performed on all access requests from clients with the same source IP address, the load balancing device distributes all access requests of the clients to the same server.
In this specification, the source IP address session holding table refers to a session service table that is used by the load balancing device to perform "source IP address session holding" on the target service packet.
When the method is realized, the source IP address conversation keeping table at least comprises a source IP address corresponding to the service message and a server IP address correspondingly distributed to the service message.
For example, the table structure and the entry content of the session holding table of the source IP address are shown in table 2:
Figure GDA0003543776820000111
TABLE 2
As shown in table 2, when the load balancing device performs load balancing on the target service packet of C1 from the corresponding client device of the same source IP address 10.30.5.6, each behavior corresponds to a service session corresponding to the source IP address session holding table, and all access requests of the client device C1 are allocated to the corresponding server device S1 with an IP address 100.30.5.6. Similarly, as shown in table 2, C2 and S2, and C3 and S3 respectively correspond to the service session entries.
It should be noted that table 2 is only one possible example, and in an actual load balancing system, there are many possible combinations of the correspondence between the client device and the server device, which is not specifically limited in this specification.
In this specification, after obtaining a client IP address corresponding to the client device, the load balancing system searches, using the client IP address as a search index, in a preset source IP address session holding table, whether a matching service session exists; if yes, distributing target server equipment corresponding to the IP address of the client based on the matched service session; and the target server-side equipment executes corresponding service processing aiming at the target service message.
For example, in implementation, the client device is C1 shown in fig. 1, the load balancing system looks up the source IP address session holding table shown in table 2 with the client IP address 10.30.5.6 of C1 as a lookup index, determines that a service session entry matching 10.30.5.6 (corresponding to the first service session in table 2) exists, and further allocates a target server device S1 with the IP address 100.30.5.6 corresponding to the client IP address 10.30.5.6 of C1 according to the matching service session. So that S1 performs corresponding service processing on the target service packet.
In this specification, after the load balancing device finds a target service end device corresponding to the client in the source IP address session holding table, the load balancing device forwards the target service packet to the target service end device, so that the target service end device performs corresponding service processing on the target service packet.
Continuing with the above example, the load balancing device forwards the target service packet from C1 to the corresponding target server device S1, so that S1 performs corresponding service processing on the target service packet.
In an embodiment shown in the foregoing description, if there is no service session matching with the IP address of the client in the source IP address session holding table, the load balancing device selects a new server device from the multiple server devices based on a preset scheduling algorithm; and the new server-side equipment executes corresponding service processing aiming at the target service message.
For example, in implementation, the table structure and the entry content of the session holding table of the source IP address are shown in table 3:
Figure GDA0003543776820000121
TABLE 3
The load balancing device selects a new server device (for example, S1) from the plurality of server devices (S1, S2, S3) shown in fig. 1 based on a preset scheduling algorithm; so that S1 performs corresponding service processing on the target service packet.
It should be noted that, the scheduling algorithm is an algorithm used by the load balancing device to select a corresponding server device from the plurality of server devices for the client device corresponding to the target service packet, and the type of the scheduling algorithm may be multiple, for example, a scheduling algorithm based on polling or a scheduling algorithm with weighted polling, and the type of the scheduling algorithm is not specifically limited in this specification.
In this specification, after the load balancing device selects the new server device from the plurality of server devices based on the scheduling algorithm, the load balancing device further adds a session entry corresponding to the client IP address and the new server device in the source IP address session holding table.
For example, in implementation, the client device is C1 shown in fig. 1, the load balancing device is C1, and selects a new server device S1 from a plurality of server devices (S1, S2, S3) shown in fig. 1, and the load balancing device adds a new service session table entry in the source IP address session holding table shown in table 3, for example, where the session table entry includes the IP address of the C1 client and the IP address of S1 corresponding to C1; after the service session entry is newly added, the entry content of the source IP address session holding table is updated from table 3 to table 2.
In this specification, further, after the load balancing device selects the corresponding new server device for the client through the scheduling algorithm, the load balancing device forwards the target service packet to the new server device, so that the new server device performs corresponding service processing on the target service packet.
For example, the load balancing device forwards the target service packet from C1 to a corresponding new server device S1, so that S1 performs corresponding service processing on the target service packet.
In the technical scheme, the load balancing equipment can quickly acquire the IP address of the client at a TCP layer based on the self-defined use of the tcpOptions field of the TCP message; allocating server equipment for maintaining the service session corresponding to the client based on the IP address of the client and the source IP address session maintaining table so as to enable the server equipment to execute corresponding service session maintaining processing; therefore, the IP address of the client does not need to be acquired at an OSI application layer, the pressure of the client and the server is reduced, and the efficiency of the load balancing system is improved.
Fig. 3 is a block diagram of a service session management 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 service session management device, the device is applied to load balancing equipment in a load balancing system, and the load balancing system further comprises client equipment, a plurality of server equipment and intermediate network equipment; please refer to a service session management apparatus 30 illustrated in fig. 3, in which the client device is connected to the server devices via the intermediate network device and then via the load balancing device for communication, the apparatus includes:
A receiving module 301, configured to receive a target service packet initiated by the client device;
the analysis module 302 is used for analyzing the target service message to obtain a client IP address corresponding to the client equipment;
the allocating module 303 searches whether a matching service session exists in a preset source IP address session holding table by using the client IP address as a search index; if yes, distributing target server-side equipment corresponding to the IP address of the client-side based on the matched service session; and the target server side equipment executes corresponding service processing aiming at the target service message.
In this embodiment, the target service packet is a TCP packet carrying a tcppocations field, and the parsing module 302 further:
performing message analysis on the target service message based on a TCP (transmission control protocol), and acquiring a TCP field corresponding to the target service message and corresponding content of the TCP field;
determining that the target service message carries a tcpOptions field from the TCP protocol field;
acquiring tcpOptions content corresponding to the tcpOptions field; wherein the tcpOptions content includes at least the client IP address.
In this embodiment, the tcpOptions content further includes a kind field; wherein the kind field is used to indicate that the tcppocations content carries the client IP address, and the parsing module 302 further:
Checking whether the corresponding content of a kid field in the tcpOptions content is the same as a preset value or not; if the two contents are the same, further acquiring that the contents of tcpOptions comprise the IP address of the client.
In this embodiment, the allocating module 303 further:
if the service session matched with the IP address of the client does not exist in the source IP address session holding table, selecting new server equipment from the plurality of server equipment based on a preset scheduling algorithm; so that the new server-side equipment executes corresponding service processing aiming at the target service message;
and adding a session table item corresponding to the client IP address and the new server device in the source IP address session holding table.
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 service session management 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 level, as shown in fig. 4, the present application is a hardware structure diagram of an electronic device where a service session management apparatus is located, 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 all configured to communicate with each other via a bus 404. The communication interface 401 is used for performing network communication. Processor 402 may be a Central Processing Unit (CPU) and processor 402 may execute machine-readable instructions stored in 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.
Further, the present application provides a machine-readable storage medium, such as machine-readable storage medium 403 in fig. 4, including machine-executable instructions, which can be executed by processor 402 in the data 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 a preferred embodiment of the present application and should not be taken as limiting the present application, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (8)

1. A business conversation management 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 client equipment, a plurality of server equipment and intermediate network equipment; the client device is connected with the plurality of server devices through the intermediate network device and the load balancing device for communication, and the method comprises the following steps:
receiving a target service message initiated by the client device;
the target service message is a TCP message carrying a tcpOptions field;
performing message analysis on the target service message based on a TCP (transmission control protocol), and acquiring the TCP field machine content corresponding to the target service message;
determining that the target service message carries a tcpOptions field from the TCP protocol field;
acquiring tcpOptions content corresponding to the tcpOptions field; wherein the tcpOptions content includes at least a client IP address corresponding to the client device;
Using the client IP address as a search index, and searching whether a matched service session exists in a preset source IP address session holding table; if yes, distributing target server-side equipment corresponding to the IP address of the client-side based on the matched service session; and the target server-side equipment executes corresponding service processing aiming at the target service message.
2. The method of claim 1, wherein the tcpopactions content further comprises a kind field; wherein the kind field is used to indicate that the tcpopoperations content carries the client IP address, and the obtaining of the tcpopoperations content corresponding to the tcpopoperations field includes:
checking whether the corresponding content of the kind field in the tcpOptions content is the same as a preset value or not; and if the contents are the same, further acquiring that the contents of tcpOptions comprise the IP address of the client.
3. The method of claim 1, further comprising:
if the service session matched with the IP address of the client does not exist in the source IP address session holding table, selecting new server equipment from the plurality of server equipment based on a preset scheduling algorithm; so that the new server device executes corresponding service processing for the target service packet;
And adding a session table item corresponding to the client IP address and the new server device in the source IP address session holding table.
4. A business conversation management device is characterized in that the device is applied to load balancing equipment in a load balancing system, and the load balancing system further comprises client equipment, a plurality of server equipment and intermediate network equipment; wherein, the client device is connected with the plurality of server devices through the intermediate network device and then through the load balancing device for communication, the apparatus includes:
the receiving module is used for receiving a target service message initiated by the client equipment;
the target service message is a TCP message carrying a tcpOptions field;
the analysis module is used for executing message analysis on the target service message based on a TCP (transmission control protocol) protocol to obtain the TCP protocol field machine content corresponding to the target service message;
determining that the target service message carries a tcpOptions field from the TCP protocol field;
acquiring tcpOptions content corresponding to the tcpOptions field; wherein the tcpOptions content includes at least a client IP address corresponding to the client device;
The distribution module is used for searching whether a matched service session exists in a preset source IP address session holding table by taking the IP address of the client as a search index; if yes, distributing target server equipment corresponding to the IP address of the client based on the matched service session; and the target server side equipment executes corresponding service processing aiming at the target service message.
5. The apparatus of claim 4, wherein the tcpOptions content further comprises a kind field; wherein the kind field is used to indicate that the tcpOptions content carries the client IP address, and the parsing module further:
checking whether the corresponding content of the kind field in the tcpOptions content is the same as a preset value or not; and if the contents are the same, further acquiring that the contents of tcpOptions comprise the IP address of the client.
6. The apparatus of claim 4, wherein the assignment module is further to:
if the service session matched with the IP address of the client does not exist in the source IP address session holding table, selecting new server equipment from the plurality of server equipment based on a preset scheduling algorithm; so that the new server device executes corresponding service processing for the target service packet;
And adding a session table item corresponding to the client IP address and the new server device in the source IP address session holding table.
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.
CN201910483489.5A 2019-06-04 2019-06-04 Service session management method and device, and electronic device Active CN110166570B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910483489.5A CN110166570B (en) 2019-06-04 2019-06-04 Service session management method and device, and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910483489.5A CN110166570B (en) 2019-06-04 2019-06-04 Service session management method and device, and electronic device

Publications (2)

Publication Number Publication Date
CN110166570A CN110166570A (en) 2019-08-23
CN110166570B true CN110166570B (en) 2022-06-28

Family

ID=67627705

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910483489.5A Active CN110166570B (en) 2019-06-04 2019-06-04 Service session management method and device, and electronic device

Country Status (1)

Country Link
CN (1) CN110166570B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111147598B (en) * 2019-12-30 2023-04-25 杭州迪普科技股份有限公司 HTTP message processing method and device
CN111800423A (en) * 2020-07-06 2020-10-20 中国工商银行股份有限公司 Method, system, computing device and medium for processing IP address
CN111953770B (en) * 2020-08-07 2022-11-25 平安科技(深圳)有限公司 Route forwarding method and device, route equipment and readable storage medium
CN112671698A (en) * 2020-08-17 2021-04-16 紫光云技术有限公司 Method for preventing WAF from being bypassed in public cloud environment
CN113612851A (en) * 2021-08-11 2021-11-05 山石网科通信技术股份有限公司 Remote connection method and device, storage medium and processor
CN114024968B (en) * 2021-08-20 2023-05-26 绿盟科技集团股份有限公司 Message sending method and device based on intermediate equipment and electronic equipment
CN114268615B (en) * 2021-12-24 2023-08-08 成都知道创宇信息技术有限公司 Service processing method and system based on TCP connection
CN114928661A (en) * 2022-05-31 2022-08-19 杭州迪普科技股份有限公司 Session keeping method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101296238A (en) * 2008-06-17 2008-10-29 杭州华三通信技术有限公司 Method and equipment for remaining persistency of security socket layer conversation
CN102255932A (en) * 2010-05-20 2011-11-23 百度在线网络技术(北京)有限公司 Load balancing method and load equalizer
CN107070983A (en) * 2017-01-23 2017-08-18 天地融科技股份有限公司 A kind of load-balancing method, equipment and system forwarded based on address

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101296238A (en) * 2008-06-17 2008-10-29 杭州华三通信技术有限公司 Method and equipment for remaining persistency of security socket layer conversation
CN102255932A (en) * 2010-05-20 2011-11-23 百度在线网络技术(北京)有限公司 Load balancing method and load equalizer
CN107070983A (en) * 2017-01-23 2017-08-18 天地融科技股份有限公司 A kind of load-balancing method, equipment and system forwarded based on address

Also Published As

Publication number Publication date
CN110166570A (en) 2019-08-23

Similar Documents

Publication Publication Date Title
CN110166570B (en) Service session management method and device, and electronic device
US10911549B2 (en) Proxy routing based on path headers
US8737210B2 (en) Load balancing SCTP associations using VTAG mediation
RU2464722C2 (en) Method, device and system for distribution of messages
EP1436957B1 (en) Network location management system
CN109040243B (en) Message processing method and device
US20200120031A1 (en) Stateless distributed load-balancing
CN109525684B (en) Message forwarding method and device
US11202252B2 (en) Inclusion of a message proxy in a service based architecture
CN110012118B (en) Method and controller for providing Network Address Translation (NAT) service
EP2824872A1 (en) Host providing system and communication control method
WO2023124309A1 (en) Cloud native upf signaling plane load balancing selection method and system
US10178033B2 (en) System and method for efficient traffic shaping and quota enforcement in a cluster environment
CN110233902B (en) Session processing method and device, electronic equipment and machine-readable storage medium
CN112738288A (en) DNS domain name resolution method, DNS server, GSLB system and domain name resolution system
CN109413224B (en) Message forwarding method and device
CN109246024B (en) Method, device, terminal equipment and storage medium for load sharing in networking
EP2719118B1 (en) Routing by resolution
CN114785733B (en) Method for realizing session tracing in cross-VPC network flow forwarding
CN107547382B (en) Neighbor relation discovery method and device
CN112929277B (en) Message processing method and device
CN107547687B (en) Message transmission method and device
CN113132273A (en) Data forwarding method and device
CN109618014B (en) Message forwarding method and device
CN112688985B (en) Communication method and device

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