Message forwarding method and device, electronic equipment and storage medium
By replacing the destination address of the packet in the load balancing device, the transmissive transmission function of the cloud load balancing device is realized, and the intrusion and compatibility problems of user systems in the prior art are solved, and the user experience is improved.
Patent Information
- Application Number
- CN202411782301.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-12-05
AI Technical Summary
When implementing cloud load balancing, the prior art often requires the user's operating system or application to be modified, or standard protocols need to be customized, resulting in compatibility issues and intrusion into user systems.
By determining the destination physical address and network address of the original message sent by the client in the load balancing device, and replacing it with the address forwarding address and the network address of the backend server, the message transmission is realized and the modification of the user's operating system or application is avoided.
It realizes that without network restrictions, cloud load balancing devices can directly transmit client IP addresses, reduce intrusion into user operating systems or applications, improve compatibility, and improve user experience.
Smart Images

Figure CN119814654A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a message forwarding method, device, electronic device and storage medium. Background Art
[0002] In cloud networks, controlled by software-defined network (SDN) software, network functions can be implemented more flexibly. To improve user experience, cloud load balancing usually needs to implement transparent transmission of the client Internet Protocol (IP) address without networking restrictions.
[0003] Common implementation methods include cloud load balancing inserting a TCP option address (TOA) into the user's Transmission Control Protocol (TCP) message and modifying the user's operating system or application, but this method is more invasive to the user's operating system or application.
[0004] A common implementation method also includes cloud load balancing using a reserved field in the Virtual Extensible Local Area Network (VXLAN) protocol to identify that the message is sent from cloud load balancing, but this method requires customization of the standard VXLAN protocol, which may lead to potential compatibility issues with other devices that process VXLAN messages. Summary of the invention
[0005] The embodiments of the present application provide a message forwarding method, device, electronic device and storage medium to solve the technical problems of large intrusion into user operating systems or applications, or low compatibility.
[0006] In a first aspect, an embodiment of the present application provides a message forwarding method, which is applied to a load balancing device, and the method includes:
[0007] Upon receiving an original message sent by a client, determining a destination physical address and a destination network address of the original message, wherein the original message is used to access a backend server;
[0008] The destination physical address is replaced with an addressing forwarding address, and the destination network address is replaced with the network address of the backend server, wherein the addressing forwarding address is obtained according to the physical identifier of the backend server, and the addressing forwarding message is used to transparently transmit the network address of the client;
[0009] Encapsulating the replaced original message to obtain a first message, and sending the first message to the host machine where the backend server is located;
[0010] Receiving a second message returned by the host machine according to the addressing forwarding address;
[0011] The second message is encapsulated and the encapsulated second message is returned to the client.
[0012] Optionally, the physical identifier of the backend server includes a MAC identifier, and replacing the destination physical address with an addressing forwarding address includes:
[0013] Determine the addressing forwarding address according to a mapping relationship between a MAC identifier and the addressing forwarding address, wherein the MAC identifier is a user-visible MAC address;
[0014] The destination physical address is replaced with the addressing forwarding address.
[0015] Optionally, encapsulating the second message and returning the encapsulated second message to the client includes:
[0016] Determining the address information of the client according to the stored session information;
[0017] Matching the second message with a five-tuple session and performing layer 2 encapsulation;
[0018] The encapsulated second message is returned to the client.
[0019] Optionally, the method further comprises:
[0020] Allocating addressing and forwarding addresses to the multiple virtual switches according to the MAC identifiers of the multiple virtual switches, and obtaining a mapping relationship between the MAC addresses and the addressing and forwarding addresses;
[0021] The mapping relationship is sent to the host machine where the multiple virtual switches are located.
[0022] In a second aspect, an embodiment of the present application provides a message forwarding method, which is applied to a host machine where a backend server is located, and the method includes:
[0023] Upon receiving a first message sent by a load balancing device, obtaining an addressing forwarding address in the first message;
[0024] According to a mapping relationship between the physical address and the addressing forwarding address, the addressing forwarding address in the first message is replaced with the physical address;
[0025] Sending the first message to the backend server corresponding to the physical address, and receiving a second message returned by the backend server;
[0026] The second message is sent to the load balancing device according to the addressing forwarding address.
[0027] Optionally, sending the second message to the load balancing device according to the addressing forwarding address includes:
[0028] Pass the second message through the connection tracking module of the virtual switch to extract the addressing forwarding address and the underlying network address of the load balancing device;
[0029] The second message is encapsulated and sent to the load balancing device according to the addressing forwarding address and the underlying network address.
[0030] In a third aspect, an embodiment of the present application provides a message forwarding device, which is applied to a load balancing device, and the device includes:
[0031] A first determination module is used to determine the destination physical address and the destination network address of the original message when receiving the original message sent by the client, wherein the original message is used to access the backend server;
[0032] A first replacement module, used to replace the destination physical address with an addressing forwarding address, and replace the destination network address with the network address of the backend server, wherein the addressing forwarding address is obtained according to the physical identifier of the backend server, and the addressing forwarding message is used to transparently transmit the network address of the client;
[0033] A first sending module, used for encapsulating the replaced original message to obtain a first message, and sending the first message to the host machine where the backend server is located;
[0034] A receiving module, used for receiving a second message returned by the host machine according to the addressing forwarding address;
[0035] The first processing module is used to encapsulate the second message and return the encapsulated second message to the client.
[0036] In a fourth aspect, an embodiment of the present application provides a message forwarding device, which is applied to a host machine where a backend server is located, and the device includes:
[0037] An acquisition module, configured to acquire an addressing forwarding address in a first message sent by a load balancing device when receiving the first message;
[0038] A second replacement module, configured to replace the addressing forwarding address in the first message with the physical address according to a mapping relationship between the physical address and the addressing forwarding address;
[0039] A second processing module, used for sending the first message to the back-end server corresponding to the physical address, and receiving a second message returned by the back-end server;
[0040] The second sending module is used to send the second message to the load balancing device according to the addressing forwarding address.
[0041] In a fifth aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned message forwarding method when executing the program.
[0042] In a sixth aspect, an embodiment of the present application provides a readable storage medium. When the instructions in the readable storage medium are executed by a processor of an electronic device, the electronic device can execute the above-mentioned message forwarding method.
[0043] In summary, in the embodiment of the present application, when the load balancing device receives the original message sent by the client, it determines the destination physical address and destination network address of the original message accessing the back-end server; replaces the destination physical address with the addressing forwarding address, and replaces the destination network address with the network address of the back-end server, the addressing forwarding address is obtained according to the physical identification of the back-end server, and the addressing forwarding message is used to transparently transmit the network address of the client; encapsulates the replaced original message to obtain a first message, and sends the first message to the host machine where the back-end server is located; receives the second message returned by the host machine according to the addressing forwarding address; encapsulates the second message, and returns the encapsulated second message to the client. Through the above technical scheme, on the one hand, since the message is forwarded to the host machine where the back-end server is located through the addressing forwarding address, the host machine where the back-end server is located recognizes the addressing forwarding address, and the same source and the same destination can be achieved; on the other hand, the load balancing device can support direct transparent transmission of the client IP address without the need to modify the user operating system and application, which can reduce the intrusion into the user operating system or application, improve compatibility, and provide users with a better user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, 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 some embodiments of the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0045] Figure 1 This is an overall system architecture diagram of a message forwarding method provided in an embodiment of the present application;
[0046] Figure 2 It is a flowchart of the steps of a message forwarding method provided by an embodiment of the present application;
[0047] Figure 3 It is a flowchart of the specific steps of a message forwarding method provided in an embodiment of the present application;
[0048] Figure 4 It is a flowchart of another method for forwarding a message provided by an embodiment of the present application;
[0049] Figure 5 It is a schematic diagram of a message path provided in an embodiment of the present application;
[0050] Figure 6 It is a structural diagram of a message forwarding device provided in an embodiment of the present application;
[0051] Figure 7 It is a structural diagram of another message forwarding device provided in an embodiment of the present application;
[0052] Figure 8 is a structural diagram of an electronic device provided in an embodiment of the present application;
[0053] Fig. 9 It is a structural diagram of another electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0054] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0055] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0056] Layer 4 load balancing is a network device that is usually placed at the user traffic entrance to distribute access traffic to multiple business nodes, thereby achieving high availability and horizontal expansion of the business. During the traffic distribution process, the layer 4 load balancing will perform address translation, changing the target address from the virtual IP address (VIP) address on the layer 4 load balancing to the IP address of the business node (Real Server). There are usually two ways to process the source IP address, one is to convert it to a specific IP address, and the other is to directly pass through the client IP address. Directly passing through the client IP address provides a better user experience, and the user's business application can directly obtain the client's real IP address, but this often requires specific networking conditions.
[0057] In traditional data center networks, backend Real Servers are generally required to point the default route to the load balancing device. The load balancing device also has a gateway function and is responsible for processing the traffic of all Real Servers. Even if the Real Server communicates directly with nodes in other subnets, the default route points to the load balancing device and the load balancing device is required to forward the traffic. This results in severe networking restrictions.
[0058] In the cloud network, since it is controlled by SDN software, network functions can be implemented more flexibly. In order to improve the user experience, cloud load balancing usually needs to realize the transparent transmission of the client IP address without networking restrictions.
[0059] In some implementations, cloud load balancing inserts TOA into the user's Transmission Control Protocol TCP message and modifies the user's operating system or application. It parses TOA by loading the TOA kernel module to enable the user's business application to obtain the client IP address. However, this method is highly invasive to the user's operating system or application and is inconvenient to use.
[0060] In another implementation, cloud load balancing uses a reserved field in the VXLAN protocol to identify that the message is sent from cloud load balancing. The cloud virtual switch identifies it and triggers the recording of the Underlay IP address of the source, thereby sending the message back to the load balancing device. However, this method requires customization of the standard VXLAN protocol, and there will be potential compatibility issues with other devices that process VXLAN messages.
[0061] In order to solve the above technical problems, the embodiments of the present application provide a message forwarding method, device, electronic device and storage medium. First, an application scenario involved in the embodiments of the present application is described.
[0062] Figure 1This is an overall system architecture diagram of a message forwarding method provided in an embodiment of the present application, see Figure 1 ,The message forwarding system includes a cloud network controller, a cloud load balancing controller, a host machine where multiple cloud virtual switches are located, and multiple cloud load balancing forwarding devices.
[0063] In an embodiment of the present application, the cloud network controller is used to monitor and manage the configuration of network devices and decide how to configure virtual machines in the cloud based on the user's network requirements.
[0064] In an embodiment of the present application, a cloud load balancing controller is used to configure a cloud load balancing forwarding device based on load balancing service configuration information and information about work units on multiple clouds. Load balancing is the entrance to business traffic. However, the load balancing on different clouds is usually fragmented, that is, the load balancing service provided by cloud provider A cannot access the work units (for example, containers, virtual machines, etc.) deployed by cloud provider B. Therefore, if a business builds its own applications on different clouds, each cloud will provide a load balancing traffic entrance, and each load balancer can only distribute user requests to the work units on its own cloud. For the load balancing traffic entrances of multiple different clouds, the business needs to be scheduled through the domain name system DNS.
[0065] Exemplarily, the cloud load balancing controller is responsible for obtaining the addressing forwarding MAC and identification MAC address of the Real Server and the mapping relationship between the two MAC addresses from the cloud network controller, and sending the configuration to the cloud load balancing forwarding device.
[0066] In the embodiment of the present application, the host machine refers to a physical computer or server running virtualization software (such as VMware, VirtualBox, Docker, etc.). In a virtualized environment, the host machine is responsible for providing hardware resources (such as CPU, memory, disk, network, etc.) to the virtual machine (GuestMachine) for use. The virtual machine is a simulated computer running on the host machine, which has its own operating system and application, but all operations are performed on the resources provided by the host machine. In the context of Docker, the host machine generally refers to a physical machine or virtual machine running the Docker daemon. The Docker container runs on the host machine and is managed and scheduled by the Docker daemon. The Docker daemon on the host machine interacts with the client (such as the command line interface or DockerCompose), receives requests from the client, and creates, starts, stops, and manages Docker containers on the host machine. In short, the host machine is a computer that provides hardware resources and runs virtualization software or Docker daemon in a virtualized environment or Docker environment.
[0067] Exemplarily, the cloud network controller is responsible for allocating an addressing and forwarding MAC address to each Real Server virtual machine, and sending the mapping relationship between the addressing and forwarding MAC and the Real Server virtual machine identification MAC to the virtual switch on the host machine where the Real Server virtual machine is located.
[0068] In the embodiments of the present application, a cloud virtual switch (Virtual Switch, vSwitch) is a network switching device used in a virtualized environment, which simulates the functions of a physical switch, allowing virtual machines (Virtual Machines, VMs) and between virtual machines and physical networks to communicate. vSwitch is a key component of the virtualization infrastructure and exists on the host system as a core component of the virtual network.
[0069] Exemplarily, the cloud virtual switch should include a connection tracking subsystem, which receives the mapping relationship between the addressing forwarding MAC and the Real Server virtual machine identifier MAC issued by the cloud network controller, and triggers the same-source and same-destination mechanism when receiving a message containing the addressing forwarding MAC, and records the Underlay IP address of the cloud load balancing forwarding device and the corresponding addressing forwarding MAC address in the connection tracking subsystem; when receiving a message sent by the virtual machine, it matches the connection tracking subsystem, extracts the addressing forwarding MAC address and the Underlay IP address of the cloud load balancing forwarding device, and uses these addresses to encapsulate the VXLAN message and send it.
[0070] In an embodiment of the present application, a cloud load balancing forwarding device is deployed in a cloud network to improve the efficiency of cloud management.
[0071] Exemplarily, the cloud load balancing forwarding device is responsible for receiving the addressing forwarding MAC, identification MAC and other configuration information of the Real Server from the cloud load balancing controller, and when sending a message to the Real Server, it uses the addressing forwarding MAC address for Overlay Layer 2 encapsulation. When receiving the VXLAN message sent by the cloud virtual switch, it matches the five-tuple session and sends the message back to the client.
[0072] Optionally, the load balancing forwarding method includes a method based on one or more combinations of a source Media Access Control Address (MAC) address, a destination MAC address, a source IP address, and a destination IP address.
[0073] The message forwarding method provided in the embodiment of the present application is described in detail below.
[0074] Figure 2 This is a flowchart of a message forwarding method provided by an embodiment of the present application, see Figure 2 , the message forwarding method is applied to Figure 1 In the cloud load balancing forwarding device shown, the message forwarding method may include:
[0075] Step 101: upon receiving an original message sent by a client, determine a destination physical address and a destination network address of the original message.
[0076] In the embodiment of the present application, the original message is used to access the back-end server.
[0077] In a possible implementation, the destination physical address is the destination MAC address, and the destination network address is the destination IP; the original message may include the source MAC address, the destination MAC address, the source IP address, the destination IP, a VLAN ID, and the like.
[0078] Step 102: Replace the destination physical address with the addressing forwarding address, and replace the destination network address with the network address of the back-end server.
[0079] In an embodiment of the present application, the addressing forwarding address is obtained based on the physical identification of the backend server, and the addressing forwarding message is used to transparently transmit the network address of the client.
[0080] In a possible implementation, the backend server is a Real Server, and the addressing and forwarding address is an addressing and forwarding MAC address.
[0081] In the embodiment of the present application, the physical identification of the backend server may also be referred to as "identification MAC".
[0082] It should be noted that each backend server or service node (Real Server) has a MAC address that is visible to the user. In step 102, the identification MAC and the addressing and forwarding MAC address are separated, and the user-visible MAC address is called the identification MAC. Based on this identification MAC address, a MAC address is allocated to each backend Real Server, namely the addressing and forwarding MAC.
[0083] Step 103: encapsulate the replaced original message to obtain a first message, and send the first message to the host machine where the back-end server is located.
[0084] In an embodiment of the present application, the first message may be in VXLAN format.
[0085] In a possible implementation, step 103 may include: using the addressing forwarding address to perform Overlay layer 2 encapsulation to obtain a first message, and sending the first message to the Real Server virtual machine through a tunnel technology.
[0086] In an embodiment of the present application, the host machine can be a cloud server or a physical server. The host machine provides hardware resources and infrastructure for the RealServer and allows virtual machines to be created and managed thereon.
[0087] Step 104: Receive the second message returned by the host machine according to the addressing forwarding address.
[0088] In an embodiment of the present application, the addressing forwarding MAC is identified on the cloud virtual switch to trigger the connection tracking subsystem to record the Underlay layer source IP address, thereby achieving the same source and the same destination.
[0089] In some embodiments, when the host machine receives a first message sent by a load balancing device, it obtains the addressing forwarding address in the first message; replaces the addressing forwarding address in the first message with the physical address based on the mapping relationship between the physical address and the addressing forwarding address; sends the first message to the back-end server corresponding to the physical address, and receives a second message returned by the back-end server; and sends the second message to the load balancing device based on the addressing forwarding address.
[0090] Step 105: encapsulate the second message and return the encapsulated second message to the client.
[0091] In a possible implementation, encapsulating the second message in step 105 may include: parsing the second message, finding pre-saved session information, and encapsulating the message and sending it to the client according to the client information corresponding to the session information.
[0092] Exemplarily, before step 105, the above-mentioned message forwarding method may also include: reading the second message and recording the tunnel endpoint network address, tunnel endpoint network identifier, destination network address, source network address, network protocol type, destination port, source port, and source MAC address of the second message in the session record table.
[0093] To summarize, in the embodiments of the present application, on the one hand, since the message is forwarded to the host machine where the back-end server is located through the addressing forwarding address, the host machine where the back-end server is located can identify the addressing forwarding address, and the same source and the same destination can be achieved; on the other hand, there is no need to modify the user operating system and application, the load balancing device can support direct transparent transmission of the client IP address, which can reduce the intrusion into the user operating system or application, improve compatibility, and provide users with a better user experience.
[0094] Figure 3 This is a flowchart of the specific steps of a message forwarding method provided in an embodiment of the present application, see Figure 3 , the message forwarding method is applied to Figure 1 In the cloud load balancing forwarding device shown, the message forwarding method may include:
[0095] Step 201: upon receiving an original message sent by a client, determine the destination physical address and destination network address of the original message.
[0096] The method of this step has been described in the aforementioned step 101 and will not be repeated here.
[0097] Step 202: Determine the addressing forwarding address according to the mapping relationship between the MAC identifier and the addressing forwarding address.
[0098] The MAC identifier is a user-visible MAC address.
[0099] In some embodiments, the message forwarding method further includes:
[0100] Sub-step A1: allocating addressing and forwarding addresses to multiple virtual switches according to MAC identifiers of multiple virtual switches, and obtaining a mapping relationship between MAC addresses and addressing and forwarding addresses;
[0101] Sub-step A2: sending the mapping relationship to the host machines where the multiple virtual switches are located.
[0102] Step 203: Replace the destination physical address with the addressing forwarding address.
[0103] The method of this step has been described in the aforementioned step 102 and will not be repeated here.
[0104] Step 204: Replace the destination network address with the network address of the backend server.
[0105] The method of this step has been described in the aforementioned step 102 and will not be repeated here.
[0106] Step 205: encapsulate the replaced original message to obtain a first message, and send the first message to the host machine where the back-end server is located.
[0107] In the embodiments of the present application,
[0108] The method of this step has been described in the aforementioned step 103 and will not be repeated here.
[0109] Step 206: Receive the second message returned by the host machine according to the addressing forwarding address.
[0110] In the embodiments of the present application,
[0111] The method of this step has been described in the aforementioned step 104 and will not be repeated here.
[0112] Step 207: encapsulate the second message and return the encapsulated second message to the client.
[0113] The method of this step has been described in the aforementioned step 105 and will not be repeated here.
[0114] In some embodiments, step 207 includes:
[0115] Sub-step 2071, determining the address information of the client according to the stored session information;
[0116] Sub-step 2072: Match the second message with the five-tuple session and perform layer 2 encapsulation;
[0117] Sub-step 2073: Return the encapsulated second message to the client.
[0118] To sum up, in the embodiments of the present application, in the cloud network, regardless of whether the cloud load balancing device, the client and the RealServer are located in the same subnet, and regardless of whether the traffic is north-south or east-west, there is no need for the user's operating system and application to be modified. The cloud load balancing device can support direct transparent transmission of the client IP address, providing users with a better user experience.
[0119] Figure 4 is a flowchart of another method for forwarding a message provided in an embodiment of the present application, see Figure 4 , the message forwarding method is applied to Figure 1 In the host machine where the multiple cloud virtual switches are located, the message forwarding method may include:
[0120] Step 301: upon receiving a first message sent by a load balancing device, obtain an addressing forwarding address in the first message.
[0121] In the embodiment of the present application, the addressing forwarding address is allocated by the load balancing device to different backend servers.
[0122] Step 302: According to the mapping relationship between the physical address and the addressing forwarding address, the addressing forwarding address in the first message is replaced with the physical address.
[0123] In some embodiments, the message forwarding method further includes:
[0124] Receive the mapping relationship between the physical address sent by the load balancing device and the addressing forwarding address.
[0125] Step 303: Send the first message to the backend server corresponding to the physical address, and receive the second message returned by the backend server.
[0126] Step 304: Send the second message to the load balancing device according to the addressing forwarding address.
[0127] In some embodiments, step 304 may include:
[0128] Sub-step 3041: passing the second message through the connection tracking module of the virtual switch to extract the addressing forwarding address and the underlying network address of the load balancing device;
[0129] Sub-step 3042: encapsulate the second message and send it to the load balancing device according to the addressing forwarding address and the underlying network address.
[0130] In an embodiment of the present application, the connection tracking module is used to track or maintain the network connection and its status.
[0131] Through the above technical solution, during the two-way communication, the corresponding message is identified by addressing and forwarding the MAC address, and the connection tracking module of the virtual switch needs to record the connection information and the message return path, that is, the same source and the same destination at the session level.
[0132] In summary, in the embodiment of the present application, the identification MAC and the addressing and forwarding MAC are separated, and the user can only see the identification MAC, and the addressing and forwarding MAC is used for message forwarding encapsulation. In addition to the identification MAC, the addressing and forwarding MAC is assigned to the Real Server to realize the transparent transmission of the cloud load balancing client IP address. By identifying the addressing and forwarding MAC on the cloud virtual switch, the connection tracking subsystem is triggered to record the Underlay layer source IP address, thereby achieving the same source and the same destination.
[0133] Figure 5 is a schematic diagram of a message path provided in an embodiment of the present application, see Figure 5 As shown, after the load balancing device receives the client message, it encapsulates the VXLAN message and sends it to the host machine where the backend Real Server is located; after the host machine where the backend RealServer is located receives the VXLAN message, it sends the message to the virtual machine of the backend Real Server; the reply message of the virtual machine of the backend Real Server is sent to the message load balancing device through the connection tracking module of the virtual switch; after receiving the message, the load balancing device encapsulates the message and sends it to the client.
[0134] With the above technical solution, users are completely unaware and the VXLAN message format is not modified, so the implementation cost is relatively low.
[0135] Figure 6600 is a structural diagram of a message forwarding device provided in an embodiment of the present application, which is used in a load balancing device. The message forwarding device 600 may include:
[0136] A first determination module 601 is used to determine the destination physical address and the destination network address of the original message when receiving the original message sent by the client, where the original message is used to access the backend server;
[0137] A first replacement module 602 is used to replace the destination physical address with an addressing forwarding address, and replace the destination network address with the network address of the backend server, the addressing forwarding address is obtained according to the physical identifier of the backend server, and the addressing forwarding message is used to transparently transmit the network address of the client;
[0138] A first sending module 603, configured to encapsulate the replaced original message to obtain a first message, and send the first message to a host machine where the backend server is located;
[0139] A receiving module 604, configured to receive a second message returned by the host machine according to the addressing forwarding address;
[0140] The first processing module 605 is used to encapsulate the second message and return the encapsulated second message to the client.
[0141] Optionally, the first replacement module 602 includes:
[0142] A first determination submodule is used to determine the addressing forwarding address according to a mapping relationship between the MAC identifier and the addressing forwarding address, where the MAC identifier is a user-visible MAC address;
[0143] The replacement submodule is used to replace the destination physical address with the addressing forwarding address.
[0144] Optionally, the first processing module 605 includes:
[0145] A second determination submodule, used to determine the address information of the client according to the stored session information;
[0146] A processing submodule, used for matching the second message with the five-tuple session and performing layer 2 encapsulation;
[0147] The first sending submodule is used to return the encapsulated second message to the client.
[0148] Optionally, the message forwarding device 600 further includes:
[0149] An address allocation module is used to allocate addressing and forwarding addresses to multiple virtual switches according to MAC identifiers of multiple virtual switches, and obtain a mapping relationship between MAC addresses and addressing and forwarding addresses;
[0150] The mapping relationship sending module is used to send the mapping relationship to the host machines where the multiple virtual switches are located.
[0151] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0152] Figure 7 : is a schematic diagram of the structure of a message forwarding device provided in an embodiment of the present application, which is applied to a host machine where a backend server is located. The message forwarding device 700 may include:
[0153] The acquisition module 701 is used to acquire the addressing forwarding address in the first message when receiving the first message sent by the load balancing device;
[0154] A second replacement module 702, configured to replace the addressing forwarding address in the first message with the physical address according to a mapping relationship between the physical address and the addressing forwarding address;
[0155] The second processing module 703 is used to send the first message to the back-end server corresponding to the physical address, and receive the second message returned by the back-end server;
[0156] The second sending module 704 is used to send the second message to the load balancing device according to the addressing forwarding address.
[0157] Optionally, the second sending module 704 includes:
[0158] An address extraction submodule, used for extracting the addressing forwarding address and the underlying network address of the load balancing device from the second message through the connection tracking module of the virtual switch;
[0159] The second sending submodule is used to encapsulate the second message and send it to the load balancing device according to the addressing forwarding address and the underlying network address.
[0160] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0161] See also Figure 7 , the electronic device 400 may include one or more of the following components: a processing component 402 , a memory 404 , a power component 406 , a multimedia component 408 , an audio component 410 , an input / output (I / O) interface 412 , a sensor component 414 , and a communication component 416 .
[0162] The processing component 402 generally controls the overall operation of the electronic device 400, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 402 may include one or more processors 420 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 402 may include one or more modules to facilitate the interaction between the processing component 402 and other components. For example, the processing component 402 may include a multimedia module to facilitate the interaction between the multimedia component 408 and the processing component 402.
[0163] The memory 404 is used to store various types of data to support the operation of the electronic device 400. Examples of such data include instructions for any application or method operating on the electronic device 400, contact data, phone book data, messages, pictures, multimedia, etc. The memory 404 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0164] The power supply component 406 provides power to the various components of the electronic device 400. The power supply component 406 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 400.
[0165] The multimedia component 408 includes an interface that provides an output interface between the electronic device 400 and the user. In some embodiments, the interface may include a liquid crystal display (LCD) and a touch panel (TP). If the interface includes a touch panel, the interface may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 408 includes a front camera and / or a rear camera. When the electronic device 400 is in an operating mode, such as a shooting mode or a multimedia mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0166] The audio component 410 is used to output and / or input audio signals. For example, the audio component 410 includes a microphone (MIC), and when the electronic device 400 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is used to receive an external audio signal. The received audio signal can be further stored in the memory 404 or sent via the communication component 416. In some embodiments, the audio component 410 also includes a speaker for outputting audio signals.
[0167] The input / output I / O interface 412 provides an interface between the processing component 402 and the peripheral interface module, which may be a keyboard, a click wheel, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0168] The sensor assembly 414 includes one or more sensors for providing various aspects of status assessment for the electronic device 400. For example, the sensor assembly 414 can detect the open / closed state of the electronic device 400, the relative positioning of components, such as the display and keypad of the electronic device 400, and the sensor assembly 414 can also detect the position change of the electronic device 400 or a component of the electronic device 400, the presence or absence of user contact with the electronic device 400, the orientation or acceleration / deceleration of the electronic device 400, and the temperature change of the electronic device 400. The sensor assembly 414 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 414 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 414 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0169] The communication component 416 is used to facilitate wired or wireless communication between the electronic device 400 and other devices. The electronic device 400 can access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G or 5G), or a combination thereof. In an exemplary embodiment, the communication component 416 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 416 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0170] In an exemplary embodiment, the electronic device 400 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to implement a method for displaying a vehicle-road collaborative scenario provided in an embodiment of the present application.
[0171] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 404 including instructions, and the instructions can be executed by a processor 420 of an electronic device 400 to perform the above method. For example, the non-transitory storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0172] Figure 8 is a block diagram of an electronic device 500 according to another embodiment of the present invention. For example, the electronic device 500 may be provided as a server. Figure 8 , the electronic device 500 includes a processing component 522, which further includes one or more processors, and a memory resource represented by a memory 532 for storing instructions executable by the processing component 522, such as an application. The application stored in the memory 532 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 522 is configured to execute instructions to execute a method for displaying a vehicle-road cooperative scenario provided in an embodiment of the present application.
[0173] The electronic device 500 may also include a power supply component 526 configured to perform power management of the electronic device 500, a wired or wireless network interface 550 configured to connect the electronic device 500 to a network, and an input / output (I / O) interface 558. The electronic device 500 may operate based on an operating system stored in the memory 532, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™ or the like.
[0174] In an embodiment of the present application, the memory 632 may be used to store software programs and various data. The memory 632 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 632 may include a volatile memory or a non-volatile memory, or the memory 632 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 632 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
[0175] The processor may include one or more processing units; optionally, the processor integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to the operating system, user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor.
[0176] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned image super-resolution reconstruction method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0177] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.
[0178] An embodiment of the present application also provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the super-resolution reconstruction method embodiment of the above-mentioned image, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0179] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the application disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0180] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A message forwarding method, characterized in that: Applied to a load balancing device, the method comprises: Upon receiving an original message sent by a client, determining a destination physical address and a destination network address of the original message, wherein the original message is used to access a backend server; The destination physical address is replaced with an addressing forwarding address, and the destination network address is replaced with the network address of the backend server, wherein the addressing forwarding address is obtained according to the physical identifier of the backend server, and the addressing forwarding message is used to transparently transmit the network address of the client; Encapsulating the replaced original message to obtain a first message, and sending the first message to the host machine where the backend server is located; Receiving a second message returned by the host machine according to the addressing forwarding address; The second message is encapsulated and the encapsulated second message is returned to the client.
2. The method according to claim 1, characterized in that: The physical identifier of the backend server includes a MAC identifier, and replacing the destination physical address with an addressing forwarding address includes: Determine the addressing forwarding address according to a mapping relationship between a MAC identifier and the addressing forwarding address, wherein the MAC identifier is a user-visible MAC address; The destination physical address is replaced with the addressing forwarding address.
3. The method according to claim 1, characterized in that The encapsulating the second message and returning the encapsulated second message to the client includes: Determining the address information of the client according to the stored session information; Matching the second message with a five-tuple session and performing layer 2 encapsulation; The encapsulated second message is returned to the client.
4. The method according to claim 1, characterized in that: The method further comprises: Allocating addressing and forwarding addresses to the multiple virtual switches according to the MAC identifiers of the multiple virtual switches, and obtaining a mapping relationship between the MAC addresses and the addressing and forwarding addresses; The mapping relationship is sent to the host machine where the multiple virtual switches are located.
5. A message forwarding method, characterized in that: Applied to the host machine where the backend server is located, the method includes: Upon receiving a first message sent by a load balancing device, obtaining an addressing forwarding address in the first message; According to a mapping relationship between the physical address and the addressing forwarding address, the addressing forwarding address in the first message is replaced with the physical address; Sending the first message to the backend server corresponding to the physical address, and receiving a second message returned by the backend server; The second message is sent to the load balancing device according to the addressing forwarding address.
6. The method according to claim 5, characterized in that The sending the second message to the load balancing device according to the addressing forwarding address comprises: Pass the second message through the connection tracking module of the virtual switch to extract the addressing forwarding address and the underlying network address of the load balancing device; The second message is encapsulated and sent to the load balancing device according to the addressing forwarding address and the underlying network address.
7. A message forwarding device, characterized in that: Applied to a load balancing device, the device comprises: A first determination module is used to determine the destination physical address and the destination network address of the original message when receiving the original message sent by the client, wherein the original message is used to access the backend server; A first replacement module, used to replace the destination physical address with an addressing forwarding address, and replace the destination network address with the network address of the backend server, wherein the addressing forwarding address is obtained according to the physical identifier of the backend server, and the addressing forwarding message is used to transparently transmit the network address of the client; A first sending module, used for encapsulating the replaced original message to obtain a first message, and sending the first message to the host machine where the backend server is located; A receiving module, used for receiving a second message returned by the host machine according to the addressing forwarding address; The first processing module is used to encapsulate the second message and return the encapsulated second message to the client.
8. A message forwarding device, characterized in that: Applied to the host machine where the backend server is located, the device includes: An acquisition module, configured to acquire an addressing forwarding address in a first message sent by a load balancing device when receiving the first message; A second replacement module, configured to replace the addressing forwarding address in the first message with the physical address according to a mapping relationship between the physical address and the addressing forwarding address; A second processing module, used for sending the first message to the back-end server corresponding to the physical address, and receiving a second message returned by the back-end server; The second sending module is used to send the second message to the load balancing device according to the addressing forwarding address.
9. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method according to any one of claims 1 to 4 or 5 to 6 is implemented.
10. A readable storage medium, characterized in that: When the instructions in the readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute any one of the methods of claims 1 to 4 or 5 to 6.
Citation Information
Patent Citations
Method and device for access to memory of virtual machine and finders
CN102662869A
Systems and methods for maintaining transparent end to end cache redirection
CN102771085A
Data transmission method and system
CN102946351A
High-availability loading balancing equipment and method under transparent network bridge mode
CN104079497A
Load balancing method and load balancing system in cloud computing environment
CN104780115A