CN111147186A - Data transmission method and device, computer equipment and storage medium - Google Patents

Data transmission method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN111147186A
CN111147186A CN201911399560.8A CN201911399560A CN111147186A CN 111147186 A CN111147186 A CN 111147186A CN 201911399560 A CN201911399560 A CN 201911399560A CN 111147186 A CN111147186 A CN 111147186A
Authority
CN
China
Prior art keywords
target node
address
transmission
punching
external
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911399560.8A
Other languages
Chinese (zh)
Other versions
CN111147186B (en
Inventor
刘杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Onething Technology Co Ltd
Original Assignee
Shenzhen Onething Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Onething Technology Co Ltd filed Critical Shenzhen Onething Technology Co Ltd
Priority to CN201911399560.8A priority Critical patent/CN111147186B/en
Publication of CN111147186A publication Critical patent/CN111147186A/en
Application granted granted Critical
Publication of CN111147186B publication Critical patent/CN111147186B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0056Systems characterized by the type of code used
    • H04L1/0067Rate matching
    • H04L1/0068Rate matching by puncturing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • H04L61/256NAT traversal
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/164Adaptation or special uses of UDP protocol

Abstract

The invention provides a data transmission method, which is applied to computer equipment and comprises the following steps: acquiring a punching transmission ID, a punching transmission protocol port and an external IP address of a router of a target node; judging the type of the target node according to the punching transmission ID and the external IP address of the router; if the target node is an intranet node, establishing a punching transmission channel to the target node according to the punching transmission ID, the punching transmission protocol port and the external IP address of the router; and carrying out data transmission with the target node through the punching transmission channel. The invention also provides a data transmission device, computer equipment and a storage medium. The invention can support the data transmission between the computer equipment and the intranet node.

Description

Data transmission method and device, computer equipment and storage medium
Technical Field
The invention relates to the technical field of computer networks, in particular to a data transmission method and device, computer equipment and a computer readable storage medium.
Background
Data transmission between different devices is required in the network. However, the existing data transmission method can conveniently transmit data from the external network node, and is more complicated to transmit data with the internal network node.
Disclosure of Invention
In view of the above, it is necessary to provide a data transmission method, a data transmission apparatus, a computer device, a computer readable storage medium and a computer program product, which can support the computer device to perform data transmission with the intranet node.
A first aspect of the present application provides a data transmission method applied to a computer device, where the method includes:
acquiring a punching transmission ID, a punching transmission protocol port and an external IP address of a router of a target node;
judging the type of the target node according to the punching transmission ID and the external IP address of the router;
if the target node is an intranet node, establishing a punching transmission channel to the target node according to the punching transmission ID, the punching transmission protocol port and the external IP address of the router;
and carrying out data transmission with the target node through the punching transmission channel.
In another possible implementation manner, the target node stores a target file, and the acquiring the hole-making transmission ID, the hole-making transmission protocol port, and the external IP address of the router of the target node includes:
sending a downloading request for the target file;
receiving index information of the target file returned by the index node in response to the downloading request;
and acquiring the punching transmission ID, the punching transmission protocol port and the external IP address of the router from the index information.
In another possible implementation manner, the determining the type of the target node according to the punching transmission ID and the external IP address of the router includes:
acquiring an external network IP address of the target node;
judging whether the external network IP address of the target node is equal to the external IP address of the router of the target node or not and judging whether the punching transmission ID of the target node is empty or not;
and if the external network IP address of the target node is not equal to the external IP address of the router of the target node and the punching transmission ID of the target node is not null, the target node is an internal network node.
In another possible implementation manner, the determining the type of the target node according to the punching transmission ID and the external IP address of the router further includes:
if the external network IP address of the target node is equal to the external IP address of the router of the target node and the punching transmission ID of the target node is empty, the target node is an external network node;
the method further comprises the following steps:
and if the target node is an external network node, carrying out data transmission with the target node through direct communication.
In another possible implementation manner, before the establishing a hole transmission channel to the target node according to the hole transmission ID, the hole transmission protocol port, and the external IP address of the router, the method further includes:
judging whether the computer equipment and the target node support hole-making transmission according to the NAT types of the computer equipment and the target node;
if the computer equipment and the target node support the hole-making transmission, a hole-making transmission channel to the target node is established according to the hole-making transmission ID, the hole-making transmission protocol port and the external IP address of the router.
In another possible implementation manner, the method further includes:
and if the computer equipment and the target node do not support the punching transmission, carrying out data transmission with the target node through an intermediate node.
In another possible implementation manner, the establishing a tunneling transmission channel to the target node according to the tunneling transmission ID, the tunneling transmission protocol port, and the external IP address of the router includes:
sending a punching request message to a punching server according to the punching transmission ID, the punching transmission protocol port and the external IP address of the router;
receiving address information of the target node returned by the punching server in response to the punching request message;
and sending a UDP data packet to the target node according to the address information of the target node.
A second aspect of the application provides a computer device comprising a memory and a processor, the memory having stored thereon a computer program executable on the processor, the computer program, when executed by the processor, implementing the data transmission method.
A third aspect of the present application provides a data transmission apparatus applied to a computer device, the apparatus including:
the system comprises an acquisition unit, a forwarding unit and a forwarding unit, wherein the acquisition unit is used for acquiring a punching transmission ID, a punching transmission protocol port and an external IP address of a router of a target node;
the judging unit is used for judging the type of the target node according to the punching transmission ID and the external IP address of the router;
a hole making unit, configured to establish a hole making transmission channel to the target node according to the hole making transmission ID, the hole making transmission protocol port, and the external IP address of the router if the target node is an intranet node;
and the transmission unit is used for carrying out data transmission with the target node through the punching transmission channel.
In another possible implementation manner, the target node stores a target file, and the acquiring the hole-making transmission ID, the hole-making transmission protocol port, and the external IP address of the router of the target node includes:
sending a downloading request for the target file;
receiving index information of the target file returned by the index node in response to the downloading request;
and acquiring the punching transmission ID, the punching transmission protocol port and the external IP address of the router from the index information.
In another possible implementation manner, the determining the type of the target node according to the punching transmission ID and the external IP address of the router includes:
acquiring an external network IP address of the target node;
judging whether the external network IP address of the target node is equal to the external IP address of the router of the target node or not and judging whether the punching transmission ID of the target node is empty or not;
and if the external network IP address of the target node is not equal to the external IP address of the router of the target node and the punching transmission ID of the target node is not null, the target node is an internal network node.
In another possible implementation manner, the determining the type of the target node according to the punching transmission ID and the external IP address of the router further includes:
if the external network IP address of the target node is equal to the external IP address of the router of the target node and the punching transmission ID of the target node is empty, the target node is an external network node;
the transmission unit is further configured to:
and if the target node is an external network node, carrying out data transmission with the target node through direct communication.
In another possible implementation manner, before the establishing a hole transmission channel to the target node according to the hole transmission ID, the hole transmission protocol port, and the external IP address of the router, the method further includes:
judging whether the computer equipment and the target node support hole-making transmission according to the NAT types of the computer equipment and the target node;
if the computer equipment and the target node support the hole-making transmission, a hole-making transmission channel to the target node is established according to the hole-making transmission ID, the hole-making transmission protocol port and the external IP address of the router.
In another possible implementation manner, the transmission unit is further configured to:
and if the computer equipment and the target node do not support the punching transmission, carrying out data transmission with the target node through an intermediate node.
In another possible implementation manner, the establishing a tunneling transmission channel to the target node according to the tunneling transmission ID, the tunneling transmission protocol port, and the external IP address of the router includes:
sending a punching request message to a punching server according to the punching transmission ID, the punching transmission protocol port and the external IP address of the router;
receiving address information of the target node returned by the punching server in response to the punching request message;
and sending a UDP data packet to the target node according to the address information of the target node.
A fourth aspect of the present application provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the data transmission method.
A fifth aspect of the application provides a computer program product comprising computer instructions which, when run on a computer device, cause the computer device to perform the data transmission method.
The invention obtains the punching transmission ID, the punching transmission protocol port and the external IP address of the router of the target node; and judging whether the target node is an intranet node or not according to the punching transmission ID of the target node of the target file and the external IP of the router, establishing a punching transmission channel to the target node according to the punching transmission ID, the punching transmission protocol port and the external IP address of the router when the target node is the intranet node, and performing data transmission with the target node by using the punching transmission channel. The invention supports the data transmission between the computer equipment and the intranet node, and solves the technical problem that the data transmission between the computer equipment and the intranet node cannot be carried out in the prior art.
Drawings
Fig. 1 is a flowchart of a data transmission method according to an embodiment of the present invention.
Fig. 2 is a flowchart of a data transmission apparatus according to an embodiment of the present invention.
Fig. 3 is a schematic diagram of a computer device provided by an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims of the present application and in the drawings described above, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. The terms "first", "second", "third", "fourth", etc. are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implying any indication of the number of technical features indicated. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, apparatus, article, or device that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or device.
Technical solutions between various embodiments of the present application may be combined with each other, but must be realized by a person skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present invention.
Preferably, the data transmission method of the present invention is applied to one or more computer devices. The computer device is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction, and the hardware includes, but is not limited to, a microprocessor, an Application Specific Integrated Circuit (ASIC), a Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), an embedded device, and the like.
The computer devices include, but are not limited to, desktop computers, laptop portable computers, personal digital assistants, tablet computers, personal cloud disks, smart phones, electronic book readers, MP3(Moving Picture Experts Group audio Layer III, motion Picture Experts compression standard audio Layer 3) or MP4(Moving Picture Experts Group audio Layer IV, motion Picture Experts compression standard audio Layer 4) players, POS terminals, and car computers. The computer equipment can carry out man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch panel or voice control equipment and the like.
The computer device may be a node constituting a CDN (Content Delivery Network) Network or a blockchain Network.
Example one
Fig. 1 is a flowchart of a data transmission method according to an embodiment of the present invention. The data transmission method is applied to computer equipment. The data transmission method supports the data transmission between the computer equipment and the target node (namely the intranet node) in the internal network. The computer device may be located behind a Network Address Translation (NAT) device. The NAT device is an IETF (Internet Engineering Task Force) standard that allows an entire organization to appear on the Internet as a public IP (Internet Protocol) address. The NAT devices may include, but are not limited to: the operator telecom and Unicom network exit equipment.
The computer device may be in an internal network (i.e., an intranet node) different from the target node, or may be in an external network (i.e., an extranet node).
The target node can be a desktop computer, a notebook computer, a palm computer, a cloud server and the like.
In an embodiment, the computer device and the target node may be a personal cloud disk, such as a guest-playing cloud.
Referring to fig. 1, the data transmission method specifically includes the following steps:
101, acquiring a punching transmission ID, a punching transmission protocol port and an external IP address of the router of the target node.
The hole transfer ID of the target node is used to identify the target node.
The punching transmission protocol port refers to a service port of a punching server and is used for establishing a punching transmission channel through the punching server.
The router external IP address of the target node is an external IP address that the target node acquires from the router in communication with the router.
In an embodiment, the target node stores a target file, and the obtaining the hole-making transmission ID, the hole-making transmission protocol port, and the external IP address of the router of the target node includes:
(1) and sending a downloading request of the target file.
The download request includes a file name of the target file.
A file download interface may be provided through which the computer device issues the download request. For example, the file download interface may include a filename input box at which the computer device issues the download request by entering the filename of the target file. For another example, the file download interface includes a hit file download bar, where the hit file download bar displays a plurality of hit files, and the computer device sends the download request by clicking a hit file in the hit file download bar.
(2) And receiving index information of the target file returned by the index node in response to the downloading request.
Index information of the target file can be searched by using the index node. And the index node searches index information of the target file from an index database according to the file name of the target file and returns the index information to the computer device.
In this embodiment, the target file fragments are stored in the target node, and the storage index of the target file is a two-level index structure, that is, the index information of the target file includes a first-level index and a second-level index. The first-level index mainly records the size and fragment information (including fragment number, fragment name, fragment size and the like) of a target file, and the second-level index records node information (including a punching transmission ID, a punching transmission protocol port, an external IP address of a router and the like) of a target node of each fragment of the target file. The index node searches a first-level index of a target file according to the file name of the target file, searches a second-level index of the target file according to the first-level index of the target file, and acquires node information of target nodes (which can correspond to a plurality of target nodes) of each fragment of the target file from the second-level index.
In other embodiments, the target file may be stored entirely (i.e., not fragmented) in the target node. Correspondingly, the index node searches node information of a target node (corresponding to one target node) of the target file according to the file name of the target file.
The data transmission method may use other index structures, such as a primary index structure, a tertiary index structure, and the like.
(3) And acquiring the punching transmission ID, the punching transmission protocol port and the external IP address of the router from the index information.
The target file is a file that the computer device needs to download. The target files may be different types of files, such as video files, audio files, text files, picture files, and the like.
In an embodiment, the index information of the target file returned by the index node further includes the NAT type of the target node.
The NAT type of the target node may include full cone, restricted cone, port restricted cone, symmetric.
And 102, judging the type of the target node according to the punching transmission ID and the external IP address of the router.
In this embodiment, the determining the type of the target node according to the hole-making transmission ID and the external IP address of the router includes:
acquiring an external network IP address of the target node;
judging whether the external network IP address of the target node is equal to the external IP address of the router of the target node or not and judging whether the punching transmission ID of the target node is empty or not;
if the external network IP address of the target node is not equal to the external IP address of the router of the target node and the punching transmission ID of the target node is not null, the target node is an internal network node;
and if the external network IP address of the target node is equal to the external IP address of the router of the target node and the punching transmission ID of the target node is empty, the target node is the external network node.
The external network IP address of the target node is an IP address allocated to the target node when the target node is accessed into the network.
103, if the target node is an intranet node, establishing a punching transmission channel to the target node according to the punching transmission ID, the punching transmission protocol port and the external IP address of the router.
In an embodiment, before said establishing a hole-making transmission channel to said target node according to said hole-making transmission ID, said hole-making transmission protocol port and said router external IP address, said method further comprises:
and judging whether the computer equipment and the target node support hole-making transmission according to the NAT types of the computer equipment and the target node.
If the computer equipment and the target node support the hole-making transmission, establishing a hole-making transmission channel to the target node according to the hole-making transmission ID, the hole-making transmission protocol port and the external IP address of the router;
and if the computer equipment and the target node do not support the punching transmission, carrying out data transmission with the target node through an intermediate node.
The intermediate node is a node which can perform data transmission with the computer equipment and also can perform data transmission with the target node. The intermediate node performs data transfer between the computer device and the target node.
NAT types for computer devices may include full cone, restricted cone, port restricted cone, symmetric.
The judging whether the computer equipment and the target node support the hole-making transmission according to the NAT types of the computer equipment and the target node comprises the following steps:
if the NAT type of any one of the computer device and the target node is a symmetric type and the NAT type of the other one of the computer device and the target node is a port-restricted cone type, or if the NAT types of both the computer device and the target node are symmetric types, then no hole-punching transmission is supported between the computer device and the target node.
In an embodiment, the establishing a hole-making transmission channel to the target node according to the hole-making transmission ID, the hole-making transmission protocol port and the router external IP address includes:
sending a punching request message to a punching server according to the punching transport protocol port and the external IP address of the router, and requesting the punching server to help establish UDP connection with the target node;
receiving address information of the target node returned by the punching server in response to the punching request message;
and sending a UDP data packet to the target node according to the address information of the target node.
And after receiving the punching request message, the punching server sends the address information of the target node to the computer equipment, and simultaneously sends the address information of the computer equipment to the target node. The address information of the computer device may include an IP address and a port number of the computer device, and the address information of the target node may include an IP address and a port number of the target node.
And after receiving the address information of the computer equipment returned by the punching server, the target node sends a UDP (user Datagram protocol) data packet to the computer equipment according to the address information of the computer equipment. Once both the computer device and the target node send data packets to each other, a hole-making transmission channel from the computer device to the target node is established.
And 104, carrying out data transmission with the target node through the punching transmission channel.
For example, a target file is downloaded from the target node through the hole-making transmission channel.
The downloading of the target file from the target node by the hole-making transmission channel may comprise:
sending a file request to the target node through the punching transmission channel;
and receiving the target file returned by the target node through the punching transmission channel.
In the data transmission method according to the first embodiment, a punching transmission ID, a punching transmission protocol port, and an external IP address of a router of a target node are acquired, whether the target node is an intranet node is determined according to the punching transmission ID of the target node of a target file and the external IP address of the router, when the target node is the intranet node, a punching transmission channel to the target node is established according to the punching transmission ID, the punching transmission protocol port, and the external IP address of the router, and data transmission is performed using the punching transmission channel. The data transmission method supports the computer equipment to transmit data with the intranet node, and solves the technical problem that the data transmission with the intranet node cannot be carried out in the prior art.
In another embodiment, the method further comprises:
and if the target node is an external network node, carrying out data transmission with the target node through direct communication.
Example two
Fig. 2 is a structural diagram of a data transmission device according to an embodiment of the present invention. The data transmission device 20 is applied to a computer device. The data transmission apparatus 20 supports data transmission between a computer device and a target node (i.e., an intranet node) in an internal network. The computer device may be located behind a Network Address Translation (NAT) device. The NAT device is an IETF (Internet Engineering task force) standard that allows an entire organization to appear on the Internet as a public IP (Internet Protocol) address. The NAT devices may include, but are not limited to: the operator telecom and Unicom network exit equipment.
The computer device may be in an internal network (i.e., an intranet node) different from the target node, or may be in an external network (i.e., an extranet node).
The target node can be a desktop computer, a notebook computer, a palm computer, a cloud server and the like.
In an embodiment, the computer device and the target node may be a personal cloud disk, such as a guest-playing cloud.
As shown in fig. 2, the data transmission device 20 may include: an acquisition unit 201, a judgment unit 202, a hole punching unit 203 and a transmission unit 204.
An obtaining unit 201, configured to obtain a hole-making transmission ID, a hole-making transmission protocol port, and a router external IP address of a target node.
The hole transfer ID of the target node is used to identify the target node.
The punching transmission protocol port refers to a service port of a punching server and is used for establishing a punching transmission channel through the punching server.
The router external IP address of the target node is an external IP address that the target node acquires from the router in communication with the router.
In an embodiment, the target node stores a target file, and the obtaining the hole-making transmission ID, the hole-making transmission protocol port, and the external IP address of the router of the target node includes:
(1) and sending a downloading request of the target file.
The download request includes a file name of the target file.
A file download interface may be provided through which the computer device issues the download request. For example, the file download interface may include a filename input box at which the computer device issues the download request by entering the filename of the target file. For another example, the file download interface includes a hit file download bar, where the hit file download bar displays a plurality of hit files, and the computer device sends the download request by clicking a hit file in the hit file download bar.
(2) And receiving index information of the target file returned by the index node in response to the downloading request.
Index information of the target file can be searched by using the index node. And the index node searches index information of the target file from an index database according to the file name of the target file and returns the index information to the computer device.
In this embodiment, the target file fragments are stored in the target node, and the storage index of the target file is a two-level index structure, that is, the index information of the target file includes a first-level index and a second-level index. The first-level index mainly records the size and fragment information (including fragment number, fragment name, fragment size and the like) of a target file, and the second-level index records node information (including a punching transmission ID, a punching transmission protocol port, an external IP address of a router and the like) of a target node of each fragment of the target file. The index node searches a first-level index of a target file according to the file name of the target file, searches a second-level index of the target file according to the first-level index of the target file, and acquires node information of target nodes (which can correspond to a plurality of target nodes) of each fragment of the target file from the second-level index.
In other embodiments, the target file may be stored entirely (i.e., not fragmented) in the target node. Correspondingly, the index node searches node information of a target node (corresponding to one target node) of the target file according to the file name of the target file.
The data transmission method may use other index structures, such as a primary index structure, a tertiary index structure, and the like.
(3) And acquiring the punching transmission ID, the punching transmission protocol port and the external IP address of the router from the index information.
The target file is a file that the computer device needs to download. The target files may be different types of files, such as video files, audio files, text files, picture files, and the like.
In an embodiment, the index information of the target file returned by the index node further includes the NAT type of the target node.
The NAT type of the target node may include full cone, restricted cone, port restricted cone, symmetric.
A determining unit 202, configured to determine the type of the target node according to the punching transmission ID and the external IP address of the router.
In this embodiment, the determining the type of the target node according to the hole-making transmission ID and the external IP address of the router includes:
acquiring an external network IP address of the target node;
judging whether the external network IP address of the target node is equal to the external IP address of the router of the target node or not and judging whether the punching transmission ID of the target node is empty or not;
if the external network IP address of the target node is not equal to the external IP address of the router of the target node and the punching transmission ID of the target node is not null, the target node is an internal network node;
and if the external network IP address of the target node is equal to the external IP address of the router of the target node and the punching transmission ID of the target node is empty, the target node is the external network node.
The external network IP address of the target node is an IP address allocated to the target node when the target node is accessed into the network.
A hole-making unit 203, configured to establish a hole-making transmission channel to the target node according to the hole-making transmission ID, the hole-making transmission protocol port, and the external IP address of the router if the target node is an intranet node.
In an embodiment, before said establishing a hole-making transmission channel to said target node according to said hole-making transmission ID, said hole-making transmission protocol port and said router external IP address, said method further comprises:
and judging whether the computer equipment and the target node support hole-making transmission according to the NAT types of the computer equipment and the target node.
If the computer equipment and the target node support the hole-making transmission, establishing a hole-making transmission channel to the target node according to the hole-making transmission ID, the hole-making transmission protocol port and the external IP address of the router;
and if the computer equipment and the target node do not support the punching transmission, carrying out data transmission with the target node through an intermediate node.
The intermediate node is a node which can perform data transmission with the computer equipment and also can perform data transmission with the target node. The intermediate node performs data transfer between the computer device and the target node.
NAT types for computer devices may include full cone, restricted cone, port restricted cone, symmetric.
The judging whether the computer equipment and the target node support the hole-making transmission according to the NAT types of the computer equipment and the target node comprises the following steps:
if the NAT type of any one of the computer device and the target node is a symmetric type and the NAT type of the other one of the computer device and the target node is a port-restricted cone type, or if the NAT types of both the computer device and the target node are symmetric types, then no hole-punching transmission is supported between the computer device and the target node.
In an embodiment, the establishing a hole-making transmission channel to the target node according to the hole-making transmission ID, the hole-making transmission protocol port and the router external IP address includes:
sending a punching request message to a punching server according to the punching transport protocol port and the external IP address of the router, and requesting the punching server to help establish UDP connection with the target node;
receiving address information of the target node returned by the punching server in response to the punching request message;
and sending a UDP data packet to the target node according to the address information of the target node.
And after receiving the punching request message, the punching server sends the address information of the target node to the computer equipment, and simultaneously sends the address information of the computer equipment to the target node. The address information of the computer device may include an IP address and a port number of the computer device, and the address information of the target node may include an IP address and a port number of the target node.
And after receiving the address information of the computer equipment returned by the punching server, the target node sends a UDP (user Datagram protocol) data packet to the computer equipment according to the address information of the computer equipment. Once both the computer device and the target node send data packets to each other, a hole-making transmission channel from the computer device to the target node is established.
A transmission unit 204, configured to perform data transmission with the target node through the hole-making transmission channel.
For example, a target file is downloaded from the target node through the hole-making transmission channel.
The downloading of the target file from the target node by the hole-making transmission channel may comprise:
sending a file request to the target node through the punching transmission channel;
and receiving the target file returned by the target node through the punching transmission channel.
The data transmission apparatus 20 according to the second embodiment obtains the punching transmission ID, the punching transmission protocol port, and the router external IP address of the target node, determines whether the target node is an intranet node according to the punching transmission ID of the target node of the target file and the router external IP address, establishes a punching transmission channel to the target node according to the punching transmission ID, the punching transmission protocol port, and the router external IP address when the target node is an intranet node, and performs data transmission using the punching transmission channel. The data transmission device 20 supports the computer device to perform data transmission with the intranet node, and solves the technical problem that the data transmission with the intranet node cannot be performed in the prior art.
In another embodiment, the transmission unit 204 is further configured to:
and if the target node is an external network node, carrying out data transmission with the target node through direct communication.
EXAMPLE III
The present embodiment provides a computer-readable storage medium, which stores a computer program, and the computer program, when executed by a processor, implements the steps in the foregoing data transmission method embodiment, for example, 101-104 shown in fig. 1:
101, acquiring a punching transmission ID, a punching transmission protocol port and an external IP address of a router of a target node;
102, judging the type of the target node according to the punching transmission ID and the external IP address of the router;
103, if the target node is an intranet node, establishing a punching transmission channel to the target node according to the punching transmission ID, the punching transmission protocol port and the external IP address of the router;
and 104, carrying out data transmission with the target node through the punching transmission channel.
Alternatively, the computer program, when executed by the processor, implements the functions of the modules/units in the above-mentioned device embodiments, for example, the unit 201 and 204 in fig. 2:
an obtaining unit 201, configured to obtain a hole-making transmission ID, a hole-making transmission protocol port, and an external IP address of a router of a target node;
a judging unit 202, configured to judge a type of the target node according to the punching transmission ID and the external IP address of the router;
a hole making unit 203, configured to establish a hole making transmission channel to the target node according to the hole making transmission ID, the hole making transmission protocol port, and the external IP address of the router if the target node is an intranet node;
a transmission unit 204, configured to perform data transmission with the target node through the hole-making transmission channel.
Example four
Fig. 3 is a schematic diagram of a computer device according to an embodiment of the present invention. The computer device 3 comprises a memory 30, a processor 31, a bus 33 and a computer program 32 stored in the memory 30 and executable on the processor 31. When the processor 31 executes the computer program 32, the steps in the above-mentioned data transmission method embodiment are implemented, for example, 101-104 shown in fig. 1:
101, acquiring a punching transmission ID, a punching transmission protocol port and an external IP address of a router of a target node;
102, judging the type of the target node according to the punching transmission ID and the external IP address of the router;
103, if the target node is an intranet node, establishing a punching transmission channel to the target node according to the punching transmission ID, the punching transmission protocol port and the external IP address of the router;
and 104, carrying out data transmission with the target node through the punching transmission channel.
Alternatively, when the processor 31 executes the computer program 32, the functions of the modules/units in the above-mentioned device embodiment are implemented, for example, the units 201 and 204 in fig. 2:
an obtaining unit 201, configured to obtain a hole-making transmission ID, a hole-making transmission protocol port, and an external IP address of a router of a target node;
a judging unit 202, configured to judge a type of the target node according to the punching transmission ID and the external IP address of the router;
a hole making unit 203, configured to establish a hole making transmission channel to the target node according to the hole making transmission ID, the hole making transmission protocol port, and the external IP address of the router if the target node is an intranet node;
a transmission unit 204, configured to perform data transmission with the target node through the hole-making transmission channel.
Illustratively, the computer program 32 may be partitioned into one or more modules/units that are stored in the memory 30 and executed by the processor 31 to carry out the invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program 32 in the computer device 3.
The Computer device 3 may be a PC (Personal Computer), or may be a terminal device such as a smart phone, a tablet Computer, a palmtop Computer, a portable Computer, an intelligent router, an ore machine, a network storage device, and the like.
The Processor 31 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, or the like. The general purpose processor may be a microprocessor or the processor 31 may be any conventional processor or the like, said processor 31 being the control center of said computer device 3, the various parts of the whole computer device 3 being connected by various interfaces and lines.
The memory 30 may be used to store the computer program 32 and/or the module/unit, and the processor 31 may implement various functions of the computer device 3 by running or executing the computer program and/or the module/unit stored in the memory 30 and calling data stored in the memory 30. The memory 30 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to the use of the computer device 3. Further, the memory 30 may include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Memory Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other non-volatile solid state storage device.
The bus 33 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus 33 may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 3, but this does not mean only one bus or one type of bus.
Further, the computer device 3 may further include a network interface, which may optionally include a wired interface and/or a wireless interface (such as a WI-FI interface, a bluetooth interface, etc.), and is generally used for establishing a communication connection between the computer device 3 and other electronic devices.
Optionally, the computer device 3 may further comprise a user interface, which may comprise a Display (Display), an input unit such as a Keyboard (Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable for displaying information processed in the computer device 3 and for displaying a visualized user interface.
It will be appreciated by those skilled in the art that the schematic diagram 3 is merely an example of the computer device 3 and does not constitute a limitation of the computer device 3 and may include more or less components than those shown, or combine certain components, or different components.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product.
The computer program product includes one or more computer instructions. The procedures or functions described in accordance with the embodiments of the invention may be generated in whole or in part upon loading and execution of the computer program instructions on a computer device. The computer apparatus may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can store or a data storage device, such as a server, a data center, etc., that is integrated with one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described device embodiments are merely illustrative, and for example, the division of the units is only one type of logical function division, and other division manners may be available in actual implementation, for example, a plurality of units or components may be combined or integrated into another device, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-only memory (ROM), a magnetic disk, or an optical disk.
It should be noted that the above-mentioned numbers of the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments. And the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, apparatus, article, or method that includes the element.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A data transmission method applied to computer equipment is characterized by comprising the following steps:
acquiring a punching transmission ID, a punching transmission protocol port and an external IP address of a router of a target node;
judging the type of the target node according to the punching transmission ID and the external IP address of the router;
if the target node is an intranet node, establishing a punching transmission channel to the target node according to the punching transmission ID, the punching transmission protocol port and the external IP address of the router;
and carrying out data transmission with the target node through the punching transmission channel.
2. The method of claim 1, wherein the target node stores a target file, and wherein obtaining the destination node's tunneling ID, tunneling protocol port, and router external IP address comprises:
sending a downloading request for the target file;
receiving index information of the target file returned by the index node in response to the downloading request;
and acquiring the punching transmission ID, the punching transmission protocol port and the external IP address of the router from the index information.
3. The method of claim 1, wherein said determining the type of the target node based on the hole transport ID and the router external IP address comprises:
acquiring an external network IP address of the target node;
judging whether the external network IP address of the target node is equal to the external IP address of the router of the target node or not and judging whether the punching transmission ID of the target node is empty or not;
and if the external network IP address of the target node is not equal to the external IP address of the router of the target node and the punching transmission ID of the target node is not null, the target node is an internal network node.
4. The method of claim 3, wherein said determining the type of the target node based on the hole transport ID and the router external IP address further comprises:
if the external network IP address of the target node is equal to the external IP address of the router of the target node and the punching transmission ID of the target node is empty, the target node is an external network node;
the method further comprises the following steps:
and if the target node is an external network node, carrying out data transmission with the target node through direct communication.
5. The method of claim 1, wherein prior to said establishing a tunneled transport path to said destination node based on said tunneled transport ID, said tunneled transport protocol port and said router external IP address, said method further comprises:
judging whether the computer equipment and the target node support hole-making transmission according to the NAT types of the computer equipment and the target node;
if the computer equipment and the target node support the hole-making transmission, a hole-making transmission channel to the target node is established according to the hole-making transmission ID, the hole-making transmission protocol port and the external IP address of the router.
6. The method of claim 5, wherein the method further comprises:
and if the computer equipment and the target node do not support the punching transmission, carrying out data transmission with the target node through an intermediate node.
7. The method of any one of claims 1 to 6, wherein said establishing a hole transport channel to the destination node based on the hole transport ID, the hole transport protocol port, and the router external IP address comprises:
sending a punching request message to a punching server according to the punching transmission ID, the punching transmission protocol port and the external IP address of the router;
receiving address information of the target node returned by the punching server in response to the punching request message;
and sending a UDP data packet to the target node according to the address information of the target node.
8. A computer device, characterized in that the computer device comprises a memory and a processor, the memory having stored thereon a computer program operable on the processor, the computer program, when executed by the processor, implementing the data transmission method according to any one of claims 1 to 7.
9. A data transmission apparatus applied to a computer device of a distributed storage network, the apparatus comprising:
the system comprises an acquisition unit, a forwarding unit and a forwarding unit, wherein the acquisition unit is used for acquiring a punching transmission ID, a punching transmission protocol port and an external IP address of a router of a target node;
the judging unit is used for judging the type of the target node according to the punching transmission ID and the external IP address of the router;
a hole making unit, configured to establish a hole making transmission channel to the target node according to the hole making transmission ID, the hole making transmission protocol port, and the external IP address of the router if the target node is an intranet node;
and the transmission unit is used for carrying out data transmission with the target node through the punching transmission channel.
10. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the data transmission method according to any one of claims 1 to 7.
CN201911399560.8A 2019-12-30 2019-12-30 Data transmission method and device, computer equipment and storage medium Active CN111147186B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911399560.8A CN111147186B (en) 2019-12-30 2019-12-30 Data transmission method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911399560.8A CN111147186B (en) 2019-12-30 2019-12-30 Data transmission method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111147186A true CN111147186A (en) 2020-05-12
CN111147186B CN111147186B (en) 2023-07-18

Family

ID=70522097

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911399560.8A Active CN111147186B (en) 2019-12-30 2019-12-30 Data transmission method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111147186B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114095470A (en) * 2020-07-29 2022-02-25 顺丰科技有限公司 Block chain node uplink method and device and block chain node

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101741914A (en) * 2010-02-03 2010-06-16 上海悠络客电子科技有限公司 Method and system for penetrating NAT to establish overlay network in P2P network
CN101873359A (en) * 2010-06-28 2010-10-27 北京神州泰岳软件股份有限公司 Method for implementing UDP hole punching
CN101895590A (en) * 2010-07-23 2010-11-24 华南理工大学 UDT-based system and method for realizing network address translator traversal
WO2016201966A1 (en) * 2015-06-18 2016-12-22 中兴通讯股份有限公司 Nat traversal method, apparatus and system
US20170085523A1 (en) * 2015-09-17 2017-03-23 Synology Inc. Methods for nat (network address translation) traversal and systems using the same
CN108600316A (en) * 2018-03-23 2018-09-28 深圳市网心科技有限公司 Data managing method, system and the equipment of cloud storage service
US20180341662A1 (en) * 2017-05-24 2018-11-29 3S International, LLC Hierarchical computing network and methods thereof
CN109660639A (en) * 2018-12-11 2019-04-19 深圳市网心科技有限公司 A kind of data uploading method, equipment, system and medium
CN109788051A (en) * 2019-01-02 2019-05-21 深圳市网心科技有限公司 Network resource transmission method and system based on distributed file system

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101741914A (en) * 2010-02-03 2010-06-16 上海悠络客电子科技有限公司 Method and system for penetrating NAT to establish overlay network in P2P network
CN101873359A (en) * 2010-06-28 2010-10-27 北京神州泰岳软件股份有限公司 Method for implementing UDP hole punching
CN101895590A (en) * 2010-07-23 2010-11-24 华南理工大学 UDT-based system and method for realizing network address translator traversal
WO2016201966A1 (en) * 2015-06-18 2016-12-22 中兴通讯股份有限公司 Nat traversal method, apparatus and system
US20170085523A1 (en) * 2015-09-17 2017-03-23 Synology Inc. Methods for nat (network address translation) traversal and systems using the same
US20180341662A1 (en) * 2017-05-24 2018-11-29 3S International, LLC Hierarchical computing network and methods thereof
CN108600316A (en) * 2018-03-23 2018-09-28 深圳市网心科技有限公司 Data managing method, system and the equipment of cloud storage service
CN109660639A (en) * 2018-12-11 2019-04-19 深圳市网心科技有限公司 A kind of data uploading method, equipment, system and medium
CN109788051A (en) * 2019-01-02 2019-05-21 深圳市网心科技有限公司 Network resource transmission method and system based on distributed file system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张静颐;赵雪岩;陈爱网;: "基于NAT穿透P2P即时通讯系统的设计与实现", 电子设计工程 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114095470A (en) * 2020-07-29 2022-02-25 顺丰科技有限公司 Block chain node uplink method and device and block chain node

Also Published As

Publication number Publication date
CN111147186B (en) 2023-07-18

Similar Documents

Publication Publication Date Title
US9846699B2 (en) System and methods thereof for dynamically updating the contents of a folder on a device
US9459759B2 (en) Method for displaying contents use history and electronic device thereof
EP3005084B1 (en) Driver installation for targeted and not-connected devices
EP3541098B1 (en) Processing method for communication identifier binding and terminal
KR102504075B1 (en) Matching and attributes of user device events
CN107508903B (en) Webpage content access method and terminal equipment
CN110677493B (en) Service state determination method and device, computer device and storage medium
CN108958780A (en) A kind of method and apparatus of the more new information for program of lodging for rendering
CN109408181B (en) Equipment skill display method and device
CN111343048A (en) Pressure testing method and device, computer device and storage medium
KR20140106887A (en) A method for displaying program and an electronic device thereof
CN110677506B (en) Network access method, device, computer equipment and storage medium
CN110417789B (en) Server connection method, electronic device, system and medium
CN110808974A (en) Data acquisition method and device, computer device and storage medium
CN111142799A (en) Distributed storage method and device, network node and storage medium
CN110730244A (en) Networking method and system of DHT (distributed hash table) system, network equipment and storage medium
US9201960B2 (en) Virtual agent response to customer inquiries
CN108694227B (en) Method, system, and computer program product for tagging technical components of an organization unit in a virtual hosted platform by a central resource controller
CN111147186B (en) Data transmission method and device, computer equipment and storage medium
CN111193804B (en) Distributed storage method and device, network node and storage medium
CN103188324A (en) Vehicle-mounted information displaying system
CN112368696A (en) Method and apparatus for retrieving content
CN105701231A (en) Network resource search system and method
CN113064531B (en) Virtual resource interaction method and device, storage medium and electronic equipment
CN111641690B (en) Session message processing method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant