Data transmission method, device, storage medium and computer program product

CN122534041APending Publication Date: 2026-08-07ZTE CORP
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZTE CORP
Filing Date
2026-06-25
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

[0004]然而,上述引流策略在云网络中存在明显缺陷:网络的路由节点数量较多,每个可能转发响应报文的路由节点均需配置引流策略,且LB本身也是由多个节点构成的集群,引流策略的配置需要考虑负荷分担到不同的LB的节点,导致引流策略的配置复杂度较高

Benefits of technology

[0015]本申请提供了一种数据传输方法、设备、存储介质及计算机程序产品,包括:接收服务节点发送的第一响应报文;按照网关与服务节点之间的地址映射关系,对所述第一响应报文中的源地址进行地址转换,得到第二响应报文;将所述第二响应报文路由转发至客户端。在本申请中,服务节点生成的第一响应报文直接转发至网关,由网关根据网关与服务节点之间的地址映射关系完成响应报文的源地址转换以及报文转发。相较于传统DNAT负载均衡架构,本申请的响应报文全程无需经过负载均衡器进行二次转发,且无需在全网部署引流策略,有效降低组网配置复杂度,减少负载均衡器的带宽资源占用,缩短报文转发链路以及提高报文整体转发的效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122534041A_ABST
    Figure CN122534041A_ABST
Patent Text Reader

Abstract

The application discloses a data transmission method, device, storage medium and computer program product. The method comprises the following steps: receiving a first response message sent by a service node; performing address conversion on a source address in the first response message according to an address mapping relationship between a gateway and the service node, to obtain a second response message; and routing and forwarding the second response message to a client. In the application, the first response message generated by the service node is directly forwarded to the gateway; and the address conversion and the message forwarding are completed by the gateway according to the address mapping relationship between the gateway and the service node. The forwarding of the response message does not need to pass through a load balancer, and a diversion strategy does not need to be deployed in the whole network, so that the networking configuration complexity is effectively reduced, the bandwidth resource occupation of the load balancer is reduced, the message forwarding link is shortened, and the overall message forwarding efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a data transmission method, device, storage medium, and computer program product. Background Technology

[0002] Cloud networks are infrastructure networks adapted to cloud scenarios (including private clouds, public clouds, edge clouds, etc.). Among them, the Destination Network Address Translation (DNAT) load balancing solution is widely used in cloud business scenarios because it can completely preserve the real source IP of the client, which facilitates business auditing and traceability.

[0003] Currently, the load balancing forwarding process in DNAT mode is as follows: A public network client initiates an access request. The request packet is forwarded sequentially through a NAT (Network Address Translation) gateway and a LB (Load Balancer) before reaching the corresponding service node. After processing the business request, the service node generates a response packet. The source IP of the response packet is the service node's IP, and the destination address is the client's IP. To enable the response packet to undergo source address translation through the LB, the current solution requires configuring a traffic redirection policy in the network, such as policy routing or redirection rules, to force response packets with relevant characteristics to the LB according to the traffic redirection policy. After receiving the response packet, the LB translates the source IP address of the response packet into a VIP (Virtual IP). The response packet with the translated source address is then routed to the NAT gateway. The NAT gateway translates the source IP of the response packet from the VIP into an EIP (Elastic IP) and sends it to the public network. The response packet is then routed to the client on the public network.

[0004] However, the aforementioned traffic redirection strategy has significant drawbacks in cloud networks: the network has a large number of routing nodes, and each routing node that may forward response packets needs to be configured with a traffic redirection strategy. Furthermore, the load balancer (LB) itself is a cluster of multiple nodes, and configuring the traffic redirection strategy requires considering load balancing across different LB nodes, resulting in high configuration complexity. In addition, the LB must handle both destination address translation and forwarding of client request packets, as well as source address translation and forwarding of response packets, leading to significant bandwidth consumption and high packet forwarding latency. Summary of the Invention

[0005] The main objective of this application is to provide a data transmission method, device, storage medium, and computer program product, which aims to reduce the complexity of message forwarding configuration, reduce the bandwidth consumption of the load balancer, and reduce message forwarding latency.

[0006] To achieve the above objectives, this application proposes a data transmission method, which is applied to a gateway and includes: Receive the first response message sent by the service node; Based on the address mapping relationship between the gateway and the service node, the source address in the first response message is translated to obtain the second response message; The second response message is routed and forwarded to the client.

[0007] Furthermore, to achieve the above objectives, this application also proposes a data transmission method, which is applied to a control platform and includes: The address mapping relationship between the gateway and the service node is sent to the gateway, so that the gateway can perform address translation on the source address in the first response message sent by the service node according to the address mapping relationship between the gateway and the service node, obtain the second response message, and route and forward the second response message to the client.

