CN115134553A - Data transmission method and device, electronic equipment and storage medium - Google Patents
Data transmission method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN115134553A CN115134553A CN202110277682.0A CN202110277682A CN115134553A CN 115134553 A CN115134553 A CN 115134553A CN 202110277682 A CN202110277682 A CN 202110277682A CN 115134553 A CN115134553 A CN 115134553A
- Authority
- CN
- China
- Prior art keywords
- data
- connection
- terminal
- packet
- server
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N7/00—Television systems
- H04N7/14—Systems for two-way working
- H04N7/15—Conference systems
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L5/00—Arrangements affording multiple use of the transmission path
- H04L5/003—Arrangements for allocating sub-channels of the transmission path
- H04L5/0053—Allocation of signalling, i.e. of overhead other than pilot signals
- H04L5/0055—Physical resource allocation for ACK/NACK
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L51/00—User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
- H04L51/04—Real-time or near real-time messaging, e.g. instant messaging [IM]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/04—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
- H04L63/0428—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/08—Network architectures or network communication protocols for network security for authentication of entities
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/431—Generation of visual interfaces for content selection or interaction; Content or additional data rendering
- H04N21/4312—Generation of visual interfaces for content selection or interaction; Content or additional data rendering involving specific graphical features, e.g. screen layout, special fonts or colors, blinking icons, highlights or animations
- H04N21/4316—Generation of visual interfaces for content selection or interaction; Content or additional data rendering involving specific graphical features, e.g. screen layout, special fonts or colors, blinking icons, highlights or animations for displaying supplemental content in a region of the screen, e.g. an advertisement in a separate window
Landscapes
- Engineering & Computer Science (AREA)
- Signal Processing (AREA)
- Computer Networks & Wireless Communication (AREA)
- Computer Security & Cryptography (AREA)
- Multimedia (AREA)
- Computer Hardware Design (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Marketing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本申请提供了一种数据传输方法、装置、电子设备及存储介质;涉及云技术和通信技术领域,方法包括:创建与终端间用于数据传输的第一数据连接,所述第一数据连接的连接标识,在所述终端的互联网协议地址或端口发生变化时保持不变;接收到所述终端基于所述第一数据连接传输的数据包;对所述数据包进行解析,以确定所述数据包对应的数据类型;当确定所述数据包的数据类型为不可靠数据类型时,控制不向所述终端返回对应所述数据包的接收响应消息;通过本申请,能够减少网络资源的不必要占用,提高网络资源的利用率。
The application provides a data transmission method, device, electronic device and storage medium; it relates to the field of cloud technology and communication technology, and the method includes: creating a first data connection with a terminal for data transmission, and the first data connection is A connection identifier, which remains unchanged when the Internet Protocol address or port of the terminal changes; receives a data packet transmitted by the terminal based on the first data connection; parses the data packet to determine the data The data type corresponding to the packet; when it is determined that the data type of the data packet is an unreliable data type, the control does not return a reception response message corresponding to the data packet to the terminal; through this application, unnecessary network resources can be reduced Occupy, improve the utilization of network resources.
Description
技术领域technical field
本申请涉及云技术和通信技术领域,尤其涉及一种数据传输方法、装置、电子设备及存储介质。The present application relates to the field of cloud technology and communication technology, and in particular, to a data transmission method, apparatus, electronic device, and storage medium.
背景技术Background technique
相关技术中,针对音视频数据、频繁移动的坐标数据等无需可靠传输的不可靠数据,往往和需要可靠传输的可靠数据复用同一条通道传输,即均通过可靠传输方式进行传输。而网络较差时,可靠传输方式的重传策略会给网络带来较大压力,并且会影响信令等可靠数据的正常传输。In the related art, unreliable data that does not require reliable transmission, such as audio and video data and frequently moving coordinate data, is often multiplexed and transmitted on the same channel as reliable data that requires reliable transmission, that is, both are transmitted in a reliable transmission mode. When the network is poor, the retransmission strategy of the reliable transmission method will bring greater pressure to the network, and will affect the normal transmission of reliable data such as signaling.
发明内容SUMMARY OF THE INVENTION
本申请实施例提供一种数据传输方法、装置、电子设备及存储介质,能够减少网络资源的不必要占用,提高网络资源的利用率。Embodiments of the present application provide a data transmission method, apparatus, electronic device, and storage medium, which can reduce unnecessary occupation of network resources and improve the utilization rate of network resources.
本申请实施例的技术方案是这样实现的:The technical solutions of the embodiments of the present application are implemented as follows:
本申请实施例提供一种数据传输方法,包括:The embodiment of the present application provides a data transmission method, including:
创建与终端间用于数据传输的第一数据连接,所述第一数据连接的连接标识,在所述终端的互联网协议地址或端口发生变化时保持不变;Create a first data connection with the terminal for data transmission, and the connection identifier of the first data connection remains unchanged when the Internet Protocol address or port of the terminal changes;
接收到所述终端基于所述第一数据连接传输的数据包;receiving a data packet transmitted by the terminal based on the first data connection;
对所述数据包进行解析,以确定所述数据包对应的数据类型;Analyzing the data packet to determine the data type corresponding to the data packet;
当确定所述数据包的数据类型为不可靠数据类型时,控制不向所述终端返回对应所述数据包的接收响应消息。When it is determined that the data type of the data packet is an unreliable data type, the control does not return a reception response message corresponding to the data packet to the terminal.
本申请实施例提供一种数据传输方法,包括:The embodiment of the present application provides a data transmission method, including:
创建与服务器间用于数据传输的第一数据连接,所述第一数据连接的连接标识,在所述服务器的互联网协议地址或端口发生变化时保持不变;Create a first data connection with the server for data transmission, and the connection identifier of the first data connection remains unchanged when the Internet Protocol address or port of the server changes;
基于所述第一数据连接,发送数据包至所述服务器;sending a data packet to the server based on the first data connection;
其中,所述数据包的数据类型包括不可靠数据类型,所述不可靠数据类型,用于当所述服务器确定所述数据包的数据类型为不可靠数据类型时,控制不返回对应所述数据包的接收响应消息。The data type of the data packet includes an unreliable data type, and the unreliable data type is used to control not to return the corresponding data when the server determines that the data type of the data packet is an unreliable data type Packet receive response message.
本申请实施例还提供一种数据传输装置,包括:The embodiment of the present application also provides a data transmission device, including:
创建模块,用于创建与终端间用于数据传输的第一数据连接,所述第一数据连接的连接标识,在所述终端的互联网协议地址或端口发生变化时保持不变;A creation module is used to create a first data connection with the terminal for data transmission, and the connection identifier of the first data connection remains unchanged when the Internet Protocol address or port of the terminal changes;
接收模块,用于接收到所述终端基于所述第一数据连接传输的数据包;a receiving module, configured to receive a data packet transmitted by the terminal based on the first data connection;
解析模块,用于对所述数据包进行解析,以确定所述数据包对应的数据类型;a parsing module, configured to parse the data packet to determine the data type corresponding to the data packet;
控制模块,用于当确定所述数据包的数据类型为不可靠数据类型时,控制不向所述终端返回对应所述数据包的接收响应消息。A control module, configured to control not to return a reception response message corresponding to the data packet to the terminal when it is determined that the data type of the data packet is an unreliable data type.
上述方案中,所述装置还包括:In the above scheme, the device also includes:
连接状态控制模块,用于获取心跳包发送周期,并按照所述心跳包发送周期,通过所述第一数据连接,发送心跳包至所述终端;a connection state control module, configured to obtain a heartbeat packet sending cycle, and send a heartbeat packet to the terminal through the first data connection according to the heartbeat packet sending cycle;
当接收到针对所述心跳包的心跳响应信息时,控制所述第一数据连接对应的连接状态为活跃状态。When the heartbeat response information for the heartbeat packet is received, the connection state corresponding to the first data connection is controlled to be an active state.
上述方案中,当所述第一数据连接为首次建立时,所述创建模块,还用于接收到所述终端发送的请求建立数据连接的第一问询数据包;In the above solution, when the first data connection is established for the first time, the creation module is further configured to receive a first inquiry data packet sent by the terminal for requesting to establish a data connection;
基于所述第一问询数据包,发送相应的应答数据包至所述终端;based on the first inquiry data packet, sending a corresponding response data packet to the terminal;
当接收到所述终端发送的第二问询数据包时,创建与所述终端间用于数据传输的第一数据连接。When receiving the second inquiry data packet sent by the terminal, a first data connection for data transmission with the terminal is established.
上述方案中,当所述第一数据连接为非首次建立时,所述创建模块,还用于接收到所述终端发送的请求建立数据连接的问询数据包;In the above solution, when the first data connection is not established for the first time, the creation module is further configured to receive an inquiry data packet sent by the terminal for requesting to establish a data connection;
基于所述问询数据包,创建与所述终端间用于数据传输的第一数据连接。Based on the inquiry data packet, a first data connection for data transmission with the terminal is established.
上述方案中,所述解析模块,还用于提取所述数据包的包头部分;In the above scheme, the parsing module is also used to extract the header part of the data packet;
对所述包头部分进行解析,得到用于指示数据类型的报文字段;The packet header part is parsed to obtain a message field for indicating the data type;
将所述报文字段所指示的数据类型,确定为所述数据包对应的数据类型。The data type indicated by the packet field is determined as the data type corresponding to the data packet.
上述方案中,所述装置还包括:In the above scheme, the device also includes:
第一迁移模块,用于当所述终端的互联网协议地址发生变更时,通过所述终端的第一套接字接口,建立与所述终端间的第二数据连接,以将与所述终端间的数据连接从所述第一数据连接迁移至所述第二数据连接;The first migration module is configured to establish a second data connection with the terminal through the first socket interface of the terminal when the Internet Protocol address of the terminal is changed, so as to connect the terminal with the terminal. migrating the data connection from the first data connection to the second data connection;
其中,所述第二数据连接的连接标识与所述第一数据连接的连接标识相一致。Wherein, the connection identifier of the second data connection is consistent with the connection identifier of the first data connection.
上述方案中,所述第一迁移模块,还用于基于所述连接标识,通过所述第二数据连接,发送包括第一验证信息的探测数据包至所述终端;In the above solution, the first migration module is further configured to send a probe data packet including the first verification information to the terminal through the second data connection based on the connection identifier;
接收到所述终端针对所述探测数据包返回的响应数据包,所述响应数据包包括第二验证信息;receiving a response data packet returned by the terminal for the probe data packet, where the response data packet includes second verification information;
基于所述第二验证信息对所述第一验证信息进行验证,当得到表征验证通过的验证结果时,基于所述第二数据连接进行与所述终端间的数据传输。The first verification information is verified based on the second verification information, and when a verification result indicating that the verification is passed is obtained, data transmission with the terminal is performed based on the second data connection.
上述方案中,所述第一迁移模块,还用于接收到所述终端基于所述连接标识,通过所述第二数据连接传输的包括第三验证信息的探测数据包;In the above solution, the first migration module is further configured to receive a probe data packet including third verification information that is transmitted by the terminal through the second data connection based on the connection identifier;
发送针对所述探测数据包的响应数据包至所述终端,所述响应数据包包括第四验证信息;sending a response data packet to the terminal for the probe data packet, where the response data packet includes fourth verification information;
其中,所述第四验证信息,用于供所述终端基于所述第三验证信息对所述第四验证信息进行验证,当得到表征验证通过的验证结果时,基于所述第二数据连接进行数据传输。The fourth verification information is used for the terminal to verify the fourth verification information based on the third verification information, and when a verification result indicating that the verification is passed is obtained, the verification is performed based on the second data connection. data transmission.
上述方案中,所述装置还包括:In the above scheme, the device also includes:
第二迁移模块,用于对目标互联网协议地址是否发生变更进行监测,得到监测结果,所述目标互联网协议地址归属于与所述终端建立所述第一数据连接的服务器;A second migration module, configured to monitor whether the target Internet Protocol address is changed, and obtain a monitoring result, where the target Internet Protocol address belongs to the server that establishes the first data connection with the terminal;
当所述监测结果表征所述目标互联网协议地址发生变更时,针对变更后的目标互联网协议地址创建第二套接字接口,并When the monitoring result indicates that the target Internet Protocol address is changed, create a second socket interface for the changed target Internet Protocol address, and
基于所述第二套接字接口,建立与所述终端间的第三数据连接,以将与所述终端间的数据连接从所述第一数据连接迁移至所述第三数据连接;establishing a third data connection with the terminal based on the second socket interface, so as to migrate the data connection with the terminal from the first data connection to the third data connection;
其中,所述第三数据连接的连接标识与所述第一数据连接的连接标识相一致。Wherein, the connection identifier of the third data connection is consistent with the connection identifier of the first data connection.
上述方案中,所述第二迁移模块,还用于对所述目标互联网协议地址对应的原始套接字接口的数据传输失败事件、以及所述目标互联网协议地址的变更通知消息中至少之一进行监测;In the above solution, the second migration module is further configured to perform at least one of the data transmission failure event of the original socket interface corresponding to the target Internet Protocol address and the change notification message of the target Internet Protocol address. monitor;
当监测到所述目标互联网协议地址对应的原始套接字接口的数据传输失败事件、以及所述目标互联网协议地址的变更通知消息中至少之一时,得到表征所述目标互联网协议地址发生变更的监测结果。When at least one of the data transmission failure event of the raw socket interface corresponding to the target Internet Protocol address and the change notification message of the target Internet Protocol address are monitored, a monitoring indicating that the target Internet Protocol address is changed is obtained. result.
上述方案中,所述第二迁移模块,还用于基于所述连接标识,对所述第三数据连接的数据可达性进行验证,得到验证结果;In the above solution, the second migration module is further configured to verify the data reachability of the third data connection based on the connection identifier to obtain a verification result;
当所述验证结果表征所述第三数据连接的数据可达时,基于所述第三数据连接进行与所述终端间的数据传输。When the verification result indicates that the data of the third data connection is reachable, perform data transmission with the terminal based on the third data connection.
本申请实施例还提供一种数据传输装置,包括:The embodiment of the present application also provides a data transmission device, including:
连接创建模块,用于创建与服务器间用于数据传输的第一数据连接,所述第一数据连接的连接标识,在所述服务器的互联网协议地址或端口发生变化时保持不变;a connection creation module for creating a first data connection with a server for data transmission, and the connection identifier of the first data connection remains unchanged when the Internet Protocol address or port of the server changes;
发送模块,用于基于所述第一数据连接,发送数据包至所述服务器;a sending module, configured to send a data packet to the server based on the first data connection;
其中,所述数据包的数据类型包括不可靠数据类型,所述不可靠数据类型,用于当所述服务器确定所述数据包的数据类型为不可靠数据类型时,控制不返回对应所述数据包的接收响应消息。The data type of the data packet includes an unreliable data type, and the unreliable data type is used to control not to return the corresponding data when the server determines that the data type of the data packet is an unreliable data type Packet receive response message.
本申请实施例还提供一种电子设备,包括:The embodiment of the present application also provides an electronic device, including:
存储器,用于存储可执行指令;memory for storing executable instructions;
处理器,用于执行所述存储器中存储的可执行指令时,实现本申请实施例提供的数据传输方法。The processor is configured to implement the data transmission method provided by the embodiment of the present application when executing the executable instructions stored in the memory.
本申请实施例还提供一种计算机可读存储介质,存储有可执行指令,所述可执行指令被处理器执行时,实现本申请实施例提供的数据传输方法。Embodiments of the present application further provide a computer-readable storage medium storing executable instructions, and when the executable instructions are executed by a processor, the data transmission method provided by the embodiments of the present application is implemented.
本申请实施例具有以下有益效果:The embodiment of the present application has the following beneficial effects:
创建与终端间用于数据传输的第一数据连接,该第一数据连接的连接标识,在终端的互联网协议地址或端口发生变化时保持不变;当接收到该终端基于第一数据连接传输的数据包时,对该数据包进行解析,以确定该数据包对应的数据类型;当确定数据包的数据类型为不可靠数据类型时,则控制不向该终端返回对应数据包的接收响应消息。如此,通过解析数据包的数据类型,针对不可靠数据类型的数据包,则不返回对应的接收响应消息,从而避免了终端重传不可靠数据类型的数据包的情况,减少网络资源的不必要占用,提高网络资源的利用率。Create a first data connection with the terminal for data transmission, and the connection identifier of the first data connection remains unchanged when the Internet Protocol address or port of the terminal changes; When the data packet is detected, the data packet is parsed to determine the data type corresponding to the data packet; when the data type of the data packet is determined to be an unreliable data type, the control does not return a reception response message corresponding to the data packet to the terminal. In this way, by analyzing the data type of the data packet, for the data packet of the unreliable data type, the corresponding reception response message is not returned, thereby avoiding the situation that the terminal retransmits the data packet of the unreliable data type and reducing unnecessary network resources. Occupy, improve the utilization of network resources.
附图说明Description of drawings
图1是本申请实施例提供的数据传输系统100的架构示意图;FIG. 1 is a schematic structural diagram of a
图2是本申请实施例提供的数据传输方法的电子设备500的结构示意图;FIG. 2 is a schematic structural diagram of an electronic device 500 according to a data transmission method provided by an embodiment of the present application;
图3A是本申请实施例提供的数据传输方法的流程示意图;3A is a schematic flowchart of a data transmission method provided by an embodiment of the present application;
图3B是本申请实施例提供的数据传输方法的流程示意图;3B is a schematic flowchart of a data transmission method provided by an embodiment of the present application;
图4是本申请实施例提供的数据传输方法的流程示意图;4 is a schematic flowchart of a data transmission method provided by an embodiment of the present application;
图5是本申请实施例提供的用于数据传输的长连接的创建方法的流程示意图;5 is a schematic flowchart of a method for creating a persistent connection for data transmission provided by an embodiment of the present application;
图6是本申请实施例提供的客户端的应用示意图;6 is a schematic diagram of an application of a client provided by an embodiment of the present application;
图7是本申请实施例提供的TCP连接的建立流程示意图;FIG. 7 is a schematic flowchart of the establishment of a TCP connection provided by an embodiment of the present application;
图8是本申请实施例提供的TLS连接的建立流程示意图;8 is a schematic flowchart of a TLS connection establishment provided by an embodiment of the present application;
图9是本申请实施例提供的互联网协议地址变更时客户端的表现示意图;9 is a schematic diagram of the performance of a client when an Internet Protocol address is changed according to an embodiment of the present application;
图10是本申请实施例提供的QUIC连接的建立流程示意图;FIG. 10 is a schematic flowchart of the establishment of a QUIC connection provided by an embodiment of the present application;
图11是本申请实施例提供的用于数据传输的长连接的创建方法的流程示意图;11 is a schematic flowchart of a method for creating a persistent connection for data transmission provided by an embodiment of the present application;
图12是本申请实施例提供的数据连接的连接迁移的流程示意图;12 is a schematic flowchart of connection migration of a data connection provided by an embodiment of the present application;
图13是本申请实施例提供的连接迁移的流程示意图;13 is a schematic flowchart of connection migration provided by an embodiment of the present application;
图14是本申请实施例提供的路径验证的流程示意图;14 is a schematic flowchart of path verification provided by an embodiment of the present application;
图15是本申请实施例提供的可靠帧格式和不可靠帧格式的示意图;15 is a schematic diagram of a reliable frame format and an unreliable frame format provided by an embodiment of the present application;
图16是本申请实施例提供的应用于远程控制的数据传输的流程示意图;16 is a schematic flowchart of data transmission applied to remote control provided by an embodiment of the present application;
图17A是本申请实施例提供的画中画模式的示意图;17A is a schematic diagram of a picture-in-picture mode provided by an embodiment of the present application;
图17B是本申请实施例提供的声音大小显示的示意图;17B is a schematic diagram of sound level display provided by an embodiment of the present application;
图18是本申请实施例提供的客户端指标的优化示意图;FIG. 18 is a schematic diagram of optimization of client indicators provided by an embodiment of the present application;
图19是本申请实施例提供的数据传输装置555的结构示意图;19 is a schematic structural diagram of a data transmission device 555 provided by an embodiment of the present application;
图20是本申请实施例提供的数据传输装置2000的结构示意图。FIG. 20 is a schematic structural diagram of a data transmission apparatus 2000 provided by an embodiment of the present application.
具体实施方式Detailed ways
为了使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请作进一步地详细描述,所描述的实施例不应视为对本申请的限制,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本申请保护的范围。In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be described in further detail below with reference to the accompanying drawings. All other embodiments obtained under the premise of creative work fall within the scope of protection of the present application.
在以下的描述中,涉及到“一些实施例”,其描述了所有可能实施例的子集,但是可以理解,“一些实施例”可以是所有可能实施例的相同子集或不同子集,并且可以在不冲突的情况下相互结合。In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is understood that "some embodiments" can be the same or a different subset of all possible embodiments, and Can be combined with each other without conflict.
在以下的描述中,所涉及的术语“第一\第二\第三”仅仅是是区别类似的对象,不代表针对对象的特定排序,可以理解地,“第一\第二\第三”在允许的情况下可以互换特定的顺序或先后次序,以使这里描述的本申请实施例能够以除了在这里图示或描述的以外的顺序实施。In the following description, the term "first\second\third" is only used to distinguish similar objects, and does not represent a specific ordering of objects. It is understood that "first\second\third" Where permitted, the specific order or sequence may be interchanged to enable the embodiments of the application described herein to be practiced in sequences other than those illustrated or described herein.
除非另有定义,本文所使用的所有的技术和科学术语与属于本申请的技术领域的技术人员通常理解的含义相同。本文中所使用的术语只是为了描述本申请实施例的目的,不是旨在限制本申请。Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the technical field to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of the present application, and are not intended to limit the present application.
对本申请实施例进行进一步详细说明之前,对本申请实施例中涉及的名词和术语进行说明,本申请实施例中涉及的名词和术语适用于如下的解释。Before further describing the embodiments of the present application in detail, the terms and terms involved in the embodiments of the present application are described, and the terms and terms involved in the embodiments of the present application are suitable for the following explanations.
1)客户端,终端中运行的用于提供各种服务的应用程序,例如即时通讯客户端、视频播放客户端。1) A client, an application program running in the terminal for providing various services, such as an instant messaging client and a video playing client.
2)响应于,用于表示所执行的操作所依赖的条件或者状态,当满足所依赖的条件或状态时,所执行的一个或多个操作可以是实时的,也可以具有设定的延迟;在没有特别说明的情况下,所执行的多个操作不存在执行先后顺序的限制。2) In response, used to represent the condition or state on which the executed operation depends, when the dependent condition or state is satisfied, the executed one or more operations may be real-time or may have a set delay; Unless otherwise specified, there is no restriction on the order of execution of multiple operations to be executed.
3)TCP:Transmission Control Protocol,是一种面向连接的、可靠的、基于字节流的传输层通信协议,由IETF(国际互联网工程任务组)的RFC 793定义。3) TCP: Transmission Control Protocol, is a connection-oriented, reliable, byte stream-based transport layer communication protocol, defined by RFC 793 of the IETF (Internet Engineering Task Force).
4)TLS:Transport Layer Security,是一种安全协议,目的是为互联网通信提供安全及数据完整性保障4) TLS: Transport Layer Security, is a security protocol, the purpose is to provide security and data integrity guarantee for Internet communication
5)QUIC:Quick UDP Internet Connection,是谷歌制定的一种基于UDP的低时延的可靠互联网传输层协议,2016年11月由IETF(国际互联网工程任务组)开始进行标准化,预计2021年从基础草案发布成为RFC。5) QUIC: Quick UDP Internet Connection, is a low-latency and reliable Internet transport layer protocol based on UDP formulated by Google. It was standardized by the IETF (International Internet Engineering Task Force) in November 2016. It is expected to start from the foundation in 2021. The draft is published as an RFC.
6)Cellular:蜂窝技术,一种无线通信技术,也就是我们通常说的的GPRS/3G/4G/5G网络。6) Cellular: Cellular technology, a wireless communication technology, also known as GPRS/3G/4G/5G network.
7)长连接:客户端和后台之间建立并维护的一条长时间有效的可靠的数据传输通道。7) Long connection: a long-term effective and reliable data transmission channel established and maintained between the client and the background.
8)XMPP:XMPP是一种基于标准通用标记语音的子集XML的协议,它继承了在XML环境中灵活的发展性。可用于服务类实时通讯、表示和需求响应服务中的XML数据元流式传输。因此,基于XMPP的应用具有超强的可扩展性,由IETF(国际互联网工程任务组)的RFC3920定义。8) XMPP: XMPP is a protocol based on the subset XML of standard universal markup speech, which inherits the flexible development in the XML environment. Can be used for streaming of XML data elements in service class real-time communication, presentation and demand response services. Therefore, the application based on XMPP has super extensibility, which is defined by RFC3920 of IETF (Internet Engineering Task Force).
9)RTT:Round-Trip Time,往返时延。在计算机网络中它是一个重要的性能指标,表示从发送端发送数据开始,到发送端收到来自接收端的确认(接收端收到数据后便立即发送确认),总共经历的时延。9) RTT: Round-Trip Time, round-trip delay. It is an important performance indicator in computer networks, indicating the total delay experienced from the time the sender sends data until the sender receives an acknowledgment from the receiver (the receiver sends an acknowledgment immediately after receiving the data).
基于上述对本申请实施例中涉及的名词和术语的解释,下面说明本申请实施例提供的数据传输系统。参见图1,图1是本申请实施例提供的数据传输系统100的架构示意图,为实现支撑一个示例性应用,终端(示例性示出了终端400-1)通过网络300连接服务器200,网络300可以是广域网或者局域网,又或者是二者的组合,使用无线或有线链路实现数据传输。Based on the above explanations of terms and terms involved in the embodiments of the present application, the data transmission system provided by the embodiments of the present application is described below. Referring to FIG. 1, FIG. 1 is a schematic structural diagram of a
终端(如终端400-1),用于创建与服务器200间用于数据传输的第一数据连接;基于第一数据连接,发送数据包至服务器200;a terminal (such as terminal 400-1), used to create a first data connection with the
服务器200,用于创建与终端间用于数据传输的第一数据连接;接收到终端基于所述第一数据连接传输的数据包;对数据包进行解析,以确定数据包对应的数据类型;当确定数据包的数据类型为不可靠数据类型时,控制不向终端返回对应数据包的接收响应消息。The
本申请实施例可以借助于云技术(Cloud Technology)实现,云技术是指在广域网或局域网内将硬件、软件、网络等系列资源统一起来,实现数据的计算、储存、处理和共享的一种托管技术。The embodiments of the present application can be implemented with the help of cloud technology. Cloud technology refers to a kind of hosting that unifies a series of resources such as hardware, software, and network in a wide area network or a local area network to realize data computing, storage, processing, and sharing. technology.
云技术是基于云计算商业模式应用的网络技术、信息技术、整合技术、管理平台技术、以及应用技术等的总称,可以组成资源池,按需所用,灵活便利。云计算技术将变成重要支撑。技术网络系统的后台服务需要大量的计算、存储资源。Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, and application technology based on cloud computing business models. Cloud computing technology will become an important support. Background services of technical network systems require a lot of computing and storage resources.
在实际应用中,服务器200可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群或者分布式系统,还可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、CDN、以及大数据和人工智能平台等基础云计算服务的云服务器。终端(如终端400-1)可以是智能手机、平板电脑、笔记本电脑、台式计算机、智能音箱、智能电视、智能手表等,但并不局限于此。终端(如终端400-1)以及服务器200可以通过有线或无线通信方式进行直接或间接地连接,本申请在此不做限制。In practical applications, the
参见图2,图2是本申请实施例提供的数据传输方法的电子设备500的结构示意图。在实际应用中,电子设备500可以为图1示出的服务器或终端,以电子设备500为图1示出的终端为例,对实施本申请实施例的数据传输方法的电子设备进行说明,本申请实施例提供的电子设备500包括:至少一个处理器510、存储器550、至少一个网络接口520和用户接口530。电子设备500中的各个组件通过总线系统540耦合在一起。可理解,总线系统540用于实现这些组件之间的连接通信。总线系统540除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图2中将各种总线都标为总线系统540。Referring to FIG. 2 , FIG. 2 is a schematic structural diagram of an electronic device 500 according to a data transmission method provided by an embodiment of the present application. In practical applications, the electronic device 500 may be the server or terminal shown in FIG. 1 . Taking the electronic device 500 as the terminal shown in FIG. 1 as an example, the electronic device implementing the data transmission method of the embodiment of the present application will be described. The electronic device 500 provided by the embodiment of the application includes: at least one processor 510 , a memory 550 , at least one network interface 520 and a user interface 530 . The various components in electronic device 500 are coupled together by
处理器510可以是一种集成电路芯片,具有信号的处理能力,例如通用处理器、数字信号处理器(DSP,Digital Signal Processor),或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等,其中,通用处理器可以是微处理器或者任何常规的处理器等。The processor 510 may be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where a general-purpose processor may be a microprocessor or any conventional processor or the like.
用户接口530包括使得能够呈现媒体内容的一个或多个输出装置531,包括一个或多个扬声器和/或一个或多个视觉显示屏。用户接口530还包括一个或多个输入装置532,包括有助于用户输入的用户接口部件,比如键盘、鼠标、麦克风、触屏显示屏、摄像头、其他输入按钮和控件。User interface 530 includes one or more output devices 531 that enable presentation of media content, including one or more speakers and/or one or more visual display screens. User interface 530 also includes one or more input devices 532, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, and other input buttons and controls.
存储器550可以是可移除的,不可移除的或其组合。示例性的硬件设备包括固态存储器,硬盘驱动器,光盘驱动器等。存储器550可选地包括在物理位置上远离处理器510的一个或多个存储设备。Memory 550 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid state memory, hard drives, optical drives, and the like. Memory 550 optionally includes one or more storage devices that are physically remote from processor 510 .
存储器550包括易失性存储器或非易失性存储器,也可包括易失性和非易失性存储器两者。非易失性存储器可以是只读存储器(ROM,Read Only Me mory),易失性存储器可以是随机存取存储器(RAM,Random Access Memor y)。本申请实施例描述的存储器550旨在包括任意适合类型的存储器。Memory 550 includes volatile memory or non-volatile memory, and may also include both volatile and non-volatile memory. The non-volatile memory may be Read Only Memory (ROM, Read Only Memory), and the volatile memory may be Random Access Memory (RAM, Random Access Memory). The memory 550 described in the embodiments of the present application is intended to include any suitable type of memory.
在一些实施例中,存储器550能够存储数据以支持各种操作,这些数据的示例包括程序、模块和数据结构或者其子集或超集,下面示例性说明。In some embodiments, memory 550 is capable of storing data to support various operations, examples of which include programs, modules, and data structures, or subsets or supersets thereof, as exemplified below.
操作系统551,包括用于处理各种基本系统服务和执行硬件相关任务的系统程序,例如框架层、核心库层、驱动层等,用于实现各种基础业务以及处理基于硬件的任务;The operating system 551 includes system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;
网络通信模块552,用于经由一个或多个(有线或无线)网络接口520到达其他计算设备,示例性的网络接口520包括:蓝牙、无线相容性认证(WiFi)、和通用串行总线(USB,Universal Serial Bus)等;A network communication module 552 for reaching other computing devices via one or more (wired or wireless) network interfaces 520, exemplary network interfaces 520 including: Bluetooth, Wireless Compatibility (WiFi), and Universal Serial Bus ( USB, Universal Serial Bus), etc.;
呈现模块553,用于经由一个或多个与用户接口530相关联的输出装置531(例如,显示屏、扬声器等)使得能够呈现信息(例如,用于操作外围设备和显示内容和信息的用户接口);A presentation module 553 for enabling presentation of information (eg, a user interface for operating peripherals and displaying content and information) via one or more output devices 531 associated with the user interface 530 (eg, a display screen, speakers, etc.) );
输入处理模块554,用于对一个或多个来自一个或多个输入装置532之一的一个或多个用户输入或互动进行检测以及翻译所检测的输入或互动。An input processing module 554 for detecting one or more user inputs or interactions from one of the one or more input devices 532 and translating the detected inputs or interactions.
在一些实施例中,本申请实施例提供的数据传输装置可以采用软件方式实现,图2示出了存储在存储器550中的数据传输装置555,其可以是程序和插件等形式的软件,包括以下软件模块:创建模块5551、接收模块5552、解析模块5553和控制模块5554,这些模块是逻辑上的,因此根据所实现的功能可以进行任意的组合或进一步拆分,将在下文中说明各个模块的功能。In some embodiments, the data transmission apparatus provided by the embodiments of the present application may be implemented in software. FIG. 2 shows the data transmission apparatus 555 stored in the memory 550, which may be software in the form of programs and plug-ins, including the following Software modules: creation module 5551, receiving module 5552, parsing module 5553 and control module 5554, these modules are logical, so they can be combined arbitrarily or further split according to the functions implemented, and the functions of each module will be explained below .
在另一些实施例中,本申请实施例提供的数据传输装置可以采用软硬件结合的方式实现,作为示例,本申请实施例提供的数据传输装置可以是采用硬件译码处理器形式的处理器,其被编程以执行本申请实施例提供的数据传输方法,例如,硬件译码处理器形式的处理器可以采用一个或多个应用专用集成电路(ASIC,Application Specific IntegratedCircuit)、DSP、可编程逻辑器件(PLD,Programmable Logic Device)、复杂可编程逻辑器件(CPLD,Complex Progra mmable Logic Device)、现场可编程门阵列(FPGA,Field-Programmable GateArray)或其他电子元件。In some other embodiments, the data transmission apparatus provided by the embodiments of the present application may be implemented by a combination of software and hardware. As an example, the data transmission apparatus provided by the embodiments of the present application may be processors in the form of hardware decoding processors. It is programmed to execute the data transmission method provided by the embodiments of the present application. For example, the processor in the form of a hardware decoding processor may adopt one or more application specific integrated circuits (ASIC, Application Specific Integrated Circuit), DSP, programmable logic device (PLD, Programmable Logic Device), Complex Programmable Logic Device (CPLD, Complex Programmable Logic Device), Field Programmable Gate Array (FPGA, Field-Programmable Gate Array) or other electronic components.
基于上述对本申请实施例提供的数据传输系统及电子设备的说明,下面说明本申请实施例提供的数据传输方法。在一些实施例中,本申请实施例提供的数据传输方法可由服务器或终端单独实施,或由服务器及终端协同实施,下面以服务器实施为例说明本申请实施例提供的数据传输方法。参见图3A,图3A是本申请实施例提供的数据传输方法的流程示意图,本申请实施例提供的数据传输方法包括:Based on the above description of the data transmission system and the electronic device provided by the embodiment of the present application, the data transmission method provided by the embodiment of the present application is described below. In some embodiments, the data transmission method provided by the embodiments of the present application may be implemented by a server or a terminal alone, or by a server and a terminal in cooperation. The data transmission method provided by the embodiments of the present application is described below by taking the server implementation as an example. Referring to FIG. 3A, FIG. 3A is a schematic flowchart of a data transmission method provided by an embodiment of the present application. The data transmission method provided by an embodiment of the present application includes:
步骤101:服务器创建与终端间用于数据传输的第一数据连接。Step 101: The server creates a first data connection with the terminal for data transmission.
其中,第一数据连接的连接标识,在终端的互联网协议地址或端口发生变化时保持不变。The connection identifier of the first data connection remains unchanged when the Internet Protocol address or port of the terminal changes.
这里,服务器在与终端进行数据通信之前,可以预先创建服务器与终端之间的用于数据传输的第一数据连接。在第一数据连接创建完成后,服务器与终端通过该第一数据连接进行数据包的发送与接收。在实际应用中,终端可以设置有应用客户端,比如会议客户端、学习客户端等,该服务器可以为相应的应用客户端的后台服务器。Here, before the server performs data communication with the terminal, a first data connection for data transmission between the server and the terminal may be created in advance. After the first data connection is created, the server and the terminal send and receive data packets through the first data connection. In practical applications, the terminal may be provided with an application client, such as a conference client, a learning client, etc., and the server may be a background server of the corresponding application client.
在本申请实施例中,该第一数据连接的连接标识,在终端和服务器中任一方的互联网协议地址(即IP地址)或端口发送变化时保持不变,即在终端和服务器中任一方的IP地址或端口发送变化时,该终端与服务器之间的数据通道并不会断,双方均可基于该第一数据连接的连接标识进行数据包的传输。如此,当终端或者服务器的IP地址发生变更时,并不影响双方之间的数据传输,而对于用户来说,IP地址的变更是无感知的,也不会出现网络断连、需要重新连接等情况。In the embodiment of the present application, the connection identifier of the first data connection remains unchanged when the Internet Protocol address (that is, the IP address) or the port of any one of the terminal and the server is changed, that is, the connection between the terminal and the server is changed. When the IP address or port changes, the data channel between the terminal and the server will not be interrupted, and both parties can transmit data packets based on the connection identifier of the first data connection. In this way, when the IP address of the terminal or server is changed, it does not affect the data transmission between the two parties, and for the user, the change of the IP address is insensitive, and there will be no network disconnection, need to reconnect, etc. Happening.
在实际应用中,该第一数据连接是基于QUIC协议建立的,QUIC连接的连接标识是一个64位的连接ID,用户在Wi-Fi和蜂窝网络(即Celluar)之间切换时,无论是IP地址或者端口(Port)发生变化,QUIC连接中的连接ID保持不变,终端与服务器双方仍可基于该QUIC连接的连接标识进行数据包的传输,因此不需要重新经过协议握手等过程创建连接,如此QUIC连接迁移可达到用户无感知的网络类型切换的技术效果。In practical applications, the first data connection is established based on the QUIC protocol, and the connection identifier of the QUIC connection is a 64-bit connection ID. When the address or port (Port) changes, the connection ID in the QUIC connection remains unchanged, and both the terminal and the server can still transmit data packets based on the connection identifier of the QUIC connection, so there is no need to re-create the connection through the protocol handshake and other processes. In this way, QUIC connection migration can achieve the technical effect of network type switching without user perception.
在一些实施例中,当第一数据连接为首次建立时,服务器可通过如下方式创建与终端间用于数据传输的第一数据连接:接收到终端发送的请求建立数据连接的第一问询数据包;基于第一问询数据包,发送相应的应答数据包至终端;当接收到终端发送的第二问询数据包时,创建与终端间用于数据传输的第一数据连接。In some embodiments, when the first data connection is established for the first time, the server may create a first data connection with the terminal for data transmission in the following manner: receiving the first inquiry data sent by the terminal for requesting to establish a data connection packet; based on the first inquiry data packet, send a corresponding response data packet to the terminal; when receiving the second inquiry data packet sent by the terminal, create a first data connection with the terminal for data transmission.
在实际应用中,该第一数据连接可以是基于QUIC协议实现的。具体地,当第一数据连接为首次建立时,服务器与终端之间可以通过如下方式创建第一数据连接:当终端需要建立与服务器的数据连接时,向服务器发送请求建立数据连接的第一问询数据包;服务器接收到该第一问询数据包后,基于该第一问询数据包,发送相应的应答数据包至终端,该应答数据包中可以包括密钥交换算法的公钥信息、算法信息、证书信息、协议可用版本信息等;终端接收到服务器发送的响应数据包并存储其中包含的信息,然后向服务器发送第二问询数据包,该第二问询数据包中可以携带终端的加密信息,比如终端所运行客户端的公钥信息;服务器接收到该第二问询数据包后,若接受建立数据连接,则创建与终端间的第一数据连接,若不接受则返回拒绝建立的响应信息。这里,上述终端和服务器对应的加密信息用于对第一数据连接中传输的数据进行加密,以保证数据传输的安全性。In practical applications, the first data connection may be implemented based on the QUIC protocol. Specifically, when the first data connection is established for the first time, the first data connection may be established between the server and the terminal in the following manner: when the terminal needs to establish a data connection with the server, it sends a first question requesting the establishment of the data connection to the server. After receiving the first query data packet, the server sends a corresponding response data packet to the terminal based on the first query data packet, and the response data packet may include the public key information of the key exchange algorithm, Algorithm information, certificate information, protocol available version information, etc.; the terminal receives the response data packet sent by the server and stores the information contained therein, and then sends a second inquiry data packet to the server, which can carry the terminal The encrypted information, such as the public key information of the client running on the terminal; after the server receives the second query data packet, if it accepts the establishment of a data connection, it will create a first data connection with the terminal, and if not, it will return to reject the establishment response information. Here, the encryption information corresponding to the terminal and the server is used to encrypt the data transmitted in the first data connection, so as to ensure the security of data transmission.
在实际实施时,在终端发送第二问询数据包时,可以将终端的加密信息和应用数据一起发送;服务器在接收到第二问询数据包时,基于该第二问询数据包建立与终端间的第一数据连接,从而可以针对第二问询数据包中的应用数据进行相应的响应。如此,该第一数据连接则可以在一个RTT内完成协议握手和数据加密的操作,既减少了数据连接的握手耗时,也完成了数据加密传输,保证了数据的安全性。In actual implementation, when the terminal sends the second query data packet, the encrypted information of the terminal may be sent together with the application data; when the server receives the second query data packet, it establishes an The first data connection between the terminals can accordingly respond to the application data in the second query data packet. In this way, the first data connection can complete the protocol handshake and data encryption operations within one RTT, which not only reduces the time-consuming handshake of the data connection, but also completes the encrypted data transmission, ensuring data security.
在一些实施例中,当第一数据连接为非首次建立时,服务器可通过如下方式创建与终端间用于数据传输的第一数据连接:接收到终端发送的请求建立数据连接的问询数据包;基于问询数据包,创建与终端间用于数据传输的第一数据连接。In some embodiments, when the first data connection is not established for the first time, the server may create a first data connection with the terminal for data transmission in the following manner: receiving an inquiry data packet sent by the terminal for requesting to establish a data connection ; Create a first data connection with the terminal for data transmission based on the query data packet.
在实际应用中,该第一数据连接可以是基于QUIC协议实现的。具体地,当第一数据连接为非首次建立时,服务器与终端之间可以通过如下方式创建第一数据连接:由于是非首次建立终端与服务器间的数据连接,终端侧存储有服务器的相关信息,即首次建立数据连接时存储的第二问询数据包中的密钥交换算法的公钥信息、算法信息、证书信息、协议可用版本信息等。此时,当终端再次需要和服务器建立数据连接时,终端仅需要发送请求建立数据连接的问询数据包至服务器,该问询数据包中可以直接携带加密的应用数据;服务器接收到该问询数据包后,若接受建立连接,则直接创建与终端间的第一数据连接,从而可以针对问询数据包中的应用数据进行相应的响应。如此,该第一数据连接则可以在0个RTT内完成建立,既减少了数据连接的握手耗时,也完成了数据加密传输,保证了数据的安全性。In practical applications, the first data connection may be implemented based on the QUIC protocol. Specifically, when the first data connection is not established for the first time, the first data connection can be established between the server and the terminal in the following manner: Since the data connection between the terminal and the server is not established for the first time, the terminal side stores relevant information of the server, That is, the public key information, algorithm information, certificate information, protocol available version information, etc. of the key exchange algorithm in the second query data packet stored when the data connection is first established. At this time, when the terminal needs to establish a data connection with the server again, the terminal only needs to send a query data packet requesting to establish a data connection to the server, and the query data packet can directly carry encrypted application data; the server receives the query After the data packet is received, if the establishment of the connection is accepted, the first data connection with the terminal is directly established, so that a corresponding response can be made to the application data in the query data packet. In this way, the first data connection can be established within 0 RTTs, which not only reduces the time-consuming handshake of the data connection, but also completes the encrypted data transmission and ensures the security of the data.
在一些实施例中,创建与终端间用于数据传输的第一数据连接之后,服务器可通过如下方式维持第一数据连接的连接状态为活跃状态:获取心跳包发送周期,并按照心跳包发送周期,通过第一数据连接,发送心跳包至终端;当接收到针对心跳包的心跳响应信息时,控制第一数据连接对应的连接状态为活跃状态。In some embodiments, after creating the first data connection with the terminal for data transmission, the server may maintain the connection state of the first data connection as an active state by obtaining the heartbeat packet sending cycle, and according to the heartbeat packet sending cycle , send a heartbeat packet to the terminal through the first data connection; when receiving heartbeat response information for the heartbeat packet, control the connection state corresponding to the first data connection to be an active state.
这里,服务器在和终端间建立第一数据连接后,还需要维持该第一数据连接的连接状态为活跃状态。即设置心跳机制,通过发送心跳包至终端,判断是否在预设的时长阈值内接收到该心跳包的心跳响应信息,以确定是否需要维持该第一数据连接的连接状态为活跃状态,从而维持服务器与终端之间的第一数据连接为长连接。具体地,可以预先设置心跳包的发送周期以及时长阈值;然后按照心跳包发送周期,通过第一数据连接向终端发送心跳包;判断是否在预设的时长阈值内接收到终端针对该心跳包返回的心跳响应信息;当确定在预设的时长阈值内接收到终端针对该心跳包返回的心跳响应信息,则控制第一数据连接对应的连接状态为活跃状态,当确定在预设的时长阈值内未接收到终端针对该心跳包返回的心跳响应信息,则控制第一数据连接对应的连接状态为断开状态,即断开与终端间的第一数据连接,减少网络资源浪费。Here, after establishing the first data connection with the terminal, the server also needs to maintain the connection state of the first data connection as an active state. That is, a heartbeat mechanism is set, and by sending a heartbeat packet to the terminal, it is judged whether the heartbeat response information of the heartbeat packet is received within a preset duration threshold, so as to determine whether it is necessary to maintain the connection state of the first data connection as an active state, thereby maintaining The first data connection between the server and the terminal is a persistent connection. Specifically, a heartbeat packet sending cycle and a duration threshold can be preset; then, according to the heartbeat packet sending cycle, send a heartbeat packet to the terminal through the first data connection; determine whether the terminal receives the heartbeat packet within the preset duration threshold and returns a response to the heartbeat packet The heartbeat response information; when it is determined that the heartbeat response information returned by the terminal for the heartbeat packet is received within the preset duration threshold, the connection state corresponding to the first data connection is controlled to be an active state, and when it is determined to be within the preset duration threshold. If the heartbeat response information returned by the terminal for the heartbeat packet is not received, the connection state corresponding to the first data connection is controlled to be a disconnected state, that is, the first data connection with the terminal is disconnected to reduce waste of network resources.
步骤102:接收到终端基于第一数据连接传输的数据包。Step 102: Receive a data packet transmitted by the terminal based on the first data connection.
这里,服务器建立与终端间用于数据传输的第一数据连接后,通过该第一数据连接进行数据包的传输。在本申请实施例中,该第一数据连接既可支持可靠数据传输,也可支持不可靠数据传输。当需要发送可靠数据(比如握手时期的数据、握手成功后的信令数据等)时,可以将数据封装成可靠数据类型的数据包;当需要发送不可靠数据(比如音视频数据、频繁移动的坐标数据等)时,可以将数据封装成不可靠数据类型的数据包。具体地,可靠数据类型的数据包和不可靠数据类型的数据包采用不同的封包格式,且数据包中携带用于指示数据类型的报文字段,该报文字段用于存放用于指示数据类型的数据标识,即不同数据类型的数据包的数据标识是不同的。Here, after the server establishes a first data connection with the terminal for data transmission, data packets are transmitted through the first data connection. In this embodiment of the present application, the first data connection can support both reliable data transmission and unreliable data transmission. When reliable data needs to be sent (such as data during handshake, signaling data after successful handshake, etc.), the data can be encapsulated into data packets of reliable data type; when unreliable data needs to be sent (such as audio and video data, frequently moving coordinate data, etc.), the data can be encapsulated into packets of unreliable data types. Specifically, the data packets of the reliable data type and the data packets of the unreliable data type adopt different packet formats, and the data packets carry a message field used to indicate the data type, and the message field is used to store the data used to indicate the data type. , that is, the data identifiers of data packets of different data types are different.
这里,该可靠数据类型的数据包,即为传输过程中严格要求的不可丢弃的数据(比如握手时期的数据、握手成功后的信令数据等),具体是需要采用可靠传输方式进行传输的数据;该不可靠数据类别的数据包,即为传输过程中可以部分丢弃的数据(比如音视频数据、频繁移动的坐标数据等),具体是需要采用不可靠传输方式进行传输的数据。这里,可靠传输方式所传输的数据,如果因为网络抖动或者拥塞等原因,接收端没有接收到数据,则发送方需要重传该数据,其中,是否接收到该数据根据接收方是否回复ACK等响应消息来判断;而不可靠传输方式是与可靠传输方式相对应的一种传输方式,不可靠传输方式的发送方不管接收方是否接收到数据,只管发送。Here, the data packet of the reliable data type is the data that cannot be discarded strictly required in the transmission process (such as the data during the handshake period, the signaling data after the handshake is successful, etc.), and specifically the data that needs to be transmitted by a reliable transmission method. ; The data packet of the unreliable data category is the data that can be partially discarded during the transmission process (such as audio and video data, frequently moving coordinate data, etc.), specifically the data that needs to be transmitted in an unreliable transmission mode. Here, for the data transmitted by the reliable transmission method, if the receiver does not receive the data due to network jitter or congestion, etc., the sender needs to retransmit the data. Whether the data is received depends on whether the receiver responds with ACK or not. The unreliable transmission method is a transmission method corresponding to the reliable transmission method. The sender of the unreliable transmission method just sends the data regardless of whether the receiver receives the data or not.
步骤103:对数据包进行解析,以确定数据包对应的数据类型。Step 103: Analyze the data packet to determine the data type corresponding to the data packet.
这里,服务器在接收到终端基于第一数据连接发送的数据包后,对数据包进行解析,以确定数据包对应的数据类型。从而针对不同数据类型的数据包,采用不同的数据处理方式进行处理。Here, after receiving the data packet sent by the terminal based on the first data connection, the server parses the data packet to determine the data type corresponding to the data packet. Therefore, different data processing methods are used for processing data packets of different data types.
在一些实施例中,服务器可通过如下方式确定数据包对应的数据类型:提取数据包的包头部分;对包头部分进行解析,得到用于指示数据类型的报文字段;将报文字段所指示的数据类型,确定为数据包对应的数据类型。In some embodiments, the server may determine the data type corresponding to the data packet by: extracting the packet header part of the data packet; parsing the packet header part to obtain a packet field indicating the data type; The data type is determined as the data type corresponding to the data packet.
在实际应用中,可靠数据类型的数据包和不可靠数据类型的数据包采用不同的封包格式,且数据包中携带用于指示数据类型的报文字段,该报文字段用于存放用于指示数据类型的数据标识,即不同数据类型的数据包的数据标识是不同的。当服务器接收到终端发送的数据包后,提取数据包的包头部分,然后对包头部分进行解析,得到用于指示数据类型的报文字段,该报文字段中存放有用于指示数据类型的数据标识。此时,将报文字段中数据标识所指示的数据类型,确定为所接收的数据包对应的数据类型。In practical applications, the data packets of the reliable data type and the data packets of the unreliable data type use different packet formats, and the data packets carry a message field used to indicate the data type, and the message field is used to store the data used to indicate the data type. Data identifiers of data types, that is, data identifiers of data packets of different data types are different. When the server receives the data packet sent by the terminal, it extracts the packet header part of the data packet, and then parses the packet header part to obtain a message field for indicating the data type, and the message field stores the data identifier for indicating the data type. . At this time, the data type indicated by the data identifier in the message field is determined as the data type corresponding to the received data packet.
步骤104:当确定数据包的数据类型为不可靠数据类型时,控制不向终端返回对应数据包的接收响应消息。Step 104: when it is determined that the data type of the data packet is an unreliable data type, control not to return a reception response message corresponding to the data packet to the terminal.
基于上述实施例,当确定所接收的数据包的数据类型为不可靠数据类型时,则服务器控制不向该终端返回对应数据包的接收响应消息。相应的,终端针对不可靠数据类型的数据包尽管发送即可。Based on the above embodiment, when it is determined that the data type of the received data packet is an unreliable data type, the server controls not to return a reception response message corresponding to the data packet to the terminal. Correspondingly, the terminal may send data packets of unreliable data types as long as they are.
当确定所接收的数据包的数据类型为可靠数据类型时,则服务器向该终端返回对应数据包的接收响应消息,以通知终端已接收到该数据包。相应的,若终端未接收到针对该数据包的接收响应消息,则重新发送该数据包至服务器。When it is determined that the data type of the received data packet is a reliable data type, the server returns a reception response message corresponding to the data packet to the terminal to notify the terminal that the data packet has been received. Correspondingly, if the terminal does not receive a reception response message for the data packet, the terminal resends the data packet to the server.
在一些实施例中,当终端的互联网协议地址发生变更时,通过终端的第一套接字接口,建立与终端间的第二数据连接,以将与终端间的数据连接从第一数据连接迁移至第二数据连接;其中,第二数据连接的连接标识与第一数据连接的连接标识相一致。In some embodiments, when the Internet Protocol address of the terminal is changed, a second data connection with the terminal is established through the first socket interface of the terminal, so as to migrate the data connection with the terminal from the first data connection to the second data connection; wherein the connection identifier of the second data connection is consistent with the connection identifier of the first data connection.
这里,当终端的IP地址发生变更时,比如当终端的网络类型由Wi-Fi变更为蜂窝网络时,由于和原始IP地址绑定的套接字接口(即socket)已经不能使用,此时,则需要针对变更后的IP地址,重新创建相应的第一套接字接口,并将重新创建的第一套接字接口与变更后的IP地址进行绑定,从而通过该重新创建的第一套接字接口进行数据包的传输。Here, when the IP address of the terminal is changed, for example, when the network type of the terminal is changed from Wi-Fi to cellular network, because the socket interface (ie socket) bound to the original IP address can no longer be used, at this time, Then it is necessary to re-create the corresponding first socket interface for the changed IP address, and bind the re-created first socket interface with the changed IP address, so as to pass the re-created first socket interface. The interface is used for data packet transmission.
基于此,终端可通过重新创建的第一套接字接口,基于第一数据连接的连接标识,与服务器进行数据传输,以建立第二数据连接;同样的,服务器也基于该第二数据连接与终端进行数据传输。如此,将终端与服务器间的数据连接由第一数据连接迁移至第二数据连接。Based on this, the terminal can perform data transmission with the server through the re-created first socket interface based on the connection identifier of the first data connection to establish a second data connection; similarly, the server also communicates with the server based on the second data connection. terminal for data transmission. In this way, the data connection between the terminal and the server is migrated from the first data connection to the second data connection.
这里,第二数据连接的连接标识与第一数据连接的连接标识相一致,保证在IP地址发生变更时,终端和服务器之间仍可通过连接标识进行数据传输,避免出现由于IP地址变更导致数据连接断连的情况。该第二数据连接和第一数据连接,实则为终端与服务器之间所建立的数据连接对应的多个网络路径,这里将终端与服务器间的数据连接由第一数据连接迁移至第二数据连接,实则是通过连接标识,将终端与服务器间的数据连接从原始网络路径迁移至新的网络路径、且保证数据连接迁移过程中数据能够正常传输,从而实现了IP地址的无感知切换。Here, the connection identifier of the second data connection is consistent with the connection identifier of the first data connection, which ensures that when the IP address changes, data transmission between the terminal and the server can still be performed through the connection identifier, so as to avoid the occurrence of data transmission caused by the change of the IP address. The connection is disconnected. The second data connection and the first data connection are actually multiple network paths corresponding to the data connection established between the terminal and the server. Here, the data connection between the terminal and the server is migrated from the first data connection to the second data connection In fact, through the connection identifier, the data connection between the terminal and the server is migrated from the original network path to the new network path, and the data can be transmitted normally during the data connection migration process, thereby realizing the non-aware switching of IP addresses.
这里,终端可通过如下方式确定终端的IP地址是否发生变更:对终端的IP地址对应的原始套接字接口的数据传输失败事件、以及IP地址的变更通知消息中至少之一进行监听;当监听到IP地址对应的原始套接字接口的数据传输失败事件、以及IP地址的的变更通知消息中至少之一时,则确定终端的IP地址发生了变更。Here, the terminal can determine whether the IP address of the terminal is changed by the following methods: monitor at least one of the data transmission failure event of the original socket interface corresponding to the IP address of the terminal and the change notification message of the IP address; When at least one of the data transmission failure event to the raw socket interface corresponding to the IP address and the change notification message of the IP address, it is determined that the IP address of the terminal has changed.
在实际应用中,可在每个操作系统(包括Windows/Mac/Android/iOS系统)下,根据各操作系统的代码逻辑,分别实现IP地址的变更通知消息的监听。从而当终端监听到IP地址的变更通知消息时,则确定终端的IP地址发生了变更。In practical applications, under each operating system (including Windows/Mac/Android/iOS system), according to the code logic of each operating system, the monitoring of IP address change notification messages can be implemented separately. Therefore, when the terminal monitors the change notification message of the IP address, it is determined that the IP address of the terminal is changed.
在实际应用中,还可针对各操作系统,设置通用的IP地址变更监听方式,即对IP地址对应的原始套接字接口的数据传输失败事件进行监听。当监听到IP地址对应的原始套接字接口的数据传输失败事件时,则确定终端的IP地址发生了变更。如此,则不需要针对不同的操作系统分别实现相应的IP地址的变更通知消息的监听,降低实现逻辑的复杂性,提高效率。In practical applications, a general IP address change monitoring method can also be set for each operating system, that is, monitoring the data transmission failure event of the raw socket interface corresponding to the IP address. When the data transmission failure event of the raw socket interface corresponding to the IP address is monitored, it is determined that the IP address of the terminal has changed. In this way, it is not necessary to implement monitoring of corresponding IP address change notification messages for different operating systems, thereby reducing the complexity of implementation logic and improving efficiency.
在一些实施例中,建立与终端间的第二数据连接之后,服务器可通过如下方式对所建立的第二数据连接进行路径验证:基于连接标识,通过第二数据连接,发送包括第一验证信息的探测数据包至终端;接收到终端针对探测数据包返回的响应数据包,响应数据包包括第二验证信息;基于第二验证信息对第一验证信息进行验证,当得到表征验证通过的验证结果时,基于第二数据连接进行与终端间的数据传输。In some embodiments, after establishing the second data connection with the terminal, the server may perform path verification on the established second data connection in the following manner: based on the connection identifier, through the second data connection, send information including the first verification information The detection data packet sent by the terminal is sent to the terminal; the response data packet returned by the terminal for the detection data packet is received, and the response data packet includes the second verification information; the first verification information is verified based on the second verification information, and the verification result indicating that the verification is passed is obtained. At the time, data transmission with the terminal is performed based on the second data connection.
在实际应用中,当终端与服务器间的数据连接发生迁移后,即由第一数据连接迁移至第二数据连接后,需要对第二数据连接进行路径验证,即验证第二数据连接的数据可达性。这里,数据可达性的验证,即为验证第二数据连接是否能够支持数据在终端和服务器之间传输,即终端或服务器分别作为接收方时,是否能够接收到发送方所发送的数据。In practical applications, after the data connection between the terminal and the server is migrated, that is, after the data connection is migrated from the first data connection to the second data connection, it is necessary to perform path verification on the second data connection, that is, to verify that the data of the second data connection can be verified. reachability. Here, the verification of data reachability is to verify whether the second data connection can support data transmission between the terminal and the server, that is, whether the terminal or the server can receive the data sent by the sender when the terminal or the server is the receiver respectively.
具体地,服务器可基于终端与服务器间的数据连接的连接标识,通过第二数据连接,发送包含第一验证信息的探测数据包至终端,在实际实施时,该第一验证信息为一个不可预测的随机值;终端接收到包含第一验证信息的探测数据包后,获取其中包含的第一验证信息,将该第一验证信息作为第二验证信息携带于针对探测数据包的响应数据包中返回至服务器。服务器接收到该响应数据包,获取该数据包中包含的第二验证信息,然后通过第一验证信息对第二验证信息进行验证,即判断第二验证信息与第一验证信息是否一致;当第二验证信息与第一验证信息一致时,则得到表征验证通过的验证结果,此时,则认为第二数据连接的数据可达。在后续的数据传输过程中,则基于第二数据连接进行与终端间的数据传输。Specifically, based on the connection identifier of the data connection between the terminal and the server, the server may send a probe data packet containing the first verification information to the terminal through the second data connection. In actual implementation, the first verification information is an unpredictable After receiving the probe packet containing the first verification information, the terminal obtains the first verification information contained therein, and carries the first verification information as the second verification information in the response packet for the probe packet and returns to the server. The server receives the response data packet, obtains the second verification information contained in the data packet, and then verifies the second verification information through the first verification information, that is, determines whether the second verification information is consistent with the first verification information; When the second verification information is consistent with the first verification information, a verification result indicating that the verification is passed is obtained, and at this time, it is considered that the data of the second data connection is reachable. In the subsequent data transmission process, data transmission with the terminal is performed based on the second data connection.
在一些实施例中,建立与终端间的第二数据连接之后,终端可通过如下方式对所建立的第二数据连接进行路径验证:接收到终端基于连接标识,通过第二数据连接传输的包括第三验证信息的探测数据包;发送针对探测数据包的响应数据包至终端,响应数据包包括第四验证信息;其中,该第四验证信息,用于供终端基于第三验证信息对第四验证信息进行验证,当得到表征验证通过的验证结果时,基于第二数据连接进行数据传输。In some embodiments, after establishing the second data connection with the terminal, the terminal may perform path verification on the established second data connection in the following manner: after receiving the terminal based on the connection identifier, the data transmitted through the second data connection includes the first Three detection data packets of verification information; send a response data packet for the detection data packet to the terminal, and the response data packet includes fourth verification information; wherein, the fourth verification information is used for the terminal to verify the fourth verification information based on the third verification information The information is verified, and when a verification result indicating that the verification is passed is obtained, data transmission is performed based on the second data connection.
在实际应用中,不只服务器需要针对第二数据连接的数据可达性进行验证,终端在IP地址变更后,也需要针对第二数据连接的数据可达性进行验证。具体地,终端基于终端与服务器间的数据连接的连接标识,通过第二数据连接,发送包含第三验证信息的探测数据包至服务器,在实际实施时,该第三验证信息为一个不可预测的随机值;服务器接收到包含第三验证信息的探测数据包后,获取其中包含的第三验证信息,将该第三验证信息作为第四验证信息携带于针对探测数据包的响应数据包中返回至终端。终端接收到该响应数据包,获取该数据包中包含的第四验证信息,然后通过第三验证信息对第四验证信息进行验证,即判断第四验证信息与第三验证信息是否一致;当第四验证信息与第三验证信息一致时,则得到表征验证通过的验证结果,此时,则认为第二数据连接的数据可达。在后续的数据传输过程中,则基于第二数据连接进行与终端间的数据传输。In practical applications, not only the server needs to verify the data reachability of the second data connection, but the terminal also needs to verify the data reachability of the second data connection after the IP address is changed. Specifically, based on the connection identifier of the data connection between the terminal and the server, the terminal sends a probe data packet containing third verification information to the server through the second data connection. In actual implementation, the third verification information is an unpredictable Random value; after receiving the probe packet containing the third verification information, the server obtains the third verification information contained therein, and carries the third verification information as the fourth verification information in the response packet for the probe packet and returns to terminal. The terminal receives the response data packet, obtains the fourth verification information contained in the data packet, and then verifies the fourth verification information through the third verification information, that is, determines whether the fourth verification information is consistent with the third verification information; When the fourth verification information is consistent with the third verification information, a verification result indicating that the verification is passed is obtained, and at this time, it is considered that the data of the second data connection is reachable. In the subsequent data transmission process, data transmission with the terminal is performed based on the second data connection.
在一些实施例中,服务器还对目标互联网协议地址是否发生变更进行监测,得到监测结果,该目标互联网协议地址归属于与终端建立第一数据连接的服务器;当监测结果表征目标互联网协议地址发生变更时,针对变更后的目标互联网协议地址创建第二套接字接口,并基于第二套接字接口,建立与终端间的第三数据连接,以将与终端间的数据连接从第一数据连接迁移至第三数据连接;其中,第三数据连接的连接标识与第一数据连接的连接标识相一致。In some embodiments, the server also monitors whether the target Internet Protocol address is changed, and obtains a monitoring result, where the target Internet Protocol address belongs to the server that establishes the first data connection with the terminal; when the monitoring result indicates that the target Internet Protocol address is changed When the target Internet Protocol address is changed, a second socket interface is created, and based on the second socket interface, a third data connection with the terminal is established, so as to change the data connection with the terminal from the first data connection Migrating to a third data connection; wherein, the connection identifier of the third data connection is consistent with the connection identifier of the first data connection.
这里,服务器还可以对自身的IP地址,即目标互联网协议地址是否发生变更进行监测,得到监测结果。当服务器的目标IP地址发生变更时,由于和原始IP地址绑定的套接字接口(即socket)已经不能使用,此时,则需要针对变更后的IP地址,重新创建相应的第二套接字接口,并将重新创建的第二套接字接口与变更后的目标IP地址进行绑定,从而通过该重新创建的第二套接字接口进行数据包的传输。Here, the server may also monitor whether its own IP address, that is, the target Internet Protocol address, has changed, and obtain the monitoring result. When the target IP address of the server changes, the socket interface (ie socket) bound to the original IP address cannot be used. At this time, it is necessary to recreate the corresponding second socket for the changed IP address. word interface, and bind the re-created second socket interface with the changed target IP address, so as to transmit data packets through the re-created second socket interface.
基于此,服务器可通过重新创建的第二套接字接口,基于第一数据连接的连接标识,与终端进行数据传输,以建立第三数据连接;同样的,终端也基于该第三数据连接与服务器进行数据传输。如此,将终端与服务器间的数据连接由第一数据连接迁移至第三数据连接。Based on this, the server can perform data transmission with the terminal based on the connection identifier of the first data connection through the re-created second socket interface to establish a third data connection; similarly, the terminal also communicates with the terminal based on the third data connection. server for data transfer. In this way, the data connection between the terminal and the server is migrated from the first data connection to the third data connection.
这里,第三数据连接的连接标识与第一数据连接的连接标识相一致,保证在IP地址发生变更时,终端和服务器之间仍可通过连接标识进行数据传输,避免出现由于IP地址变更导致数据连接断连的情况。该第三数据连接和第一数据连接,实则为终端与服务器之间所建立的数据连接对应的多个网络路径,这里将终端与服务器间的数据连接由第一数据连接迁移至第三数据连接,实则是通过连接标识,将终端与服务器间的数据连接从原始网络路径迁移至新的网络路径、且保证数据连接迁移过程中数据能够正常传输,从而实现了IP地址的无感知切换。Here, the connection identifier of the third data connection is consistent with the connection identifier of the first data connection, which ensures that when the IP address changes, data transmission between the terminal and the server can still be performed through the connection identifier, so as to avoid the occurrence of data transmission caused by the change of the IP address. The connection is disconnected. The third data connection and the first data connection are actually multiple network paths corresponding to the data connection established between the terminal and the server. Here, the data connection between the terminal and the server is migrated from the first data connection to the third data connection In fact, through the connection identifier, the data connection between the terminal and the server is migrated from the original network path to the new network path, and the data can be transmitted normally during the data connection migration process, thereby realizing the non-aware switching of IP addresses.
在一些实施例中,服务器可通过如下方式对目标互联网协议地址是否发生变更进行监测,得到监测结果:对目标互联网协议地址对应的原始套接字接口的数据传输失败事件、以及目标互联网协议地址的变更通知消息中至少之一进行监测;当监测到目标互联网协议地址对应的原始套接字接口的数据传输失败事件、以及目标互联网协议地址的变更通知消息中至少之一时,得到表征目标互联网协议地址发生变更的监测结果。In some embodiments, the server may monitor whether the target Internet Protocol address has changed, and obtain the monitoring result: the data transmission failure event of the raw socket interface corresponding to the target Internet Protocol address, and the data transmission failure of the target Internet Protocol address. At least one of the change notification messages is monitored; when at least one of the data transmission failure event of the raw socket interface corresponding to the target Internet Protocol address and the change notification message of the target Internet Protocol address are monitored, a representative target Internet Protocol address is obtained. Changed monitoring results.
在一些实施例中,服务器建立与终端间的第三数据连接之后,可通过如下方式对第三数据连接的数据可达性进行验证:基于连接标识,对第三数据连接的数据可达性进行验证,得到验证结果;当验证结果表征第三数据连接的数据可达时,基于第三数据连接进行与终端间的数据传输。In some embodiments, after the server establishes the third data connection with the terminal, the data reachability of the third data connection may be verified in the following manner: based on the connection identifier, the data reachability of the third data connection is verified. After verification, a verification result is obtained; when the verification result indicates that the data of the third data connection is reachable, data transmission with the terminal is performed based on the third data connection.
在实际应用中,当终端与服务器间的数据连接发生迁移后,即由第一数据连接迁移至第三数据连接后,需要对第三数据连接进行路径验证,即验证第三数据连接的数据可达性。这里,数据可达性的验证,即为验证第三数据连接是否能够支持数据在终端和服务器之间传输,即终端或服务器分别作为接收方时,是否能够接收到发送方所发送的数据。具体地,第三数据连接的路径验证方式也可以采用第二数据连接的路径验证方式,在本申请实施例中将不再赘述。In practical applications, after the data connection between the terminal and the server is migrated, that is, after the data connection is migrated from the first data connection to the third data connection, it is necessary to perform path verification on the third data connection, that is, to verify that the data of the third data connection can be verified. reachability. Here, the verification of data reachability is to verify whether the third data connection can support data transmission between the terminal and the server, that is, whether the terminal or the server can receive the data sent by the sender when the terminal or the server is respectively the receiver. Specifically, the path verification method of the third data connection may also adopt the path verification method of the second data connection, which will not be repeated in the embodiments of the present application.
应用本申请上述实施例,创建与终端间用于数据传输的第一数据连接,该第一数据连接的连接标识,在终端的互联网协议地址或端口发生变化时保持不变;当接收到该终端基于第一数据连接传输的数据包时,对该数据包进行解析,以确定该数据包对应的数据类型;当确定数据包的数据类型为不可靠数据类型时,则控制不向该终端返回对应数据包的接收响应消息。如此,通过解析数据包的数据类型,针对不可靠数据类型的数据包,则不返回对应的接收响应消息,从而避免了终端重传不可靠数据类型的数据包的情况,减少网络资源的不必要占用,提高网络资源的利用率。By applying the above embodiments of the present application, a first data connection for data transmission with the terminal is created, and the connection identifier of the first data connection remains unchanged when the Internet Protocol address or port of the terminal changes; When the data packet is transmitted based on the first data connection, the data packet is parsed to determine the data type corresponding to the data packet; when it is determined that the data type of the data packet is an unreliable data type, the control is not to return the corresponding data type to the terminal. Packet receive response message. In this way, by analyzing the data type of the data packet, for the data packet of the unreliable data type, the corresponding reception response message is not returned, thereby avoiding the situation that the terminal retransmits the data packet of the unreliable data type and reducing unnecessary network resources. Occupy, improve the utilization of network resources.
下面继续说明本申请实施例提供的数据传输方法。在一些实施例中,本申请实施例提供的数据传输方法可由服务器或终端单独实施,或由服务器及终端协同实施,下面以终端实施为例说明本申请实施例提供的数据传输方法。参见图3B,图3B是本申请实施例提供的数据传输方法的流程示意图,本申请实施例提供的数据传输方法包括:The following continues to describe the data transmission method provided by the embodiments of the present application. In some embodiments, the data transmission method provided by the embodiments of the present application may be implemented by the server or the terminal alone, or by the server and the terminal in cooperation. The data transmission method provided by the embodiments of the present application is described below by taking the terminal implementation as an example. Referring to FIG. 3B , FIG. 3B is a schematic flowchart of a data transmission method provided by an embodiment of the present application. The data transmission method provided by an embodiment of the present application includes:
步骤201:终端创建与服务器间用于数据传输的第一数据连接。Step 201: The terminal creates a first data connection with the server for data transmission.
其中,该第一数据连接的连接标识,在服务器的互联网协议地址或端口发生变化时保持不变。The connection identifier of the first data connection remains unchanged when the Internet Protocol address or port of the server changes.
这里,终端在与服务器进行数据通信之前,可以预先创建服务器与终端之间的用于数据传输的第一数据连接。在第一数据连接创建完成后,服务器与终端通过该第一数据连接进行数据包的发送与接收。在实际应用中,终端可以设置有应用客户端,比如会议客户端、学习客户端等,该服务器可以为相应的应用客户端的后台服务器。Here, before the terminal performs data communication with the server, a first data connection for data transmission between the server and the terminal may be created in advance. After the first data connection is created, the server and the terminal send and receive data packets through the first data connection. In practical applications, the terminal may be provided with an application client, such as a conference client, a learning client, etc., and the server may be a background server of the corresponding application client.
在本申请实施例中,该第一数据连接的连接标识,在终端和服务器中任一方的互联网协议地址(即IP地址)或端口发送变化时保持不变,即在终端和服务器中任一方的IP地址或端口发送变化时,该终端与服务器之间的数据通道并不会断,双方均可基于该第一数据连接的连接标识进行数据包的传输。如此,当终端或者服务器的IP地址发生变更时,并不影响双方之间的数据传输,而对于用户来说,IP地址的变更是无感知的,也不会出现网络断连、需要重新连接等情况。In the embodiment of the present application, the connection identifier of the first data connection remains unchanged when the Internet Protocol address (that is, the IP address) or the port of any one of the terminal and the server is changed, that is, the connection between the terminal and the server is changed. When the IP address or port changes, the data channel between the terminal and the server will not be interrupted, and both parties can transmit data packets based on the connection identifier of the first data connection. In this way, when the IP address of the terminal or server is changed, it does not affect the data transmission between the two parties, and for the user, the change of the IP address is insensitive, and there will be no network disconnection, need to reconnect, etc. Happening.
在实际应用中,该第一数据连接是基于QUIC协议建立的,QUIC连接的连接标识是一个64位的连接ID,用户在Wi-Fi和蜂窝网络(即Celluar)之间切换时,无论是IP地址或者端口(Port)发生变化,QUIC连接中的连接ID保持不变,终端与服务器双方仍可基于该QUIC连接的连接标识进行数据包的传输,因此不需要重新经过协议握手等过程创建连接,如此QUIC连接迁移可达到用户无感知的网络类型切换的技术效果。In practical applications, the first data connection is established based on the QUIC protocol, and the connection identifier of the QUIC connection is a 64-bit connection ID. When the address or port (Port) changes, the connection ID in the QUIC connection remains unchanged, and both the terminal and the server can still transmit data packets based on the connection identifier of the QUIC connection, so there is no need to re-create the connection through the protocol handshake and other processes. In this way, QUIC connection migration can achieve the technical effect of network type switching without user perception.
步骤202:基于第一数据连接,发送数据包至服务器。Step 202: Based on the first data connection, send a data packet to the server.
其中,该数据包的数据类型包括不可靠数据类型,该不可靠数据类型,用于当服务器确定数据包的数据类型为不可靠数据类型时,控制不返回对应数据包的接收响应消息。The data type of the data packet includes an unreliable data type, and the unreliable data type is used to control not to return a reception response message corresponding to the data packet when the server determines that the data type of the data packet is an unreliable data type.
当终端与服务器间的第一数据连接建立后,终端通过第一数据连接,发送数据包至服务器。在本申请实施例中,该第一数据连接既可支持可靠数据传输,也可支持不可靠数据传输。当需要发送可靠数据(比如握手时期的数据、握手成功后的信令数据等)时,可以将数据封装成可靠数据类型的数据包;当需要发送不可靠数据(比如音视频数据、频繁移动的坐标数据等)时,可以将数据封装成不可靠数据类型的数据包。具体地,可靠数据类型的数据包和不可靠数据类型的数据包采用不同的封包格式,且数据包中携带用于指示数据类型的报文字段,该报文字段用于存放用于指示数据类型的数据标识,即不同数据类型的数据包的数据标识是不同的。After the first data connection between the terminal and the server is established, the terminal sends a data packet to the server through the first data connection. In this embodiment of the present application, the first data connection can support both reliable data transmission and unreliable data transmission. When reliable data needs to be sent (such as data during handshake, signaling data after successful handshake, etc.), the data can be encapsulated into data packets of reliable data type; when unreliable data needs to be sent (such as audio and video data, frequently moving coordinate data, etc.), the data can be encapsulated into packets of unreliable data types. Specifically, the data packets of the reliable data type and the data packets of the unreliable data type adopt different packet formats, and the data packets carry a message field used to indicate the data type, and the message field is used to store the data used to indicate the data type. , that is, the data identifiers of data packets of different data types are different.
这里,该可靠数据类型的数据包,即为传输过程中严格要求的不可丢弃的数据(比如握手时期的数据、握手成功后的信令数据等),具体是需要采用可靠传输方式进行传输的数据;该不可靠数据类别的数据包,即为传输过程中可以部分丢弃的数据(比如音视频数据、频繁移动的坐标数据等),具体是需要采用非可靠传输方式进行传输的数据。这里,可靠传输方式所传输的数据,如果因为网络抖动或者拥塞等原因,接收端没有接收到数据,则发送方需要重传该数据,其中,是否接收到该数据根据接收方是否回复ACK等响应消息来判断;而非可靠传输方式是与可靠传输方式相对应的一种传输方式,非可靠传输方式的发送方不管接收方是否接收到数据,只管发送。Here, the data packet of the reliable data type is the data that cannot be discarded strictly required in the transmission process (such as the data during the handshake period, the signaling data after the handshake is successful, etc.), and specifically the data that needs to be transmitted by a reliable transmission method. ; The data packets of the unreliable data category are the data that can be partially discarded during the transmission process (such as audio and video data, frequently moving coordinate data, etc.), specifically the data that needs to be transmitted in an unreliable transmission mode. Here, for the data transmitted by the reliable transmission method, if the receiver does not receive the data due to network jitter or congestion, etc., the sender needs to retransmit the data. Whether the data is received depends on whether the receiver responds with ACK or not. The unreliable transmission method is a transmission method corresponding to the reliable transmission method. The sender of the unreliable transmission method just sends the data regardless of whether the receiver receives the data or not.
服务器在接收到终端基于第一数据连接发送的数据包后,对数据包进行解析,以确定数据包对应的数据类型。从而针对不同数据类型的数据包,采用不同的数据处理方式进行处理。当确定所接收的数据包的数据类型为不可靠数据类型时,则服务器控制不向该终端返回对应数据包的接收响应消息。相应的,终端针对不可靠数据类型的数据包尽管发送即可。After receiving the data packet sent by the terminal based on the first data connection, the server parses the data packet to determine the data type corresponding to the data packet. Therefore, different data processing methods are used for processing data packets of different data types. When it is determined that the data type of the received data packet is an unreliable data type, the server controls not to return a reception response message corresponding to the data packet to the terminal. Correspondingly, the terminal may send data packets of unreliable data types as long as they are.
当确定所接收的数据包的数据类型为可靠数据类型时,则服务器向该终端返回对应数据包的接收响应消息,以通知终端已接收到该数据包。相应的,若终端未接收到针对该数据包的接收响应消息,则重新发送该数据包至服务器。When it is determined that the data type of the received data packet is a reliable data type, the server returns a reception response message corresponding to the data packet to the terminal to notify the terminal that the data packet has been received. Correspondingly, if the terminal does not receive a reception response message for the data packet, the terminal resends the data packet to the server.
应用本申请上述实施例,创建与终端间用于数据传输的第一数据连接,该第一数据连接的连接标识,在终端的互联网协议地址或端口发生变化时保持不变;当接收到该终端基于第一数据连接传输的数据包时,对该数据包进行解析,以确定该数据包对应的数据类型;当确定数据包的数据类型为不可靠数据类型时,则控制不向该终端返回对应数据包的接收响应消息。如此,通过解析数据包的数据类型,针对不可靠数据类型的数据包,则不返回对应的接收响应消息,从而避免了终端重传不可靠数据类型的数据包的情况,减少网络资源的不必要占用,提高网络资源的利用率。By applying the above embodiments of the present application, a first data connection for data transmission with the terminal is created, and the connection identifier of the first data connection remains unchanged when the Internet Protocol address or port of the terminal changes; When the data packet is transmitted based on the first data connection, the data packet is parsed to determine the data type corresponding to the data packet; when it is determined that the data type of the data packet is an unreliable data type, the control is not to return the corresponding data type to the terminal. Packet receive response message. In this way, by analyzing the data type of the data packet, for the data packet of the unreliable data type, the corresponding reception response message is not returned, thereby avoiding the situation that the terminal retransmits the data packet of the unreliable data type and reducing unnecessary network resources. Occupy, improve the utilization of network resources.
接下来继续对本申请实施例提供的数据传输方法进行说明,本申请实施例提供的数据传输方法可以由终端及服务器协同实施。参见图4,图4为本申请实施例提供的数据传输方法的流程示意图,本申请实施例提供的数据传输方法包括:Next, the data transmission method provided by the embodiment of the present application will be described. The data transmission method provided by the embodiment of the present application may be implemented by the terminal and the server in cooperation. Referring to FIG. 4, FIG. 4 is a schematic flowchart of a data transmission method provided by an embodiment of the present application. The data transmission method provided by an embodiment of the present application includes:
步骤301:终端与服务器建立用于数据传输的第一数据连接。Step 301: The terminal and the server establish a first data connection for data transmission.
步骤302:终端基于第一数据连接,发送数据包至服务器。Step 302: The terminal sends a data packet to the server based on the first data connection.
步骤303:服务器接收到终端基于第一数据连接传输的数据包,对数据包进行解析,确定数据包对应的数据类型。Step 303: The server receives the data packet transmitted by the terminal based on the first data connection, parses the data packet, and determines the data type corresponding to the data packet.
步骤304:判断数据包对应的数据类型是否为不可靠数据类型,若否,执行步骤305;若是,执行步骤306。Step 304: Determine whether the data type corresponding to the data packet is an unreliable data type, if not, go to Step 305; if yes, go to
步骤305:向终端返回对应数据包的接收响应消息。Step 305: Return a reception response message corresponding to the data packet to the terminal.
步骤306:控制不向终端返回对应数据包的接收响应消息。Step 306: Control not to return a reception response message corresponding to the data packet to the terminal.
步骤307:终端接收到对应数据包的接收响应消息。Step 307: The terminal receives a reception response message corresponding to the data packet.
应用本申请上述实施例,创建与终端间用于数据传输的第一数据连接,该第一数据连接的连接标识,在终端的互联网协议地址或端口发生变化时保持不变;当接收到该终端基于第一数据连接传输的数据包时,对该数据包进行解析,以确定该数据包对应的数据类型;当确定数据包的数据类型为不可靠数据类型时,则控制不向该终端返回对应数据包的接收响应消息。如此,通过解析数据包的数据类型,针对不可靠数据类型的数据包,则不返回对应的接收响应消息,从而避免了终端重传不可靠数据类型的数据包的情况,减少网络资源的不必要占用,提高网络资源的利用率。By applying the above embodiments of the present application, a first data connection for data transmission with the terminal is created, and the connection identifier of the first data connection remains unchanged when the Internet Protocol address or port of the terminal changes; When the data packet is transmitted based on the first data connection, the data packet is parsed to determine the data type corresponding to the data packet; when it is determined that the data type of the data packet is an unreliable data type, the control is not to return the corresponding data type to the terminal. Packet receive response message. In this way, by analyzing the data type of the data packet, for the data packet of the unreliable data type, the corresponding reception response message is not returned, thereby avoiding the situation that the terminal retransmits the data packet of the unreliable data type and reducing unnecessary network resources. Occupy, improve the utilization of network resources.
下面将说明本申请实施例在一个实际的应用场景中的示例性应用。An exemplary application of the embodiments of the present application in a practical application scenario will be described below.
接下来在对本申请实施例提供的数据传输方法进行说明之前,首先说明本申请实施例提供的用于数据传输的长连接的创建方法。如图5所示,图5是本申请实施例提供的用于数据传输的长连接的创建方法的流程示意图,包括:Next, before describing the data transmission method provided by the embodiment of the present application, the method for creating a persistent connection for data transmission provided by the embodiment of the present application is first described. As shown in FIG. 5 , FIG. 5 is a schematic flowchart of a method for creating a persistent connection for data transmission provided by an embodiment of the present application, including:
步骤401:客户端发送SYN握手信号至服务器。Step 401: The client sends a SYN handshake signal to the server.
步骤402:服务器返回应答信号SYN+ACK至客户端,以表示接收到SYN握手信号。Step 402: The server returns a response signal SYN+ACK to the client to indicate that the SYN handshake signal is received.
步骤403:客户端发送ACK响应信号至服务器,以建立与服务器间的TCP连接。Step 403: The client sends an ACK response signal to the server to establish a TCP connection with the server.
这里,在实际应用中,该客户端可以是会议客户端,用户可通过终端安装并运行该客户端,实现相应的客户端功能。作为示例,参见图6,图6是本申请实施例提供的客户端的应用示意图,这里,该客户端为会议客户端中,包括预定会议、加入会议、会议中打开摄像头、麦克风等功能场景,该每个场景下均需要客户端和服务器建立长连接来进行数据的交互和传输。因此,客户端需要与服务器之间建立长连接,在本申请实施例中,该长连接可通过TCP+TLS+XMPP共同建立实现,其中,上述步骤401-403即为TCP协议的握手流程,在经过步骤401-403后,则客户端与服务器之间建立了TCP连接。Here, in practical applications, the client can be a conference client, and the user can install and run the client through the terminal to implement corresponding client functions. As an example, referring to FIG. 6, FIG. 6 is a schematic diagram of an application of a client provided by an embodiment of the present application. Here, the client is a conference client, including functional scenarios such as booking a conference, joining a conference, and turning on a camera and a microphone during the conference. In each scenario, the client and the server need to establish a long connection for data interaction and transmission. Therefore, the client needs to establish a long connection with the server, and in this embodiment of the present application, the long connection can be realized by jointly establishing TCP+TLS+XMPP, wherein the above steps 401-403 are the handshake process of the TCP protocol. After steps 401-403, a TCP connection is established between the client and the server.
具体地,参见图7,图7是本申请实施例提供的TCP连接的建立流程示意图,包括:Specifically, referring to FIG. 7 , FIG. 7 is a schematic flowchart of the establishment of a TCP connection provided by an embodiment of the present application, including:
步骤501:客户端发送SYN握手信号至服务器;步骤502:服务器返回应答信号SYN+ACK至客户端,以表示接收到SYN握手信号;步骤503:客户端发送ACK响应信号至服务器,以建立与服务器间的TCP连接;步骤504:客户端发送应用数据(Application Data)至服务器;步骤505:服务器返回应用数据(Application Data)至客户端。如此实现基于TCP连接的数据传输。Step 501: The client sends a SYN handshake signal to the server; Step 502: The server returns a response signal SYN+ACK to the client to indicate that the SYN handshake signal is received; Step 503: The client sends an ACK response signal to the server to establish a connection with the server Step 504: The client sends application data (Application Data) to the server; Step 505: The server returns the application data (Application Data) to the client. In this way, data transmission based on a TCP connection is realized.
步骤404:客户端发送问询数据包(XMPP Stream Start)至服务器,以请求服务器的流特征字段。Step 404: The client sends a query packet (XMPP Stream Start) to the server to request the stream feature field of the server.
这里,客户端与服务器之间建立了TCP连接后,开始执行XMPP握手流程。Here, after a TCP connection is established between the client and the server, the XMPP handshake process begins.
步骤405:服务器返回携带会话ID的应答数据包ACK。Step 405: The server returns a response data packet ACK carrying the session ID.
这里,该会话ID即为服务器为客户端本次会话所分配的标识。Here, the session ID is an identifier allocated by the server to the client for this session.
步骤406:服务器下发特征字段Server Feature(TLS)至客户端。Step 406: The server delivers the feature field Server Feature (TLS) to the client.
步骤407:客户端发送TLS握手的握手请求(TLS start)至服务器。Step 407: The client sends a handshake request (TLS start) of the TLS handshake to the server.
步骤408:服务器发送针对TLS握手的握手请求的响应信息ACK至客户端。Step 408: The server sends the response information ACK of the handshake request for the TLS handshake to the client.
步骤409:客户端发送客户端问询数据包Client Hello至服务器。Step 409: The client sends a client query data packet Client Hello to the server.
这里,该Client Hello数据包携带客户端的随机数random、密码套件ciph ers以及可用的协议版本号version等信息。Here, the Client Hello data packet carries information such as the random number random of the client, the cipher suite ciphers, and the available protocol version number.
步骤410:服务器返回服务器问询数据包Server Hello至客户端。Step 410: The server returns the server query data packet Server Hello to the client.
这里,该Server Hello数据包携带服务器的随机数random、密码套件ciph ers以及证书cert等信息。Here, the Server Hello data packet carries information such as random number random, cipher suite ciphers, and certificate cert of the server.
步骤411:客户端发送客户端问询结束数据包Client Hello Finish至服务器。Step 411: The client sends a client query end packet Client Hello Finish to the server.
步骤412:服务器返回服务器问询结束数据包Server Hello Finish至客户端。Step 412: The server returns the server query end packet Server Hello Finish to the client.
这里,客户端和服务器之间执行标准TLS握手,并在握手完成后,建立TLS连接,以实现通道的TLS加密。Here, a standard TLS handshake is performed between the client and the server, and after the handshake is completed, a TLS connection is established to implement TLS encryption of the channel.
具体地,参见图8,图8是本申请实施例提供的TLS连接的建立流程示意图,包括:步骤601:客户端发送客户端问询数据包Client Hello至服务器;步骤602:服务器返回服务器问询数据包Server Hello至客户端;步骤603:客户端发送客户端问询结束数据包ClientHello Finish至服务器;步骤604:服务器返回服务器问询结束数据包Server HelloFinish至客户端;步骤605:客户端发送应用数据至服务器;步骤606:服务器返回应用数据至客户端。如此实现基于TLS连接的数据加密传输,保证数据安全性。Specifically, referring to FIG. 8, FIG. 8 is a schematic diagram of a TLS connection establishment process provided by an embodiment of the present application, including: Step 601: the client sends a client query data packet Client Hello to the server; Step 602: the server returns a server query The data packet Server Hello is sent to the client; Step 603: The client sends the client query end packet ClientHello Finish to the server; Step 604: The server returns the server query end packet Server HelloFinish to the client; Step 605: The client sends the application data to the server; Step 606: the server returns the application data to the client. In this way, data encryption transmission based on TLS connection is implemented to ensure data security.
步骤413:客户端发送问询数据包Stream Request至服务器,以请求服务器下发流特征字段并进行SASL认证。Step 413: The client sends a query data packet Stream Request to the server, so as to request the server to deliver the stream feature field and perform SASL authentication.
步骤414:服务器发送包含流标志的响应数据包ACK至客户端。Step 414: The server sends a response packet ACK containing the flow flag to the client.
步骤415:服务器发送流特征字段Server Feature(SASL)至客户端,并携带所支持的SASL加密方式。Step 415: The server sends a stream feature field Server Feature (SASL) to the client, and carries the supported SASL encryption mode.
步骤416:客户端选择加密方式,并发送携带用户信息的SASL验证开始数据包(SASL challenge start)至服务器。Step 416: The client selects an encryption method, and sends a SASL verification start packet (SASL challenge start) carrying user information to the server.
这里,在实际应用中,客户端从所支持的SASL加密方式中选择PLAIN加密方式。Here, in practical applications, the client selects the PLAIN encryption method from the supported SASL encryption methods.
步骤417:服务器发送针对接收到的数据包的SASL验证结束数据包(SA SLchallenge end)至客户端。Step 417: The server sends a SASL verification end packet (SA SLchallenge end) for the received packet to the client.
这里,服务器针对SASL的验证成功。Here, the authentication of the server against SASL is successful.
步骤418:客户端发送初始流Stream Request至服务器。Step 418: The client sends an initial stream Stream Request to the server.
步骤419:服务器发送给客户端流标志作为响应数据包ACK。Step 419: The server sends a stream flag to the client as a response packet ACK.
步骤420:服务器响应并返回支持的流特征字段Server Feature,以指示说明客户端需要开始绑定资源bind resource流程。Step 420: The server responds and returns the supported stream feature field Server Feature to indicate that the client needs to start the bind resource process.
步骤421:客户端发送绑定资源请求Bind Rosource Request至服务器。Step 421: The client sends a Bind Rosource Request to the server.
步骤422:服务器判断并返回绑定资源结果Bind Resourca Response至客户端。Step 422: The server judges and returns the binding resource result Bind Resource Response to the client.
步骤423:客户端发送应用数据Application Data至服务器。Step 423: The client sends Application Data to the server.
步骤424:服务器返回应用数据Application Data至客户端。Step 424: The server returns Application Data to the client.
如此,上述用于数据传输的长连接是基于TCP+TLS协议和的长连接通信技术。其中,TCP协议提供了可靠传输通道,TLS加密协议为通道提供了安全保障。然而针对本申请实施例提供的上述用于数据传输的长连接的创建方法,申请人进一步分析发现,从图7和图8可以看出,在正式开始数据通信之前,TCP建立连接需要1.5个RTT,完成通道的TLS加密需要2个RTT,而基于上述流程建立用于数据传输的长连接(即客户端与服务器之间的长连接)一共需要11个RTT。In this way, the above-mentioned persistent connection for data transmission is based on the TCP+TLS protocol and the persistent connection communication technology. Among them, the TCP protocol provides a reliable transmission channel, and the TLS encryption protocol provides a security guarantee for the channel. However, with regard to the above-mentioned method for creating a long connection for data transmission provided by the embodiment of the present application, the applicant further analyzes and finds that, as can be seen from FIG. 7 and FIG. 8 , before the data communication is officially started, it takes 1.5 RTTs for TCP to establish a connection , 2 RTTs are required to complete the TLS encryption of the channel, and a total of 11 RTTs are required to establish a long connection for data transmission (ie, a long connection between the client and the server) based on the above process.
而统计数据表明,在正常网络情况下,只有69.9%的用户能够在1s之内完成握手过程,开始客户端的其他会议功能使用,整个握手过程,考虑到用户体验,连接建立的超时时间是30s,而所有登录失败的用户中,有41.53%的用户是因为连接建立超时导致登录失败,因为弱网情况下,RTT较大,如果连接建立的流程复杂的话必然导致完成握手的耗时较多,超时的可能性更大,因此,简化握手环节,减少登录耗时,提高登录成功率和弱网抗性是亟待解决的问题。Statistics show that under normal network conditions, only 69.9% of users can complete the handshake process within 1s and start other conference functions on the client side. During the whole handshake process, considering the user experience, the connection establishment timeout is 30s. Among all the users who failed to log in, 41.53% of the users failed to log in because the connection establishment timed out. Because the RTT is large in the case of weak network, if the connection establishment process is complicated, it will inevitably lead to more time consuming to complete the handshake and timeout. Therefore, simplifying the handshake process, reducing the login time, and improving the login success rate and weak network resistance are urgent problems to be solved.
且,目前客户端与服务器之间的长连接是基于TCP协议的,TCP协议使用一个四元组(源IP地址、目的IP地址、源端口和目的端口)来标识一个长连接。当用户设备网络在wifi和cellular之间切换时,源IP地址会发生变化,因此TCP协议连接无法支持在wifi和cellular之间无缝切换,也就导致一旦用户切换网络,整个长连接必须断开重连,否则数据无法继续传输,表现在客户端侧就是会出现“网络不稳定,正在连接”等掉线重连的情况,参见图9,图9是本申请实施例提供的互联网协议地址变更时客户端的表现示意图。在长连接断开重连期间,所有指令数据都无法发送接收,由于日常使用过程中,进出电梯等或者偶现wifi信号不好,导致wifi和cellular互相频繁切换的场景是非常常见的,如果每次都需要断开重连,会非常影响用户的体验。Moreover, the current persistent connection between the client and the server is based on the TCP protocol, and the TCP protocol uses a four-tuple (source IP address, destination IP address, source port and destination port) to identify a persistent connection. When the user equipment network switches between wifi and cellular, the source IP address will change, so the TCP protocol connection cannot support seamless switching between wifi and cellular, which means that once the user switches the network, the entire long connection must be disconnected Reconnect, otherwise the data cannot continue to be transmitted, which means that on the client side, there will be a disconnection and reconnection situation such as "the network is unstable and the connection is in progress", see Figure 9, Figure 9 is the Internet Protocol address change provided by the embodiment of this application Schematic diagram of the client's performance. During the long connection disconnection and reconnection period, all command data cannot be sent and received. Due to the daily use of elevators, etc., or the occasional poor WiFi signal, it is very common for WiFi and cellular to frequently switch to each other. It needs to be disconnected and reconnected every time, which will greatly affect the user experience.
基于此,本申请实施例还提供一种用于数据传输的长连接的创建方法,该用于数据传输的长连接的创建方法是基于QUIC协议建立的。接下来首先对本申请提供的QUIC连接的建立流程进行说明,如图10所示,图10是本申请实施例提供的QUIC连接的建立流程示意图,包括:Based on this, an embodiment of the present application further provides a method for creating a persistent connection for data transmission, where the method for creating a persistent connection for data transmission is established based on the QUIC protocol. Next, the establishment process of the QUIC connection provided by this application will be described first. As shown in FIG. 10, FIG. 10 is a schematic diagram of the establishment process of the QUIC connection provided by the embodiment of this application, including:
步骤701:客户端发送初始问询数据包Inchoate Client Hello至服务器。Step 701: The client sends an initial query data packet Inchoate Client Hello to the server.
步骤702:服务器返回针对初始问询数据包Inchoate Client Hello响应数据包Rejection至客户端。Step 702: The server returns the Inchoate Client Hello response data packet Rejection to the client for the initial query data packet.
步骤703:客户端发送完整问询数据包Complete Client Hello至服务器。Step 703: The client sends a complete query data packet Complete Client Hello to the server.
这里,该Complete Client Hello可以携带客户端的加密信息,并与加密的应用数据Encript Application Data一起发送至服务器,即表明在一个RTT内完成QUIC握手和数据加密的操作。Here, the Complete Client Hello can carry the encrypted information of the client and send it to the server together with the encrypted application data Encript Application Data, which means that the operations of QUIC handshake and data encryption are completed within one RTT.
步骤704:服务器基于Complete Client Hello返回加密应用数据Encript Application Data。Step 704: The server returns the encrypted application data Encript Application Data based on Complete Client Hello.
如图10所示,可知QUIC连接在建立时,只需要1个RTT,客户端接收到服务器发送的针对问询数据包Rejection之后,会在下次发送数据包时带上客户端的加密信息,并与应用数据一起发送至服务器,从而在一个RTT内完成QUI C握手和数据加密的操作,相较于TCP+TLS,减省了2.5个RTT。As shown in Figure 10, it can be seen that when the QUIC connection is established, only 1 RTT is required. After the client receives the Rejection for the query packet sent by the server, it will bring the encrypted information of the client when sending the packet next time, and communicate with it. The application data is sent to the server together to complete the QUI C handshake and data encryption operations in one RTT, which saves 2.5 RTTs compared to TCP+TLS.
如此,会议客户端与服务器之间的长连接可基于QUIC协议来实现,参见图11,图11是本申请实施例提供的用于数据传输的长连接的创建方法的流程示意图,包括:In this way, the persistent connection between the conference client and the server can be implemented based on the QUIC protocol. Referring to FIG. 11 , FIG. 11 is a schematic flowchart of a method for creating a persistent connection for data transmission provided by an embodiment of the present application, including:
步骤801:客户端发送初始问询数据包Inchoate Client Hello至服务器。Step 801: The client sends an initial query data packet Inchoate Client Hello to the server.
步骤802:服务器返回针对Inchoate Client Hello响应数据包Rejection至客户端。Step 802: The server returns the Inchoate Client Hello response data packet Rejection to the client.
步骤803:客户端发送问询数据包至服务器,以请求服务器的流特征字段;同时发送完整问询数据包Complete Client Hello至服务器。Step 803: The client sends an inquiry data packet to the server to request the flow characteristic field of the server; and at the same time sends a complete inquiry data packet Complete Client Hello to the server.
步骤804:服务器返回携带会话ID的应答数据包ACK;同时基于Comple te ClientHello返回加密应用数据Encript Application Data。Step 804: The server returns a response data packet ACK carrying the session ID; at the same time, the encrypted application data Encript Application Data is returned based on Complete ClientHello.
步骤805:客户端发送问询数据包Stream Request至服务器,以请求服务器的流特征字段。Step 805: The client sends a query data packet Stream Request to the server to request the stream feature field of the server.
步骤806:服务器发送流标志作为响应数据包ACK至客户端。Step 806: The server sends a flow flag as a response packet ACK to the client.
步骤807:服务器发送流特征字段Server Feature(SASL)至客户端,并携带所支持的SASL加密方式。Step 807: The server sends the stream feature field Server Feature (SASL) to the client, and carries the supported SASL encryption mode.
步骤808:客户端选择加密方式,并发送携带用户信息的SASL验证开始数据包(SASL challenge start)至服务器。Step 808: The client selects an encryption method, and sends a SASL verification start packet (SASL challenge start) carrying user information to the server.
这里,在实际应用中,客户端从所支持的SASL加密方式中选择PLAIN加密方式。Here, in practical applications, the client selects the PLAIN encryption method from the supported SASL encryption methods.
步骤809:服务器发送针对接收到的数据包的SASL验证结束数据包(SA SLchallenge end)至客户端。Step 809: The server sends a SASL verification end packet (SA SLchallenge end) for the received packet to the client.
这里,服务器针对SASL的验证成功。Here, the authentication of the server against SASL is successful.
步骤810:客户端发送初始流Stream Request至服务器。Step 810: The client sends an initial stream Stream Request to the server.
步骤811:服务器发送给客户端流标志作为响应数据包ACK。Step 811: The server sends a flow flag to the client as a response packet ACK.
步骤812:服务器响应并返回支持的流特征字段Server Feature,以指示说明客户端需要开始绑定资源bind resource流程。Step 812: The server responds and returns the supported stream feature field, Server Feature, to indicate that the client needs to start the bind resource process.
步骤813:客户端发送绑定资源请求Bind Rosource Request至服务器。Step 813: The client sends a Bind Rosource Request to the server.
步骤814:服务器判断并返回绑定资源结果Bind Resourca Response至客户端。Step 814: The server judges and returns the binding resource result Bind Resource Response to the client.
步骤815:客户端发送应用数据Application Data至服务器。Step 815: The client sends Application Data to the server.
步骤816:服务器返回应用数据Application Data至客户端。Step 816: The server returns Application Data to the client.
由此可见,引入QUIC协议的长连接建立的过程已经缩减到7个RTT,相较于上述图5所示的长连接建立的过程减少了4个RTT,而理论上长连接建立耗时则能够减少36%。It can be seen that the process of establishing a long-term connection with the introduction of the QUIC protocol has been reduced to 7 RTTs, which is 4 RTTs less than the process of establishing a long-term connection shown in Figure 5 above. 36% reduction.
同时,由于QUIC协议是使用连接标识(ConnectionID)来唯一标识一个连接的,当客户端源IP地址发生变更时(比如网络在wifi和cellular之间切换时),基于QUIC协议的长连接的连接标识不变,如此保持客户端和服务器之间的数据通道不断。具体地,参见图12,图12是本申请实施例提供的数据连接的连接迁移的流程示意图,包括:At the same time, since the QUIC protocol uses the connection ID (ConnectionID) to uniquely identify a connection, when the client source IP address changes (such as when the network switches between wifi and cellular), the connection ID of the long connection based on the QUIC protocol Unchanged, thus keeping the data channel between client and server constant. Specifically, referring to FIG. 12, FIG. 12 is a schematic flowchart of connection migration of a data connection provided by an embodiment of the present application, including:
步骤901:客户端针对IP1建立第一套接字接口socket,并将第一套接字接口socket与IP1绑定。Step 901: The client establishes a first socket interface socket for IP1, and binds the first socket interface socket with IP1.
步骤902:客户端发送应用数据请求Application Data Request至服务器。Step 902: The client sends an Application Data Request to the server.
步骤903:服务器返回针对应用数据请求的应用数据响应Application DataResponse至客户端。Step 903: The server returns an application data response Application DataResponse to the application data request to the client.
步骤904:客户端监听到网络状态更改通知network state change notify,由IP1变更为IP2。Step 904: The client monitors the network state change notify, and changes from IP1 to IP2.
步骤905:客户端针对IP2建立第二套接字接口socket,并将第二套接字接口socket与IP2绑定。Step 905: The client establishes a second socket interface socket for IP2, and binds the second socket interface socket with IP2.
这里,当客户端的网络在wifi和cellular之间切换时,客户端会收到系统的网络状态更改通知,此时IP1变更为IP2,原始IP1绑定的第一套接字接口soc ket已经无法继续通信。因此需要新建一个socket跟变更后的IP2进行绑定,以继续进行网络数据包的收发,同时还对第一套接字接口socket缓存中发送失败的数据包进行重发,从而完成客户端与服务器之间的数据连接的网络通道的迁移。在实际应用中,可在每个操作系统(包括Windows/Mac/Android/iOS系统)下,根据各操作系统的代码逻辑,分别实现IP地址的网络状态更改通知的监听。从而当客户端监听到IP地址的网络状态更改通知时,则确定客户端的IP地址发生了变更,从而及时创建新的socket以完成数据连接的迁移。Here, when the client's network switches between wifi and cellular, the client will receive the system's network status change notification. At this time, IP1 is changed to IP2, and the first socket interface socket bound to the original IP1 can no longer continue. communication. Therefore, it is necessary to create a new socket and bind the changed IP2 to continue to send and receive network data packets. At the same time, it also retransmits the failed data packets in the socket buffer of the first socket interface, so as to complete the client and server. Migration of network channels between data connections. In practical applications, under each operating system (including Windows/Mac/Android/iOS system), according to the code logic of each operating system, the monitoring of the network state change notification of the IP address can be realized respectively. Therefore, when the client monitors the network state change notification of the IP address, it is determined that the IP address of the client has changed, so that a new socket is created in time to complete the migration of the data connection.
步骤906:基于第二套接字接口socket实现数据连接的连接迁移connectio nmigration。Step 906: Implement connection migration of the data connection based on the second socket interface socket.
步骤907:客户端重传第一套接字接口socket缓存中发送失败的数据包。Step 907: The client retransmits the failed data packets in the socket buffer of the first socket interface.
步骤908:服务器返回应用数据响应至客户端。Step 908: The server returns an application data response to the client.
进一步地,参见图13,图13是本申请实施例提供的连接迁移的流程示意图,包括:Further, referring to FIG. 13, FIG. 13 is a schematic flowchart of connection migration provided by an embodiment of the present application, including:
步骤1001:客户端针对IP1建立第一套接字接口socket,并将第一套接字接口socket与IP1绑定。Step 1001: The client establishes a first socket interface socket for IP1, and binds the first socket interface socket with IP1.
步骤1002:客户端发送应用数据请求Application Data Request至服务器。Step 1002: The client sends an Application Data Request to the server.
步骤1003:服务器返回针对应用数据请求的应用数据响应Application Dat aResponse至客户端。Step 1003: The server returns an application data response Application Data Response to the application data request to the client.
步骤1004:客户端发送应用数据请求至服务器。Step 1004: The client sends an application data request to the server.
此时,客户端的网络在wifi和cellular之间切换,由IP1变更为IP2。At this point, the client's network switches between wifi and cellular, and changes from IP1 to IP2.
步骤1005:服务器返回应用数据响应发送失败,客户端监听到socket读取失败事件。Step 1005: The server returns the application data response sending failure, and the client listens to the socket read failure event.
步骤1006:客户端针对IP2建立第二套接字接口socket,并将第二套接字接口socket与IP2绑定。Step 1006: The client establishes a second socket interface socket for IP2, and binds the second socket interface socket with IP2.
步骤1007:基于第二套接字接口socket实现数据连接的连接迁移connecti onmigration。Step 1007: The connection migration of the data connection is implemented based on the second socket interface socket.
步骤1008:客户端重传第一套接字接口socket缓存中发送失败的数据包。Step 1008: The client retransmits the failed data packets in the socket buffer of the first socket interface.
步骤1009:服务器返回应用数据响应至客户端。Step 1009: The server returns an application data response to the client.
这里,客户端不再对操作系统的物理网络的网络状态变更通知进行监听,而是对socket读写失败事件进行监听,由此来判断当前是否需要重建socket绑定新的ip以进行网络数据传输。如此,既不需要分别监听4个平台(Windows/Mac/Android/iOS)的物理网络变化,又可以成功监测到网络切换导致的socket读写失败,并且及时建立新的传输通道完成连接迁移。Here, the client no longer monitors the network status change notification of the physical network of the operating system, but monitors the socket read and write failure events, thereby judging whether it is currently necessary to rebuild the socket and bind a new ip for network data transmission. . In this way, it is not necessary to monitor the physical network changes of the four platforms (Windows/Mac/Android/iOS) separately, but also can successfully monitor the socket read and write failure caused by network switching, and establish a new transmission channel in time to complete the connection migration.
继续地,在客户端和服务器之间的连接迁移后,还需要对迁移后的网络路径进行数据可达性验证。参见图14,图14是本申请实施例提供的路径验证的流程示意图,包括:Continuing, after the connection between the client and the server is migrated, it is also necessary to perform data reachability verification on the migrated network path. Referring to FIG. 14, FIG. 14 is a schematic flowchart of a path verification provided by an embodiment of the present application, including:
步骤1101:连接迁移之前,客户端通过IP1使用非探测包(Non-probing Packet)和服务器进行数据通信。Step 1101 : Before connection migration, the client uses a non-probing packet (Non-probing Packet) to communicate with the server through IP1.
这里,非探测包(Non-probing Packet)即为传输的应用数据相关的数据包。Here, a non-probing packet (Non-probing Packet) is a data packet related to the transmitted application data.
步骤1102:客户端的IP变成IP2,客户端发送包含路径验证帧PATH_CH ALLENGE帧的探测包(Probing Packet)至服务器,该PATH_CHALLENGE帧包含一个不可预测的随机值。Step 1102: The IP of the client becomes IP2, and the client sends a Probing Packet containing a path verification frame PATH_CHALLENGE frame to the server, and the PATH_CHALLENGE frame contains an unpredictable random value.
这里,当客户端的IP地址发生变更后并完成连接迁移后,客户端在迁移后的新的网络路径启动路径验证,验证新网络路径的数据可达性(即reachability)。Here, when the IP address of the client is changed and the connection migration is completed, the client starts path verification on the new network path after the migration to verify the data reachability (ie reachability) of the new network path.
步骤1103:服务器接收到客户端发送的包含PATH_CHALLENGE帧的探测包,返回响应探测包(Probing Packet)至客户端,并在响应探测包包含的路径响应帧PATH_RESPONSE帧携带通过PATH_CHALLENGE接收到的随机值。Step 1103: The server receives the probe packet including the PATH_CHALLENGE frame sent by the client, returns a Probing Packet to the client, and carries the random value received through the PATH_CHALLENGE in the PATH_RESPONSE frame included in the response probe packet.
这里,客户端接收到包含的PATH_RESPONSE的响应探测包,验证响应探测包的数据体payload里面的随机值是否与PATH_CHALLENGE帧的随机值一致,若一致,则表征路径的数据可达。Here, the client receives the response detection packet containing PATH_RESPONSE, and verifies whether the random value in the data body payload of the response detection packet is consistent with the random value of the PATH_CHALLENGE frame. If they are consistent, the data representing the path is reachable.
步骤1104:服务器发送包含PATH_CHALLENGE帧的探测包(Probing Pa cket)至客户端,该PATH_CHALLENGE帧包含一个不可预测的随机值。Step 1104: The server sends a Probing Packet containing a PATH_CHALLENGE frame to the client, and the PATH_CHALLENGE frame contains an unpredictable random value.
这里,服务器也需要发送PATH_CHALLENGE帧对客户端进行路径验证。Here, the server also needs to send a PATH_CHALLENGE frame to verify the path of the client.
步骤1105:客户端接收到客户端发送的包含PATH_CHALLENGE帧的探测包,返回响应探测包(Probing Packet)至服务器,并在响应探测包包含的PATH_RESPONSE帧携带通过PATH_CHALLENGE接收到的随机值。Step 1105: The client receives the probe packet including the PATH_CHALLENGE frame sent by the client, returns a response probe packet (Probing Packet) to the server, and carries the random value received through the PATH_CHALLENGE in the PATH_RESPONSE frame included in the response probe packet.
这里,服务器接收到包含的PATH_RESPONSE的响应探测包,验证响应探测包的数据体payload里面的随机值是否与PATH_CHALLENGE帧的随机值一致,若一致,则表征路径的数据可达。Here, the server receives the response probe packet containing PATH_RESPONSE, and verifies whether the random value in the data body payload of the response probe packet is consistent with the random value of the PATH_CHALLENGE frame. If they are consistent, the data representing the path is reachable.
步骤1106:连接迁移之后,客户端通过IP2使用非探测包(Non-probing Packet)和服务器进行数据通信。Step 1106 : After the connection is migrated, the client uses a non-probing packet (Non-probing Packet) to communicate with the server through IP2.
由此可见,基于QUIC协议之后的长连接能够做到在IP地址发生变更时实现连接迁移,即实现网络wifi和cellular之间的无缝切换,而不必重新建立连接。在实际应用中,用户在使用会议客户端的过程中若发生网络切换场景,音视频数据和开关麦克风/摄像头等等网络操作都可以直接续传,用户是完全无感知的,提高了用户体验。It can be seen that the long connection based on the QUIC protocol can achieve connection migration when the IP address changes, that is, to achieve seamless switching between network wifi and cellular without having to re-establish the connection. In practical applications, if a network switching scenario occurs during the user's use of the conference client, audio and video data and network operations such as switching the microphone/camera can be directly resumed, and the user is completely unaware, which improves the user experience.
在对本申请实施例提供的用于数据传输的长连接的创建方法说明结束后,接下来在对本申请实施例提供的数据传输方法进行说明。在本申请实施例中,该数据传输方法是基于QUIC协议的长连接实现的。After the description of the method for creating a persistent connection for data transmission provided by the embodiment of the present application is completed, the data transmission method provided by the embodiment of the present application is described next. In this embodiment of the present application, the data transmission method is implemented based on the persistent connection of the QUIC protocol.
相关技术中,对于信令等不可丢弃的数据,采用可靠传输方式进行传输;而对于其他不严格要求,可以部分丢弃的不可靠数据(例如音量大小的显示数据,频繁移动的坐标数据等),也同样和可靠数据复用同一条通道都进行可靠传输;那么在网络较差时,可靠传输通道的重传策略会给网络带来较大压力,并且会影响信令等可靠数据的正常传输。而如果为这种不可靠数据专门建立另一条非可靠通道,例如UDP通道等,客户端和服务器就需要同时维护两条通道的状态,导致增加新的通道握手时延,并且实现逻辑复杂,维护成本高。In the related art, for signaling and other data that cannot be discarded, reliable transmission is used for transmission; while for other unreliable data that can be partially discarded (such as volume display data, frequently moving coordinate data, etc.), The same channel is also used for reliable data multiplexing for reliable transmission; then when the network is poor, the retransmission strategy of the reliable transmission channel will bring greater pressure to the network, and will affect the normal transmission of reliable data such as signaling. If another unreliable channel, such as a UDP channel, is specially established for this kind of unreliable data, the client and the server need to maintain the states of the two channels at the same time, which leads to an increase in the handshake delay of the new channel, and the implementation logic is complex and maintenance. high cost.
基于此,本申请实施例提供一种数据传输方法,基于QUIC协议建立终端与服务器(即客户端与服务器)之间的数据连接,采用同一数据连接通道同时进行可靠传输和不可靠传输。具体地,在本申请实施例中,该客户端与服务器之间的数据连接既可支持可靠数据传输,也可支持不可靠数据传输。当需要发送可靠数据(比如握手时期的数据、握手成功后的信令数据,包括会议过程中摄像头、麦克风的开关操作指令等)时,可以将数据封装成可靠数据类型的数据包;当需要发送不可靠数据(比如音量大小的显示数据、频繁移动的坐标数据等)时,可以将数据封装成不可靠数据类型的数据包。具体地,可靠数据类型的数据包和不可靠数据类型的数据包采用不同的封包格式,且数据包中携带用于指示数据类型(包括可靠数据类型和不可靠数据类型)的标识,即可靠数据类型的数据包的标识、与不靠数据类型的数据包的标识是不同的。如图15所示,图15是本申请实施例提供的可靠帧格式和不可靠帧格式的示意图,其中图15中A图为可靠帧格式,图15中B图为不可靠帧格式。Based on this, an embodiment of the present application provides a data transmission method, which establishes a data connection between a terminal and a server (ie, a client and a server) based on the QUIC protocol, and uses the same data connection channel to perform reliable transmission and unreliable transmission at the same time. Specifically, in this embodiment of the present application, the data connection between the client and the server can support both reliable data transmission and unreliable data transmission. When reliable data needs to be sent (such as data during the handshake period, signaling data after a successful handshake, including switch operation instructions for cameras and microphones during the conference, etc.), the data can be encapsulated into data packets of reliable data types; When there is unreliable data (such as volume display data, frequently moving coordinate data, etc.), the data can be encapsulated into data packets of unreliable data type. Specifically, the data packets of the reliable data type and the data packets of the unreliable data type adopt different packet formats, and the data packets carry the identifier used to indicate the data type (including the reliable data type and the unreliable data type), that is, the reliable data The identification of the type of data packet is different from the identification of the data type-independent packet. As shown in FIG. 15 , FIG. 15 is a schematic diagram of a reliable frame format and an unreliable frame format provided by an embodiment of the present application, wherein picture A in FIG. 15 is a reliable frame format, and picture B in FIG. 15 is an unreliable frame format.
这里,该可靠数据类型的数据包,即为传输过程中严格要求的不可丢弃的数据(比如握手时期的数据、握手成功后的信令数据等),具体是需要采用可靠传输方式进行传输的数据;该不可靠数据类别的数据包,即为传输过程中可以部分丢弃的数据(比如音量大小的显示数据、频繁移动的坐标数据等),具体是需要采用非可靠传输方式进行传输的数据。这里,可靠传输方式所传输的数据,如果因为网络抖动或者拥塞等原因,接收端没有接收到数据,则发送方需要重传该数据,其中,是否接收到该数据根据接收方是否回复ACK等响应消息来判断;而不可靠传输方式是与可靠传输方式相对应的一种传输方式,不可靠传输方式的发送方不管接收方是否接收到数据,只管发送。Here, the data packet of the reliable data type is the data that cannot be discarded strictly required in the transmission process (such as the data during the handshake period, the signaling data after the handshake is successful, etc.), and specifically the data that needs to be transmitted by a reliable transmission method. ; The data packets of the unreliable data category are data that can be partially discarded during the transmission process (such as volume display data, frequently moving coordinate data, etc.), specifically the data that needs to be transmitted in an unreliable transmission mode. Here, for the data transmitted by the reliable transmission method, if the receiver does not receive the data due to network jitter or congestion, etc., the sender needs to retransmit the data. Whether the data is received depends on whether the receiver responds with ACK or not. The unreliable transmission method is a transmission method corresponding to the reliable transmission method. The sender of the unreliable transmission method just sends the data regardless of whether the receiver receives the data or not.
具体地,当服务器确定所接收的数据包的数据类型为不可靠数据类型时,则服务器不向该终端返回对应数据包的接收响应消息。相应的,终端针对不可靠数据类型的数据包尽管发送即可。当服务器确定所接收的数据包的数据类型为可靠数据类型时,则服务器向该终端返回对应数据包的接收响应消息,以通知终端已接收到该数据包。相应的,若终端未接收到针对该数据包的接收响应消息,则重新发送该数据包至服务器。Specifically, when the server determines that the data type of the received data packet is an unreliable data type, the server does not return a reception response message corresponding to the data packet to the terminal. Correspondingly, the terminal may send data packets of unreliable data types as long as they are. When the server determines that the data type of the received data packet is a reliable data type, the server returns a reception response message corresponding to the data packet to the terminal to notify the terminal that the data packet has been received. Correspondingly, if the terminal does not receive a reception response message for the data packet, the terminal resends the data packet to the server.
以远程控制为例,参见图16,图16是本申请实施例提供的应用于远程控制的数据传输的流程示意图,包括:Taking remote control as an example, see FIG. 16 . FIG. 16 is a schematic flowchart of data transmission applied to remote control provided by an embodiment of the present application, including:
步骤1201:第一客户端和第二客户端均与服务器建立QUIC长连接。Step 1201: Both the first client and the second client establish a QUIC long connection with the server.
这里,第一客户端对应用户A,第二客户端对应用户B,该QUIC长连接是可以是基于QUIC协议和XMPP协议共同建立。Here, the first client corresponds to user A, and the second client corresponds to user B. The QUIC long connection may be jointly established based on the QUIC protocol and the XMPP protocol.
步骤1202:第一客户端发送远程控制请求Remote Control Request至服务器。Step 1202: The first client sends a Remote Control Request to the server.
这里,该第一客户端利用QUIC长连接发送远程控制请求的信令,其中携带目的用户B的标识信息,要求开启远程控制服务,对用户B的第二客户端进行远程控制。Here, the first client uses the QUIC long connection to send the remote control request signaling, which carries the identification information of the destination user B, and requests to enable the remote control service to remotely control the second client of user B.
步骤1203:服务器返回ACK接收响应信息至第一客户端。Step 1203: The server returns ACK to receive the response information to the first client.
步骤1204:服务器将第一客户端的远程控制请求通过远程控制推送信息RemoteControl Push发送至第二客户端。Step 1204: The server sends the remote control request of the first client to the second client through remote control push information RemoteControl Push.
步骤1205:第二客户端返回第一远程控制响应至服务器,该第一远程控制响应中携带拒绝接受远程控制的通知消息。Step 1205: The second client returns a first remote control response to the server, where the first remote control response carries a notification message of refusing to accept the remote control.
步骤1206:服务器将远程控制响应消息发送至第一客户端,以通知第一客户端远程控制连接失败。Step 1206: The server sends a remote control response message to the first client to notify the first client that the remote control connection fails.
步骤1207:第二客户端返回第二远程控制响应至服务器,该第二远程控制响应中携带同意接受远程控制的通知消息。Step 1207: The second client returns a second remote control response to the server, where the second remote control response carries a notification message of agreeing to accept the remote control.
步骤1208:服务器将远程控制响应消息发送至第一客户端,以通知第一客户端远程控制连接成功。Step 1208: The server sends a remote control response message to the first client to notify the first client that the remote control connection is successful.
这里,该远程控制响应消息中携带鉴权token,用于后续具体指令控制数据鉴权。Here, the remote control response message carries an authentication token, which is used for subsequent specific instruction control data authentication.
步骤1209:第一客户端发送远程控制开始请求至服务器,以要求开始远程控制。Step 1209: The first client sends a remote control start request to the server to request to start the remote control.
步骤1210:服务器将远程控制开始请求发送至第二客户端。Step 1210: The server sends a remote control start request to the second client.
步骤1211:返回指令下发成功的远程控制开始响应消息至第一客户端。Step 1211: Return a remote control start response message with a successful instruction delivery to the first client.
这里,服务器接收到第一客户端的远程控制开启信令,通过长连接通道向目的用户B发送远程控制开始的push指令,然后向用户A回包指令下发成功的通知消息。Here, the server receives the remote control start signaling from the first client, sends a push command to start remote control to the destination user B through the persistent connection channel, and then sends a notification message of success to user A by returning the packet instruction.
步骤1212:第一客户端接收到指令下发成功的远程控制开始响应消息后,拦截鼠标和键盘操作。Step 1212: The first client terminal intercepts mouse and keyboard operations after receiving the remote control start response message that the instruction is issued successfully.
步骤1213:第二客户端接收到远程控制开始请求,拦截鼠标和键盘操作。Step 1213: The second client receives the remote control start request, and intercepts mouse and keyboard operations.
步骤1214:第一客户端将控制指令数据封装成不可靠数据包,通过QUIC长连接通道发送至服务器,同时携带鉴权token和目的用户信息。Step 1214: The first client encapsulates the control command data into an unreliable data packet, and sends it to the server through the QUIC long connection channel, carrying the authentication token and destination user information at the same time.
步骤1215:服务器将控制指令数据通过QUIC长连接通道转发至第二客户端。Step 1215: The server forwards the control command data to the second client through the QUIC persistent connection channel.
这里,该控制指令数据可以包括鼠标坐标,鼠标操作指令,和键盘操作指令等。但是这些数据中,不需要保证百分百可靠,例如鼠标移动过程中,即使当前网络状态差,有些坐标信息丢失了,只要移动停止的坐标发送成功了,或者通过再次操作,再次发送,远程控制也能成功。因此将远程控制中的控制指令数据可以封装为不可靠数据包,并通过建立的既支持可靠传输也支持不可靠传输的QUIC长连接进行传输。Here, the control instruction data may include mouse coordinates, mouse operation instructions, keyboard operation instructions, and the like. However, these data do not need to be guaranteed to be 100% reliable. For example, during the mouse movement process, even if the current network status is poor, some coordinate information is lost, as long as the coordinates of the movement stop are sent successfully, or by re-operating, re-sending, remote control can also succeed. Therefore, the control command data in the remote control can be encapsulated into unreliable data packets, and transmitted through the established QUIC long connection that supports both reliable transmission and unreliable transmission.
这里,不可靠数据类型的数据还包括会议客户端的画中画模式(即开启屏幕分享同时开启摄像头,摄像头画面可以放在窗口中,如图17A所示,图17A是本申请实施例提供的画中画模式的示意图)中涉及的数据,比如用户指定的任何地方,就是用户可以调整摄像头画面大小,拖动画面位置,画面的坐标和尺寸数据,该类数据也是可以通过不可靠传输方式进行传输的不可靠数据。另外,会议客户端中有音量数据,即指示用户的声音大小的显示数据(如图17B所示,图17B是本申请实施例提供的声音大小显示的示意图),这些数据量都比较大,而且网络差时,丢掉一些也不会有太大影响,该类数据也是可以通过不可靠传输方式进行传输的。Here, the data of the unreliable data type also includes the picture-in-picture mode of the conference client (that is, the screen sharing is turned on and the camera is turned on at the same time, and the camera picture can be placed in the window, as shown in FIG. 17A , which is a picture provided by an embodiment of the present application. The data involved in the schematic diagram of the medium picture mode), such as any place specified by the user, that is, the user can adjust the size of the camera screen, drag the screen position, the coordinates and size data of the screen, and this type of data can also be transmitted through unreliable transmission methods. of unreliable data. In addition, there is volume data in the conference client, that is, display data indicating the volume of the user's voice (as shown in FIG. 17B , which is a schematic diagram of the volume display provided by the embodiment of the present application), and the amount of these data is relatively large, and When the network is poor, losing some will not have much impact, and this type of data can also be transmitted through unreliable transmission methods.
应用本申请上述实施例,通过将QUIC协议引入到建立客户端和服务器之间的长连接过程中,利用QUIC的快速握手并进行通道加密的特性和连接迁移特性,取得了较大的优化效果。如图18所示,图18是本申请实施例提供的客户端指标的优化示意图,这里,基于TCP+TLS+XMPP建立长连接、与基于QUIC+XMPP建立长连接相比,如图18中A图所示,成功降低了登录耗时,根据线上数据统计,登录平均耗时从1224ms降低为555ms,优化效果达54.6%;如图18中B图所示,因为登录耗时高产生的超时问题也得到优化,登录成功率从99.89%提升到99.98%,提升了0.09%;如图18中C图所示,会议客户端中开关麦成功率从98.59%提升到99.84%,优化效果达1.26%。By applying the above embodiments of the present application, by introducing the QUIC protocol into the process of establishing a long connection between the client and the server, and utilizing the fast handshake and channel encryption characteristics and connection migration characteristics of QUIC, a great optimization effect is achieved. As shown in FIG. 18, FIG. 18 is a schematic diagram of the optimization of client indicators provided by the embodiment of the present application. Here, establishing a long connection based on TCP+TLS+XMPP is compared with establishing a long connection based on QUIC+XMPP, as shown in Figure 18 A As shown in the figure, the login time was successfully reduced. According to online data statistics, the average login time was reduced from 1224ms to 555ms, and the optimization effect reached 54.6%. As shown in Figure B in Figure 18, the timeout occurred due to the high login time. The problem has also been optimized, and the login success rate has increased from 99.89% to 99.98%, an increase of 0.09%; as shown in Figure C in Figure 18, the success rate of switching the microphone in the conference client has increased from 98.59% to 99.84%, and the optimization effect has reached 1.26 %.
下面继续说明本申请实施例提供的数据传输装置555,在一些实施例中,数据传输装置可采用软件模块的方式实现。参见图19,图19是本申请实施例提供的数据传输装置555的结构示意图,本申请实施例提供的数据传输装置555包括:The following continues to describe the data transmission apparatus 555 provided by the embodiments of the present application. In some embodiments, the data transmission apparatus may be implemented in the form of a software module. Referring to FIG. 19, FIG. 19 is a schematic structural diagram of a data transmission device 555 provided by an embodiment of the present application. The data transmission device 555 provided by an embodiment of the present application includes:
创建模块5551,用于创建与终端间用于数据传输的第一数据连接,所述第一数据连接的连接标识,在所述终端的互联网协议地址或端口发生变化时保持不变;The creation module 5551 is used to create a first data connection with the terminal for data transmission, and the connection identifier of the first data connection remains unchanged when the Internet Protocol address or port of the terminal changes;
接收模块5552,用于接收到所述终端基于所述第一数据连接传输的数据包;a receiving module 5552, configured to receive a data packet transmitted by the terminal based on the first data connection;
解析模块5553,用于对所述数据包进行解析,以确定所述数据包对应的数据类型;A parsing module 5553, configured to parse the data packet to determine the data type corresponding to the data packet;
控制模块5554,用于当确定所述数据包的数据类型为不可靠数据类型时,控制不向所述终端返回对应所述数据包的接收响应消息。The control module 5554 is configured to control not to return a reception response message corresponding to the data packet to the terminal when it is determined that the data type of the data packet is an unreliable data type.
在一些实施例中,所述装置还包括:In some embodiments, the apparatus further includes:
连接状态控制模块,用于获取心跳包发送周期,并按照所述心跳包发送周期,通过所述第一数据连接,发送心跳包至所述终端;a connection state control module, configured to obtain a heartbeat packet sending cycle, and send a heartbeat packet to the terminal through the first data connection according to the heartbeat packet sending cycle;
当接收到针对所述心跳包的心跳响应信息时,控制所述第一数据连接对应的连接状态为活跃状态。When the heartbeat response information for the heartbeat packet is received, the connection state corresponding to the first data connection is controlled to be an active state.
在一些实施例中,当所述第一数据连接为首次建立时,所述创建模块5551,还用于接收到所述终端发送的请求建立数据连接的第一问询数据包;In some embodiments, when the first data connection is established for the first time, the creation module 5551 is further configured to receive a first inquiry data packet sent by the terminal for requesting to establish a data connection;
基于所述第一问询数据包,发送相应的应答数据包至所述终端;based on the first inquiry data packet, sending a corresponding response data packet to the terminal;
当接收到所述终端发送的第二问询数据包时,创建与所述终端间用于数据传输的第一数据连接。When receiving the second inquiry data packet sent by the terminal, a first data connection for data transmission with the terminal is established.
在一些实施例中,当所述第一数据连接为非首次建立时,所述创建模块5551,还用于接收到所述终端发送的请求建立数据连接的问询数据包;In some embodiments, when the first data connection is not established for the first time, the creation module 5551 is further configured to receive an inquiry data packet sent by the terminal for requesting to establish a data connection;
基于所述问询数据包,创建与所述终端间用于数据传输的第一数据连接。Based on the inquiry data packet, a first data connection for data transmission with the terminal is established.
在一些实施例中,所述解析模块5553,还用于提取所述数据包的包头部分;In some embodiments, the parsing module 5553 is further configured to extract the header part of the data packet;
对所述包头部分进行解析,得到用于指示数据类型的报文字段;The packet header part is parsed to obtain a message field for indicating the data type;
将所述报文字段所指示的数据类型,确定为所述数据包对应的数据类型。The data type indicated by the packet field is determined as the data type corresponding to the data packet.
在一些实施例中,所述装置还包括:In some embodiments, the apparatus further includes:
第一迁移模块,用于当所述终端的互联网协议地址发生变更时,通过所述终端的第一套接字接口,建立与所述终端间的第二数据连接,以将与所述终端间的数据连接从所述第一数据连接迁移至所述第二数据连接;The first migration module is configured to establish a second data connection with the terminal through the first socket interface of the terminal when the Internet Protocol address of the terminal is changed, so as to connect the terminal with the terminal. migrating the data connection from the first data connection to the second data connection;
其中,所述第二数据连接的连接标识与所述第一数据连接的连接标识相一致。Wherein, the connection identifier of the second data connection is consistent with the connection identifier of the first data connection.
在一些实施例中,所述第一迁移模块,还用于基于所述连接标识,通过所述第二数据连接,发送包括第一验证信息的探测数据包至所述终端;In some embodiments, the first migration module is further configured to send a probe data packet including the first verification information to the terminal through the second data connection based on the connection identifier;
接收到所述终端针对所述探测数据包返回的响应数据包,所述响应数据包包括第二验证信息;receiving a response data packet returned by the terminal for the probe data packet, where the response data packet includes second verification information;
基于所述第二验证信息对所述第一验证信息进行验证,当得到表征验证通过的验证结果时,基于所述第二数据连接进行与所述终端间的数据传输。The first verification information is verified based on the second verification information, and when a verification result indicating that the verification is passed is obtained, data transmission with the terminal is performed based on the second data connection.
在一些实施例中,所述第一迁移模块,还用于接收到所述终端基于所述连接标识,通过所述第二数据连接传输的包括第三验证信息的探测数据包;In some embodiments, the first migration module is further configured to receive a probe data packet including third verification information transmitted by the terminal through the second data connection based on the connection identifier;
发送针对所述探测数据包的响应数据包至所述终端,所述响应数据包包括第四验证信息;sending a response data packet to the terminal for the probe data packet, where the response data packet includes fourth verification information;
其中,所述第四验证信息,用于供所述终端基于所述第三验证信息对所述第四验证信息进行验证,当得到表征验证通过的验证结果时,基于所述第二数据连接进行数据传输。The fourth verification information is used for the terminal to verify the fourth verification information based on the third verification information, and when a verification result indicating that the verification is passed is obtained, the verification is performed based on the second data connection. data transmission.
在一些实施例中,所述装置还包括:In some embodiments, the apparatus further includes:
第二迁移模块,用于对目标互联网协议地址是否发生变更进行监测,得到监测结果,所述目标互联网协议地址归属于与所述终端建立所述第一数据连接的服务器;A second migration module, configured to monitor whether the target Internet Protocol address is changed, and obtain a monitoring result, where the target Internet Protocol address belongs to the server that establishes the first data connection with the terminal;
当所述监测结果表征所述目标互联网协议地址发生变更时,针对变更后的目标互联网协议地址创建第二套接字接口,并When the monitoring result indicates that the target Internet Protocol address is changed, create a second socket interface for the changed target Internet Protocol address, and
基于所述第二套接字接口,建立与所述终端间的第三数据连接,以将与所述终端间的数据连接从所述第一数据连接迁移至所述第三数据连接;establishing a third data connection with the terminal based on the second socket interface, so as to migrate the data connection with the terminal from the first data connection to the third data connection;
其中,所述第三数据连接的连接标识与所述第一数据连接的连接标识相一致。Wherein, the connection identifier of the third data connection is consistent with the connection identifier of the first data connection.
在一些实施例中,所述第二迁移模块,还用于对所述目标互联网协议地址对应的原始套接字接口的数据传输失败事件、以及所述目标互联网协议地址的变更通知消息中至少之一进行监测;In some embodiments, the second migration module is further configured to respond to at least one of the data transmission failure event of the raw socket interface corresponding to the target Internet Protocol address and the change notification message of the target Internet Protocol address a monitoring;
当监测到所述目标互联网协议地址对应的原始套接字接口的数据传输失败事件、以及所述目标互联网协议地址的变更通知消息中至少之一时,得到表征所述目标互联网协议地址发生变更的监测结果。When at least one of the data transmission failure event of the raw socket interface corresponding to the target Internet Protocol address and the change notification message of the target Internet Protocol address are monitored, a monitoring indicating that the target Internet Protocol address is changed is obtained. result.
在一些实施例中,所述第二迁移模块,还用于基于所述连接标识,对所述第三数据连接的数据可达性进行验证,得到验证结果;In some embodiments, the second migration module is further configured to verify the data reachability of the third data connection based on the connection identifier to obtain a verification result;
当所述验证结果表征所述第三数据连接的数据可达时,基于所述第三数据连接进行与所述终端间的数据传输。When the verification result indicates that the data of the third data connection is reachable, perform data transmission with the terminal based on the third data connection.
应用本申请上述实施例,创建与终端间用于数据传输的第一数据连接,该第一数据连接的连接标识,在终端的互联网协议地址或端口发生变化时保持不变;当接收到该终端基于第一数据连接传输的数据包时,对该数据包进行解析,以确定该数据包对应的数据类型;当确定数据包的数据类型为不可靠数据类型时,则控制不向该终端返回对应数据包的接收响应消息。如此,通过解析数据包的数据类型,针对不可靠数据类型的数据包,则不返回对应的接收响应消息,从而避免了终端重传不可靠数据类型的数据包的情况,减少网络资源的不必要占用,提高网络资源的利用率。By applying the above embodiments of the present application, a first data connection for data transmission with the terminal is created, and the connection identifier of the first data connection remains unchanged when the Internet Protocol address or port of the terminal changes; When the data packet is transmitted based on the first data connection, the data packet is parsed to determine the data type corresponding to the data packet; when it is determined that the data type of the data packet is an unreliable data type, the control is not to return the corresponding data type to the terminal. Packet receive response message. In this way, by analyzing the data type of the data packet, for the data packet of the unreliable data type, the corresponding reception response message is not returned, thereby avoiding the situation that the terminal retransmits the data packet of the unreliable data type and reducing unnecessary network resources. Occupy, improve the utilization of network resources.
下面继续说明本申请实施例提供的数据传输装置2000,参见图20,图20是本申请实施例提供的数据传输装置2000的结构示意图,本申请实施例提供的数据传输装置2000包括:The following continues to describe the data transmission device 2000 provided by the embodiment of the present application. Referring to FIG. 20, FIG. 20 is a schematic structural diagram of the data transmission device 2000 provided by the embodiment of the present application. The data transmission device 2000 provided by the embodiment of the present application includes:
连接创建模块2010,用于创建与服务器间用于数据传输的第一数据连接,所述第一数据连接的连接标识,在所述服务器的互联网协议地址或端口发生变化时保持不变;A connection creation module 2010, configured to create a first data connection with the server for data transmission, and the connection identifier of the first data connection remains unchanged when the Internet Protocol address or port of the server changes;
发送模块2020,用于基于所述第一数据连接,发送数据包至所述服务器;a sending module 2020, configured to send a data packet to the server based on the first data connection;
其中,所述数据包的数据类型包括不可靠数据类型,所述不可靠数据类型,用于当所述服务器确定所述数据包的数据类型为不可靠数据类型时,控制不返回对应所述数据包的接收响应消息。The data type of the data packet includes an unreliable data type, and the unreliable data type is used to control not to return the corresponding data when the server determines that the data type of the data packet is an unreliable data type Packet receive response message.
应用本申请上述实施例,创建与终端间用于数据传输的第一数据连接,该第一数据连接的连接标识,在终端的互联网协议地址或端口发生变化时保持不变;当接收到该终端基于第一数据连接传输的数据包时,对该数据包进行解析,以确定该数据包对应的数据类型;当确定数据包的数据类型为不可靠数据类型时,则控制不向该终端返回对应数据包的接收响应消息。如此,通过解析数据包的数据类型,针对不可靠数据类型的数据包,则不返回对应的接收响应消息,从而避免了终端重传不可靠数据类型的数据包的情况,减少网络资源的不必要占用,提高网络资源的利用率。By applying the above embodiments of the present application, a first data connection for data transmission with the terminal is created, and the connection identifier of the first data connection remains unchanged when the Internet Protocol address or port of the terminal changes; When the data packet is transmitted based on the first data connection, the data packet is parsed to determine the data type corresponding to the data packet; when it is determined that the data type of the data packet is an unreliable data type, the control is not to return the corresponding data type to the terminal. Packet receive response message. In this way, by analyzing the data type of the data packet, for the data packet of the unreliable data type, the corresponding reception response message is not returned, thereby avoiding the situation that the terminal retransmits the data packet of the unreliable data type and reducing unnecessary network resources. Occupy, improve the utilization of network resources.
本申请实施例还提供一种电子设备,所述电子设备包括:The embodiment of the present application also provides an electronic device, the electronic device includes:
存储器,用于存储可执行指令;memory for storing executable instructions;
处理器,用于执行所述存储器中存储的可执行指令时,实现本申请实施例提供的数据传输方法。The processor is configured to implement the data transmission method provided by the embodiment of the present application when executing the executable instructions stored in the memory.
本申请实施例还提供一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行本申请实施例提供的数据传输方法。Embodiments of the present application also provide a computer program product or computer program, where the computer program product or computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the data transmission method provided by the embodiment of the present application.
本申请实施例还提供一种计算机可读存储介质,存储有可执行指令,所述可执行指令被处理器执行时,实现本申请实施例提供的数据传输方法。Embodiments of the present application further provide a computer-readable storage medium storing executable instructions, and when the executable instructions are executed by a processor, the data transmission method provided by the embodiments of the present application is implemented.
在一些实施例中,计算机可读存储介质可以是FRAM、ROM、PROM、EP ROM、EEPROM、闪存、磁表面存储器、光盘、或CD-ROM等存储器;也可以是包括上述存储器之一或任意组合的各种设备。In some embodiments, the computer-readable storage medium may be memory such as FRAM, ROM, PROM, EP ROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; it may also include one or any combination of the foregoing memories of various equipment.
在一些实施例中,可执行指令可以采用程序、软件、软件模块、脚本或代码的形式,按任意形式的编程语言(包括编译或解释语言,或者声明性或过程性语言)来编写,并且其可按任意形式部署,包括被部署为独立的程序或者被部署为模块、组件、子例程或者适合在计算环境中使用的其它单元。In some embodiments, executable instructions may take the form of programs, software, software modules, scripts, or code, written in any form of programming language, including compiled or interpreted languages, or declarative or procedural languages, and which Deployment may be in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
作为示例,可执行指令可以但不一定对应于文件系统中的文件,可以可被存储在保存其它程序或数据的文件的一部分,例如,存储在超文本标记语言(HTML,Hyper TextMarkup Language)文档中的一个或多个脚本中,存储在专用于所讨论的程序的单个文件中,或者,存储在多个协同文件(例如,存储一个或多个模块、子程序或代码部分的文件)中。As an example, executable instructions may, but do not necessarily correspond to files in a file system, may be stored as part of a file that holds other programs or data, for example, in a Hyper Text Markup Language (HTML) document One or more scripts of a , stored in a single file dedicated to the program in question, or in multiple cooperating files (eg, files that store one or more modules, subroutines, or code sections).
作为示例,可执行指令可被部署为在一个计算设备上执行,或者在位于一个地点的多个计算设备上执行,又或者,在分布在多个地点且通过通信网络互连的多个计算设备上执行。As an example, executable instructions may be deployed to be executed on one computing device, or on multiple computing devices located at one site, or alternatively, distributed across multiple sites and interconnected by a communication network execute on.
以上所述,仅为本申请的实施例而已,并非用于限定本申请的保护范围。凡在本申请的精神和范围之内所作的任何修改、等同替换和改进等,均包括在本申请的保护范围之内。The above descriptions are merely examples of the present application, and are not intended to limit the protection scope of the present application. Any modifications, equivalent substitutions and improvements made within the spirit and scope of this application are included within the protection scope of this application.
Claims (15)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110277682.0A CN115134553A (en) | 2021-03-15 | 2021-03-15 | Data transmission method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110277682.0A CN115134553A (en) | 2021-03-15 | 2021-03-15 | Data transmission method and device, electronic equipment and storage medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN115134553A true CN115134553A (en) | 2022-09-30 |
Family
ID=83374393
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202110277682.0A Pending CN115134553A (en) | 2021-03-15 | 2021-03-15 | Data transmission method and device, electronic equipment and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN115134553A (en) |
Cited By (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115866093A (en) * | 2022-11-30 | 2023-03-28 | 珠海全志科技股份有限公司 | Data processing method, device, equipment and storage medium of dual network protocol stack |
| CN115883541A (en) * | 2022-12-06 | 2023-03-31 | 北京百度网讯科技有限公司 | A batch file download method, device, electronic equipment and storage medium |
| CN116828025A (en) * | 2022-12-15 | 2023-09-29 | 慧之安信息技术股份有限公司 | A data pre-connection control system and method based on protocol type |
| CN118075349A (en) * | 2024-02-27 | 2024-05-24 | 南京大学 | A network twin multi-host transmission method and system for multi-cloud native applications |
| WO2024244401A1 (en) * | 2023-05-31 | 2024-12-05 | 天翼云科技有限公司 | Connection scheduling method and system for data transmission |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1224961A (en) * | 1997-09-30 | 1999-08-04 | 索尼公司 | Communication method and communication device |
| US20170346742A1 (en) * | 2016-05-30 | 2017-11-30 | Mellanox Technologies Ltd. | End-to-end Enhanced Reliable Datagram Transport |
| CN110430551A (en) * | 2019-08-09 | 2019-11-08 | 西藏宁算科技集团有限公司 | A kind of automobile data transfer method and system based on QUIC technology |
| CN111741013A (en) * | 2020-07-21 | 2020-10-02 | 炬芯(珠海)科技有限公司 | Data transmission method and device |
| CN112468513A (en) * | 2020-12-14 | 2021-03-09 | 南京中孚信息技术有限公司 | Terminal management communication protocol architecture of enterprise network |
-
2021
- 2021-03-15 CN CN202110277682.0A patent/CN115134553A/en active Pending
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1224961A (en) * | 1997-09-30 | 1999-08-04 | 索尼公司 | Communication method and communication device |
| US20170346742A1 (en) * | 2016-05-30 | 2017-11-30 | Mellanox Technologies Ltd. | End-to-end Enhanced Reliable Datagram Transport |
| CN110430551A (en) * | 2019-08-09 | 2019-11-08 | 西藏宁算科技集团有限公司 | A kind of automobile data transfer method and system based on QUIC technology |
| CN111741013A (en) * | 2020-07-21 | 2020-10-02 | 炬芯(珠海)科技有限公司 | Data transmission method and device |
| CN112468513A (en) * | 2020-12-14 | 2021-03-09 | 南京中孚信息技术有限公司 | Terminal management communication protocol architecture of enterprise network |
Non-Patent Citations (1)
| Title |
|---|
| MOB60475702A1FF: "跟坚哥学QUIC系列:连接迁移(Connection Migration)", 《HTTPS://BLOG.51CTO.COM/U_15127673/3346633》, 1 December 2020 (2020-12-01), pages 1 - 11 * |
Cited By (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115866093A (en) * | 2022-11-30 | 2023-03-28 | 珠海全志科技股份有限公司 | Data processing method, device, equipment and storage medium of dual network protocol stack |
| CN115883541A (en) * | 2022-12-06 | 2023-03-31 | 北京百度网讯科技有限公司 | A batch file download method, device, electronic equipment and storage medium |
| CN115883541B (en) * | 2022-12-06 | 2025-08-22 | 北京百度网讯科技有限公司 | Batch file downloading method, device, electronic device and storage medium |
| CN116828025A (en) * | 2022-12-15 | 2023-09-29 | 慧之安信息技术股份有限公司 | A data pre-connection control system and method based on protocol type |
| WO2024244401A1 (en) * | 2023-05-31 | 2024-12-05 | 天翼云科技有限公司 | Connection scheduling method and system for data transmission |
| CN118075349A (en) * | 2024-02-27 | 2024-05-24 | 南京大学 | A network twin multi-host transmission method and system for multi-cloud native applications |
| WO2025179769A1 (en) * | 2024-02-27 | 2025-09-04 | 南京大学 | Network twin multi-sink transmission method and system for multi-cloud native application |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN115134553A (en) | Data transmission method and device, electronic equipment and storage medium | |
| US20220131957A1 (en) | Adaptive session reliability over multiple transports | |
| CN111479121B (en) | Live broadcasting method and system based on streaming media server | |
| US8335853B2 (en) | Transparent recovery of transport connections using packet translation techniques | |
| US9015822B2 (en) | Automatic invocation of DTN bundle protocol | |
| CN108200158B (en) | request transmission system, method, device and storage medium | |
| JP2007509521A (en) | Protocol encapsulation for session persistence and reliability | |
| US10608985B2 (en) | Multihoming for tunneled encapsulated media | |
| CN102523207A (en) | VNC (Virtual Network Computer)-based remote resource access method and proxy device | |
| CN108306986B (en) | Multi-type media data network address translation traversal method, terminal and system | |
| US9357014B2 (en) | Service-based networking | |
| CN114710568B (en) | Audio and video data communication methods, equipment and storage media | |
| CN115580667A (en) | Data transmission method, device, equipment and storage medium | |
| CN110771117B (en) | A Session Layer Communication Using ID-Oriented Networks | |
| CN118740899A (en) | Virtual debugging communication method, device, equipment and storage medium | |
| US8972543B1 (en) | Managing clients utilizing reverse transactions | |
| WO2010148723A1 (en) | Telnet method for external terminal and master device, slave device thereof | |
| CN115665500A (en) | Scheduling processing method, device, equipment and storage medium | |
| WO2025016443A1 (en) | Bulk endpoint-based wireless auxiliary stream data transmission method, and device | |
| US20170033946A1 (en) | Negative acknowledgment of tunneled encapsulated media | |
| CN111265852A (en) | Low-delay information transmission method and device based on UDP (user Datagram protocol) | |
| CN118101788A (en) | A multi-gateway concurrent communication simulation method based on CoAP and UDP protocols | |
| CN101510901B (en) | Communication method, communication apparatus and system between distributed equipment | |
| US10334086B2 (en) | Header redundancy removal for tunneled media traffic | |
| WO2024032102A1 (en) | Data transmission method and apparatus, device, storage medium, and computer program product |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination |
