Message transmission method and device, equipment and storage medium

By determining the target NAT device based on the source information and destination information of the request message, and diverting the request message to the public network device, the problem of inefficiency in existing NAT devices when processing a large number of request messages is solved, and more efficient message transmission is achieved.

CN120075188APending Publication Date: 2025-05-30JD DIGITS HAIYI INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311617729.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-29
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

In a data center network, when a large number of private network devices need to share a public IP for communication with the public network devices, the existing NAT devices will have low packet transmission efficiency when processing a large number of request packets.

Method used

By determining the target public network IP based on the source information of the request message sent by the private network device, and determining the first target NAT device based on the destination information of the request message and the target public network IP, the request message is sent to the public network device to realize the decentralized traffic diversion of the request message.

Benefits of technology

This method effectively disperses the access pressure on NAT devices, improves the packet transmission efficiency, and fully utilizes the high throughput and high concurrency capabilities of the NAT cluster.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120075188A_ABST
    Figure CN120075188A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a message transmission method and device, equipment and a storage medium, and relates to the technical field of communication, and the method comprises the steps: determining a target public network IP according to the source information of a request message sent by private network equipment; determining a first target network address translation (NAT) device according to target information of the request message and the target public network IP; and sending the request message to a public network device based on the first target NAT device. According to the technical scheme, the first target NAT device used for guiding the request message is determined by referring to the source information and the destination information of the request message, different first target NAT devices are determined for the request messages with inconsistent source information and consistent destination information, and the request message is sent to the public network device based on the first target NAT devices, so that the public network device can carry out flow guiding on the request message. Request messages with inconsistent source information and consistent destination information are sent to the public network device based on different first target NAT devices, so that diversion and dispersion of a large number of request messages with consistent destination information are realized, and the message transmission efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of communication technologies, and in particular, to a method, apparatus, device, and storage medium for message transmission. Background Art

[0002] In a data center network, when a large number of private network devices need to share a public network IP to communicate with public network devices, a Network Address Translator (NAT) device needs to be deployed. To provide high throughput and high concurrency capabilities, NAT devices often need to be deployed in a clustered manner.

[0003] In the prior art, after receiving a request message sent by a private network device, the NAT device determines the outer destination IP based on the destination IP and destination port in the five-tuple of the request message, determines the target NAT device for traffic diversion based on the outer destination IP, and diverts the request message to the target NAT device to implement traffic diversion of the request message. Of course, the target NAT device can send the request message to the public network device.

[0004] In the process of implementing the present invention, the inventors found that there are at least the following technical problems in the prior art:

[0005] When a large number of request messages simultaneously access the same public network device, a large number of request messages will be diverted to the same NAT device, resulting in low message transmission efficiency. Summary of the Invention

[0006] The present invention provides a method, apparatus, device, and storage medium for message transmission to achieve decentralized traffic diversion of request messages and improve message transmission efficiency.

[0007] In a first aspect, an embodiment of the present invention provides a method for message transmission, including:

[0008] Determine a target public network IP according to the source information of a request message sent by a private network device.

[0009] Determine a first target Network Address Translator (NAT) device according to the destination information of the request message and the target public network IP;

[0010] Send the request message to a public network device based on the first target NAT device.

[0011] In a second aspect, an embodiment of the present invention further provides a message transmission apparatus, including:

[0012] A first determination module, configured to determine a target public network IP according to the source information of a request message sent by a private network device;

[0013] A second determination module, configured to determine a first target network address translation (NAT) device according to the destination information of the request message and the target public IP address.

[0014] A sending module, configured to send the request message to a public network device based on the first target NAT device.

[0015] In a third aspect, an embodiment of the present invention further provides a computer device, including:

[0016] One or more processors;

[0017] A storage device, configured to store one or more programs,

[0018] When the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the message transmission method according to any one of the first aspects.

[0019] In a fourth aspect, an embodiment of the present invention further provides a storage medium including computer-executable instructions, characterized in that the computer-executable instructions are used to execute the message transmission method according to any one of the first aspects when executed by a computer processor.

[0020] The embodiments in the above-mentioned invention have the following advantages or beneficial effects:

[0021] An embodiment of the present invention provides a message transmission method, including: determining a target public IP address according to the source information of a request message sent by a private network device; determining a first target network address translation (NAT) device according to the destination information of the request message and the target public IP address; and sending the request message to a public network device based on the first target NAT device. In the above technical solution, first, a target public IP address can be determined according to the source information of the request message sent by the private network device, and a first target NAT device can be determined according to the destination information of the request message and the target public IP address determined by the source information of the request message, so as to implement determining the first target NAT device for diverting the request message with reference to the source information and destination information of the request message, further implementing determining different first target NAT devices for request messages with inconsistent source information and consistent destination information, and then the request message can be sent to the public network device based on the first target NAT device, so as to implement sending request messages with inconsistent source information and consistent destination information to the public network device based on different first target NAT devices, and further implementing the diversion and dispersion of a large number of request messages with consistent destination information. Description of the Drawings

[0022] Figure 1 A flowchart of a message transmission method provided by an embodiment of the present invention;

[0023] Figure 2Flowchart of another message transmission method provided by an embodiment of the present invention;

[0024] Figure 3 Structural schematic diagram of a message transmission device provided by an embodiment of the present invention;

[0025] Figure 4 Structural schematic diagram of a computer device provided by an embodiment of the present invention. Detailed implementation manners

[0026] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the present invention, rather than limiting the present invention. Additionally, it should be noted that for the sake of description, only parts related to the present invention rather than all structures are shown in the drawings.

[0027] Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts depict the operations (or steps) as sequential processes, many of the operations can be implemented in parallel, concurrently, or simultaneously. In addition, the order of the operations can be rearranged. The process can be terminated when its operations are completed, but it can also have additional steps not included in the drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc. In addition, without conflict, the embodiments in the present invention and the features in the embodiments can be combined with each other.

[0028] In the prior art, in order to complete the NAT function, the NAT cluster needs to divert the request messages and response messages transmitted between the private network device and the public network device to the same NAT device for processing through a diversion method.

[0029] The NAT cluster consists of multiple NAT devices and switches. The switch configures the equivalent routes of the same continuous diversion network segment for each NAT device. After receiving a request message, the NAT device in the NAT cluster can determine the outer destination IP for encapsulating the request message with the outer VxLAN through an algorithm, encapsulate the request message based on the outer destination IP, and send the encapsulated request message to the switch. The switch can select the target NAT device according to the outer destination IP hash and divert the request message to the target NAT device to achieve the diversion of the request message. Of course, the target NAT device can send the request message to the public network device.

[0030] However, the prior art does not process a large number of request messages evenly. When a large number of request messages access the same public network device simultaneously, a large number of request messages will be diverted to the same NAT device, resulting in low access efficiency and the failure to exert the clustering advantage of the NAT cluster.

[0031] Therefore, the present application proposes a message transmission method to achieve decentralized diversion of request messages and improve access efficiency.

[0032] Figure 1 FIG. is a flowchart of a message transmission method provided by an embodiment of the present invention. The embodiment of the present invention is applicable to the situation where traffic dispersion of message transmission is required. This method can be executed by a message transmission device, and the device can be implemented in software and / or hardware. As Figure 1 described, the method specifically includes the following steps:

[0033] Step 110: Determine a target public network IP according to the source information of the request message sent by the private network device.

[0034] Among them, the private network device can be understood as an internal device of the data center network. The five-tuple information of the request message sent by the private network device includes source IP, source port, destination IP, destination port, and transport protocol.

[0035] Specifically, in order to perform decentralized processing on request messages with the same destination information based on different NAT devices, the target public network IP can be first selected from multiple public network IPs according to the source information of the request message, and then the first target NAT device can be selected from multiple NAT devices according to the destination information of the request message and the target public network IP. Therefore, after receiving the request message sent by the private network device, the source information of the request message can be first determined in the five-tuple information of the request message, and the target public network IP can be determined from multiple public network IPs according to the source information of the request message.

[0036] In the embodiment of the present invention, the target public network IP is determined according to the source information of the request message. The target public network IP can be used for the first target NAT device to process the request message, providing a data basis for determining the first target NAT device. Moreover, the first target NAT device determined with reference to the target public network IP determined by the source information of the request message can determine different first target NAT devices for request messages with inconsistent source information and the same destination information.

[0037] Step 120: Determine a first target network address translation (NAT) device according to the destination information of the request message and the target public network IP.

[0038] Specifically, after determining the target public network IP according to the source information of the request message, the first target NAT device for diverting the request message can be selected from multiple NAT devices according to the destination information of the request message and the target public network IP. Compared with the prior art that determines the first target NAT device only according to the destination information of the request message, that is, only refers to the destination information of the request message to determine the first NAT device, the present application determines the first target NAT device according to the destination information of the request message and the target public network IP determined by the source information of the request message, that is, refers to the destination information and the source information of the request message to determine the first target NAT device, and can determine different first target NAT devices for request messages with inconsistent source information and consistent destination information.

[0039] When the destination information of a large number of request messages is consistent, the first target NAT device for diverting each request message can be determined according to the destination information of each request message and the target public network IP determined by the source information of each request message. Therefore, the target public network IP determined according to the destination information of the request message and the source information of the request message can determine different first target NAT devices for request messages with inconsistent source information and consistent destination information.

[0040] In the embodiment of the present invention, the first target NAT device for diverting the request message is determined according to the destination information of the request message and the target public network IP determined by the source information of the request message, and further different first target NAT devices are determined for request messages with inconsistent source information and consistent destination information.

[0041] Step 130: Send the request message to the public network device based on the first target NAT device.

[0042] Specifically, after determining the first target NAT device, the request message can be sent to the public network device based on the first target NAT device. Of course, the first target NAT device does not know which public network IP to access the public network device, so the first target NAT device can determine the target public network IP according to the source information of the request message, and then send the request message to the public network device based on the target public network IP.

[0043] It should be noted that the way for the first target NAT device to determine the target public network IP according to the source information of the request message is the same as the above-mentioned way of determining the target public network IP according to the source information of the request message, and will not be elaborated here.

[0044] In an embodiment of the present invention, a request message is sent to a public network device based on a first target NAT device, and the first target NAT device is determined according to the destination information of the request message and a target public network IP determined by the source information of the request message, that is, the determination of the first target NAT device refers to the source information and destination information of the request message, so as to send request messages with inconsistent source information and consistent destination information to the public network device based on different first target NAT devices, thereby realizing the diversion and dispersion of a large number of request messages with consistent destination information.

[0045] The message transmission method provided by an embodiment of the present invention includes: determining a target public network IP according to the source information of a request message sent by a private network device; determining a first target network address translation (NAT) device according to the destination information of the request message and the target public network IP; and sending the request message to the public network device based on the first target NAT device. In the above technical solution, first, a target public network IP can be determined according to the source information of a request message sent by a private network device, and a first target NAT device can be determined according to the destination information of the request message and the target public network IP determined by the source information of the request message, so as to realize determining a first target NAT device for diverting the request message by referring to the source information and destination information of the request message, further realizing determining different first target NAT devices for request messages with inconsistent source information and consistent destination information, and then the request message can be sent to the public network device based on the first target NAT device, so as to send request messages with inconsistent source information and consistent destination information to the public network device based on different first target NAT devices, thereby realizing the diversion and dispersion of a large number of request messages with consistent destination information and improving the message transmission efficiency.

[0046] Figure 2 It is a flowchart of another message transmission method provided by an embodiment of the present invention, and the embodiment of the present invention is applicable to the situation where traffic dispersion is required for message transmission. In this embodiment, "determining a second target NAT device according to the source information of a response message corresponding to the request message determined by the public network device and the target public network IP, where the source information of the response message is consistent with the destination information of the request message, and the second target NAT device is the same NAT device as the first target NAT device; and sending the response message to the private network device based on the second target NAT device." is added. The explanations of the same or corresponding terms as those in the above embodiments are not repeated here. Refer to Figure 2 The message transmission method provided by an embodiment of the present invention includes:

[0047] Step 210: Determine a target public network IP according to the source information of a request message sent by a private network device.

[0048] In one implementation, the source information of the request message includes the source IP and source port of the request message. Accordingly, step 210 may specifically include:

[0049] Determine a first hash value based on the source IP and source port of the request message; perform a modulo operation on the first hash value and the total number of public network IPs, and determine the target public network IP according to the operation result and the numbers of each public network IP.

