Load balancing method and device, electronic equipment and readable storage medium

By deploying the management plane and multiple forwarding planes in the load balancer, combined with DPDK and Tofino+FPGA technology, the balance problem between cost and performance of the load balancer is solved, and efficient traffic processing and resource utilization are achieved.

CN118740746APending Publication Date: 2024-10-01CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410995099.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-24
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

Existing load balancers cannot achieve a balance between cost and performance. Pure software load balancers have serious performance bottlenecks when processing large traffic, while pure hardware load balancers have high single device costs and low overall utilization.

Method used

Deploy the management plane, business plane and at least two types of forwarding planes in the load balancer. The management plane determines the appropriate forwarding plane based on the business traffic characteristics and user setting information to achieve smooth scheduling and forwarding of traffic. Combined with DPDK pure software forwarding Plane and Tofino+FPGA pure hardware forwarding plane to improve resource utilization.

Benefits of technology

It achieves a balance between cost and performance of the load balancer, improves overall resource utilization, reduces costs, and has high-performance processing capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118740746A_ABST
    Figure CN118740746A_ABST
Patent Text Reader

Abstract

The invention provides a load balancing method and device, electronic equipment and a readable storage medium, and belongs to the cloud computing technology. The method is applied to a load balancer, the load balancer comprises a management plane, a service plane and at least two types of forwarding planes, the service plane is used for guiding the at least two types of forwarding planes to carry out message forwarding, and the method comprises the following steps: a first forwarding plane obtains service message data of a load balancing instance, the first forwarding plane is a forwarding plane determined by the management plane from at least two types of forwarding planes according to the first information; the service plane performs load balancing processing according to the session query message sent by the first forwarding plane to obtain a session response message; the session query message is a message obtained by packaging the first forwarding plane according to the service message data; and the first forwarding plane forwards the service message data according to the session response message sent by the service plane.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the technical field of cloud computing, and in particular to a load balancing method, device, electronic device, and readable storage medium. Background Art

[0002] With the rapid development of cloud computing, load balancers are becoming more and more important. Load balancers (LB) can be used to distribute loads. Currently, load balancers only have one forwarding plane, such as a pure software forwarding plane of the Data Plane Development Kit (DPDK), or a pure hardware forwarding plane of the Tofino network chip combined with the Field Programmable Gate Array (FPGA).

[0003] In related technologies, pure software load balancing developed based on DPDK usually uses optimization technologies such as DPDK kernel bypass, lock-free queues, core isolation, network card multi-queues and huge pages to achieve high performance through software. The deployment structure diagram of a pure software forwarding plane load balancer developed based on DPDK is shown in the figure below. Figure 1 As shown, a load balancing system is usually deployed in a multi-active device cluster, with each device having an independent business plane and forwarding plane. The following processing flow can be used:

[0004] 1) Traffic is introduced to the device through the Border Gateway Protocol (BGP); DPDK parses the message, extracts the five-tuple, and searches the local session table;

[0005] 2) If there is a local session, the message is modified according to the session information and forwarded to the backend;

[0006] 3) If there is no local session, the message is sent to the service processing module of the device for load balancing logic processing. According to the load balancing algorithm, the backend is selected, the session table entry is generated, the message is modified, and the message is forwarded to the backend;

[0007] 4) During the processing, each single device in this load balancer has an independent business plane. The devices are not related to each other, and each processes and forwards traffic independently, and internal information is not shared at all.

[0008] Compared with Linux Virtual Server (LVS) in Linux kernel state, the load balancer developed by pure software using DPDK has good performance. However, due to the upper limit of the bandwidth of a single server, many servers are required to form a cluster, which is costly. Therefore, it still has difficult problems in processing large-volume traffic and Tb-level traffic. For this reason, the industry began to use Tofino+FPGA to implement hardware load balancers. The deployment structure diagram of the load balancer based on the pure hardware forwarding plane developed by Tofino+FPGA is shown in the figure below: Figure 2 As shown in the figure, the powerful message forwarding capability and flexible programmability of the Tofino network chip are used to forward messages, the large-scale table capability of the FPGA is used to implement session table storage query, and the business plane on this device is used to process business logic. Usually a set of Tofino+FPGA hardware load balancers will be deployed in a multi-active device mode, with independent business planes and forwarding planes on each device. It can use the following processing flow:

[0009] 1) Traffic is first introduced to the device through the BGP protocol; Tofino parses the message, extracts the five-tuple, and uses the FPGA to query the session based on the five-tuple;

[0010] 2) If the FPGA stores a session, it constructs a message carrying the query result and sends it to Tofino. Tofino modifies the message according to the session information and forwards it to the backend;

[0011] 3) If there is no local session on the FPGA, the message will be sent to the service plane of the device for load balancing logic processing. According to the load balancing algorithm, the backend will be selected, and the session table will be generated and sent to the FPGA. At the same time, Tofino will modify the message according to the session and forward the message to the backend.

[0012] 4) During the processing, each single device in this load balancer has an independent business plane. The devices are not related to each other, and each processes and forwards traffic independently, and internal information is not shared at all.

[0013] In the related art, when using the DPDK pure software forwarding plane, if encountering large traffic, especially a single large flow, it will have performance problems; and when using the Tofino+FPGA pure hardware forwarding plane, the cost of a single device is high, and in the case of high-availability multi-device deployment, there will be a problem of low overall utilization. As a result, in the related art, the load balancer cannot strike a good balance between cost and performance. Summary of the invention

[0014] The embodiments of the present invention provide a load balancing method, device, electronic device and readable storage medium to solve the problem that the load balancer in the prior art cannot strike a good balance between cost and performance. The embodiments of the present invention can enable the load balancer to strike a balance between cost and performance and can maximize the overall resource utilization.

[0015] In a first aspect, an embodiment of the present invention provides a load balancing method, which is applied to a load balancer, wherein the load balancer includes a management plane, a service plane, and at least two types of forwarding planes, wherein the service plane is used to guide the at least two types of forwarding planes to forward packets, and the method includes:

[0016] The first forwarding plane acquires service message data of the load balancing instance, where the first forwarding plane is a forwarding plane determined by the management plane from the at least two types of forwarding planes according to first information, where the first information includes at least one of a service traffic feature of the load balancing instance and setting information of the forwarding plane by a user;

[0017] The service plane performs load balancing processing according to the session query message sent by the first forwarding plane to obtain a session response message; the session query message is a message obtained by encapsulating the first forwarding plane according to the service message data;

[0018] The first forwarding plane forwards the service message data according to the session response message sent by the service plane.

[0019] In a second aspect, an embodiment of the present invention provides a load balancing device, which is applied to a load balancer, wherein the load balancer includes a management plane, a service plane, and at least two types of forwarding planes, wherein the service plane is used to guide the at least two types of forwarding planes to forward packets; the device includes:

[0020] a determination module, configured for the management plane to determine a first forwarding plane from the at least two types of forwarding planes according to first information, wherein the first information includes at least one of a service traffic feature of the load balancing instance and user setting information for the forwarding plane;

[0021] An acquisition module, used by the first forwarding plane to acquire service message data of the load balancing instance;

[0022] A load balancing processing module, used for the service plane to perform load balancing processing according to the session query message sent by the first forwarding plane to obtain a session response message; the session query message is a message obtained by the first forwarding plane encapsulating the service message data;

[0023] A forwarding module is used for the first forwarding plane to forward the service message data according to the session response message sent by the service plane.

[0024] In a third aspect, an embodiment of the present invention provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the above-mentioned load balancing method when executed by the processor.

[0025] In a fourth aspect, an embodiment of the present invention provides a readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned load balancing method are implemented.

[0026] In a fifth aspect, an embodiment of the present invention provides a computer program product, including computer instructions, which implement the steps of the above-mentioned load balancing method when executed by a processor.

[0027] In an embodiment of the present invention, by deploying a management plane, a business plane and at least two types of forwarding planes in a set of load balancers, the business plane is used to guide the at least two types of forwarding planes to forward messages. When implementing load balancing, the load balancer determines the first forwarding plane from the at least two types of forwarding planes according to the first information through the management plane; the first forwarding plane obtains the service message data of the load balancing instance; the business plane performs load balancing processing according to the session query message sent by the first forwarding plane to obtain a session response message; the session query message is a message encapsulated by the first forwarding plane according to the service message data; the first forwarding plane forwards the service message data according to the session response message sent by the business plane. In this way, by deploying at least two types of forwarding planes in a set of load balancers, and guiding the forwarding of at least two types of forwarding planes at the same time through a single business plane, the performance bottleneck of pure software load balancers and the high cost and low resource utilization of pure hardware load balancers can be solved, thereby improving resource utilization efficiency and achieving a balance between cost and performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0029] Figure 1 This is a diagram of the deployment structure of a load balancer based on a pure software forwarding plane developed based on DPDK;

[0030] Figure 2 This is the deployment structure diagram of the load balancer based on the pure hardware forwarding plane developed based on Tofino+FPGA;

[0031] Figure 3 It is a flow chart of a load balancing method provided by an embodiment of the present invention;

[0032] Figure 4 is a schematic diagram of the deployment structure of a load balancer according to an embodiment of the present invention;

[0033] Figure 5 It is a schematic diagram of the principle that the management plane performs traffic smoothing scheduling on two types of forwarding planes according to the service traffic characteristics;

[0034] Figure 6 This is an effect diagram of a traffic scheduling scenario of a heterogeneous forwarding plane according to an embodiment of the present invention;

[0035] Figure 7 is a schematic diagram of the structure of the GENEVE protocol header in an embodiment of the present invention;

[0036] Figure 8 This is a schematic diagram of the format of the device type TLV;

[0037] Fig. 9 This is a schematic diagram of the format of the DPDK pure software forwarding plane interaction TLV;

[0038] Fig.10 This is a schematic diagram of the format of the Tofino+FPGA pure hardware forwarding plane interaction TLV;

[0039] Fig.11 This is a schematic diagram of the format of the session query message applied to the DPDK pure software forwarding plane;

[0040] Fig.12 This is a schematic diagram of the format of the session query message applied to the Tofino+FPGA pure hardware forwarding plane;

[0041] Fig.13 It is a schematic diagram of the processing logic between the DPDK pure software forwarding plane and the business plane;

[0042] Fig.14 This is a schematic diagram of the processing logic between the Tofino+FPGA pure hardware forwarding plane and the service plane;

[0043] Fig.15 It is a schematic diagram of the interaction between the management plane, the forwarding plane and the service plane;

[0044] Fig.16 This is a logical diagram of traffic processing by the DPDK pure software forwarding plane;

[0045] Fig.17 This is a logical diagram of traffic processing by the Tofino+FPGA pure hardware forwarding plane;

[0046] Fig.18 is a structural diagram of a load balancing device provided by an embodiment of the present invention;

[0047] Fig.19 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0048] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0049] The following first describes the load balancing method provided by an embodiment of the present invention.

[0050] See also Figure 3 , the figure shows a schematic flow chart of a load balancing method provided by an embodiment of the present invention. It should be noted that the load balancing method is applied to a load balancer, the load balancer includes a management plane, a service plane and at least two types of forwarding planes, the service plane is used to guide the at least two types of forwarding planes to forward packets, such as Figure 3 As shown, the method may include the following steps:

[0051] Step 301, the first forwarding plane obtains the business message data of the load balancing instance, the first forwarding plane is a forwarding plane determined by the management plane from the at least two types of forwarding planes according to the first information, and the first information includes at least one of the business traffic characteristics of the load balancing instance and the user's setting information for the forwarding plane.

[0052] In this embodiment, the service plane and the management plane may be a control plane, which is a part of the network that controls the way data packets are forwarded, that is, how data is sent from one place to another. For example, the process of creating a routing table is considered to be part of the control plane, and the router uses various protocols to identify network paths and stores these paths in the routing table.

[0053] In contrast to the control plane that decides how to forward packets, the data plane actually forwards packets. The data plane is also called the forwarding plane. The data plane is the hardware and software on the network device that operates according to the instructions of the control plane. In routing, the data plane refers to all functions and processes that forward data from one interface to another according to the control plane logic. That is, the main task of the data plane is to transmit packets from one network device to another. The routing table, forwarding table, and routing logic constitute the function of the data plane.

[0054] The control plane and the data plane can interact with each other through messages of a predetermined protocol. For example, the management plane can interact with the forwarding plane, and the service plane can interact with the forwarding plane.

[0055] The interaction between the management plane and the forwarding plane can be used to determine a first forwarding plane from at least two types of forwarding planes, and the first forwarding plane is used to perform data diversion and data packet forwarding.

[0056] At least two types of forwarding planes may include: a forwarding plane based on software development, such as a DPDK pure software forwarding plane, and a forwarding plane based on hardware development, such as a Tofino+FPGA pure hardware forwarding plane. Other types of forwarding planes may also be included, which are not specifically limited here.

[0057] Figure 4 FIG. 1 is a schematic diagram of the deployment structure of the load balancer according to an embodiment of the present invention. Figure 4 As shown, at least two types of forwarding planes in the load balancer can be arranged heterogeneously, that is, deployed on different devices respectively, and the business plane part of the load balancer is abstracted together and concentrated on a separate public device. A single business plane can simultaneously guide forwarding for multiple heterogeneous forwarding planes.

[0058] Among them, the main tasks of the business plane in the load balancer are: creating new sessions, selecting the backend according to the scheduling algorithm, selecting the session source address, performing whitelist filtering, concurrency restrictions, and adding source address transparent transmission information, etc. The load balancer heterogeneous forwarding plane uses session interaction messages to query the forwarding session from the business plane to forward traffic.

[0059] like Figure 4As shown, the management plane can be deployed on different devices from the business plane. It can specify the load balancing instance to take effect on a specific forwarding plane without changing the business plane of the load balancing instance to which it belongs, that is, determine the first forwarding plane from at least two types of forwarding planes according to the first information. In some embodiments, the management plane can determine the effective first forwarding plane based on the user's setting information for the forwarding plane. In some embodiments, the management plane can also determine the effective first forwarding plane based on the business traffic characteristics of the load balancing instance. On the basis of determining the first forwarding plane, the business message data of the load balancing instance can be network diverted through the first forwarding device to achieve smooth scheduling and control of the traffic.

[0060] Optionally, the at least two types of forwarding planes include a forwarding plane developed based on software and a forwarding plane developed based on hardware; before step 301, the method further includes:

[0061] When the service traffic characteristic indicates that the service traffic of the load balancing instance is less than or equal to a first preset threshold, the management plane controls the service message data of the load balancing instance to be directed to a forwarding plane based on software development, where the first forwarding plane is a forwarding plane based on software development;

[0062] When the service traffic characteristics indicate that the service traffic of the load balancing instance is greater than a first preset threshold, the management plane controls the service message data of the load balancing instance to switch from a forwarding plane developed based on software to a forwarding plane developed based on hardware, and the first forwarding plane is a forwarding plane developed based on hardware.

[0063] In the related art, since each device has its own independent load balancer business plane, when traffic is directed to other devices, the connection will be interrupted because the existing session cannot be queried. Therefore, if different types of devices are simply mixed and used to form a cluster, the problem of smooth traffic switching scheduling cannot be solved. In this embodiment, the fusion scheduling method is designed to enable smooth fusion scheduling of traffic between data planes of different architectures, and the entire load balancer is still logically a single set of load balancers, rather than a load balancer cluster formed by combining multiple independent load balancers.

[0064] The management plane can monitor the business traffic characteristics of the load balancing instance. Under the default configuration, the traffic is usually directed to the forwarding plane based on software development for forwarding processing. When the traffic increases, the management plane starts scheduling and controls the business message data of the load balancing instance to switch from the forwarding plane based on software development to the forwarding plane based on hardware development to achieve the switching of the forwarding plane. Among them, the first preset threshold can be set according to the actual situation so that the management plane can distinguish between large traffic and small traffic.

[0065] In this way, the business traffic characteristics of the load balancing instance can be used as the basis for switching different types of forwarding planes. When the traffic is small, the DPDK pure software forwarding plane can be used for forwarding, and when the traffic increases, the Tofino+FPGA pure hardware forwarding plane can be used for forwarding, achieving a balance between cost and performance.

[0066] Optionally, the management plane controls the service message data of the load balancing instance to switch from the forwarding plane diversion based on software development to the forwarding plane diversion based on hardware development, including:

[0067] The management plane sends the basic configuration of the load balancing instance to the hardware-based forwarding plane deployed in the first device, where the basic configuration is used to guide the forwarding plane to perform forwarding processing for the load balancing instance;

[0068] The management plane issues a first control instruction to the first device, where the first control instruction is used to instruct the first device to publish traffic diversion information, where the traffic diversion information is used to introduce service message data of the load balancing instance to the first device;

[0069] The management plane sends a second control instruction to the second device and controls the second device to delete the basic configuration of the load balancing instance. The second device is deployed with a forwarding plane developed based on software. The second control instruction is used to guide the second device to cancel the publication of the diversion information.

[0070] Figure 5 This is a schematic diagram of the principle that the management plane performs traffic smoothing scheduling on two types of forwarding planes according to business traffic characteristics, such as Figure 5 As shown, the process is as follows:

[0071] 1) By default, for a load balancing instance, the management platform can send its main configuration to the device where the business plane is deployed, and can send its basic configuration to the second device where the DPDK pure software forwarding plane is deployed, and the traffic is processed by the second device. When the traffic increases, the management plane starts scheduling, scheduling the forwarding plane of the load balancing instance from the DPDK pure software forwarding plane to the Tofino+FPGA pure hardware forwarding plane. During this period, the main configuration of the load balancing instance remains unchanged on the device of the business plane;

[0072] 2) The management plane sends the basic configuration of the load balancing instance to the Tofino+FPGA pure hardware forwarding plane of the first device according to the steps shown in label ①, so that it can process the traffic of the corresponding load balancing instance. At this time, the first device only has the ability to process the traffic of the load balancing instance, but no traffic has entered;

[0073] 3) The management plane sends a first control instruction to the first device, instructing the first device to Figure 5 The step of label ② shown in the figure is to publish the virtual Internet Protocol (VIP) address of the load balancing instance through BGP to introduce traffic to the first device. At this time, the traffic starts to enter the first device. After the traffic enters, the Tofino+FPGA pure hardware forwarding plane of the first device finds that there is no forwarding session for load balancing, and starts to query the session to the business plane through the interactive interface. After the session is queried, it starts to forward the traffic;

[0074] 4) Management plane according to Figure 5 The step of label ③ shown in the figure sends a second control instruction to the second device, instructing the second device to cancel the release of VIP through BGP and stop introducing the traffic corresponding to the VIP of the load balancing instance. At this time, all traffic enters the first device for processing;

[0075] 5) Management plane according to Figure 5 The step of label ④ shown deletes the basic configuration of the relevant load balancing instance from the second device, thereby completing the scheduling of the heterogeneous forwarding plane of the load balancing instance.

[0076] In addition, when the traffic drops suddenly, the traffic can be migrated from the first device back to the second device, and migrating the traffic from the first device to the second device is similar to the above steps.

[0077] Figure 6The traffic scheduling effect diagram of the heterogeneous forwarding plane is shown. When the LB instance traffic is at a low 2Gb, the traffic is forwarded using the low-cost DPDK pure software forwarding plane. If the LB instance business increases suddenly and the traffic increases from 2Gb to 20Gb, the traffic can be transparently scheduled to the high-performance Tofino+FPGA pure hardware forwarding plane for forwarding. At this time, the traffic is still on the same set of load balancers, but it is switched from one forwarding plane to another, rather than migrating from one set of load balancers to another.

