Data channel establishment method in wide area network environment, server and electronic equipment
By deploying servers on the WAN and using the server as a transit station to establish data channels, the limitation of data transmission between different local area networks is solved, and accurate data transmission and two-way transmission and reception are achieved.
Patent Information
- Application Number
- CN202411799060.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-03-25
AI Technical Summary
In a wide area network environment, communication devices of different LANs cannot directly transmit data through IP addresses, resulting in limited data transmission, and the P2P method is likely to cause resource sharing disorders during large-scale use.
By deploying a server on the WAN, using the server as a transit station, the reception data channel establishes the composite transmission address sent by the initiator, determines the data receiving end, and forms a forwarding transmission address with the public network IP through the free port, and binds the server to reflect the transmission address to realize the establishment of the data channel and the accurate data transmission.
It realizes the target end-to-end data transmission between different LANs, ensures that data is accurately sent to the target device, and supports two-way data transmission and reception, solving the problem of data transmission restrictions in the wide area network environment.
Smart Images

Figure CN119697235A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the technical field of data transmission, and in particular to a method for establishing a data channel in a wide area network environment, a server, and an electronic device. Background Art
[0002] The global Internet has limited public IP addresses and cannot accommodate an unlimited number of communication devices. Therefore, a large number of communication devices need to be operated in different local area networks. Communication devices in the same local area network can transmit data through LAN direct connection, while P2P can help communication devices in the same or different local area networks to transmit data.
[0003] In a wide area network environment, the devices that need to send and receive data are generally located in different local area networks and cannot be directly connected via IP. This greatly limits the data transmission of communication devices in different local area networks. At the same time, in a wide area network, there are a large number of clients that need to transmit data to each other. The P2P method is relatively complicated to set up, and when used on a large scale, it is easy to cause resource sharing disorder. Therefore, how to accurately achieve end-to-end data transmission between local area networks is a technical problem that needs to be solved in this field.
[0004] It should be noted that this section is intended to provide background or context for the technical solutions of the present disclosure stated in the claims. The description herein is not admitted to be prior art by virtue of being included in this section. Summary of the invention
[0005] The purpose of the embodiments of the present disclosure is to provide a method, a server and an electronic device for establishing a data channel in a wide area network environment, thereby overcoming one or more problems caused by the limitations and defects of related technologies at least to a certain extent.
[0006] The present disclosure first provides a method for establishing a data channel in a wide area network environment, including:
[0007] Receive a first composite transmission address sent by a data channel establishment initiator, wherein the first composite transmission address includes an initiator host transmission address and a server reflex transmission address, and the server reflex transmission address includes a unique identifier of the data channel establishment initiator and a unique identifier of the data receiving end;
[0008] Determine the corresponding data receiving end through the unique identifier of the data receiving end, and send the first composite transmission address to the data receiving end;
[0009] Receiving an instruction for obtaining a forwarding transmission address sent by the data receiving end;
[0010] Apply for an idle port, combine the idle port and the public network IP to form the forwarding transmission address, and bind the forwarding transmission address to the server reflection transmission address;
[0011] Sending a second composite transmission address to the data receiving end, wherein the second composite transmission address includes the forwarding transmission address and the server reflection transmission address;
[0012] Receiving a third composite transmission address sent by the data receiving end, wherein the third composite transmission address includes a receiving end host transmission address, a forwarding transmission address, and a server reflection transmission address;
[0013] The data channel establishment initiator is determined according to the unique identifier of the data channel establishment initiator in the third composite transmission address, and the third composite transmission address is forwarded to the data channel establishment initiator, so that the data channel establishment initiator and the data receiving end establish a data channel with the idle port.
[0014] In one embodiment of the present disclosure, the step of receiving the first composite transmission address sent by the initiator of establishing the data channel further includes:
[0015] An instruction for acquiring a server reflexive transmission address sent by a data channel establishment initiator is received, and the server reflexive transmission address is sent to the data channel establishment initiator.
[0016] In one embodiment of the present disclosure, the step of receiving an instruction for obtaining a server reflexive transmission address sent by a data channel establishment initiator, and sending the server reflexive transmission address to the data channel establishment initiator, further includes:
[0017] A registration request sent by a data channel establishment initiator / data receiving end is received and verified, and a registration success response that passes the verification is sent to the data channel establishment initiator / data receiving end.
[0018] In one embodiment of the present disclosure, the step of receiving a registration request sent by a data channel establishment initiator / data receiving end and verifying it, and sending a verified registration success response to the data channel establishment initiator / data receiving end, then includes:
[0019] The login request sent by the data channel establishment initiator / data receiving end is received and the login information is verified, and a successful login response that passes the verification is sent to the data channel establishment initiator / data receiving end.
[0020] In one embodiment of the present disclosure, the data channel establishment method further includes:
[0021] Check the connectivity between the data channel establishment initiator and the data receiving end.
[0022] In one embodiment of the present disclosure, the step of detecting connectivity between the data channel establishment initiator and the data receiving end includes:
[0023] Use PING-PONG to detect the connectivity between the data channel establishment initiator and the data receiver.
[0024] In one embodiment of the present disclosure, the step of using PING-PONG to detect the connectivity between the data channel establishment initiator and the data receiving end includes:
[0025] Receive a PING instruction sent by a data channel establishment initiator, and forward the PING instruction to a corresponding data receiving end;
[0026] Receive the PONG instruction sent by the data receiving end, and forward the PONG instruction to the data channel establishment initiator.
[0027] In one embodiment of the present disclosure, the data channel establishment initiator and the data receiving end are located in different local area networks, or the data channel establishment initiator and the data receiving end are located in the same local area network.
[0028] The embodiment of the present disclosure also provides a server, which is deployed on a public network and is used to establish a data channel between an initiator and a data receiver as described in any of the above data channel establishment items and to forward data between the two.
[0029] The present disclosure also provides an electronic device, including:
[0030] Processor; and
[0031] A memory, configured to store executable instructions of the processor;
[0032] The processor is configured to execute the steps of any one of the above-mentioned methods for establishing a data channel in a wide area network environment by executing the executable instructions.
[0033] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:
[0034] The data channel establishment method, server and electronic device in the wide area network environment in the embodiments of the present disclosure, by deploying the server in the wide area network and using the server as a transfer station, can establish a data transmission channel for two communication equipment ends located in different local area networks, and use the unique identification of the two communication devices to connect the two one-to-one, so that data can be accurately sent to the target device, and data can be sent and received in both directions between the two devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] The drawings herein are incorporated into the specification and constitute a part of the specification, represent embodiments consistent with the present disclosure, and are used together with the specification to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0036] Figure 1 A schematic diagram showing a flow chart of a method for establishing a data channel in a wide area network environment in an exemplary embodiment of the present disclosure;
[0037] Figure 2 A schematic diagram showing a flow chart of a method for establishing a data channel in a wide area network environment in yet another exemplary embodiment of the present disclosure;
[0038] Figure 3 A schematic diagram showing a flow chart of using PING-PONG to detect connectivity between a data channel establishment initiator and a data receiving terminal in an exemplary embodiment of the present disclosure;
[0039] Figure 4 An architectural diagram showing establishment of a data channel in a wide area network environment in an exemplary embodiment of the present disclosure;
[0040] Figure 5 A schematic diagram showing the structure of an electronic device in an exemplary embodiment of the present disclosure is shown;
[0041] Figure 6 A schematic diagram showing the structure of a program product for implementing a method for establishing a data channel in a wide area network environment in an exemplary embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0042] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0043] In addition, the accompanying drawings are only schematic illustrations of the embodiments of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated descriptions will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities.
[0044] This example implementation method first provides a method for establishing a data channel in a wide area network environment, which is described from the perspective of a server. The server is set up on the public network. Please refer to Figure 1 The method may include: Step S101 to Step S107. Specifically, as follows:
[0045] Step S101, receiving a first composite transmission address sent by a data channel establishment initiator, wherein the first composite transmission address includes an initiator host transmission address and a server reflection transmission address, and the server reflection transmission address includes a unique identifier of the data channel establishment initiator and a unique identifier of the data receiving end.
[0046] The data channel establishment initiator is represented by Caller, and the data receiving end is represented by Callee. Their unique identifiers can be device IDs. Each device has an ID corresponding to it, and the device can be identified by the ID. The initiator host transport address is represented by Host TransportAddress, and the server reflection transport address is represented by SrflxTransport Address. The first composite transport address is represented by Host / Srflx Transport Address. Since Srflx TransportAddress contains the IDs of Caller and Callee, Host / Srflx TransportAddress contains the respective IDs of Caller and Callee.
[0047] Step S102, determine the corresponding data receiving end through the unique identifier of the data receiving end, and send the first composite transport address to the data receiving end. Since the Host / SrflxTransport Address contains the IDs of both the Caller and the Callee, the server can find the Callee using the Callee and send the Host / Srflx Transport Address to the Callee.
[0048] Step S103, receiving the Get Relayed Transport Address instruction sent by the data receiving end, that is, the server receives the Get Relayed Transport Address instruction sent by the Callee.
[0049] Step S104, apply for a free port, combine the free port with the public IP to form the forwarding transport address, and bind the forwarding transport address to the server reflection transport address. The server applies for an unoccupied free port, combines it with the public IP to form a Relayed Transport Address, and binds the Relayed Transport Address to the SrflxTransport Address to ensure that the Relayed Transport Address can only forward data from the caller to the callee, and all data not sent by the caller is discarded. Since the Relayed Transport Address is exposed on the public Internet, this mechanism can improve security.
[0050] Step S105, sending a second composite transport address to the data receiving end, wherein the second composite transport address includes the forwarding transport address and the server reflection transport address. The second composite transport address is represented by Relayed / SrflxTransport Address. Similarly, since SrflxTransport Address includes the IDs of the caller and the callee, the Relayed / Srflx TransportAddress includes the respective IDs of the caller and the callee.
[0051] Step S106, receiving the third composite transport address sent by the data receiving end, wherein the third composite transport address includes the receiving end host transport address, the forwarding transport address and the server reflection transport address. The third composite transport address is represented by Host / Relayed / Srflx Transport Address. Similarly, since Srflx Transport Address includes the IDs of the Caller and Callee, the Host / Relayed / Srflx Transport Address includes the respective IDs of the Caller and Callee.
[0052] Step S107, determining the data channel establishment initiator according to the unique identifier of the data channel establishment initiator in the third composite transmission address, and forwarding the third composite transmission address to the data channel establishment initiator, so that the data channel establishment initiator and the data receiving end establish a data channel with the idle port.
[0053] The Caller is found according to the Caller ID contained in the Host / Relayed / Srflx Transport Address, and the Host / Relayed / Srflx Transport Address is forwarded to the Caller, so that the Caller and Callee establish a data channel with the idle port, and data can be transmitted between the two through the server.
[0054] In this embodiment, by deploying a server in a wide area network and using the server as a transfer station, a data transmission channel can be established for two communication equipment ends located in different local area networks, and the two communication devices are connected one-to-one using the unique identifiers of the two communication devices, so that data can be accurately sent to the target device, and data can be sent and received in both directions between the two devices.
[0055] Based on the above examples, please refer to Figure 2 , the step S101 also includes steps S201-S203:
[0056] Step S201, receiving a registration request sent by a data channel establishment initiator / data receiving end and verifying it, and sending a registration success response that passes the verification to the receiving data channel establishment initiator / data receiving end.
[0057] In this step, when the Caller / Callee device is used for the first time, it must provide some of its own information to the server, such as factory batch, MAC and other information. After passing the server verification, the server will assign a unique device ID to the Caller / Callee to distinguish different devices. The details are as follows:
[0058] Step 1.1, Caller provides some of its own information to the server, such as factory batch, MAC and other information, and initiates a registration request to the server port 8080 using the WebSocket protocol;
[0059] Step 1.2: The server verifies the information provided by the Caller. If the verification is successful, a registration success response is returned to the Caller.
[0060] Step 2.1, Callee provides some of its own information to the server, such as factory batch, MAC and other information, and initiates a registration request to the server port 8080 using the WebSocket protocol;
[0061] Step 2.2, the server verifies the information provided by Callee, and returns a registration success response to Callee if the verification is successful.
[0062] There is no order between step 1.1 and step 2.1. Both parties who establish a data channel must register on the server, and the server will assign a device ID. The server will not provide any services to devices that are not registered on the server.
[0063] Step S202, receiving a login request sent by the data channel establishment initiator / data receiving end and verifying the login information, and sending a successful login response that passes the verification to the data channel establishment initiator / data receiving end.
[0064] In this step, when the Caller / Callee device is used later, there is no need to perform the registration process again. You only need to log in to the server through the device ID and other information. The details are as follows:
[0065] Step 3.1, Caller provides the server with information such as ID, and initiates a login request to the server port 8080 using the WebSocket protocol;
[0066] Step 3.2, the server verifies the login information provided by the Caller, and returns a login success response to the Caller if the verification is successful;
[0067] Step 4.1, Callee provides the ID and other information to the server, and initiates a login request to the server port 8080 using the WebSocket protocol;
[0068] Step 4.2, the server verifies the login information provided by Callee, and returns a successful login response to Caller if the verification is successful.
[0069] There is no order between step 3.1 and step 4.1. Both parties who establish the data channel must log in to the server before they can use the subsequent services provided by the server.
[0070] Step S203: receiving an instruction for acquiring a server reflexive transmission address sent by the data channel establishment initiator, and sending the server reflexive transmission address to the data channel establishment initiator.
[0071] Specifically, the Caller uses the UDP protocol to send a Get Srflx TransportAddress instruction to port 9527 of the server. After receiving the instruction, the server obtains the source address of the instruction through the socket, that is, the Caller ID. After obtaining the address, the UDP protocol is also used to return the Caller's Srflx TransportAddress to the source address that initiated the instruction.
[0072] Based on the above embodiments, it is also necessary to detect the connectivity between the data channel establishment initiator and the data receiving end. Figure 3 , you can use PING-PONG to detect the connectivity between the data channel initiator and the data receiver. The process is as follows:
[0073] S301, receiving a PING instruction sent by a data channel establishment initiator, and forwarding the PING instruction to a corresponding data receiving end.
[0074] S302, receiving a PONG instruction sent by a data receiving end, and forwarding the PONG instruction to the data channel establishment initiator.
[0075] Specifically, the connectivity detection process from Caller to Callee is as follows:
[0076] The caller uses the UDP protocol to send the PING command to the Relayed Transport Address of the Callee. After receiving the PING command, the server forwards it to the corresponding Callee through port 9527 using the UDP protocol (the Relayed Transport Address is applied for by the Callee and corresponds one-to-one to the Callee).
[0077] After receiving the PING command, the Callee sends the PONG command to the server's port 9527 using the UDP protocol. After receiving the PONG command, the server finds the corresponding Relayed Transport Address through the Callee (the Relayed Transport Address is applied for by the Callee and corresponds to the Callee one-to-one), and then forwards the PONG command to the Srflx Transport Address bound to the Caller through the Relayed Transport Address. The NAT (Network Address Translation) where the Caller's SrflxTransportAddress is located will automatically forward the data sending command to the Caller.
[0078] The callee to caller connectivity detection process is as follows:
[0079] The callee uses the UDP protocol to send the PING command to the server's port 9527. After receiving the PING command, the server finds the corresponding RelayedTransport Address through the callee (the RelayedTransport Address is applied by the callee and corresponds to the callee one-to-one), and then forwards the PING command to the Srflx Transport Address bound to the caller through the RelayedTransport Address. The NAT where the caller's Srflx TransportAddress is located will automatically forward the data sending command to the caller.
[0080] After receiving the PING command, the Caller sends the PONG command to the Relayed Transport Address of the Callee using the UDP protocol. After receiving the PONG command, the server forwards it to the corresponding Callee through port 9527 using the UDP protocol (the Relayed Transport Address is applied for by the Callee and corresponds one-to-one to the Callee).
[0081] The sender of the PING message can obtain the transmission address of the channel established with the other end according to the source address of the PONG instruction received. The party that receives the PONG determines that the corresponding data channel is successfully established.
[0082] The above connectivity test is to test the data channel that transfers data through the server. In addition, Caller and Callee can also transmit data through LAN direct connection or P2P direct connection. The connectivity test process of these two methods is as follows:
[0083] After receiving the Host / Srflx Transport Address from the other end, the Caller / Callee uses a timing method, such as a 30ms interval, and uses the UDP protocol to send a PING command to the Host / Srflx TransportAddress. If the other end receives the PING message, it replies with a PONG command to the source address of the PING message.
[0084] The sender of the PING message can obtain the transmission address of the channel established with the other end according to the source address of the PONG instruction. The party that receives the PONG determines that the corresponding data channel is successfully established. At this time, the LAN or P2P channel is successfully established.
[0085] The present invention converts a local area network direct connection into a LAN direct connection, and converts a wide area network direct connection without server forwarding into a P2P connection mode.
[0086] In this application, when the connectivity test passes, the caller / callee will get at least one data channel, because the server-transfer connectivity test is confirmed to pass, and data can be sent to the other end through the data sending instruction. If the LAN / P2P connectivity test passes, the LAN / P2P method is used first to send data.
[0087] The data to be sent is encapsulated into a data sending instruction using the LAN / P2P method, and then sent to the other end through a channel where connectivity detection is successful. The other end parses the instruction and obtains the required data.
[0088] The specific process of using the server for transfer is as follows:
[0089] The process of Caller sending data to Callee:
[0090] The Caller encapsulates the data to be sent into a data sending instruction and uses the UDP protocol to send the data sending instruction to the Relayed Transport Address of the Callee. After receiving the data sending instruction, the server forwards it to the corresponding Callee through port 9527 using the UDP protocol (the Relayed Transport Address is applied for by the Callee and corresponds one-to-one to the Callee).
[0091] The process of Callee sending data to Caller:
[0092] Callee encapsulates the data to be sent into the data sending instruction, and uses the UDP protocol to send the data sending instruction to the server's port 9527. After receiving the data sending instruction, the server finds the corresponding RelayedTransport Address through Callee (Relayed Transport Address is applied by Callee and corresponds to Callee one-to-one), and then forwards the data sending instruction to the SrflxTransport Address bound to the Caller through the RelayedTransport Address. The NAT where the Caller's Srflx Transport Address is located will automatically forward the data sending instruction to the Caller.
[0093] The P2P channel establishment method of the present invention is realized by a UDP-based "hole punching" method. The final transmission channel is based on UDP, so each data packet sent cannot exceed the MTU. If a data packet is too large, it needs to be split into data packets smaller than the MTU for transmission. How to split and combine large data packets to ensure data reliability can adopt conventional technologies in the field.
[0094] This application also provides a server, please refer to Figure 4 The server is deployed on a public network (local area network), and is used to establish a data channel between the data channel establishment initiator and the data receiving end in any of the above embodiments and to forward data between the two.
[0095] The server is deployed on the public Internet and will listen to the following two ports when it is running:
[0096] WebSocket port, such as 8080, is used to process caller / callee registration and login requests and exchange caller / callee transmission addresses.
[0097] UDP port, such as 9527, is used to obtain the Caller / Callee transmission address and forward data.
[0098] Caller / Callee runs in its own network, which can be in the same LAN or not.
[0099] In the above embodiments, the instruction design format is as follows:
[0100]
[0101] The details of each field are as follows:
[0102] Marker field:
[0103] Marker occupies 8 bits, Marker = 255, and is used to identify the protocol.
[0104] Method field:
[0105] Method, occupies 6 bits. Range 0-63. Indicates the message method. The message methods and values are as follows:
[0106] #define MSG_METHOD_GET_SRFLX_TRANSPORT_ADDR 0
[0107] #define MSG_METHOD_GET_RELAYED_TRANSPORT_ADDR 1
[0108] #define MSG_METHOD_PING 2
[0109] #define MSG_METHOD_PONG 3
[0110] #define MSG_METHOD_CHANNEL_DATA 4
[0111] Class field:
[0112] class, occupies 2 bits, indicating the message category.
[0113] The message categories and values are as follows:
[0114] #define MSG_CLASS_REQUEST 0
[0115] #define MSG_CLASS_INDICATION 1
[0116] #define MSG_CLASS_SUCCESS_RESPONSE 2
[0117] #define MSG_CLASS_FAILURE_RESPONSE 3
[0118] MSG_CLASS_REQUEST requires a response
[0119] MSG_CLASS_SUCCESS_RESPONSE / MSG_CLASS_FAILURE_RESPONSE.
[0120] MSG_CLASS_INDICATION No response is required.
[0121] Length field:
[0122] Length, 16 bits. The length of the message body (excluding the message header).
[0123] Data Field
[0124] Message body.
[0125] Get Srflx Transport Address Command
[0126] The specific field filling values are as follows.
[0127] ask
[0128] Marker = 255;
[0129] Method=MSG_METHOD_GET_SRFLX_TRANSPORT_ADDR;
[0130] Class = MSG_CLASS_REQUEST;
[0131] Length=0;
[0132] Data is empty.
[0133] Successful response
[0134] Marker = 255;
[0135] Method=MSG_METHOD_GET_SRFLX_TRANSPORT_ADDR;
[0136] Class=MSG_CLASS_SUCCESS_RESPONSE;
[0137] Length = Srflx Transport Address length;
[0138] Data=Srflx Transport Address;
[0139] Error Response
[0140] Marker = 255;
[0141] Method=MSG_METHOD_GET_SRFLX_TRANSPORT_ADDR;
[0142] Class=MSG_CLASS_FAILURE_RESPONSE;
[0143] Length = length of failure reason;
[0144] Data = failure reason;
[0145] Get Relayed Transport Address Command
[0146] The specific field filling values are as follows:
[0147] ask
[0148] Marker = 255;
[0149] Method=MSG_METHOD_GET_RELAYED_TRANSPORT_ADDR; Class=MSG_CLASS_REQUEST;
[0150] Length = Srflx Transport Address length;
[0151] Data=Srflx Transport Address.
[0152] Successful response
[0153] Marker = 255;
[0154] Method=MSG_METHOD_GET_RELAYED_TRANSPORT_ADDR; Class=MSG_CLASS_SUCCESS_RESPONSE;
[0155] Length=Relayed / Srflx Transport Address length;
[0156] Data=Relayed / Srflx Transport Address;
[0157] Error Response
[0158] Marker = 255;
[0159] Method=MSG_METHOD_GET_RELAYED_TRANSPORT_ADDR; Class=MSG_CLASS_FAILURE_RESPONSE;
[0160] Length = length of failure reason;
[0161] Data = failure reason;
[0162] Connectivity test command
[0163] The specific field filling values are as follows.
[0164] PING
[0165] Marker = 255;
[0166] Method = MSG_METHOD_PING;
[0167] Class=MSG_CLASS_INDICATION;
[0168] Length=0;
[0169] Data is empty;
[0170] PONG
[0171] Marker = 255;
[0172] Method = MSG_METHOD_PONG;
[0173] Class=MSG_CLASS_INDICATION;
[0174] Length=0;
[0175] Data is empty;
[0176] Data sending instruction
[0177] The specific field filling values are as follows:
[0178] Marker = 255;
[0179] Method=MSG_METHOD_CHANNEL_DATA;
[0180] Class=MSG_CLASS_INDICATION;
[0181] Length = data length;
[0182] Data=data.
[0183] See also Figure 5 The embodiment of the present invention further provides an electronic device 300, which includes at least one memory 310, at least one processor 320, and a bus 330 for connecting different platform systems.
[0184] The memory 310 may include a readable medium in the form of a volatile memory, such as a random access memory (RAM) 311 and / or a cache memory 312 , and may further include a read-only memory (ROM) 313 .
[0185] Among them, the memory 310 also stores a computer program, and the computer program can be executed by the processor 320, so that the processor 320 executes the steps of a method for establishing a data channel in a wide area network environment in any embodiment of the present invention. The specific implementation method is consistent with the implementation method and the technical effect achieved in the embodiment of the method for establishing a data channel in a wide area network environment mentioned above, and some contents will not be repeated here.
[0186] The memory 310 may also include a utility 314 having at least one program module 315, such program module 315 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0187] Accordingly, the processor 320 may execute the above-mentioned computer program and may execute the utility 314 .
[0188] Bus 330 may represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures.
[0189] The electronic device 300 may also communicate with one or more external devices 340 such as keyboards, pointing devices, Bluetooth devices, etc., and may also communicate with one or more devices that can interact with the electronic device 300, and / or communicate with any device (such as a router, a modem, etc.) that enables the electronic device 300 to communicate with one or more other computing devices. Such communication may be performed through an input / output interface 350. In addition, the electronic device 300 may 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 360. The network adapter 360 may communicate with other modules of the electronic device 300 through a bus 330. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 300, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage platforms.
[0190] An embodiment of the present invention further provides a computer-readable storage medium, which is used to store a computer program. When the computer program is executed, the steps of a method for establishing a data channel in a wide area network environment in an embodiment of the present invention are implemented. The specific implementation method is consistent with the implementation method and the technical effect achieved in the embodiment of the method for establishing a data channel in a wide area network environment mentioned above, and some contents will not be repeated here.
[0191] Figure 6The program product 400 provided in this embodiment for implementing the above-mentioned method for establishing a data channel in a wide area network environment is shown. It can use a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product 400 of the present invention is not limited to this. In the present invention, the readable storage medium can be any tangible medium containing or storing a program, and the program can be used by an instruction execution system, device or device or used in combination with it. The program product 400 can use any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (non-exhaustive list) include: an electrical connection with one or more wires, a portable 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.
[0192] Computer-readable storage media may include data signals propagated in baseband or as part of a carrier wave, wherein readable program codes are carried. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The readable storage medium may also be any readable medium, which may send, propagate, or transmit a program for use by an instruction execution system, an apparatus, or a device or for use in combination with it. The program code contained on the readable storage medium may be transmitted by any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above. The program code for performing the operation of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and also conventional procedural programming languages such as C language or similar programming languages. The program code may be executed entirely on a user computing device, partially on a user device, as an independent software package, partially on a user computing device, partially on a remote computing device, or entirely on a remote computing device or server. Where a remote computing device is involved, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0193] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.
Claims
1. A method for establishing a data channel in a wide area network environment, characterized in that: include: Receive a first composite transmission address sent by a data channel establishment initiator, wherein the first composite transmission address includes an initiator host transmission address and a server reflex transmission address, and the server reflex transmission address includes a unique identifier of the data channel establishment initiator and a unique identifier of the data receiving end; Determine the corresponding data receiving end through the unique identifier of the data receiving end, and send the first composite transmission address to the data receiving end; Receiving an instruction for obtaining a forwarding transmission address sent by the data receiving end; Apply for an idle port, combine the idle port and the public network IP to form the forwarding transmission address, and bind the forwarding transmission address to the server reflection transmission address; Sending a second composite transmission address to the data receiving end, wherein the second composite transmission address includes the forwarding transmission address and the server reflection transmission address; Receiving a third composite transmission address sent by the data receiving end, wherein the third composite transmission address includes a receiving end host transmission address, a forwarding transmission address, and a server reflection transmission address; The data channel establishment initiator is determined according to the unique identifier of the data channel establishment initiator in the third composite transmission address, and the third composite transmission address is forwarded to the data channel establishment initiator, so that the data channel establishment initiator and the data receiving end establish a data channel with the idle port.
2. The method for establishing a data channel under a wide area network environment according to claim 1, characterized in that: The step of receiving the first composite transmission address sent by the initiator through the data channel establishment step also includes: An instruction for acquiring a server reflexive transmission address sent by a data channel establishment initiator is received, and the server reflexive transmission address is sent to the data channel establishment initiator.
3. The method for establishing a data channel under a wide area network environment according to claim 2, characterized in that: The step of receiving an instruction for acquiring a server reflexive transmission address sent by a data channel establishment initiator, and sending the server reflexive transmission address to the data channel establishment initiator, further includes: A registration request sent by a data channel establishment initiator / data receiving end is received and verified, and a registration success response that passes the verification is sent to the data channel establishment initiator / data receiving end.
4. The method for establishing a data channel under a wide area network environment according to claim 3, characterized in that: The step of receiving a registration request sent by the data channel establishment initiator / data receiving end and verifying it, and sending a registration success response that passes the verification to the data channel establishment initiator / data receiving end, then includes: The login request sent by the data channel establishment initiator / data receiving end is received and the login information is verified, and a successful login response that passes the verification is sent to the data channel establishment initiator / data receiving end.
5. The method for establishing a data channel under a wide area network environment according to claim 1, characterized in that: The data channel establishment method also includes: Check the connectivity between the data channel establishment initiator and the data receiving end.
6. The method for establishing a data channel under a wide area network environment according to claim 5, characterized in that: The step of detecting the connectivity between the data channel establishment initiator and the data receiving terminal comprises: Use PING-PONG to detect the connectivity between the data channel establishment initiator and the data receiver.
7. The method for establishing a data channel under a wide area network environment according to claim 1, characterized in that: The step of using PING-PONG to detect the connectivity between the data channel establishment initiator and the data receiving end includes: Receive a PING instruction sent by a data channel establishment initiator, and forward the PING instruction to a corresponding data receiving end; Receive the PONG instruction sent by the data receiving end, and forward the PONG instruction to the data channel establishment initiator.
8. The method for establishing a data channel in a wide area network environment according to any one of claims 1 to 7, characterized in that: The data channel establishment initiator and the data receiving end are located in different local area networks, or the data channel establishment initiator and the data receiving end are located in the same local area network.
9. A server, characterized in that The server is deployed on the public network, and is used to establish a data channel between the data channel establishment initiator and the data receiving end as described in any one of claims 1-8, and to forward data between the two.
10. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to execute the steps of the method for establishing a data channel in a wide area network environment according to any one of claims 1 to 8 by executing the executable instructions.
Citation Information
Cited By
Cross-local area network equipment interaction method and system, terminal and storage medium
CN120583143A