[0050] Specifically, after receiving a request message sent by a private network device, the source IP and source port of the request message can be determined first in the five-tuple information of the request message, and the target public network IP can be determined from multiple public network IPs according to the source IP and source port of the request message.

[0051] Specifically, after determining the source IP and source port of the request message in the five-tuple information of the request message, the source IP and source port of the request message and the total number of all public network IPs can be substituted into formula 1 to obtain the public network IP number, and then the target public network IP can be determined from all public network IPs based on the public network IP number.

[0052] Public network IP number = hash(source IP, source port) mod number of public network IPs Formula 1

[0053] It can be understood that, first, a first hash value can be obtained by performing a hash operation on the source IP and source port of the request message, and a modulo operation is performed on the first hash value and the number of all public network IPs to obtain the public network IP number. The target public network IP is determined from all pre-numbered public network IPs according to the public network IP number. Specifically, the public network IP with the number consistent with the public network IP number can be determined as the target public network IP.

[0054] In practical applications, the selection of the public network IP can also be completed by means of convention configuration. For example, when there are 100 private network devices in a private network that need to communicate with public network devices, 30 private network devices can be divided into subnet A, 30 private network devices can be divided into subnet B, and 40 private network devices can be divided into subnet C. A next hop is configured for each subnet as a preset public network IP, so that private network devices in different subnets use different public network IPs to communicate with public network devices.

[0055] In the embodiments of the present invention, the target public network IP is determined according to the source information of the request message. The target public network IP can be used by a first target NAT device for processing the request message, providing a data basis for determining the first target NAT device. Moreover, the first target NAT device determined with reference to the target public network IP determined by the source information of the request message can determine different first target NAT devices for request messages with inconsistent source information and consistent destination information.

[0056] Step 220: Determine a first target network address translation (NAT) device based on the destination information of the request message and the target public network IP.

[0057] In one implementation, the destination information of the request message includes the destination IP and destination port of the request message. Correspondingly, step 220 may specifically include:

[0058] Determine a second hash value based on the destination IP and destination port of the request message and the target public network IP; perform a modulo operation on the second hash value and the total number of NAT devices, and determine the first target NAT device according to the operation result and the numbers of the NAT devices.

[0059] Specifically, after determining the target public network IP based on the source information of the request message, the destination IP and destination port of the request message may be determined in the five-tuple information of the request message, and the first target NAT device may be determined from multiple NAT devices based on the destination IP and destination port of the request message and the target public network IP.

[0060] Specifically, after determining the destination IP and destination port of the request message in the five-tuple information of the request message, the destination IP and destination port of the request message and the number of NAT devices may be substituted into formula 2 to obtain the NAT device number, and then the target NAT device may be determined from all NAT devices based on the NAT device number.

[0061] NAT device number = hash(target public network IP, destination IP, destination port) mod number of NAT devices Formula 2

[0062] It can be understood that first, a second hash value may be obtained by performing a hash operation on the destination IP and destination port of the request message, and a modulo operation is performed on the second hash value and the number of all NAT devices to obtain the NAT device number. The target NAT device is determined from all pre-numbered NAT devices based on the NAT device number. Specifically, the NAT device with the same number as the NAT device number may be determined as the target NAT device.

[0063] As described above, when the destination information of a large number of request messages is the same, the first target NAT device for processing each request message may be determined based on the destination information of each request message and the target public network IP determined from the source information of each request message. Therefore, based on the destination information of the request message and the target public network IP determined from the source information of the request message, different first target NAT devices may be determined for request messages with inconsistent source information and the same destination information.

[0064] In the embodiments of the present invention, a first target NAT device for diverting a request message is determined according to the destination information of the request message and the target public network IP determined by the source information of the request message, so as to implement determining different first target NAT devices for request messages with inconsistent source information and consistent destination information.

[0065] Step 230: Send the request message to a public network device based on the first target NAT device.

[0066] In one implementation, step 230 may specifically include:

[0067] Send the request message to the first target NAT device, so that the first target NAT device sends an updated request message corresponding to the request message to the public network device based on the target public network IP.

[0068] Wherein, the updated request message is obtained by the first target NAT device performing NAT conversion on the source information of the request message after determining the target public network IP according to the source information of the request message.

[0069] Specifically, after determining the first target NAT device, the request message can be sent to the public network device based on the first target NAT device. After receiving the request message, the first target NAT device can first determine the target public network IP according to the source information of the request message. Specifically, after determining the source IP and source port of the request message in the five-tuple information of the request message, substitute the source IP and source port of the request message and the total number of all public network IPs into formula 1 to obtain a public network IP number, and then determine the public network IP with the same number as the public network IP number among all pre-numbered public network IPs as the target public network IP.

[0070] The first target NAT device can also perform NAT conversion on the source information of the request message, replace the source ID of the request message with the NAT ID of the first target NAT device, and replace the source port of the request message with the NAT port of the first target NAT device to obtain an updated request message. Furthermore, the request message can be sent to the public network device based on the target public network IP.

[0071] In the embodiments of the present invention, it is implemented to send the request message to the public network device based on the first target NAT device, and the first target NAT device is determined according to the destination information of the request message and the target public network IP determined by the source information of the request message, that is, the determination of the first target NAT device refers to the source information and destination information of the request message, and it is implemented to send request messages with inconsistent source information and consistent destination information to the public network device based on different first target NAT devices, so as to implement the diversion and dispersion of a large number of request messages with consistent destination information.

[0072] Step 240: Determine a second target NAT device according to the source information of the response message corresponding to the request message determined by the public network device and the target public network IP.

[0073] Wherein, the source information of the response message is the same as the destination information of the request message, and the second target NAT device is the same NAT device as the first target NAT device.

[0074] In one implementation, the source information of the response message includes the source IP and source port of the response message. Correspondingly, step 240 may specifically include:

[0075] Determine a third hash value according to the source IP and source port of the response message and the target public network IP; perform a modulo operation on the third hash value and the total number of NAT devices, and determine the second target NAT device according to the operation result and the numbers of each NAT device.

[0076] Specifically, after receiving the request message, the public network device may determine the response message corresponding to the request message, and the source information of the response message is the same as the destination information of the request message. The public network device needs to return the response message to the private network device. At this time, in order to ensure that the request message and the response message transmitted between the private network device and the public network device are diverted based on the same NAT device, the second target NAT device for diverting the response message corresponding to the request message may be determined according to the source information of the response message and the target public network IP.

[0077] Specifically, after determining the source IP and source port of the response message in the five-tuple information of the response message, the source IP and source port of the response message and the target public network IP may be substituted into formula 2 to perform a hash operation on the source IP and source port of the response message to obtain a third hash value, perform a modulo operation on the third hash value and the number of all NAT devices to obtain a NAT device number, and then determine the NAT device with the same number as the NAT device IP number among all the pre-numbered public network NAT devices as the second target NAT device.

[0078] Of course, since the source information of the response message is the same as the destination information of the request message, the second target NAT device determined according to the source information of the response message and the target public network IP is the same NAT device as the first target NAT device determined according to the destination information of the request message and the target public network IP.

[0079] In the embodiment of the present invention, the second target NAT device for diverting the response message corresponding to the request message is implemented, and the second target NAT device is the same NAT device as the first target NAT device.

[0080] Step 250: Send the response message to the private network device based on the second target NAT device.

[0081] In one implementation, step 250 may specifically include:

[0082] Send the response message to the second target NAT device based on the target public network IP, so that the second target NAT device sends the updated response message corresponding to the response message to the private network device.

[0083] Wherein, the updated response message is obtained by the second target NAT device performing NAT conversion on the destination IP and destination port of the response message.

[0084] Specifically, after determining the second target NAT device, the response message corresponding to the request message can be sent to the second target NAT device based on the target public network IP. After receiving the response message, the second target NAT device can perform NAT conversion on the destination information of the response message, replace the destination ID of the response message with the ID of the private network device, and replace the destination port of the response message with the port of the private network device to obtain an updated response message. Furthermore, the response message can be sent to the private network device.

[0085] In the embodiment of the present invention, it is realized to return the response message corresponding to the request message to the private network device based on the second target NAT device, and to realize the diversion of the response message transmitted between the private network device and the public network device based on the same NAT device.

[0086] The message transmission method provided by the embodiment of the present invention includes: determining a target public network IP according to the source information of a request message sent by a private network device; determining a first target network address translation (NAT) device according to the destination information of the request message and the target public network IP; sending the request message to a public network device based on the first target NAT device; determining a second target NAT device according to the source information of a response message corresponding to the request message determined by the public network device and the target public network IP; and sending the response message to the private network device based on the second target NAT device. In the above technical solution, first, the target public network IP can be determined according to the source information of the request message sent by the private network device, and the first target NAT device can be determined according to the destination information of the request message and the target public network IP determined by the source information of the request message, so as to realize determining the first target NAT device for diverting the request message with reference to the source information and destination information of the request message, further realize determining different first target NAT devices for request messages with inconsistent source information and consistent destination information, and then the request message can be sent to the public network device based on the first target NAT device, so as to realize sending request messages with inconsistent source information and consistent destination information to the public network device based on different first target NAT devices, and further realize the diversion and dispersion of a large number of request messages with consistent destination information, thereby improving the message transmission efficiency.

[0087] In addition, after determining the response message corresponding to the request message, the second target NAT device can be determined according to the source information of the response message and the target public network IP, so as to realize determining the second target NAT device for diverting the response message corresponding to the request message. Moreover, the second target NAT device and the first target NAT device are the same NAT device, and the response message can also be sent to the private network device based on the second target NAT device, so as to realize diverting the response message transmitted between the private network device and the public network device based on the same NAT device.

[0088] Figure 3 It is a schematic structural diagram of a message transmission device provided by an embodiment of the present invention. This device and the message transmission methods of the above embodiments belong to the same inventive concept. For the details not described in detail in the embodiment of the message transmission device, reference can be made to the embodiments of the above message transmission methods.

[0089] The specific structure of the message transmission device is as Figure 3 shown and includes:

[0090] A first determination module 310, configured to determine a target public network IP according to the five-tuple information of a request message sent by a private network device;

[0091] A second determination module 320, configured to determine a first target NAT device according to the five-tuple information of the request message and the target public network IP;

[0092] A sending module 330, configured to send the request message to a public network device based on the first target NAT device.

[0093] Based on the above embodiments, the source information of the request message includes the source IP and source port of the request message. Correspondingly, the first determination module 310 is specifically configured to:

[0094] Determine a first hash value according to the source IP and source port of the request message; perform a modulo operation on the first hash value and the total number of public network IPs, and determine the target public network IP according to the operation result and the numbers of each public network IP.

[0095] Based on the above embodiments, the destination information of the request message includes the destination IP and destination port of the request message. Correspondingly, the second determination module 320 is specifically configured to:

[0096] Determine a second hash value according to the destination IP and destination port of the request message and the target public network IP; perform a modulo operation on the second hash value and the total number of NAT devices, and determine the first target NAT device according to the operation result and the numbers of each NAT device.

[0097] Based on the above embodiments, the sending module 330 is specifically configured to:

[0098] Send the request message to the first target NAT device, so that the first target NAT device sends an updated request message corresponding to the request message to the public network device based on the target public network IP.

[0099] In one implementation, the updated request message is obtained by the first target NAT device performing NAT conversion on the source IP and source port of the request message after determining the target public network IP according to the five-tuple information of the request message.

[0100] Based on the above embodiments, the apparatus further includes:

[0101] An execution module, configured to determine a second target NAT device according to the five-tuple information of the response message corresponding to the request message determined by the public network device and the target public network IP, where the source information of the response message is the same as the destination information of the request message, and the second target NAT device is the same NAT device as the first target NAT device; and send the response message to the private network device based on the second target NAT device.

[0102] Based on the above embodiments, the source information of the response message includes the source IP and source port of the response message. Correspondingly, the execution module is specifically configured to:

[0103] Determine a third hash value based on the source IP and source port of the response message and the target public network IP; perform a modulo operation on the third hash value and the total number of NAT devices, and determine the second target NAT device according to the operation result and the numbers of the NAT devices; send the response message to the second target NAT device based on the target public network IP, so that the second target NAT device sends the updated response message corresponding to the response message to the private network device.

[0104] In one implementation, the updated response message is obtained by the second target NAT device performing NAT conversion on the destination IP and destination port of the response message.

[0105] The message transmission device provided by the embodiments of the present invention can execute the message transmission method provided by any embodiment of the present invention, and has corresponding functional modules and beneficial effects for executing the message transmission method.

[0106] It should be noted that in the embodiments of the above message transmission device, the included units and modules are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of the functional units are only for the convenience of mutual distinction and do not limit the protection scope of the present invention.

[0107] Figure 4 It is a schematic structural diagram of a computer device provided by an embodiment of the present invention. Figure 4 A block diagram of an exemplary computer device 4 suitable for implementing the embodiments of the present invention is shown. Figure 4 The shown computer device 4 is only an example and should not bring any limitation to the functions and usage scope of the embodiments of the present invention.

[0108] As Figure 4 shown, the computer device 4 is presented in the form of a general-purpose computing electronic device. The components of the computer device 4 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 connecting different system components (including the system memory 28 and the processing unit 16).

[0109] The bus 18 represents one or more of several types of bus structures, including a memory bus or a memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any bus structure in a variety of bus structures. For example, these architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.

[0110] Computer device 4 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by computer device 4, including volatile and non-volatile media, removable and non-removable media.

[0111] System memory 28 can include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Computer device 4 can further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 can be used for reading and writing on non-removable, non-volatile magnetic media ( Figure 4 not shown, commonly referred to as a "hard disk drive"). Although Figure 4 not shown in the figure, a disk drive for reading and writing on removable non-volatile disks (such as a "floppy disk") and an optical disk drive for reading and writing on removable non-volatile optical disks (such as CD-ROM, DVD-ROM or other optical media) can be provided. In these cases, each drive can be connected to bus 18 through one or more data media interfaces. System memory 28 can include at least one program product having a set (such as at least one) of program modules that are configured to perform the functions of the embodiments of the present invention.

[0112] A program / utility 40 having a set (at least one) of program modules 42 can be stored in, for example, system memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include the implementation of a network environment. Program modules 42 generally perform the functions and / or methods in the embodiments described in the present invention.

[0113] Computer device 4 can also communicate with one or more external devices 14 (such as a keyboard, a pointing device, a display 24, etc.), and can also communicate with one or more devices that enable a user to interact with the computer device 4, and / or communicate with any device that enables the computer device 4 to communicate with one or more other computing devices (such as a network card, a modem, etc.). Such communication can be carried out through an input / output (I / O) interface 22. And, computer device 4 can also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 20. As Figure 4 shown, network adapter 20 communicates with other modules of computer device 4 through bus 18. It should be understood that although Figure 4which is not shown in the figure, other hardware and / or software modules can be used in combination with the computer device 4, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.

[0114] The processing unit 16 executes various functional applications and page displays by running the programs stored in the system memory 28. For example, the message transmission method provided by the embodiments of the present invention is implemented. The method includes:

[0115] Determine the target public network IP according to the five-tuple information of the request message sent by the private network device;

[0116] Determine the first target NAT device according to the five-tuple information of the request message and the target public network IP;

[0117] Send the request message to the public network device based on the first target NAT device.

[0118] Of course, those skilled in the art can understand that the processor can also implement the technical solutions of the message transmission method provided by any embodiment of the present invention.

[0119] The embodiments of the present invention provide a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the message transmission method provided by the embodiments of the present invention is implemented. The method includes:

[0120] Determine the target public network IP according to the five-tuple information of the request message sent by the private network device;

[0121] Determine the first target NAT device according to the five-tuple information of the request message and the target public network IP;

[0122] Send the request message to the public network device based on the first target NAT device.

[0123] The computer storage medium of the embodiments of the present invention may adopt any combination of one or more computer-readable media. The computer-readable media may be computer-readable signal media or computer-readable storage media. The computer-readable storage media may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (a non-exhaustive list) of the computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, the computer-readable storage media may be any tangible medium that contains or stores a program, which can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0124] The computer-readable signal media may include a data signal propagated in a baseband or as a part of a carrier wave, which carries the computer-readable program code. Such a propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal media may also be any computer-readable media other than the computer-readable storage media, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0125] The program code contained on the computer-readable media may be transmitted by any appropriate medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination of the above.

[0126] The computer program code for performing the operations of the present invention may be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages - such as the "C" language or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., by using an Internet service provider to connect through the Internet).

[0127] Those of ordinary skill in the art should understand that the various modules or steps of the present invention described above can be implemented by a general-purpose computing device. They can be concentrated on a single computing device or distributed over a network composed of multiple computing devices. Optionally, they can be implemented with program codes executable by a computer device, so that they can be stored in a storage device and executed by the computing device, or they can be separately fabricated into individual integrated circuit modules, or multiple modules or steps among them can be fabricated into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0128] Note that the above is only a preferred embodiment of the present invention and the technical principles applied. Those skilled in the art will understand that the present invention is not limited to the specific embodiments here. Various obvious changes, re-adjustments, and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to only the above embodiments. Without departing from the concept of the present invention, more other equivalent embodiments can be included, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A message transmission method, characterized in that, it includes: Determine the target public network IP according to the source information of the request message sent by the private network device; Determine the first target network address translation (NAT) device according to the destination information of the request message and the target public network IP; Send the request message to the public network device based on the first target NAT device.

2. The message transmission method according to claim 1, characterized in that, The source information of the request message includes the source IP and source port of the request message. Correspondingly, determining the target public network IP according to the source information of the request message sent by the private network device includes: Determine the first hash value according to the source IP and source port of the request message; Perform a modulo operation on the first hash value and the total number of public network IPs, and determine the target public network IP according to the operation result and the numbers of each public network IP.

3. The message transmission method according to claim 1, characterized in that, The destination information of the request message includes the destination IP and destination port of the request message. Correspondingly, determining the first target network address translation (NAT) device according to the destination information of the request message and the target public network IP includes: Determine the second hash value according to the destination IP and destination port of the request message and the target public network IP; Perform a modulo operation on the second hash value and the total number of NAT devices, and determine the first target NAT device according to the operation result and the numbers of each NAT device.

4. The message transmission method according to claim 1, characterized in that, Sending the request message to the public network device based on the first target NAT device includes: Send the request message to the first target NAT device, so that the first target NAT device sends the updated request message corresponding to the request message to the public network device based on the target public network IP.

5. The message transmission method according to claim 4, characterized in that, The updated request message is obtained by performing NAT conversion on the source information of the request message after the first target NAT device determines the target public network IP according to the source information of the request message.

6. The message transmission method according to claim 1, characterized in that, It further includes: Determine the second target NAT device according to the source information of the response message corresponding to the request message determined by the public network device and the target public network IP, where the source information of the response message is the same as the destination information of the request message, and the second target NAT device is the same NAT device as the first target NAT device; Send the response message to the private network device based on the second target NAT device.

7. The message transmission method according to claim 6, characterized in that, The source information of the response message includes the source IP and source port of the response message. Correspondingly, determining the second target NAT device according to the source information of the response message corresponding to the request message determined by the public network device and the target public network IP includes: Determine the third hash value according to the source IP and source port of the response message and the target public network IP; Perform a modulo operation on the third hash value and the total number of NAT devices, and determine the second target NAT device according to the operation result and the numbers of the NAT devices.

8. The message transmission method according to claim 6, wherein, sending the response message to the private network device based on the second target NAT device includes: sending the response message to the second target NAT device based on the target public network IP, so that the second target NAT device sends the updated response message corresponding to the response message to the private network device.

9. The message transmission method according to claim 8, wherein, the updated response message is obtained by the second target NAT device performing NAT conversion on the destination information of the response message.

10. A message transmission device, wherein, comprising: a first determination module, configured to determine a target public network IP according to the source information of a request message sent by a private network device; a second determination module, configured to determine a first target network address translation (NAT) device according to the destination information of the request message and the target public network IP; a sending module, configured to send the request message to a public network device based on the first target NAT device.

11. A computer device, wherein, the computer device includes: one or more processors; a storage device, configured to store one or more programs, when the one or more programs are executed by the one or more processors, enabling the one or more processors to implement the message transmission method according to any one of claims 1-9.

12. A storage medium containing computer-executable instructions, wherein, the computer-executable instructions are used to execute the message transmission method according to any one of claims 1-9 when executed by a computer processor.