[0008] Furthermore, to achieve the above objectives, this application also proposes a data transmission method, which is applied to a service node and includes: A first response message is sent to the gateway, so that the gateway can perform address translation on the source address in the first response message according to the address mapping relationship between the gateway and the service node, obtain a second response message, and route the second response message to the client.

[0009] Furthermore, to achieve the above objectives, this application also proposes a data transmission device, which is applied to a gateway and includes: The receiving module is used to receive the first response message sent by the service node; The address translation module is used to translate the source address in the first response message according to the address mapping relationship between the gateway and the service node, so as to obtain the second response message; The forwarding module is used to route and forward the second response message to the client.

[0010] Furthermore, to achieve the above objectives, this application also proposes a data transmission device, which is applied to a control platform and includes: The first sending module is used to send the address mapping relationship between the gateway and the service node to the gateway, so that the gateway can perform address translation on the source address in the first response message sent by the service node according to the address mapping relationship between the gateway and the service node, obtain the second response message, and route and forward the second response message to the client.

[0011] Furthermore, to achieve the above objectives, this application also proposes a data transmission apparatus, which is applied to a service node and includes: The second sending module is used to send a first response message to the gateway, so that the gateway can perform address translation on the source address in the first response message according to the address mapping relationship between the gateway and the service node to obtain a second response message, and then route and forward the second response message to the client.

[0012] In addition, to achieve the above objectives, this application also proposes an electronic device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the data transmission method as described above.

[0013] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and which, when executed by a processor, implements the steps of the data transmission method described above.

[0014] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the data transmission method described above.

[0015] This application provides a data transmission method, device, storage medium, and computer program product, comprising: receiving a first response message sent by a service node; performing address translation on the source address in the first response message according to the address mapping relationship between the gateway and the service node to obtain a second response message; and routing and forwarding the second response message to a client. In this application, the first response message generated by the service node is directly forwarded to the gateway, which performs source address translation and message forwarding based on the address mapping relationship between the gateway and the service node. Compared with the traditional DNAT load balancing architecture, the response message in this application does not need to be forwarded twice by the load balancer throughout the entire process, and there is no need to deploy traffic redirection strategies across the entire network, effectively reducing network configuration complexity, reducing the bandwidth resource consumption of the load balancer, shortening the message forwarding link, and improving the overall message forwarding efficiency. Attached Figure Description

[0016] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a flowchart illustrating an embodiment of the data transmission method of this application. Figure 2 One of the schematic diagrams illustrating the construction of a mapping relationship provided in an embodiment of this application; Figure 3 A second schematic diagram illustrating the construction of a mapping relationship provided in an embodiment of this application; Figure 4 The third schematic diagram illustrating the construction of mapping relationships provided in an embodiment of this application; Figure 5 A complete flow interaction timing diagram is provided for one embodiment of this application; Figure 6 A system architecture diagram for data transmission provided in an embodiment of this application; Figure 7 An interaction timing diagram of a capacity expansion service node provided in an embodiment of this application; Figure 8 An interaction timing diagram of a scaling-down service node provided in an embodiment of this application; Figure 9 An interaction timing diagram of a fault service node provided in an embodiment of this application; Figure 10 This is a flowchart illustrating Embodiment 2 of the data transmission method of this application; Figure 11 This is a flowchart illustrating Embodiment 3 of the data transmission method of this application; Figure 12 This is one of the schematic diagrams of the module structure of the data transmission device according to an embodiment of this application; Figure 13 This is a second schematic diagram of the module structure of the data transmission device according to an embodiment of this application; Figure 14 This is the third schematic diagram of the module structure of the data transmission device according to an embodiment of this application; Figure 15 This is a schematic diagram of the device structure of the hardware operating environment involved in the data transmission method in the embodiments of this application.

[0019] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0020] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.

[0021] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.

[0022] The data transmission method in this application belongs to the load balancing technology solution under virtualized cloud systems, and is applied to various cloud computing power deployment scenarios such as general computing systems and intelligent computing systems. Specifically, refer to... Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of the data transmission method of this application. The data transmission method is applied to a gateway and includes the following steps: Step S11: Receive the first response message sent by the service node; It should be noted that the load balancing forwarding process in DNAT (Destination Network Address Translation) mode is as follows: The client initiates a first access request, where the source address of the first access request is the client's IP address, and the destination address is the IP address provided by the gateway. After the first access request is routed to the gateway via the public network, the gateway translates the destination address of the first access request, that is, it translates the destination address of the first access request to the IP address of the LB (Load Balancer), while the source address remains unchanged, resulting in the second access request. Optionally, the gateway can be a firewall device, a router device, or a standalone NAT (Network Address Translation) gateway device.

[0023] The second access request is then routed to the load balancer, which in this embodiment is in DNAT mode. The load balancer selects a target service node from multiple service nodes, and then, based on the IP address of the target service node, transforms the destination address of the second access request again. That is, the destination address of the second access request is replaced with the IP address of the target service node, while the source address remains the client's IP address. After transformation, a third access request packet is obtained, and the third access request packet is forwarded to the corresponding service node.

