A same-agent cluster communication method and device, electronic equipment and storage medium
By using a pre-defined address information table and internal virtual addresses, the problem of internal communication within the service cluster was solved, enabling efficient communication between service clusters under the same load balancing agent, thereby improving the availability of the service cluster and the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SUGON INFORMATION IND
- Filing Date
- 2022-12-30
- Publication Date
- 2026-06-02
AI Technical Summary
Under the microservices concept, existing Linux Virtual Servers (LVS) cannot achieve load balancing communication between service clusters, resulting in service clusters under the same load balancing agent being unable to communicate normally.
By using a preset address information table and internal virtual addresses, the network address of the second service cluster that handles the same proxy requests is determined. Based on the load balancing rules, the second service cluster that handles the requests is selected within the internal service clusters. The address field of the data packets is parsed and updated to achieve accurate transmission.
Communication between service clusters can be achieved without introducing additional equipment, reducing costs, improving service cluster availability and user experience, and enhancing communication security and accuracy.
Smart Images

Figure CN116074320B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer application technology, and in particular to a method, apparatus, electronic device, and storage medium for communicating with a proxy cluster. Background Technology
[0002] Large-scale physical machine or virtual clusters often require load balancing technology to achieve balanced and consistent cluster services and avoid localized overload issues. Currently, Linux Virtual Servers (LVS) are commonly used for load balancing of large-scale physical machines or virtual clusters. Operating within a Layer 4 network model, LVS provides high-performance, highly available cluster load balancing services and features simple configuration and diverse operating modes. LVS offers multiple operating modes, including Direct Routing (DR), tunneling, and route forwarding. In DR mode, client access requests are sent to the Virtual Internet Protocol (VIP) module. The VIP module then determines the Real Server (RS) to handle the access request according to the load balancing algorithm configured in LVS, and the destination address of the access request data packet is modified to the address of the determined RS.
[0003] However, with the application of microservices, the service architecture of server clusters has become more complex. The existing LVS DR mode only allows external nodes to access services within the service cluster, but there are limitations on access between service clusters belonging to the same LVS architecture. Figure 1 The different servers within the service cluster are load balanced through LVS. LVS can proxy the load balancing of cluster service A and cluster service B. When cluster service A accesses cluster service B through LVS, due to the LVS load balancing mechanism, the access request of service cluster A will be returned to service cluster A by LVS, and will not be processed by service cluster B before being fed back to service cluster A. The service clusters proxied by LVS cannot communicate with each other through LVS. Summary of the Invention
[0004] This application provides a communication method for a proxy cluster to solve the communication problem between service clusters with the same load balancing proxy. Without changing the service cluster structure, it improves the service cluster's ability to handle complex service architectures, enhances the availability of the service cluster, and improves the user experience.
[0005] According to one aspect of the embodiments of this application, a method for communicating with a proxy cluster is provided, wherein the method includes:
[0006] Obtain the same-proxy communication request from the first service cluster, wherein the same-proxy communication request includes at least an internal virtual address;
[0007] The network address of the second service cluster that processes the same proxy request is determined based on the preset address information table and the internal virtual address.
[0008] The same-proxy communication request is transmitted to the second service cluster for processing based on the network address.
[0009] This application embodiment uses a preset address information table and internal virtual addresses to process proxy requests without introducing additional equipment. This reduces the cost of communication between service clusters, assists in communication and interaction between service clusters, helps to realize complex service cluster architectures, improves the availability of service clusters, and thus enhances the user experience.
[0010] Furthermore, in some application embodiments, it also includes: determining that the second service cluster and the first service cluster belong to the same load balancing agent based on the network segment to which the internal virtual address belongs.
[0011] This application embodiment determines that the first service cluster and the second service cluster belong to the same load balancing proxy by determining the network segment, thereby preventing requests from being routed to external service clusters and improving the security of request processing.
[0012] Furthermore, in some application embodiments, determining the network address of the second service cluster processing the same proxy request based on a preset address information table and the internal virtual address includes:
[0013] Extract the internal virtual address within the same proxy communication request;
[0014] Determine at least one internal service cluster corresponding to the internal virtual address and the real network address of the internal service cluster according to the preset address information table;
[0015] According to the preset load balancing rules, the second service cluster that will handle the same proxy communication request is determined within the at least one internal service cluster, and the real network address corresponding to the second service cluster is used as the network address.
[0016] This application embodiment reduces the configuration difficulty of the address information table by setting the internal service cluster and the real network address corresponding to the internal virtual address in the preset address information table, which facilitates the management of access relationships within the service cluster. By selecting a second service cluster within the internal service cluster to handle the same proxy communication request through load balancing rules, unified access management between different service clusters can be achieved, avoiding the problem of excessive local load within the service cluster and enhancing the robustness of the service cluster.
[0017] Furthermore, in some application embodiments, the preset load balancing rules include at least one of the following: minimum connection dynamic scheduling rule, minimum expected delay dynamic scheduling rule, never queue scheduling rule, and local minimum connection scheduling rule.
[0018] In this embodiment, different load balancing rules are used to determine the second service cluster for handling the same proxy communication request, which can improve the matching degree between the second service cluster and the same proxy communication request, and improve the processing efficiency of the same proxy communication request.
[0019] Furthermore, in some application embodiments, transmitting the same-proxy communication request to the second service cluster for processing based on the network address includes:
[0020] Parse the data packets of the same agent communication request to determine the destination Internet Protocol address field and the destination Media Access Control address field;
[0021] Update the Internet Protocol address and Media Access Control address of the real server in the network address to the Internet Protocol address field and the destination Media Access Control address field of the same proxy communication request;
[0022] The updated data packet is transmitted to the second service cluster so that the second service cluster can process the same-proxy communication request.
[0023] This application embodiment modifies the data packets of communication requests with the same proxy by using the network address, which can achieve accurate transmission of data packets, prevent communication requests with the same proxy from failing to be transmitted to the second service cluster, improve the accuracy of communication within the service cluster, and solve the problem that service clusters belonging to the same load balancing proxy cannot communicate.
[0024] Furthermore, in some application embodiments, the internal virtual address of the internal service cluster is configured in the preset address information table, wherein the internal virtual address is a one-way virtual address.
[0025] In this embodiment of the application, by dynamically configuring the internal virtual address in the preset address information table, the difficulty of updating the service cluster system can be reduced, so that the internal cluster access can still be realized based on the preset address information table after the service cluster system is updated. The one-way virtual address in the preset address information table can improve the accuracy of communication control, prevent communication conflicts caused by virtual addresses, and improve the security of communication within the service cluster.
[0026] Furthermore, in some application embodiments, the network segment is different from the network segment to which the virtual address corresponding to the external cluster belongs.
[0027] This application embodiment isolates the internal service cluster that processes same-proxy communication requests from the external cluster by setting up network segments, preventing internal communication requests from flowing into the external cluster, and can further improve the security of same-proxy communication request transmission.
[0028] According to another aspect of the embodiments of this application, a communication device for a proxy cluster is provided, wherein the device includes:
[0029] The request acquisition module is used to acquire communication requests from the same proxy of the first service cluster, wherein the same proxy communication request includes at least an internal virtual address;
[0030] The cluster determination module is used to determine the network address of the second service cluster that processes the same proxy request based on a preset address information table and the internal virtual address.
[0031] The request forwarding module is used to transmit the same proxy communication request to the second service cluster for processing based on the network address.
[0032] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0033] At least one processor; and
[0034] A memory communicatively connected to the at least one processor; wherein,
[0035] The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the same-agent cluster communication method according to any embodiment of the present invention.
[0036] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the same-agent cluster communication method according to any embodiment of the present invention.
[0037] The technical solution of this application embodiment obtains the same-proxy communication request of the first service cluster, determines the network address of the second service cluster that processes the same-proxy communication request based on the preset address information table and the internal virtual address of the same-proxy communication request, and sends the same-proxy communication request to the second service cluster for processing according to the network address. This application embodiment realizes communication between service clusters belonging to the same proxy through the preset address information table and the internal virtual address, without the need to introduce additional equipment, reducing the cost of communication between service clusters, realizing complex architecture of service clusters, thereby improving the availability of service clusters and enhancing the user experience.
[0038] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this application, nor is it intended to limit the scope of this application. Other features of this application will become readily apparent from the following description. Attached Figure Description
[0039] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0040] Figure 1 This is an example diagram of service cluster information communication provided according to an embodiment of this application;
[0041] Figure 2 This is a flowchart illustrating a communication method with a proxy cluster according to an embodiment of this application;
[0042] Figure 3 This is a flowchart of another method for communicating with a proxy cluster according to an embodiment of this application;
[0043] Figure 4 This is an example diagram of a communication method with a proxy cluster provided according to an embodiment of this application;
[0044] Figure 5 This is a flowchart illustrating a communication process with a proxy cluster according to an embodiment of this application.
[0045] Figure 6 This is a schematic diagram of a communication device for a proxy cluster provided according to an embodiment of this application;
[0046] Figure 7 This is a schematic diagram of the structure of an electronic device that implements the same agent cluster communication method of the present invention. Detailed Implementation
[0047] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0048] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0049] Figure 2 This is a flowchart illustrating a communication method between proxy clusters according to an embodiment of this application. This embodiment is applicable to information communication between service clusters belonging to the same load balancer. The method can be executed by a proxy cluster communication device, which can be implemented in hardware and / or software. This device can be configured within the load balancer of the proxy load balancer, which may include a server or a server cluster. Figure 2 As shown, the method provided in this application embodiment specifically includes:
[0050] Step 110: Obtain the same-proxy communication request from the first service cluster, wherein the same-proxy communication request includes at least the internal virtual address.
[0051] The first service cluster can be a service cluster proxied by the load balancer. This first service cluster may have information exchange needs with other service clusters and can consist of one or more servers. A peer-to-peer communication request can be a request to facilitate information exchange between service clusters belonging to the same load balancer. This request can be generated according to existing communication protocols or by a custom communication protocol. The internal virtual address can be a virtual address used by the service cluster for communication. This internal virtual address can include a VIP address or a Media Access Control Address (MAC), and can be configured through the load balancer.
[0052] In this embodiment, the first service cluster can send a peer-to-peer communication request to a load balancer, which can receive the request. This peer-to-peer request can be used by the first service cluster to access other service clusters belonging to the load balancer. The peer-to-peer communication request can be generated according to specified communication rules and may include at least an internal virtual address. This internal virtual address can point to other service clusters processing the peer-to-peer communication request within the load balancer. In some embodiments, the peer-to-peer communication request can be a Transmission Control Protocol (TCP) message, and the internal virtual address can serve as the destination IP address of the peer-to-peer communication request.
[0053] Step 120: Determine the network address of the second service cluster that handles the same proxy request based on the preset address information table and the internal virtual address.
[0054] The preset address information table can be a table storing internal virtual addresses and the real addresses of the server cluster, and there can be a corresponding relationship between the internal virtual addresses and the real addresses of the server cluster within the preset address information table. The second service cluster can be a service cluster that communicates with the first service cluster. In some embodiments, the first and second service clusters can implement different business services, while in other embodiments, the first and second service clusters can be different physical machines or virtual machines implementing the same business service. The network address can be the real address for accessing the second service cluster, and this network address can include an IP address or a MAC address.
[0055] In this embodiment, the network address corresponding to the internal virtual address can be looked up in a preset information table. The service cluster corresponding to that network address can be used as a second service cluster to handle the same proxy request. It is understood that one internal virtual address in the preset information table can correspond to multiple network addresses, and one or more service clusters corresponding to multiple network addresses can be selected as the second service cluster. In some embodiments, the preset information table can be a routing information table configured in the virtual network interface card of the load balancer, and the preset information table can store the routing information of the service requests processed by the virtual network interface card.
[0056] Step 130: Transmit the communication request to the agent to the second service cluster for processing based on the network address.
[0057] In the embodiments of this application, the load balancer can transmit the same-proxy communication request to the second service cluster according to the determined network address of the second service cluster, and the second service cluster can process the same-proxy communication request. Furthermore, in some embodiments, the transmission process of the same-proxy communication request can be implemented based on the load balancer's balancing algorithm, which can ensure load balancing within the service cluster.
[0058] In this embodiment, by receiving a communication request from the same agent of a first service cluster, a second service cluster for processing the communication request is determined using a preset address information table and the internal virtual address of the communication request, as well as the network address of the second service cluster. The communication request is then sent to the second service cluster for processing according to the network address. This embodiment achieves communication between service clusters belonging to the same agent through a preset address information table and an internal virtual address, eliminating the need for additional equipment, reducing the cost of communication between service clusters, enabling complex service cluster architectures, thereby improving the availability of service clusters and enhancing the user experience.
[0059] Figure 3 This is a flowchart illustrating another method for communicating with a proxy cluster according to an embodiment of this application. This embodiment is a refinement based on the aforementioned embodiments, distinguishing the processing direction of proxy communication requests by judging the internal virtual address network segment, thus preventing internal access from affecting external access. See [link to relevant documentation]. Figure 3 The method provided in this application specifically includes the following steps:
[0060] Step 210: Obtain the same-proxy communication request from the first service cluster, wherein the same-proxy communication request includes at least the internal virtual address.
[0061] Step 220: Determine that the second service cluster and the first service cluster belong to the same load balancing agent based on the network segment to which the internal virtual address belongs.
[0062] The network segment can be the network segment to which the configured internal virtual address belongs within the virtual network interface card of the load balancer, and the service clusters proxied by the load balancer can all be configured to the same network segment.
[0063] In this embodiment, the internal virtual address within the same proxy communication request can be determined by judging the network segment to which the internal virtual address belongs. This determines whether the internal virtual address belongs to the virtual address used within the service cluster of the load balancer proxy. If it does, it can be determined that the first server cluster and the communicating second service cluster belong to the same load balancer proxy. If not, the same proxy communication request is an external communication request and cannot be transmitted within the service cluster of the load balancer proxy. By judging the network segment of the internal virtual address, internal requests and external requests are isolated, preventing the transmission of internal requests from affecting the transmission of external requests.
[0064] Step 230: Extract the internal virtual address within the same proxy communication request.
[0065] In this embodiment of the application, an internal virtual address can be extracted from the same-proxy communication request, and the internal virtual address can be located in the destination address field of the same-proxy communication request.
[0066] Step 240: Determine at least one internal service cluster corresponding to the internal virtual address and the real network address of the internal service cluster according to the preset address information table.
[0067] The internal service cluster can be a service cluster proxied by the load balancer, and the internal service cluster can have a corresponding relationship with the internal virtual address in a preset address information table. The real network address can be the network address of each internal service cluster, and this network address can be used to access the internal service cluster.
[0068] In this embodiment, an internal service cluster that has a pairing relationship with an internal virtual address, as well as the real network address of the internal service cluster, can be found in a preset address information table. This preset address information table can associate and store the identification information of the internal virtual address with the identification information of the internal service cluster. This identification information may include the service cluster name, the real network address of the service cluster, etc. It is understood that one internal virtual address in the preset address information table can be associated and stored with multiple internal service clusters, and there can be multiple internal service clusters that are identified as corresponding to the internal virtual address.
[0069] Step 250: Determine the second service cluster for handling the same-proxy communication request within at least one internal service cluster according to the preset load balancing rules, and use the real network address of the corresponding second service cluster as the network address.
[0070] Among them, the preset load balancing rules can be the rules configured in the load balancer for load balancing in the internal service cluster. The preset load balancing rules can save the business distribution balance among the internal service clusters and prevent the local load in the internal service cluster from being too large, which would cause service problems.
[0071] In this embodiment of the application, a pre-configured preset load balancing rule can be obtained. According to the preset load balancing rule, a second service cluster that handles the same proxy communication request can be selected from one or more internal service clusters corresponding to the internal virtual address. The real network address of the determined second service cluster can be used as the network address for information transmission within the cluster.
[0072] In some application embodiments, the preset load balancing rules include at least one of the following: minimum connection dynamic scheduling rule, minimum expected delay dynamic scheduling rule, never queue scheduling rule, and local minimum connection scheduling rule.
[0073] In this embodiment, the preset load balancing rules configured within the load balancer may include one or more of the following: least connections dynamic scheduling rules, minimum expected latency dynamic scheduling rules, never-queue scheduling rules, and local least connections scheduling rules. By invoking these preset load balancing rules, balanced service distribution within the internal service cluster can be achieved. It is understood that the preset load balancing rules configured in the load balancer may include, but are not limited to, the aforementioned elements.
[0074] Step 260: Parse the data packet of the same agent communication request to determine the destination Internet Protocol address field and the destination Media Access Control address field.
[0075] The data packet can be a data unit that is requested to be transmitted by the same agent. The data packet may include a destination Internet Protocol address field and a destination Media Access Control address field.
[0076] In this embodiment, the received peer-to-peer communication request can be parsed, and the positions of the destination Internet Protocol address (IPA) field and the destination Media Access Control (MAC) field in the peer-to-peer communication request can be determined. In some embodiments, the peer-to-peer communication request can be transmitted in the form of TCP packets, and the header of the TCP packets can be parsed to determine the positions of the IPA field and the MAC field in the peer-to-peer communication request.
[0077] Step 270: Update the Internet Protocol address and Media Access Control address of the real server in the network address to the Internet Protocol address field and the destination Media Access Control address field of the same proxy communication request.
[0078] In this embodiment, the network address of the second service cluster may include the real server Internet Protocol address and the real server Media Access Control address. The information of the Internet Protocol address field and the destination Media Access Control address field determined in the same proxy communication request can be updated to the real server Internet Protocol address and the real server Media Access Control address in the network address, so that the same proxy communication request can be transmitted to the second service cluster.
[0079] Step 280: Transmit the updated data packet to the second service cluster so that the second service cluster can process the communication request with the agent.
[0080] In this embodiment of the application, after all data packets of the same agent communication request are updated to the network address of the second service cluster, the updated data packets can be transmitted to the second service cluster, thereby realizing the transmission of the same agent communication request, so that the second service cluster can process the same agent communication request, thereby realizing the response of the second service cluster to the first service cluster.
[0081] In this embodiment, by obtaining the same-proxy communication request generated by the first service cluster, and confirming that the first service cluster and the second service cluster handling the same-proxy communication request belong to the same load balancing proxy according to the network segment of the internal dotted line address in the same-proxy communication request, the internal virtual address in the same-proxy communication request is extracted, and the internal service cluster corresponding to the internal virtual address and the real network address corresponding to the internal service cluster are searched in a preset address information table. According to the preset load balancing rules, the second service cluster handling the same-proxy communication request is determined in each internal service cluster, and the real network address of the second service cluster is used as the network address. The data packet of the same-proxy communication request is parsed to determine the destination Internet Protocol address field and the destination Media Access Control address field. The real server Internet Protocol address and the real server Media Access Control address of the network address are updated to the above fields, and the updated data packet is transmitted to the second service cluster so that the second service cluster can handle the same-proxy communication request. This realizes communication between service clusters belonging to the same proxy without introducing additional equipment, reducing the cost of communication between service clusters, realizing complex service cluster architecture, thereby improving the availability of service clusters and enhancing the user experience.
[0082] In some embodiments of this application, the communication method with the same agent cluster provided in this application further includes:
[0083] Configure the internal virtual address of the internal service cluster in the preset address information table. The internal virtual address is a one-way virtual address.
[0084] Among them, a one-way virtual address can be a virtual address that can only perform one-way transmission. For example, a one-way virtual address configured in service cluster A can be used by service cluster B to transmit data to service cluster A. When service cluster A transmits data to service cluster B, the above-mentioned one-way virtual address cannot be used, and another one-way virtual address needs to be used.
[0085] In this embodiment of the application, a preset address information table can be configured in advance. Each internal service cluster can have its own corresponding internal virtual address. The internal virtual address configured in the preset address information table can be a one-way virtual address. The internal service cluster can only use this one-way virtual address to transmit to the corresponding internal virtual address.
[0086] In other application embodiments, the network segment is different from the network segment to which the virtual address corresponding to the external cluster belongs.
[0087] In this embodiment of the application, the load balancer executing the method of this embodiment can also perform access scheduling from the external cluster to the internal service cluster. This scheduling process can also be implemented by virtual addresses. However, the network segments of the virtual addresses used for communication between the external cluster and the internal virtual addresses are different, which makes it easier for the load balancer to determine the processing method of the access request and prevent interference between internal and external access requests.
[0088] In some embodiments, Figure 4 This is an example diagram of a communication method with a proxy cluster according to an embodiment of this application. See also... Figure 4 The load balancing service cluster can be implemented by LVS. This load balancing service cluster can simultaneously proxy the load balancing of service cluster A and service cluster B. For external access links, the load balancing service cluster can provide a first direct server (DS), which can provide routing and forwarding functions for external access links. The load balancing service cluster can also provide a second DS for internal access links, which can provide routing and forwarding functions for internal access links. Internal access links can refer to the data access links between service cluster A and service cluster B proxied by the load balancing service cluster. Service cluster A and service cluster B can each be composed of one or more RSs.
[0089] based on Figure 4 The access link shown illustrates that when service cluster A needs to communicate with service cluster B, the communication method between service cluster A and service cluster B can be as follows: Figure 5As shown, when service cluster A requests services from service cluster B, the same-proxy communication request sent by service cluster A can access the second DS through the internal VIP of the same-proxy communication request. The second DS can parse the same-proxy communication request based on the internal VIP, extracting the source IP address, destination IP address, and destination MAC address from the same-proxy communication request. Then, it can match service cluster B according to one or more pre-configured load balancing policies to determine the RS service address. The destination IP address and destination MAC address in the same-proxy communication request can be updated according to the RS service address, so that the updated destination IP address and destination MAC address of the same-proxy communication request point to the RS service address. The same-proxy communication request can then be forwarded to the RS of service cluster B, allowing the RS to process the same-proxy communication request. Furthermore, after processing the same-proxy communication request, the RS can modify the IP address of the same-proxy communication request, thereby responding to the request from service cluster A. This response process can be similar to the request process type. Service cluster B can send the response information to the second DS through its internal VIP. The second DS can then parse the response information based on the internal VIP, extracting the source IP address, destination IP address, and destination MAC address. It's understood that in this case, the source IP address, destination IP address, and destination MAC address of the response information can be exactly the opposite of those in the same proxy communication request. The source IP address is the IP address of the RS in service cluster B, while the destination IP address and destination MAC address can be the IP address and MAC address of the RS in service cluster A. The second DS can also use one or more load balancing strategies to select one or more RS service addresses within service cluster A, modify the response information according to the selected RS service address, and then send the modified response information back to the RS in service cluster A.
[0090] And based on Figure 4 The illustrated access link allows an external service cluster to communicate with an internal service cluster. Communication requests can be sent to the first DS via a VIP. It's understood that this VIP belongs to a different network segment than the VIP accessing the second DS. Communication requests can only access the first DS through the VIP. The first DS only handles communication requests from the external cluster. The first DS can use load balancing to select the internal RS (Real Server) containing the communication request. The first DS can then forward the communication request to the internal RS for processing, thus enabling communication between the external and internal service clusters. In this embodiment, the VIP for external communication requests that can access the first DS can be assigned to a different network segment than the VIP for internal communication requests. This ensures that internal access requests access the second DS, while external access requests access the first DS, preventing interference between internal and external access requests and improving the security of inter-cluster communication.
[0091] Furthermore, in some embodiments, the first DS and the second DS can be located in the same physical device. This physical device can be configured with two sets of preset address information tables. The first set of preset address information tables is associated with the external VIP, and the second set of preset address information tables is associated with the internal VIP. When the physical device receives a communication request, it can determine the network segment to which the VIP of the communication request belongs. If the network segment belongs to the external VIP, the RS that handles the communication request is determined using the first set of preset address information tables. If the network segment belongs to the internal VIP, the RS that handles the communication request is determined using the second set of preset address information tables. The communication request can then be forwarded to the corresponding RS for processing, thereby ensuring compatibility between external service clusters accessing internal service clusters and internal service clusters accessing each other.
[0092] Figure 6 This is a schematic diagram of a communication device for a proxy cluster provided according to an embodiment of this application, such as... Figure 6 As shown, the device includes: a request acquisition module 301, a cluster determination module 302, and a request forwarding module 303.
[0093] The request acquisition module 301 is used to acquire the same proxy communication request of the first service cluster, wherein the same proxy communication request includes at least an internal virtual address.
[0094] The cluster determination module 302 is used to determine the network address of the second service cluster that processes the same proxy request based on a preset address information table and the internal virtual address.
[0095] The request forwarding module 303 is used to transmit the same proxy communication request to the second service cluster for processing according to the network address.
[0096] In this embodiment, the request acquisition module receives a communication request from the same agent of the first service cluster. The cluster determination module uses a preset address information table and the internal virtual address of the same agent communication request to determine the second service cluster that will process the same agent communication request, as well as the network address of the second service cluster. The request forwarding module sends the same agent communication request to the second service cluster for processing according to the network address. This embodiment realizes communication between service clusters belonging to the same agent through the preset address information table and the internal virtual address, without the need to introduce additional equipment, reducing the cost of communication between service clusters, enabling complex service cluster architectures, thereby improving the availability of service clusters and enhancing the user experience.
[0097] In some application embodiments, it further includes: a network segment determination module, used to determine that the second service cluster and the first service cluster belong to the same load balancing agent based on the network segment to which the internal virtual address belongs.
[0098] In other embodiments, the network segment is different from the network segment to which the virtual address corresponding to the external cluster belongs.
[0099] In some embodiments, the cluster determination module 302 includes:
[0100] The address extraction unit is used to extract the internal virtual address within the same proxy communication request.
[0101] The address lookup unit is used to determine, according to the preset address information table, at least one internal service cluster corresponding to the internal virtual address and the real network address of the internal service cluster.
[0102] The cluster determination unit is configured to determine the second service cluster that will process the same-proxy communication request within the at least one internal service cluster according to a preset load balancing rule, and to use the real network address corresponding to the second service cluster as the network address.
[0103] In some application embodiments, the preset load balancing rules include at least one of the following: minimum connection dynamic scheduling rule, minimum expected delay dynamic scheduling rule, never queue scheduling rule, and local minimum connection scheduling rule.
[0104] In some embodiments, the request forwarding module 303 includes:
[0105] The field determination unit is used to parse the data packet of the same agent communication request to determine the destination Internet Protocol address field and the destination Media Access Control address field.
[0106] The information update unit is used to update the real server Internet Protocol address and real server Media Access Control address in the network address to the Internet Protocol address field and the destination Media Access Control address field of the same proxy communication request.
[0107] A request sending unit is used to transmit the updated data packet to the second service cluster so that the second service cluster can process the same-proxy communication request.
[0108] In some embodiments, the apparatus provided in this application further includes: an address configuration module, configured to configure the internal virtual address of the internal service cluster in the preset address information table, wherein the internal virtual address is a one-way virtual address.
[0109] The same-proxy communication device provided in the embodiments of this application can execute the same-proxy communication method provided in any embodiment of this application, and has the corresponding functional modules and beneficial effects of the execution method.
[0110] Figure 7This is a schematic diagram of the structure of an electronic device implementing the same-agent cluster communication method of the present invention. 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 processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0111] like Figure 7 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0112] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0113] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as communication methods with agent clusters.
[0114] In some embodiments, the co-agent cluster communication method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the co-agent cluster communication method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the co-agent cluster communication method by any other suitable means (e.g., by means of firmware).
[0115] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0116] Computer programs used to implement the methods of the embodiments of this application may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0117] In the context of this application, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0118] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device 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 provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, 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 sound input, voice input, or tactile input).
[0119] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0120] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0121] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0122] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A method for communication between proxy clusters, applicable to information communication between service clusters belonging to the same load balancer, characterized in that, Applications in load balancers include: Obtain the same proxy communication request of the first service cluster, wherein the same proxy communication request is used to realize the information exchange between service clusters belonging to the same load balancer proxy, and the same proxy communication request includes at least an internal virtual address. The network address of the second service cluster that processes the same proxy request is determined based on the preset address information table and the internal virtual address; wherein, the preset address information table is an information table that stores the internal virtual address and the real address of the server cluster; The same-proxy communication request is transmitted to the second service cluster for processing based on the network address; The step of determining the network address of the second service cluster that processes the same proxy request based on the preset address information table and the internal virtual address includes: Extract the internal virtual address within the same proxy communication request; Determine at least one internal service cluster corresponding to the internal virtual address and the real network address of the internal service cluster according to the preset address information table; According to the preset load balancing rules, the second service cluster that will handle the same proxy communication request is determined within the at least one internal service cluster, and the real network address corresponding to the second service cluster is used as the network address.
2. The method according to claim 1, characterized in that, Also includes: Based on the network segment to which the internal virtual address belongs, it is determined that the second service cluster and the first service cluster belong to the same load balancing agent.
3. The method according to claim 1, characterized in that, The preset load balancing rules include at least one of the following: minimum connection dynamic scheduling rule, minimum expected delay dynamic scheduling rule, never queue scheduling rule, and local minimum connection scheduling rule.
4. The method according to claim 1, characterized in that, The step of transmitting the same-proxy communication request to the second service cluster for processing according to the network address includes: Parse the data packets of the same agent communication request to determine the destination Internet Protocol address field and the destination Media Access Control address field; Update the Internet Protocol address and Media Access Control address of the real server in the network address to the Internet Protocol address field and the destination Media Access Control address field of the same proxy communication request; The updated data packet is transmitted to the second service cluster so that the second service cluster can process the same-proxy communication request.
5. The method according to any one of claims 1, characterized in that, Also includes: Configure the internal virtual address of the internal service cluster in the preset address information table, wherein the internal virtual address is a one-way virtual address.
6. The method according to claim 2, characterized in that, The network segment in question is different from the network segment to which the virtual address of the external cluster belongs.
7. A communication device for a proxy cluster, suitable for information communication between service clusters belonging to the same load balancer, characterized in that, include: The request acquisition module is used to acquire communication requests from the same proxy of the first service cluster, wherein the same proxy communication request is used to realize information exchange between service clusters belonging to the same load balancer proxy, and the same proxy communication request includes at least an internal virtual address. The cluster determination module is used to determine the network address of the second service cluster that processes the same proxy request based on a preset address information table and the internal virtual address; wherein, the preset address information table is an information table that stores the internal virtual address and the real address of the server cluster; The request forwarding module is used to transmit the same proxy communication request to the second service cluster for processing based on the network address; The cluster determination module includes: An address extraction unit is used to extract the internal virtual address within the same proxy communication request; The address lookup unit is used to determine, according to the preset address information table, at least one internal service cluster corresponding to the internal virtual address and the real network address of the internal service cluster. The cluster determination unit is configured to determine the second service cluster that will process the same-proxy communication request within the at least one internal service cluster according to a preset load balancing rule, and to use the real network address corresponding to the second service cluster as the network address.
8. An electronic device, characterized in that, The electronic device includes: At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the same agent cluster communication method according to any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a processor, implement the same agent cluster communication method as described in any one of claims 1-6.