Global load balancing method and device, readable storage medium and electronic equipment
The vectorized message processing engine directly performs global load balancing processing on the network card data plane, solving the problem of performance limitation of the kernel protocol stack and achieving a more efficient global load balancing effect.
Patent Information
- Application Number
- CN202411276390.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-12
- Publication Date
- 2024-12-03
AI Technical Summary
The existing global load balancing method is limited by the performance of the kernel protocol stack, which affects its effectiveness.
The vectorized message processing engine takes over the data plane of the network card and directly performs global load balancing processing, bypasses the kernel protocol stack, avoids data copying, and achieves zero-copy data interaction.
It effectively improves the effect of global load balancing, get rid of dependence on the kernel protocol stack, and improves performance.
Smart Images

Figure CN119071233A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer technology, and in particular, relates to a global load balancing method, device, computer-readable storage medium, and electronic device. Background Art
[0002] Global load balancing is a network traffic management technology that can distribute user requests to multiple servers or service nodes globally (usually across multiple data centers or geographical locations) to improve the availability, reliability and response speed of applications while optimizing resource utilization. In the prior art, global load balancing is generally performed through the kernel protocol stack of the operating system, which is subject to the performance limitations of the kernel protocol stack, thus adversely affecting the effect of global load balancing. Summary of the invention
[0003] In view of this, embodiments of the present application provide a global load balancing method, device, computer-readable storage medium and electronic device to solve the problem that the existing global load balancing method is subject to the performance limitations of the kernel protocol stack, thereby adversely affecting the effect of global load balancing.
[0004] A first aspect of an embodiment of the present application provides a global load balancing method, which may include:
[0005] Receiving a domain name system request message sent by a client through a network card, and forwarding the domain name system request message to a vectorized message processing engine through the network card;
[0006] Performing global load balancing processing on the domain name system request message through the vectored message processing engine to obtain a domain name system response message; wherein the domain name system response message includes a target Internet Protocol address corresponding to the domain name system request message;
[0007] The domain name system response message is forwarded by the vectored message processing engine to the network card, and the domain name system response message is sent to the client through the network card.
[0008] In a specific implementation of the first aspect, the vectored message processing engine may include a domain name system processing node and a global load balancing processing node;
[0009] The performing global load balancing processing on the domain name system request message by the vectorized message processing engine to obtain a domain name system response message may include:
[0010] Parsing the domain name system request message through the domain name system processing node to obtain a target domain name corresponding to the domain name system request message, and forwarding the target domain name to the global load balancing processing node;
[0011] The target Internet Protocol address is determined according to the target domain name through the global load balancing processing node, and the domain name system response message is constructed according to the target Internet Protocol address.
[0012] In a specific implementation of the first aspect, determining the target Internet Protocol address according to the target domain name may include:
[0013] In the case where a domain name system mapping corresponding to the target domain name exists, performing address pool scheduling in each address pool in the domain name system mapping to obtain a target address pool;
[0014] Address scheduling is performed among the Internet Protocol addresses in the target address pool to obtain the target Internet Protocol address.
[0015] In a specific implementation of the first aspect, performing address pool scheduling in each address pool in the domain name system mapping to obtain a target address pool may include:
[0016] In the case where there is an address pool priority in the domain name system mapping, address pool scheduling is performed in each address pool in the domain name system mapping based on the address pool priority and the address pool scheduling policy in the domain name system mapping to obtain the target address pool;
[0017] In the case that the address pool priority does not exist in the domain name system mapping, address pool scheduling is performed in each address pool in the domain name system mapping based on the address pool scheduling policy in the domain name system mapping to obtain the target address pool.
[0018] In a specific implementation of the first aspect, performing address scheduling among the Internet Protocol addresses in the target address pool to obtain the target Internet Protocol address may include:
[0019] In the case where there is an address priority in the target address pool, performing address scheduling in each Internet Protocol address in the target address pool based on the address priority and the address scheduling policy in the target address pool to obtain the target Internet Protocol address;
[0020] In the case that the address priority does not exist in the target address pool, address scheduling is performed among the Internet Protocol addresses in the target address pool based on the address scheduling policy in the target address pool to obtain the target Internet Protocol address.
[0021] In a specific implementation of the first aspect, determining the target Internet Protocol address according to the target domain name may also include:
[0022] If there is a domain name system record corresponding to the target domain name, determine the target Internet Protocol address according to the domain name system record;
[0023] In the absence of the domain name system mapping and the absence of the domain name system record, the target Internet Protocol address is determined to be empty.
[0024] In a specific implementation of the first aspect, the vectored message processing engine may further include a message input node, a first message routing link, a second message routing link, and a message output node;
[0025] The step of forwarding the domain name system request message from the network card to the vectored message processing engine may include:
[0026] forwarding the domain name system request message from the network card to the message input node;
[0027] Before the domain name system request message is parsed by the domain name system processing node, the method may further include:
[0028] forwarding the domain name system request message from the message input node to the domain name system processing node via the first message routing link;
[0029] After constructing the domain name system response message according to the target Internet Protocol address, the method may further include:
[0030] forwarding the domain name system response message from the global load balancing processing node to the message output node via the second message routing link;
[0031] The forwarding of the domain name system response message by the vectored message processing engine to the network card may include:
[0032] The domain name system response message is forwarded from the message output node to the network card.
[0033] A second aspect of an embodiment of the present application provides a global load balancing device, which may include:
[0034] A request message input module, used for receiving a domain name system request message sent by a client through a network card, and forwarding the domain name system request message from the network card to a vectorized message processing engine;
[0035] A global load balancing processing module, configured to perform global load balancing processing on the domain name system request message through the vectored message processing engine to obtain a domain name system response message; wherein the domain name system response message includes a target Internet Protocol address corresponding to the domain name system request message;
[0036] A response message output module is used to forward the domain name system response message from the vectorized message processing engine to the network card, and send the domain name system response message to the client through the network card.
[0037] In a specific implementation of the second aspect, the vectored message processing engine may include a domain name system processing node and a global load balancing processing node;
[0038] The global load balancing processing module may include:
[0039] A message parsing submodule, configured to parse the domain name system request message through the domain name system processing node, obtain a target domain name corresponding to the domain name system request message, and forward the target domain name to the global load balancing processing node;
[0040] The global load balancing processing submodule is used to determine the target Internet Protocol address according to the target domain name through the global load balancing processing node, and construct the domain name system response message according to the target Internet Protocol address.
[0041] In a specific implementation of the second aspect, the global load balancing processing submodule may include:
[0042] An address pool scheduling unit, configured to perform address pool scheduling in each address pool in the domain name system mapping to obtain a target address pool when there is a domain name system mapping corresponding to the target domain name;
[0043] The address scheduling unit is used to perform address scheduling among the Internet Protocol addresses in the target address pool to obtain the target Internet Protocol address.
[0044] In a specific implementation of the second aspect, the address pool scheduling unit can be specifically used to: when there is an address pool priority in the domain name system mapping, based on the address pool priority and the address pool scheduling policy in the domain name system mapping, perform address pool scheduling in each address pool in the domain name system mapping to obtain the target address pool; when there is no address pool priority in the domain name system mapping, based on the address pool scheduling policy in the domain name system mapping, perform address pool scheduling in each address pool in the domain name system mapping to obtain the target address pool.
[0045] In a specific implementation of the second aspect, the address scheduling unit can be specifically used to: when there is an address priority in the target address pool, based on the address priority and the address scheduling policy in the target address pool, perform address scheduling among each Internet Protocol address in the target address pool to obtain the target Internet Protocol address; when there is no address priority in the target address pool, based on the address scheduling policy in the target address pool, perform address scheduling among each Internet Protocol address in the target address pool to obtain the target Internet Protocol address.
[0046] In a specific implementation of the second aspect, the global load balancing processing submodule may further include:
[0047] a domain name system record processing unit, configured to determine the target Internet Protocol address according to the domain name system record if there is a domain name system record corresponding to the target domain name;
[0048] An exception handling unit is used to determine that the target Internet Protocol address is empty when the domain name system mapping does not exist and the domain name system record does not exist.
[0049] In a specific implementation of the second aspect, the vectored message processing engine may further include a message input node, a first message routing link, a second message routing link, and a message output node;
[0050] The request message input module may be specifically used to: forward the domain name system request message from the network card to the message input node;
[0051] The global load balancing processing module may also include:
[0052] a first routing submodule, configured to forward the domain name system request message from the message input node to the domain name system processing node via the first message routing link;
[0053] a second routing submodule, configured to forward the domain name system response message from the global load balancing processing node to the message output node via the second message routing link;
[0054] The response message output module may be specifically configured to: forward the domain name system response message from the message output node to the network card.
[0055] A third aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any one of the above-mentioned global load balancing methods are implemented.
[0056] A fourth aspect of an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any one of the above-mentioned global load balancing methods when executing the computer program.
[0057] A fifth aspect of an embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes the steps of any one of the above-mentioned global load balancing methods.
[0058] Compared with the prior art, the embodiments of the present application have the following beneficial effects: the embodiments of the present application receive a domain name system request message sent by a client through a network card, and forward the domain name system request message to a vectorized message processing engine by the network card; the domain name system request message is globally load balanced by the vectorized message processing engine to obtain a domain name system response message; wherein the domain name system response message includes a target Internet Protocol address corresponding to the domain name system request message; the domain name system response message is forwarded to the network card by the vectorized message processing engine, and the domain name system response message is sent to the client through the network card. Through the embodiments of the present application, the dependence on the kernel protocol stack can be eliminated, and global load balancing can be performed through the vectorized message processing engine, which is no longer limited by the performance of the kernel protocol stack, thereby effectively improving the effect of global load balancing. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0060] Figure 1 A schematic diagram of an application scenario of an embodiment of the present application;
[0061] Figure 2 This is a comparison diagram of two types of global load balancing;
[0062] Figure 3 This is a flow chart of an embodiment of a global load balancing method in an embodiment of the present application;
[0063] Figure 4 A schematic flow chart for determining a target Internet Protocol address;
[0064] Figure 5 A diagram showing a domain name system mapping;
[0065] Figure 6 The overall data flow diagram for global load balancing in the vectored message processing engine is shown.
[0066] Figure 7 This is a structural diagram of an embodiment of a global load balancing device in an embodiment of the present application;
[0067] Figure 8 This is a schematic block diagram of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION
[0068] In order to make the purpose, features, and advantages of the invention of this application more obvious and easy to understand, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the embodiments described below are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0069] It should be understood that when used in this specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.
[0070] It should also be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0071] It should be further understood that the term “and / or” used in the specification and appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0072] As used in this specification and the appended claims, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrases "if it is determined" or "if [described condition or event] is detected" may be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.
[0073] In addition, in the description of the present application, the terms "first", "second", "third", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0074] Global Load Balancing (GLB) is a network traffic management technology that can distribute user requests to multiple servers or service nodes globally (usually across multiple data centers or geographical locations), aiming to improve the availability, reliability and response speed of applications while optimizing resource utilization. In the prior art, global load balancing is generally performed through the kernel protocol stack of the operating system, which is subject to the performance limitations of the kernel protocol stack, thus adversely affecting the effect of global load balancing.
[0075] In view of this, embodiments of the present application provide a global load balancing method, device, computer-readable storage medium and electronic device to solve the problem that the existing global load balancing method is subject to the performance limitations of the kernel protocol stack, thereby adversely affecting the effect of global load balancing.
[0076] In the embodiment of the present application, the dependence on the kernel protocol stack can be eliminated, and global load balancing can be performed through the vectored packet processing engine (Vector Packet Processor, VPP), which is no longer subject to the performance limitations of the kernel protocol stack, thereby effectively improving the effect of global load balancing.
[0077] The execution subject of the embodiment of the present application may be an electronic device, which may include but is not limited to a server, a desktop computer, a notebook, a PDA and other devices. For the convenience of description, the following detailed description will be given by taking the server as an example.
[0078] Figure 1 The figure is a schematic diagram of an application scenario of an embodiment of the present application. As shown in the figure, the client sends a Domain Name System (DNS) request message to the server, the server receives the DNS request message through the network card, and takes over the data plane (Data Plane) of the network card through VPP, transfers the DNS request message to VPP for global load balancing, obtains the corresponding DNS response message, and then forwards the DNS response message to the network card by VPP, and sends the DNS response message to the client through the network card.
[0079] Under this processing mode of the embodiment of the present application, the data copying between the data plane and the control plane can be effectively reduced. Figure 2As shown, in the global load balancing based on the kernel protocol stack, taking the uplink data as an example, the data needs to be copied at least twice through the kernel protocol stack, that is, the data is first copied from the network card to the kernel space (Kernel Space) through the kernel protocol stack, and then the data is copied from the kernel space to the user space (User Space) through the kernel protocol stack for use by the application. The copy process of downlink data is similar, but in the opposite direction. In the global load balancing based on VPP in the embodiment of the present application, the kernel's network code can be bypassed to avoid the multiple data copies involved. The data plane of the network card is taken over by VPP, and the memory mapping (mmap) between the network card and the user space is directly established to achieve zero-copy data interaction.
[0080] See also Figure 3 , an embodiment of a global load balancing method in an embodiment of the present application may include:
[0081] Step S301: Receive a DNS request message sent by a client through a network card, and forward the DNS request message to the VPP through the network card.
[0082] In a specific implementation of the embodiment of the present application, the VPP may include a message input node (ie, a dpdk-input node). The DNS request message may be forwarded by the network card to the dpdk-input node for global load balancing by the VPP.
[0083] Step S302: Perform global load balancing on the DNS request message through VPP to obtain a DNS response message.
[0084] The DNS response message includes a target Internet Protocol (IP) address corresponding to the DNS request message.
[0085] In a specific implementation of the embodiment of the present application, the VPP may further include a DNS processing node and a GLB processing node. Within the VPP, the DNS request message may be parsed by the DNS processing node to obtain the target domain name corresponding to the DNS request message, and the target domain name may be forwarded to the GLB processing node. Then, the target IP address may be determined according to the target domain name by the GLB processing node, and a DNS response message may be constructed according to the target IP address.
[0086] Among them, in the GLB processing node, it can be done by Figure 4 The process shown determines the target IP address:
[0087] Step S3021: Determine whether there is a DNS mapping corresponding to the target domain name.
[0088] like Figure 5 As shown, the DNS mapping is used to represent at least one virtual IP address pool corresponding to the target domain name, and each address pool includes at least one IP address.
[0089] If there is a DNS mapping corresponding to the target domain name, step S3022 and its subsequent steps can be executed; if there is no DNS mapping corresponding to the target domain name, step S3024 and its subsequent steps can be executed.
[0090] Step S3022: Perform address pool scheduling in each address pool in the DNS mapping to obtain a target address pool.
[0091] Address pool scheduling is the first level of scheduling in global load balancing processing. During address pool scheduling, it can be first determined whether the address pool priority is pre-set in the DNS mapping.
[0092] In the case that there is no address pool priority in the DNS mapping, address pool scheduling can be performed in each address pool in the DNS mapping directly based on the address pool scheduling policy in the DNS mapping to obtain the target address pool.
[0093] The address pool scheduling strategy can be flexibly set according to actual conditions, and may include but is not limited to round robin, least connections, weighted round robin, weighted least connections or other scheduling strategies, which are not specifically limited in the embodiments of the present application.
[0094] In the case where there is an address pool priority in the DNS mapping, address pool scheduling can be performed in each address pool in the DNS mapping based on the address pool priority and the address pool scheduling strategy in the DNS mapping to obtain the target address pool. Among them, for any address pool in the DNS mapping, the higher the address pool priority, the greater the probability of it being selected as the target address pool, and conversely, the lower the address pool priority, the smaller the probability of it being selected as the target address pool.
[0095] Step S3023: Perform address scheduling among the various IP addresses in the target address pool to obtain the target IP address.
[0096] Address scheduling is the second level of scheduling in the global load balancing process. During address scheduling, it can be first determined whether the address priority is pre-set in the target address pool.
[0097] In the case that there is no address priority in the target address pool, address scheduling can be performed directly on each IP address in the target address pool based on the address scheduling policy in the target address pool to obtain the target IP address.
[0098] The address scheduling strategy can be flexibly set according to actual conditions, and may include but is not limited to round robin, least connections, weighted round robin, weighted least connections or other scheduling strategies, which are not specifically limited in the embodiments of the present application.
[0099] In the case where there is an address priority in the target address pool, address scheduling can be performed in each IP address in the target address pool based on the address priority to obtain the target IP address. Among them, for any address in the target address pool, the higher its address priority, the greater the probability of it being selected as the target IP address, and conversely, the lower its address priority, the smaller the probability of it being selected as the target IP address.
[0100] Step S3024: Determine whether there is a DNS record corresponding to the target domain name.
[0101] The DNS record is used to represent the target IP address corresponding to the target domain name. If there is a DNS record corresponding to the target domain name, step S3025 can be executed; if there is no DNS record corresponding to the target domain name, step S3026 can be executed.
[0102] Step S3025: Determine the target IP address based on the DNS record.
[0103] Step S3026: Determine that the target IP address is empty.
[0104] When there is no DNS mapping corresponding to the target domain name and there is no DNS record corresponding to the target domain name, the target IP address corresponding to the DNS request message cannot be determined, that is, the target IP address is empty, and the global load balancing process fails. At this time, the corresponding failure processing process can be executed.
[0105] In a specific implementation of the embodiment of the present application, the VPP may also include a first message routing link, a second message routing link and a message output node (ie, ethX-output node).
[0106] Before the DNS request message is parsed by the DNS processing node, the DNS request message can be forwarded from the dpdk-input node to the DNS processing node via the first message routing link. The first message routing link may include an input processing node (i.e., an ip4-input node), a first routing lookup node (i.e., an ip4-lookup node), a local message processing node (i.e., an ip4-local node), and a second routing lookup node (i.e., an ip4-udp-lookup node).
[0107] After constructing the DNS response message according to the target IP address, the DNS response message can be forwarded from the GLB processing node to the ethX-output node via the second message routing link. The second message routing link may include an ip4-lookup node, several data plane object (DPO) nodes and an interface output node (i.e., an interface-output node).
[0108] Figure 6 The overall data flow diagram for global load balancing in VPP is shown. As shown in the figure, the DNS request message can be forwarded from the dpdk-input node to the ip4-input node, and forwarded to the ip4-lookup node after preliminary processing by the ip4-input node. When the ip4-lookup node determines that the DNS request message is a local message, the DNS request message can be forwarded from the ip4-lookup node to the ip4-local node. When the ip4-local node determines that the DNS request message is a User Datagram Protocol (UDP), the DNS request message can be forwarded from the ip4-local node to the ip4-udp-lookup node. The ip4-udp-lookup can forward the DNS request message to the enabled DNS processing node according to the port information of the DNS request message. The DNS processing node can parse the DNS request message, obtain the target domain name corresponding to the DNS request message, and forward the target domain name to the GLB processing node. In the GLB processing node, the target IP address can be determined according to the target domain name, and a DNS response message can be constructed according to the target IP address. The DNS response message can be forwarded by the GLB processing node to the ip4-lookup node, routed and forwarded by the ip4-lookup node, and finally forwarded to the ethX-output node via several DPO nodes (i.e., DPO nodes) and interface-output nodes.
[0109] Step S303: forward the DNS response message from the VPP to the network card, and send the DNS response message to the client through the network card.
[0110] In a specific implementation of an embodiment of the present application, the DNS response message can be forwarded by the ethX-output node to the network card, and the DNS response message can be sent to the client through the network card.
[0111] In summary, the embodiment of the present application receives the domain name system request message sent by the client through the network card, and forwards the domain name system request message to the vectorized message processing engine by the network card; the domain name system request message is globally load balanced by the vectorized message processing engine to obtain a domain name system response message; wherein the domain name system response message includes a target Internet Protocol address corresponding to the domain name system request message; the domain name system response message is forwarded to the network card by the vectorized message processing engine, and the domain name system response message is sent to the client through the network card. Through the embodiment of the present application, the dependence on the kernel protocol stack can be eliminated, and global load balancing can be performed by the vectorized message processing engine, which is no longer limited by the performance of the kernel protocol stack, thereby effectively improving the effect of global load balancing.
[0112] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0113] Corresponding to the global load balancing method described in the above embodiment, Figure 7 A structural diagram of an embodiment of a global load balancing device provided in an embodiment of the present application is shown.
[0114] In this embodiment, a global load balancing device may include:
[0115] A request message input module 701 is used to receive a domain name system request message sent by a client through a network card, and forward the domain name system request message to a vectorized message processing engine through the network card;
[0116] A global load balancing processing module 702, configured to perform global load balancing processing on the domain name system request message through the vectored message processing engine to obtain a domain name system response message; wherein the domain name system response message includes a target Internet Protocol address corresponding to the domain name system request message;
[0117] The response message output module 703 is used to forward the domain name system response message from the vectored message processing engine to the network card, and send the domain name system response message to the client through the network card.
[0118] In a specific implementation of the embodiment of the present application, the vectored message processing engine may include a domain name system processing node and a global load balancing processing node;
[0119] The global load balancing processing module may include:
[0120] A message parsing submodule, configured to parse the domain name system request message through the domain name system processing node, obtain a target domain name corresponding to the domain name system request message, and forward the target domain name to the global load balancing processing node;
[0121] The global load balancing processing submodule is used to determine the target Internet Protocol address according to the target domain name through the global load balancing processing node, and construct the domain name system response message according to the target Internet Protocol address.
[0122] In a specific implementation of the embodiment of the present application, the global load balancing processing submodule may include:
[0123] An address pool scheduling unit, configured to perform address pool scheduling in each address pool in the domain name system mapping to obtain a target address pool when there is a domain name system mapping corresponding to the target domain name;
[0124] The address scheduling unit is used to perform address scheduling among the Internet Protocol addresses in the target address pool to obtain the target Internet Protocol address.
[0125] In a specific implementation method of an embodiment of the present application, the address pool scheduling unit can be specifically used to: when there is an address pool priority in the domain name system mapping, based on the address pool priority and the address pool scheduling policy in the domain name system mapping, perform address pool scheduling in each address pool in the domain name system mapping to obtain the target address pool; when there is no address pool priority in the domain name system mapping, based on the address pool scheduling policy in the domain name system mapping, perform address pool scheduling in each address pool in the domain name system mapping to obtain the target address pool.
[0126] In a specific implementation method of an embodiment of the present application, the address scheduling unit can be specifically used to: when there is an address priority in the target address pool, based on the address priority and the address scheduling policy in the target address pool, perform address scheduling among each Internet Protocol address in the target address pool to obtain the target Internet Protocol address; when there is no address priority in the target address pool, based on the address scheduling policy in the target address pool, perform address scheduling among each Internet Protocol address in the target address pool to obtain the target Internet Protocol address.
[0127] In a specific implementation of the embodiment of the present application, the global load balancing processing submodule may further include:
[0128] a domain name system record processing unit, configured to determine the target Internet Protocol address according to the domain name system record if there is a domain name system record corresponding to the target domain name;
[0129] An exception handling unit is used to determine that the target Internet Protocol address is empty when the domain name system mapping does not exist and the domain name system record does not exist.
[0130] In a specific implementation of the embodiment of the present application, the vectored message processing engine may further include a message input node, a first message routing link, a second message routing link and a message output node;
[0131] The request message input module may be specifically used to: forward the domain name system request message from the network card to the message input node;
[0132] The global load balancing processing module may also include:
[0133] a first routing submodule, configured to forward the domain name system request message from the message input node to the domain name system processing node via the first message routing link;
[0134] a second routing submodule, configured to forward the domain name system response message from the global load balancing processing node to the message output node via the second message routing link;
[0135] The response message output module may be specifically configured to: forward the domain name system response message from the message output node to the network card.
[0136] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices, modules and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0137] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0138] Figure 8 A schematic block diagram of an electronic device provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.
[0139] like Figure 8 As shown, the electronic device 8 of this embodiment includes: a processor 80, a memory 81, and a computer program 82 stored in the memory 81 and executable on the processor 80. When the processor 80 executes the computer program 82, the steps in the above-mentioned various global load balancing method embodiments are implemented, for example Figure 3 Alternatively, when the processor 80 executes the computer program 82, the functions of each module / unit in the above-mentioned device embodiments are realized, for example Figure 7 The functions of modules 701 to 703 are shown.
[0140] Exemplarily, the computer program 82 may be divided into one or more modules / units, which are stored in the memory 81 and executed by the processor 80 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program 82 in the electronic device 8.
[0141] The electronic device 8 may include but is not limited to servers, desktop computers, notebooks, and PDAs. Those skilled in the art will appreciate that Figure 8 It is only an example of the electronic device 8 and does not constitute a limitation of the electronic device 8. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device 8 may also include input and output devices, network access devices, buses, etc.
[0142] The processor 80 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0143] The memory 81 may be an internal storage unit of the electronic device 8, such as a hard disk or memory of the electronic device 8. The memory 81 may also be an external storage device of the electronic device 8, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 8. Further, the memory 81 may also include both an internal storage unit of the electronic device 8 and an external storage device. The memory 81 is used to store the computer program and other programs and data required by the electronic device 8. The memory 81 may also be used to temporarily store data that has been output or is to be output.
[0144] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0145] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0146] Those of ordinary skill 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 this application.
[0147] In the embodiments provided in the present application, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely schematic. For example, the division of the modules or 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 through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0148] 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 solution of this embodiment.
[0149] In addition, each functional unit in each embodiment of the present application 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. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0150] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable storage media do not include electric carrier signals and telecommunication signals.
[0151] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A global load balancing method, It is characterized in that include: Receiving a domain name system request message sent by a client through a network card, and forwarding the domain name system request message to a vectorized message processing engine through the network card; Performing global load balancing processing on the domain name system request message through the vectored message processing engine to obtain a domain name system response message; wherein the domain name system response message includes a target Internet Protocol address corresponding to the domain name system request message; The domain name system response message is forwarded by the vectored message processing engine to the network card, and the domain name system response message is sent to the client through the network card.
2. The global load balancing method according to claim 1, It is characterized in that The vectorized message processing engine includes a domain name system processing node and a global load balancing processing node; The performing global load balancing processing on the domain name system request message by the vectorized message processing engine to obtain a domain name system response message includes: Parsing the domain name system request message through the domain name system processing node to obtain a target domain name corresponding to the domain name system request message, and forwarding the target domain name to the global load balancing processing node; The target Internet Protocol address is determined according to the target domain name through the global load balancing processing node, and the domain name system response message is constructed according to the target Internet Protocol address.
3. The global load balancing method according to claim 2, It is characterized in that Determining the target Internet Protocol address according to the target domain name includes: In the case where a domain name system mapping corresponding to the target domain name exists, performing address pool scheduling in each address pool in the domain name system mapping to obtain a target address pool; Address scheduling is performed among the Internet Protocol addresses in the target address pool to obtain the target Internet Protocol address.
4. The global load balancing method according to claim 3, It is characterized in that The performing address pool scheduling in each address pool in the domain name system mapping to obtain a target address pool includes: In the case where there is an address pool priority in the domain name system mapping, address pool scheduling is performed in each address pool in the domain name system mapping based on the address pool priority and the address pool scheduling policy in the domain name system mapping to obtain the target address pool; In the case that the address pool priority does not exist in the domain name system mapping, address pool scheduling is performed in each address pool in the domain name system mapping based on the address pool scheduling policy in the domain name system mapping to obtain the target address pool.
5. The global load balancing method according to claim 3, It is characterized in that The performing address scheduling in each Internet Protocol address in the target address pool to obtain the target Internet Protocol address includes: In the case where there is an address priority in the target address pool, performing address scheduling in each Internet Protocol address in the target address pool based on the address priority and the address scheduling policy in the target address pool to obtain the target Internet Protocol address; In the case that the address priority does not exist in the target address pool, address scheduling is performed among the Internet Protocol addresses in the target address pool based on the address scheduling policy in the target address pool to obtain the target Internet Protocol address.
6. The global load balancing method according to claim 3, It is characterized in that Also includes: If there is a domain name system record corresponding to the target domain name, determine the target Internet Protocol address according to the domain name system record; In the absence of the domain name system mapping and the absence of the domain name system record, the target Internet Protocol address is determined to be empty.
7. The global load balancing method according to any one of claims 2 to 6, It is characterized in that The vectorized message processing engine also includes a message input node, a first message routing link, a second message routing link and a message output node; The forwarding of the domain name system request message from the network card to the vectorized message processing engine includes: forwarding the domain name system request message from the network card to the message input node; Before the domain name system request message is parsed by the domain name system processing node, the method further includes: forwarding the domain name system request message from the message input node to the domain name system processing node via the first message routing link; After constructing the domain name system response message according to the target Internet Protocol address, the method further includes: forwarding the domain name system response message from the global load balancing processing node to the message output node via the second message routing link; The forwarding of the domain name system response message by the vectorized message processing engine to the network card includes: The domain name system response message is forwarded from the message output node to the network card.
8. A global load balancing device, It is characterized in that include: A request message input module, used for receiving a domain name system request message sent by a client through a network card, and forwarding the domain name system request message from the network card to a vectorized message processing engine; A global load balancing processing module, configured to perform global load balancing processing on the domain name system request message through the vectored message processing engine to obtain a domain name system response message; wherein the domain name system response message includes a target Internet Protocol address corresponding to the domain name system request message; A response message output module is used to forward the domain name system response message from the vectorized message processing engine to the network card, and send the domain name system response message to the client through the network card.
9. A computer-readable storage medium storing a computer program. It is characterized in that When the computer program is executed by a processor, the steps of the global load balancing method according to any one of claims 1 to 7 are implemented.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the steps of the global load balancing method according to any one of claims 1 to 7 are implemented.