[0024] After receiving and processing the third access request, the service node generates a first response message. The source address of this first response message is the IP address of the current service node, and the destination address is the IP address of the client that initiated the access request. Then, using a preset default route, the first response message is directly routed to the gateway. The default route is a pre-configured default routing rule; when there is no corresponding forwarding route for the destination address of the message, it is uniformly forwarded to the gateway according to the path specified by the default route. In other words, the first response message sent by the service node does not need to be forwarded twice by the load balancer; it can be directly routed to the gateway using the network's default route, simplifying the overall return message forwarding chain.

[0025] In addition, it should be noted that the deployment of gateways and load balancers is compatible with two implementation methods: they can be physical network devices or virtual network element devices generated by virtualization cloud platforms.

[0026] Step S12: According to the address mapping relationship between the gateway and the service node, the source address in the first response message is converted to obtain the second response message; It should be noted that the source address of the second response message is the IP address of the gateway, and the destination address of the second response message is the IP address of the client that initiated the access request.

[0027] In this embodiment, the source address in the first response message is converted into the IP address of the gateway according to the address mapping relationship between the gateway and the service node, thus obtaining the second response message.

[0028] More specifically: the address mapping relationship between the gateway and the service node includes a first mapping relationship and a second mapping relationship; the first mapping relationship is used to characterize the address mapping relationship between the service node and the load balancer, and the second mapping relationship is used to characterize the address mapping relationship between the gateway and the load balancer; in one embodiment, according to the first mapping relationship, the target virtual IP address corresponding to the source address in the first response message is queried; then, according to the second mapping relationship, the target elastic IP address corresponding to the target virtual IP address is queried. The source address in the first response message is modified to the target elastic IP address to obtain the second response message.

[0029] In another embodiment, the address mapping relationship between the gateway and the service node is a third mapping relationship derived from the first and second mapping relationships. This third mapping relationship refers to the direct mapping relationship between the IP address of the service node and the IP address of the gateway. Based on the third mapping relationship, the target elastic IP address corresponding to the source address in the first response message is directly retrieved; then, the source address in the first response message is directly modified to the target elastic IP address to obtain the second response message.

[0030] In this embodiment, the source address translation of the response message is completed independently by the gateway. The entire process does not require the participation of the load balancer in the return message forwarding, nor does it require the deployment of traffic diversion strategies on the routing nodes of the entire network.

[0031] In other alternative embodiments, the address mapping relationship in this embodiment is not limited to matching and converting based on the source IP address. It can also combine the five-tuple information of the destination IP address, source port number, destination port number and transport layer protocol number of the packet to jointly construct a finer mapping relationship, so as to achieve more granular and more accurate packet address conversion and further improve the accuracy and security of network packet forwarding.

[0032] Step S13: The second response message is routed and forwarded to the client.

[0033] In this embodiment, the second response message is sent to the client corresponding to the destination address based on the destination address in the second response message. Optionally, the gateway pushes the second response message to the public network, and the second response message is forwarded across networks via the routing links of the public network, ultimately forwarding the second response message to the client that initiated the access request.

[0034] In this embodiment, the first response message generated by the service node is directly forwarded to the gateway, which then performs address translation and message forwarding based on the address mapping relationship between the gateway and the service node. The entire forwarding process of the response message does not require passing through a load balancer, and there is no need to deploy traffic redirection strategies across the entire network. This effectively reduces network configuration complexity, minimizes the bandwidth resource consumption of the load balancer, shortens the message forwarding link, and improves the overall message forwarding efficiency.

[0035] In one feasible implementation, before performing address translation on the source address in the first response message according to the address mapping relationship between the gateway and the service node to obtain the second response message, the method further includes: Step S21: Receive the address mapping relationship between the gateway and the service node sent by the control platform.

[0036] It should be noted that the address mapping relationship between the gateway and the service node is formed by the control platform based on the first mapping relationship and the second mapping relationship.

[0037] In this embodiment, refer to Figure 2 , Figure 2This is one of the schematic diagrams illustrating the construction of a mapping relationship according to an embodiment of this application. The control platform stores the IP addresses of each service node. Furthermore, when configuring a load balancer, a virtual IP address for external services is configured for the load balancer, and a mapping relationship is established between the IP addresses of the service nodes and the virtual IP address of the load balancer, resulting in a first mapping relationship. Additionally, when the control platform creates a gateway to connect to the public network, it binds an independent elastic IP address to the gateway and associates and binds the gateway's elastic IP address with the virtual IP address of the load balancer, resulting in a second mapping relationship. Using the virtual IP address of the load balancer as a basis, the control platform merges the first and second mapping relationships to generate a third mapping relationship. The third mapping relationship strips away the virtual IP address of the load balancer, directly establishing a direct mapping relationship between the IP addresses of the service nodes and the IP address of the NAT gateway. The third mapping relationship is then sent to the gateway for storage, allowing the gateway to perform address translation and packet forwarding based on the third mapping relationship. It should be noted that the control platform can be an SDN (Software Defined Networking) controller or a network management system, etc.