[0078] In this way, the fusion scheduling method of different types of forwarding planes can realize the smooth switching of traffic in heterogeneous forwarding planes; thus, a set of load balancers with different types of forwarding planes can be realized, achieving a balance between cost and performance. Moreover, the load balancer system can have both low-cost DPDK pure software forwarding planes and high-performance Tofino+FPGA pure hardware forwarding planes. When the traffic is not large, the low-cost DPDK pure software forwarding plane can be used. When the traffic increases, the high-performance Tofino+FPGA pure hardware forwarding plane can be used smoothly through the fusion scheduling of the management plane, so as to have both low cost and high performance.

[0079] Step 302: The service plane performs load balancing processing according to the session query message sent by the first forwarding plane to obtain a session response message; the session query message is a message obtained by encapsulating the service message data by the first forwarding plane.

[0080] Since the business plane and the forwarding plane are deployed on different devices, the device deployed with the forwarding plane needs to interact with the device deployed with the business plane through message exchange. The first forwarding plane can encapsulate the business message data to obtain a session query message to perform a session query on the business plane and send it to the business plane.

[0081] In order to make the business plane identify different types of forwarding planes, a session interaction message compatible with heterogeneous forwarding planes can be designed to achieve a single business plane to guide forwarding of multiple types of forwarding planes at the same time and heterogeneous forwarding planes. That is, a session interaction message compatible with heterogeneous forwarding planes can be designed so that the business plane part of the load balancer can be abstracted together and concentrated on a separate public device.

[0082] The session interaction message can be encapsulated using the Generic Network Virtualization Encapsulation (GENEVE) protocol. The GENEVE protocol header is as follows: Figure 7As shown, support for heterogeneous forwarding planes is achieved by adding different types of type-length-values ​​(TLVs) by design.

[0083] Optionally, before step 302, the method further includes:

[0084] When the session response message table entry corresponding to the service message data is not found in the session table corresponding to the first forwarding plane, the first forwarding plane encapsulates the service message data according to a preset encapsulation protocol to obtain the session query message, and sends the session query message to the service plane;

[0085] The preset encapsulation protocol includes: a first TLV field and a second TLV field, the first TLV field indicates the device information of the message being sent, the second TLV field indicates the source of the message and the information of one of the at least two types of forwarding planes acting on it, and the first TLV field and the second TLV field are used to guide the interaction between the service plane and the at least two types of forwarding planes. Table 1 below describes the newly added TLV types in this proposal.

[0086] Table 1 New TLV type description table

[0087]

[0088] Among them, the first TLV field is the device type TLV, the second TLV field is the DPDK pure software forwarding plane interaction TLV or the Tofino+FPGA pure hardware forwarding plane interaction TLV, and the second TLV field is determined according to the first TLV field, that is, if the first TLV field indicates that the device sending the message is deployed with a DPDK pure software forwarding plane, then the second TLV field is the DPDK pure software forwarding plane interaction TLV; if the first TLV field indicates that the device sending the message is deployed with a Tofino+FPGA pure hardware forwarding plane, then the second TLV field is the Tofino+FPGA pure hardware forwarding plane interaction TLV.

[0089] The device type TLV needs to be carried in all interaction messages between the forwarding plane and the service plane. It is mainly used to indicate the type of device from which the interaction message comes. Figure 8 shows the format of the device type TLV, and the following Table 2 explains the meaning of the specific fields.

[0090] Table 2 Field description in device type TLV

[0091] Fields illustrate Type type Length Total length of TLV Device Type Indicates the source of the message and acts on the hardware forwarding plane Device id Device ID, used to identify the specific device to which the message belongs Security ID Security ID, used to verify the validity of the content Reserved Reserved Fields

[0092] DPDK pure software forwarding plane interaction TLV, which is actively constructed and initiated by the DPDK pure software forwarding plane. It needs to be carried when querying the service plane for a session, and the service plane also needs to carry it when responding to a session. Fig. 9 The format of the DPDK pure software forwarding plane interaction TLV is shown, and the following Table 3 explains the meaning of the specific fields.

[0093] Table 3 Field description of DPDK pure software forwarding plane interaction TLV

[0094] Fields illustrate Type type Length Total length of TLV Fwd Cid The ID corresponding to the DPDK forwarding core Session Cid The id corresponding to the DPDK session core Keep Fields that need to be returned intact

[0095] The DPDK forwarding core is used by the forwarding plane to forward traffic, while the DPDK session core is used by the forwarding plane to interact with the business plane.

[0096] Tofino+FPGA pure hardware forwarding plane interaction TLV is actively constructed and initiated by the hardware forwarding plane. It needs to be carried when querying the service plane for a session, and the service plane also needs to carry it when responding to a session. Fig.10 The format of the Tofino+FPGA pure hardware forwarding plane interaction TLV is shown, and Table 4 explains the meaning of the specific fields.

[0097] Table 4 Field description of Tofino+FPGA pure hardware forwarding plane interaction TLV

[0098] Fields illustrate Type type Length Total length of TLV FPGAid Indicates the FPGA ID Card Status Indicates the status of the FPGA card Keep Fields that need to be returned intact

[0099] The session interaction messages between the forwarding plane and the service plane are generally divided into: session query messages, session response messages, session refresh messages, and session update messages. Fig.11 The complete format of the session query message applied to the DPDK pure software forwarding plane is shown. Fig.12 The complete format of the session query message applied to the Tofino+FPGA pure hardware forwarding plane is demonstrated.

[0100] The session response message, session refresh message and session update message are similar to the session query message, except that the TLV corresponding to the message type is updated, such as updating the session query TLV to the session response TLV. That is, when the first forwarding plane sends a session query message to the service plane, the message type indicates session query, and the message type field is the session query TLV. When the service plane sends a session response message to the first forwarding plane, the message type indicates session response, and the message type field is the session response TLV.

[0101] The DPDK pure software forwarding plane no longer has the load balancing scheduling logic of the business plane. Instead, it queries the business plane for a session query module to guide forwarding. The specific processing logic between the DPDK pure software forwarding plane and the business plane is as follows: Fig.13 As shown below:

[0102] 1) If Fig.13 In the step shown in label ①, DPDK receives the message from the network card queue, parses the message, extracts the five-tuple, uses the five-tuple to query the session in the local session table, and determines whether the session corresponding to the five-tuple is found;

[0103] 2) If found, enter Fig.13 In the step labeled ②, use the information recorded in the session table to modify the destination IP, destination port and other information of the message. After the modification is completed, the message is sent directly through the network card;

[0104] 3) If the session corresponding to the five-tuple is not found, enter Fig.13 The step shown in label ③ carries the forwarding core information and the original message and sends the message to the session query module;

