Network traffic processing method and apparatus, and electronic device
By constructing a distribution table in the distributed load balancing device based on the configuration information and mapping relationship table of the virtual server, ensuring that the network traffic of the same client is forwarded to the correct service processor, the problem of session interruption in the distributed load balancing device is solved and achieved Session retention and efficiency improvement.
Patent Information
- Application Number
- CN202410910002.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-08
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-07-08
AI Technical Summary
In distributed load balancing equipment, because the service processor may forward the traffic of the same client to different servers, the problem of session interruption has not been effectively solved.
By determining the distribution table based on the configuration information of the virtual server and the pre-built mapping relationship table, it is ensured that the network traffic of the same client is forwarded to the corresponding service processor to achieve session persistence. Specific steps include: grouping virtual servers according to their configuration information, building a mapping relationship table between virtual servers and business processors, and allocating network traffic according to the distribution table when receiving network traffic to ensure that the traffic is forwarded to the correct destination. Business processor.
It achieves session maintenance between the client and the server, improves the efficiency and accuracy of the server's processing of network traffic, avoids session interruption, and enhances the stability of the system.
Smart Images

Figure CN118869696A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of distributed technology, and in particular to a method, device and electronic device for processing network traffic. Background Art
[0002] The load balancing device maps the IP addresses of multiple real servers to the IP address of a virtual server. When the client's access reaches the load balancing device, the Virtual Server will select the server pool according to the configuration. The server pool schedules the real server according to the balancing algorithm and forwards the user's access request to the appropriate real server. One of the important functions of the load balancing device is session persistence. It can forward the client request to the same back-end server for processing based on different persistence algorithms such as source IP, destination IP (Internet Protocol), Uniform Resource Locator (URL), and small text files (cookies).
[0003] To implement the session persistence function, it is necessary to save the session persistence table entries on the load balancing device. For centralized devices, session persistence table entries are created and queried on the same CPU, while the traffic of distributed devices is distributed to different CPUs for processing, and the creation and query of session persistence table entries are also distributed on different CPUs. If the traffic of the same client is successively distributed to different CPUs for processing, the traffic initiated later will not be able to find the session persistence table entries created previously on other CPUs when querying the CPU locally, causing the session persistence to fail and resulting in the session interruption between the client and the server.
[0004] In the related art, during the communication between the client and the server, since the service processor in the distributed load balancing device may forward the traffic of the same client to different servers, resulting in session interruption, no effective solution has been proposed yet. Summary of the invention
[0005] The main purpose of this application is to provide a method, device and electronic device for processing network traffic.
[0006] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a method for processing network traffic is provided, which is applied to a distributed device, wherein the distributed device has multiple service processors and the distributed device is configured with multiple virtual servers, and the method includes: determining a diversion table based on the configuration information of the virtual server and a pre-built mapping relationship table, wherein in the mapping relationship table, virtual servers belonging to the same virtual server group are mapped to the same service processor; when receiving first network traffic sent by a client to access a first virtual server, according to the diversion table, the first network traffic is allocated to a target service processor, so that the target service processor can maintain a session between the first network traffic and the second network traffic; wherein the virtual server group to which the first virtual server belongs has a mapping relationship with the target service processor; the second network traffic is the network traffic sent by the client to access the first virtual server; or, the second network traffic is the network traffic sent by the client to access the second virtual server, and the first virtual server and the second virtual server belong to the same virtual server group.
[0007] Furthermore, a diversion table is determined based on the configuration information of the virtual server and a pre-constructed mapping relationship table, including: grouping the multiple virtual servers based on the configuration information of the multiple virtual servers to obtain N groups of virtual servers, where N is a positive integer; constructing a mapping relationship table between each group of virtual servers and the business processor in the N groups of virtual servers; and generating the diversion table based on the configuration information of the virtual servers and the mapping relationship table.
[0008] Furthermore, the configuration information includes: the association relationship between the virtual server and the service pool, the IP information of the virtual server, the port information of the virtual server and the virtual system information of the virtual server. The multiple virtual servers are grouped according to the configuration information of the multiple virtual servers to obtain N groups of virtual servers, including: grouping the virtual servers according to the association relationship between the virtual server and the service pool to obtain multiple first groups; grouping the virtual servers according to the virtual system information of the virtual server, the IP information of the virtual server and the port information of the virtual server to obtain multiple second groups; merging the groups that have intersections between the multiple first groups and the multiple second groups to obtain the N groups of virtual servers.
[0009] Furthermore, the virtual servers are grouped according to the association relationship between the virtual servers and the service pool to obtain multiple first groups, including: determining the scheduling relationship between the virtual servers and the service pool according to the association relationship; determining the first service pool that has a scheduling relationship with the multiple virtual servers according to the scheduling relationship; for each of the first service pools, grouping the virtual servers that have a scheduling relationship with the first service pool, and grouping the currently ungrouped virtual servers into one group, to obtain the multiple first groups.
[0010] Furthermore, the virtual servers are grouped according to the virtual system information of the virtual servers, the IP information of the virtual servers and the port information of the virtual servers to obtain a plurality of second groups, including: for each of the virtual servers, determining the virtual system information of the virtual server, the IP information of the virtual server and the port information of the virtual server; grouping the virtual servers with the same system information, the IP information and the port information into a group, and grouping the currently ungrouped virtual servers into a group respectively, to obtain the plurality of second groups.
[0011] Furthermore, a mapping relationship is established between each group of virtual servers in the N groups of virtual servers and a service processor, including: traversing each group of virtual servers in the N groups of virtual servers; and establishing a mapping relationship table between each group of virtual servers and a service processor of a virtual server with the least current load.
[0012] Furthermore, after generating the diversion table based on the configuration information of the virtual server and the mapping relationship table, the method also includes: when the mapping relationship table is updated, updating the diversion table, and migrating the session retention table entries in the business processor where the mapping relationship has changed; wherein the conditions triggering the update of the mapping relationship include at least one of the following: regrouping of the virtual servers when the configuration information of any of the virtual servers is updated; or a change in the state of any of the business processors, wherein the state of the business processor includes an online state and an offline state.
[0013] Furthermore, the session persistence table entries in the business processor whose mapping relationship has changed are migrated, including: for any virtual server, when the business processor having a mapping relationship with the virtual server is changed from a first business processor to a second business processor, the session persistence table entries in the first business processor are migrated to the second business processor.
[0014] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a network traffic processing device is provided, which is applied to a distributed device, wherein the distributed device has multiple service processors and the distributed device is configured with multiple virtual servers, and the device includes: a determination unit, which is used to determine a diversion table based on the configuration information of the virtual server and a pre-constructed mapping relationship table, wherein in the mapping relationship table, virtual servers belonging to the same virtual server group are mapped to the same service processor; an allocation unit, which is used to allocate the first network traffic to a target service processor according to the diversion table when receiving the first network traffic sent by the client to access the first virtual server, so that the target service processor can maintain a session between the first network traffic and the second network traffic; wherein the virtual server group to which the first virtual server belongs has a mapping relationship with the target service processor; the second network traffic is the network traffic sent by the client to access the first virtual server; or, the second network traffic is the network traffic sent by the client to access the second virtual server, and the first virtual server and the second virtual server belong to the same virtual server group.
[0015] Furthermore, the determination unit includes: a grouping subunit, used to group the multiple virtual servers according to the configuration information of the multiple virtual servers to obtain N groups of virtual servers, where N is a positive integer; a construction subunit, used to construct a mapping relationship table between each group of virtual servers and business processors in the N groups of virtual servers; and a generation subunit, used to generate the diversion table based on the configuration information of the virtual servers and the mapping relationship table.
[0016] Furthermore, the configuration information includes: the association relationship between the virtual server and the service pool, the IP information of the virtual server, the port information of the virtual server and the virtual system information of the virtual server, and the grouping subunit includes: a first grouping module, used to group the virtual servers according to the association relationship between the virtual server and the service pool to obtain multiple first groups; a second grouping module, used to group the virtual servers according to the virtual system information of the virtual server, the IP information of the virtual server and the port information of the virtual server to obtain multiple second groups; a merging module, used to merge the groups that have intersections in the multiple first groups and the multiple second groups to obtain the N groups of virtual servers.
[0017] Furthermore, the first grouping module includes: a first determination submodule, used to determine the scheduling relationship between the virtual server and the service pool based on the association relationship; a second determination submodule, used to determine the first service pool that has a scheduling relationship with multiple virtual servers based on the scheduling relationship; a first grouping submodule, used to, for each of the first service pools, group the virtual servers that have a scheduling relationship with the first service pool into a group, and group the currently ungrouped virtual servers into each group, to obtain the multiple first groups.
[0018] Furthermore, the second grouping module includes: a third determination submodule, used to determine, for each of the virtual servers, the virtual system information of the virtual server, the IP information of the virtual server and the port information of the virtual server; a second grouping submodule, used to group virtual servers with the same system information, the IP information and the port information into a group, and group currently ungrouped virtual servers into a group, to obtain the multiple second groups.
[0019] Furthermore, the construction subunit includes: a traversal module for traversing each group of virtual servers in the N groups of virtual servers; and a construction module for constructing a mapping relationship table between each group of virtual servers and the service processors of the virtual servers with the least current load.
[0020] Furthermore, the determination unit also includes: an update subunit, which is used to update the diversion table after generating the diversion table based on the configuration information of the virtual server and the mapping relationship table, and migrate the session retention table entries in the business processor where the mapping relationship has changed when the mapping relationship table is updated; wherein the conditions triggering the update of the mapping relationship include at least one of the following: regrouping of the virtual servers when the configuration information of any of the virtual servers is updated; the state of any of the business processors changes, wherein the state of the business processor includes an online state and an offline state.
[0021] Furthermore, the update subunit includes: a migration module, which is used to migrate the session retention table entries in any virtual server from the first service processor to the second service processor when the service processor having a mapping relationship with the virtual server is changed from the first service processor to the second service processor.
[0022] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a computer program product is provided, including a computer program, which, when executed by a processor, implements any one of the above-mentioned methods for processing network traffic, and which, when executed by a processor, implements the steps of the method for processing network traffic described in each embodiment of the present application.
[0023] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes stored computer instructions, wherein when the computer instructions are executed by a processor, any one of the above-mentioned methods for processing network traffic is implemented.
[0024] In order to achieve the above-mentioned purpose, according to one aspect of the present application, an electronic device is provided, including one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by one or more processors, the one or more processors implement any one of the above-mentioned methods for processing network traffic.
[0025] Through the present application, the following steps are adopted: determine the diversion table according to the configuration information of the virtual server and the pre-built mapping relationship table, wherein in the mapping relationship table, the virtual servers belonging to the same virtual server group are mapped to the same service processor; in the case of receiving the first network traffic sent by the client to access the first virtual server, the first network traffic is allocated to the target service processor according to the diversion table, so that the target service processor can maintain the session between the first network traffic and the second network traffic; wherein the virtual server group to which the first virtual server belongs has a mapping relationship with the target service processor; the second network traffic is the network traffic sent by the client to access the first virtual server; or, the second network traffic is the network traffic sent by the client to access the second virtual server, and the first virtual server and the second virtual server belong to the same virtual server group. By grouping the currently working virtual servers, a mapping relationship can be established between the grouped virtual servers and different service processors, so that when receiving the network traffic, the network traffic initiated by the same client can be forwarded to the corresponding service processor according to the mapping relationship, thereby achieving the effect of maintaining the session between the client and the server, which is conducive to improving the efficiency and accuracy of the server in processing network traffic. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0027] Figure 1 is a flow chart of a method for processing network traffic provided in accordance with Embodiment 1 of the present application;
[0028] Figure 2 This is a schematic diagram of an optional network traffic processing method provided in Example 1 of the present application. Figure 1 ;
[0029] Figure 3 This is a schematic diagram of an optional network traffic processing method provided in Example 1 of the present application. Figure 2 ;
[0030] Figure 4 This is a schematic diagram of an optional network traffic processing method provided in Example 1 of the present application. Figure 3 ;
[0031] Figure 5 This is a schematic diagram of an optional network traffic processing method provided in Example 1 of the present application. Figure 4 ;
[0032] Figure 6 This is a schematic diagram of an optional network traffic processing method provided in Example 1 of the present application. Figure 5 ;
[0033] Figure 7 This is a schematic diagram of an optional network traffic processing method provided in Example 1 of the present application. Figure 6 ;
[0034] Figure 8 is a schematic diagram of a network traffic processing device provided according to Embodiment 2 of the present application;
[0035] Fig. 9 It is a schematic diagram of an electronic device for processing network traffic provided according to Embodiment 5 of the present application. DETAILED DESCRIPTION
[0036] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0037] It should be noted that the methods and devices determined by the processing methods, devices, storage media and electronic devices of the present application documents can be used in the field of financial technology to improve the stability of session maintenance during communication between the client and the server, and can also be used in any field other than the field of financial technology. The application fields of the methods and devices determined by the processing methods, devices, storage media and electronic devices of the present application documents are not limited.
[0038] It should be noted that the user information (including but not limited to user device information, user personal information, collected data, used data, generated data, received data, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, collected information, used information, generated information, received information, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of relevant data are in compliance with the relevant laws, regulations and standards of relevant countries and regions, necessary confidentiality measures are taken, and public order and good morals are not violated, and corresponding operation entrances are provided for users to choose to authorize or refuse. For example, an interface is set between this system and relevant users or organizations. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain relevant information after receiving the consent information fed back by the aforementioned user or organization.
[0039] It should be noted that this application provides users with corresponding operation entrances for them to choose to agree or reject the automated decision-making results; if the user chooses to reject, the expert decision-making process will be entered.
[0040] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0041] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0042] For the convenience of description, some nouns or terms involved in the embodiments of the present application are explained below:
[0043] The control CPU (CCPU) is responsible for the control and management of the entire system, such as resource allocation, task scheduling, etc.
[0044] The service processor (Service CPU, hereinafter referred to as SCPU) is responsible for processing business logic, such as database transaction processing, application computing, etc.
[0045] The input / output processor (I / O CPU, hereinafter referred to as IOCPU) is responsible for communicating with external devices such as hard disks, networks, etc.
[0046] A virtual server (VS) is an instance of a management object of a load balancing device created through virtualization technology.
[0047] A service pool (SP) is a group of servers that can provide the same service and can perform load balancing and failover.
[0048] Real Server (RS) is an actual physical server that can run operating systems and applications and provide various services.
[0049] Association group: virtual servers that reference the same service pool for cross-virtual server session maintenance or are configured with the same IP or port are grouped as a group of associated virtual servers.
[0050] Mapping relationship table: records the mapping relationship between virtual servers and SCPUs.
[0051] Traffic distribution table: the correspondence between the IP or port of the virtual server and the SCPU.
[0052] Migration table: When updating the diversion table of a virtual server, for virtual servers whose mapping relationships have changed, it is necessary to migrate the session retention table, which is called the migration table.
[0053] Embodiment 1
[0054] The present invention is described below in conjunction with preferred implementation steps. Figure 1 is a flowchart of a method for processing network traffic according to the first embodiment of the present application, such as Figure 1 As shown, the method comprises the following steps:
[0055] Step S101 : determining a distribution table according to configuration information of the virtual servers and a pre-built mapping relationship table, wherein in the mapping relationship table, virtual servers belonging to the same virtual server group are mapped to the same service processor.
[0056] In the prior art, a process for maintaining a session between a client and a server can be as follows: Figure 2 As shown, Figure 2The solid line in the figure represents the access path for the first time receiving network traffic from a client. Figure 2 The dotted line in the figure represents the access path of the network traffic received from the same client later. After the client sends a request for the first time, the load balancing device creates a session persistence table entry and forwards the client's first request to the server. When the same client sends a subsequent request, the load balancing device queries the session persistence table entry and forwards the client's subsequent requests to the corresponding server based on the query result, so as to achieve the effect of uninterrupted session.
[0057] In the prior art, the session persistence function can be implemented by diverting the traffic of the same IP address to the same SCPU for processing, creating and querying the session persistence table on the SCPU. The load balancing device performs session persistence based on the Server Pool referenced by the Virtual Server, and generally supports different persistence algorithms such as source IP, destination IP, URL, and cookie. Diverting based on the source IP can only solve the problem of source IP session persistence, but cannot solve the problem of session persistence based on other information such as destination IP, URL, and cookie.
[0058] The network traffic processing method provided in the first embodiment is applied to a distributed device, wherein the distributed device has multiple service processors and the distributed device is configured with multiple virtual servers. Here, the service processor may be a board installed on the distributed device. A distributed device refers to computers, servers or other devices distributed in different geographical locations, connected through a network and working in coordination, for example, a distributed device with a load balancing function.
[0059] In the first embodiment, in order to ensure balanced processing of client traffic accessing virtual servers and avoid the problem of low network traffic processing efficiency caused by network traffic concentration, it is necessary to determine a diversion table based on the configuration information of the virtual server and the mapping relationship table between the virtual server and the service processor, so that the distributed load balancing device can forward the network traffic from the client according to the diversion table. The diversion table is used to indicate the destination service processor to which the distributed load balancing device forwards the network traffic accessing the virtual server. A virtual server group includes at least one virtual server, and a service processor is responsible for processing the network traffic accessing the virtual server in the same virtual server group.
[0060] In an optional embodiment, the configuration information of the virtual server refers to various settings and parameters required when creating and managing the virtual server. The configuration information of the virtual server includes, but is not limited to: allocation parameters of resources such as CPU, memory, hard disk space and network bandwidth, the operating system installed on the virtual server, the IP address allocation of the virtual server, the subnet mask, the default gateway and the domain name system server (Domain Name System, hereinafter referred to as DNS) and other network configurations, storage configurations such as the type, size and storage format of the virtual hard disk, firewall rules, security protocols (such as SSL / TLS), access control lists (ACLs) and other security settings, CPU and memory usage, disk I / O and other performance parameters.
[0061] Step S102, when the first network traffic sent by the client to access the first virtual server is received, the first network traffic is distributed to the target business processor according to the diversion table, so that the target business processor can maintain the session between the first network traffic and the second network traffic; wherein the virtual server group to which the first virtual server belongs has a mapping relationship with the target business processor; the second network traffic is the network traffic sent by the client to access the first virtual server; or, the second network traffic is the network traffic sent by the client to access the second virtual server, and the first virtual server and the second virtual server belong to the same virtual server group.
[0062] In the first embodiment, in order to keep the session between the client and the server uninterrupted, when the distributed load balancing device receives network traffic accessing a virtual server, the network traffic accessing the same group of virtual servers is forwarded to the business processor corresponding to the group of virtual servers according to the diversion table.
[0063] Exemplarily, when a distributed load balancing device receives first network traffic for accessing a first virtual server and second network traffic for accessing a second virtual server, and the first virtual server and the second virtual server belong to the same group of virtual servers, the business processor corresponding to the group of virtual servers is determined as the target business processor according to the diversion table, so that the first network traffic and the second network traffic are both forwarded to the target business processor through the distributed load balancing device, and the first network traffic and the second network traffic are processed by the target business processor.
[0064] In an optional embodiment, the process of the distributed load balancing device processing network traffic can be as follows: Figure 3 As shown, Figure 3 The solid line in the figure represents the forwarding path of the network traffic of virtual server VS1. Figure 3The dotted line in the figure represents the forwarding path of the network traffic of the virtual server VS2. When the network traffic initiated by the client reaches the distributed load balancing device, after IOCPU1 receives the data packet accessing the virtual server VS1, it sends the message to the specific SCPU1 (i.e., the above-mentioned target service processor) for processing according to the diversion table. SCPU1 sends the processed network traffic to IOCPU, and IOCPU forwards the network traffic according to the diversion table. The traffic of the virtual server VS1 is all processed by SCPU1. For example, when the traffic accessing the virtual server VS1 is first received, a session persistence table entry is created in SCPU1, and when the traffic accessing the virtual server VS1 is subsequently received, the session persistence table is queried in SCPU1 to implement the session persistence function of the virtual server related services.
[0065] In an optional embodiment, the process of this solution to distribute network traffic can be as follows: Figure 4 First, according to the configuration information of the virtual server (such as Figure 4 ) calculates the associated virtual servers and groups the associated virtual servers into a group to obtain the N groups of virtual servers (such as Figure 4 Then, according to the balancing principle, a mapping relationship table is established between the grouped virtual servers and SCPUs (such as Figure 4 The balancing principle is responsible for mapping the network traffic accessing the virtual server to each SCPU of the distributed device in a balanced manner, so that each SCPU can evenly process the service traffic, avoid the traffic being concentrated on certain SCPUs, and cause the waste of the processing performance of the distributed device, thereby making full use of the processing performance of the distributed device. Secondly, according to the configuration information of the virtual server (for example, IP information, port information), the relevant information of the virtual server in the mapping relationship table (for example, the name of the virtual server) is replaced to obtain the above-mentioned diversion table (such as Figure 4 Finally, the SCPU in the load balancing device forwards the received traffic according to the flow distribution table.
[0066] In summary, the network traffic processing method provided in the first embodiment of the present application determines a diversion table based on the configuration information of the virtual server and a pre-built mapping relationship table, wherein in the mapping relationship table, virtual servers belonging to the same virtual server group are mapped to the same business processor; when the first network traffic sent by the client to access the first virtual server is received, the first network traffic is distributed to the target business processor according to the diversion table, so that the target business processor can maintain a session between the first network traffic and the second network traffic; wherein the virtual server group to which the first virtual server belongs has a mapping relationship with the target business processor; the second network traffic is the network traffic sent by the client to access the first virtual server; or, the second network traffic is the network traffic sent by the client to access the second virtual server, and the first virtual server and the second virtual server belong to the same virtual server group, which solves the problem in the related technology that during the communication between the client and the server, the business processor in the distributed load balancing device may forward the traffic of the same client to different servers, resulting in session interruption. By grouping the currently working virtual servers, a diversion table can be established between the grouped virtual servers and different business processors. Therefore, when network traffic is received, the network traffic initiated by the same client can be forwarded to the corresponding business processor according to the diversion table, thereby achieving the effect of maintaining the session between the client and the server, which is beneficial to improving the efficiency and accuracy of the server in processing network traffic.
[0067] Optionally, in the network traffic processing method provided in Example 1 of the present application, a diversion table is determined based on the configuration information of the virtual server and a pre-constructed mapping relationship table, including: grouping multiple virtual servers based on the configuration information of the multiple virtual servers to obtain N groups of virtual servers, where N is a positive integer; constructing a mapping relationship table between each group of virtual servers and the business processor in the N groups of virtual servers; and generating a diversion table based on the configuration information of the virtual servers and the mapping relationship table.
[0068] In the first embodiment, in order to keep the session between the client and the server uninterrupted, the virtual servers can be grouped according to the configuration information of the virtual servers, so that a diversion table can be established according to the mapping relationship between virtual servers in different groups and different business processors, and then the network traffic accessing the virtual servers can be diverted according to the diversion table through the distributed load balancing device, thereby achieving the effect of maintaining the session between the client and the server.
[0069] Then, in order to facilitate the distributed load balancing device to forward traffic from the client, it is necessary to determine the mapping relationship between each group of virtual servers and SCPU (i.e., the above-mentioned business processor) according to the pre-built mapping relationship table, and convert the name of the virtual server in the mapping relationship table into IP information and port information according to the configuration information of the virtual server to obtain the above-mentioned diversion table, so that the IOCPU in the distributed load balancing device can forward the traffic of the client accessing the virtual server according to the diversion table, thereby realizing the session maintenance between the client and the server.
[0070] Finally, in order to maintain the session between the client and the server, when the network traffic sent by the client is received, it is necessary to forward the network traffic to the corresponding server through the SCPU of the load balancing device according to the determined diversion table, so that the traffic sent by the same client can be continuously processed by the same server.
[0071] Optionally, in the network traffic processing method provided in Example 1 of the present application, the above-mentioned configuration information includes: the association relationship between the virtual server and the service pool, the IP information of the virtual server, the port information of the virtual server and the virtual system information of the virtual server. The multiple virtual servers are grouped according to the configuration information of the multiple virtual servers to obtain N groups of virtual servers, including: grouping the virtual servers according to the association relationship between the virtual server and the service pool to obtain multiple first groups; grouping the virtual servers according to the virtual system information of the virtual server, the IP information of the virtual server and the port information of the virtual server to obtain multiple second groups; merging the groups that have intersections in the multiple first groups and the multiple second groups to obtain N groups of virtual servers.
[0072] In an optional embodiment, different grouping methods can be determined according to the configuration information of the virtual server, and then the grouping results corresponding to the different grouping methods are merged to obtain the above-mentioned N groups of virtual servers. Exemplarily, one grouping method is to group the virtual servers according to the association between the virtual servers and the service pool, and another grouping method is to group the virtual servers according to the virtual system information, IP information and port information of the virtual servers.
[0073] In an optional embodiment, the process of merging the grouping results of different grouping methods may be as follows: the grouping conditions of the above-mentioned multiple first groups may be as follows: Figure 5 As shown, the first group includes: virtual server VS1 and virtual server VS2, the second group includes: virtual server VS3, the third group includes: virtual server VS4 and virtual server VS5, the fourth group includes: virtual server VS6, and the fifth group includes: virtual server VS7 and virtual server VS8; the grouping of the above-mentioned multiple second groups can be as follows Figure 6 As shown, the first group includes: virtual server VS1 and virtual server VS4, the second group includes: virtual server VS2, the third group includes: virtual server VS3, the fourth group includes: virtual server VS5, the fifth group includes: virtual server VS6 and virtual server VS7, and the sixth group includes: virtual server VS8.
[0074] Since the virtual servers contained in each group corresponding to each grouping method may have an intersection, for example, in the above example, virtual server VS1 and virtual server VS2 need to be grouped together according to the association relationship between the virtual server and the service pool, and virtual server VS1 and virtual server VS4 need to be grouped together according to IP information and port information. The final grouping needs to meet both grouping requirements. Therefore, the two grouping results are merged, and the virtual servers with intersections are merged into one group to obtain the final N groups of virtual servers. The final grouping result, that is, the above-mentioned N groups of virtual servers can be shown in Table 1, wherein the first group includes: virtual server VS1 and virtual server VS4, the second group includes: virtual server VS2, the third group includes: virtual server VS3, the fourth group includes: virtual server VS5, the fifth group includes: virtual server VS6 and virtual server VS7, and the sixth group includes: virtual server VS8.
[0075] Table 1
[0076] Group Virtual Servers Group 1 VS1, VS2, VS4, VS5 Group 2 VS3 Group 3 VS6, VS7, VS8
[0077] Optionally, in the network traffic processing method provided in Example 1 of the present application, virtual servers are grouped according to the association relationship between the virtual servers and the service pool to obtain multiple first groups, including: determining the scheduling relationship between the virtual servers and the service pool according to the association relationship; determining the first service pool that has a scheduling relationship with multiple virtual servers according to the scheduling relationship; for each first service pool, grouping the virtual servers that have a scheduling relationship with the first service pool into a group, and grouping the currently ungrouped virtual servers into a group, to obtain multiple first groups.
[0078] Since session retention is performed in units of service pools, if two virtual servers reference the same service pool for cross-virtual server session retention, the session retention entries of the two virtual servers are shared. Therefore, the two virtual servers need to be mapped to the same SCPU.
[0079] In the first embodiment, by grouping virtual servers according to service pools that reference the same cross-virtual server session maintenance, it is possible to avoid the problem of two virtual servers establishing two identical session maintenance entries and needing to collect data synchronization means to maintain the two session maintenance entries, thereby achieving the effect of improving data processing speed and improving communication efficiency between the client and the server.
[0080] In an optional embodiment, the scheduling relationship between the virtual server and the service pool can be as shown in Table 2, wherein the service pool SP2 can schedule virtual server VS1 and virtual server VS2, and the service pool SP2 is the above-mentioned service pool maintained across virtual server sessions, and virtual server VS1 and virtual server VS2 refer to the same service pool SP2 maintained across virtual server sessions, therefore, virtual server VS1 and virtual server VS2 need to be mapped to the same SCPU. Based on Table 2, only the service pools maintained across virtual server sessions scheduled by each virtual server in Table 2 are retained to obtain Table 3, wherein SP2, SP4, and SP7 in Table 3 are the above-mentioned first service pool.
[0081] Then, the virtual servers of the first service pool with the same scheduling in Table 3 are grouped into one group to obtain the above-mentioned multiple first groups. For example, in Table 3, both virtual server VS1 and virtual server VS2 call the first service pool SP2, and virtual server VS1 and virtual server VS2 are grouped into one group. The grouping of multiple first groups can be shown in Table 4.
[0082] Table 2
[0083] Virtual Servers A pool of services that may be dispatched VS1 SP1, SP2 VS2 SP2 VS3 SP3 VS4 SP4 VS5 SP4, SP5 VS6 SP6 VS7 SP7 VS8 SP8, SP8
[0084] Table 3
[0085]
[0086]
[0087] Table 4
[0088] Group Virtual Servers Group 1 VS1, VS2 Group 2 VS3 Group 3 VS4, VS5 Group 4 VS6 Group 5 VS7, VS8
[0089] Optionally, in the network traffic processing method provided in Example 1 of the present application, virtual servers are grouped according to their virtual system information, IP information and port information, to obtain multiple second groups, including: for each virtual server, determining the virtual system information, IP information and port information of the virtual server; grouping virtual servers with the same system information, IP information and port information into one group, and grouping currently ungrouped virtual servers into one group, to obtain multiple second groups.
[0090] Since the IOCPU in the distributed load balancing device will not parse the application layer of the network traffic, the IOCPU can only preliminarily determine whether the traffic belongs to the network traffic corresponding to the virtual server through the destination IP and destination port. Therefore, it is necessary to map the virtual servers configured with the same IP and port to the same SCPU to achieve the effect of session persistence between the client and the server.
[0091] In an optional embodiment, the virtual system information, IP information and port information of different virtual servers can be as shown in Table 5, wherein the virtual system information (Virtual System, hereinafter referred to as vsys) of virtual server VS1 is virtual system 1, and the IP address, port and domain name configured by the virtual machine system of virtual server VS1 are 1.1.1.1-1.1.1.4:80domain1, and 2.2.2.2:80domain1. Then, according to Table 5, virtual servers with the same vsys, IP address and port are grouped into one group to obtain the above-mentioned multiple second groups. The grouping of multiple second groups can be as shown in Table 6, wherein VS1 and virtual server VS4 are grouped into one group, virtual server VS6 and virtual server VS7 are grouped into one group, and other virtual servers are each grouped.
[0092] Table 5
[0093]
[0094] Table 6
[0095] Group Virtual Servers Group 1 VS1, VS4 Group 2 VS2 Group 3 VS3 Group 4 VS5 Group 5 VS6, VS7 Group 6 VS8
[0096] Optionally, in the network traffic processing method provided in Example 1 of the present application, a mapping relationship is established between each group of virtual servers in N groups of virtual servers and a business processor, including: traversing each group of virtual servers in the N groups of virtual servers; and establishing a mapping relationship table between each group of virtual servers and the business processor of the virtual server with the least current load.
[0097] In an optional embodiment, the mapping relationship between virtual servers of different groups and different service processors may be determined according to a balance principle to obtain the above-mentioned mapping relationship table.
[0098] Exemplarily, there are currently 3 available service processors, namely SCPU1, SCPU2 and SCPU3, and 4 groups of virtual servers, including 3 virtual servers, 1 virtual server, 2 virtual servers and 2 virtual servers respectively. When building a mapping relationship between the 4 groups of virtual servers and the 3 service processors, traverse the first group of virtual servers, and the 3 service processors are not currently assigned a virtual server group, then a mapping relationship is established between the first group of virtual servers and SCPU1; traverse the second group of virtual servers, and the 2 service processors are not currently assigned a virtual server group, then a mapping relationship is established between the second group of virtual servers and SCPU2; traverse the third group of virtual servers, and the 1 service processor is not currently assigned a virtual server group, then a mapping relationship is established between the third group of virtual servers and SCPU3; traverse the fourth group of virtual servers, and all service processors are currently assigned a virtual server group, then it is determined that the service processors of the virtual servers with the least current load are SCPU2 and SCPU3, so as to establish a mapping relationship between the fourth group of virtual servers and SCPU2.
[0099] By establishing a mapping relationship between the business processor and the virtual server group according to the load quantity of each business processor, the received network can be forwarded to different business processors in a balanced manner, which can make more effective use of the business processor and avoid the problem of a single business processor being overloaded and reducing traffic processing efficiency. This improves the processing efficiency of network traffic and the stability of the entire system, while ensuring that requests initiated by the client can be responded to quickly, thereby achieving the effect of improving customer experience.
[0100] Optionally, in the network traffic processing method provided in Example 1 of the present application, after generating a diversion table based on the configuration information of the virtual server and the mapping relationship table, the above method also includes: when the mapping relationship table is updated, updating the diversion table, and migrating the session retention table entries in the business processor where the mapping relationship has changed; wherein the conditions triggering the update of the mapping relationship include at least one of the following: regrouping of the virtual servers when the configuration information of any virtual server is updated; the state of any business processor changes, wherein the state of the business processor includes an online state and an offline state.
[0101] In the first embodiment, since the grouping of virtual servers is related to the configuration of the virtual servers and the status of the business processor, when a change is detected in the virtual server configuration of the distributed load balancing device, or a change in the status of the business processor, it is necessary to promptly update the diversion table of the virtual server to avoid forwarding the traffic of the same client to different servers, thereby achieving the effect of improving the stability of session maintenance.
[0102] In an optional embodiment, when a change is detected in the virtual system information, IP address information and port information (i.e., the configuration information of the virtual server mentioned above) of the system information of the virtual server of the distributed load balancing device, it is necessary to obtain the change information of the configuration information of the virtual server, and use the change information of the configuration information to update the configuration information of the corresponding virtual server in the diversion table.
[0103] When a change in the state of a business processor in a distributed load balancing device is detected, it is necessary to update the mapping relationship table and the diversion table according to the changed current state of the business processor. For example, when the state of the business processor SCPU1 changes from "processing state" to "closed state", the virtual server corresponding to the business processor SCPU1 in the mapping relationship table can be mapped to other business processors according to the above-mentioned balancing principle, and the virtual system information, IP address information and port information of the system information of the virtual server originally corresponding to the business processor SCPU1 in the diversion table can be adjusted according to the new mapping relationship table, and the relevant information of the business processor SCPU1 can be deleted.
[0104] Optionally, in the network traffic processing method provided in Example 1 of the present application, the session persistence table entries in the business processor whose mapping relationship has changed are migrated, including: for any virtual server, when the business processor having a mapping relationship with the virtual server is changed from a first business processor to a second business processor, the session persistence table entries in the first business processor are migrated to the second business processor.
[0105] In an optional embodiment, if the mapping relationship table is updated, that is, the first group of virtual servers changes from being mapped to business processor SCPU1 (that is, the first business processor mentioned above) to being mapped to business processor SCPU2 (that is, the second business processor mentioned above), since the session persistence table entries of the first group of virtual servers are stored in the business processor SCPU1, it is necessary to migrate the session persistence table entries of the first group of virtual servers from business processor SCPU1 to business processor SCPU2.
[0106] In an optional embodiment, in the process of adjusting the mapping relationship table, the session retention table entries of the virtual servers that need to be migrated can be determined according to the principle of minimum change (i.e., the above-mentioned preset rules). Exemplarily, the mapping relationship before the update is that the first group of virtual servers (including virtual server VS1 and virtual server VS2) are mapped to the service processor SCPU1, and the second group of virtual servers (including virtual server VS3) are mapped to the service processor SCPU2. After the mapping relationship is updated, the second group of virtual servers can be mapped to the service processor SCPU1, so that only the session retention table entries of virtual server VS3 need to be migrated.
[0107] By determining the session persistence table entries before and after migration based on the principle of minimum change, it is possible to ensure that after the diversion table is updated, the created session persistence table entries can still be queried when the traffic is forwarded to other business processors. At the same time, it is possible to minimize the impact on existing network traffic and session persistence rules, thereby achieving the effect of improving the communication stability between the client and the server.
[0108] In an optional embodiment, the process of using the state machine to update the virtual server's traffic distribution table is as follows: Figure 7 First, according to the configuration information of the virtual server (such as Figure 7 The virtual servers are grouped according to the configuration of the Virtual Server in the virtual server group, and a mapping relationship table between the virtual server group and the service processor is determined according to the balance principle. A distribution table is obtained according to the configuration information of the virtual server and the mapping relationship table.
[0109] Then, when a change in the configuration information of the virtual server or a change in the state of the service processor is detected, the updated mapping relationship table is determined according to the balance principle, and the session retention table entries to be migrated (such as Figure 7 in the migration table).
[0110] Finally, the migration is performed according to the session retention table entry to be migrated, and the updated distribution table (such as Figure 7 The IOCPU in the load balancing device replaces the updated shunt table, so that when receiving network traffic sent by the client, the network traffic can be forwarded according to the updated shunt table.
[0111] Optionally, in the network traffic processing method provided in Example 1 of the present application, after establishing a mapping relationship between each group of virtual servers in N groups of virtual servers and a business processor, the above method also includes: creating a session persistence item table between the client and the server for each business processor.
[0112] In the first embodiment, in order to keep the session between the client and the server uninterrupted, after determining the mapping relationship between each group of virtual servers and the business processor, a session persistence table entry can be established in each business processor. Therefore, when network traffic is received, the destination server of the network traffic can be determined according to the session persistence entry table corresponding to the target business processor, thereby forwarding the network traffic of the same client to the same server, achieving the effect of uninterrupted session.
[0113] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0114] Embodiment 2
[0115] The second embodiment of the present application also provides a network traffic processing device. It should be noted that the network traffic processing device of the second embodiment of the present application can be used to execute the network traffic processing method provided in the first embodiment of the present application. The network traffic processing device provided in the second embodiment of the present application is introduced below.
[0116] Figure 8 Schematic diagram of a network traffic processing device according to Embodiment 2 of the present application. Figure 8 As shown, the device includes: a grouping unit 801, a construction unit 802, a first updating unit 803 and a processing unit 804.
[0117] Exemplarily, the determining unit 801 is used to determine a distribution table according to the configuration information of the virtual server and a pre-built mapping relationship table, wherein in the mapping relationship table, virtual servers belonging to the same virtual server group are mapped to the same service processor.
[0118] The allocation unit 802 is used to allocate the first network traffic to the target business processor according to the diversion table when receiving the first network traffic sent by the client to access the first virtual server, so that the target business processor can maintain the session between the first network traffic and the second network traffic; wherein the virtual server group to which the first virtual server belongs has a mapping relationship with the target business processor; the second network traffic is the network traffic sent by the client to access the first virtual server; or, the second network traffic is the network traffic sent by the client to access the second virtual server, and the first virtual server and the second virtual server belong to the same virtual server group.
[0119] The network traffic processing device provided in the second embodiment of the present application determines a diversion table according to the configuration information of the virtual server and a pre-constructed mapping relationship table through a determination unit 801, wherein in the mapping relationship table, virtual servers belonging to the same virtual server group are mapped to the same service processor; when the allocation unit 802 receives the first network traffic sent by the client to access the first virtual server, the allocation unit allocates the first network traffic to the target service processor according to the diversion table, so that the target service processor can maintain a session between the first network traffic and the second network traffic; wherein the virtual server group to which the first virtual server belongs has a mapping relationship with the target service processor; the second network traffic is the network traffic sent by the client to access the first virtual server; or, the second network traffic is the network traffic sent by the client to access the second virtual server, and the first virtual server and the second virtual server belong to the same virtual server group, which solves the problem in the related technology that during the communication between the client and the server, the service processor in the distributed load balancing device may forward the traffic of the same client to different servers, resulting in session interruption. By grouping the currently working virtual servers, a mapping relationship can be established between the grouped virtual servers and different business processors. Therefore, when network traffic is received, the network traffic initiated by the same client can be forwarded to the corresponding business processor according to the mapping relationship, thereby achieving the effect of maintaining the session between the client and the server, which is beneficial to improving the efficiency and accuracy of the server in processing network traffic.
[0120] Optionally, in the network traffic processing device provided in Example 2 of the present application, the determination unit 801 includes: a grouping subunit, used to group multiple virtual servers according to the configuration information of the multiple virtual servers to obtain N groups of virtual servers, where N is a positive integer; a construction subunit, used to construct a mapping relationship table between each group of virtual servers and business processors in the N groups of virtual servers; and a generation subunit, used to generate a diversion table based on the configuration information of the virtual servers and the mapping relationship table.
[0121] Optionally, in the network traffic processing device provided in Example 2 of the present application, the above-mentioned configuration information includes: the association relationship between the virtual server and the service pool, the IP information of the virtual server, the port information of the virtual server and the virtual system information of the virtual server, and the above-mentioned grouping sub-unit includes: a first grouping module, used to group the virtual servers according to the association relationship between the virtual server and the service pool to obtain multiple first groups; a second grouping module, used to group the virtual servers according to the virtual system information of the virtual server, the IP information of the virtual server and the port information of the virtual server to obtain multiple second groups; a merging module, used to merge the groups that have intersections in the multiple first groups and the multiple second groups to obtain N groups of virtual servers.
[0122] Optionally, in the network traffic processing device provided in Example 2 of the present application, the above-mentioned first grouping module includes: a first determination sub-module, used to determine the scheduling relationship between the virtual server and the service pool based on the association relationship; a second determination sub-module, used to determine the first service pool that has a scheduling relationship with multiple virtual servers based on the scheduling relationship; the first grouping sub-module, used to, for each first service pool, group the virtual servers that have a scheduling relationship with the first service pool into a group, and group the currently ungrouped virtual servers into a group, to obtain multiple first groups.
[0123] Optionally, in the network traffic processing device provided in Example 2 of the present application, the above-mentioned second grouping module includes: a third determination sub-module, used to determine the virtual system information of the virtual server, the IP information of the virtual server and the port information of the virtual server for each virtual server; a second grouping sub-module, used to group virtual servers with the same system information, IP information and port information into a group, and group currently ungrouped virtual servers into a group, to obtain multiple second groups.
[0124] Optionally, in the network traffic processing device provided in Example 2 of the present application, the above-mentioned construction sub-unit includes: a traversal module, used to traverse each group of virtual servers in N groups of virtual servers; a construction module, used to construct a mapping relationship table between each group of virtual servers and the business processors of the virtual servers with the least current load.
[0125] Optionally, in the network traffic processing device provided in Example 2 of the present application, the above-mentioned determination unit 801 also includes: an update sub-unit, which is used to update the diversion table after generating the diversion table based on the configuration information of the virtual server and the mapping relationship table, and migrate the session retention table entries in the business processor whose mapping relationship has changed when the mapping relationship table is updated; wherein the conditions for triggering the update of the mapping relationship include at least one of the following: regrouping of the virtual servers when the configuration information of any virtual server is updated; the state of any business processor changes, wherein the state of the business processor includes an online state and an offline state.
[0126] Optionally, in the network traffic processing device provided in Example 2 of the present application, the above-mentioned update sub-unit includes: a migration module, which is used to migrate the session persistence table entries in the first business processor to the second business processor for any virtual server when the business processor having a mapping relationship with the virtual server is changed from the first business processor to the second business processor.
[0127] The network traffic processing device includes a processor and a memory. The above-mentioned determination unit 801 and allocation unit 802 are stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.
[0128] The processor includes a kernel, which calls the corresponding program unit from the memory. One or more kernels can be set, and the stability of the session between the client and the server can be improved by adjusting the kernel parameters.
[0129] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0130] Embodiment 3 of the present invention provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, a method for processing network traffic is implemented.
[0131] A fourth embodiment of the present invention provides a processor, which is used to run a program, wherein the program executes a method for processing network traffic when the program is running.
[0132] like Fig. 9 As shown, embodiment 5 of the present invention provides an electronic device, the device includes a processor, a memory and a program stored in the memory and executable on the processor, and the processor implements the following steps when executing the program: determining a diversion table based on the configuration information of the virtual server and a pre-constructed mapping relationship table, wherein in the mapping relationship table, virtual servers belonging to the same virtual server group are mapped to the same service processor; upon receiving first network traffic sent by a client to access a first virtual server, allocating the first network traffic to a target service processor according to the diversion table, so that the target service processor can maintain a session between the first network traffic and the second network traffic; wherein the virtual server group to which the first virtual server belongs has a mapping relationship with the target service processor; the second network traffic is the network traffic sent by the client to access the first virtual server; or, the second network traffic is the network traffic sent by the client to access the second virtual server, and the first virtual server and the second virtual server belong to the same virtual server group.
[0133] When the processor executes the program, the following steps are also implemented: determining a diversion table based on the configuration information of the virtual server and a pre-constructed mapping relationship table, including: grouping multiple virtual servers based on the configuration information of the multiple virtual servers to obtain N groups of virtual servers, where N is a positive integer; constructing a mapping relationship table between each group of virtual servers and a business processor in the N groups of virtual servers; generating a diversion table based on the configuration information of the virtual server and the mapping relationship table.
[0134] When the processor executes the program, the following steps are also implemented: the above-mentioned configuration information includes: the association relationship between the virtual server and the service pool, the IP information of the virtual server, the port information of the virtual server and the virtual system information of the virtual server; the multiple virtual servers are grouped according to the configuration information of the multiple virtual servers to obtain N groups of virtual servers, including: grouping the virtual servers according to the association relationship between the virtual server and the service pool to obtain multiple first groups; grouping the virtual servers according to the virtual system information of the virtual server, the IP information of the virtual server and the port information of the virtual server to obtain multiple second groups; merging the groups that have intersections in the multiple first groups and the multiple second groups to obtain N groups of virtual servers.
[0135] When the processor executes the program, the following steps are also implemented: virtual servers are grouped according to the association relationship between the virtual servers and the service pool to obtain multiple first groups, including: determining the scheduling relationship between the virtual servers and the service pool according to the association relationship; determining the first service pool that has a scheduling relationship with multiple virtual servers according to the scheduling relationship; for each first service pool, the virtual servers that have a scheduling relationship with the first service pool are grouped, and the currently ungrouped virtual servers are each grouped to obtain multiple first groups.
[0136] When the processor executes the program, the following steps are also implemented: grouping the virtual servers according to the virtual system information of the virtual servers, the IP information of the virtual servers and the port information of the virtual servers to obtain multiple second groups, including: for each virtual server, determining the virtual system information of the virtual server, the IP information of the virtual server and the port information of the virtual server; grouping the virtual servers with the same system information, IP information and port information into one group, and grouping the currently ungrouped virtual servers into one group respectively, to obtain multiple second groups.
[0137] When the processor executes the program, the following steps are also implemented: a mapping relationship is established between each group of virtual servers in the N groups of virtual servers and a business processor, including: traversing each group of virtual servers in the N groups of virtual servers; and a mapping relationship table is established between each group of virtual servers and the business processor of the virtual server with the least current load.
[0138] When the processor executes the program, the following steps are also implemented: after generating the diversion table based on the configuration information of the virtual server and the mapping relationship table, the above method also includes: when the mapping relationship table is updated, updating the diversion table, and migrating the session retention table items in the business processor whose mapping relationship has changed; wherein the conditions that trigger the update of the mapping relationship include at least one of the following: regrouping of the virtual servers when the configuration information of any virtual server is updated; the state of any business processor changes, wherein the state of the business processor includes online state and offline state.
[0139] When the processor executes the program, the following steps are also implemented: migrating the session persistence table entries in the business processor whose mapping relationship has changed, including: for any virtual server, when the business processor with a mapping relationship with the virtual server is changed from a first business processor to a second business processor, migrating the session persistence table entries in the first business processor to the second business processor.
[0140] The devices in this article can be servers, PCs, PADs, mobile phones, etc.
[0141] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program that is initialized with the following method steps: determining a diversion table based on the configuration information of the virtual server and a pre-constructed mapping relationship table, wherein, in the mapping relationship table, virtual servers belonging to the same virtual server group are mapped to the same business processor; upon receiving first network traffic sent by a client to access a first virtual server, allocating the first network traffic to a target business processor according to the diversion table, so that the target business processor can maintain a session between the first network traffic and the second network traffic; wherein the virtual server group to which the first virtual server belongs has a mapping relationship with the target business processor; the second network traffic is the network traffic sent by the client to access the first virtual server; or, the second network traffic is the network traffic sent by the client to access the second virtual server, and the first virtual server and the second virtual server belong to the same virtual server group.
[0142] When executed on a data processing device, it is also suitable for executing an initialization program having the following method steps: determining a diversion table based on the configuration information of the virtual server and a pre-constructed mapping relationship table, including: grouping multiple virtual servers based on the configuration information of the multiple virtual servers to obtain N groups of virtual servers, where N is a positive integer; constructing a mapping relationship table between each group of virtual servers and a business processor in the N groups of virtual servers; generating a diversion table based on the configuration information of the virtual server and the mapping relationship table.
[0143] When executed on a data processing device, it is also suitable for executing an initialization program having the following method steps: the above-mentioned configuration information includes: the association relationship between the virtual server and the service pool, the IP information of the virtual server, the port information of the virtual server and the virtual system information of the virtual server, and multiple virtual servers are grouped according to the configuration information of the multiple virtual servers to obtain N groups of virtual servers, including: grouping the virtual servers according to the association relationship between the virtual server and the service pool to obtain multiple first groups; grouping the virtual servers according to the virtual system information of the virtual server, the IP information of the virtual server and the port information of the virtual server to obtain multiple second groups; merging the groups with intersections in the multiple first groups and the multiple second groups to obtain N groups of virtual servers.
[0144] When executed on a data processing device, it is also suitable for executing an initialization program having the following method steps: grouping virtual servers according to the association relationship between the virtual servers and the service pool to obtain multiple first groups, including: determining the scheduling relationship between the virtual servers and the service pool according to the association relationship; determining the first service pool that has a scheduling relationship with multiple virtual servers according to the scheduling relationship; for each first service pool, grouping the virtual servers that have a scheduling relationship with the first service pool, and grouping the currently ungrouped virtual servers into one group, to obtain multiple first groups.
[0145] When executed on a data processing device, it is also suitable for executing an initialization program having the following method steps: grouping virtual servers according to their virtual system information, IP information and port information to obtain multiple second groups, including: for each virtual server, determining the virtual system information, IP information and port information of the virtual server; grouping virtual servers with the same system information, IP information and port information into one group, and grouping currently ungrouped virtual servers into one group respectively, to obtain multiple second groups.
[0146] When executed on a data processing device, it is also suitable for executing an initialization program having the following method steps: building a mapping relationship between each group of virtual servers in N groups of virtual servers and a business processor, including: traversing each group of virtual servers in the N groups of virtual servers; building a mapping relationship table between each group of virtual servers and the business processor of the virtual server with the least current load.
[0147] When executed on a data processing device, it is also suitable for executing an initialization program having the following method steps: after generating a diversion table based on the configuration information of the virtual server and the mapping relationship table, the above method also includes: when the mapping relationship table is updated, updating the diversion table, and migrating the session retention table entries in the business processor where the mapping relationship has changed; wherein the conditions triggering the update of the mapping relationship include at least one of the following: regrouping of the virtual servers when the configuration information of any virtual server is updated; the state of any business processor changes, wherein the state of the business processor includes an online state and an offline state.
[0148] When executed on a data processing device, it is also suitable for executing an initialized program having the following method steps: migrating the session persistence table entries in the business processor whose mapping relationship has changed, including: for any virtual server, when the business processor having a mapping relationship with the virtual server is changed from the first business processor to the second business processor, migrating the session persistence table entries in the first business processor to the second business processor.
[0149] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0150] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0151] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0152] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0153] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0154] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0155] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0156] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0157] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0158] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A method for processing network traffic, characterized in that: Applied to a distributed device, the distributed device has multiple service processors, and the distributed device is configured with multiple virtual servers, the method includes: Determine a traffic distribution table according to the configuration information of the virtual server and a pre-built mapping relationship table, wherein in the mapping relationship table, virtual servers belonging to the same virtual server group are mapped to the same service processor; When first network traffic for accessing a first virtual server is received from a client, the first network traffic is distributed to a target business processor according to the diversion table, so that the target business processor can maintain a session between the first network traffic and the second network traffic; wherein the virtual server group to which the first virtual server belongs has a mapping relationship with the target business processor; the second network traffic is the network traffic sent by the client for accessing the first virtual server; or, the second network traffic is the network traffic sent by the client for accessing the second virtual server, and the first virtual server and the second virtual server belong to the same virtual server group.
2. The method according to claim 1, characterized in that The flow distribution table is determined according to the configuration information of the virtual server and the pre-built mapping relationship table, including: Grouping the multiple virtual servers according to the configuration information of the multiple virtual servers to obtain N groups of virtual servers, where N is a positive integer; Constructing a mapping relationship table between each group of virtual servers and a service processor in the N groups of virtual servers; The flow distribution table is generated according to the configuration information of the virtual server and the mapping relationship table.
3. The method according to claim 2, characterized in that The configuration information includes: the association relationship between the virtual server and the service pool, the IP information of the virtual server, the port information of the virtual server and the virtual system information of the virtual server. The multiple virtual servers are grouped according to the configuration information of the multiple virtual servers to obtain N groups of virtual servers, including: The virtual servers are grouped according to the association relationship between the virtual servers and the service pool to obtain a plurality of first groups; The virtual servers are grouped according to the virtual system information of the virtual servers, the IP information of the virtual servers and the port information of the virtual servers to obtain a plurality of second groups; The groups having intersections among the multiple first groups and the multiple second groups are merged to obtain the N groups of virtual servers.
4. The method according to claim 3, characterized in that The virtual servers are grouped according to the association relationship between the virtual servers and the service pool to obtain a plurality of first groups, including: Determining a scheduling relationship between the virtual server and the service pool according to the association relationship; Determine, according to the scheduling relationship, a first service pool that has a scheduling relationship with the plurality of virtual servers; For each of the first service pools, the virtual servers that have a scheduling relationship with the first service pool are grouped into one group, and the virtual servers that are not currently grouped are each grouped together to obtain the multiple first groups.
5. The method according to claim 3, characterized in that: The virtual servers are grouped according to the virtual system information of the virtual servers, the IP information of the virtual servers, and the port information of the virtual servers to obtain a plurality of second groups, including: For each of the virtual servers, determine the virtual system information of the virtual server, the IP information of the virtual server, and the port information of the virtual server; The virtual servers having the same system information, IP information and port information are grouped together, and the currently ungrouped virtual servers are grouped together to obtain the plurality of second groups.
6. The method according to claim 2, characterized in that Establishing a mapping relationship between each group of virtual servers in the N groups of virtual servers and a service processor includes: Traversing each group of virtual servers in the N groups of virtual servers; A mapping relationship table is constructed between each group of virtual servers and the service processors of the virtual servers with the least current load.
7. The method according to any one of claims 1 to 6, characterized in that: After generating the flow distribution table according to the configuration information of the virtual server and the mapping relationship table, the method further includes: When the mapping relationship table is updated, the diversion table is updated, and the session holding table entries in the service processor whose mapping relationship has changed are migrated; The conditions for triggering the updating of the mapping relationship include at least one of the following: When the configuration information of any of the virtual servers is updated, the virtual servers are regrouped; The state of any of the service processors changes, wherein the state of the service processor includes an online state and an offline state.
8. The method according to claim 7, characterized in that Migrate the session persistence table entries in the service processor whose mapping relationship has changed, including: For any virtual server, when the service processor having a mapping relationship with the virtual server is changed from a first service processor to a second service processor, the session retention table entry in the first service processor is migrated to the second service processor.
9. A network traffic processing device, characterized in that: include: A determination unit, configured to determine a traffic distribution table according to configuration information of the virtual servers and a pre-built mapping relationship table, wherein in the mapping relationship table, virtual servers belonging to the same virtual server group are mapped to the same service processor; An allocation unit is used to allocate the first network traffic sent by the client to access the first virtual server to a target business processor according to the diversion table when the first network traffic is received, so that the target business processor can maintain a session between the first network traffic and the second network traffic; wherein the virtual server group to which the first virtual server belongs has a mapping relationship with the target business processor; the second network traffic is the network traffic sent by the client to access the first virtual server; or, the second network traffic is the network traffic sent by the client to access the second virtual server, and the first virtual server and the second virtual server belong to the same virtual server group.
10. An electronic device, characterized in that: It includes one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the network traffic processing method described in any one of claims 1 to 8.
Citation Information
Patent Citations
Data packet processing method and device in LVS load balancing
CN113364660A
Server resource configuration method and device, storage medium and processor
CN115086340A
Method and system for balancing load of server
CN117812083A
Domain name resolution method and device, electronic equipment and storage medium
CN118200286A
Systems and methods for persistence across applications using a content switching server
US20210176304A1
Cited By
Configuration updating method and device, equipment, storage medium and program product
CN120710871A