[0038] This embodiment receives the address mapping relationship between the gateway and the service node sent by the control platform. Subsequently, the gateway completes address translation and packet forwarding based on the address mapping relationship between the gateway and the service node. The forwarding of response packets does not require passing through a load balancer, and there is no need to deploy traffic diversion strategies across the entire network, effectively reducing network configuration complexity, reducing the bandwidth resource consumption of the load balancer, shortening the packet forwarding link, and improving the overall packet forwarding efficiency.

[0039] In one feasible embodiment, before performing address translation on the source address in the first response message according to the address mapping relationship between the gateway and the service node to obtain the second response message, the method further includes: Step S31: Receive the first mapping relationship sent by the control platform; Step S32: Receive the second mapping relationship sent by the control platform or receive the virtual IP address of the load balancer and the elastic IP address of the gateway sent by the control platform, and construct the second mapping relationship; Step S33: Based on the first mapping relationship and the second mapping relationship, form an address mapping relationship between the gateway and the service node.

[0040] In this embodiment, the control platform stores the IP addresses of each service node. In addition, when configuring the load balancer, it configures a virtual IP address for the load balancer to provide external services, and establishes a mapping relationship between the IP addresses of the service nodes and the virtual IP address of the load balancer to obtain a first mapping relationship, which is then sent to the gateway.

[0041] Furthermore, when the control platform creates a gateway to the public network, it binds an independent elastic IP address to the gateway and then sends the virtual IP address of the load balancer and the elastic IP address of the gateway to the gateway. The gateway then constructs a second mapping relationship based on these two addresses. In another embodiment, when the control platform creates a gateway to the public network, it binds an independent elastic IP address to the gateway and associates the gateway's elastic IP address with the IP address of the load balancer to obtain a second mapping relationship. The control platform then sends this second mapping relationship to the gateway.

[0042] Furthermore, referring to Figure 3 Figure 3 This is a second schematic diagram illustrating the construction of a mapping relationship according to an embodiment of this application. The gateway uses the virtual IP address of the load balancer as a basis to associate and merge the first and second mapping relationships, generating a third mapping relationship. The third mapping relationship removes the virtual IP address of the load balancer and directly establishes a one-to-one mapping between the IP address of the service node and the IP address of the gateway. Subsequently, the gateway performs address translation and packet forwarding based on the third mapping relationship. In another embodiment, referring to... Figure 4 , Figure 4 This is a third schematic diagram of the construction of mapping relationships provided in an embodiment of this application; the first mapping relationship and the second mapping relationship are used as the address mapping relationship between the gateway and the service node, and the gateway subsequently completes address translation and packet forwarding based on the first mapping relationship and the second mapping relationship.

[0043] This embodiment establishes an address mapping relationship between the gateway and the service node based on the first and second mapping relationships. Subsequently, the gateway performs address translation and packet forwarding according to the address mapping relationship between the gateway and the service node. The forwarding of response packets does not require passing through a load balancer, and there is no need to deploy traffic redirection strategies across the entire network. This effectively reduces the complexity of network configuration, reduces the bandwidth resource consumption of the load balancer, shortens the packet forwarding link, and improves the overall packet forwarding efficiency.

[0044] In a specific example, refer to Figure 5 and Figure 6 , Figure 5 This is a complete flow interaction timing diagram provided for one embodiment of this application. Figure 6This is a system architecture diagram for data transmission provided in one embodiment of this application. Specifically, the control platform configures the IP addresses of each service node, denoted as RIP. Additionally, it configures the virtual IP address for external services of the load balancer, denoted as VIP, and establishes a mapping relationship between the RIPs of each service node and the VIP of the load balancer, obtaining a first mapping relationship. The control platform sends the first mapping relationship to the gateway. Furthermore, when the control platform creates a gateway to connect to the public network, it binds an independent IP address to the gateway, denoted as EIP, and sends the gateway's EIP and the load balancer's VIP to the gateway so that the gateway can construct a mapping relationship between the EIP and the load balancer's VIP, obtaining a second mapping relationship. The gateway then associates and merges the first and second mapping relationships to generate a mapping relationship between the EIP and RIP, obtaining a third mapping relationship.

[0045] During communication, the client initiates a first access request. The source address of this first access request is the client's public IP address (CIP), and the destination address is the gateway's EIP. After the first access request is routed through the public network to the gateway, the gateway translates the destination address of the first access request, replacing the EIP with the load balancer's VIP, while keeping the client's CIP as the source address, resulting in a second access request. This second access request, with its destination address translated, is then routed to the load balancer. The load balancer selects a target service node from multiple service nodes and translates the destination address of the second access request again, replacing the VIP with the target service node's RIP, while keeping the client's CIP as the source address, resulting in a third access request packet. This third access request packet is then forwarded to the corresponding service node.

[0046] After receiving and processing the third access request, the service node generates a first response message. The source address of this first response message is the current service node's RIP, and the destination address is the client's CIP. The first response message does not need to pass through the load balancer; instead, it is routed to the gateway via a preset default route. The gateway, according to the mapping relationship between EIP and RIP, translates the source address in the first response message into the gateway's EIP, resulting in a second response message. The second response message is then forwarded across the network to the client via a public network routing link. The first response message does not require secondary forwarding through the load balancer throughout its entire process, shortening the message forwarding path and improving the overall efficiency of message forwarding.

[0047] In one feasible implementation, the data transmission method further includes: Step S41: In response to the mapping relationship adjustment request sent by the control platform, update the address mapping relationship between the gateway and the service node.

[0048] It should be noted that the mapping relationship adjustment request includes the mapping relationships to be adjusted for service nodes that are being expanded, service nodes that are being scaled down, and / or service nodes that are experiencing failures.

[0049] In this embodiment, refer to Figure 7 , Figure 7 This is an interaction timing diagram of a service node expansion according to an embodiment of this application. For a service node expansion scenario, for example, expanding from the original N service nodes to N+1 service nodes, the control platform allocates IP addresses to the service nodes and establishes an address mapping relationship between the gateway and the service nodes. Based on the address mapping relationship between the gateway and the service nodes, a mapping adjustment request is generated and sent to the gateway so that the gateway can store the newly added address mapping relationship between the gateway and the service nodes. Subsequently, the gateway can perform address translation and packet forwarding on the response packets of the service nodes.

[0050] Reference Figure 8 , Figure 8 This is a timing diagram illustrating the interaction of a scaling-down service node according to an embodiment of this application. For a scaling-down service node scenario, for example, scaling down from N service nodes to N-1 service nodes, the control platform determines the address mapping relationship associated with the scaling-down service node. Based on this address mapping relationship, it generates a mapping adjustment request and sends it to the gateway, allowing the gateway to delete the address mapping relationship related to the scaling-down service node from its local storage. Furthermore, the control platform synchronously distributes the IP address of the scaling-down service node to the load balancer. The load balancer updates its local node scheduling list, that is, it deletes the relevant IP information of the scaling-down service node from the node scheduling list. Subsequently, when the load balancer performs load balancing scheduling for client access requests, it automatically blocks the scaling-down service node, no longer forwarding access requests to it, and instead scheduling all client access requests to the remaining N-1 normally operating service nodes for business processing.

[0051] Reference Figure 9 , Figure 9This is a timing diagram illustrating the interaction of a faulty service node according to an embodiment of this application. In a faulty service node scenario: the control platform continuously sends heartbeat messages to each service node. If no response is received from a service node within a preset time, the service node is determined to have failed. Further, the control platform queries the address mapping relationship associated with the faulty service node, generates a mapping adjustment request based on this relationship, and sends it to the gateway so that the gateway can delete the address mapping relationship related to the faulty service node. Additionally, the control platform synchronously sends the IP address of the faulty service node to the load balancer so that the load balancer can delete the relevant IP information of the faulty service node. Subsequently, when the load balancer performs load balancing scheduling for client access requests, it will automatically block the faulty service node and will no longer forward any access requests to it. Instead, it will schedule all client access requests to the remaining N-1 normally operating service nodes for business processing.

[0052] This embodiment updates the address mapping relationship between the gateway and service nodes in response to a mapping adjustment request sent by the control platform. The mapping adjustment request includes the mapping relationships to be adjusted for service nodes that are being expanded, scaled down, or have failed. By adjusting the address mapping relationship between the gateway and service nodes, various operation and maintenance scenarios such as elastic scaling up and scaling down of service nodes and node failure shutdown can be adapted without changing the overall network routing configuration and traffic redirection strategy, thereby improving the overall cloud load balancing network's operation and maintenance convenience and business operation stability.

[0053] In one feasible implementation, refer to Figure 10 , Figure 10 This is a flowchart illustrating a second embodiment of the data transmission method of this application; this application provides a data transmission method applied to a control platform, including: Step S51: Send the address mapping relationship between the gateway and the service node to the gateway, so that the gateway can perform address translation on the source address in the first response message sent by the service node according to the address mapping relationship between the gateway and the service node, obtain the second response message, and route and forward the second response message to the client.