[0105] 4) The session query module constructs a GENEVE-encapsulated session query message for session query and constructs the TLVs of each part: constructs the device type TLV, and fills in the Device Type, Device id and Security id fields in the device type TLV by querying the device type, device id and security id in the local configuration; constructs the DPDK pure software forwarding plane interaction TLV, obtains the forwarding core id and session core id, and fills in the Fwd Cid and Session Cid fields respectively; constructs the session query TLV; and attaches the original message;

[0106] 5) After constructing the GENEVE message, follow Fig.13 The step shown in label ④ sends the constructed GENEVE message, i.e., the session query message, to the service plane for load balancing processing;

[0107] 6) If Fig.13 In the step shown in label ⑤, after the DPDK pure software forwarding plane receives the GENEVE-encapsulated session response message, it parses the device type TLV and verifies the legitimacy of the message by extracting the contents of the Device Type, Device id, and Security id fields; parses the Session Cid and Fwd Cid in the message TLV, and sends the message to the corresponding session core and forwarding core to insert the session into the local session table.

[0108] The Tofino+FPGA pure hardware forwarding plane no longer has the load balancing scheduling logic of the business plane. Instead, it is replaced by a session query module that queries the business plane for sessions. The specific processing logic between the Tofino+FPGA pure hardware forwarding plane and the business plane is as follows: Fig.14 As shown below:

[0109] 1) Fig.14 In the steps shown in label ①, Tofino hardware receives the message, parses the message, extracts the five-tuple, and uses the five-tuple to construct a session query key that can be recognized by FPGA; Fig.14 In the step shown in label ②, the message is sent to the FPGA, allowing the FPGA to query the session based on the key;

[0110] 2) After the FPGA search is completed, Fig.14 In the step shown in label ③, the query results are returned to Tofino;

[0111] 3) If the query result shows a hit, enter Fig.14 In the step shown in label ④, Tofino parses and extracts the Value in the query result, modifies the destination IP, destination port and other information of the message, and forwards it after the modification is completed;

[0112] 4) If the query result shows no hit, Tofino performs Fig.14 In the step of label ⑤, construct the TLVs of each part: construct the device type TLV, fill in the Device Type, Device id and Security id fields in the device type TLV by querying the device type, device id and security id in the local configuration respectively; construct the Tofino+FPGA pure hardware forwarding plane interaction TLV, fill in the FPGAid and Card status fields respectively by obtaining the id and card status of the FPGA card to which it belongs; construct the session query TLV; attach the original message;

[0113] 5) After constructing the GENEVE message, follow Fig.14 The step shown in label ⑥ sends the constructed GENEVE message to the service plane for load balancing;

[0114] 6) Fig.14 In the step shown in label ⑦, after the Tofino+FPGA pure hardware forwarding plane receives the GENEVE-encapsulated response message from the service plane, it parses the device type TLV and verifies the legitimacy of the message by extracting the contents of the Device Type, Device id, and Security id fields; it parses the FPGA id and Card status in the message TLV and sends the message to the corresponding FPGA card to insert the session into the session table.

[0115] In this way, through the session query module of the forwarding plane and the interaction with the business plane, traffic scheduling of a load balancer deployed with multiple types of forwarding planes can be achieved, and traffic scheduling of a load balancer deployed with heterogeneous forwarding planes can be achieved.

[0116] Optionally, when the management plane controls the service message data of the load balancing instance to be directed to a forwarding plane developed based on software, the method further includes:

[0117] The management plane sends the main configuration of the load balancing instance to the business plane, where the main configuration is used to guide the business plane to perform load balancing processing on the load balancing instance;

[0118] The management plane sends the basic configuration of the load balancing instance to the software-based forwarding plane deployed in the second device.

[0119] Optionally, step 302 specifically includes:

[0120] The service plane extracts device information indicated by the first TLV field in the session query message, where the device information includes message verification information and a forwarding plane type deployed by the device;

[0121] When the message verification information is verified, the service plane extracts the forwarding plane information indicated by the second TLV field in the session query message according to the forwarding plane type, and extracts the service message data in the session query message;

[0122] The service plane performs load balancing processing according to the service message data to obtain the session response message, wherein the session response message includes the device information, the forwarding plane information and the service message data after load balancing processing.

[0123] Step 303: The first forwarding plane forwards the service message data according to the session response message sent by the service plane.

[0124] The interaction process between the management plane, forwarding plane, and service plane is as follows:

[0125] 1) Fig.15 The following diagram shows the interaction between the management plane, the forwarding plane, and the service plane. Fig.15 As shown in the figure, the load balancing instance configuration is divided into two parts, one part is called the main configuration, and the other part is called the basic configuration. The main configuration mainly includes: instance ID, VIP corresponding to the load balancing instance, listener, whitelist rules, new concurrent limit number and other information; the basic configuration mainly includes: instance ID, traffic limit rules, etc.

[0126] 2) When creating a load balancing instance, determine the forwarding plane device to which it belongs on the management plane, and then follow Fig.15 The step of label ① shown in the figure sends the main configuration to the device of the business plane of the load balancer;

[0127] 3) According to Fig.15 The step of label ② shown in the figure sends the basic configuration to the selected forwarding plane device, and at the same time sends the traffic introduction instruction, i.e., the first control instruction, to introduce the traffic to the forwarding plane device through BGP to start processing; in this way, the business plane and the software-based forwarding plane can be guided to perform traffic scheduling of the load balancing instance;

[0128] 4) The service plane and the heterogeneous forwarding plane use GENEVE protocol encapsulated messages for session interaction, and the heterogeneous forwarding plane obtains the forwarding session from the service plane for forwarding;

[0129] 5) The service plane uses the device type TLV in the GENEVE message header to distinguish whether it is a DPDK pure software forwarding plane or a Tofino+FPGA pure hardware forwarding plane;

[0130] 6) After receiving the GENEVE message, the service plane first extracts the device type TLV, verifies the device ID and security ID, and identifies the forwarding plane type to which the session query message belongs;

[0131] 7) When the forwarding plane type is DPDK pure software forwarding plane, identify the next TLV as the DPDK pure software forwarding plane interaction TLV, extract the information and fill it into the temporary data structure for storage. Continue to extract the next TLV, namely the session query TLV, to obtain the session query information and save it. Finally, parse the original message, namely the business message data, perform load balancing logic processing according to the original message content to generate the corresponding content, and then use the session encapsulation GENEVE format to encapsulate the temporary data structure content and the corresponding content generated by the load balancing logic processing into the session response message, and send the session response message to the DPDK pure software forwarding plane. The entire processing process corresponds to Fig.16 The labels in the figure show that the service traffic reaches the DPDK pure software forwarding plane, the steps shown in label ② show that the DPDK pure software forwarding plane queries the service plane for a session, the steps shown in label ③ show that the service plane generates and responds to the session and sends it to the DPDK pure software forwarding plane, and the steps shown in label ④ show that the DPDK pure software forwarding plane processes the original message according to the session response message and forwards it.

