Data transmission channel establishing method, system and server
Technical Field
The present invention relates to the field of communications, and in particular, to a method, a system, and a server for establishing a data transmission channel.
Background
In the data transmission process, the initiator and the responder need to establish corresponding data transmission channels, and the initiator sends data to the responder through the data transmission channels, so that a data transmission channel establishment method is needed, so that the initiator and the responder establish corresponding data transmission channels.
The prior art provides a method for establishing a data transmission channel, wherein during data transmission, a server connected with an initiator and a responder establishes a corresponding single data transmission channel to realize data transmission.
However, when the method provided by the prior art is used, the responder and the initiator need to wait for the time for establishing the data channel in the data transmission process, so that the efficiency of data transmission is reduced, and in the case that the network environment of the data transmission channel is poor, data transmission through a single data transmission channel may cause data loss, and the reliability of data transmission is reduced.
Disclosure of Invention
In order to improve reliability and efficiency of data transmission, embodiments of the present invention provide a method, a system, and a server for establishing a data transmission channel. The technical scheme is as follows:
in a first aspect, a method for establishing a data transmission channel is provided, where the method includes:
the server receives an establishment request sent by an initiator and sends the establishment request to a responder;
if the server receives a first response message sent by a responder, wherein the first response message is used for indicating the responder to receive the establishment request, the server sends information of a plurality of User Datagram Protocol (UDP) servers to the initiator and the responder;
the initiator and the responder send channel establishment requests to the plurality of UDP servers;
the plurality of UDP servers respectively establish a plurality of data transmission channels;
if the server receives a second response message sent by the responder, the server sends the second response message to the initiator;
and the initiator sends data to the responder according to the information of at least one data transmission channel meeting preset conditions in the plurality of data transmission channels.
With reference to the first aspect, in a first possible implementation manner, the server includes a TCP server, and the sending, by the server, information of a plurality of UDP servers to the initiator and the responder includes:
the TCP server acquires information of a plurality of User Datagram Protocol (UDP) servers meeting preset conditions;
the TCP server sends information of the plurality of UDP servers to the initiator and the responder.
With reference to the first possible implementation manner of the first aspect, in a second possible implementation manner, the acquiring, by the TCP server, information of a plurality of UDP servers that satisfy a preset condition includes:
the TCP server acquires network parameters of all available UDP servers;
and the TCP server acquires the plurality of UDP servers meeting the preset conditions from all the available UDP servers according to the network parameters.
With reference to the first aspect to any one of the second possible implementation manners of the first aspect, in a third possible implementation manner, the sending, by the initiator, data to the responder according to information of at least one data transmission channel that meets a preset condition in the plurality of data transmission channels includes:
the initiator acquires at least one of a first round trip time RTT and a first packet loss rate of the plurality of data transmission channels;
the responder acquires at least one of second RTTs and second packet loss rates of the multiple data transmission channels;
the initiator calculates RTT components according to the first RTT and the second RTT;
the initiator calculates a packet loss rate component according to the first packet loss rate and the second packet loss rate;
the initiator acquires a data transmission channel, of the multiple data transmission channels, in which at least one of the RTT component and the packet loss rate component meets a preset condition;
and the sender sends data to the responder according to the information of the at least one data transmission channel meeting the preset condition.
With reference to the first aspect, in a fourth possible implementation manner, before the plurality of UDP servers respectively establish the plurality of data transmission channels, the method further includes:
the UDP server judges whether a point-to-point P2P channel can be established between the initiator and the responder;
and if so, the UDP server sends the information of the P2P channel to the initiator and the responder.
With reference to the fourth possible implementation manner of the first aspect, in a fifth possible implementation manner, the method further includes:
and if the initiator receives the information of the P2P channel sent by the UDP server, sending data to the responder through the P2P channel.
In a second aspect, a method for establishing a data transmission channel is provided, where the method includes:
the server receives an establishment request sent by an initiator and sends the establishment request to a responder;
when the server receives an acceptance response message sent by the responder, the server sends the acceptance response message to the initiator and sends information of a plurality of User Datagram Protocol (UDP) servers to the initiator and the responder;
the initiator and the responder send channel establishment requests to the plurality of UDP servers;
the plurality of UDP servers respectively establish a plurality of data transmission channels;
and the initiator sends data to the responder according to the information of at least one data transmission channel meeting preset conditions in the plurality of data transmission channels.
With reference to the second aspect, in a first possible implementation manner, the server includes a TCP server, and the sending, by the server, information of a plurality of UDP servers to the initiator and the responder includes:
the TCP server acquires information of a plurality of User Datagram Protocol (UDP) servers meeting preset conditions;
the TCP server sends information of the plurality of UDP servers to the initiator and the responder.
With reference to the first possible implementation manner of the second aspect, in a second possible implementation manner, the acquiring, by the TCP server, information of a plurality of UDP servers that satisfy a preset condition includes:
the TCP server acquires network parameters of all available UDP servers;
and the TCP server acquires the plurality of UDP servers meeting the preset conditions from all the available UDP servers according to the network parameters.
With reference to the second aspect to any one of the second possible implementation manners of the second aspect, in a third possible implementation manner, the sending, by the initiator, data to the responder according to information of at least one data transmission channel that meets a preset condition in the plurality of data transmission channels includes:
the initiator acquires at least one of a first round trip time RTT and a first packet loss rate of the plurality of data transmission channels;
the responder acquires at least one of second RTTs and second packet loss rates of the multiple data transmission channels;
the initiator calculates RTT components according to the first RTT and the second RTT;
the initiator calculates a packet loss rate component according to the first packet loss rate and the second packet loss rate;
the initiator acquires a data transmission channel, of the multiple data transmission channels, in which at least one of the RTT component and the packet loss rate component meets a preset condition;
and the sender sends data to the responder according to the information of the at least one data transmission channel meeting the preset condition.
With reference to the second aspect, in a fourth possible implementation manner, before the plurality of UDP servers respectively establish the plurality of data transmission channels, the method further includes:
the UDP server judges whether a point-to-point P2P channel can be established between the initiator and the responder;
and if so, the UDP server sends the information of the P2P channel to the initiator and the responder.
With reference to the fourth possible implementation manner of the second aspect, in a fifth possible implementation manner, the method further includes:
and if the initiator receives the information of the P2P channel sent by the UDP server, sending data to the responder through the P2P channel.
In a third aspect, a server is provided, which includes:
the transfer module is used for receiving an establishment request sent by an initiator and sending the establishment request to a responder;
a sending module, configured to send, to the initiator and the responder, information of a plurality of UDP servers, after the forwarding module receives a first response message indicating that the responder receives the establishment request;
the transit module is further configured to send a second response message to the initiator when receiving the second response message sent by the responder, so that the initiator sends data to the responder according to information of at least one data transmission channel satisfying a preset condition in the plurality of data transmission channels;
wherein the plurality of data transmission channels are respectively established by the plurality of UDP servers after the initiator and the responder send channel establishment requests to the plurality of UDP servers.
With reference to the third aspect, in a first possible implementation manner, the server includes a transmission control protocol TCP server, and the sending module specifically includes:
the acquisition submodule is used for acquiring information of a plurality of User Datagram Protocol (UDP) servers meeting preset conditions;
and the sending submodule is used for sending the information of the plurality of UDP servers to the initiator and the responder.
With reference to the first possible implementation manner of the third aspect, in a second possible implementation manner, the obtaining sub-module is specifically configured to:
acquiring network parameters of all available UDP servers;
and acquiring the plurality of UDP servers meeting the preset conditions from all the available UDP servers according to the network parameters.
In a fourth aspect, a server is provided, which includes a memory, a network interface module, and a processor connected to the memory and the network interface module, wherein the memory is used for storing a set of program codes, and the processor calls the program codes stored in the memory to perform the following operations:
the control network interface module receives an establishment request sent by an initiator and sends the establishment request to a responder;
after the network interface module receives a first response message for indicating that the responder receives the establishment request, the network interface module sends information of a plurality of User Datagram Protocol (UDP) servers to the initiator and the responder;
when receiving a second response message sent by the responder, the control network interface module sends the second response message to the initiator so that the initiator sends data to the responder according to the information of at least one data transmission channel meeting preset conditions in a plurality of data transmission channels;
wherein the plurality of data transmission channels are respectively established by the plurality of UDP servers after the initiator and the responder send channel establishment requests to the plurality of UDP servers.
With reference to the fourth aspect, in a first possible implementation manner, the server includes a TCP server, and the processor invokes the program code stored in the memory to specifically perform the following operations:
acquiring information of a plurality of User Datagram Protocol (UDP) servers meeting preset conditions;
and sending the information of the plurality of UDP servers to the initiator and the responder.
With reference to the first possible implementation manner of the fourth aspect, in a second possible implementation manner, the processor calls the program code stored in the memory to specifically perform the following operations:
acquiring network parameters of all available UDP servers;
and acquiring the plurality of UDP servers meeting the preset conditions from all the available UDP servers according to the network parameters.
In a fifth aspect, a server is provided, which includes:
the transfer module is used for receiving an establishment request sent by an initiator and sending the establishment request to a responder;
and the sending module is used for sending the acceptance response message to the initiator and sending information of a plurality of User Datagram Protocol (UDP) servers to the initiator and the responder when the transfer module receives the acceptance response message sent by the responder.
With reference to the fifth aspect, in a first possible implementation manner, the server includes a transmission control protocol TCP server, and the sending module specifically includes:
the acquisition submodule is used for acquiring information of a plurality of User Datagram Protocol (UDP) servers meeting preset conditions;
and the sending submodule is used for sending the information of the plurality of UDP servers to the initiator and the responder.
With reference to the first possible implementation manner of the fifth aspect, in a second possible implementation manner, the obtaining sub-module is specifically configured to:
acquiring network parameters of all available UDP servers;
and acquiring the plurality of User Datagram Protocol (UDP) servers meeting the preset conditions from all the available UDP servers according to the network parameters.
In a sixth aspect, a server is provided, which includes a memory, a network interface module, and a processor connected to the memory and the network interface module, wherein the memory is used for storing a set of program codes, and the processor calls the program codes stored in the memory to execute the following operations:
controlling the network interface module to receive an establishment request sent by an initiator and send the establishment request to a responder;
and controlling the network interface module to send the acceptance response message to the initiator and send information of a plurality of User Datagram Protocol (UDP) servers to the initiator and the responder when receiving the acceptance response message sent by the responder.
With reference to the sixth aspect, in a first possible implementation manner, the server includes a TCP server, and the processor calls the program code stored in the memory to specifically perform the following operations:
acquiring information of a plurality of User Datagram Protocol (UDP) servers meeting preset conditions;
and sending the information of the plurality of UDP servers to the initiator and the responder.
With reference to the first possible implementation manner of the sixth aspect, in a second possible implementation manner, the processor calls the program code stored in the memory to specifically perform the following operations:
acquiring network parameters of all available UDP servers;
and acquiring the plurality of User Datagram Protocol (UDP) servers meeting the preset conditions from all the available UDP servers according to the network parameters.
A seventh aspect provides a system for establishing a data transmission channel, where the system includes a server, an initiator, a responder, and multiple UDP servers, where:
the server includes:
the transfer module is used for receiving the establishment request sent by the initiator and sending the establishment request to the responder;
a first sending module, configured to send, when the transit module receives a first response message sent by the responder, the first response message being used to indicate that the responder receives the establishment request, information of a plurality of UDP servers to the initiator and the responder;
the initiator and the responder respectively comprise a second sending module and a third sending module, and the second sending module and the third sending module are used for sending channel establishment requests to the plurality of UDP servers;
the plurality of UDP servers respectively comprise a plurality of channel establishing modules, and the plurality of channel establishing modules are respectively used for establishing a plurality of data transmission channels;
the transit module is further configured to send a second response message to the initiator when receiving the second response message sent by the responder;
the second sending module is further configured to send data to the responder according to information of at least one data transmission channel that meets a preset condition among the plurality of data transmission channels.
With reference to the seventh aspect, in a first possible implementation manner, the server includes a TCP server, and the first sending module includes:
the acquisition submodule is used for acquiring information of a plurality of User Datagram Protocol (UDP) servers meeting preset conditions;
and the first sending submodule is used for sending the information of the plurality of UDP servers to the initiator and the responder.
With reference to the first possible implementation manner of the seventh aspect, in a second possible implementation manner, the obtaining sub-module is specifically configured to:
acquiring network parameters of all available UDP servers;
and acquiring the plurality of UDP servers meeting the preset conditions from all the available UDP servers according to the network parameters.
With reference to any one of the seventh aspect to the second possible implementation manner of the seventh aspect, in a third possible implementation manner, the initiator further includes a processing module, and the processing module is configured to:
obtaining at least one of a first Round Trip Time (RTT) and a first packet loss rate of the plurality of data transmission channels;
acquiring at least one of a second RTT and a second packet loss rate of the plurality of data transmission channels acquired by the responder;
calculating an RTT component according to the first RTT and the second RTT;
calculating packet loss rate components according to the first packet loss rate and the second packet loss rate;
and acquiring a data transmission channel in which at least one of the RTT component and the packet loss rate component in the plurality of data transmission channels meets a preset condition.
With reference to the seventh aspect, in a fourth possible implementation manner, the UDP server further includes:
the processing submodule is used for judging whether a point-to-point P2P channel can be established between the initiator and the responder;
and the second sending submodule is used for sending the information of the P2P channel to the initiator and the responder when the processing submodule judges that a point-to-point P2P channel can be established between the initiator and the responder.
With reference to the fourth possible implementation manner of the seventh aspect, in a fifth possible implementation manner,
the initiator further comprises a receiving module, and the second sending module is further configured to send data to the responder through the P2P channel when the receiving module receives the information of the P2P channel sent by the UDP server.
An eighth aspect provides a data transmission channel establishing system, where the system includes a server, an initiator, a responder, and multiple UDP servers, where:
the server includes:
the transfer module is used for receiving the establishment request sent by the initiator and sending the establishment request to the responder;
a first sending module, configured to send, when the transit module receives an acceptance response message sent by the responder, the acceptance response message to the initiator, and send information of multiple UDP servers to the initiator and the responder;
the initiator and the responder respectively comprise a second sending module and a third sending module, and the second sending module and the third sending module are respectively used for sending channel establishment requests to the plurality of UDP servers;
the plurality of UDP servers respectively comprise a plurality of channel establishing modules for establishing a plurality of data transmission channels;
the second sending module is further configured to send data to the responder according to information of at least one data transmission channel that meets a preset condition among the plurality of data transmission channels.
With reference to the eighth aspect, in a first possible implementation manner, the server includes a TCP server, and the first sending module includes:
the acquisition submodule is used for acquiring information of a plurality of User Datagram Protocol (UDP) servers meeting preset conditions;
and the sending submodule is used for sending the information of the plurality of UDP servers to the initiator and the responder.
With reference to the first possible implementation manner of the eighth aspect, in a second possible implementation manner, the obtaining sub-module is specifically configured to:
acquiring network parameters of all available UDP servers;
and acquiring the plurality of UDP servers meeting the preset conditions from all the available UDP servers according to the network parameters.
With reference to any one of the second possible implementation manners of the eighth aspect to the eighth aspect, in a third possible implementation manner, the initiator further includes a processing module, and the processing module is configured to:
obtaining at least one of a first Round Trip Time (RTT) and a first packet loss rate of the plurality of data transmission channels;
acquiring at least one of a second RTT and a second packet loss rate of the plurality of data transmission channels acquired by the responder;
calculating an RTT component according to the first RTT and the second RTT;
calculating packet loss rate components according to the first packet loss rate and the second packet loss rate;
and acquiring a data transmission channel in which at least one of the RTT component and the packet loss rate component in the plurality of data transmission channels meets a preset condition.
With reference to the eighth aspect, in a fourth possible implementation manner, the UDP server further includes:
the processing submodule is used for judging whether a point-to-point P2P channel can be established between the initiator and the responder;
and the second sending submodule is used for sending the information of the P2P channel to the initiator and the responder when the processing submodule judges that a point-to-point P2P channel can be established between the initiator and the responder.
With reference to the fourth possible implementation manner of the eighth aspect, in a fifth possible implementation manner,
the initiator further comprises a receiving module, and the second sending module is further configured to send data to the responder through the P2P channel when the receiving module receives the information of the P2P channel sent by the UDP server.
The invention provides a method, a system and a server for establishing a data transmission channel, which comprises the following steps: the server receives an establishment request sent by an initiator and sends the establishment request to a responder; if the server receives a first response message sent by a responder, wherein the first response message is used for indicating the responder to receive an establishment request, the server sends information of a plurality of User Datagram Protocol (UDP) servers to an initiator and the responder; the initiator and the responder send channel establishment requests to the plurality of UDP servers; the plurality of UDP servers respectively establish a plurality of data transmission channels; if the server receives a second response message sent by the responder, the server sends the second response message to the initiator; and the initiator sends data to the responder according to the information of at least one data transmission channel meeting the preset condition in the plurality of data transmission channels. Before data transmission, a plurality of UDP server initiators and responders respectively pre-establish data transmission channels according to the sent channel establishment requests, and compared with the method of establishing data transmission channels during data transmission, the method avoids waiting for the establishment of the data channels in the data transmission process, thereby improving the efficiency of data transmission and improving the user experience. In addition, compared with the data transmission through one channel, the data transmission channels are replaced when the transmission speed and the reliability of a partial channel network are poor, the data loss is avoided, the reliability of data transmission is improved, and the user experience is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of a method for establishing a data transmission channel according to an embodiment of the present invention;
fig. 2 is a flowchart of a method for establishing a data transmission channel according to an embodiment of the present invention;
fig. 3 is a flowchart of a method for establishing a data transmission channel according to an embodiment of the present invention;
fig. 4 is a flowchart of a method for establishing a data transmission channel according to an embodiment of the present invention;
fig. 5 is a flowchart of a method for establishing a data transmission channel according to an embodiment of the present invention;
fig. 6 is a flowchart of a method for establishing a data transmission channel according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of a server according to an embodiment of the present invention;
FIG. 8 is a schematic diagram of a server according to an embodiment of the present invention;
FIG. 9 is a schematic diagram of a server according to an embodiment of the present invention;
FIG. 10 is a schematic diagram of a server according to an embodiment of the present invention;
fig. 11 is a schematic diagram of a system for establishing a data transmission channel according to an embodiment of the present invention;
fig. 12 is a schematic diagram of a system for establishing a data transmission channel according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. 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 embodiment of the invention provides a data transmission channel establishing method, which can be applied to data transmission of video data, voice data, picture data, text data and the like of two video interaction parties in an instant video process. It should be noted that the initiator and the responder are connected to the same TCP server before data transmission, the TCP server may be a single TCP server, or a server group composed of multiple TCP servers, and information of multiple TCP servers is shared in the TCP server group.
An embodiment of the present invention provides a method for establishing a data transmission channel, which is shown in fig. 1 and includes:
101. the server receives the establishment request sent by the initiator and sends the establishment request to the responder.
102. And if the server receives a first response message sent by the responder, wherein the first response message is used for indicating the responder to receive the establishment request, the server sends information of a plurality of User Datagram Protocol (UDP) servers to the initiator and the responder.
Specifically, the server includes a TCP server, and the sending of the information of the plurality of UDP servers by the server to the initiator and the responder includes:
the method comprises the steps that a TCP server obtains information of a plurality of user datagram protocol UDP servers meeting preset conditions;
the TCP server sends information of a plurality of UDP servers to the initiator and the responder.
The process of the TCP server acquiring the information of the plurality of UDP servers meeting the preset condition may be:
the TCP server acquires network parameters of all available UDP servers;
and the TCP server acquires a plurality of UDP servers meeting preset conditions from all available UDP servers according to the network parameters.
103. The initiator and the responder send channel establishment requests to a plurality of UDP servers.
104. The plurality of UDP servers respectively establish a plurality of data transmission channels.
Optionally, before step 104, the method may further include:
the UDP server judges whether a point-to-point P2P channel can be established between the initiator and the responder;
if yes, the UDP server establishes a P2P channel between the initiator and the responder and sends the information of the P2P channel to the initiator and the responder.
105. And if the server receives a second response message sent by the responder, sending the second response message to the initiator.
106. And the initiator sends data to the responder according to the information of at least one data transmission channel meeting the preset condition in the plurality of data transmission channels.
Specifically, the initiator may perform at least one data transmission channel satisfying a preset condition from among the plurality of data transmission channels by any one of the following operations:
the initiator acquires at least one of first round trip time RTT and first packet loss rate of a plurality of data transmission channels;
the initiator calculates an RTT component according to the first RTT;
the initiator calculates a packet loss rate component according to the first packet loss rate;
the initiator acquires a data transmission channel, of which at least one of an RTT component and a packet loss rate component in a plurality of data transmission channels meets a preset condition. Or
The initiator acquires at least one of first round trip time RTT and first packet loss rate of a plurality of data transmission channels;
the responder acquires at least one of second RTT and second packet loss rate of a plurality of data transmission channels;
the initiator calculates an RTT component according to the first RTT and the second RTT;
the initiator calculates a packet loss rate component according to the first packet loss rate and a second packet loss rate, wherein the second RTT and the second packet loss rate are forwarded to the initiator by the responder through the TCP server;
the initiator acquires a data transmission channel, at least one of RTT (round trip time) components and packet loss rate components of which meet preset conditions, from a plurality of data transmission channels;
and the sender sends data to the responder according to the information of at least one data transmission channel meeting the preset condition.
Optionally, if the initiator receives the information of the P2P channel sent by the UDP server, the initiator sends data to the responder through the P2P channel.
The embodiment of the invention provides a data transmission channel establishing method, wherein before data transmission, a plurality of UDP server initiators and responders respectively establish data transmission channels in advance according to a transmitted channel establishing request, and compared with the data transmission channel establishment during data transmission, the data transmission channel establishing method avoids the time for waiting for the data channel establishment in the data transmission process, thereby improving the data transmission efficiency and improving the user experience. In addition, compared with the data transmission through one channel, the data transmission channels are replaced when the transmission speed and the reliability of a partial channel network are poor, the data loss is avoided, the reliability of data transmission is improved, and the user experience is improved.
An embodiment two is a method for establishing a data transmission channel according to an embodiment of the present invention, and as shown in fig. 2, the method includes:
201. the server receives the establishment request sent by the initiator and sends the establishment request to the responder.
202. And when the server receives the receiving response message sent by the responder, the receiving response message is sent to the initiator, and the information of a plurality of User Datagram Protocol (UDP) servers is sent to the initiator and the responder.
Specifically, the server includes a TCP server, and the sending of the information of the plurality of UDP servers by the server to the initiator and the responder includes:
the method comprises the steps that a TCP server obtains information of a plurality of user datagram protocol UDP servers meeting preset conditions;
the TCP server sends information of a plurality of UDP servers to the initiator and the responder.
The process of the TCP server acquiring the information of the plurality of UDP servers meeting the preset condition may be:
the TCP server acquires network parameters of all available UDP servers;
and the TCP server acquires a plurality of UDP servers meeting preset conditions from all available UDP servers according to the network parameters.
203. The initiator and the responder send channel establishment requests to a plurality of UDP servers.
204. The plurality of UDP servers respectively establish a plurality of data transmission channels.
Optionally, before step 204, the method may further include:
the UDP server judges whether a point-to-point P2P channel can be established between the initiator and the responder;
if yes, the UDP server establishes a P2P channel between the initiator and the responder and sends the information of the P2P channel to the initiator and the responder.
205. And the initiator sends data to the responder according to the information of at least one data transmission channel meeting the preset condition in the plurality of data transmission channels.
Specifically, the initiator may perform at least one data transmission channel satisfying a preset condition from among the plurality of data transmission channels by any one of the following operations:
the initiator acquires at least one of first round trip time RTT and first packet loss rate of a plurality of data transmission channels;
the initiator calculates an RTT component according to the first RTT;
the initiator calculates a packet loss rate component according to the first packet loss rate;
the initiator acquires a data transmission channel, of which at least one of an RTT component and a packet loss rate component in a plurality of data transmission channels meets a preset condition. Or
The initiator acquires at least one of first round trip time RTT and first packet loss rate of a plurality of data transmission channels;
the responder acquires at least one of second RTT and second packet loss rate of a plurality of data transmission channels;
the initiator calculates an RTT component according to the first RTT and the second RTT;
the initiator calculates a packet loss rate component according to the first packet loss rate and a second packet loss rate, wherein the second RTT and the second packet loss rate are forwarded to the initiator by the responder through the TCP server;
the initiator acquires a data transmission channel, at least one of RTT (round trip time) components and packet loss rate components of which meet preset conditions, from a plurality of data transmission channels;
and the sender sends data to the responder according to the information of at least one data transmission channel meeting the preset condition.
Optionally, if the initiator receives the information of the P2P channel sent by the UDP server, the initiator sends data to the responder through the P2P channel.
The embodiment of the invention provides a data transmission channel establishing method, wherein before data transmission, a plurality of UDP server initiators and responders respectively establish data transmission channels in advance according to a transmitted channel establishing request, and compared with the data transmission channel establishment during data transmission, the data transmission channel establishing method avoids the time for waiting for the data channel establishment in the data transmission process, thereby improving the data transmission efficiency and improving the user experience. In addition, compared with the data transmission through one channel, the data transmission channels are replaced when the transmission speed and the reliability of a partial channel network are poor, the data loss is avoided, the reliability of data transmission is improved, and the user experience is improved.
An embodiment three is a method for establishing a data transmission channel according to an embodiment of the present invention, and as shown in fig. 3, the method includes:
301. the TCP server receives the establishment request sent by the initiator and sends the establishment request to the responder.
Specifically, the establishment request may be a data transmission channel establishment request;
in practical applications, the setup request may include a network address of the responder, a network address of the initiator, etc.,
the sending process may be:
the initiator sends a request for establishing the network address of the initiator and the network address of the responder to a TCP server connected with the initiator;
the TCP server sends the establishment request to the responder according to the network address of the responder included in the establishment request, and the sending process is only exemplary, and the specific sending process is not limited in the embodiment of the present invention.
302. The TCP server receives a first response message sent by the responder, wherein the first response message is used for indicating the responder to receive the establishment request.
Specifically, after receiving the establishment request, the responder sends a first response message to the server, indicating that the responder receives the establishment request.
The server receives a first response message sent by the responder.
Optionally, in practical application, if the server does not receive the first response message sent by the responder within the preset time, the establishment request may be sent to the responder again until the first response message sent by the responder is received.
303. The TCP server obtains the network parameters of all available UDP servers.
Specifically, the above process may be implemented by the TCP server sending test data to the UDP server, or by acquiring network parameters periodically reported by the UDP server to the TCP server.
In addition, the available UDP server according to the embodiment of the present invention includes a UDP server that is connected to the TCP server and is in an idle state, or a UDP server that is connected to the TCP server and has a number of tasks to be processed smaller than a preset value.
The network parameters described in the embodiments of the present invention are used to describe the data processing capability of the UDP server, the network state of the network link between the UDP server and the initiator, and the network state of the network link between the UDP server and the responder.
304. And the TCP server acquires a plurality of UDP servers meeting preset conditions from all available UDP servers according to the network parameters.
Specifically, a TCP server acquires a plurality of UDP servers with network parameters meeting a threshold value;
in addition, in the above process, the plurality of UDP servers satisfying the preset condition may be determined by determining at least one of a data processing capability of the UDP server, a network state of a network link between the UDP server and the initiator, and a network state of a network link between the UDP server and the responder, or the plurality of UDP servers satisfying the preset condition may be determined by comprehensively determining the data processing capability of the UDP server, the network state of a network link between the UDP server and the initiator, and the network state of a network link between the UDP server and the responder.
The data processing capacity of the UDP server may be described by a data amount that can be processed by the server in a unit time, and the data processing capacity of the UDP server satisfying the preset condition includes:
the data amount that can be processed by the server in the unit time is greater than or equal to the data amount threshold, and the data amount that can be processed by the server in the unit time can be acquired through the data processing history of the server.
The network state of the network link between the UDP server and the initiator may be described by a transmission speed, a packet loss rate, and an RTT of the network link between the UDP server and the initiator, where the network state of the network link between the UDP server and the initiator satisfies a preset condition including:
the transmission speed is greater than at least one of a first preset speed, the packet loss rate is less than a first packet loss rate threshold value, and the RTT is less than a first RTT threshold value.
The network state of the network link between the UDP server and the answering party can be described by the transmission speed, packet loss rate and RTT of the network link between the UDP server and the answering party,
the network state of the network link between the UDP server and the responder meeting the preset conditions comprises the following steps:
and the transmission speed is greater than at least one of a second preset speed, the packet loss rate is less than a second packet loss rate threshold value and the RTT is less than a second RTT threshold value.
It should be noted that steps 303 to 304 are processes for the TCP server to obtain information of a plurality of user datagram protocol UDP servers meeting a preset condition, and besides the manners described in the steps, the processes may be implemented in other manners, and a specific manner is not limited in the embodiment of the present invention.
Because the network parameters of the UDP server describe the data processing capacity of the UDP server, the network state of the network link between the UDP server and the initiator and the network state of the network link between the UDP server and the responder, the TCP server obtains a plurality of UDP servers meeting preset conditions from all available UDP servers according to the network parameters, thereby avoiding data transmission interruption or data loss caused by poor data processing capacity of the UDP server, the network state of the network link between the UDP server and the initiator and the network state of the network link between the UDP server and the responder in the data transmission process, and further ensuring the reliability and efficiency of data transmission.
305. The TCP server sends information of a plurality of UDP servers to the initiator and the responder.
Specifically, the information of the UDP server may include an IP address of the UDP server.
The embodiment of the present invention does not limit the specific transmission method.
It should be noted that steps 303 to 305 are processes for implementing that the server sends information of a plurality of UDP servers to the initiator and the responder, and besides the manners described in the steps, the processes may also be implemented in other manners, and the specific manner is not limited in the embodiment of the present invention.
306. The initiator and the responder send channel establishment requests to a plurality of UDP servers.
Specifically, the channel establishment request may include the network address of the initiator and the network address of the responder.
The embodiment of the present invention does not limit the specific transmission method.
Optionally, the channel establishment request may further include a field for describing a data type to be transmitted, so that the UDP server establishes the data transmission channel according to the field of the data type.
307. The UDP server determines whether a peer-to-peer P2P channel can be established between the initiator and the responder, and if so, performs step 308; otherwise, step 309 is performed.
Specifically, it is determined whether the type of the transmission medium between the initiator and the responder, the operating speed of the same network to which the initiator and the responder are connected, the coverage of the network to which the initiator and the responder are connected, and the network topology between the initiator and the responder satisfy the conditions required for establishing the peer-to-peer P2P channel.
The method for transmitting the data comprises the following steps that the type of a transmission medium between an initiator and a responder meets a preset condition, and comprises the following steps:
the initiator and the responder at least comprise a wireless network interface capable of supporting the establishment of a wireless peer-to-peer network or the initiator and the responder at least comprise a wired network interface and a transmission medium which support the establishment of a wired peer-to-peer network.
The method for enabling the running speed of the same network connected with the initiator and the responder to meet the preset conditions comprises the following steps:
the operating speed of the same network to which the initiator and responder are connected is greater than or equal to a network speed threshold.
The method for realizing the network coverage of the initiator and the responder meets the preset conditions comprises the following steps:
the network coverage of the initiator includes at least the respondents, and the network coverage between the respondents includes at least the initiator.
The network topology structure between the initiator and the responder meeting the preset conditions comprises the following steps:
the network topology between the initiator and responder is ad hoc and automatically adjusted.
The embodiment of the present invention does not limit the specific determination method.
It should be noted that steps 307 to 308 are optional steps, and in practical applications, after step 306, step 309 may be directly performed without performing steps 307 to 308.
Compared with data transmission through server transfer, the data transmission through the P2P channel has higher reliability and higher data transmission efficiency, and meanwhile, the data transmission interruption or data loss caused by the fault of intermediate routing equipment during the data transmission through the server transfer can be avoided, so that the UDP server judges whether a point-to-point P2P channel can be established between an initiator and a responder, so that when the point-to-point P2P channel can be established between the initiator and the responder, the data transmission is carried out through the P2P channel, and the reliability and the efficiency of the data transmission are further ensured.
308. The UDP server establishes a P2P channel between the initiator and the responder and sends the information of the P2P channel to the initiator and the responder.
Specifically, the information about the P2P channel includes: routing information for the P2P tunnel.
The embodiment of the present invention does not limit the specific transmission method.
309. The plurality of UDP servers respectively establish a plurality of data transmission channels.
Specifically, a plurality of UDP servers respectively establish a plurality of data transmission channels according to I P addresses of an initiator, I P addresses of a responder and routing information between the initiator and the responder;
the embodiment of the present invention does not limit the specific establishment method.
310. The TCP server, upon receiving the second response message sent by the responder, sends the second response message to the initiator, and after step 310, executes any one of steps 311 and 317.
Specifically, the second response message is used to indicate that the responder agrees to the data transmission request of the initiator, and indicate that the initiator can transmit data to the responder through a plurality of data transmission channels.
The embodiment of the present invention does not limit the specific transmission method.
311. The initiator acquires at least one of a first Round Trip Time (RTT) and a first packet loss rate of a plurality of data transmission channels.
Specifically, the initiator sends a plurality of test packets to the UDP server through the plurality of data transmission channels, and obtains at least one of a first round trip time RTT and a first packet loss rate of the plurality of data transmission channels.
For example, in practical applications, the process may be:
the initiator sends 10 test packets to the corresponding UDP server through any one of the multiple data transmission channels, and if 8 test packets are returned, the packet loss rate corresponding to the data transmission channel is 20%, and the average RTT of the 8 test packets is the RTT value corresponding to the data transmission channel.
312. The responder acquires at least one of a second RTT and a second packet loss rate of the plurality of data transmission channels.
Specifically, the manner in which the responder obtains at least one of the second RTT and the second packet loss rate of the multiple data transmission channels is the same as the manner in which the initiator obtains at least one of the first round trip delay RTT and the first packet loss rate of the multiple data transmission channels in step 311, and details are not repeated here.
313. The initiator calculates an RTT component according to the first RTT and the second RTT;
specifically, the initiator acquires the second RTTs of the multiple data transmission channels acquired by the responder, and the acquisition mode may be that the responder forwards the second RTTs to the initiator through a TCP server;
calculating an RTT component according to the first RTT and the second RTT by using a first preset formula, where the first preset formula may be:
x=x1+x2
wherein, in the formula, r is RTT component, x1Is the first RTT, x2Is the second RTT, a1、a2、a3、a4And a5Respectively are preset coefficients, in practical application, a1May have a value of 100, a2May have a value of 30, a3May have a value of 300, a4May have a value of 30000, a5May have a value of 3000.
The first preset formula is only exemplary, and the specific preset formula is not limited in the embodiment of the present invention.
314. The initiator calculates a packet loss rate component according to the first packet loss rate and the second packet loss rate;
specifically, the initiator obtains a second packet loss rate of the plurality of data transmission channels obtained by the responder, and the obtaining mode may be that the responder forwards the second packet loss rate to the initiator through a TCP server;
calculating a packet loss component according to the first packet loss rate and a second packet loss rate by using a second preset formula, where the second preset formula may be:
l=b1×(1-y)2
y=1-(1-y1)×(1-y2)
where l is the packet loss component, y1Is the first packet loss rate, y2Is the second packet loss rate, b1For the purpose of presetting the coefficients, in practical applications, b1May have a value of 100.
The second preset formula is only exemplary, and the specific preset formula is not limited in the embodiment of the present invention.
315. The initiator acquires a data transmission channel, of which at least one of an RTT component and a packet loss rate component in a plurality of data transmission channels meets a preset condition.
Specifically, a data transmission channel in which at least one of RTT components and packet loss rate components in the multiple data transmission channels meets a preset condition is obtained through a third preset formula, where the third preset formula may be:
s=a×r+b×l
wherein s is a score, r is an RTT component, l is a packet loss component, a is a weight of r, and b is a weight of l, in practical application, a may be 0.3, and b may be 0.7;
the data transmission channel satisfying the preset condition may be at least one data transmission channel having a score s greater than or equal to a score threshold value.
Because the RTT and the packet loss rate of the data transmission channel describe the data transmission capability of the data transmission channel, when the RTT and the packet loss rate are small, the data transmission efficiency is high, and the data loss is small, so that the reliability and the efficiency of data transmission are further ensured by obtaining the data transmission channel in which at least one of the RTT component and the packet loss rate component in the plurality of data transmission channels meets the preset condition.
316. And the sender sends data to the responder according to the information of at least one data transmission channel meeting the preset conditions, and the process is finished.
Specifically, the embodiment of the present invention does not limit the specific sending process.
It should be noted that steps 311 to 316 are processes of implementing that the initiator sends data to the responder according to information of at least one data transmission channel satisfying a preset condition in a plurality of data transmission channels, and besides the manners described in the steps, the processes may also be implemented in other manners, and a specific manner is not limited in the embodiment of the present invention.
Optionally, in addition to the manners described in steps 311 to 316, a process of sending data to the responder by the initiator according to information of at least one data transmission channel satisfying a preset condition in the plurality of data transmission channels may be implemented by:
the initiator acquires at least one of first round trip time RTT and first packet loss rate of a plurality of data transmission channels;
specifically, the obtaining method is the same as the obtaining method described in step 311, and is not described herein again.
The initiator calculates an RTT component according to the first RTT;
specifically, calculating an RTT component according to the first RTT by a fourth preset formula; the fourth predetermined formula may be:
wherein, in the formula, r is RTT component, x is first RTT, a1、a2、a3、a4And a5Respectively are preset coefficients, in practical application, a1May have a value of 100, a2May have a value of 30, a3May have a value of 300, a4May have a value of 30000, a5May have a value of 3000.
The initiator calculates a packet loss rate component according to the first packet loss rate;
specifically, calculating a packet loss rate component according to the first packet loss rate through a fifth preset formula; the fifth predetermined formula may be;
l=b1×(1-y)2
wherein, in the formula, l is a packet loss component, y is a first packet loss, b1For the purpose of presetting the coefficients, in practical applications, b1May have a value of 100.
The initiator acquires a data transmission channel, of which at least one of an RTT component and a packet loss rate component in a plurality of data transmission channels meets a preset condition.
Specifically, a data transmission channel in which at least one of the RTT component and the packet loss rate component in the multiple data transmission channels meets the preset condition is obtained through a third preset formula, which is the same as the method described in step 315, and is not described here again.
In addition to the two manners, the process of the initiator sending data to the responder according to the information of at least one data transmission channel satisfying the preset condition in the plurality of data transmission channels may also be implemented in other manners.
317, when the initiator receives the information of the P2P channel transmitted from the UDP server, the initiator transmits data to the responder through the P2P channel, and the process is ended.
Specifically, the embodiment of the present invention does not limit the specific sending process.
It should be noted that step 317 is an optional step, and in practical applications, after step 310, step 311 may be directly performed without performing step 317; in addition, in the embodiment of the present invention, if step 307 to step 308 are executed before step 310, step 317 is executed after step 310.
In practical applications, a flowchart of the data transmission channel establishing method provided by the embodiment of the present invention may also be shown in fig. 4.
The embodiment of the invention provides a data transmission channel establishing method, wherein before data transmission, a plurality of UDP server initiators and responders respectively establish data transmission channels in advance according to a transmitted channel establishing request, and compared with the data transmission channel establishment during data transmission, the data transmission channel establishing method avoids the time for waiting for the data channel establishment in the data transmission process, thereby improving the data transmission efficiency and improving the user experience. In addition, compared with the data transmission through one channel, the data transmission channels are replaced when the transmission speed and the reliability of a partial channel network are poor, the data loss is avoided, the reliability of data transmission is improved, and the user experience is improved. In addition, because the network parameters of the UDP server describe the data processing capability of the UDP server, the network state of the network link between the UDP server and the initiator, and the network state of the network link between the UDP server and the responder, the TCP server obtains a plurality of UDP servers satisfying the preset conditions from all available UDP servers according to the network parameters, thereby avoiding data transmission interruption or data loss caused by poor data processing capability of the UDP server, network state of the network link between the UDP server and the initiator, and network state of the network link between the UDP server and the responder in the data transmission process, and further ensuring reliability and efficiency of data transmission. In addition, because the RTT and the packet loss rate of the data transmission channel describe the data transmission capability of the data transmission channel, when the RTT and the packet loss rate are small, the data transmission efficiency is high, and the data loss is small, so that the reliability and efficiency of data transmission are further ensured by obtaining a data transmission channel in which at least one of RTT components and packet loss rate components in a plurality of data transmission channels meets a preset condition. In addition, because the reliability of data transmission through the P2P channel is higher than that of data transmission through server relay, the efficiency of data transmission is higher, and meanwhile, data transmission interruption or data loss caused by the fault of intermediate routing equipment during data transmission through server relay can be avoided, the UDP server determines whether a point-to-point P2P channel can be established between the initiator and the responder, so that when the point-to-point P2P channel can be established between the initiator and the responder, data transmission is performed through the P2P channel, thereby further ensuring the reliability and efficiency of data transmission.
An embodiment four is a method for establishing a data transmission channel according to an embodiment of the present invention, and as shown in fig. 5, the method includes:
501. the TCP server receives the establishment request sent by the initiator and sends the establishment request to the responder.
Specifically, the step is the same as step 301, and is not described herein again.
502. And when the TCP server receives the acceptance response message sent by the responder, the TCP server sends the acceptance response message to the initiator.
Specifically, after receiving the establishment request, the responder sends an acceptance response message to the server to indicate that the responder receives the establishment request.
The server receives the acceptance response message sent by the responder.
Optionally, in practical application, if the server does not receive the acceptance response message sent by the responder within the preset time, the establishment request may be sent to the responder again until the acceptance response message sent by the responder is received.
503. The TCP server obtains the network parameters of all available UDP servers.
Specifically, the step is the same as step 303, and is not described herein again.
504. And the TCP server acquires a plurality of UDP servers meeting preset conditions from all available UDP servers according to the network parameters.
Specifically, the step is the same as step 304, and is not described herein again.
It should be noted that steps 503 to 504 are processes for implementing that the TCP server obtains information of a plurality of user datagram protocol UDP servers meeting a preset condition, and besides the manners described in the steps, the processes may also be implemented in other manners, and a specific manner is not limited in the embodiment of the present invention.
Because the network parameters of the UDP server describe the data processing capacity of the UDP server, the network state of the network link between the UDP server and the initiator and the network state of the network link between the UDP server and the responder, the TCP server obtains a plurality of UDP servers meeting preset conditions from all available UDP servers according to the network parameters, thereby avoiding data transmission interruption or data loss caused by poor data processing capacity of the UDP server, the network state of the network link between the UDP server and the initiator and the network state of the network link between the UDP server and the responder in the data transmission process, and further ensuring the reliability and efficiency of data transmission.
505. The TCP server sends information of a plurality of UDP servers to the initiator and the responder.
Specifically, the step is the same as step 305, and is not described herein again.
It should be noted that steps 503 to 505 are processes for implementing a process in which the TCP server sends information of a plurality of UDP servers to the initiator and the responder, and the processes may be implemented in other ways besides the ways described in the steps, and the specific ways are not limited in the embodiment of the present invention.
506. The UDP server determines whether a peer-to-peer P2P channel can be established between the initiator and the responder, and if so, performs step 507; otherwise, step 508 is performed.
Specifically, the step is the same as step 307, and is not described again here.
It should be noted that steps 506 to 507 are optional steps, and in practical applications, after step 505, step 508 may be directly performed without performing steps 506 to 507.
Compared with data transmission through server transfer, the data transmission through the P2P channel has higher reliability and higher data transmission efficiency, and meanwhile, the data transmission interruption or data loss caused by the fault of intermediate routing equipment during the data transmission through the server transfer can be avoided, so that the UDP server judges whether a point-to-point P2P channel can be established between an initiator and a responder, so that when the point-to-point P2P channel can be established between the initiator and the responder, the data transmission is carried out through the P2P channel, and the reliability and the efficiency of the data transmission are further ensured.
507. The UDP server establishes a P2P channel between the initiator and the responder and sends the information of the P2P channel to the initiator and the responder.
Specifically, the step is the same as the step 308, and is not described again here.
508. The plurality of UDP servers respectively establish a plurality of data transmission channels.
Specifically, the step is the same as step 309, and is not described again here.
509. If the TCP server receives the second response message sent by the responder, the TCP server sends the second response message to the initiator, and after step 509, any one of step 510 and step 516 is executed.
Specifically, the steps are the same as step 310, and are not described again here.
510. The initiator acquires at least one of a first Round Trip Time (RTT) and a first packet loss rate of a plurality of data transmission channels.
Specifically, the step is the same as step 311, and is not described again here.
511. The responder acquires at least one of a second RTT and a second packet loss rate of the plurality of data transmission channels.
Specifically, the step is the same as step 312, and is not described again here.
512. And the initiator calculates the RTT component according to the first RTT and the second RTT.
Specifically, the steps are the same as step 313, and are not described again here.
513. And the initiator calculates the packet loss rate component according to the first packet loss rate and the second packet loss rate.
Specifically, the step is the same as step 314, and is not described again here.
514. The initiator acquires a data transmission channel, of which at least one of an RTT component and a packet loss rate component in a plurality of data transmission channels meets a preset condition.
Specifically, the step is the same as step 315, and is not described again here.
Because the RTT and the packet loss rate of the data transmission channel describe the data transmission capability of the data transmission channel, when the RTT and the packet loss rate are small, the data transmission efficiency is high, and the data loss is small, so that the reliability and the efficiency of data transmission are further ensured by obtaining the data transmission channel in which at least one of the RTT component and the packet loss rate component in the plurality of data transmission channels meets the preset condition.
515. And the sender sends data to the responder according to the information of at least one data transmission channel meeting the preset conditions, and the process is finished.
Specifically, the step is the same as step 316, and is not described again here.
It should be noted that steps 510 to 515 are processes of implementing the initiator sending data to the responder according to information of at least one data transmission channel satisfying a preset condition in a plurality of data transmission channels, and besides the manners described in the steps, the processes may be implemented in other manners, and a specific manner is not limited in the embodiment of the present invention.
Optionally, in addition to the manners described in steps 510 to 515, a process of sending data to the responder by the initiator according to information of at least one data transmission channel satisfying a preset condition in the plurality of data transmission channels may be implemented by:
the initiator acquires at least one of first round trip time RTT and first packet loss rate of a plurality of data transmission channels;
the initiator calculates an RTT component according to the first RTT;
the initiator calculates a packet loss rate component according to the first packet loss rate;
the initiator acquires a data transmission channel, of which at least one of an RTT component and a packet loss rate component in a plurality of data transmission channels meets a preset condition.
In addition to the two manners, the process of the initiator sending data to the responder according to the information of at least one data transmission channel satisfying the preset condition in the plurality of data transmission channels may also be implemented in other manners.
516, when the initiator receives the information of the P2P tunnel transmitted from the UDP server, the initiator transmits data to the responder through the P2P tunnel, and the process is terminated.
Specifically, the step is the same as the step 317, and is not described herein again.
It should be noted that step 516 is an optional step, and in practical applications, after step 509, step 510 may be directly performed without performing step 516; in addition, in the embodiment of the present invention, if step 506 to step 507 are performed before step 509, step 516 is performed after step 509.
In practical applications, a flowchart of the data transmission channel establishing method provided by the embodiment of the present invention may also be shown in fig. 6.
The embodiment of the invention provides a data transmission channel establishing method, wherein before data transmission, a plurality of UDP server initiators and responders respectively establish data transmission channels in advance according to a transmitted channel establishing request, and compared with the data transmission channel establishment during data transmission, the data transmission channel establishing method avoids the time for waiting for the data channel establishment in the data transmission process, thereby improving the data transmission efficiency and improving the user experience. In addition, compared with the data transmission through one channel, the data transmission channels are replaced when the transmission speed and the reliability of a partial channel network are poor, the data loss is avoided, the reliability of data transmission is improved, and the user experience is improved. In addition, because the network parameters of the UDP server describe the data processing capability of the UDP server, the network state of the network link between the UDP server and the initiator, and the network state of the network link between the UDP server and the responder, the TCP server obtains a plurality of UDP servers satisfying the preset conditions from all available UDP servers according to the network parameters, thereby avoiding data transmission interruption or data loss caused by poor data processing capability of the UDP server, network state of the network link between the UDP server and the initiator, and network state of the network link between the UDP server and the responder in the data transmission process, and further ensuring reliability and efficiency of data transmission. In addition, because the RTT and the packet loss rate of the data transmission channel describe the data transmission capability of the data transmission channel, when the RTT and the packet loss rate are small, the data transmission efficiency is high, and the data loss is small, so that the reliability and efficiency of data transmission are further ensured by obtaining a data transmission channel in which at least one of RTT components and packet loss rate components in a plurality of data transmission channels meets a preset condition. In addition, because the reliability of data transmission through the P2P channel is higher than that of data transmission through server relay, the efficiency of data transmission is higher, and meanwhile, data transmission interruption or data loss caused by the fault of intermediate routing equipment during data transmission through server relay can be avoided, the UDP server determines whether a point-to-point P2P channel can be established between the initiator and the responder, so that when the point-to-point P2P channel can be established between the initiator and the responder, data transmission is performed through the P2P channel, thereby further ensuring the reliability and efficiency of data transmission.
Fifth embodiment is a server provided in an embodiment of the present invention, and as shown in fig. 7, the server includes:
the relay module 71 is configured to receive an establishment request sent by an initiator, and send the establishment request to a responder;
a sending module 72, configured to send information of multiple UDP servers to the initiator and the responder after the forwarding module receives a first response message indicating that the responder receives the establishment request;
the relay module 71 is further configured to send a second response message to the initiator when receiving the second response message sent by the responder, so that the initiator sends data to the responder according to information of at least one data transmission channel satisfying a preset condition in the plurality of data transmission channels;
the plurality of data transmission channels are respectively established by the plurality of UDP servers after the initiator and the responder send channel establishment requests to the plurality of UDP servers.
Optionally, the server includes a transmission control protocol TCP server, and the sending module 72 specifically includes:
an obtaining sub-module 721, configured to obtain information of multiple UDP servers meeting a preset condition;
the sending submodule 722 is configured to send information of a plurality of UDP servers to the initiator and the responder.
Optionally, the obtaining sub-module 721 is specifically configured to:
acquiring network parameters of all available UDP servers;
and acquiring a plurality of UDP servers meeting preset conditions from all available UDP servers according to the network parameters.
The embodiment of the invention provides a server, wherein before data transmission, a plurality of UDP (user Datagram protocol) server initiators and responders respectively establish data transmission channels in advance according to sent channel establishment requests, and compared with the method for establishing the data transmission channels during data transmission, the method avoids the time for waiting for establishing the data channels in the data transmission process, thereby improving the data transmission efficiency and improving the user experience. In addition, compared with the data transmission through one channel, the data transmission channels are replaced when the transmission speed and the reliability of a partial channel network are poor, the data loss is avoided, the reliability of data transmission is improved, and the user experience is improved.
Sixth embodiment is a server according to an embodiment of the present invention, and as shown in fig. 8, the server includes a memory 81, a network interface module 82, and a processor 83 connected to the memory 81 and the network interface module 82, where the memory 81 is configured to store a set of program codes, and the processor 83 calls the program codes stored in the memory 81 to perform the following operations:
the control network interface module 82 receives the establishment request sent by the initiator and sends the establishment request to the responder;
after receiving a first response message indicating that the responder received the setup request, the control network interface module 82;
sending information of a plurality of User Datagram Protocol (UDP) servers to an initiator and a responder;
when receiving a second response message sent by the responder, the control network interface module 82 sends the second response message to the initiator, so that the initiator sends data to the responder according to information of at least one data transmission channel meeting preset conditions in the plurality of data transmission channels;
the plurality of data transmission channels are respectively established by the plurality of UDP servers after the initiator and the responder send channel establishment requests to the plurality of UDP servers.
Optionally, the server comprises a transmission control protocol TCP server, and the processor 82 calls the program code stored in the memory 81 to perform the following operations:
acquiring information of a plurality of User Datagram Protocol (UDP) servers meeting preset conditions;
and sending information of a plurality of UDP servers to the initiator and the responder.
Optionally, the processor 82 calls the program code stored in the memory 81 for performing the following operations:
acquiring network parameters of all available UDP servers;
and acquiring a plurality of UDP servers meeting preset conditions from all available UDP servers according to the network parameters.
The embodiment of the invention provides a server, wherein before data transmission, a plurality of UDP (user Datagram protocol) server initiators and responders respectively establish data transmission channels in advance according to sent channel establishment requests, and compared with the method for establishing the data transmission channels during data transmission, the method avoids the time for waiting for establishing the data channels in the data transmission process, thereby improving the data transmission efficiency and improving the user experience. In addition, compared with the data transmission through one channel, the data transmission channels are replaced when the transmission speed and the reliability of a partial channel network are poor, the data loss is avoided, the reliability of data transmission is improved, and the user experience is improved.
Seventh embodiment is a server according to an embodiment of the present invention, and as shown in fig. 9, the server includes:
the relay module 91 is configured to receive an establishment request sent by an initiator, and send the establishment request to a responder;
the sending module 92 is configured to send the acceptance response message to the initiator and send information of a plurality of UDP servers to the initiator and the responder when the relay module receives the acceptance response message sent by the responder.
Optionally, the server includes a transmission control protocol TCP server, and the sending module 92 specifically includes:
the obtaining sub-module 921 is configured to obtain information of a plurality of UDP servers meeting a preset condition;
the sending submodule 922 is configured to send information of multiple UDP servers to the initiator and the responder.
Optionally, the obtaining sub-module 921 is specifically configured to:
acquiring network parameters of all available UDP servers;
and acquiring a plurality of User Datagram Protocol (UDP) servers meeting preset conditions from all available UDP servers according to the network parameters.
The embodiment of the invention provides a server, wherein before data transmission, a plurality of UDP (user Datagram protocol) server initiators and responders respectively establish data transmission channels in advance according to sent channel establishment requests, and compared with the method for establishing the data transmission channels during data transmission, the method avoids the time for waiting for establishing the data channels in the data transmission process, thereby improving the data transmission efficiency and improving the user experience. In addition, compared with the data transmission through one channel, the data transmission channels are replaced when the transmission speed and the reliability of a partial channel network are poor, the data loss is avoided, the reliability of data transmission is improved, and the user experience is improved.
Eighth embodiment is a server according to an embodiment of the present invention, and as shown in fig. 10, the server includes a memory 101, a network interface module 102, and a processor 103 connected to the memory 101 and the network interface module 102, where the memory 101 is configured to store a set of program codes, and the processor 103 calls the program codes stored in the memory 101 to perform the following operations:
the control network interface module 102 receives an establishment request sent by an initiator and sends the establishment request to a responder;
when receiving the acceptance response message sent by the responder, the control network interface module 102 sends the acceptance response message to the initiator, and sends information of a plurality of User Datagram Protocol (UDP) servers to the initiator and the responder.
Optionally, the server comprises a TCP server, and the processor 102 calls the program code stored in the memory 101 to perform the following operations:
acquiring information of a plurality of User Datagram Protocol (UDP) servers meeting preset conditions;
and sending information of a plurality of UDP servers to the initiator and the responder.
Optionally, the processor 102 calls the program code stored in the memory 101 for performing the following operations:
acquiring network parameters of all available UDP servers;
and acquiring a plurality of User Datagram Protocol (UDP) servers meeting preset conditions from all available UDP servers according to the network parameters.
The embodiment of the invention provides a server, wherein before data transmission, a plurality of UDP (user Datagram protocol) server initiators and responders respectively establish data transmission channels in advance according to sent channel establishment requests, and compared with the method for establishing the data transmission channels during data transmission, the method avoids the time for waiting for establishing the data channels in the data transmission process, thereby improving the data transmission efficiency and improving the user experience. In addition, compared with the data transmission through one channel, the data transmission channels are replaced when the transmission speed and the reliability of a partial channel network are poor, the data loss is avoided, the reliability of data transmission is improved, and the user experience is improved.
Ninth embodiment of the present invention is a data transmission channel establishing system provided in the embodiment of the present invention, and as shown in fig. 11, the system includes a server 111, an initiator 112, an responder 113, and a plurality of UDP servers 114, where:
the server 111 includes:
the relay module 1111 is configured to receive the establishment request sent by the initiator 112, and send the establishment request to the responder 113;
a first sending module 1112, configured to send, when the transit module receives a first response message sent by the responder 113, where the first response message is used to indicate that the responder 113 receives the establishment request, information of a plurality of UDP servers to the initiator 112 and the responder;
the initiator 112 and the responder 113 respectively include a second sending module 1121 and a third sending module 1131, where the second sending module 1121 and the third sending module 1131 are configured to send a channel establishment request to a plurality of UDP servers;
the plurality of UDP servers 114 respectively include a plurality of channel establishing modules 1141, which are respectively used for establishing a plurality of data transmission channels;
the transit module 1111 is further configured to send a second response message to the initiator 112 when receiving the second response message sent by the responder 113;
the second sending module 1121 is further configured to send data to the responder 113 according to information of at least one data transmission channel satisfying a preset condition in the plurality of data transmission channels.
Optionally, the server 111 includes a TCP server, and the first sending module 1112 includes:
an obtaining sub-module 11121, configured to obtain information of multiple UDP servers 114 meeting a preset condition;
a first sending sub-module 11122, configured to send information of a plurality of UDP servers 114 to the initiator 112 and the responder 113.
Optionally, the obtaining sub-module 11121 is specifically configured to:
acquiring network parameters of all available UDP servers;
according to the network parameters, a plurality of UDP servers 114 meeting preset conditions are obtained from all available UDP servers.
Optionally, the initiator 112 further includes a processing module 1122, and the processing module 1122 is configured to perform any one of the following operations:
obtaining at least one of a first Round Trip Time (RTT) and a first packet loss rate of a plurality of data transmission channels;
calculating an RTT component according to the first RTT;
calculating a packet loss rate component according to the first packet loss rate;
and acquiring a data transmission channel of which at least one of RTT (round trip time) components and packet loss rate components in the plurality of data transmission channels meets a preset condition. Or
Obtaining at least one of a first Round Trip Time (RTT) and a first packet loss rate of a plurality of data transmission channels;
acquiring at least one of a second RTT and a second packet loss rate of the plurality of data transmission channels acquired by the responder 113;
calculating an RTT component according to the first RTT and the second RTT;
calculating a packet loss rate component according to the first packet loss rate and a second packet loss rate, wherein the second RTT and the second packet loss rate are forwarded to the initiator by the responder through the TCP server;
and acquiring a data transmission channel of which at least one of RTT (round trip time) components and packet loss rate components in the plurality of data transmission channels meets a preset condition.
Optionally, UDP server 114 further includes:
a processing submodule 1142 configured to determine whether a peer-to-peer P2P channel can be established between the initiator 112 and the responder 113;
the processing submodule 1142 is further configured to establish a P2P channel between the initiator and the responder when it is determined that a peer-to-peer P2P channel can be established between the initiator 112 and the responder 113;
and a second sending submodule 1143, configured to send information of the P2P channel to the initiator 112 and the responder 113.
Alternatively to this, the first and second parts may,
the initiator 112 further comprises a receiving module 1123, and the second sending module 1121 is further configured to send data to the responder 113 through a P2P channel when the receiving module 1123 receives the information of the P2P channel sent by the UDP server.
The embodiment of the invention provides a data transmission channel establishing system, wherein before data transmission, a plurality of UDP server initiators and responders respectively establish data transmission channels in advance according to transmitted channel establishing requests, and compared with the data transmission channel establishing method during data transmission, the data transmission channel establishing method avoids the time for waiting for the data channel establishment in the data transmission process, thereby improving the data transmission efficiency and improving the user experience. In addition, compared with the data transmission through one channel, the data transmission channels are replaced when the transmission speed and the reliability of a partial channel network are poor, the data loss is avoided, the reliability of data transmission is improved, and the user experience is improved.
Tenth embodiment is a system for establishing a data transmission channel provided by an embodiment of the present invention, and as shown in fig. 12, the system includes a server 121, an initiator 122, a responder 123, and a plurality of UDP servers 124, where:
the server 121 includes:
a transit module 1211, configured to receive the establishment request sent by the initiator 122, and send the establishment request to the responder 123;
a first sending module 1212, configured to send, when the transit module receives the acceptance response message sent by the responder 123, the acceptance response message to the initiator 122, and send information of the plurality of UDP servers 124 to the initiator 122 and the responder 123;
the initiator 122 and the responder 123 respectively include a second sending module 1221 and a third sending module 1231, where the second sending module 1221 and the third sending module are respectively configured to send a channel establishment request to the plurality of UDP servers 124;
the plurality of UDP servers 124 respectively include a plurality of channel establishing modules 1241 for establishing a plurality of data transmission channels;
the second sending module 1221 is further configured to send data to the responder 123 according to information of at least one data transmission channel satisfying a preset condition in the multiple data transmission channels.
Optionally, the server 121 includes a TCP server, and the first sending module 1212 includes:
an obtaining sub-module 12121, configured to obtain information of a plurality of UDP servers meeting a preset condition;
a sending submodule 12122 is configured to send information of the plurality of UDP servers to the initiator 122 and the responder 123.
Optionally, the obtaining sub-module 12121 is specifically configured to:
acquiring network parameters of all available UDP servers;
according to the network parameters, a plurality of UDP servers 124 satisfying a preset condition are obtained from all available UDP servers.
Optionally, the initiator further comprises a processing module 1222, and the processing module 1222 is configured to perform any one of the following operations:
obtaining at least one of a first Round Trip Time (RTT) and a first packet loss rate of a plurality of data transmission channels;
calculating an RTT component according to the first RTT;
calculating a packet loss rate component according to the first packet loss rate;
and acquiring a data transmission channel of which at least one of RTT (round trip time) components and packet loss rate components in the plurality of data transmission channels meets a preset condition. Or
Obtaining at least one of a first Round Trip Time (RTT) and a first packet loss rate of a plurality of data transmission channels;
acquiring at least one of a second RTT and a second packet loss rate of the multiple data transmission channels acquired by the responder 123;
calculating an RTT component according to the first RTT and the second RTT;
calculating a packet loss rate component according to the first packet loss rate and a second packet loss rate, wherein the second RTT and the second packet loss rate are forwarded to the initiator by the responder through the TCP server;
and acquiring a data transmission channel of which at least one of RTT (round trip time) components and packet loss rate components in the plurality of data transmission channels meets a preset condition.
Optionally, the UDP server 124 further includes:
a processing submodule 1242, configured to determine whether a peer-to-peer P2P channel can be established between the initiator 122 and the responder 123;
the processing submodule 1242 is further configured to establish a P2P channel between the initiator and the responder when it is determined that a peer-to-peer P2P channel can be established between the initiator 112 and the responder 113;
and a second sending submodule 1243, configured to send information of the P2P channel to the initiator 122 and the responder 123.
Alternatively to this, the first and second parts may,
the initiator 122 further includes a receiving module 1223, and the second sending module 1221 is further configured to send data to the responder 123 through the P2P channel when the receiving module 1223 receives the information of the P2P channel sent by the UDP server.
The embodiment of the invention provides a data transmission channel establishing system, wherein before data transmission, a plurality of UDP server initiators and responders respectively establish data transmission channels in advance according to transmitted channel establishing requests, and compared with the data transmission channel establishing method during data transmission, the data transmission channel establishing method avoids the time for waiting for the data channel establishment in the data transmission process, thereby improving the data transmission efficiency and improving the user experience. In addition, compared with the data transmission through one channel, the data transmission channels are replaced when the transmission speed and the reliability of a partial channel network are poor, the data loss is avoided, the reliability of data transmission is improved, and the user experience is improved.
All the above-mentioned optional technical solutions can be combined arbitrarily to form the optional embodiments of the present invention, and are not described herein again.
It should be noted that: in the data transmission channel establishing system and the server provided in the foregoing embodiments, when executing the data transmission channel establishing method, only the division of the functional modules is illustrated, and in practical applications, the function distribution may be completed by different functional modules according to needs, that is, the internal structures of the server and the system are divided into different functional modules, so as to complete all or part of the functions described above. In addition, the data transmission channel establishing system, the data transmission channel establishing method, and the server embodiment provided in the above embodiments belong to the same concept, and specific implementation processes thereof are described in the method embodiments in detail and are not described herein again.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.