[0054] In this embodiment, the control platform stores the IP addresses of each service node. Furthermore, it configures a virtual IP address for the load balancer to provide external services and establishes a mapping relationship between the IP addresses of the service nodes and the virtual IP address of the load balancer, resulting in a first mapping relationship. Additionally, when the control platform creates a gateway to connect to the public network, it binds an independent elastic IP address to the gateway and associates the gateway's elastic IP address with the virtual IP address of the load balancer, resulting in a second mapping relationship. Using the virtual IP address of the load balancer as a reference, the control platform merges the first and second mapping relationships to generate a third mapping relationship. The third mapping relationship is a direct mapping between the virtual IP address of the service node and the elastic IP address of the gateway. This third mapping relationship is then sent to the gateway, which performs address translation on the source address in the first response message sent by the service node according to the third mapping relationship, obtaining a second response message, and then routes and forwards the second response message to the client.

[0055] In another embodiment, the control platform sends the first and second mapping relationships to the gateway, so that the gateway can perform address translation on the source address in the first response message sent by the service node according to the first and second mapping relationships to obtain a second response message, and then route the second response message to the client. In another embodiment, the control platform sends the first and second mapping relationships to the gateway, so that the gateway can perform association and fusion according to the first and second mapping relationships to generate a third mapping relationship, and then perform address translation on the source address in the first response message sent by the service node according to the third mapping relationship to obtain a second response message, and then route the second response message to the client.

[0056] It should be noted that the process of constructing the address mapping relationship between the gateway and the service node, as well as the message address conversion process, have been specifically described in the above embodiments and will not be repeated here.

[0057] This embodiment sends the address mapping relationship between the gateway and the service node to the gateway, which then performs address translation and packet forwarding based on this mapping. The entire forwarding process of the response packet does not require a load balancer, and there is no need to deploy traffic redirection strategies across the entire network. This effectively reduces network configuration complexity, minimizes the bandwidth resource consumption of the load balancer, shortens the packet forwarding link, and improves overall packet forwarding efficiency.

[0058] In one feasible implementation, after sending the address mapping relationship between the gateway and the service node to the gateway, the method further includes: Step S61: Obtain the mapping relationship to be adjusted corresponding to the expansion service node, the reduction service node and / or the faulty service node; Step S62: Based on the mapping relationship to be adjusted, generate a mapping relationship adjustment request and send it to the gateway, so that the gateway can update the address mapping relationship between the gateway and the service node according to the mapping relationship adjustment request.

[0059] In this embodiment, for the scenario of expanding service nodes, the control platform allocates IP addresses to the expansion service nodes and establishes an address mapping relationship between the gateway and the expansion service nodes. Based on the address mapping relationship between the gateway and the expansion service nodes, a mapping adjustment request is generated and sent to the gateway so that the gateway can store the newly added address mapping relationship between the gateway and the expansion service nodes. Subsequently, the gateway can perform address translation and packet forwarding on the response packets of the expansion service nodes.

[0060] For scenarios involving scaling down service nodes, such as reducing from N service nodes to N-1 service nodes, the control platform determines the address mapping relationship corresponding to the scaled-down service node. Based on this address mapping relationship, it generates a mapping adjustment request and sends it to the gateway, allowing the gateway to delete the address mapping relationship related to the scaled-down service node from its local storage. Furthermore, the control platform synchronously distributes the IP address of the scaled-down service node to the load balancer, enabling the load balancer to update its local node scheduling list, i.e., to delete the related IP information of the scaled-down service node. Subsequently, when the load balancer performs load balancing scheduling for client access requests, it will automatically block the scaled-down service node, no longer forwarding access requests to it, and instead distributing all client access requests to the remaining N-1 normally operating service nodes for business processing.

[0061] For scenarios involving failed service nodes: The control platform continuously sends heartbeat messages to each service node. If no response is received from a service node within a preset time, the failure of that service node is confirmed. Further, the control platform determines the address mapping relationship corresponding to the failed service node, generates a mapping adjustment request based on this relationship, and sends it to the gateway so that the gateway can delete the address mapping relationship related to the failed service node. Additionally, the control platform synchronously sends the IP address of the failed service node to the load balancer so that the load balancer can delete the relevant IP information of the failed service node. Subsequently, when the load balancer performs load balancing scheduling for client access requests, it will automatically block the failed service node, no longer forwarding access requests to it, and instead distributing all client access requests to the remaining N-1 normally operating service nodes for business processing.

[0062] This embodiment generates a mapping adjustment request based on the mapping relationships to be adjusted for expanded, scaled-down, and / or failed service nodes, and sends it to the gateway. The gateway then updates the address mapping relationship between itself and the service nodes according to the request. For various operational scenarios involving elastic scaling up, scaling down, and node failures of backend service nodes, only the address mapping relationship between the gateway and the service nodes needs to be adjusted to ensure normal packet forwarding. No changes to the overall network routing configuration and traffic redirection strategy are required, improving the overall ease of operation and maintenance and the stability of business operations in the cloud load balancing network.