[0132] 8) When the forwarding plane type is Tofino+FPGA pure hardware forwarding plane, identify the next TLV as Tofino+FPGA forwarding plane interaction TLV, extract the information and fill it into the temporary data structure for storage, continue to extract the next TLV, namely the session query TLV, obtain the session query information and save it, finally parse the original message, perform load balancing logic processing according to the original message content to generate the corresponding session, then use the session encapsulation GENEVE format to encapsulate the temporary data structure content and the corresponding content generated by the load balancing logic processing into the session response message, and send the session response message to the DPDK pure software forwarding plane. The entire processing process corresponds to Fig.17 In the steps shown in the labels, the step shown in label ① indicates that the service traffic reaches the Tofino+FPGA pure hardware forwarding plane, the step shown in label ② indicates that the Tofino+FPGA pure hardware forwarding plane queries the service plane for a session, the step shown in label ③ indicates that the service plane generates and responds to the session and sends it to the Tofino+FPGA pure hardware forwarding plane, and the step shown in label ④ indicates that the Tofino+FPGA pure hardware forwarding plane processes the original message according to the response session and forwards the message.

[0133] It can be seen that no matter which type of forwarding plane is used during the use of the load balancing instance, the forwarding plane device of the load balancer to which the load balancing instance belongs has never changed and still belongs to the same load balancer. Deploying a load balancer with a heterogeneous forwarding plane allows a set of load balancers to have multiple types of forwarding planes, thereby effectively reducing costs and improving performance, which is very suitable for cloud computing scenarios.

[0134] In this embodiment, by deploying a management plane, a business plane and at least two types of forwarding planes in a set of load balancers, the business plane is used to guide the at least two types of forwarding planes to forward messages. When implementing load balancing, the load balancer determines the first forwarding plane from at least two types of forwarding planes according to the first information through the management plane; the first forwarding plane obtains the service message data of the load balancing instance; the business plane performs load balancing processing according to the session query message sent by the first forwarding plane to obtain a session response message; the session query message is a message encapsulated by the first forwarding plane according to the service message data; the first forwarding plane forwards the service message data according to the session response message sent by the business plane. In this way, by deploying at least two types of forwarding planes in a set of load balancers, and guiding the forwarding of at least two types of forwarding planes at the same time through a single business plane, the performance bottleneck of pure software load balancers and the high cost and low resource utilization of pure hardware load balancers can be solved, thereby improving resource utilization efficiency and achieving a balance between cost and performance.

[0135] Moreover, in the related art, whether the load balancer is a load balancer with a pure DPDK software forwarding plane or a load balancer with a pure Tofino+FPGA hardware forwarding plane, it usually only has a single type of forwarding plane, and each device has an independent load balancing instance configuration. However, this embodiment realizes the simultaneous use of forwarding plane capabilities of different architectures by designing a session interaction message compatible with heterogeneous forwarding planes, and guiding forwarding of heterogeneous forwarding planes by a single business plane, thereby realizing the simultaneous use of forwarding plane capabilities of different architectures.

[0136] The load balancing method provided by the embodiment of the present invention is described in detail below in conjunction with actual application scenarios.

[0137] The embodiments of the present invention relate to the field of cloud computing, big data and edge computing, and to a load balancer component, which can be applied to a large cloud network function virtualization (NFV) platform, and is mainly used for load balancing products, such as software defined network (SDN) load balancing products.

[0138] The embodiments of the present invention are applicable to all relevant scenarios that require load balancing, such as cloud platform load balancing products, object storage, file storage, etc. In elastic load balancing, it can serve SDN load balancing products to achieve load balancing of tenant business traffic. In object storage, it will serve Glance in the cloud network and cloud operating system Openstack components to achieve the role of large traffic entry and load balancing, which is expected to reduce costs by millions.

[0139] Tables 5 and 6 below show the total bandwidth that can be achieved by the instance when the DPDK pure software forwarding plane and the Tofino+FPGA pure hardware forwarding plane are used in the load balancing product. As shown in Table 5 below, for the elastic load balancing product, the maximum bandwidth of the instance can reach 20 Gb when the DPDK pure software forwarding plane is used. As shown in Table 6 below, the maximum bandwidth of the instance can reach 90 Gb when it is scheduled to the Tofino+FPGA pure hardware forwarding plane.

[0140] Table 5: Total bandwidth that can be achieved when using the DPDK pure software forwarding plane

[0141] Number of DPDK network elements Total bandwidth (Gbps) 1 9.22 2 18.78 4 27

[0142] Table 6 Total bandwidth that can be achieved when using the Tofino+FPGA pure hardware forwarding plane

[0143] Hardware Accelerated LB Total bandwidth (Gbps) bandwidth >93

[0144] In an embodiment of the present invention, the load balancer can simultaneously have a low-cost DPDK pure software forwarding plane and a high-performance Tofino+FPGA pure hardware forwarding plane. When the traffic is not large, the low-cost pure software forwarding plane can be used. When the traffic increases, the management plane fusion scheduling can be used to smoothly use the high-performance forwarding plane, thereby having both low cost and high performance.

[0145] The load balancing device provided by the embodiment of the present invention is described below.

[0146] See also Fig.18 , the figure shows a schematic diagram of the structure of the load balancing device provided by an embodiment of the present invention, which is applied to a load balancer, the load balancer includes a management plane, a service plane and at least two types of forwarding planes, the service plane is used to guide the at least two types of forwarding planes to forward packets. Fig.18 As shown, the load balancing device 1800 includes:

[0147] A determination module 1801, configured for the management plane to determine a first forwarding plane from the at least two types of forwarding planes according to first information, wherein the first information includes at least one of a service traffic feature of the load balancing instance and user setting information for the forwarding plane;

[0148] An acquisition module 1802 is used for the first forwarding plane to acquire service message data of the load balancing instance;

[0149] The load balancing processing module 1803 is used for the service plane to perform load balancing processing according to the session query message sent by the first forwarding plane to obtain a session response message; the session query message is a message obtained by the first forwarding plane encapsulating the service message data;

[0150] The forwarding module 1804 is configured to enable the first forwarding plane to forward the service message data according to the session response message sent by the service plane.

[0151] Optionally, the at least two types of forwarding planes include a forwarding plane developed based on software and a forwarding plane developed based on hardware; the device further includes a control module, the control module being configured to:

[0152] When the service traffic characteristic indicates that the service traffic of the load balancing instance is less than or equal to a first preset threshold, the management plane controls the service message data of the load balancing instance to be directed to a forwarding plane based on software development, where the first forwarding plane is a forwarding plane based on software development;

[0153] When the service traffic characteristics indicate that the service traffic of the load balancing instance is greater than a first preset threshold, the management plane controls the service message data of the load balancing instance to switch from a forwarding plane developed based on software to a forwarding plane developed based on hardware, and the first forwarding plane is a forwarding plane developed based on hardware.

[0154] Optionally, the control module is specifically used to:

[0155] The management plane sends the basic configuration of the load balancing instance to the hardware-based forwarding plane deployed in the first device, where the basic configuration is used to guide the forwarding plane to perform forwarding processing for the load balancing instance;

[0156] The management plane issues a first control instruction to the first device, where the first control instruction is used to instruct the first device to publish traffic diversion information, where the traffic diversion information is used to introduce service message data of the load balancing instance to the first device;

[0157] The management plane sends a second control instruction to the second device and controls the second device to delete the basic configuration of the load balancing instance. The second device is deployed with a forwarding plane developed based on software. The second control instruction is used to guide the second device to cancel the publication of the diversion information.

[0158] Optionally, when the management plane controls the service message data of the load balancing instance to be directed to the forwarding plane developed based on software, the device further includes a configuration delivery module, and the configuration delivery module is used to:

[0159] The management plane sends the main configuration of the load balancing instance to the business plane, where the main configuration is used to guide the business plane to perform load balancing processing on the load balancing instance;

[0160] The management plane sends the basic configuration of the load balancing instance to the software-based forwarding plane deployed in the second device.

[0161] Optionally, the device further includes a session query module, wherein the session query module is configured to:

[0162] When the session response message table entry corresponding to the service message data is not found in the session table corresponding to the first forwarding plane, the first forwarding plane encapsulates the service message data according to a preset encapsulation protocol to obtain the session query message, and sends the session query message to the service plane;

[0163] Among them, the preset encapsulation protocol includes: a first TLV field and a second TLV field, the first TLV field represents the device information of sending the message, the second TLV field represents the source of the message and the information of one type of forwarding plane among the at least two types of forwarding planes acted on, and the first TLV field and the second TLV field are used to guide the interaction between the service plane and the at least two types of forwarding planes.

[0164] Optionally, the load balancing processing module 1803 is specifically used to:

[0165] The service plane extracts device information indicated by the first TLV field in the session query message, where the device information includes message verification information and a forwarding plane type deployed by the device;

[0166] When the message verification information is verified, the service plane extracts the forwarding plane information indicated by the second TLV field in the session query message according to the forwarding plane type, and extracts the service message data in the session query message;

[0167] The service plane performs load balancing processing according to the service message data to obtain the session response message, wherein the session response message includes the device information, the forwarding plane information and the service message data after load balancing processing.

[0168] The load balancing device 1800 can implement each process implemented in the above load balancing method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described here.

[0169] The electronic device provided by the embodiment of the present invention is described below.

[0170] See also Fig.19 , the figure shows a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention, which is applied to a load balancer, the load balancer includes a management plane, a service plane and at least two types of forwarding planes, the service plane is used to guide the at least two types of forwarding planes to forward packets. Fig.19 As shown, the electronic device 1900 includes: a processor 1901 , a memory 1902 , a user interface 1903 and a bus interface 1904 .

[0171] The processor 1901 is used to read the program in the memory 1902 and execute the following process:

[0172] The first forwarding plane acquires service message data of the load balancing instance, where the first forwarding plane is a forwarding plane determined by the management plane from the at least two types of forwarding planes according to first information, where the first information includes at least one of a service traffic feature of the load balancing instance and setting information of the forwarding plane by a user;

[0173] The service plane performs load balancing processing according to the session query message sent by the first forwarding plane to obtain a session response message; the session query message is a message obtained by encapsulating the first forwarding plane according to the service message data;

[0174] The first forwarding plane forwards the service message data according to the session response message sent by the service plane.

[0175] exist Fig.19 In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically one or more processors represented by processor 1901 and various circuits of memory represented by memory 1902 are linked together. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface 1904 provides an interface. For different user devices, the user interface 1903 may also be an interface that can be connected to external or internal devices, and the connected devices include but are not limited to keypads, displays, speakers, microphones, joysticks, etc.

[0176] The processor 1901 is responsible for managing the bus architecture and general processing, and the memory 1902 can store data used by the processor 1901 when performing operations.

[0177] Optionally, the at least two types of forwarding planes include a forwarding plane developed based on software and a forwarding plane developed based on hardware; the processor 1901 is further configured to:

[0178] When the service traffic characteristic indicates that the service traffic of the load balancing instance is less than or equal to a first preset threshold, the management plane controls the service message data of the load balancing instance to be directed to a forwarding plane based on software development, where the first forwarding plane is a forwarding plane based on software development;

[0179] When the service traffic characteristics indicate that the service traffic of the load balancing instance is greater than a first preset threshold, the management plane controls the service message data of the load balancing instance to switch from a forwarding plane developed based on software to a forwarding plane developed based on hardware, and the first forwarding plane is a forwarding plane developed based on hardware.

[0180] Optionally, the processor 901 is further configured to:

[0181] The management plane sends the basic configuration of the load balancing instance to the hardware-based forwarding plane deployed in the first device, where the basic configuration is used to guide the forwarding plane to perform forwarding processing for the load balancing instance;

[0182] The management plane issues a first control instruction to the first device, where the first control instruction is used to instruct the first device to publish traffic diversion information, where the traffic diversion information is used to introduce service message data of the load balancing instance to the first device;

[0183] The management plane sends a second control instruction to the second device and controls the second device to delete the basic configuration of the load balancing instance. The second device is deployed with a forwarding plane developed based on software. The second control instruction is used to guide the second device to cancel the publication of the diversion information.

[0184] Optionally, when the management plane controls the service message data of the load balancing instance to be directed to the forwarding plane developed based on software, the processor 901 is further configured to:

[0185] The management plane sends the main configuration of the load balancing instance to the business plane, where the main configuration is used to guide the business plane to perform load balancing processing on the load balancing instance;

[0186] The management plane sends the basic configuration of the load balancing instance to the software-based forwarding plane deployed in the second device.

[0187] Optionally, the processor 901 is further configured to:

[0188] When the session response message table entry corresponding to the service message data is not found in the session table corresponding to the first forwarding plane, the first forwarding plane encapsulates the service message data according to a preset encapsulation protocol to obtain the session query message, and sends the session query message to the service plane;

[0189] Among them, the preset encapsulation protocol includes: a first TLV field and a second TLV field, the first TLV field represents the device information of sending the message, the second TLV field represents the source of the message and the information of one type of forwarding plane among the at least two types of forwarding planes acted on, and the first TLV field and the second TLV field are used to guide the interaction between the service plane and the at least two types of forwarding planes.

