Data transmission using connection-less and connection-oriented transmission layer protocols
View Patent ↗A data transmission method is provided, including: generating session offers of a communication session, and sending the session offers to a destination end based on a connectionless-oriented transmission layer protocol and a connection-oriented transmission layer protocol respectively; determining, based on transmission statuses of session answers fed back by the destination end for the session offers, respective connectivity detection results of a connectionless transmission channel and a connection transmission channel of the communication session; establishing a data transmission channel to the destination end based on the connectivity detection results; and transmitting session data of the communication session with the destination end through the data transmission channel.
1 . A data transmission method for real-time communications over a computer network, executed by a computer device, and the method comprising:
generating session offers of a network communication session;
transmitting the session offers to a destination end based on a connectionless-oriented transmission layer protocol and a connection-oriented transmission layer protocol respectively, the transmitting including:
encapsulating the session offer into first interaction signaling based on the connectionless-oriented transmission layer protocol;
encapsulating the session offer into second interaction signaling based on the connection-oriented transmission layer protocol; and
transmitting the first interaction signaling to the destination end by using the connectionless-oriented transmission layer protocol, and transmitting the second interaction signaling to the destination end by using the connection-oriented transmission layer protocol;
determining, based on transmission statuses of session answers fed back by the destination end responsive to the session offers, respective connectivity detection results of a connectionless transmission channel and a connection transmission channel of the communication session, wherein the determining includes:
determining that a session answer fed back by the destination end for the first interaction signaling is only received through the connectionless-oriented transmission layer protocol, and responsive to the determining that a session answer fed back by the destination end for the first interaction signaling is only received through the connectionless-oriented transmission layer protocol, storing a destination end candidate address that is used to transmit session data and that is in the session answer, and
determining that the connectionless transmission channel of the communication session is in a connected state; or
determining that a session answer fed back by the destination end for the second interaction signaling is only received through the connection-oriented transmission layer protocol, and responsive to the determining that a session answer fed back by the destination end for the second interaction signaling is only received through the connection-oriented transmission layer protocol, storing a destination end candidate address that is used to transmit the session data and that is in the session answer, and determining that the connection transmission channel of the communication session is in a connected state;
establishing a data transmission channel to the destination end based on the connectivity detection results; and
transmitting the session data of the communication session with the destination end through the data transmission channel.
2 . The method according to claim 1 , wherein the generating session offers of a communication session comprises:
creating the communication session in response to a trigger operation of pulling a media stream from a server;
obtaining session description information of the communication session; and
generating the session offers of the communication session based on the session description information.
3 . The method according to claim 1 , wherein the transmitting the session offers to a destination end based on a connectionless-oriented transmission layer protocol and a connection-oriented transmission layer protocol respectively comprises:
compressing the session offers to obtain binary data; and
transmitting the binary data to the destination end based on the connectionless-oriented transmission layer protocol and the connection-oriented transmission layer protocol respectively.
4 . The method according to claim 1 , wherein the establishing a data transmission channel to the destination end based on the connectivity detection results comprises:
determining that the connectionless transmission channel of the communication session is in the connected state, and responsive to the determining that the connectionless transmission channel of the communication session is in the connected state, initiating, based on a candidate address combination formed by a first address in a source end candidate address and a second address in the destination end candidate address, a connection check request of the candidate address combination; and
upon receiving a connection check response fed back by the destination end in response to the connection check request, establishing a connectionless-oriented data transmission channel to the destination end based on the candidate address combination.
5 . The method according to claim 1 , wherein the establishing a data transmission channel to the destination end based on the connectivity detection results comprises:
determining that the connection transmission channel of the communication session is in the connected state, and responsive to the determining that the connection transmission channel of the communication session is in the connected state, initiating, based on a candidate address combination formed by a first address in a source end candidate address and a second address in the destination end candidate address, a connection check request of the candidate address combination; and
upon receiving a connection check response fed back by the destination end in response to the connection check request, establishing a connection-oriented data transmission channel to the destination end based on the candidate address combination.
6 . The method according to claim 1 , wherein the determining, based on transmission statuses of session answers fed back by the destination end for the session offers, respective connectivity detection results of a connectionless transmission channel and a connection transmission channel of the communication session comprises:
after receiving the session answer fed back by the destination end for the first interaction signaling by using the connectionless-oriented transmission layer protocol, and storing a destination end candidate address that is used to transmit the session data and that is in the session answer:
determining that a candidate address is fed back by the destination end for the second interaction signaling by using the connection-oriented transmission layer protocol; and
responsive to the determining that a candidate address is fed back by the destination end for the second interaction signaling by using the connection-oriented transmission layer protocol, storing the fed back candidate address, and determining that both the connectionless transmission channel and the connection transmission channel of the communication session are in a connected state.
7 . The method according to claim 1 , wherein the session answers are compressed into binary data.
8 . The method according to claim 1 , wherein the session answer is encapsulated into third interaction signaling based on the connectionless-oriented transmission layer protocol;
the session answer is encapsulated into fourth interaction signaling based on the connection-oriented transmission layer protocol;
wherein the third interaction signaling is received via the connectionless-oriented transmission layer protocol; and
wherein the fourth interaction signaling is received via the connection-oriented transmission layer protocol.
9 . A data transmission apparatus for real-time communications over a computer network, the data transmission apparatus comprising:
a processor; and
memory storing computer-readable instructions that, when executed, cause the data transmission apparatus to:
generate session offers of a communication session;
transmit the session offers to a destination end based on a connectionless-oriented transmission layer protocol and a connection-oriented transmission layer protocol respectively, the transmitting including:
encapsulating the session offer into first interaction signaling based on the connectionless-oriented transmission layer protocol;
encapsulating the session offer into second interaction signaling based on the connection-oriented transmission layer protocol; and
transmitting the first interaction signaling to the destination end by using the connectionless-oriented transmission layer protocol, and transmitting the second interaction signaling to the destination end by using the connection-oriented transmission layer protocol;
determine, based on transmission statuses of session answers fed back by the destination end responsive to the session offers, respective connectivity detection results of a connectionless transmission channel and a connection transmission channel of the communication session, wherein the determining includes:
determining that a session answer fed back by the destination end for the first interaction signaling is only received through the connectionless-oriented transmission layer protocol, and responsive to the determining that a session answer fed back by the destination end for the first interaction signaling is only received through the connectionless-oriented transmission layer protocol, storing a destination end candidate address that is used to transmit session data and that is in the session answer, and determining that the connectionless transmission channel of the communication session is in a connected state; or
determining that a session answer fed back by the destination end for the second interaction signaling is only received through the connection-oriented transmission layer protocol, and responsive to the determining that a session answer fed back by the destination end for the second interaction signaling is only received through the connection-oriented transmission layer protocol, storing a destination end candidate address that is used to transmit the session data and that is in the session answer, and determining that the connection transmission channel of the communication session is in a connected state;
establish a data transmission channel to the destination end based on the connectivity detection results; and
transmit the session data of the communication session with the destination end through the data transmission channel.
10 . The data transmission apparatus according to claim 9 , wherein the data transmission apparatus is further caused to: compress the session offers, to obtain binary data; and transmit the binary data to the destination end based on the connectionless-oriented transmission layer protocol and the connection-oriented transmission layer protocol respectively.
11 . The data transmission apparatus according to claim 9 , wherein the establishing a data transmission channel to the destination end based on the connectivity detection results comprises:
determining that the connectionless transmission channel of the communication session is in the connected state, and responsive to the determining that the connectionless transmission channel of the communication session is in the connected state, initiating, based on a candidate address combination formed by a first address in a source end candidate address and a second address in the destination end candidate address, a connection check request of the candidate address combination; and
upon receiving a connection check response fed back by the destination end in response to the connection check request, establishing a connectionless-oriented data transmission channel to the destination end based on the candidate address combination.
12 . The data transmission apparatus according to claim 9 , wherein the generating session offers of a communication session comprises:
creating the communication session in response to a trigger operation of pulling a media stream from a server;
obtaining session description information of the communication session; and
generating the session offers of the communication session based on the session description information.
13 . The data transmission apparatus according to claim 9 , wherein the establishing a data transmission channel to the destination end based on the connectivity detection results comprises:
determining that the connection transmission channel of the communication session is in the connected state, and responsive to the determining that the connection transmission channel of the communication session is in the connected state, initiating, based on a candidate address combination formed by a first address in a source end candidate address and a second address in the destination end candidate address, a connection check request of the candidate address combination; and
upon receiving a connection check response fed back by the destination end in response to the connection check request, establishing a connection-oriented data transmission channel to the destination end based on the candidate address combination.
14 . The data transmission apparatus according to claim 9 , wherein the determining, based on transmission statuses of session answers fed back by the destination end for the session offers, respective connectivity detection results of a connectionless transmission channel and a connection transmission channel of the communication session comprises:
after receiving the session answer fed back by the destination end for the first interaction signaling by using the connectionless-oriented transmission layer protocol, and storing a destination end candidate address that is used to transmit the session data and that is in the session answer:
determining that a candidate address is fed back by the destination end for the second interaction signaling by using the connection-oriented transmission layer protocol; and
responsive to the determining that a candidate address is fed back by the destination end for the second interaction signaling by using the connection-oriented transmission layer protocol, storing the fed back candidate address, and determining that both the connectionless transmission channel and the connection transmission channel of the communication session are in a connected state.
15 . The data transmission apparatus according to claim 9 , wherein the session answers are compressed into binary data.
16 . The data transmission apparatus according to claim 9 , wherein the session answer is encapsulated into third interaction signaling based on the connectionless-oriented transmission layer protocol;
the session answer is encapsulated into fourth interaction signaling based on the connection-oriented transmission layer protocol;
wherein the third interaction signaling is received via the connectionless-oriented transmission layer protocol; and
wherein the fourth interaction signaling is received via the connection-oriented transmission layer protocol.
17 . A non-transitory computer-readable storage medium, having computer-readable instructions stored therein, and the computer-readable instructions, when executed by a processor, implementing a method for providing real-time communication over a computer network, the method comprising:
generating session offers of a network communication session;
transmitting the session offers to a destination end based on a connectionless-oriented transmission layer protocol and a connection-oriented transmission layer protocol respectively, the transmitting including:
encapsulating the session offer into first interaction signaling based on the connectionless-oriented transmission layer protocol;
encapsulating the session offer into second interaction signaling based on the connection-oriented transmission layer protocol; and
transmitting the first interaction signaling to the destination end by using the connectionless-oriented transmission layer protocol, and transmitting the second interaction signaling to the destination end by using the connection-oriented transmission layer protocol;
determining, based on transmission statuses of session answers fed back by the destination end responsive to the session offers, respective connectivity detection results of a connectionless transmission channel and a connection transmission channel of the communication session, wherein the determining includes:
determining that a session answer fed back by the destination end for the first interaction signaling is only received through the connectionless-oriented transmission layer protocol, and responsive to the determining that a session answer fed back by the destination end for the first interaction signaling is only received through the connectionless-oriented transmission layer protocol, storing a destination end candidate address that is used to transmit session data and that is in the session answer, and determining that the connectionless transmission channel of the communication session is in a connected state; or
determining that a session answer fed back by the destination end for the second interaction signaling is only received through the connection-oriented transmission layer protocol, and responsive to the determining that a session answer fed back by the destination end for the second interaction signaling is only received through the connection-oriented transmission layer protocol, storing a destination end candidate address that is used to transmit the session data and that is in the session answer, and determining that the connection transmission channel of the communication session is in a connected state;
establishing a data transmission channel to the destination end based on the connectivity detection results; and
transmitting the session data of the communication session with the destination end through the data transmission channel.
18 . The non-transitory computer-readable storage medium according to claim 17 , wherein the determining, based on transmission statuses of session answers fed back by the destination end for the session offers, respective connectivity detection results of a connectionless transmission channel and a connection transmission channel of the communication session comprises:
after receiving the session answer fed back by the destination end for the first interaction signaling by using the connectionless-oriented transmission layer protocol, and storing a destination end candidate address that is used to transmit the session data and that is in the session answer:
determining that a candidate address is fed back by the destination end for the second interaction signaling by using the connection-oriented transmission layer protocol; and
responsive to the determining that a candidate address is fed back by the destination end for the second interaction signaling by using the connection-oriented transmission layer protocol, storing the fed back candidate address, and determining that both the connectionless transmission channel and the connection transmission channel of the communication session are in a connected state.
19 . The non-transitory computer-readable storage medium according to claim 17 , wherein the establishing a data transmission channel to the destination end based on the connectivity detection results comprises:
determining that the connection transmission channel of the communication session is in the connected state, and responsive to the determining that the connection transmission channel of the communication session is in the connected state, initiating, based on a candidate address combination formed by a first address in a source end candidate address and a second address in the destination end candidate address, a connection check request of the candidate address combination; and
upon receiving a connection check response fed back by the destination end in response to the connection check request, establishing a connection-oriented data transmission channel to the destination end based on the candidate address combination.
20 . The non-transitory computer-readable storage medium according to claim 17 , wherein the method further comprises: compressing the session offers, to obtain binary data; and transmitting the binary data to the destination end based on the connectionless-oriented transmission layer protocol and the connection-oriented transmission layer protocol respectively.