[0063] In one feasible implementation, refer to Figure 11 , Figure 11 This is a flowchart illustrating a third embodiment of the data transmission method of this application; this application provides a data transmission method applied to a service node, including: Step S71: Send a first response message to the gateway, so that the gateway can perform address translation on the source address in the first response message according to the address mapping relationship between the gateway and the service node, obtain a second response message, and route and forward the second response message to the client.

[0064] In this embodiment, after receiving and processing the access request forwarded by the load balancer, the service node generates a first response message. The source address of this first response message is the IP address of the current service node, and the destination address is the IP address of the client that initiated the access request. Then, through a preset default route, the first response message is directly routed to the gateway, so that the gateway can query the target elastic IP address corresponding to the source address in the first response message based on the address mapping relationship between the gateway and the service node. The source address in the first response message is then modified to the target elastic IP address to obtain a second response message, which is further routed and forwarded to the client.

[0065] It should be noted that the process of constructing the address mapping relationship between the gateway and the service node, as well as the message address conversion process, have been specifically described in the above embodiments and will not be repeated here.

[0066] In this embodiment, the service node directly forwards the generated first response message to the gateway; the gateway then performs address translation and message forwarding based on the address mapping relationship between the gateway and the service node. The entire forwarding process of the response message does not require passing through a load balancer, and there is no need to deploy traffic redirection strategies across the entire network, effectively reducing network configuration complexity, minimizing the bandwidth resource consumption of the load balancer, shortening the message forwarding link, and improving the overall message forwarding efficiency.

[0067] It should be noted that the examples in the figure are only for understanding this application and do not constitute a limitation on the data transmission method of this application. Any simple modifications based on this technical concept are within the protection scope of this application.

[0068] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0069] This application also provides a data transmission device; please refer to... Figure 12 , Figure 12 This is one of the schematic diagrams of the module structure of the data transmission device according to an embodiment of this application; the data transmission device is applied to a gateway and includes: Receiver module 81 is used to receive the first response message sent by the service node; Address translation module 82 is used to translate the source address in the first response message according to the address mapping relationship between the gateway and the service node to obtain the second response message; Forwarding module 83 is used to route and forward the second response message to the client.

[0070] In addition, this application also proposes a data transmission device, please refer to... Figure 13 , Figure 13 This is a second schematic diagram of the module structure of the data transmission device according to an embodiment of this application; the data transmission device is applied to a control platform and includes: The first sending module 91 is used to send the address mapping relationship between the gateway and the service node to the gateway, so that the gateway can perform address translation on the source address in the first response message sent by the service node according to the address mapping relationship between the gateway and the service node, obtain the second response message, and route and forward the second response message to the client.

[0071] In addition, this application also proposes a data transmission device, please refer to... Figure 14 , Figure 14 This is the third schematic diagram of the module structure of the data transmission device according to an embodiment of this application; the data transmission device is applied to a service node and includes: The second sending module 101 is used to send a first response message to the gateway, so that the gateway can perform address translation on the source address in the first response message according to the address mapping relationship between the gateway and the service node to obtain a second response message, and then route and forward the second response message to the client.

[0072] The data transmission apparatus provided in this application, employing the data transmission method in the above embodiments, can solve the technical problems described in the background section. Compared with the prior art, the beneficial effects of the data transmission apparatus provided in this application are the same as those of the data transmission method provided in the above embodiments, and other technical features in the data transmission apparatus are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.

[0073] This application provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the data transmission method in Embodiment 1 above.

[0074] The following is for reference. Figure 15 , Figure 15 This is a schematic diagram of the device structure of the hardware operating environment involved in the data transmission method in the embodiments of this application. The electronic devices in the embodiments of this application may include, but are not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), vehicle terminals (such as vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 15 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0075] like Figure 15As shown, the electronic device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory 1002 or a program loaded from a storage device 1003 into a random access memory 1004. The random access memory 1004 also stores various programs and data required for the operation of the electronic device. The processing unit 1001, the read-only memory 1002, and the random access memory 1004 are interconnected via a bus 1005. An input / output interface 1006 is also connected to the bus. Typically, the following systems can be connected to the input / output interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. The communication device 1009 allows the electronic device to communicate wirelessly or wiredly with other devices to exchange data. Although the diagrams show electronic devices with various systems, it should be understood that it is not required to implement or have all of the systems shown. More or fewer systems may be implemented alternatively.

[0076] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from read-only memory 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.

[0077] The electronic device provided in this application, employing the data transmission method in the above embodiments, can solve the technical problems described in the background section. Compared with the prior art, the beneficial effects of the electronic device provided in this application are the same as those of the data transmission method provided in the above embodiments, and other technical features of the electronic device are the same as those disclosed in the method of the previous embodiment, and will not be repeated here.