[0190] Optionally, the processor 901 is further configured to:

[0191] The service plane extracts device information indicated by the first TLV field in the session query message, where the device information includes message verification information and a forwarding plane type deployed by the device;

[0192] When the message verification information is verified, the service plane extracts the forwarding plane information indicated by the second TLV field in the session query message according to the forwarding plane type, and extracts the service message data in the session query message;

[0193] The service plane performs load balancing processing according to the service message data to obtain the session response message, wherein the session response message includes the device information, the forwarding plane information and the service message data after load balancing processing.

[0194] Preferably, an embodiment of the present invention further provides an electronic device 1900, including a processor 1901, a memory 1902, and a computer program stored in the memory 1902 and executable on the processor 1901. When the computer program is executed by the processor 1901, each process of the above-mentioned load balancing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0195] The embodiment of the present invention further provides a readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the above-mentioned load balancing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0196] The embodiment of the present application also provides a computer program product, including computer instructions. When the computer instructions are executed by a processor, the various processes of the above-mentioned load balancing method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, they are not repeated here.

[0197] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0198] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0199] In the embodiments provided in the present application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0200] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of the present invention.

[0201] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0202] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, ROM, RAM, magnetic disks, or optical disks.

[0203] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A load balancing method, It is characterized in that Applied to a load balancer, the load balancer includes a management plane, a service plane, and at least two types of forwarding planes, the service plane is used to guide the at least two types of forwarding planes to forward messages, and the method includes: The first forwarding plane acquires service message data of the load balancing instance, where the first forwarding plane is a forwarding plane determined by the management plane from the at least two types of forwarding planes according to first information, where the first information includes at least one of a service traffic feature of the load balancing instance and setting information of the forwarding plane by a user; The service plane performs load balancing processing according to the session query message sent by the first forwarding plane to obtain a session response message; the session query message is a message obtained by encapsulating the first forwarding plane according to the service message data; The first forwarding plane forwards the service message data according to the session response message sent by the service plane.

2. The method according to claim 1, It is characterized in that The at least two types of forwarding planes include a forwarding plane developed based on software and a forwarding plane developed based on hardware; Before the first forwarding plane obtains the service message data of the load balancing instance, the method further includes: When the service traffic characteristic indicates that the service traffic of the load balancing instance is less than or equal to a first preset threshold, the management plane controls the service message data of the load balancing instance to be directed to a forwarding plane based on software development, where the first forwarding plane is a forwarding plane based on software development; When the service traffic characteristics indicate that the service traffic of the load balancing instance is greater than a first preset threshold, the management plane controls the service message data of the load balancing instance to switch from a forwarding plane developed based on software to a forwarding plane developed based on hardware, and the first forwarding plane is a forwarding plane developed based on hardware.

3. The method according to claim 2, It is characterized in that The management plane controls the service message data of the load balancing instance to switch from the forwarding plane diversion based on software development to the forwarding plane diversion based on hardware development, including: The management plane sends the basic configuration of the load balancing instance to the hardware-based forwarding plane deployed in the first device, where the basic configuration is used to guide the forwarding plane to perform forwarding processing for the load balancing instance; The management plane issues a first control instruction to the first device, where the first control instruction is used to instruct the first device to publish traffic diversion information, where the traffic diversion information is used to introduce service message data of the load balancing instance to the first device; The management plane sends a second control instruction to the second device and controls the second device to delete the basic configuration of the load balancing instance. The second device is deployed with a forwarding plane developed based on software. The second control instruction is used to guide the second device to cancel the publication of the diversion information.

4. The method according to claim 2, It is characterized in that In the case where the management plane controls the service message data of the load balancing instance to be directed to the forwarding plane based on software development, the method further includes: The management plane sends the main configuration of the load balancing instance to the business plane, where the main configuration is used to guide the business plane to perform load balancing processing on the load balancing instance; The management plane sends the basic configuration of the load balancing instance to the software-based forwarding plane deployed in the second device.

5. The method according to claim 1, It is characterized in that The service plane performs load balancing processing according to the session query message sent by the first forwarding plane, and before obtaining the session response message, the method further includes: When the session response message table entry corresponding to the service message data is not found in the session table corresponding to the first forwarding plane, the first forwarding plane encapsulates the service message data according to a preset encapsulation protocol to obtain the session query message, and sends the session query message to the service plane; Among them, the preset encapsulation protocol includes: a first TLV field and a second TLV field, the first TLV field represents the device information of sending the message, the second TLV field represents the source of the message and the information of one type of forwarding plane among the at least two types of forwarding planes acted on, and the first TLV field and the second TLV field are used to guide the interaction between the service plane and the at least two types of forwarding planes.

6. The method according to claim 5, It is characterized in that The service plane performs load balancing processing according to the session query message sent by the first forwarding plane to obtain a session response message, including: The service plane extracts device information indicated by the first TLV field in the session query message, where the device information includes message verification information and a forwarding plane type deployed by the device; When the message verification information is verified, the service plane extracts the forwarding plane information indicated by the second TLV field in the session query message according to the forwarding plane type, and extracts the service message data in the session query message; The service plane performs load balancing processing according to the service message data to obtain the session response message, wherein the session response message includes the device information, the forwarding plane information and the service message data after load balancing processing.

7. A load balancing device, It is characterized in that Applied to a load balancer, the load balancer includes a management plane, a service plane and at least two types of forwarding planes, the service plane is used to guide the at least two types of forwarding planes to forward messages; the device includes: A determination module, configured for the management plane to determine a first forwarding plane from the at least two types of forwarding planes according to first information, wherein the first information includes at least one of a service traffic characteristic of the load balancing instance and setting information of the forwarding plane by a user; An acquisition module, used by the first forwarding plane to acquire service message data of the load balancing instance; A load balancing processing module, used for the service plane to perform load balancing processing according to the session query message sent by the first forwarding plane to obtain a session response message; the session query message is a message obtained by the first forwarding plane encapsulating the service message data; A forwarding module is used for the first forwarding plane to forward the service message data according to the session response message sent by the service plane.

8. An electronic device, It is characterized in that The electronic device comprises a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the load balancing method as claimed in any one of claims 1 to 6 when executed by the processor.

9. A readable storage medium, It is characterized in that The readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the load balancing method according to any one of claims 1 to 6 are implemented.

10. A computer program product, It is characterized in that The method comprises computer instructions, which, when executed by a processor, implement the steps of the load balancing method according to any one of claims 1 to 6.

Citation Information

Cited By

  • Embedded real-time system architecture tradeoff space generation method and device based on constraint

    CN119883287A

  • Constraint-Based Method and Apparatus for Generating Tradeoff Spaces in Embedded Real-Time System Architectures

    CN119883287B