Load balancing system, method and device and electronic equipment
By introducing forwarding surfaces, conversation surfaces and monitoring surfaces in the load balancing system, monitoring the Kubernetes cluster node status is solved, and the problem of inability to detect pod health status in the prior art is solved, achieving high availability and continuity.
Patent Information
- Application Number
- CN202410989372.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-23
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2044-07-23
AI Technical Summary
In the prior art, DPVS detects the health status of nginx, and nginx detects the health status of back-end pods, but cannot detect the health status of pods in Kubernetes, resulting in traffic that may be forwarded to the invalid pods, causing business interruption.
A load balancing system is designed, including a forwarding plane, a conversation plane and a monitoring plane. The status information of each node is monitored through the monitoring plane module to avoid forwarding traffic to failed nodes, achieving high availability and continuity.
Through modular splitting, each module is responsible for specific functions. The monitoring surface module monitors the node status to avoid traffic forwarding to the failed node, reduces the probability of business interruption, and makes the system highly available and continuity.
Smart Images

Figure CN118945164A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing technology, and in particular to a load balancing system and method, device, and electronic device. Background Art
[0002] With the gradual popularization of kubernetes (also known as k8s or "kube", an open source container orchestration platform that can automate many manual operations involved in the deployment, management and expansion of containerized applications) and the rapid increase in the user scale, products need to introduce a high-availability and high-performance load balancing solution for kubernetes clusters, which must have high performance and can also achieve grayscale release, high availability and other functions.
[0003] The load balancing system uses DPVS (full name Dual-Port Virtual Server, an open source load balancing software that supports L4 (transport layer) load balancing) as the four-layer (transport layer) load balancing, nginx (a high-performance HTTP and reverse proxy server that also supports IMAP / POP3 and other protocols) as the seven-layer (application layer) load balancing, and ingress-nginx as the ingress controller of kubernetes (ingress is an API object used to manage external access to services within the cluster). The request sent by the user will first pass through the DPVS four-layer load balancer, then through the nginx seven-layer load balancer, and finally reach the kubernetes cluster through the ingress-nginx controller; the response returned by the kubernetes cluster will pass through the ingress-nginx controller, nginx load balancer, DPVS load balancer, and finally reach the user.
[0004] At the same time, when the kubernetes cluster load balancing system performs automatic health checks, it checks the health status of the seven-layer load balancing nginx through the four-layer load balancing dpvs, and checks the health status of the kubernetes cluster through the seven-layer load balancing nginx.
[0005] However, in the existing load balancing system, DPVS detects the health status of nginx, and nginx detects the health status of the backend pod (a basic working unit in the Kubernetes cluster, which represents a process in the cluster). DPVS and ingress-nginx cannot detect the health status of the pod in kubernetes, and the traffic may be forwarded to the failed pod, causing business interruption. Summary of the invention
[0006] The present disclosure provides a load balancing system and method, device, and electronic device. Its main purpose is to solve the problem that the load balancing system in the prior art detects the health status of nginx, and nginx detects the health status of the backend pod. DPVS and ingress-nginx cannot detect the health status of the pod in kubernetes, and the traffic may be forwarded to the failed pod, causing business interruption.
[0007] According to a first aspect of the present disclosure, a load balancing system is provided, comprising: a forwarding plane, a session plane, and a monitoring plane.
[0008] The monitoring plane is used to monitor the status information of the forwarding plane and the session plane;
[0009] The forwarding plane is used to obtain the traffic to be forwarded and transmit the forwarding information carried in the traffic to be forwarded to the session plane;
[0010] The session plane is used to respond to the forwarding information, match the configuration information corresponding to the to-be-forwarded traffic from a preset database according to the forwarding information, and interact with the forwarding plane for session and configuration, and transmit the configuration information to the forwarding plane;
[0011] The forwarding plane is further used to receive the configuration information, and perform forwarding processing on the to-be-forwarded traffic according to the configuration information and the state information.
[0012] Optionally, the forwarding plane includes: a transport layer forwarding plane, an application layer forwarding plane, and a cluster forwarding plane.
[0013] The transport layer forwarding plane is used to transmit the forwarding information to the session plane, and receive the first configuration information, and forward the traffic to be forwarded to the application layer forwarding plane according to the first configuration information; wherein the first configuration information includes the first address information of the application layer forwarding plane corresponding to the traffic to be forwarded, and the configuration information includes the first configuration information and the second configuration information;
[0014] The application layer forwarding plane is used to receive the traffic to be forwarded and transmit the forwarding information to the session plane;
[0015] The application layer forwarding plane is further used to receive the second configuration information, and forward the traffic to be forwarded to the cluster forwarding plane according to the second configuration information; wherein the second configuration information includes the second address information of the cluster forwarding plane corresponding to the traffic to be forwarded;
[0016] The cluster forwarding plane is used to receive the traffic to be forwarded.
[0017] Optionally, the session plane includes: a transport layer session plane, an application layer session plane, and a cluster session plane.
[0018] The transport layer session plane is used to receive the forwarding information transmitted by the transport layer forwarding plane, and match the first configuration information corresponding to the to-be-forwarded traffic from the preset database according to the forwarding information, and transmit the first configuration information to the transport layer forwarding plane;
[0019] The application layer session plane is used to receive the forwarding information transmitted by the application layer forwarding plane, match the second configuration information corresponding to the to-be-forwarded traffic from the preset database according to the forwarding information, and transmit the second configuration information to the application layer forwarding plane;
[0020] The cluster session plane is used to perform session and configuration interaction with the cluster forwarding plane.
[0021] Optionally, the monitoring plane is further used to determine whether the configuration information meets a preset configuration condition, generate a forwarding instruction according to the determination result, and transmit the forwarding instruction to the forwarding plane;
[0022] The monitoring plane is also used to obtain the forwarding status of the traffic to be forwarded.
[0023] Optionally, the monitoring plane includes: a transport layer monitoring plane, an application layer monitoring plane, and a cluster monitoring plane.
[0024] The transport layer monitoring plane is used to monitor the first state information of the transport layer forwarding plane and the transport layer session plane, and the first forwarding state of the traffic to be forwarded; wherein the state information includes the first state information, the second state information and the third state information;
[0025] The transport layer monitoring plane is further used to determine whether the first configuration information meets the preset configuration condition, and generate a first forwarding instruction according to the determination result, and transmit the first forwarding instruction to the transport layer forwarding plane; wherein the forwarding instruction includes the first forwarding instruction and the second forwarding instruction;
[0026] The application layer monitoring plane is used to monitor the second state information of the application layer forwarding plane and the application layer session plane, and the second forwarding state of the traffic to be forwarded;
[0027] The application layer monitoring plane is further used to determine whether the second configuration information meets the preset configuration condition, generate the second forwarding instruction according to the determination result, and transmit the second forwarding instruction to the application layer forwarding plane;
[0028] The cluster monitoring plane is used to monitor the third status information of the cluster forwarding plane and the cluster session plane.
[0029] According to a second aspect of the present disclosure, a method for traffic forwarding is provided, the method being applied to the system according to the first aspect, and comprising:
[0030] Obtaining the traffic to be forwarded and state information; wherein the state information is the state information of the device that forwards the traffic to be forwarded;
[0031] Matching configuration information corresponding to the traffic to be forwarded from a preset database according to the forwarding information carried by the traffic to be forwarded;
[0032] The traffic to be forwarded is forwarded according to the configuration information and the status information.
[0033] Optionally, before forwarding the traffic to be forwarded according to the configuration information and the state information, the method further includes:
[0034] Determine whether the configuration information meets the preset configuration conditions, and generate a forwarding instruction according to the determination result;
[0035] Determine whether to forward the traffic to be forwarded according to the forwarding instruction;
[0036] In the case where it is determined that the forwarding instruction is to cancel forwarding, canceling the forwarding processing of the to-be-forwarded traffic;
[0037] When it is determined that the forwarding instruction is to confirm forwarding, forwarding processing is performed on the traffic to be forwarded according to the configuration information and the state information.
[0038] Optionally, generating a forwarding instruction according to the judgment result includes:
[0039] In the case where it is determined that the configuration information meets the preset configuration condition, generating the forwarding instruction for determining forwarding;
[0040] When it is determined that the configuration information does not meet the preset configuration condition, the forwarding instruction for canceling the forwarding is generated.
[0041] According to a third aspect of the present disclosure, a traffic forwarding device is provided, including:
[0042] An acquisition unit, used to acquire the traffic to be forwarded and state information; wherein the state information is the state information of a device that forwards the traffic to be forwarded;
[0043] A matching unit, configured to match configuration information corresponding to the traffic to be forwarded from a preset database according to the forwarding information carried by the traffic to be forwarded;
[0044] A forwarding unit is used to forward the traffic to be forwarded according to the configuration information and the status information.
[0045] Optionally, the device further comprises:
[0046] A judging unit, used to judge whether the configuration information meets a preset configuration condition;
[0047] A generating unit, used for generating a forwarding instruction according to the judgment result;
[0048] A determination unit, configured to determine whether to forward the traffic to be forwarded according to the forwarding instruction;
[0049] a cancelling unit, configured to cancel the forwarding processing of the to-be-forwarded traffic when it is determined that the forwarding instruction is to cancel the forwarding;
[0050] The forwarding unit is further configured to, when it is determined that the forwarding instruction is to confirm forwarding, perform forwarding processing on the traffic to be forwarded according to the configuration information and the state information.
[0051] Optionally, the generating unit is further used for:
[0052] In the case where it is determined that the configuration information meets the preset configuration condition, generating the forwarding instruction for determining forwarding;
[0053] When it is determined that the configuration information does not meet the preset configuration condition, the forwarding instruction for canceling the forwarding is generated.
[0054] According to a fourth aspect of the present disclosure, there is provided an electronic device, including:
[0055] at least one processor; and
[0056] a memory communicatively connected to the at least one processor; wherein,
[0057] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method described in the second aspect.
[0058] According to a fifth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the method described in the second aspect.
[0059] According to a sixth aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the method described in the second aspect is implemented.
[0060] The load balancing system and method, device, and electronic device provided by the present disclosure include: a forwarding plane, a session plane, and a monitoring plane, wherein the monitoring plane is used to monitor the status information of the forwarding plane and the session plane; the forwarding plane is used to obtain the traffic to be forwarded, and transmit the forwarding information carried in the traffic to be forwarded to the session plane; the session plane is used to respond to the forwarding information, match the configuration information corresponding to the traffic to be forwarded from a preset database according to the forwarding information, and interact with the forwarding plane for session and configuration, and transmit the configuration information to the forwarding plane; the forwarding plane is also used to receive the configuration information, and forward the traffic to be forwarded according to the configuration information and the status information. Compared with the related art, the embodiment of the present disclosure performs modular splitting, each module is only responsible for its own function, and monitors the status information of each node of the system through the monitoring plane module, so as to avoid forwarding the traffic to be forwarded to the failed node, reduce the probability of service interruption, and make the system have continuity and high availability.
[0061] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0063] Figure 1 A structural diagram of a load balancing system provided by an embodiment of the present disclosure;
[0064] Figure 2 A schematic diagram of the interaction logic between a forwarding plane and a session plane provided in an embodiment of the present disclosure;
[0065] Figure 3 A schematic diagram of an interactive logic of a monitoring surface provided by an embodiment of the present disclosure;
[0066] Figure 4 A schematic diagram of the architecture of a load balancing system provided by an embodiment of the present disclosure;
[0067] Figure 5 A flow chart of a method for forwarding traffic provided by an embodiment of the present disclosure;
[0068] Figure 6A schematic diagram of the structure of a traffic forwarding device provided by an embodiment of the present disclosure;
[0069] Figure 7 A schematic diagram of the structure of another traffic forwarding device provided by an embodiment of the present disclosure;
[0070] Figure 8 A schematic block diagram of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0071] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0072] The following describes the load balancing system and method, device, and electronic device according to the embodiments of the present disclosure with reference to the accompanying drawings.
[0073] The load balancing system disclosed in the present invention divides the load balancing of the K8S cluster into three modules, namely the forwarding plane (FP), the session plane (SP), and the monitoring plane (MP). Figure 1 A schematic diagram of the structure of a load balancing system provided in an embodiment of the present disclosure.
[0074] like Figure 1 As shown, the load balancing system includes: a forwarding plane 11, a session plane 12 and a monitoring plane 13.
[0075] The monitoring plane 13 is used to monitor the status information of the forwarding plane 11 and the session plane 12;
[0076] The forwarding plane 11 is used to obtain the traffic to be forwarded and transmit the forwarding information carried in the traffic to be forwarded to the session plane 12;
[0077] The session plane 12 is used to respond to the forwarding information, match the configuration information corresponding to the to-be-forwarded traffic from a preset database according to the forwarding information, and interact with the forwarding plane 11 for session and configuration, and transmit the configuration information to the forwarding plane 11;
[0078] The forwarding plane 11 is further configured to receive the configuration information, and perform forwarding processing on the traffic to be forwarded according to the configuration information and the state information.
[0079] Among them, each module, namely the forwarding plane 11, the session plane 12 and the monitoring plane 13, includes three levels, namely, the forwarding plane 11 includes a four-layer (transport layer) forwarding plane 111, a seven-layer (application layer) forwarding plane 112 and a cluster (for example: a kubernetes cluster) forwarding plane 113; the session plane 12 includes a four-layer (transport layer) session plane 121, a seven-layer (application layer) session plane 122 and a cluster (for example: a kubernetes cluster) session plane 123; the monitoring plane 13 includes a four-layer (transport layer) monitoring plane 131, a seven-layer (application layer) monitoring plane 132 and a cluster (for example: a kubernetes cluster) monitoring plane 133, etc.
[0080] The forwarding plane 11 is responsible for forwarding the traffic to be forwarded, and the traffic to be forwarded goes from user->four-layer FP (four-layer forwarding plane) 111->seven-layer FP112->kubernetes cluster FP113; the session plane 12 is responsible for interacting with the forwarding plane 11 for session and configuration. Each time the forwarding plane 11 forwards traffic, it must first find the corresponding session and configuration information from the session plane 12; the monitoring plane 13 is responsible for health checks and reporting of monitoring information, which records the health status of each forwarding plane 11 and reports the traffic to the server.
[0081] It should be noted that each level of the forwarding plane 11 includes multiple nodes, that is, the transport layer forwarding plane 111 includes multiple transport layer nodes, the application layer forwarding plane 112 includes multiple application layer nodes, the cluster forwarding plane contains multiple kubernetes cluster nodes, etc. Specifically, the number of nodes at each level is not limited in the embodiments of the present disclosure.
[0082] The load balancing system provided by the present disclosure includes: a forwarding plane, a session plane and a monitoring plane, wherein the monitoring plane is used to monitor the status information of the forwarding plane and the session plane; the forwarding plane is used to obtain the traffic to be forwarded, and transmit the forwarding information carried in the traffic to be forwarded to the session plane; the session plane is used to respond to the forwarding information, match the configuration information corresponding to the traffic to be forwarded from a preset database according to the forwarding information, and interact with the forwarding plane for session and configuration, and transmit the configuration information to the forwarding plane; the forwarding plane is also used to receive the configuration information, and forward the traffic to be forwarded according to the configuration information and the status information. Compared with the related art, the embodiment of the present disclosure performs modular splitting, each module is only responsible for its own function, and monitors the status information of each node of the system through the monitoring plane module, which can avoid forwarding the traffic to be forwarded to the failed node, reduce the probability of service interruption, and make the system have continuity and high availability.
[0083] In an implementable manner of the embodiment of the present disclosure, the forwarding plane 11 includes: a transport layer forwarding plane 111, an application layer forwarding plane 112, and a cluster forwarding plane 113.
[0084] The transport layer forwarding plane 111 is used to transmit the forwarding information to the session plane 12, and receive the first configuration information, and forward the traffic to be forwarded to the application layer forwarding plane 112 according to the first configuration information; wherein the first configuration information includes the first address information of the application layer forwarding plane corresponding to the traffic to be forwarded, and the configuration information includes the first configuration information and the second configuration information;
[0085] The application layer forwarding plane 112 is used to receive the traffic to be forwarded and transmit the forwarding information to the session plane 12;
[0086] The application layer forwarding plane 112 is further used to receive the second configuration information, and forward the traffic to be forwarded to the cluster forwarding plane 113 according to the second configuration information; wherein the second configuration information includes the second address information of the cluster forwarding plane corresponding to the traffic to be forwarded;
[0087] The cluster forwarding plane 113 is used to receive the traffic to be forwarded.
[0088] In an implementable manner of the embodiment of the present disclosure, the session plane 12 includes: a transport layer session plane 121, an application layer session plane 122, and a cluster session plane 123.
[0089] The transport layer session plane 121 is used to receive the forwarding information transmitted by the transport layer forwarding plane 111, and match the first configuration information corresponding to the to-be-forwarded traffic from the preset database according to the forwarding information, and transmit the first configuration information to the transport layer forwarding plane;
[0090] The application layer session plane 121 is used to receive the forwarding information transmitted by the application layer forwarding plane 112, and match the second configuration information corresponding to the to-be-forwarded traffic from the preset database according to the forwarding information, and transmit the second configuration information to the application layer forwarding plane;
[0091] The cluster session plane 123 is used to interact with the cluster forwarding plane 113 for session and configuration.
[0092] In summary of the above embodiments, the session plane 12 and the forwarding plane 11 will interact with each other in terms of session and configuration, and the interaction process may be performed by, but is not limited to, Figure 2 To explain, Figure 2A logical diagram of the interaction between a forwarding plane and a session plane is provided for an embodiment of the present disclosure, wherein DPVS is selected as the main balancer for the four-layer part of load balancing (transport layer forwarding plane 111 and transport layer session plane 121), and the transport layer forwarding plane 111 and the transport layer session plane 121 of DPVS are both in one machine. On this basis, DPVS agent is developed to perform DPVS session management, so that users can establish and modify DPVS sessions through APIs. Therefore, the transport layer session plane 121 will select DPVS agent as the main balancer.
[0093] Nginx is selected as the main balancer for the seven-layer part of load balancing (application layer forwarding plane 112 and application layer session plane 122). Since the nginx of the application layer session plane 122 contains more session information, it is necessary to improve the open source nginx and interact with etcd through the nginx agent interface as the main balancer of the application layer session plane 122, where etcd represents the preset database.
[0094] The session layer and forwarding layer (cluster forwarding plane 113 and cluster session plane 123) in the kubernetes cluster are both completed through the open source ingress-nginx.
[0095] In an implementation manner of the embodiment of the present disclosure, the monitoring plane 13 is further used to determine whether the configuration information meets the preset configuration condition, and generate a forwarding instruction according to the determination result, and transmit the forwarding instruction to the forwarding plane 11;
[0096] The monitoring plane 13 is further used to obtain the forwarding status of the traffic to be forwarded.
[0097] In an implementable manner of the embodiment of the present disclosure, the monitoring plane 13 includes: a transport layer monitoring plane 131, an application layer monitoring plane 132, and a cluster monitoring plane 133.
[0098] The transport layer monitoring plane 131 is used to monitor the first state information of the transport layer forwarding plane 111 and the transport layer session plane 121, and the first forwarding state of the traffic to be forwarded; wherein the state information includes the first state information, the second state information and the third state information;
[0099] The transport layer monitoring plane 131 is further used to determine whether the first configuration information meets the preset configuration condition, and generate a first forwarding instruction according to the determination result, and transmit the first forwarding instruction to the transport layer forwarding plane 111; wherein the forwarding instruction includes the first forwarding instruction and the second forwarding instruction;
[0100] The application layer monitoring plane 132 is used to monitor the second state information of the application layer forwarding plane 112 and the application layer session plane 122, and the second forwarding state of the traffic to be forwarded;
[0101] The application layer monitoring plane 132 is further used to determine whether the second configuration information meets the preset configuration condition, and generate the second forwarding instruction according to the determination result, and transmit the second forwarding instruction to the application layer forwarding plane 112;
[0102] The cluster monitoring plane 133 is used to monitor the third status information of the cluster forwarding plane 113 and the cluster session plane 123 .
[0103] For ease of understanding, the present disclosure provides a schematic diagram of an interactive logic of a monitoring surface, such as Figure 3 As shown, the monitoring plane 13 is responsible for three functions: the first is to check whether the configuration file is correctly synchronized, the second is to check the health status of the forwarding plane 11, and the third is to monitor the traffic and report it to the monitoring product. Through dpvs monitor (transport layer monitoring plane 131), monitor the traffic of dpvs (transport layer forwarding plane 111) and check the node status of each dpvs, and report the monitoring information to the monitoring product. Through nginx monitor (application layer monitoring plane 132), monitor the traffic of nginx (application layer forwarding plane 112), compare the configuration information in the etcd (preset database) cluster, and check the node status of each nginx (application layer forwarding plane 112). Through ingress-nginx monitor (cluster monitoring plane 133), monitor the traffic of the kubernetes cluster, compare whether the configuration information of ingress-nginx (cluster forwarding plane 113) is synchronized, check the node status of the kubernetes cluster (cluster forwarding plane 113) and report it to the server.
[0104] It should be noted that since the session plane 12 contains a lot of session information, it is necessary to improve the open source nginx and interact with etcd through the nginx agent interface. The session plane 12 is mainly used to save information. Therefore, etcd represents the preset database while also representing the application layer forwarding plane 112 and the cluster forwarding plane 113.
[0105] Specifically, regarding the load balancing architecture, the embodiment of the present disclosure provides a schematic diagram of the architecture of a load balancing system, such as Figure 4As shown, the traffic to be forwarded passes through dpvs (transport layer forwarding plane 111) on the forwarding plane 11 to nginx (application layer forwarding plane 112), and then passes through ingress-nginx to the kubernetes cluster (cluster forwarding plane 113). The configuration information is obtained through the session plane 12, and the monitoring information and health check are implemented through the monitoring plane 13, thereby realizing a highly available kubernetes cluster load balancing architecture.
[0106] Figure 5 The following is a flow chart of a method for forwarding traffic provided by an embodiment of the present disclosure. Figure 5 As shown, the method comprises the following steps:
[0107] Step 501, obtaining the traffic to be forwarded and state information; wherein the state information is the state information of the device that forwards the traffic to be forwarded.
[0108] In the embodiment of the present disclosure, the traffic to be forwarded is traffic information obtained from the user, and the status information includes but is not limited to: the health status of each node of the device that forwards the traffic to be forwarded, the switch status of each node of the device that forwards the traffic to be forwarded, etc. Specifically, the embodiment of the present disclosure does not limit the status information.
[0109] Step 502: matching configuration information corresponding to the traffic to be forwarded from a preset database according to the forwarding information carried by the traffic to be forwarded.
[0110] In the embodiment of the present disclosure, the forwarding information includes but is not limited to: the destination node of the traffic to be forwarded, the traffic information of the traffic to be forwarded, etc., and the configuration information includes but is not limited to: the address information of the destination node of the traffic to be forwarded, etc. Specifically, the embodiment of the present disclosure does not impose any restrictions on the forwarding information and the configuration information.
[0111] Step 503: forwarding the traffic to be forwarded according to the configuration information and the status information.
[0112] In the embodiment of the present disclosure, after determining the address information of the destination node of the traffic to be forwarded according to the configuration information, it is determined whether the destination node of the traffic to be forwarded is in an invalid state according to the status information. If the destination node of the traffic to be forwarded is not in an invalid state, the traffic to be forwarded is forwarded to the destination node. If the destination node of the traffic to be forwarded is in an invalid state, the forwarding of the traffic to be forwarded is canceled, and a prompt is issued to facilitate the user to re-forward the traffic.
[0113] The load balancing method provided by the present disclosure includes: a forwarding plane, a session plane and a monitoring plane, wherein the monitoring plane is used to monitor the status information of the forwarding plane and the session plane; the forwarding plane is used to obtain the traffic to be forwarded, and transmit the forwarding information carried in the traffic to be forwarded to the session plane; the session plane is used to respond to the forwarding information, match the configuration information corresponding to the traffic to be forwarded from a preset database according to the forwarding information, and interact with the forwarding plane for session and configuration, and transmit the configuration information to the forwarding plane; the forwarding plane is also used to receive the configuration information, and forward the traffic to be forwarded according to the configuration information and the status information. Compared with the related art, the embodiment of the present disclosure performs modular splitting, each module is only responsible for its own function, and monitors the status information of each node of the system through the monitoring plane module, which can avoid forwarding the traffic to be forwarded to the failed node, reduce the probability of service interruption, and make the system have continuity and high availability.
[0114] In one implementable manner of the embodiment of the present disclosure, before forwarding the traffic to be forwarded according to the configuration information and the status information, the following method may also be used but is not limited to: judging whether the configuration information meets the preset configuration conditions, and generating a forwarding instruction according to the judgment result; determining whether to forward the traffic to be forwarded according to the forwarding instruction; canceling the forwarding processing of the traffic to be forwarded when it is determined that the forwarding instruction is to cancel forwarding; forwarding the traffic to be forwarded according to the configuration information and the status information when it is determined that the forwarding instruction is to confirm forwarding.
[0115] In the embodiment of the present disclosure, the preset configuration condition is a condition of custom setting, for example: whether the format and content of the configuration information are correct, etc. Specifically, the preset configuration condition is not limited in the embodiment of the present disclosure.
[0116] In one implementable manner of the embodiment of the present disclosure, the forwarding instruction generated based on the judgment result can also be implemented in but not limited to the following manner: when it is determined that the configuration information meets the preset configuration conditions, the forwarding instruction for confirming forwarding is generated; when it is determined that the configuration information does not meet the preset configuration conditions, the forwarding instruction for canceling forwarding is generated.
[0117] In the embodiment of the present disclosure, by judging the configuration information, the correctness of the configuration information can be ensured, and it can be ensured that the traffic to be forwarded can be accurately forwarded to the destination node.
[0118] In summary, the embodiments of the present disclosure can achieve the following effects:
[0119] 1. The disclosed embodiment performs modular splitting, where each module is responsible for its own function and monitors the status information of each node in the system through the monitoring plane module. This can avoid forwarding the traffic to be forwarded to failed nodes, reduce the probability of business interruption, and ensure the continuity and high availability of the system.
[0120] 2. Compared with the existing solutions, which do not perform modular splitting, resulting in low traffic forwarding efficiency and inability to perceive node information in each link, the disclosed embodiment uses modular splitting, where each link is only responsible for its own function, thereby improving efficiency.
[0121] 3. The disclosed embodiment monitors the status information of each node of the system through the monitoring plane module, and can perceive the status of each node of the system, avoiding the situation that the health status of the Kubernetes cluster can only be detected through the seven-layer load balancing and cannot be perceived by the four-layer load balancing.
[0122] 4. The disclosed embodiment can timely perceive the synchronization status of configuration information, thereby avoiding the problem that new configuration rules cannot take effect if the configuration information of the fourth layer and the seventh layer is not synchronized in time.
[0123] Corresponding to the above-mentioned traffic forwarding method, the present invention also provides a traffic forwarding device. Since the device embodiment of the present invention corresponds to the above-mentioned method embodiment, details not disclosed in the device embodiment can be referred to the above-mentioned method embodiment, and will not be repeated in the present invention.
[0124] Figure 6 A schematic diagram of a flow forwarding device provided in an embodiment of the present disclosure is shown in FIG. Figure 6 As shown, including:
[0125] The acquisition unit 61 is used to acquire the traffic to be forwarded and state information; wherein the state information is the state information of the device that forwards the traffic to be forwarded;
[0126] A matching unit 62, configured to match configuration information corresponding to the traffic to be forwarded from a preset database according to the forwarding information carried by the traffic to be forwarded;
[0127] The forwarding unit 63 is used to forward the traffic to be forwarded according to the configuration information and the state information.
[0128] The load balancing device provided by the present disclosure includes: a forwarding plane, a session plane and a monitoring plane, wherein the monitoring plane is used to monitor the status information of the forwarding plane and the session plane; the forwarding plane is used to obtain the traffic to be forwarded, and transmit the forwarding information carried in the traffic to be forwarded to the session plane; the session plane is used to respond to the forwarding information, match the configuration information corresponding to the traffic to be forwarded from a preset database according to the forwarding information, and interact with the forwarding plane for session and configuration, and transmit the configuration information to the forwarding plane; the forwarding plane is also used to receive the configuration information, and forward the traffic to be forwarded according to the configuration information and the status information. Compared with the related art, the embodiment of the present disclosure performs modular splitting, each module is only responsible for its own function, and monitors the status information of each node of the system through the monitoring plane module, which can avoid forwarding the traffic to be forwarded to the failed node, reduce the probability of service interruption, and make the system have continuity and high availability.
[0129] Furthermore, in a possible implementation of the embodiment of the present disclosure, as Figure 7 As shown, the device also includes:
[0130] A judging unit 64, configured to judge whether the configuration information meets a preset configuration condition;
[0131] A generating unit 65, configured to generate a forwarding instruction according to the determination result;
[0132] A determination unit 66, configured to determine whether to forward the traffic to be forwarded according to the forwarding instruction;
[0133] A cancelling unit 67, configured to cancel the forwarding process of the traffic to be forwarded when it is determined that the forwarding instruction is to cancel the forwarding;
[0134] The forwarding unit 63 is further configured to, when it is determined that the forwarding instruction is to confirm forwarding, forward the traffic to be forwarded according to the configuration information and the state information.
[0135] Furthermore, in a possible implementation of the embodiment of the present disclosure, the generating unit 65 is further configured to:
[0136] In the case where it is determined that the configuration information meets the preset configuration condition, generating the forwarding instruction for determining forwarding;
[0137] When it is determined that the configuration information does not meet the preset configuration condition, the forwarding instruction for canceling the forwarding is generated.
[0138] It should be noted that the above explanation of the method embodiment is also applicable to the device of the embodiment of the present disclosure, and the principle is the same, which is no longer limited in the embodiment of the present disclosure.
[0139] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0140] Figure 8 A schematic block diagram of an example electronic device 800 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0141] like Figure 8 As shown, the device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a ROM (Read-Only Memory) 802 or a computer program loaded from a storage unit 808 to a RAM (Random Access Memory) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An I / O (Input / Output) interface 805 is also connected to the bus 804.
[0142] A number of components in the device 800 are connected to the I / O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0143] The computing unit 801 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a CPU (Central Processing Unit), a GPU (Graphic Processing Units), various dedicated AI (Artificial Intelligence) computing chips, various computing units running machine learning model algorithms, a DSP (Digital Signal Processor), and any appropriate processor, controller, microcontroller, etc. The computing unit 801 performs the various methods and processes described above, such as a method for traffic forwarding. For example, in some embodiments, the method for traffic forwarding may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded into the RAM 803 and executed by the computing unit 801, one or more steps of the method described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to perform the aforementioned traffic forwarding method in any other appropriate manner (eg, by means of firmware).
[0144] Various embodiments of the systems and techniques described above herein may be implemented in digital electronic circuit systems, integrated circuit systems, FPGAs (Field Programmable Gate Arrays), ASICs (Application-Specific Integrated Circuits), ASSPs (Application Specific Standard Products), SOCs (System On Chips), CPLDs (Complex Programmable Logic Devices), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: being implemented in one or more computer programs that may be executed and / or interpreted on a programmable system including at least one programmable processor that may be a dedicated or general-purpose programmable processor that may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0145] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0146] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a RAM, a ROM, an EPROM (Electrically Programmable Read-Only-Memory) or a flash memory, an optical fiber, a CD-ROM (Compact Dis sc Read-Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0147] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (Cathode-Ray Tube) or LCD (Liquid Crystal Display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0148] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: LAN (Local Area Network), WAN (Wide Area Network), the Internet, and blockchain networks.
[0149] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.
[0150] It should be noted that artificial intelligence is a discipline that studies how computers can simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.), and includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, as well as machine learning / deep learning, big data processing technology, knowledge graph technology, and other major directions.
[0151] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0152] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A load balancing system, characterized in that: include: Forwarding plane, session plane and monitoring plane, The monitoring plane is used to monitor the status information of the forwarding plane and the session plane; The forwarding plane is used to obtain the traffic to be forwarded and transmit the forwarding information carried in the traffic to be forwarded to the session plane; The session plane is used to respond to the forwarding information, match the configuration information corresponding to the to-be-forwarded traffic from a preset database according to the forwarding information, and interact with the forwarding plane for session and configuration, and transmit the configuration information to the forwarding plane; The forwarding plane is further used to receive the configuration information, and perform forwarding processing on the to-be-forwarded traffic according to the configuration information and the state information.
2. The system according to claim 1, characterized in that The forwarding plane includes: a transport layer forwarding plane, an application layer forwarding plane, and a cluster forwarding plane. The transport layer forwarding plane is used to transmit the forwarding information to the session plane, and receive the first configuration information, and forward the traffic to be forwarded to the application layer forwarding plane according to the first configuration information; wherein the first configuration information includes the first address information of the application layer forwarding plane corresponding to the traffic to be forwarded, and the configuration information includes the first configuration information and the second configuration information; The application layer forwarding plane is used to receive the traffic to be forwarded and transmit the forwarding information to the session plane; The application layer forwarding plane is further used to receive the second configuration information, and forward the traffic to be forwarded to the cluster forwarding plane according to the second configuration information; wherein the second configuration information includes the second address information of the cluster forwarding plane corresponding to the traffic to be forwarded; The cluster forwarding plane is used to receive the traffic to be forwarded.
3. The system according to claim 2, characterized in that The session plane includes: a transport layer session plane, an application layer session plane, and a cluster session plane. The transport layer session plane is used to receive the forwarding information transmitted by the transport layer forwarding plane, and match the first configuration information corresponding to the to-be-forwarded traffic from the preset database according to the forwarding information, and transmit the first configuration information to the transport layer forwarding plane; The application layer session plane is used to receive the forwarding information transmitted by the application layer forwarding plane, match the second configuration information corresponding to the to-be-forwarded traffic from the preset database according to the forwarding information, and transmit the second configuration information to the application layer forwarding plane; The cluster session plane is used to perform session and configuration interaction with the cluster forwarding plane.
4. The system according to claim 3, characterized in that The monitoring plane is further used to determine whether the configuration information meets the preset configuration conditions, and generate a forwarding instruction according to the determination result, and transmit the forwarding instruction to the forwarding plane; The monitoring plane is also used to obtain the forwarding status of the traffic to be forwarded.
5. The system according to claim 4, characterized in that The monitoring plane includes: transport layer monitoring plane, application layer monitoring plane, and cluster monitoring plane. The transport layer monitoring plane is used to monitor the first state information of the transport layer forwarding plane and the transport layer session plane, and the first forwarding state of the traffic to be forwarded; wherein the state information includes the first state information, the second state information and the third state information; The transport layer monitoring plane is further used to determine whether the first configuration information meets the preset configuration condition, and generate a first forwarding instruction according to the determination result, and transmit the first forwarding instruction to the transport layer forwarding plane; wherein the forwarding instruction includes the first forwarding instruction and the second forwarding instruction; The application layer monitoring plane is used to monitor the second state information of the application layer forwarding plane and the application layer session plane, and the second forwarding state of the traffic to be forwarded; The application layer monitoring plane is further used to determine whether the second configuration information meets the preset configuration condition, generate the second forwarding instruction according to the determination result, and transmit the second forwarding instruction to the application layer forwarding plane; The cluster monitoring plane is used to monitor the third state information of the cluster forwarding plane and the cluster session plane.
6. A method for traffic forwarding, the method being applied to the system according to any one of claims 1 to 5, characterized in that: include: Obtaining the traffic to be forwarded and state information; wherein the state information is the state information of the device that forwards the traffic to be forwarded; Matching configuration information corresponding to the traffic to be forwarded from a preset database according to the forwarding information carried by the traffic to be forwarded; The traffic to be forwarded is forwarded according to the configuration information and the status information.
7. The method according to claim 5, characterized in that Before forwarding the traffic to be forwarded according to the configuration information and the state information, the method further includes: Determine whether the configuration information meets the preset configuration conditions, and generate a forwarding instruction according to the determination result; Determine whether to forward the traffic to be forwarded according to the forwarding instruction; In the case where it is determined that the forwarding instruction is to cancel forwarding, canceling the forwarding processing of the to-be-forwarded traffic; When it is determined that the forwarding instruction is to confirm forwarding, forwarding processing is performed on the traffic to be forwarded according to the configuration information and the state information.
8. The method according to claim 7, characterized in that Generating a forwarding instruction according to the judgment result includes: In the case where it is determined that the configuration information meets the preset configuration condition, generating the forwarding instruction for determining forwarding; When it is determined that the configuration information does not meet the preset configuration condition, the forwarding instruction for canceling the forwarding is generated.
9. A traffic forwarding device, characterized in that: include: An acquisition unit, used to acquire the traffic to be forwarded and state information; wherein the state information is the state information of a device that forwards the traffic to be forwarded; A matching unit, configured to match configuration information corresponding to the traffic to be forwarded from a preset database according to the forwarding information carried by the traffic to be forwarded; A forwarding unit is used to forward the traffic to be forwarded according to the configuration information and the status information.
10. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 6 to 8.
Citation Information
Patent Citations
Soft load balancing splitting automation system and operation method thereof
CN109451065A
Load balancing method and load balancing system between four-layer and seven-layer networks based on Nginx
CN111988423A
Software load balancing health degree evaluation method and system, medium and equipment
CN112001623A
Gateway system, gateway, message forwarding method and program product
CN114979016A
Dynamic load balancing method and device based on Nginx
CN115941694A