[0078] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.

[0079] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0080] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the data transmission method in the above embodiments.

[0081] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having 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 fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0082] The aforementioned computer-readable storage medium may be included in an electronic device or may exist independently without being assembled into an electronic device.

[0083] The aforementioned computer-readable storage medium carries one or more programs, which, when executed by an electronic device, cause the electronic device to: receive a first response message sent by a service node; perform address translation on the source address in the first response message according to the address mapping relationship between the gateway and the service node to obtain a second response message; and route and forward the second response message to the client.

[0084] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0085] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0086] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.

[0087] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for performing the above-described data transmission method, and is able to solve the technical problems described in the background art. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the data transmission method provided in the above embodiments, and will not be repeated here.

[0088] This application provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the data transmission method described above.

[0089] The computer program product provided in this application can solve the technical problems described in the background section. Compared with the prior art, the beneficial effects of the computer program product provided in the embodiments of this application are the same as the beneficial effects of the data transmission method provided in the above embodiments, and will not be repeated here.

[0090] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.

Claims

1. A data transmission method, characterized in that, Applied to gateways, including: Receive the first response message sent by the service node; Based on the address mapping relationship between the gateway and the service node, the source address in the first response message is translated to obtain the second response message; The second response message is routed and forwarded to the client.

2. The data transmission method as described in claim 1, characterized in that, The step of performing address translation on the source address in the first response message according to the address mapping relationship between the gateway and the service node to obtain the second response message includes: Based on the address mapping relationship between the gateway and the service node, determine the target elastic IP address corresponding to the source address in the first response message; The source address in the first response message is modified to the target elastic IP address to obtain the second response message.

3. The data transmission method as described in claim 2, characterized in that, The address mapping relationship between the gateway and the service node includes a first mapping relationship and a second mapping relationship; the first mapping relationship is used to characterize the address mapping relationship between the service node and the load balancer, and the second mapping relationship is used to characterize the address mapping relationship between the gateway and the load balancer. The step of determining the target elastic IP address corresponding to the source address in the first response message according to the address mapping relationship between the gateway and the service node includes: Based on the first mapping relationship, determine the target virtual IP address corresponding to the source address in the first response message; Based on the second mapping relationship, the target elastic IP address corresponding to the target virtual IP address is determined.

4. The data transmission method as described in claim 3, characterized in that, Before performing address translation on the source address in the first response message according to the address mapping relationship between the gateway and the service node to obtain the second response message, the method further includes: The address mapping relationship between the gateway and the service node is sent by the control platform, wherein the address mapping relationship between the gateway and the service node is formed by the control platform based on the first mapping relationship and the second mapping relationship.

5. The data transmission method as described in claim 3, characterized in that, Before performing address translation on the source address in the first response message according to the address mapping relationship between the gateway and the service node to obtain the second response message, the method further includes: Receive the first mapping relationship sent by the control platform; The second mapping relationship is constructed by receiving the second mapping relationship sent by the control platform or by receiving the virtual IP address of the load balancer and the elastic IP address of the gateway sent by the control platform. Based on the first mapping relationship and the second mapping relationship, an address mapping relationship is formed between the gateway and the service node.

6. The data transmission method as described in claim 1, characterized in that, Also includes: In response to a mapping adjustment request sent by the control platform, the address mapping relationship between the gateway and the service node is updated, wherein the mapping adjustment request includes the mapping relationship to be adjusted corresponding to the expanded service node, the scaled-down service node, and / or the faulty service node.

7. A data transmission method, characterized in that, Applications in control platforms include: The address mapping relationship between the gateway and the service node is sent to the gateway, so that the gateway can perform address translation on the source address in the first response message sent by the service node according to the address mapping relationship between the gateway and the service node, obtain the second response message, and route and forward the second response message to the client.

8. The data transmission method as described in claim 7, characterized in that, After sending the address mapping relationship between the gateway and the service node to the gateway, the process further includes: Obtain the mapping relationships to be adjusted for the expansion service nodes, reduction service nodes, and / or faulty service nodes; Based on the mapping relationship to be adjusted, a mapping relationship adjustment request is generated and sent to the gateway, so that the gateway can update the address mapping relationship between the gateway and the service node according to the mapping relationship adjustment request.

9. A data transmission method, characterized in that, Applied to service nodes, including: A first response message is sent to the gateway, so that the gateway can perform address translation on the source address in the first response message according to the address mapping relationship between the gateway and the service node, obtain a second response message, and route the second response message to the client.

10. An electronic device, characterized in that, The electronic device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the data transmission method as described in any one of claims 1 to 6, 7 to 8, or 9.

11. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the data transmission method as described in any one of claims 1 to 6, 7 to 8, or 9.

12. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the data transmission method as described in any one of claims 1 to 6, 7 to 8, or 9.