CN117220838A - Data packet transmission method, device, equipment and storage medium - Google Patents
Data packet transmission method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN117220838A CN117220838A CN202211697316.1A CN202211697316A CN117220838A CN 117220838 A CN117220838 A CN 117220838A CN 202211697316 A CN202211697316 A CN 202211697316A CN 117220838 A CN117220838 A CN 117220838A
- Authority
- CN
- China
- Prior art keywords
- data
- retransmission
- queue
- unacknowledged
- packet
- 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
- 230000005540 biological transmission Effects 0.000 title claims abstract description 173
- 238000000034 method Methods 0.000 title claims abstract description 112
- 238000003860 storage Methods 0.000 title claims abstract description 31
- 230000008569 process Effects 0.000 claims description 26
- 238000004590 computer program Methods 0.000 claims description 19
- 238000012423 maintenance Methods 0.000 claims description 7
- 238000011084 recovery Methods 0.000 claims description 6
- 230000006854 communication Effects 0.000 abstract description 33
- 238000004891 communication Methods 0.000 abstract description 31
- 230000000903 blocking effect Effects 0.000 abstract description 5
- 230000000875 corresponding effect Effects 0.000 description 42
- 238000012790 confirmation Methods 0.000 description 32
- 238000010586 diagram Methods 0.000 description 24
- 238000005516 engineering process Methods 0.000 description 15
- 238000001514 detection method Methods 0.000 description 10
- 238000012545 processing Methods 0.000 description 9
- 230000009471 action Effects 0.000 description 4
- 230000002596 correlated effect Effects 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 238000013473 artificial intelligence Methods 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 3
- 239000000284 extract Substances 0.000 description 3
- 238000010801 machine learning Methods 0.000 description 3
- 238000007726 management method Methods 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 238000005457 optimization Methods 0.000 description 2
- 238000013475 authorization Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000008014 freezing Effects 0.000 description 1
- 238000007710 freezing Methods 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 230000005055 memory storage Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000011897 real-time detection Methods 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 230000007704 transition Effects 0.000 description 1
Landscapes
- Communication Control (AREA)
Abstract
Description
技术领域Technical field
本申请涉及计算机网络通信技术领域,特别涉及一种数据包的传输方法、装置、设备及存储介质。The present application relates to the field of computer network communication technology, and in particular to a data packet transmission method, device, equipment and storage medium.
背景技术Background technique
受到发送端和接收端之间的网络通信质量的影响,发送端发送的数据包会发生丢失。发送端需要对发生丢失的数据包进行重传。Affected by the quality of network communication between the sender and the receiver, the data packets sent by the sender may be lost. The sender needs to retransmit the lost data packets.
相关技术中,发送端在检测到数据出现丢失后,立即对数据进行重传。若发送端再次检测到数据出现丢失,则发送端再次重传数据。若发送端接收到消息确认报文,则发送端确认接收端成功获得重传数据。发送端停止对该数据进行重传。In related technologies, the sending end immediately retransmits the data after detecting data loss. If the sending end detects data loss again, the sending end retransmits the data again. If the sending end receives the message confirmation message, the sending end confirms that the receiving end successfully obtained the retransmitted data. The sender stops retransmitting the data.
然而,通过这种方法,数据接收端需要等待较长时间才能接收到发生丢失的数据,导致接收端中的业务容易出现卡顿。However, with this method, the data receiving end needs to wait for a long time to receive the lost data, causing the service at the receiving end to be prone to lags.
发明内容Contents of the invention
本申请提供了一种数据包的传输方法、装置、设备及存储介质。所述技术方案如下:This application provides a data packet transmission method, device, equipment and storage medium. The technical solutions are as follows:
根据本申请实施例的一个方面,提供了一种数据包的传输方法,所述方法包括:According to one aspect of the embodiment of the present application, a data packet transmission method is provided, and the method includes:
在发送端处于应用受限状态的情况下,从重传未确认队列中确定第一数据;其中,所述应用受限状态是指所述发送端暂不具有未传输的初传数据和初次重传的数据,所述重传未确认队列用于存储已经重传但未被接收端确认收到的数据;When the sending end is in an application-limited state, the first data is determined from the retransmission unconfirmed queue; wherein the application-limited state means that the sending end does not have untransmitted initial transmission data and initial retransmission. The retransmission unconfirmed queue is used to store data that has been retransmitted but has not been confirmed by the receiving end;
向所述接收端重传所述第一数据对应的第一数据包;Retransmitting the first data packet corresponding to the first data to the receiving end;
调整所述第一数据在所述重传未确认队列中的位置。Adjust the position of the first data in the retransmission unconfirmed queue.
根据本申请实施例的一个方面,提供了一种数据包的传输装置,所述装置包括:According to one aspect of the embodiment of the present application, a data packet transmission device is provided, and the device includes:
数据包确定模块,用于在发送端处于应用受限状态的情况下,从重传未确认队列中确定第一数据;其中,所述应用受限状态是指所述发送端暂不具有未传输的初传数据和初次重传的数据,所述重传未确认队列用于存储已经重传但未被接收端确认收到的数据。A data packet determination module configured to determine the first data from the retransmission unconfirmed queue when the sending end is in an application-limited state; wherein the application-limited state means that the sending end has no untransmitted packets. The initial transmission data and the first retransmission data, the retransmission unconfirmed queue is used to store data that has been retransmitted but has not been confirmed by the receiving end.
数据包重传模块,用于向所述接收端重传所述第一数据对应的第一数据包。A data packet retransmission module is configured to retransmit the first data packet corresponding to the first data to the receiving end.
队列维护模块,用于调整所述第一数据在所述重传未确认队列中的位置。A queue maintenance module, configured to adjust the position of the first data in the retransmission unconfirmed queue.
根据本申请实施例的一个方面,提供了一种计算机设备,所述计算机设备包括:处理器和存储器,所述存储器中存储有计算机程序,所述计算机程序由所述处理器加载并执行以实现如上所述的数据包的传输方法。According to an aspect of an embodiment of the present application, a computer device is provided. The computer device includes: a processor and a memory. A computer program is stored in the memory. The computer program is loaded and executed by the processor to implement The method of transmitting data packets as described above.
根据本申请实施例的一个方面,提供了一种计算机可读存储介质,所述存储介质中存储有计算机程序,所述计算机程序由处理器加载并执行以实现如上所述的数据包的传输方法。According to one aspect of the embodiment of the present application, a computer-readable storage medium is provided, and a computer program is stored in the storage medium, and the computer program is loaded and executed by a processor to implement the data packet transmission method as described above. .
根据本申请实施例的一个方面,提供了一种计算机程序产品,所述计算机程序产品包括计算机程序,所述计算机程序存储在计算机可读存储介质中,处理器从所述计算机可读存储介质读取并执行所述计算机指令,以实现如上所述的数据包的传输方法。According to an aspect of an embodiment of the present application, a computer program product is provided. The computer program product includes a computer program. The computer program is stored in a computer-readable storage medium. A processor reads the computer program from the computer-readable storage medium. The computer instructions are fetched and executed to implement the data packet transmission method as described above.
本申请实施例提供的技术方案带来的有益效果至少包括:The beneficial effects brought by the technical solutions provided by the embodiments of this application at least include:
一方面,发送端在处于应用受限状态中,执行针对发生丢失的数据的再次重传操作,增加了发生丢失的数据在一段时间内的重传次数,有助于减少了接收端等待接收发生丢失的数据消耗的时间。On the one hand, when the sending end is in an application-limited state, it performs a retransmission operation for the lost data, which increases the number of retransmissions of the lost data within a period of time and helps to reduce the time the receiving end waits for reception. Time consumed by lost data.
另一方面,处于应用受限状态的发送端暂不具有初传数据,也即在应用受限状态下,对发生丢失的数据进行再重传操作能够减少传输阻塞的发生。On the other hand, the sender in the application-limited state does not have the initial transmission data. That is, in the application-limited state, retransmitting the lost data can reduce the occurrence of transmission congestion.
对于现场直播等对网络通信质量要求较高的领域,通过这种方法缓解了接收端中应用层播放器缓存中的数据被耗尽而带来的音视频卡顿等现象,在提升发生丢失的数据的重传成功率的同时,有助于提升端中音视频播放的了流畅性,有助于改善现有音视频直播业务的用户体验。For fields such as live broadcasts that require high network communication quality, this method alleviates audio and video lagging caused by the exhaustion of data in the application layer player cache at the receiving end, and improves the efficiency of lost data. While improving the data retransmission success rate, it also helps improve the smoothness of audio and video playback on the end, and helps improve the user experience of existing audio and video live broadcast services.
附图说明Description of drawings
图1是本申请一个示例性实施例提供的方案实施环境的示意图;Figure 1 is a schematic diagram of the solution implementation environment provided by an exemplary embodiment of the present application;
图2是本申请一个示例性实施例提供的现有的丢包重传策略的示意图;Figure 2 is a schematic diagram of an existing packet loss retransmission strategy provided by an exemplary embodiment of the present application;
图3是本申请一个示例性实施例提供的数据包阻塞原理的示意图;Figure 3 is a schematic diagram of the data packet blocking principle provided by an exemplary embodiment of the present application;
图4是本申请一个示例性实施例提供的多路径传输的示意图;Figure 4 is a schematic diagram of multipath transmission provided by an exemplary embodiment of the present application;
图5是本申请一个示例性实施例提供的数据包重传过程的示意图;Figure 5 is a schematic diagram of the data packet retransmission process provided by an exemplary embodiment of the present application;
图6是本申请一个示例性实施例提供的数据包的传输方法的流程图;Figure 6 is a flow chart of a data packet transmission method provided by an exemplary embodiment of the present application;
图7是本申请一个示例性实施例提供的重传未确认队列更新过程的示意图;Figure 7 is a schematic diagram of the retransmission unconfirmed queue update process provided by an exemplary embodiment of the present application;
图8是本申请一个示例性实施例提供的数据包的重传时机的示意图;Figure 8 is a schematic diagram of the retransmission timing of data packets provided by an exemplary embodiment of the present application;
图9是本申请一个示例性实施例提供的等级重传的时间间隔的示意图;Figure 9 is a schematic diagram of the time interval of level retransmission provided by an exemplary embodiment of the present application;
图10是本申请一个示例性实施例提供的数据包传输方法的时序图;Figure 10 is a sequence diagram of a data packet transmission method provided by an exemplary embodiment of the present application;
图11是本申请一个示例性实施例提供的数据包传输方法的示意图;Figure 11 is a schematic diagram of a data packet transmission method provided by an exemplary embodiment of the present application;
图12是本申请一个示例性实施例提供的数据包的传输装置的框图;Figure 12 is a block diagram of a data packet transmission device provided by an exemplary embodiment of the present application;
图13是本申请一个示例性实施例提供的计算机设备的结构框图。Figure 13 is a structural block diagram of a computer device provided by an exemplary embodiment of the present application.
具体实施方式Detailed ways
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。In order to make the purpose, technical solutions and advantages of the present application clearer, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.
云技术(Cloud technology)是指在广域网或局域网内将硬件、软件、网络等系列资源统一起来,实现数据的计算、储存、处理和共享的一种托管技术。云技术(Cloudtechnology)基于云计算商业模式应用的网络技术、信息技术、整合技术、管理平台技术、应用技术等的总称,可以组成资源池,按需所用,灵活便利。云计算技术将变成重要支撑。技术网络系统的后台服务需要大量的计算、存储资源,如视频网站、图片类网站和更多的门户网站。伴随着互联网行业的高度发展和应用,将来每个物品都有可能存在自己的识别标志,都需要传输到后台系统进行逻辑处理,不同程度级别的数据将会分开处理,各类行业数据皆需要强大的系统后盾支撑,只能通过云计算来实现。Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and networks within a wide area network or local area network to realize data calculation, storage, processing, and sharing. Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool and use it on demand, which is flexible and convenient. Cloud computing technology will become an important support. The background services of technical network systems require a large amount of computing and storage resources, such as video websites, picture websites and more portal websites. With the rapid development and application of the Internet industry, in the future each item may have its own identification mark, which needs to be transmitted to the backend system for logical processing. Data at different levels will be processed separately, and all types of industry data need to be powerful. System backing support can only be achieved through cloud computing.
图1是本申请一个示例性实施例提供的方案实施环境的示意图。该方案实施环境可以实现成为一个数据包的传输系统。该方案实施环境可以包括:发送端10和接收端20。Figure 1 is a schematic diagram of a solution implementation environment provided by an exemplary embodiment of the present application. The implementation environment of this solution can be realized as a data packet transmission system. The implementation environment of this solution may include: a sending end 10 and a receiving end 20 .
发送端10用于在网络通信过程中发送数据,接收端20用于在网络通信过程中接收数据。可选地,发送端10和接收端20在网络通信过程中可以相互转换。The sending end 10 is used to send data during network communication, and the receiving end 20 is used to receive data during network communication. Optionally, the sending end 10 and the receiving end 20 can convert each other during network communication.
发送端10可以是服务器,也可以是终端。服务器可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群或者分布式系统,还可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、CDN(ContentDelivery Network,内容分发网络)、以及大数据和人工智能平台等基础云计算服务的云服务器。终端可以是智能手机、平板电脑、笔记本电脑、台式计算机、智能音箱、智能手表等,但并不局限于此。终端以及服务器可以通过有线或无线通信方式进行直接或间接地连接,本申请在此不做限制。The sending end 10 may be a server or a terminal. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, and middleware. Cloud servers for basic cloud computing services such as software services, domain name services, security services, CDN (ContentDelivery Network, content distribution network), and big data and artificial intelligence platforms. The terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smart watch, etc., but is not limited to this. The terminal and the server can be connected directly or indirectly through wired or wireless communication methods, which is not limited in this application.
终端设备上运行有目标应用程序。目标应用程序用于进行视频播放、音频播放等多媒体业务。The target application is running on the terminal device. The target application is used for multimedia services such as video playback and audio playback.
在一个示例中,发送端10为云服务器,接收端20为终端,数据为视频数据。云服务器从内容发布方处获取直播内容,并对直播内容进行编解码操作,生成流量数据。云服务器将包括有流量数据的数据包发送给终端,终端的应用层播放器对数据包进行处理后,生成终端中显示的视频内容。In one example, the sending end 10 is a cloud server, the receiving end 20 is a terminal, and the data is video data. The cloud server obtains the live content from the content publisher, encodes and decodes the live content, and generates traffic data. The cloud server sends the data packet including the traffic data to the terminal. The application layer player of the terminal processes the data packet and generates the video content displayed in the terminal.
在另一个示例中,发送端10为云服务器,接收端20为终端。云服务器从其他设备中获取视频通信内容;其中,其他设备与终端正在进行视频通话。发送端视频通信内容进行编解码操作,得到数据内容。云服务器将包括有数据内容的数据包发送给终端。终端的应用层播放器对数据包进行处理后,生成终端中显示的视频内容。In another example, the sending end 10 is a cloud server, and the receiving end 20 is a terminal. The cloud server obtains video communication content from other devices; among them, other devices and the terminal are making video calls. The video communication content at the sending end is encoded and decoded to obtain the data content. The cloud server sends the data packet including the data content to the terminal. After the application layer player of the terminal processes the data packet, it generates the video content displayed in the terminal.
如图1所示,发送端与至少一个接收端(用户)建立有连接。受到网络通信质量的影响,发送端传输的数据可能出现丢失。在本申请,通过以下几个步骤实现对丢失数据进行重传。As shown in Figure 1, the sending end has established a connection with at least one receiving end (user). Affected by the quality of network communication, the data transmitted by the sender may be lost. In this application, retransmission of lost data is achieved through the following steps.
步骤1、终端向服务器发送消息请求报文,或发送消息确认报文。Step 1. The terminal sends a message request message or a message confirmation message to the server.
步骤2、服务器检测到消息请求报文或检测到出现丢包后,为该连接创建重传未确认队列。该重传未确认队列用于记录已经重传但未被接收端确认的丢包数据包。Step 2: After the server detects the message request message or packet loss, it creates a retransmission unconfirmed queue for the connection. The retransmission unacknowledged queue is used to record lost data packets that have been retransmitted but not acknowledged by the receiving end.
步骤3、服务器向用户终端发送请求的流量报文,当出现丢包时,服务器向用户终端立即重传丢失的数据包,并将该数据包添加至重传未确认队列的队尾。Step 3. The server sends the requested traffic message to the user terminal. When packet loss occurs, the server immediately retransmits the lost data packet to the user terminal and adds the data packet to the end of the retransmission unacknowledged queue.
步骤4、服务器监控自身是否处于“应用受限”(即没有流量数据可发)。Step 4. The server monitors whether it is "application restricted" (that is, there is no traffic data to send).
步骤5、若处于“应用受限”,则服务器从上述重传未确认队列的头部获取第一数据包,并执行再次重传该第一数据包的操作;若服务器不处于“应用受限”,则服务器继续执行现有方法的流量传输与丢包恢复操作。Step 5. If the server is in "Application Restricted", the server obtains the first data packet from the head of the retransmission unconfirmed queue and performs the operation of retransmitting the first data packet again; if the server is not in "Application Restricted" ”, the server continues to perform the traffic transmission and packet loss recovery operations of the existing method.
步骤6、当服务器与终端之间的连接结束时,服务器释放重传未确认队列。有关这些步骤的具体内容请参考下文实施例。Step 6. When the connection between the server and the terminal ends, the server releases the retransmission unconfirmed queue. For details on these steps, please refer to the examples below.
随着网络基础设施及网络协议的不断发展,互联网业务已经成为人们生活中不可或缺的一部分。在众多的互联网业务中,音视频业务成为当前云服务提供商的核心业务;在音视频业务中,终端侧(相当于接收端)的卡顿成为衡量云服务提供商(相当于发送端)的重要标准。With the continuous development of network infrastructure and network protocols, Internet services have become an indispensable part of people's lives. Among the many Internet services, audio and video services have become the core business of current cloud service providers; in audio and video services, lagging on the terminal side (equivalent to the receiving end) has become a measure of cloud service providers (equivalent to the sending end) important standards.
若云服务器提供商具有较好的网络传输性能,则终端播放音视频时出现的卡顿、马赛克、花屏等情况就少。在这种情况下,会有越来越多的内容服务提供商(例如视频播放平台,直播平台、音频播放平台等)选择使用云服务传输播放数据,以便减少终端中出现的卡顿,使得云服务提供商的业务范围不断扩展。相反,如果云服务提供商具有较差的网络传输性能,使得终端在播放视频、音频过程中频繁出现卡顿、花屏等现象,会造成内容服务提供商造成大量的用户流失,致使内容服务提供商更换其它云服务来支持自身的音视频业务。因此,减少终端出现的网络卡顿成为云服务提供商急需解决的问题。If the cloud server provider has good network transmission performance, there will be fewer lags, mosaics, screen blur, etc. when the terminal plays audio and video. In this case, more and more content service providers (such as video playback platforms, live broadcast platforms, audio playback platforms, etc.) will choose to use cloud services to transmit playback data in order to reduce lags in the terminal, making the cloud Service providers' business scope continues to expand. On the contrary, if the cloud service provider has poor network transmission performance, causing the terminal to frequently experience freezes and blurred screens during video and audio playback, it will cause the content service provider to lose a large number of users, causing the content service provider to lose money. Replace other cloud services to support your own audio and video services. Therefore, reducing network freezes on terminals has become an urgent problem that cloud service providers need to solve.
以音视频业务为例,丢包是造成终端侧卡顿的主要因素。音视频业务流量在网络传输过程中,若出现大量的丢包,则终端侧需要等待云服务器侧进行丢包重传,直至收到重传的丢包,终端才能将该数据包及其后续数据包上送至应用层播放器。在对时延敏感的音视频业务中,网络丢包率成为印象业务体验的关键因素。Taking audio and video services as an example, packet loss is the main factor causing lagging on the terminal side. If a large number of packets are lost during the network transmission of audio and video business traffic, the terminal side needs to wait for the cloud server side to retransmit the lost packets. Until the retransmitted lost packets are received, the terminal can transmit the data packet and its subsequent data. The package is sent to the application layer player. In delay-sensitive audio and video services, network packet loss rate has become a key factor in the impression of service experience.
图2是本申请一个示例性实施例提供的现有的丢包重传策略的示意图。Figure 2 is a schematic diagram of an existing packet loss retransmission strategy provided by an exemplary embodiment of the present application.
云服务器接收终端的音视频流量请求,根据音视频流量请求向终端发送音视频数据包。终端用户周期性地向云服务器发送消息确认数据包,消息确认数据包中携带丢包信息。云服务器接收消息确认数据包,根据接收消息确认数据包立刻重传丢失的音视频数据包,直至接收到终端的消息确认数据包,消息确认数据包用于表征终端已经收到了丢失的音视频数据包。The cloud server receives audio and video traffic requests from the terminal and sends audio and video data packets to the terminal according to the audio and video traffic requests. The end user periodically sends message confirmation packets to the cloud server, and the message confirmation packets carry packet loss information. The cloud server receives the message confirmation data packet and immediately retransmits the lost audio and video data packet according to the received message confirmation data packet until it receives the message confirmation data packet from the terminal. The message confirmation data packet is used to indicate that the terminal has received the lost audio and video data. Bag.
然而,对于终端与云服务器之间的网络通信,若使用可靠传输方法(如基于TCP(Transmission Control Protocol,传输控制协议)或QUIC(Quick UDP InternetConnection,快速UDP网络连接)等网络传输协议),如果某个数据包(或数据)出现丢失,则终端无法将后续的数据包上送至应用层播放器。也就是说,出现丢包会引起终端侧阻塞后续数据包,容易造成应用层播放器的卡顿现象发生。However, for network communication between the terminal and the cloud server, if a reliable transmission method (such as a network transmission protocol based on TCP (Transmission Control Protocol) or QUIC (Quick UDP Internet Connection), etc.) is used, if If a certain data packet (or data) is lost, the terminal cannot send subsequent data packets to the application layer player. In other words, packet loss will cause the terminal side to block subsequent data packets, which can easily cause the application layer player to freeze.
图3是本申请一个示例性实施例提供的数据包阻塞原理的示意图。Figure 3 is a schematic diagram of the data packet blocking principle provided by an exemplary embodiment of the present application.
云服务器向终端发送音视频数据包(Pkt.1、Pkt.2、Pkt.3),在网络传输过程中Pkt.1出现丢失,终端成功接收Pkt.2和Pkt.3。Pkt.1出现了丢失。即使终端接收到Pkt.2和Pkt.3,也不能将Pkt.2和Pkt.3上送至应用层播放器。在这种情况,终端通知云服务器重传Pkt.1。在用户终端收到Pkt.1后,终端将数据包1、数据包2、数据包3一并上送至应用层。The cloud server sends audio and video data packets (Pkt.1, Pkt.2, Pkt.3) to the terminal. Pkt.1 is lost during network transmission, and the terminal successfully receives Pkt.2 and Pkt.3. Pkt.1 is missing. Even if the terminal receives Pkt.2 and Pkt.3, it cannot send Pkt.2 and Pkt.3 to the application layer player. In this case, the terminal notifies the cloud server to retransmit Pkt.1. After the user terminal receives Pkt.1, the terminal sends data packet 1, data packet 2, and data packet 3 to the application layer.
在本示例中,在终端等待接收云服务器重传的Pkt.1的过程中,若应用层播放器的缓存中没有待播放的数据,则音视频播放过程会产生卡顿;若应用层播放器的缓存中有待播放的数据,则音视频播放不会产生卡顿。In this example, while the terminal is waiting to receive Pkt.1 retransmitted by the cloud server, if there is no data to be played in the cache of the application layer player, the audio and video playback process will be stuck; if the application layer player If there is data to be played in the cache, audio and video playback will not cause lag.
由上述内容可知,如何快速而及时地重传丢失的数据包,是缓解终端卡顿、提升音视频播放流畅度的重要思路。It can be seen from the above that how to retransmit lost data packets quickly and timely is an important idea to alleviate terminal freezes and improve the smoothness of audio and video playback.
在上述内容中,云服务器相当于权利要求中的发送端,终端相当于权利要求中的接收端,音视频数据包相当于权利要求中的数据包。In the above content, the cloud server is equivalent to the sending end in the claims, the terminal is equivalent to the receiving end in the claims, and the audio and video data packet is equivalent to the data packet in the claims.
针对上述提到的丢包重传问题,相关技术中的解决方法分为以下两类:一类是通过启发式或机器学习的方法获取实时的网络条件与状态,从而在重传数据包的时候云服务器采用合适的发送窗口和发送速率重传丢失的数据包,以期望重传的数据包尽快到达终端;另一种方法采用新的网络传输方式回传丢失的音视频流量数据包,例如采用多路径传输、冗余编码、重复重传的方法回传丢失的数据包。In response to the packet loss retransmission problem mentioned above, solutions in related technologies are divided into the following two categories: One is to obtain real-time network conditions and status through heuristic or machine learning methods, so as to retransmit data packets. The cloud server uses an appropriate sending window and sending rate to retransmit the lost data packets, hoping that the retransmitted data packets will reach the terminal as soon as possible; another method uses a new network transmission method to return the lost audio and video traffic data packets, such as using Multipath transmission, redundant coding, and repeated retransmission methods are used to return lost data packets.
图4是本申请一个示例性实施例提供的多路径传输的示意图。Figure 4 is a schematic diagram of multipath transmission provided by an exemplary embodiment of the present application.
云服务器在收到来自终端的消息确认数据包后,通过多路径网络通信的方式向终端重复回传丢失的数据包。After receiving the message confirmation data packet from the terminal, the cloud server repeatedly sends back the lost data packet to the terminal through multi-path network communication.
上述针对丢包重传的优化方法存在以下问题:一是现有启发式或机器学习方法很难精确获得当前的网络状态或条件,致使丢失的数据包在重传过程中难以保证一定能够到达终端,特别地,如果获取的网络状态或条件不够准确,则重传的数据包在重传过程中可能出现再次丢失的可能。The above-mentioned optimization method for packet loss retransmission has the following problems: First, it is difficult for existing heuristic or machine learning methods to accurately obtain the current network status or conditions, making it difficult to guarantee that lost data packets will reach the terminal during the retransmission process. ,In particular, if the obtained network status or ,conditions are not accurate enough, the retransmitted data ,packet may be lost again during the retransmission process.
图5是本申请一个示例性实施例提供的数据包重传过程的示意图。Figure 5 is a schematic diagram of a data packet retransmission process provided by an exemplary embodiment of the present application.
云服务器在首次重传丢失的数据包(重传数据包1)时,该数据包在路由节点R1丢失;此时,终端发送的消息确认报文中会携带未收到重传数据包1的信息。云服务器在收到消息确认报文后,则会再次向终端重传数据包(重传数据包1);在这种情况下,终端因等待重传数据包1而出现卡顿的可能性大大增加。When the cloud server retransmits the lost data packet (retransmission data packet 1) for the first time, the data packet is lost at routing node R1; at this time, the message confirmation message sent by the terminal will carry the message that retransmission data packet 1 has not been received. information. After receiving the message confirmation message, the cloud server will retransmit the data packet (retransmit data packet 1) to the terminal again; in this case, the terminal is likely to be stuck waiting for retransmission of data packet 1. Increase.
可见,相关技术中基于多路径传输、冗余编码、重复重传的方法虽然能够避免因重传数据包再次丢失而导致的终端卡顿,但无差别的重复重传面临以下问题:(1)如果终端不支持多路径传输和冗余编码,则该服务器端无法通过该方法提升重传的成功率;(2)无差别的重复重传丢失的数据包会阻塞后续待发送的音视频流量数据包,造成业务的真实下载速率降低,也会带来用户侧的卡顿现象。It can be seen that although the methods based on multi-path transmission, redundant coding, and repeated retransmission in related technologies can avoid terminal freezes caused by retransmission data packets being lost again, indiscriminate repeated retransmission faces the following problems: (1) If the terminal does not support multi-path transmission and redundant coding, the server cannot improve the success rate of retransmission through this method; (2) Indiscriminate repeated retransmission of lost data packets will block subsequent audio and video traffic data to be sent. package, causing the actual download rate of the business to decrease, and also causing lag on the user side.
本申请主要针对丢包重传过程中再次丢失而造成用户终端卡顿的问题,提出一种面向时延敏感音视频业务的丢包重传优化方法。有助于降低了接收端对于丢包的等待时间,有利于缓解音视频直播业务在播放过程中的卡顿。This application mainly aims at the problem of user terminal freezing caused by packet loss and retransmission, and proposes a packet loss retransmission optimization method for delay-sensitive audio and video services. It helps to reduce the waiting time of the receiving end for packet loss, and helps to alleviate the jamming of audio and video live broadcast services during the playback process.
图6是本申请一个示例性实施例提供的数据包的传输方法的流程图。示例性地,该方法的执行主体可以是图1所述方案实施环境中发送端10,如图6所示,该方法可以包括如下几个步骤(610~630):Figure 6 is a flow chart of a data packet transmission method provided by an exemplary embodiment of the present application. For example, the execution subject of this method may be the sending end 10 in the implementation environment of the solution described in Figure 1. As shown in Figure 6, the method may include the following steps (610-630):
步骤610,在发送端处于应用受限状态的情况下,从重传未确认队列中确定第一数据;其中,应用受限状态是指发送端暂不具有未传输的初传数据和初次重传的数据,重传未确认队列用于存储已经重传但未被接收端确认收到的数据。Step 610: When the sending end is in an application-limited state, determine the first data from the retransmission unconfirmed queue; where the application-limited state means that the sending end does not have untransmitted initial transmission data and initial retransmission data. Data, retransmission unconfirmed queue is used to store data that has been retransmitted but has not been acknowledged by the receiving end.
在一些实施例中,发送端和接收端之间建立有通信连接。发送端用于向接收端发送数据,接收端根据数据的接收情况,向发送端反馈消息确认报文。在视频播放业务中,发送端为云服务器、接收端为运行有视频播放的应用程序的终端。在云存储业务中,发送端为上传数据的终端,接收端为云服务器。In some embodiments, a communication connection is established between the sending end and the receiving end. The sending end is used to send data to the receiving end, and the receiving end feeds back a message confirmation message to the sending end according to the reception status of the data. In the video playback business, the sender is a cloud server and the receiver is a terminal running a video playback application. In the cloud storage business, the sending end is the terminal that uploads data, and the receiving end is the cloud server.
需要说明的是,发送端和接收端的类型根据实际需要进行确定,本申请在此不进行限定。It should be noted that the types of the sending end and the receiving end are determined according to actual needs, and are not limited here in this application.
在一些实施例中,应用受限状态是指发送端无需要发送初传数据,也不需要对发生丢失的数据进行初次重传的状态。处于应用受限状态的发送端对发生丢失的数据进行重复重传。In some embodiments, the application-limited state refers to a state in which the sending end does not need to send initial transmission data, nor does it need to perform initial retransmission of lost data. The sender in the application-limited state repeatedly retransmits the lost data.
可选地,发送端还具有应用非受限状态,处于应用非受限状态的发送端具有至少一个待发送的初传的数据,或者需要进行初次重传的数据。Optionally, the sending end also has an application unrestricted state, and the sending end in the application unrestricted state has at least one initially transmitted data to be sent, or data that needs to be initially retransmitted.
可选地,数据是指接收端请求获得的数据。数据包括由发送端编解码生成的流量数据。例如,数据包未音频数据包。又例如,数据包为视频数据包。发送端从视频播放平台中获取音视频内容,并对音视频内容进行编解码,生成数据。Optionally, data refers to data requested by the receiving end. The data includes traffic data generated by the sender's codec. For example, data packets are not audio packets. For another example, the data packet is a video data packet. The sending end obtains the audio and video content from the video playback platform, encodes and decodes the audio and video content, and generates data.
在一些实施例中,初始数据是指发送端初次传输的数据。例如,发送端进行视频编解码生成的数据为初始数据。初次重传的数据是指发生丢失且第一次被重传的数据。In some embodiments, the initial data refers to data transmitted for the first time by the sending end. For example, the data generated by video encoding and decoding at the sending end is initial data. The data retransmitted for the first time refers to the data that was lost and retransmitted for the first time.
在一些实施例中,重传未确认队列用于存储已经重传但未被接收端确认收到的数据。In some embodiments, the retransmission unacknowledged queue is used to store data that has been retransmitted but has not been acknowledged by the receiving end.
在一些实施例中,发送端与多个接收端建立有连接,则发送端中包括至少一个接收端对应的至少一个重传确认队列。In some embodiments, the sending end has established connections with multiple receiving ends, and the sending end includes at least one retransmission confirmation queue corresponding to at least one receiving end.
可选地,在基于流(stream)的传输协议(如QUIC)中,发送端和某个接收端之间存在多个数据流。发送端为至少一个数据流创建并维护对应的重传未确认队列。Optionally, in a stream-based transmission protocol (such as QUIC), there are multiple data streams between the sender and a certain receiver. The sending end creates and maintains a corresponding retransmission unacknowledged queue for at least one data flow.
可选地,若发送端确定某个初传数据没有被接收端成功接收,发送端立即对该数据进行初次重传,并将该数据添加到重传未确认队列(该过程由处于应用非受限状态的发送端完成)。Optionally, if the sending end determines that a certain initially transmitted data has not been successfully received by the receiving end, the sending end immediately retransmits the data for the first time and adds the data to the retransmission unconfirmed queue (this process is performed by the application non-receiver). completed by the sender in a limited state).
例如,发送端根据接收端发送的消息请求信息,向接收端发送a个数据包,a为正整数。接收端对a个数据包进行接收,并向发送端发送消息确认报文。发送端根据消息确认报文,确定数据包1出现丢包(也即数据包1中的数据1出现丢失),则发送端立即对数据1进行重传,并将数据1添加到重传未确认队列。For example, the sending end sends a data packet to the receiving end based on the message request information sent by the receiving end, where a is a positive integer. The receiving end receives a data packet and sends a message confirmation message to the sending end. According to the message confirmation message, the sender determines that packet 1 has been lost (that is, data 1 in packet 1 has been lost), then the sender immediately retransmits data 1 and adds data 1 to the retransmission unacknowledged list. queue.
在一些实施例中,重传未确认队列的大小是动态变化的。也即,重传未确认队列的大小根据已经重传但未被接收端确认收到的数据的数量确定。可选地,重传未确认队列通过链表实现。In some embodiments, the size of the retransmission unacknowledged queue is dynamically changed. That is, the size of the retransmission unacknowledged queue is determined based on the amount of data that has been retransmitted but has not been acknowledged by the receiving end. Optionally, the retransmission unacknowledged queue is implemented through a linked list.
可选地,在重传未确认队列包括多个已经重传但未被接收端确认收到的数据的情况下,多个已经重传但未被接收端确认收到的数据在重传未确认队列中的位置,根据各个数据的最后一次的重传时刻排列。Optionally, in the case where the retransmission unconfirmed queue includes multiple data that have been retransmitted but have not been acknowledged by the receiving end, multiple data that have been retransmitted but have not been acknowledged by the receiving end are in the retransmission unacknowledged queue. The position in the queue is arranged according to the last retransmission time of each data.
例如,数据2的最后一次重传时刻为12:00:01、数据3的最后一次重传时刻为12:00:15、数据4的最后一次重传时刻为11:59:01,则在重传未确认队列中,数据2、数据3和数据4的排列顺序为:数据4、数据2、数据3;其中,数据4更靠近重传未确认队列的队首。For example, the last retransmission time of data 2 is 12:00:01, the last retransmission time of data 3 is 12:00:15, and the last retransmission time of data 4 is 11:59:01. In the unconfirmed transmission queue, the order of data 2, data 3 and data 4 is: data 4, data 2, data 3; among them, data 4 is closer to the head of the retransmission unconfirmed queue.
在一些实施例中,在发送端中存在某个接收端对应的重传未确认队列的情况下,发送端对重传未确认队列进行维护,有关该过程的具体内容请参考下文实施例。In some embodiments, when there is an unconfirmed retransmission queue corresponding to a certain receiving end in the sending end, the sending end maintains the unconfirmed retransmission queue. For details about this process, please refer to the embodiments below.
可选地,发送端在与接收端建立连接后,监控当前是否处于应用受限状态,若检测到发送端当前处于应用受限状态,则发送端从重传未确认队列中,确定第一数据。若检测到发送端当前处于应用非受限状态,则发送端不执行重传未确认队列中确定第一数据的步骤。Optionally, after establishing a connection with the receiving end, the sending end monitors whether it is currently in an application restricted state. If it is detected that the sending end is currently in an application restricted state, the sending end determines the first data from the retransmission unconfirmed queue. If it is detected that the sending end is currently in an application unrestricted state, the sending end does not perform the step of retransmitting the first data in the unconfirmed queue.
步骤620,向接收端重传第一数据对应的第一数据包。Step 620: Retransmit the first data packet corresponding to the first data to the receiving end.
发送端处于应用受限状态时,暂时不存在需要进行初传的数据包(发送端的发送队列为空),因此,发送端可以选择任意一个可用传输资源对第一数据包进行重传。When the sending end is in the application-restricted state, there is no data packet that needs to be initially transmitted (the sending end's sending queue is empty). Therefore, the sending end can select any available transmission resource to retransmit the first data packet.
在一些实施例中,发送端根据与接收端建立连接使用的通信协议,确定数据包报头,并根据数据包报头和第一数据,生成第一数据包。发送端使用可用传输资源向接收端传输第一数据包。In some embodiments, the sending end determines the data packet header according to the communication protocol used to establish the connection with the receiving end, and generates the first data packet based on the data packet header and the first data. The sending end uses available transmission resources to transmit the first data packet to the receiving end.
可选地,处于应用受限状态的发送端对发生丢失的数据进行的动作称为重复重传。Optionally, the action performed by the sending end in the application-limited state on the lost data is called repeated retransmission.
在一些实施例中,传输第一数据使用的传输参数与初传数据或者初次重传数据使用的传输参数不用。可选地,发送端使用不同于发送初传数据或者初次重传数据的所使用的发送窗口,对第一数据进行重传。可选地,第一数据的传输速率小于或者等于初传数的传输速率。通过这种方法能够避免重复重传引起的数据传输阻塞,提升通信过程的可靠性。In some embodiments, the transmission parameters used to transmit the first data are different from those used to initially transmit the data or the first retransmission of the data. Optionally, the sending end retransmits the first data using a sending window different from that used to send the initially transmitted data or the first retransmitted data. Optionally, the transmission rate of the first data is less than or equal to the transmission rate of the initial transmission number. This method can avoid data transmission congestion caused by repeated retransmissions and improve the reliability of the communication process.
步骤630,调整第一数据在重传未确认队列中的位置。Step 630: Adjust the position of the first data in the retransmission unconfirmed queue.
发送端对第一数据进行重传后,对第一数据在重传确认队列中的位置进行调整。可选地,发送端将第一数据移动至重传未确认队列的队尾。After the sending end retransmits the first data, it adjusts the position of the first data in the retransmission confirmation queue. Optionally, the sending end moves the first data to the end of the retransmission unacknowledged queue.
综上所述,一方面,发送端在处于应用受限状态中,执行针对发生丢失的数据的再次重传操作,增加了发生丢失的数据在一段时间内的重传次数,有助于减少了接收端等待接收发生丢失的数据包的时间。To sum up, on the one hand, when the sender is in an application-limited state, it performs a retransmission operation for the lost data, which increases the number of retransmissions of the lost data within a period of time, which helps to reduce The time the receiver waits to receive lost packets.
另一方面,处于应用受限状态的发送端暂不具有初传数据,也即在应用受限状态下,进行对发生丢失的数据进行再重传操作不会影响数据初传过程,有助于减少数据包传输阻塞的发生。On the other hand, the sender in the application-limited state does not have the initial transmission data. That is, in the application-limited state, retransmitting the lost data will not affect the initial data transmission process, which is helpful to Reduce the occurrence of packet transmission blocking.
对于现场直播等对网络通信质量要求较高的领域,通过这种方法有助于缩短接受端接收丢失数据的时长,有助于缓解接收端中应用层播放器缓存中的数据被耗尽而带来的音视频卡顿等现象,在提升丢包数据重传成功率的同时,有助于保持接收端中音视频播放的流畅性,有助于改善现有音视频直播业务的用户体验。For fields such as live broadcasts that require high network communication quality, this method can help shorten the time for the receiver to receive lost data, and help alleviate the problem of exhaustion of data in the application layer player cache at the receiver. It not only improves the success rate of packet loss data retransmission, but also helps maintain the smoothness of audio and video playback at the receiving end and improves the user experience of existing audio and video live broadcast services.
在一些实施例中,按照最后一次重传时刻由早到晚的顺序,在重传未确认队列中从队首开始依次向队尾排列;发送端从重传未确认队列中确定第一数据,包括:发送端将位于重传未确认队列的队首的数据,确定为第一数据;发送端调整第一数据在重传未确认队列中的位置,包括:发送端将第一数据移动至重传未确认队列的队尾。In some embodiments, the retransmission unconfirmed queue is arranged in sequence from the beginning to the end of the queue in order of the last retransmission time; the sending end determines the first data from the retransmission unconfirmed queue, including : The sending end determines the data at the head of the retransmission unconfirmed queue as the first data; the sending end adjusts the position of the first data in the retransmission unconfirmed queue, including: the sending end moves the first data to the retransmission unconfirmed queue End of queue unacknowledged.
例如,重传未确认队列中按照队首到队尾的顺序包括:数据1、数据3、数据4和数据5。也即,数据1的最后一个重传时刻早于重传确认队列中的其他数据包。在发送端处于应用受限状态的情况下,发送端从重传未确认队列中将数据1确定为第一数据,对数据1进行重传。随后,发送端将数据1移动至重传未确认队列的队尾。重传未确认队列中按照队首到队尾的顺序包括:数据3、数据4、数据5和数据1。For example, the retransmission unconfirmed queue includes: data 1, data 3, data 4 and data 5 in order from the beginning of the queue to the end of the queue. That is, the last retransmission time of data 1 is earlier than other data packets in the retransmission confirmation queue. When the sending end is in an application-limited state, the sending end determines data 1 as the first data from the retransmission unconfirmed queue, and retransmits data 1. Subsequently, the sending end moves data 1 to the end of the retransmission unacknowledged queue. The retransmission unconfirmed queue includes data 3, data 4, data 5 and data 1 in order from the beginning of the queue to the end of the queue.
图7是本申请一个示例性实施例提供的重传未确认队列更新过程的示意图。Figure 7 is a schematic diagram of the retransmission unconfirmed queue update process provided by an exemplary embodiment of the present application.
发送端创建并维护了重传未确认(Queue_unack_loss)队列,其中,重传未确认队列中记录了4个已经被重传但未被接收端确认收到的数据(即Loss0、Loss1、Loss2、Loss3)。分别处于重传未确认队列中的位置0、位置1、位置2、位置3。在处于应用受限状态时,发送端对这些发生丢失的数据进行重复重传。发送端从重传未确认队列的队首(头部)提取Loss0,并基于Loss生成第一数据包。发送端向接收端发送第一数据包,实现对Loss进行重传。随后,发送端将Loss0从Queue_unack_loss队列的位置0移动至位置4。The sending end creates and maintains a retransmission unconfirmed (Queue_unack_loss) queue. The retransmission unconfirmed queue records 4 data that have been retransmitted but have not been confirmed by the receiving end (i.e. Loss0, Loss1, Loss2, Loss3 ). They are respectively at positions 0, 1, 2 and 3 in the retransmission unacknowledged queue. When in the application-limited state, the sending end repeatedly retransmits the lost data. The sending end extracts Loss0 from the head of the retransmission unacknowledged queue and generates the first data packet based on Loss. The sending end sends the first data packet to the receiving end to retransmit the Loss. Subsequently, the sending end moves Loss0 from position 0 to position 4 of the Queue_unack_loss queue.
通过这种方法,使得重传未确认队列中任意一个已经重传但未被接收端确认收到的数据包都有机会在应用受限状态下进行重传。同时,通过将最后一次重传时刻最早的数据包排列在重传未确认队列的队首,优先重复传输队首的数据包有助于缩短各个数据包的重传时间,缩短了接收端成功接收到重传数据包的耗时,有助于减少终端应用层播放的音视频出现卡顿。Through this method, any data packet in the retransmission unconfirmed queue that has been retransmitted but has not been confirmed by the receiving end has the opportunity to be retransmitted in an application-limited state. At the same time, by arranging the earliest data packet at the last retransmission time at the head of the retransmission unconfirmed queue, the data packet at the head of the queue is prioritized and repeatedly transmitted, which helps to shorten the retransmission time of each data packet and shortens the time for successful reception at the receiving end. This reduces the time it takes to retransmit data packets, helping to reduce lagging in audio and video played at the terminal application layer.
在一些实施例中,数据包的传输方法还包括:发送端在检测到第二数据发生丢失,且重传未确认队列中不存在第二数据的情况下,发送第二数据对应的第二数据包,并将第二数据添加至重传未确认队列的队尾;或者,发送端在检测到第二数据发生丢失,且重传未确认队列中存在第二数据的情况下,发送第二数据包对应的第二数据包,并将第二数据移动至重传未确认队列的队尾;或者,发送端在重传未确认队列中的第二数据被接收端确认收到的情况下,在重传未确认队列中删除第二数据。In some embodiments, the data packet transmission method further includes: when the sending end detects that the second data is lost and the second data does not exist in the retransmission unconfirmed queue, sending the second data corresponding to the second data. package, and adds the second data to the end of the retransmission unconfirmed queue; or, when the sending end detects that the second data is lost and there is second data in the retransmission unconfirmed queue, the sending end sends the second data packet corresponding to the second data packet, and moves the second data to the end of the retransmission unconfirmed queue; or, when the sender receives the second data in the retransmit unconfirmed queue and is confirmed by the receiving end, The second data is deleted from the retransmission unacknowledged queue.
第二数据是指发送端向接收端发送的任意一个数据。例如,第二数据为第一数据。又例如,第二数据是除了第一数据之外的任意一个数据。在一些实施例中,向接收端发送第二数据后,发送端根据接收端发送的消息确认报文,确定第二数据是否出现丢包。例如,接收端在消息确认报文中携带出现发生丢失的数据对应的数据标识,发送端根据数据标识确定第二数据包是否出现丢包。The second data refers to any data sent by the sending end to the receiving end. For example, the second data is the first data. For another example, the second data is any data except the first data. In some embodiments, after sending the second data to the receiving end, the sending end determines whether packet loss occurs in the second data according to the message confirmation message sent by the receiving end. For example, the receiving end carries the data identifier corresponding to the lost data in the message confirmation message, and the sending end determines whether the second data packet is lost based on the data identifier.
可选地,若消息确认报文中包括第二数据的数据标志,且第二数据对应的数据标识对应的接收消息为否定接收,则发送端检测出第二数据发生丢失。Optionally, if the message confirmation message includes a data flag of the second data, and the received message corresponding to the data flag corresponding to the second data is a negative reception, the sending end detects that the second data is lost.
在一些实施例中,在发送端在检测到第二数据发生丢失后,发送端对重传未确认队列中的已经重传但未确认接收的数据进行检测,查找第二数据是否存储在重传未确认列表。若重传未确认队列中包括第二数据,则需要调整第二数据在重传队列中的位置;如若重传未确认队列中不包括第二数据,则需要将第二数据添加至重传队列中的位置。In some embodiments, after the sending end detects that the second data is lost, the sending end detects the retransmitted but unconfirmed data in the retransmission unconfirmed queue to find out whether the second data is stored in the retransmission queue. Unconfirmed list. If the retransmission unconfirmed queue includes the second data, the position of the second data in the retransmission queue needs to be adjusted; if the retransmission unconfirmed queue does not include the second data, the second data needs to be added to the retransmission queue. location in.
在一些实施例中,在发送端检测到第二数据发生丢失的情况下,发送端根据与接收端进行连接使用的通信协议,生成数据包包头;发送端根据数据包的报头和第二数据,生成第二数据包。发送端向接收端发送第二数据包。In some embodiments, when the sending end detects that the second data is lost, the sending end generates a data packet header according to the communication protocol used to connect with the receiving end; the sending end generates a data packet header according to the header of the data packet and the second data, Generate a second data packet. The sending end sends the second data packet to the receiving end.
由上文内容可知,第二数据包用于对发生丢失的第二数据进行立即重传,第一数据包用于对第一数据进行重复重传。It can be seen from the above that the second data packet is used to immediately retransmit the lost second data, and the first data packet is used to repeatedly retransmit the first data.
在一些实施例中,第二数据包属于初传数据包。也就是说,重传未确认队列中不包括第二数据包。在这种情况下,若发送端检测到第二数据包出现丢包,则发送端立即对第二数据进行初次重传,并将第二数据添加至重传未确认队列的队尾。In some embodiments, the second data packet belongs to the initial transmission data packet. In other words, the second data packet is not included in the retransmission unacknowledged queue. In this case, if the sending end detects that the second data packet is lost, the sending end immediately retransmits the second data for the first time and adds the second data to the end of the retransmission unacknowledged queue.
在一些实施例中,第二数据包数据重传数据包。也就是说,重传未确认队列中包括第二数据包。在这种情况下,若发送端检测到第二数据包出现丢包,则发送端立即对第二数据进行初次重传,并将第二数据移动至重传未确认队列的队尾。In some embodiments, the second packet data retransmits the packet. That is to say, the retransmission unacknowledged queue includes the second data packet. In this case, if the sending end detects that the second data packet is lost, the sending end immediately retransmits the second data for the first time and moves the second data to the end of the retransmission unacknowledged queue.
可选地,发送端通过对重传未确认队列中的第二数据执行MOVE操作,将重传未确认队列中的第二数据删除,并将第二数据添加则重传未确认队列的队尾,以实现将第二数据移动至重传未确认队列的队尾。Optionally, the sending end deletes the second data in the retransmission unconfirmed queue by performing a MOVE operation on the second data in the retransmission unconfirmed queue, and adds the second data to the end of the retransmit unconfirmed queue. , to move the second data to the end of the retransmission unconfirmed queue.
在一些实施例中,发送端检测到第二数据包出现丢包,则发送端生成强相关数据,并对强相关数据进行传输,发送端将第二数据从重传未确认队列中删除,将强相关数据加入重传未确认队列的队尾。In some embodiments, when the sending end detects that the second data packet is lost, the sending end generates strong correlation data and transmits the strong correlation data. The sending end deletes the second data from the retransmission unconfirmed queue and sends the strongly correlated data. Relevant data is added to the end of the retransmission unacknowledged queue.
可选地,强相关数据用于对第二数据进行丢包恢复。虽然,强相关数据的内容和第二数据包的内容不同,但是接收端能够根据强相关数据得到第二数据包的内容。也即,通过传输强相关数据,能够对第二数据进行丢包恢复。例如,强相关数据包的数据内容中包括第二数据包中的数据内容和其他数据内容。Optionally, the strongly correlated data is used to perform packet loss recovery on the second data. Although the content of the strong correlation data is different from the content of the second data packet, the receiving end can obtain the content of the second data packet based on the strong correlation data. That is, by transmitting strongly correlated data, packet loss recovery can be performed on the second data. For example, the data content of the strongly correlated data packet includes the data content in the second data packet and other data content.
假设,第二数据为数据1、数据3是任一个重传未确定的数据、第二数据的强相关数据为数据5。在发送端检测到数据1发生丢失后,生成数据5,其中数据5的包括数据1和数据3,发送端向接收端发送数据5,并将数据1和数据3从重传未确认队列中删除。Assume that the second data is data 1, data 3 is any undetermined data for retransmission, and the strongly related data of the second data is data 5. After the sending end detects that data 1 is lost, it generates data 5, where data 5 includes data 1 and data 3. The sending end sends data 5 to the receiving end, and deletes data 1 and data 3 from the retransmission unconfirmed queue.
在一些实施例中,重传未确认队列中的任意两个数据之间不存在强相关关系。由上述实施例可知,若将数据5添加至重传未确认队列,且不删除重传未确认队列中的数据1,则容易导致数据1在一段时间内被多次重传。例如发送端传输数据5后很短一段时间内对数据1进行重传。由于接收端可能成功接收数据5,那么无需对数据1再次进行重传。In some embodiments, there is no strong correlation between any two data in the retransmission unacknowledged queue. It can be seen from the above embodiment that if data 5 is added to the retransmission unconfirmed queue and data 1 in the retransmission unconfirmed queue is not deleted, data 1 may easily be retransmitted multiple times within a period of time. For example, the sender retransmits data 1 within a short period of time after transmitting data 5. Since the receiving end may successfully receive data 5, there is no need to retransmit data 1 again.
通过保持重传未确认队列中各个数据之间不存在强相关关系,有助于避免发送端对发生丢失的数据进行不必要的重传,节省重传过程中的传输资源,还有助于缩短重传未确认队列中的数据包的重传耗时。By maintaining that there is no strong correlation between data in the retransmission unconfirmed queue, it helps to avoid unnecessary retransmission of lost data by the sender, saves transmission resources during the retransmission process, and also helps shorten the time The time taken to retransmit packets in the unacknowledged queue.
在一些实施例中,在发送端在重传未确认队列中的第二数据被接收端确认收到的情况下,在重传未确认队列中删除第二数据。In some embodiments, when the sending end acknowledges receipt of the second data in the retransmission unconfirmed queue and the receiving end acknowledges receipt, the second data is deleted in the retransmit unconfirmed queue.
可选地,发送端根据接收端发送的确认接收消息,确定第二数据被接收端确认接收。例如,确认接收消息中包括第二数据包的标识和ACK,则说明接收端确认收到第二数据包。发送端从重传未确认队列中删除第二数据包。Optionally, the sending end determines that the second data is confirmed to be received by the receiving end based on the confirmation message sent by the receiving end. For example, if the confirmation message includes the identifier and ACK of the second data packet, it means that the receiving end confirms receipt of the second data packet. The sending end deletes the second data packet from the retransmission unacknowledged queue.
例如,重传未确认队列从队首到队尾包括的数据分别为[数据3,数据2,数据1,数据4];处于应用非受限状态的发送端根据消息确认报文1,确定数据1和数据5发生丢失。处于应用非受限状态的发送端生成包括数据1对应的第二数据包A,发送第二数据包A,对数据1进行重传。发送端确定重传未确认队列中包括数据1,发送端将数据1移动至重传未确认队列的队尾。此时,重传未确认队列从队首到队尾包括的数据分别为[数据3,数据2,数据4,数据1]。处于应用非受限状态的发送端生成包括数据5对应的第二数据包B,发送第二数据包B;发送端确定重传未确认队列不包括数据5,发送端将数据5添加至重传未确认队列的队尾,重传未确认队列从队首到队尾包括的数据分别为[数据3,数据2,数据4,数据1,数据5]。发送端接收到接收端发送的消息确认报文2,确定接收端收到数据4,则发送端将数据4从重传未确认队列中删除。重传未确认队列从队首到队尾包括的数据分别为[数据3,数据2,数据1,数据5]。For example, the data included in the retransmission unconfirmed queue from the beginning to the end of the queue are [data 3, data 2, data 1, data 4]; the sending end in the application unrestricted state determines the data according to the message confirmation message 1 Data 1 and 5 are lost. The sending end in the application unrestricted state generates a second data packet A corresponding to data 1, sends the second data packet A, and retransmits data 1. The sending end determines that the retransmission unconfirmed queue includes data 1, and the sending end moves data 1 to the end of the retransmission unconfirmed queue. At this time, the data included in the retransmission unconfirmed queue from the beginning to the end of the queue are [data 3, data 2, data 4, data 1] respectively. The sending end in the application unrestricted state generates a second data packet B corresponding to data 5 and sends the second data packet B; the sending end determines that the retransmission unconfirmed queue does not include data 5, and the sending end adds data 5 to the retransmission The data included in the tail of the unconfirmed queue and the retransmission unconfirmed queue from the head to the end of the queue are [data 3, data 2, data 4, data 1, data 5] respectively. The sending end receives the message confirmation message 2 sent by the receiving end, and determines that the receiving end has received data 4, then the sending end deletes data 4 from the retransmission unconfirmed queue. The data included in the retransmission unconfirmed queue from the beginning to the end of the queue are [data 3, data 2, data 1, data 5] respectively.
发送端根据数据发生丢失的情况下,以及接收端的数据接收情况,在重传未确认队列中增加数据、调整数据的位置以及删除数据,保证了重传未确认丢列中只具有已经重传未被确认接收的数据。通过将重传后的数据移动到重传未确认队列的队尾,保证了最后一次发送时刻最早的数据排列在重传未确认队列的队首,有助于减少对最后一次发送时刻最早的数据进行重传的时间。The sender adds data, adjusts the position of the data, and deletes data in the retransmission unconfirmed queue according to the situation of data loss and the data reception situation of the receiving end, ensuring that only the retransmitted unconfirmed lost queues include those that have been retransmitted and have not yet been retransmitted. Data received is acknowledged. By moving the retransmitted data to the end of the retransmission unconfirmed queue, it ensures that the earliest data at the last sent time is arranged at the head of the retransmitted unconfirmed queue, which helps reduce the need for the earliest data at the last sent time. The time to retransmit.
在一些实施例中,在发送端处于应用受限状态的情况下,从重传未确认队列中确定第一数据,包括:在发送端处于应用受限状态,且满足第一条件的情况下,发送端从重传未确认队列中确定第一数据;其中,第一条件包括以下至少之一:发送端与接收端之间的端到端传输时延大于或等于第一阈值;发送端与接收端之间的丢包率大于或等于第二阈值。In some embodiments, when the sending end is in an application-limited state, determining the first data from the retransmission unconfirmed queue includes: when the sending end is in an application-limited state and the first condition is met, sending The end determines the first data from the retransmission unconfirmed queue; wherein the first condition includes at least one of the following: the end-to-end transmission delay between the sending end and the receiving end is greater than or equal to the first threshold; The packet loss rate during the period is greater than or equal to the second threshold.
在一些实施例中,端到端传输时延用于表征发送端和接收端的传输时延。丢包率用于表征出现丢包的数据包在已发送数据包中所占的比例。In some embodiments, the end-to-end transmission delay is used to characterize the transmission delay between the sending end and the receiving end. The packet loss rate is used to represent the proportion of lost data packets among the sent data packets.
在一些实施例中,第一阈值和第二阈值可以是协议预设置的,也可以由管理员设定的。In some embodiments, the first threshold and the second threshold may be preset by the protocol or set by the administrator.
在一些实施例中,第一条件用于表征发送端和接收端建立的连接的网络通信质量。若端到端传输时延越大,则发送端和接收端之间的网络通信质量越差,正在传输中的数据容易发生丢失;若端到端传输时延越小,则发送端和接收端之间的网络通信质量越好,接收端接收到数据的成功率越高。In some embodiments, the first condition is used to characterize the network communication quality of the connection established by the sending end and the receiving end. If the end-to-end transmission delay is larger, the network communication quality between the sender and the receiver will be worse, and the data being transmitted is prone to loss; if the end-to-end transmission delay is smaller, the sender and receiver will be The better the quality of network communication between them, the higher the success rate of the receiving end in receiving data.
若丢包率越大,则正在传输中的数据发生丢失的可能性越大;若丢包率越小,则正在传输中的数据发生丢失的可能性越小。If the packet loss rate is larger, the data being transmitted is more likely to be lost; if the packet loss rate is smaller, the data being transmitted is less likely to be lost.
在一些实施例中,在发送端处于应用受限状态且发送端与接收端之间的端到端传输时延大于或等于第一阈值的情况下,发送端从重传未确认队列中确定第一数据。In some embodiments, when the sending end is in an application-limited state and the end-to-end transmission delay between the sending end and the receiving end is greater than or equal to the first threshold, the sending end determines the first time from the retransmission unconfirmed queue. data.
例如,重传未确认队列中包括至少一个已经重传但未被确认接收的数据,在处于应用受限状态时,发送端从检测端到端的传输时延,并将端到端的传输时延与第一阈值进行比较。若端到端的传输时延大于或者等于第一阈值,则说明网络传输质量不佳,处于应用受限状态的发送端从重传未确认队列中,确定第一数据,并生成包括第一数据的第一数据包;处于应用受限状态的发送端通过发送第一数据包,实现对第一数据进行重复重传。若端到端的传输时延小于第一阈值,则发送端不执行从重传未确认队列中选择第一数据的步骤。For example, the retransmission unconfirmed queue includes at least one piece of data that has been retransmitted but has not been confirmed to be received. When in the application-limited state, the sender detects the end-to-end transmission delay and compares the end-to-end transmission delay with The first threshold is compared. If the end-to-end transmission delay is greater than or equal to the first threshold, it indicates that the network transmission quality is poor. The sending end in the application-limited state determines the first data from the retransmission unconfirmed queue and generates the first data including the first data. A data packet; the sending end in the application-limited state implements repeated retransmission of the first data by sending the first data packet. If the end-to-end transmission delay is less than the first threshold, the sending end does not perform the step of selecting the first data from the retransmission unconfirmed queue.
在一些实施例中,在发送端处于应用受限状态且发送端与接收端之间的丢包率大于或等于第二阈值,发送端从重传未确认队列中确定第一数据包。In some embodiments, when the sending end is in an application-limited state and the packet loss rate between the sending end and the receiving end is greater than or equal to the second threshold, the sending end determines the first data packet from the retransmission unacknowledged queue.
例如,重传未确认队列中包括至少一个已经重传但未被确认接收的数据,在处于应用受限状态时,发送端从检测丢包率,并将丢包率与第二阈值进行比较。若丢包率大于或者等于第二阈值,则说明网络传输质量不佳,处于应用受限状态的发送端从重传未确认队列中,确定第一数据,并生成包括第一数据的第一数据包;处于应用受限状态的发送端通过发送第一数据包,实现对第一数据进行重复重传。若丢包率小于第二阈值,则发送端不执行从重传未确认队列中选择第一数据的步骤。For example, the retransmission unconfirmed queue includes at least one piece of data that has been retransmitted but has not been confirmed to be received. When in the application restricted state, the sending end detects the packet loss rate and compares the packet loss rate with the second threshold. If the packet loss rate is greater than or equal to the second threshold, it indicates that the network transmission quality is poor. The sending end in the application-limited state determines the first data from the retransmission unconfirmed queue and generates the first data packet including the first data. ; The sending end in the application-limited state implements repeated retransmission of the first data by sending the first data packet. If the packet loss rate is less than the second threshold, the sending end does not perform the step of selecting the first data from the retransmission unconfirmed queue.
在一些实施例中,在发送端处于应用受限状态、发送端与接收端之间的端到端传输时延大于或等于第一阈值且发送端与接收端之间的丢包率大于或等于第二阈值的情况下,发送端从重传未确认队列中确定第一数据包。In some embodiments, when the sending end is in an application-limited state, the end-to-end transmission delay between the sending end and the receiving end is greater than or equal to the first threshold, and the packet loss rate between the sending end and the receiving end is greater than or equal to In the case of the second threshold, the sending end determines the first data packet from the retransmission unacknowledged queue.
例如,重传未确认队列中包括至少一个已经重传但未被确认接收的数据,在处于应用受限状态时,发送端从检测端到端传输时延和丢包率,并端到端传输时延与第一阈值进行比较,将丢包率与第二阈值进行比较。若端到端传输时延大于或者等于第一阈值,丢包率大于或者等于第二阈值,则说明网络传输质量不佳,处于应用受限状态的发送端从重传未确认队列中,确定第一数据,并生成包括第一数据的第一数据包;处于应用受限状态的发送端通过发送第一数据包,实现对第一数据进行重复重传。For example, the retransmission unconfirmed queue includes at least one piece of data that has been retransmitted but has not been confirmed to be received. When it is in an application-limited state, the sender detects the end-to-end transmission delay and packet loss rate, and transmits it end-to-end. The delay is compared with the first threshold, and the packet loss rate is compared with the second threshold. If the end-to-end transmission delay is greater than or equal to the first threshold and the packet loss rate is greater than or equal to the second threshold, it indicates that the network transmission quality is poor. The sender in the application-limited state determines the first transmission rate from the retransmission unconfirmed queue. data, and generates a first data packet including the first data; the sending end in the application-limited state implements repeated retransmission of the first data by sending the first data packet.
若端到端传输时延小于第一阈值且丢包率大于或者等于第二阈值,则处于应用受限状态的发送端不执行从重传未确认队列中选择第一数据的步骤。If the end-to-end transmission delay is less than the first threshold and the packet loss rate is greater than or equal to the second threshold, the sending end in the application-limited state does not perform the step of selecting the first data from the retransmission unconfirmed queue.
若端到端传输时延大于或者等于第一阈值,且丢包率小于第二阈值,则处于应用受限状态的发送端不执行从重传未确认队列中选择第一数据的步骤。If the end-to-end transmission delay is greater than or equal to the first threshold and the packet loss rate is less than the second threshold, the sending end in the application-limited state does not perform the step of selecting the first data from the retransmission unconfirmed queue.
若端到端传输时延大于或者等于第一阈值,且丢包率大于或者等于第二阈值,则发送端不执行从重传未确认队列中选择第一数据的步骤。可选地,发送端实时检测端到端传输时延、丢包率,并根据实时检测得到的端到端传输时延、丢包率确定是否在应用受限状态下,从重传未确认队列中确定第一数据包。If the end-to-end transmission delay is greater than or equal to the first threshold and the packet loss rate is greater than or equal to the second threshold, the sending end does not perform the step of selecting the first data from the retransmission unconfirmed queue. Optionally, the sending end detects the end-to-end transmission delay and packet loss rate in real time, and determines whether the retransmission unconfirmed queue is in the application-restricted state based on the end-to-end transmission delay and packet loss rate detected in real time. Identify the first packet.
在一些实施例中,发送端处于应用受限状态中,对端到端传输时延、丢包率进行至少n次检测,n为正整数。In some embodiments, the sending end is in an application-limited state and detects the end-to-end transmission delay and packet loss rate at least n times, where n is a positive integer.
例如,n等于1,也即,在发送端处于应用受限状态的过程中,发送端只对端到端传输时延或者丢包率进行一次实时检测。在这种情况下,发送端在检测到当前处于应用受限状态后,立即对端到端传输时延或者丢包率进行检测,并根据端到端传输时延或者丢包率是否满足第一条件,确定在本次应用受限状态中,是否从重传未确认队列中选择至少一个数据包进行重传。For example, n equals 1, that is, when the sending end is in an application-limited state, the sending end only performs a real-time detection of the end-to-end transmission delay or packet loss rate. In this case, after detecting that the sending end is currently in an application-limited state, it immediately detects the end-to-end transmission delay or packet loss rate, and determines whether the end-to-end transmission delay or packet loss rate meets the first requirement. Condition to determine whether to select at least one data packet from the retransmission unconfirmed queue for retransmission in this application restricted state.
需要说明的是n的数值根据实际需要进行设定,本申请在此不进行设定。It should be noted that the value of n is set according to actual needs, and is not set here in this application.
可选地,发送端处于应用受限状态中最多能发送N个已经重传未被确认接收的数据。例如,若发送端向接收端发送第一数据对应的第一数据包后检测到当前依旧处于应用受限状态(发送端依旧不具有初传数据),则发送端再次判断是否满足第一条件。若满足第一条件,则发送端设备再次执行从重传未确认队列中选择第一数据的步骤。若不满足条件,则发送端设备暂时不执行从重传未确认队列中选择第一数据的步骤。Optionally, the sending end can send up to N pieces of data that have been retransmitted but have not been acknowledged in the application-restricted state. For example, if the sending end sends the first data packet corresponding to the first data to the receiving end and detects that the application is still in a restricted state (the sending end still does not have the initial transmission data), the sending end determines again whether the first condition is met. If the first condition is met, the sending device performs the step of selecting the first data from the retransmission unconfirmed queue again. If the condition is not met, the sending device temporarily does not perform the step of selecting the first data from the retransmission unconfirmed queue.
可选地,处于应用受限状态的发送端发送k个已经重传未被确认接收的数据,对是否满足第一条件进行检测,k为小于或者等于N的正整数;若当前不满足第一条件,则处于应用受限状态发送端再次执行从重传未确认队列中选择第一数据的步骤;若当前不满足第一条件,则发送端在本次应用受限状态中,暂停执行从重传未确认队列中选择第一数据的步骤。Optionally, the sending end in the application-limited state sends k pieces of data that have been retransmitted but have not been confirmed to be received, and detect whether the first condition is met, where k is a positive integer less than or equal to N; if the first condition is not currently met, If the condition is met, the sending end in the application restricted state will again perform the step of selecting the first data from the retransmission unconfirmed queue; if the first condition is not currently met, the sending end will suspend the execution of the retransmission unconfirmed queue in this application restricted state. Confirm the step of selecting the first data in the queue.
在一些实施例中,发送端周期性对端到端传输时延或者丢包率进行检测。例如,发送端每个t秒进行对端到端传输时延或者丢包率进行一次检测。t的数值根据实际需要进行设定,本申请在此不进行限定。In some embodiments, the sending end periodically detects the end-to-end transmission delay or packet loss rate. For example, the sending end detects the end-to-end transmission delay or packet loss rate every t seconds. The value of t is set according to actual needs and is not limited in this application.
若发送端在应用受限过程中,测量了多次端到端传输时延或者丢包率,则在端到端传输时延或者丢包率满足第一条件的情况下,发送端对从重传未确认队列中选择并重传第一数据,在端到端传输时延或者丢包率不满足第一条件的情况下,发送端暂停对第一数据进行重传。If the sender measures the end-to-end transmission delay or packet loss rate multiple times during application restriction, then the sender will retransmit if the end-to-end transmission delay or packet loss rate meets the first condition. The first data is selected and retransmitted in the unconfirmed queue. If the end-to-end transmission delay or the packet loss rate does not meet the first condition, the sending end suspends retransmission of the first data.
例如,若发送端在第i次检测中,检测到端到端传输时延大于或者等于第一阈值T,或者,丢包率大于或者等于第二阈值R,也即满足第二条件,则发送端从重传未却确认队列中选择第一数据生成第一数据等于的第一数据包,并发送第一数据包。For example, if the sending end detects in the i-th detection that the end-to-end transmission delay is greater than or equal to the first threshold T, or the packet loss rate is greater than or equal to the second threshold R, that is, the second condition is met, then the sending The end selects the first data from the retransmission pending confirmation queue to generate a first data packet equal to the first data, and sends the first data packet.
若发送端在第i+1次检测中,检测到端到端传输时延小于或者等于第一阈值T,或者,丢包率小或者等于第二阈值R,也即不满足第一条件,则处于应用受限状态中的暂停从重传未却确认队列中选择第一数据,并对第一数据进行重复重传的行为。If the sending end detects that the end-to-end transmission delay is less than or equal to the first threshold T in the i+1th detection, or the packet loss rate is small or equal to the second threshold R, that is, the first condition is not met, then The pause in the application-limited state selects the first data from the retransmission pending confirmation queue and repeatedly retransmits the first data.
通过这种方法,根据发送端与接收端之间的通信质量,确定应用受限状态下发送端是否重复重传发生丢失的数据,有助于避免处于应用受限状态的发送端进行不必要的数据重传,有助于节省传输资源,降低发送端的功耗。Through this method, based on the communication quality between the sender and the receiver, it is determined whether the sender in the application-limited state repeatedly retransmits the lost data, which helps to avoid unnecessary unnecessary transmission of the sender in the application-limited state. Data retransmission helps save transmission resources and reduce the power consumption of the sending end.
可选地,在处于应用受限状态的发送端对端到端传输时延或者丢包率进行检测之前,发送端检测重传未确认队列中是否存在至少一个已经重传但未被接收端确认收到的数据。Optionally, before the sending end in the application-limited state detects the end-to-end transmission delay or packet loss rate, the sending end detects whether there is at least one retransmitted but not confirmed by the receiving end in the retransmission unconfirmed queue. received data.
若重传未确认队列中不存在已经重传但未被接收端确认收到的数据,则发送端不执行检查是否满足第一条件的步骤。若重传未确认队列中存在至少一个已经重传但未被接收端确认收到的数据,则发送端执行检查是否满足第一条件的步骤。If there is no data in the retransmission unconfirmed queue that has been retransmitted but has not been confirmed by the receiving end, the sending end does not perform the step of checking whether the first condition is met. If there is at least one piece of data in the retransmission unconfirmed queue that has been retransmitted but has not been confirmed by the receiving end, the sending end performs the step of checking whether the first condition is met.
例如,重传未确认队列中包括1个已经重传但未被接收端确认收到的数据,第一阈值为T。处于应用受限状态的发送端,确定端到端传输时延的检测结果1;若端到端传输时延的检测结果1大于T,则处于应用受限状态的发送端从重传未确认列表的队首选择第一数据,并向接收端发送第一数据对应的第一数据包,并将第一数据移动至重传未确认队列的队尾。For example, the retransmission unacknowledged queue includes one piece of data that has been retransmitted but has not been acknowledged by the receiving end, and the first threshold is T. The sender in the application-limited state determines the end-to-end transmission delay detection result 1; if the end-to-end transmission delay detection result 1 is greater than T, the sender in the application-limited state retransmits the unconfirmed list from The head of the queue selects the first data, sends the first data packet corresponding to the first data to the receiving end, and moves the first data to the end of the retransmission unacknowledged queue.
此时,发送端还处于应用受限状态,且重传未确认队列存在重传但未被接收端确认收到的数据。发送端检测端到端传输时延,得到端到端传输时延的检测结果2,若端到端传输时延的检测结果2小于T,则处于应用受限状态的发送端不执行从重传未确认队列中确定第一数据包的过程。At this time, the sending end is still in an application-limited state, and the retransmission unconfirmed queue contains data that has been retransmitted but has not been acknowledged by the receiving end. The sending end detects the end-to-end transmission delay and obtains the detection result 2 of the end-to-end transmission delay. If the detection result 2 of the end-to-end transmission delay is less than T, the sending end in the application-limited state does not perform retransmission. The process of identifying the first packet in the acknowledgment queue.
在经过一个检测间隔时长后,发送端依旧处于应用受限状态。发送端对发送端检测端到端传输时延,得到端到端传输时延的检测结果3,若端到端传输时延的检测结果3大于T,则发送端处于应用受限状态的发送端从重传未确认列表的队首选择第一数据,并向接收端发送第一数据对应的第一数据包,并将第一数据移动至重传未确认队列的队尾。处于应用受限状态的发送端获取接收端的消息确认报文,消息确认报文用于表征接收端接收到了第一数据,处于应用受限状态的发送端将第一数据从重传未确认队列中删除。After a detection interval has elapsed, the sender is still in an application-restricted state. The sending end detects the end-to-end transmission delay on the sending end and obtains the end-to-end transmission delay detection result 3. If the end-to-end transmission delay detection result 3 is greater than T, the sending end is in an application-limited state. Select the first data from the head of the retransmission unconfirmed queue, send the first data packet corresponding to the first data to the receiving end, and move the first data to the tail of the retransmission unconfirmed queue. The sender in the application-limited state obtains the message confirmation message from the receiver. The message confirmation message is used to indicate that the receiver has received the first data. The sender in the application-limited state deletes the first data from the retransmission unconfirmed queue. .
处于应用受限状态的发送端在下一次检测端到端传输时延前,确定重传未确认队列中不存在已经重传但未被接收端确认收到的数据,处于应用受限状态的发送端暂停检测端到端传输时延,可选地,在这种情况下,处于应用受限状态的发送端每隔i秒,检测重传未确认队列是否加入新的已经重传但未被接收端确认收到的数据。若加入已经重传但未被接收端确认收到的数据,则处于应用受限状态的发送端再次对端到端传输时延进行实时检测。Before the next detection of the end-to-end transmission delay, the sender in the application-limited state determines that there is no data in the retransmission unconfirmed queue that has been retransmitted but has not been confirmed by the receiving end. The sender in the application-limited state Pause to detect the end-to-end transmission delay. Optionally, in this case, the sender in the application-limited state checks whether the retransmission unconfirmed queue has added a new retransmission but has not been received. Confirm received data. If data that has been retransmitted but has not been confirmed by the receiving end is added, the sending end in the application-limited state will again detect the end-to-end transmission delay in real time.
重传未确认队列中不存在已经重传但未被接收端确认收到的数据,说明处于应用受限状态的发送端无需重传任意一个数据。在这种情况下,暂停检查是否满足第一条件,有助于减少发送端的计算开销。There is no data in the retransmission unconfirmed queue that has been retransmitted but has not been confirmed by the receiving end, indicating that the sending end in the application-limited state does not need to retransmit any data. In this case, pausing to check whether the first condition is met helps reduce the computational overhead of the sender.
在一些实施例中,在发送端处于应用受限状态的情况下,从重传未确认队列中确定第一数据,包括:在发送端处于应用受限状态,且满足第二条件的情况下,发送端从重传未确认队列中确定第一数据;其中,第二条件包括:丢包的重复重传次数大于或者等于第三阈值;其中,丢包的重复重传次数是指在发送端和接收端保持连接的过程中,对数据包进行重传的最大次数。In some embodiments, when the sending end is in an application-limited state, determining the first data from the retransmission unconfirmed queue includes: when the sending end is in an application-limited state and the second condition is met, sending The end determines the first data from the retransmission unconfirmed queue; where the second condition includes: the number of repeated retransmissions of packet loss is greater than or equal to the third threshold; where the number of repeated retransmissions of packet loss refers to the number of repeated retransmissions of packet loss between the sending end and the receiving end. The maximum number of times a data packet is retransmitted while maintaining a connection.
在一些实施例中,丢包的重复重传次数是指在发送端和接收端保持连接的过程中,对数据包进行重传的最大次数。例如,丢包的重复重传次数等于6,则说明某个数据对应的数据包在发送端和接收端保持连接的过程中,最多可以传输6次。In some embodiments, the number of repeated retransmissions of lost packets refers to the maximum number of retransmissions of a data packet while the sender and receiver maintain a connection. For example, if the number of repeated retransmissions of lost packets is equal to 6, it means that the data packet corresponding to a certain data can be transmitted up to 6 times while the sender and receiver maintain the connection.
在一些实施例中,第三阈值等于1。也即在丢包的重复重传次数等于1的情况下,某个数据包发生丢失后,发送端会立即对该数据进行重传,且发送端不会在应用受限状态下,再次对该数据进行重传。In some embodiments, the third threshold is equal to 1. That is to say, when the number of repeated retransmissions of lost packets is equal to 1, after a data packet is lost, the sending end will immediately retransmit the data, and the sending end will not retransmit the data again in the application-limited state. The data is retransmitted.
若丢包的重复重传次数大于1,则发送端对某个发生丢包的数据包进行立即重传后,还可以在应用受限状态中对该数据包进行重复重传。If the number of repeated retransmissions for lost packets is greater than 1, after the sender immediately retransmits a lost data packet, it can also retransmit the data packet repeatedly in the application-restricted state.
在一些实施例中,发送端中设置有重传计数器,用于记录各个已经重传但未确认接收的数据的重传次数。可选地,第一数据包的已重传次数小于或者等于丢包的重复重传次数。In some embodiments, a retransmission counter is provided in the sending end to record the number of retransmissions of each data that has been retransmitted but has not been confirmed to be received. Optionally, the number of retransmissions of the first data packet is less than or equal to the number of repeated retransmissions of lost packets.
在一些实施例中,丢包的重复重传次数可以根据历史服务质量确定。有关该过程的具体内容,请参考下文实施例。In some embodiments, the number of repeated retransmissions of lost packets may be determined based on historical service quality. For details about this process, please refer to the embodiment below.
在发送端和接收端刚建立连接的一段时间内,发送端与接受端尚未建立强连接,发送端无法及时测量端到端传输时延或者丢包率。在这种情况下,处于应用受限状态的发送端根据第二条件,确定是否需要选择并重复重传发生丢失的数据,为数据的重复重传过程提供了更多参考信息。During the period after the sender and receiver have just established a connection, the sender and receiver have not yet established a strong connection, and the sender cannot measure the end-to-end transmission delay or packet loss rate in a timely manner. In this case, the sending end in the application-limited state determines whether it is necessary to select and repeatedly retransmit the lost data based on the second condition, which provides more reference information for the repeated retransmission process of data.
在一些实施例中,数据包的传输方法还包括:发送端获取历史服务质量;其中,历史服务质量用于表征与接收端建立的历史会话的数据包传输情况;发送端根据历史服务质量,计算丢包的重复重传次数。In some embodiments, the data packet transmission method also includes: the sending end obtains historical service quality; wherein the historical service quality is used to characterize the data packet transmission status of the historical session established with the receiving end; the sending end calculates based on the historical service quality The number of repeated retransmissions for lost packets.
在一些实施例中,发送端通过接收端获取历史服务质量。可选地,发送端和接收端建立有历史连接。在连接结束之前,发送端将会话期间测量得到的服务质量(QoS)发送给接收端,该服务质量即为下一次发送端与接收端建立连接后可以参考的历史服务质量(QoS_his)。接收端存储该服务质量。In some embodiments, the sending end obtains historical service quality through the receiving end. Optionally, the sending end and receiving end establish a historical connection. Before the connection ends, the sender sends the quality of service (QoS) measured during the session to the receiver. This quality of service is the historical quality of service (QoS_his) that can be referenced after the next time the sender and the receiver establish a connection. The receiving end stores the quality of service.
在发送端与接收端再次建立连接的情况下,接收端向发送端发送存储的历史服务质量,接收端根据历史服务质量,确定丢包的重复重传次数。When the sending end and the receiving end establish a connection again, the receiving end sends the stored historical service quality to the sending end, and the receiving end determines the number of repeated retransmissions of lost packets based on the historical service quality.
通过这种方法,有助于减轻发送端的数据存储压力。由于发送端设备在一段时间内与多个接收端建立连接,将历史服务质量存储在各个接收端中,减少发送端需要存储维护的数据量。This method helps reduce the data storage pressure on the sending end. Since the sender device establishes connections with multiple receivers within a period of time, the historical service quality is stored in each receiver, reducing the amount of data that the sender needs to store and maintain.
在一些实施例中,发送端中存储与接收端进行历史连接所对应的历史服务质量。发送端从存储空间中获取历史服务质量。In some embodiments, the sending end stores historical service quality corresponding to historical connections with the receiving end. The sending end obtains historical service quality from the storage space.
在一些实施例中,发送端在获取历史服务质量后,需要确定历史服务质量信息是否可用。可选地,历史服务质量中包括历史会话的开始时刻和历史会话的结束时刻。发送端根据结束时刻确定历史会话与当前时刻之间的时间间隔。In some embodiments, after obtaining the historical service quality, the sending end needs to determine whether the historical service quality information is available. Optionally, the historical service quality includes the start time of the historical session and the end time of the historical session. The sender determines the time interval between the historical session and the current moment based on the end time.
若历史会话与当前时刻之间的时间间隔小于或者等于时间间隔阈值,则说明历史服务质量可用,发送端使用历史服务质量,计算丢包的重复重传次数。If the time interval between the historical session and the current moment is less than or equal to the time interval threshold, it means that the historical service quality is available, and the sender uses the historical service quality to calculate the number of repeated retransmissions of lost packets.
若历史会话与当前时刻之间的时间间隔大于或者等于时间间隔阈值,则说明历史服务质量不可用,发送端不执行使用历史服务质量,计算丢包的重复重传次数;可选地,在这种情况下,处于应用受限状态的发送端直接从重传为确认队列中,确定第一数据包,并对第一数据包进行重传。If the time interval between the historical session and the current moment is greater than or equal to the time interval threshold, it means that the historical service quality is not available, and the sender does not use the historical service quality to calculate the number of repeated retransmissions of lost packets; optionally, here In this case, the sending end in the application-limited state directly determines the first data packet from the retransmission to confirmation queue, and retransmits the first data packet.
在一个示例中,发送端确定确定历史服务质量信息是否可用的流程如下:In an example, the process by which the sending end determines whether historical service quality information is available is as follows:
1)服务器获取当前时刻Time_cur,并计算当前时刻与会话结束时刻之间的时间间隔Time_gap。时间间隔的计算过程如下:1) The server obtains the current time Time_cur and calculates the time interval Time_gap between the current time and the session end time. The calculation process of time interval is as follows:
Time_gap=Time_cur-Time_last_endTime_gap=Time_cur-Time_last_end
其中,Time_last_end表示历史会话的结束时刻,发送端可以从历史服务质量中,确定历史会话的结束时刻。Among them, Time_last_end represents the end time of the historical session. The sending end can determine the end time of the historical session from the historical service quality.
2)若Time_gap大于时间阈值Time_threshold,即Time_gap>Time_threshold,则说明历史服务质量QoS_his不可用,发送端不使用QoS_his信息。可选地,发送端将丢包重传策略设置为:若检测到丢包,则立刻重传一次丢失的报文。2) If Time_gap is greater than the time threshold Time_threshold, that is, Time_gap>Time_threshold, it means that the historical quality of service QoS_his is not available and the sending end does not use QoS_his information. Optionally, the sending end sets the packet loss retransmission policy to: if packet loss is detected, the lost message will be retransmitted immediately.
3)若Time_gap小于或者等于时间间隔阈值Time_threshold,即Time_gap≤Time_threshold,则说明历史服务质量可用,服务器使用QoS_his信息对确定本次连接中的丢包的重复传输次数。3) If Time_gap is less than or equal to the time interval threshold Time_threshold, that is, Time_gap ≤ Time_threshold, it means that the historical quality of service is available, and the server uses QoS_his information to determine the number of repeated transmissions of lost packets in this connection.
不同接收端对应的时间间隔阈值可以相同,也可以不同。工作人员可以根据不同接收端中的业务类型,为接收端个性化设置时间间隔阈值。需要说明的是,时间间隔阈值的具体数值根据实际需要进行设定,本申请在此不进行限定。The time interval thresholds corresponding to different receiving ends can be the same or different. Staff can set personalized time interval thresholds for the receiving end according to the service types in different receiving ends. It should be noted that the specific value of the time interval threshold is set according to actual needs and is not limited here in this application.
由于通信质量是动态变化的,在一段时间内的网络情况之间存在一定的相似性,通过确定历史服务质量对应的历史会话与当前时刻的时间间隔是否超出时间阈值,能够筛选出具有参考意义的历史服务质量,有助于提升根据历史服务质量确定出的丢包的重复重传次数的合理性。Since communication quality changes dynamically, there is a certain similarity between network conditions within a period of time. By determining whether the time interval between the historical session corresponding to the historical service quality and the current moment exceeds the time threshold, we can filter out the information with reference significance. Historical service quality helps to improve the rationality of the number of repeated retransmissions of lost packets determined based on historical service quality.
在一些实施例中,历史服务质量包括以下至少之一:历史会话的丢包重传成功率,丢包重传成功率用于表征接收端成功接收重传数据包的概率;历史会话的最大丢包重传次数,最大丢包重传次数用于表征在一次应用受限状态中,数据包的最大传输次数;历史会话中最大丢包重传次数的出现次数;历史会话中的丢包的重复传输次数。In some embodiments, the historical service quality includes at least one of the following: the packet loss retransmission success rate of the historical session. The packet loss retransmission success rate is used to represent the probability that the receiving end successfully receives the retransmitted data packet; the maximum loss of the historical session. The number of packet retransmissions. The maximum number of packet loss retransmissions is used to represent the maximum number of transmissions of data packets in an application-restricted state; the number of occurrences of the maximum number of packet loss retransmissions in historical sessions; the repetition of packet loss in historical sessions. Number of transfers.
在一些实施例中,丢包重传成功率、最大丢包重传次数基于历史会话中的等价重传的次数计算;其中,等价重传用于表真正在时长阈值内,发送端对数据包进行的重传。In some embodiments, the packet loss retransmission success rate and the maximum number of packet loss retransmissions are calculated based on the number of equal-cost retransmissions in historical sessions; where the equal-cost retransmission is used to indicate that the sending end is within the duration threshold. Retransmission of data packets.
发送端在时长阈值中针对某个数据进行的重传的动作称为等价重传。例如,若数据1在传输过程中出现丢失,则发送端在时长阈值中重传了3个数据1,则这3个数据1的重传称为一次等价重传。The action of the sender retransmitting certain data within the duration threshold is called equal-cost retransmission. For example, if data 1 is lost during transmission and the sender retransmits three data 1s within the duration threshold, then the retransmission of these three data 1s is called an equal-cost retransmission.
可选地,某个数据包的丢包重传成功率等于针对该数据包进行的等级重传的倒数。例如,发送端对某个数据包进行了4次等级重传,则该数据包的丢包重传成功率为25%。Optionally, the packet loss retransmission success rate of a certain data packet is equal to the reciprocal of the level retransmission for the data packet. For example, if the sender performs four level retransmissions on a certain data packet, the packet loss retransmission success rate of the data packet is 25%.
在一些实施例中,发送端和接收端建立连接过程中的丢包重传成功率等于各个数据包的丢包重传成功率的平均值。In some embodiments, the packet loss retransmission success rate during the connection establishment process between the sending end and the receiving end is equal to the average of the packet loss retransmission success rate of each data packet.
可选地,丢包重传成功率与网络通信质量成反比。丢包重传成功率越大,说明网络通信质量越差;丢包重传成功率越小,说明网络通信质量越好。Optionally, the packet loss retransmission success rate is inversely proportional to the network communication quality. The greater the packet loss retransmission success rate, the worse the network communication quality; the smaller the packet loss retransmission success rate, the better the network communication quality.
在一些实施例中,最大丢包重传次数是指处于应用受限状态下的发送端对某个数据包的最大重传次数。In some embodiments, the maximum number of packet loss retransmissions refers to the maximum number of retransmissions of a certain data packet by the sending end in an application-limited state.
历史会话中最大丢包重传次数的出现次数,用于表征历史会话过程中最大丢包重传次数的出现次数。The number of occurrences of the maximum number of packet loss retransmissions in the historical session is used to represent the number of occurrences of the maximum number of packet loss retransmissions in the historical session.
历史会话中的丢包的重复传输次数,用于表征历史会话中,某个数据包的进行重传的最大次数。The number of repeated transmissions of lost packets in historical sessions is used to represent the maximum number of retransmissions of a certain data packet in historical sessions.
在一些实施例中,根据历史服务质量,计算丢包的重复重传次数,包括:若历史服务质量满足第三条件,则将历史会话中的丢包的重复传输次数与第一数值之和确定为丢包的重复传输次数;其中,第三条件包括以下至少之一:历史会话的丢包重传成功率小于或者等于第四阈值;历史会话的最大丢包重传次数大于或者等于第五阈值;历史会话中最大丢包重传次数的出现次数大于或者等于第六阈值。In some embodiments, calculating the number of repeated retransmissions of lost packets based on historical service quality includes: if the historical service quality meets the third condition, determining the sum of the number of repeated retransmissions of lost packets in the historical session and the first value. is the number of repeated transmissions of lost packets; where the third condition includes at least one of the following: the success rate of packet loss retransmissions in historical sessions is less than or equal to the fourth threshold; the maximum number of packet loss retransmissions in historical sessions is greater than or equal to the fifth threshold ;The number of occurrences of the maximum number of packet loss retransmissions in the historical session is greater than or equal to the sixth threshold.
第三条件用于评估历史会话过程中的网络通信质量。若历史服务质量满足第三条件,则说明历史会话过程中的网络通信质量较差,需要对数据包进行更多次重传,保证接收端成功接收到数据包。The third condition is used to evaluate the quality of network communication during historical sessions. If the historical service quality meets the third condition, it means that the network communication quality during the historical session was poor, and the data packet needs to be retransmitted more times to ensure that the receiving end successfully receives the data packet.
在一些实施例中,第一数值为正整数。例如,第一数据等于1,也就是说在满足第三条件的情况下,发送端将历史会话中的丢包的重复传输次数加1,确定为丢包的重复传输次数。In some embodiments, the first numerical value is a positive integer. For example, the first data is equal to 1, which means that when the third condition is met, the sending end adds 1 to the number of repeated transmissions of lost packets in the historical session to determine the number of repeated transmissions of lost packets.
丢包的重复传输次数的计算公式如下:The calculation formula for the number of repeated transmissions of lost packets is as follows:
Retran_set_num_this=Retran_set_num+1Retran_set_num_this=Retran_set_num+1
其中,Retran_set_num_this表示丢包的重复传输次数,Retran_set_num表示历史会话中的丢包的重复传输次数。Among them, Retran_set_num_this represents the number of repeated transmissions of lost packets, and Retran_set_num represents the number of repeated transmissions of lost packets in historical sessions.
需要说明的是,第一数值的具体数值根据实际需要进行确定,本申请在此不进行设定。It should be noted that the specific value of the first value is determined according to actual needs and is not set here in this application.
在一些实施例中,在确定历史服务质量可用后,发送端判断历史服务质量是否满足第三条件。In some embodiments, after determining that the historical service quality is available, the sending end determines whether the historical service quality satisfies the third condition.
在一些实施例中,第三条件包括以下几种情况:In some embodiments, the third condition includes the following situations:
1)第三条件为历史会话的丢包重传成功率小于或者等于第四阈值;1) The third condition is that the packet loss retransmission success rate of historical sessions is less than or equal to the fourth threshold;
2)第三条件为历史会话的最大丢包重传次数大于或者等于第五阈值;2) The third condition is that the maximum number of packet loss retransmissions in historical sessions is greater than or equal to the fifth threshold;
3)第三条件为历史会话中最大丢包重传次数的出现次数大于或者等于第六阈值;3) The third condition is that the number of occurrences of the maximum number of packet loss retransmissions in the historical session is greater than or equal to the sixth threshold;
4)第三条件为历史会话的最大丢包重传次数大于或者等于第五阈值,且历史会话中最大丢包重传次数的出现次数大于或者等于第六阈值。4) The third condition is that the maximum number of packet loss retransmissions in the historical session is greater than or equal to the fifth threshold, and the number of occurrences of the maximum number of packet loss retransmissions in the historical session is greater than or equal to the sixth threshold.
5)第三条件为历史会话的丢包重传成功率小于或者等于第四阈值、历史会话的最大丢包重传次数大于或者等于第五阈值,且历史会话中最大丢包重传次数的出现次数大于或者等于第六阈值。5) The third condition is that the packet loss retransmission success rate of the historical session is less than or equal to the fourth threshold, the maximum number of packet loss retransmissions in the historical session is greater than or equal to the fifth threshold, and the maximum number of packet loss retransmissions in the historical session occurs The number of times is greater than or equal to the sixth threshold.
可选地,若第三条件为情况5),则第一数值大于第三条件为1)、2)、3)、4)对应的第一数值。Optionally, if the third condition is case 5), the first numerical value is greater than the first numerical value corresponding to the third condition being 1), 2), 3), and 4).
在一些实施例中,若QoS_his中的丢包重传成功率Retran_success_ratio偏小,说明历史会话中在数据包丢失后,发送端经过了多次等价重传后才能将丢失的报文回传至接收方。第四阈值记为Retran_success_ratio_t。In some embodiments, if the packet loss retransmission success rate Retran_success_ratio in QoS_his is too small, it means that after the data packet is lost in the historical session, the sending end can return the lost message to the receiver. The fourth threshold is denoted as Retran_success_ratio_t.
可选地,第四阈值可以称为丢包等价重传目标成功率。第四阈值的数值可由管理员设置;若Retran_success_ratio<Retran_success_ratio_t,则发送端计算Retran_set_num+p作为若Retran_set_num_this,p为第一数值。例如,p等于1、2、3……。Optionally, the fourth threshold may be called the target success rate of packet loss equivalent retransmission. The value of the fourth threshold can be set by the administrator; if Retran_success_ratio<Retran_success_ratio_t, the sending end calculates Retran_set_num+p as if Retran_set_num_this, p is the first value. For example, p equals 1, 2, 3….
在一些实施例中,若QoS_his中的最大丢包等价重传次数Retran_max_num最大丢包等价重传次数的出现次数Retran_max_amount均偏大,则说明在上次会话中报文出现丢失后,发送端存在多次等价重传后才能将丢失的报文回传至接收端;第五阈值及第六阈值分别记为Retran_max_num_t、Retran_max_amount_t,这两个阈值的具体数值可由管理员进行设置;In some embodiments, if the maximum number of packet loss equal-cost retransmissions Retran_max_num and the maximum number of packet loss equivalent retransmissions Retran_max_amount in QoS_his are both too large, it means that after the message was lost in the last session, the sending end The lost message can be sent back to the receiving end only after multiple equal-cost retransmissions; the fifth threshold and the sixth threshold are recorded as Retran_max_num_t and Retran_max_amount_t respectively. The specific values of these two thresholds can be set by the administrator;
若Retran_max_num>Retran_max_num_t,且Retran_max_amount>Retran_max_amount_t;则发送端计算Retran_set_num+p作为若Retran_set_num_this,p为第一数值。例如,p等于1、2、3……。If Retran_max_num>Retran_max_num_t, and Retran_max_amount>Retran_max_amount_t; then the sending end calculates Retran_set_num+p as if Retran_set_num_this, p is the first value. For example, p equals 1, 2, 3….
通过上述方法,根据历史服务质量确定丢包的重复传输次数,有助于提升提供接收端获取重传数据包的成功率。Through the above method, determining the number of repeated transmissions of lost packets based on historical service quality will help improve the success rate of providing the receiving end with retransmitted data packets.
在一些实施例中,数据包的传输方法还包括:若历史服务质量不满足第三条件,则将历史会话中的丢包的重复传输次数或者历史会话中的丢包的重复传输次数与第二数值之差,确定为丢包的重复传输次数。In some embodiments, the data packet transmission method further includes: if the historical service quality does not meet the third condition, comparing the number of repeated transmissions of lost packets in the historical session or the number of repeated transmissions of lost packets in the historical session with the second The difference between the values is determined as the number of repeated transmissions for packet loss.
在一些实施例中,若不满足第三条件,说明发送端与接收端进行历史会话的过程中的网络通信质量较好。在这种情况下,发送端按照轮询规则,根据数据包的传输失败次数,采用依次选择历史会话中的丢包的重复传输次数和历史会话中的丢包的重复传输次数与第二数值之差,作为丢包的重复传输次数。In some embodiments, if the third condition is not met, it means that the network communication quality during the historical session between the sending end and the receiving end is good. In this case, the sending end follows the polling rules and according to the number of transmission failures of the data packet, selects the number of repeated transmissions of the lost packets in the historical session and the number of repeated transmissions of the lost packets in the historical session and the second value. Difference, as the number of repeated transmissions for packet loss.
例如,若发送端第一次检测到某个数据包丢失,则在重传时重复发送(Retran_set_num–1)个相同的数据包;若发送端第二次检测到该数据包丢失,则在重传时重复发送Retran_set_num个相同的数据包。For example, if the sending end detects the loss of a certain data packet for the first time, it will resend (Retran_set_num–1) identical data packets during retransmission; if the sending end detects the loss of the data packet for the second time, it will resend it again. Repeatedly send Retran_set_num identical data packets during transmission.
图8是本申请一个示例性实施例提供的数据包的重传时机的示意图。Figure 8 is a schematic diagram of retransmission timing of data packets provided by an exemplary embodiment of the present application.
丢包的重复重传次数Retran_set_num_this设置为3,即若某个数据包在传输过程中出现丢包,则发送端需要重复重传3次,所以还需要将丢失的数据包1和2重复重传2次。发送端在应用受限阶段重传剩余次数的丢包重传操作,如图8中,发送端在应用受限阶段1分别重传1次丢失的数据包1和2;在应用受限阶段2分别重传1次丢失的数据包1和2。The number of repeated retransmissions of lost packets Retran_set_num_this is set to 3, that is, if a data packet is lost during transmission, the sender needs to retransmit it three times, so the lost data packets 1 and 2 need to be retransmitted again. 2 times. The sender retransmits the remaining number of packet loss retransmission operations in the application restricted phase. As shown in Figure 8, the sender retransmits lost data packets 1 and 2 once in application restricted phase 1; in application restricted phase 2 Retransmit lost packets 1 and 2 once respectively.
在一些实施例中,若等价重传的多个数据包之间的时间间隔超过往返时间,则发送端放弃该等价重传中对数据包进行重复重传。In some embodiments, if the time interval between multiple data packets in equal-cost retransmission exceeds the round-trip time, the sending end gives up retransmitting the data packets in the equal-cost retransmission.
图9是本申请一个示例性实施例提供的等级重传的时间间隔的示意图。Figure 9 is a schematic diagram of the time interval of level retransmission provided by an exemplary embodiment of the present application.
发送端在t0时刻检测到数据包1和2出现丢包并立刻进行重传。下一次应用受限阶段时,发送端试图再次重传丢失的数据包1;但此时等价重传的报文间隔T_retran超过服务器与用户终端之间的往返时间RTT,即T_retran>RTT,则在等价重传周期的应用受限阶段不再继续重传丢失的数据包1和2。The sender detects packet loss in data packets 1 and 2 at time t0 and immediately retransmits them. The next time the restricted phase is applied, the sender tries to retransmit the lost packet 1 again; but at this time, the equal-cost retransmission interval T_retran exceeds the round-trip time RTT between the server and the user terminal, that is, T_retran>RTT, then Lost data packets 1 and 2 will no longer be retransmitted during the application-limited phase of the equal-cost retransmission cycle.
在一些实施例中,数据包的传输方法还包括:在应用受限状态的持续时长内,若从重传未确认队列中确定并重传的数据的数量未达到门限值,则发送端再次从重传未确认队列中确定第一数据的步骤开始执行;若从重传未确认队列中确定并重传的数据的数量达到门限值,则停止从重传未确认队列中确定并重传数据。In some embodiments, the data packet transmission method further includes: within the duration of the application restricted state, if the number of data determined and retransmitted from the retransmission unacknowledged queue does not reach the threshold, the sending end retransmits it again. The step of determining the first data in the unconfirmed queue begins; if the number of data determined and retransmitted from the retransmission unconfirmed queue reaches the threshold, the determination and retransmission of data from the retransmitted unconfirmed queue stops.
在一些实施例中。门限值用于表征一次应用受限状态允许进行的等价重传的数量。可选地,门限值为大于或者等于1的正整数。例如,门限值等于6。需要说明的是,门限值根据实际需要进行设定,本申请在此不进行设定。In some embodiments. The threshold value is used to characterize the number of equivalent retransmissions allowed in an application's restricted state. Optionally, the threshold value is a positive integer greater than or equal to 1. For example, the threshold value is equal to 6. It should be noted that the threshold value is set according to actual needs, and is not set here in this application.
在一个示例中,在应用受限状态的持续时长内发送端从重传未确认队列的队首确定第一数据,并对第一数据对应的第一数据包进行重传;发送端将第一数据移动至重传未确定队列的队尾。若应用受限状态的持续时长未结束,则发送端再次从重传未确认队列的队首的数据作为新的第一数据,并对新的第一数据进行重传;发送端将新的第一数据移动至重传未确认队列的队尾。发送端循环进行上述操作,直至应用受限状态结束,或者从重传未确认队列中确定并重传的数据的数量达到门限值。In one example, within the duration of the application restricted state, the sending end determines the first data from the head of the retransmission unconfirmed queue and retransmits the first data packet corresponding to the first data; the sending end transmits the first data Move to the end of the retransmission undetermined queue. If the duration of the application restricted state has not ended, the sending end will retransmit the data at the head of the unconfirmed queue as the new first data, and retransmit the new first data; the sending end will retransmit the new first data. The data is moved to the end of the retransmission unacknowledged queue. The sender performs the above operations in a loop until the application restricted state ends or the number of data determined and retransmitted from the retransmission unconfirmed queue reaches the threshold.
在一些实施例中,第一数据的重传次数受到门限值和丢包的重复传输次数限制。在发送端的一次应用受限状态的持续时长中,对数据进行重传的次数不超过门限值。若在某次应用受限状态中,发送端已经进行的重传等于门限值,则在本次应用受限过程中,发送端不再对重传未确认队列中的其他数据进行重传。但发送端由本次应用受限状态转换至应用非受限状态,并再次进入应用受限状态时,重新统计发送端在新的应用受限状态中对数据进行重传的次数是否超出门限值。通过在一次应用受限状态的持续时间中,发送至少一个重传数据,有助于缩短接收端获取重传数据包的时长。In some embodiments, the number of retransmissions of the first data is limited by a threshold value and the number of retransmissions of lost packets. During the duration of an application-restricted state at the sender, the number of data retransmissions does not exceed the threshold value. If in a certain application restriction state, the retransmissions performed by the sender are equal to the threshold value, then during this application restriction process, the sender will no longer retransmit other data in the retransmission unconfirmed queue. However, when the sender transitions from the current application restricted state to the application unrestricted state, and then enters the application restricted state again, it will re-count whether the number of times the sender retransmits data in the new application restricted state exceeds the threshold. value. By sending at least one retransmission of data for the duration of an application-restricted state, it helps to shorten the time it takes for the receiver to obtain retransmitted data packets.
在一些实施例中,数据包的重传方法还包括:在发送端从应用受限状态切换至应用非受限状态的情况下,停止从重传未确认队列中确定并重传数据。In some embodiments, the data packet retransmission method further includes: when the sending end switches from the application restricted state to the application unrestricted state, stopping to determine and retransmit data from the retransmission unacknowledged queue.
在一些实施例中,应用非受限状态是指发送端中具有未传输的初传数据或者初次重传的数据。可选地,发送端实时监控是否处于应用受限状态。若确定属于应用受限状态,则发送端从重传未确认队列中确定并重传数据;若确定属于应用非受限状态,则停止从重传未确认队列中确定并重传数据,并开始传输初传数据包。In some embodiments, the application unrestricted state means that the sender has untransmitted initial transmission data or initial retransmission data. Optionally, the sending end monitors whether it is in an application restricted state in real time. If it is determined to be in the application restricted state, the sender determines and retransmits the data from the retransmission unconfirmed queue; if it is determined to be in the application unrestricted state, it stops determining and retransmitting the data from the retransmit unconfirmed queue and starts transmitting the initial transmission data. Bag.
可选地,发送端中具有发送队列,通过监控发送队列中的数据数量,确定发送端是否处于应用受限状态。若发送队列中不存在数据,则发送端处于应用受限状态;若发送队列中存在数据,则发送端处于应用非受限状态。若发送队列从不存在数据变为存在至少一个数据,说明发送端从应用受限状态切换至应用非受限状态。在这种情况下,发送端停止从重传未确认队列中确定并重传数据。可选地,处于应用非受限状态的发送端按照顺序对发送队列中的数据进行传输。Optionally, the sending end has a sending queue, and by monitoring the number of data in the sending queue, it is determined whether the sending end is in an application-limited state. If there is no data in the sending queue, the sending end is in the application restricted state; if there is data in the sending queue, the sending end is in the application unrestricted state. If the sending queue changes from no data to at least one data, it means that the sending end switches from the application restricted state to the application unrestricted state. In this case, the sender stops identifying and retransmitting data from the retransmission unacknowledged queue. Optionally, the sending end in the application unrestricted state transmits the data in the sending queue in sequence.
图10是本申请一个示例性实施例提供的数据包传输方法的时序图。Figure 10 is a sequence diagram of a data packet transmission method provided by an exemplary embodiment of the present application.
如图10所示,发送端在t0-t1时刻,执行基于QUIC协议或TCP协议执行的数据包传输方法。发送端在t1时刻检测到处于应用受限状态,发送端从重传未确认队列的队首头部提取数据(如Loss0),并向接收端再次重传该数据。As shown in Figure 10, the sender executes a data packet transmission method based on the QUIC protocol or TCP protocol at time t0-t1. The sending end detects that it is in an application-limited state at time t1. The sending end extracts data (such as Loss0) from the head of the retransmission unconfirmed queue and retransmits the data to the receiving end.
在发送端从应用受限状态切换至应用非受限状态的情况下,及时停止对重传未确认队列中的数据进行重传,有助于减少应用受限状态下的重传操作对数据包的初传产生的影响,有助于避免对重传未确认队列中的数据进行重传引起的数据包传输阻塞。When the sender switches from the application restricted state to the application unrestricted state, timely stop retransmitting the data in the retransmission unconfirmed queue, which helps to reduce the impact of retransmission operations on data packets in the application restricted state. The impact of the initial transmission helps avoid packet transmission blocking caused by retransmission of data in the retransmission unacknowledged queue.
在一些实施例中,重传未确认队列中包含的数据互不相同,且数据之间不存在强相关关系,若第三数据和第四数据之间具有强相关关系,则通过重传第四数据实现第三数据的丢包恢复。In some embodiments, the data contained in the retransmission unconfirmed queue are different from each other, and there is no strong correlation between the data. If there is a strong correlation between the third data and the fourth data, the fourth data is retransmitted. The data realizes packet loss recovery of the third data.
在一些实施例中,若第三数据发送丢失,发送端向接收端发送第四数据,接收端在获取到第四数据后,根据第四数据恢复第三数据,则说明第三数据和第四数据是相关的。In some embodiments, if the third data transmission is lost and the sending end sends the fourth data to the receiving end, and the receiving end recovers the third data based on the fourth data after obtaining the fourth data, it means that the third data and the fourth data are The data is relevant.
在一些实施例中,重传未确认队列中包含的数据互不相同是指数据中含的数据内容不同。In some embodiments, the data contained in the retransmission unconfirmed queue are different from each other means that the data content contained in the data is different.
由于重传未确认队列中各个数据之间不存在强相关关系,因此,若将第四数据添加至重传未确认队列的队尾,则需要将第三数据从重传未确认队列中移除,避免第三数据的数据内容在重传未确认队列中重复出现。Since there is no strong correlation between the data in the retransmission unconfirmed queue, if the fourth data is added to the end of the retransmission unconfirmed queue, the third data needs to be removed from the retransmission unconfirmed queue. Prevent the data content of the third data from appearing repeatedly in the retransmission unconfirmed queue.
通过这种方法,有助于提升数据的重复重传效率。This method helps improve the efficiency of repeated retransmission of data.
在一些实施例中,在应用受限状态的持续时长内,第一数据的重传参数满足以下至少之一:第一数的发送速率小于或者等于应用非受限状态下数据的发送速率;第一数据包的发送窗口与应用非受限状态下数据的发送窗口不同;其中,应用非受限状态是指发送端具有未传输的初传数据或者初次重传的数据。In some embodiments, within the duration of the application restricted state, the retransmission parameter of the first data satisfies at least one of the following: the sending rate of the first number is less than or equal to the sending rate of the data in the application unrestricted state; The sending window of a data packet is different from the sending window of data in the application unrestricted state; where the application unrestricted state means that the sending end has untransmitted initial transmission data or initial retransmission data.
发送速率用于表征发送端的数据传输速率。有关发送速率的相关实施例请参考上文实施例。The sending rate is used to characterize the data transmission rate of the sending end. For related embodiments of the sending rate, please refer to the above embodiments.
发送窗口用于向终端发送数据包。在一些实施例中,应用受限状态中使用的发送窗口与应用非受限状态中使用的发送窗口不同。The send window is used to send data packets to the terminal. In some embodiments, the sending window used in the application's restricted state is different from the sending window used in the application's unrestricted state.
例如,发送端具有可支配60个发送窗口,应用非受限状态持续时长中,使用前40个发送窗口发送初传数据或者初次重传数据;在应用受限状态的持续时长中,发送端从剩余的20个窗口中挑选至少一个发送窗口,对第一数据对应的第一数据包进行重传。For example, the sender has 60 sending windows at its disposal, and during the duration of the application unrestricted state, the first 40 sending windows are used to send initial transmission data or first retransmission data; during the duration of the application restricted state, the sending end never Select at least one sending window from the remaining 20 windows to retransmit the first data packet corresponding to the first data.
通过这种方法,有助于减小处于应用受限状态时,发送端进行的重复重传动作对应用非受限状态中的数据传输造成的影响。This method helps reduce the impact of repeated retransmission actions by the sender on data transmission in the application unrestricted state when the application is in the restricted state.
在一些实施例中,数据包的传输方法还包括:在发送端和接收端创建连接时,发送端创建连接对应的重传未确认队列;在发送端和接收端关闭连接时,释放连接对应的重传未确认队列。In some embodiments, the data packet transmission method also includes: when the sending end and the receiving end create a connection, the sending end creates a retransmission unconfirmed queue corresponding to the connection; when the sending end and the receiving end close the connection, release the connection corresponding Retransmit unacknowledged queue.
在一些实施例中,在发送端在与接收端建立连接时发送端创建重传未确认队列。在发送端和接收端保持连接的过程中,发送端持续对重传未确认队列进行维护。可选地,重传未确认队列中包括至少一个已经重传未被确认接收的数据包,或者重传未确认队列为空。In some embodiments, the sender creates a retransmission unacknowledged queue when the sender establishes a connection with the receiver. While the sender and receiver maintain a connection, the sender continues to maintain the retransmission unacknowledged queue. Optionally, the retransmission unacknowledged queue includes at least one data packet that has been retransmitted but has not been acknowledged, or the retransmission unacknowledged queue is empty.
通过这种方法,使得在发送端和接收端进行连接的过程中,只需要建立一次重传未确认队列,并释放一次重传未确认队列,有助于简化发送端管理重传未确认队列的步骤。Through this method, during the connection process between the sending end and the receiving end, only one retransmission unconfirmed queue needs to be established and one retransmission unconfirmed queue needs to be released, which helps to simplify the sending end's management of the retransmission unconfirmed queue. step.
在一些实施例中,在检测到连接对应的数据发生丢失时,发送端创建连接对应的重传未确认队列;在检测到重传未确认队列为空时,释放连接对应的重传未确认队列。In some embodiments, when it is detected that the data corresponding to the connection is lost, the sending end creates a retransmission unconfirmed queue corresponding to the connection; when it is detected that the retransmission unconfirmed queue is empty, the sender releases the retransmission unconfirmed queue corresponding to the connection. .
在这种情况下,重传未确认队列中包括至少一个已经重传未被确认接收的数据包。In this case, the retransmission unacknowledged queue includes at least one packet that has been retransmitted but whose receipt has not been acknowledged.
通过这种方法,发送端只需要在存在已经重传未确认接收的数据时,才对重传未确认队列进行维护,有助于减少发送端对重传未确认队列的维护时间,减少发送端的计算开销,还有助于减少维持重传未确认队列占用的空间资源。Through this method, the sender only needs to maintain the retransmission unconfirmed queue when there is data that has been retransmitted and has not been confirmed to be received, which helps to reduce the sender's maintenance time of the retransmit unconfirmed queue and reduce the sender's workload. Computational overhead also helps reduce the space resources occupied by maintaining the retransmission unacknowledged queue.
在一些实施例中,在检测到连接对应的数据发生丢失时,创建连接对应的重传未确认队列;在发送端和接收端关闭连接时,释放连接对应的重传未确认队列。In some embodiments, when it is detected that the data corresponding to the connection is lost, a retransmission unconfirmed queue corresponding to the connection is created; when the sending end and the receiving end close the connection, the retransmission unconfirmed queue corresponding to the connection is released.
例如,发送端获取接收端发送的消息确认信息,根据消息确认信息,确定存在至少一个数据包发生丢失,发送端创建连接对应的重传未确认队列。发送端在与接收端断开连接前,持续对重传未确认队列进行维护。For example, the sending end obtains the message confirmation information sent by the receiving end, determines that at least one data packet has been lost based on the message confirmation information, and creates a retransmission unconfirmed queue corresponding to the connection. The sender continues to maintain the retransmission unacknowledged queue before disconnecting from the receiver.
可选地,重传未确认队列中包括至少一个已经重传未被确认接收的数据包,或者重传未确认队列为空。Optionally, the retransmission unacknowledged queue includes at least one data packet that has been retransmitted but has not been acknowledged, or the retransmission unacknowledged queue is empty.
通过这种方法,在发送端和接收端保持连接的过程中,只需进行一次创建并释放重传未确认队列的动作。同时,在出现第一个数据包发生丢包时,才创建重传未确认队列,有助于缩短发送端和接收端把保持连接过程中,发送端对重传未确认队列的维护时长。Through this method, while the sender and receiver maintain the connection, only one action is required to create and release the retransmission unacknowledged queue. At the same time, the retransmission unconfirmed queue is created only when the first data packet is lost, which helps shorten the time the sender maintains the retransmit unconfirmed queue while the sender and receiver maintain the connection.
图11是本申请一个示例性实施例提供的数据包传输方法的示意图。Figure 11 is a schematic diagram of a data packet transmission method provided by an exemplary embodiment of the present application.
发送端与接收端建立连接后,创建重传未确认队列,发送端根据丢包重传和确认等信息维护重传未确认队列;发送端实时检测当前是否处于应用受限状态,若当前处于应用受限状态,则发送端从重传未确认队列的队首提取至少一个第一数据;发送端对重传未确认队列中提取的第一数据再次执行重复重传操作。重传未确认队列未空的情况下,发送端释放重传未确认队列。After the sender and receiver establish a connection, a retransmission unconfirmed queue is created. The sender maintains the retransmit unconfirmed queue based on packet loss retransmission and confirmation information; the sender detects in real time whether it is currently in an application restricted state. If it is currently in an application In the restricted state, the sending end extracts at least one first data from the head of the retransmission unconfirmed queue; the sending end performs a repeated retransmission operation on the first data extracted from the retransmission unconfirmed queue. When the retransmission unconfirmed queue is not empty, the sending end releases the retransmission unconfirmed queue.
下述为本申请装置实施例,可以用于执行本申请方法实施例。对于本申请装置实施例中未披露的细节,请参照本申请方法实施例。The following are device embodiments of the present application, which can be used to execute method embodiments of the present application. For details not disclosed in the device embodiments of this application, please refer to the method embodiments of this application.
图12示出了本申请一个示例性实施例提供的数据包的传输装置的框图。该装置可以通过软件、硬件或者两者的结合实现成为终端设备的全部或一部分。该装置1200可以包括:数据包确定模块1210、数据包重传模块1220和队列维护模块1230。Figure 12 shows a block diagram of a data packet transmission device provided by an exemplary embodiment of the present application. The device can be implemented as all or part of the terminal device through software, hardware, or a combination of both. The device 1200 may include: a data packet determination module 1210, a data packet retransmission module 1220, and a queue maintenance module 1230.
数据包确定模块1210,用于在发送端处于应用受限状态的情况下,从重传未确认队列中确定第一数据;其中,所述应用受限状态是指所述发送端暂不具有未传输的初传数据和初次重传的数据,所述重传未确认队列用于存储已经重传但未被接收端确认收到的数据。The data packet determination module 1210 is used to determine the first data from the retransmission unconfirmed queue when the sending end is in an application restricted state; wherein the application restricted state means that the sending end has no untransmitted data yet. The initial transmission data and the first retransmission data, the retransmission unconfirmed queue is used to store data that has been retransmitted but has not been confirmed by the receiving end.
数据包重传模块1220,用于向所述接收端重传所述第一数据对应的第一数据包。The data packet retransmission module 1220 is configured to retransmit the first data packet corresponding to the first data to the receiving end.
队列维护模块1230,用于调整所述第一数据在所述重传未确认队列中的位置。The queue maintenance module 1230 is used to adjust the position of the first data in the retransmission unconfirmed queue.
在一些实施例中,所述重传未确认队列中的数据,按照最后一次重传时刻由早到晚的顺序,在所述重传未确认队列中从队首开始依次向队尾排列;In some embodiments, the data in the retransmission unconfirmed queue is arranged in the retransmission unconfirmed queue from the beginning to the end of the queue in order of the last retransmission time;
所述数据包确定模块1210,用于将位于所述重传未确认队列的队首的数据包,确定为所述第一数据;所述队列维护模块1230,用于将所述第一数据移动至所述重传未确认队列的队尾。The data packet determination module 1210 is used to determine the data packet located at the head of the retransmission unconfirmed queue as the first data; the queue maintenance module 1230 is used to move the first data to the end of the retransmission unacknowledged queue.
在一些实施例中,所述队列维护模块1230还用于:在检测到第二数据发生丢失,且所述重传未确认队列中不存在所述第二数发生丢失的情况下,重传所述第二数据对应的第二数据,并将所述第二数据包添加至所述重传未确认队列的队尾;或者,在检测到第二数据包发生丢失,且所述重传未确认队列中存在所述第二数据的情况下,重传所述第二数据,并将所述第二数据移动至所述重传未确认队列的队尾;或者,在所述重传未确认队列中的第二数据包被所述接收端确认收到的情况下,在所述重传未确认队列中删除所述第二数据。In some embodiments, the queue maintenance module 1230 is also configured to: when it is detected that the second data is lost, and the second data is lost in the retransmission unconfirmed queue, retransmit all the lost data. second data corresponding to the second data, and add the second data packet to the end of the retransmission unconfirmed queue; or, after detecting that the second data packet is lost and the retransmission is not confirmed If the second data exists in the queue, retransmit the second data and move the second data to the end of the retransmission unconfirmed queue; or, in the retransmit unconfirmed queue When the second data packet in is confirmed to be received by the receiving end, the second data is deleted from the retransmission unconfirmed queue.
在一些实施例中,所述数据包确定模块1210,用于:在所述发送端处于所述应用受限状态,且满足第一条件的情况下,从所述重传未确认队列中确定所述第一数据;其中,所述第一条件包括以下至少之一:所述发送端与所述接收端之间的端到端传输时延大于或等于第一阈值;所述发送端与所述接收端之间的丢包率大于或等于第二阈值。In some embodiments, the data packet determination module 1210 is configured to: determine the retransmission unconfirmed queue from the retransmission unconfirmed queue when the sending end is in the application restricted state and the first condition is met. The first data; wherein, the first condition includes at least one of the following: the end-to-end transmission delay between the sending end and the receiving end is greater than or equal to a first threshold; the sending end and the receiving end The packet loss rate between receiving ends is greater than or equal to the second threshold.
在一些实施例中,所述数据包确定模块1210,用于:在所述发送端处于所述应用受限状态,且满足第二条件的情况下,从所述重传未确认队列中确定所述第一数据;其中,所述第二条件包括:丢包的重复重传次数大于或者等于第三阈值;其中,所述丢包的重复重传次数是指在所述发送端和所述接收端保持连接的过程中,对数据包进行重传的最大次数。In some embodiments, the data packet determination module 1210 is configured to: determine the retransmission unconfirmed queue from the retransmission unconfirmed queue when the sending end is in the application restricted state and the second condition is met. The first data; wherein, the second condition includes: the number of repeated retransmissions of packet loss is greater than or equal to a third threshold; wherein the number of repeated retransmissions of packet loss refers to the number of repeated retransmissions between the sending end and the receiving end. The maximum number of times a data packet is retransmitted while the client remains connected.
在一些实施例中,所述装置1200还包括:信息获取模块,用于获取历史服务质量;其中,所述历史服务质量用于表征与所述接收端建立的历史会话的数据包传输情况;次数确定模块,用于根据所述历史服务质量,计算所述丢包的重复重传次数。In some embodiments, the device 1200 further includes: an information acquisition module, used to obtain historical service quality; wherein the historical service quality is used to characterize the data packet transmission status of the historical session established with the receiving end; the number of times A determining module, configured to calculate the number of repeated retransmissions of the lost packet based on the historical service quality.
在一些实施例中,所述历史服务质量包括以下至少之一:所述历史会话的丢包重传成功率,所述丢包重传成功率用于表征所述接收端成功接收重传数据包的概率;所述历史会话的最大丢包重传次数,所述最大丢包重传次数用于表征在一次应用受限状态中,数据包的最大传输次数;所述历史会话中最大丢包重传次数的出现次数;所述历史会话中的丢包的重复传输次数。In some embodiments, the historical service quality includes at least one of the following: the packet loss retransmission success rate of the historical session. The packet loss retransmission success rate is used to represent that the receiving end successfully receives the retransmission data packet. probability; the maximum number of packet loss retransmissions in the historical session, which is used to represent the maximum number of packet loss retransmissions in an application-restricted state; the maximum number of packet loss retransmissions in the historical session; The number of occurrences of transmission times; the number of repeated transmissions of lost packets in the historical session.
在一些实施例中,所述丢包重传成功率、所述最大丢包重传次数基于所述历史会话中的等价重传的次数计算;其中,所述等价重传是指在时长阈值内,所述发送端对数据包进行的重传。In some embodiments, the packet loss retransmission success rate and the maximum number of packet loss retransmissions are calculated based on the number of equal-cost retransmissions in the historical session; wherein the equal-cost retransmission refers to the time duration Within the threshold, the sending end retransmits the data packet.
在一些实施例中,所述次数确定模块,用于,在所述历史服务质量满足第三条件的情况下,将所述历史会话中的丢包的重复传输次数与第一数值之和确定为所述丢包的重复传输次数;其中,所述第三条件包括以下至少之一:所述历史会话的丢包重传成功率小于或者等于第四阈值;所述历史会话的最大丢包重传次数大于或者等于第五阈值;所述历史会话中最大丢包重传次数的出现次数大于或者等于第六阈值。In some embodiments, the number of times determination module is configured to determine the sum of the number of repeated transmissions of lost packets in the historical session and the first value as if the historical service quality satisfies the third condition. The number of repeated transmissions of the packet loss; wherein the third condition includes at least one of the following: the packet loss retransmission success rate of the historical session is less than or equal to the fourth threshold; the maximum packet loss retransmission of the historical session The number of times is greater than or equal to the fifth threshold; the number of occurrences of the maximum number of packet loss retransmissions in the historical session is greater than or equal to the sixth threshold.
在一些实施例中,所述次数确定模块,还用于在所述历史服务质量不满足所述第三条件的情况下,将所述历史会话中的丢包的重复传输次数或者所述历史会话中的丢包的重复传输次数与第二数值之差,确定为所述丢包的重复传输次数。In some embodiments, the number of times determination module is also configured to determine the number of repeated transmissions of lost packets in the historical session or the number of repeated transmissions of the historical session when the historical service quality does not meet the third condition. The difference between the number of repeated transmissions of lost packets in and the second value is determined as the number of repeated transmissions of lost packets.
在一些实施例中,所述装置1200还包括:数量控制模块,用于在所述应用受限状态的持续时长内,若从所述重传未确认队列中确定并重传的数据的数量未达到门限值,则再次从所述从重传未确认队列中确定第一数据包的步骤开始执行;若从所述重传未确认队列中确定并重传的数据的数量达到门限值,则停止从所述重传未确认队列中确定并重传数据。In some embodiments, the device 1200 further includes: a quantity control module configured to, within the duration of the application restricted state, if the number of data determined and retransmitted from the retransmission unconfirmed queue does not reach threshold value, then start again from the step of determining the first data packet from the retransmission unconfirmed queue; if the number of data determined and retransmitted from the retransmission unconfirmed queue reaches the threshold value, stop from The data in the retransmission unacknowledged queue is determined and retransmitted.
在一些实施例中,所述装置1200还包括:重传停止模块,用于在所述发送端从所述应用受限状态切换至应用非受限状态的情况下,停止从所述重传未确认队列中确定并重传数据包。In some embodiments, the apparatus 1200 further includes: a retransmission stopping module, configured to stop the retransmission from the unrestricted state when the sending end switches from the application restricted state to the application unrestricted state. Acknowledge the queue and retransmit the packet.
在一些实施例中,所述重传未确认队列中包含的数据互不相同,且数据之间不存在强相关关系,若第三数据和第四数据之间具有强相关关系,则通过重传所述第四数据包实现所述第三数据包的丢包恢复。In some embodiments, the data contained in the retransmission unconfirmed queue are different from each other, and there is no strong correlation between the data. If there is a strong correlation between the third data and the fourth data, then the retransmission The fourth data packet implements packet loss recovery of the third data packet.
在一些实施例中,在所述应用受限状态的持续时长内,所述第一数据包的重传参数满足以下至少之一:所述第一数据的发送速率小于或者等于应用非受限状态下数据的发送速率;所述第一数据的发送窗口与所述应用非受限状态下数据的发送窗口不相同;其中,所述应用非受限状态是指所述发送端具有未传输的初传数据或者初次重传的数据。In some embodiments, within the duration of the application restricted state, the retransmission parameter of the first data packet satisfies at least one of the following: the sending rate of the first data is less than or equal to the application unrestricted state The transmission rate of data under the application is not restricted; the transmission window of the first data is different from the transmission window of data in the application unrestricted state; wherein the application unrestricted state means that the sending end has an initial untransmitted Transmitted data or data retransmitted for the first time.
在一些实施例中,所述装置1200还包括:队列管理模块,用于在所述发送端和所述接收端创建连接时,创建所述连接对应的所述重传未确认队列;在所述发送端和所述接收端关闭所述连接时,释放所述连接对应的所述重传未确认队列;或者,在检测到连接对应的数据发生丢失时,创建所述连接对应的所述重传未确认队列;在检测到所述重传未确认队列为空时,释放所述连接对应的所述重传未确认队列;或者,在检测到连接对应的数据发生丢失时,创建所述连接对应的所述重传未确认队列;在所述发送端和所述接收端关闭所述连接时,释放所述连接对应的所述重传未确认队列。In some embodiments, the apparatus 1200 further includes: a queue management module, configured to create the retransmission unconfirmed queue corresponding to the connection when the sending end and the receiving end create a connection; When the sending end and the receiving end close the connection, release the retransmission unconfirmed queue corresponding to the connection; or, when it is detected that the data corresponding to the connection is lost, create the retransmission corresponding to the connection. Unconfirmed queue; when it is detected that the retransmission unconfirmed queue is empty, release the retransmission unconfirmed queue corresponding to the connection; or, when it is detected that the data corresponding to the connection is lost, create the connection corresponding The retransmission unconfirmed queue; when the sending end and the receiving end close the connection, release the retransmission unconfirmed queue corresponding to the connection.
需要说明的是,上述实施例提供的装置,在实现其功能时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将设备的内容结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的装置与方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。上述实施例提供的装置的有益效果请参考方法侧实施例的描述,这里也不再赘述。It should be noted that when implementing the functions of the device provided by the above embodiments, only the division of the above functional modules is used as an example. In practical applications, the above functions can be allocated to different functional modules according to needs, that is, The content structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be described again here. For the beneficial effects of the devices provided by the above embodiments, please refer to the description of the method side embodiments, which will not be described again here.
图13示出了本申请一个示例性实施例提供的计算机设备的结构框图。该计算机设备1300可以是上文介绍的发送端,也可以是上文介绍的接收端。Figure 13 shows a structural block diagram of a computer device provided by an exemplary embodiment of the present application. The computer device 1300 may be the sending end introduced above, or the receiving end introduced above.
通常,计算机设备1300包括有:处理器1301和存储器1302。Generally, the computer device 1300 includes: a processor 1301 and a memory 1302.
处理器1301可以包括一个或多个处理核心,比如4核心处理器、8核心处理器等。处理器1301可以采用DSP(Digital Signal Processing,数字信号处理)、FPGA(FieldProgrammable Gate Array,现场可编程门阵列)、PLA(Programmable Logic Array,可编程逻辑阵列)中的至少一种硬件形式来实现。处理器1301也可以包括主处理器和协处理器,主处理器是用于对在唤醒状态下的数据进行处理的处理器,也称CPU(Central ProcessingUnit,中央处理器);协处理器是用于对在待机状态下的数据进行处理的低功耗处理器。在一些实施例中,处理器1301可以在集成有GPU(Graphics Processing Unit,图像处理器),GPU用于负责显示屏所需要显示的内容的渲染和绘制。一些实施例中,处理器1301还可以包括AI(Artificial Intelligence,人工智能)处理器,该AI处理器用于处理有关机器学习的计算操作。The processor 1301 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1301 can be implemented in at least one hardware form among DSP (Digital Signal Processing, digital signal processing), FPGA (Field Programmable Gate Array, field programmable gate array), and PLA (Programmable Logic Array, programmable logic array). The processor 1301 may also include a main processor and a co-processor. The main processor is a processor used to process data in the wake-up state, also called CPU (Central Processing Unit, central processing unit); the co-processor is A low-power processor used to process data in standby mode. In some embodiments, the processor 1301 may be integrated with a GPU (Graphics Processing Unit, image processor), and the GPU is responsible for rendering and drawing content that needs to be displayed on the display screen. In some embodiments, the processor 1301 may also include an AI (Artificial Intelligence, artificial intelligence) processor, which is used to process computing operations related to machine learning.
存储器1302可以包括一个或多个计算机可读存储介质,该计算机可读存储介质可以是有形的和非暂态的。存储器1302还可包括高速随机存取存储器,以及非易失性存储器,比如一个或多个磁盘存储设备、闪存存储设备。在一些实施例中,存储器1302中的非暂态的计算机可读存储介质存储有至少一条指令、至少一段程序、代码集或指令集,该至少一条指令、至少一段程序、代码集或指令集由处理器1301加载并执行以实现上述各方法实施例提供的数据包的传输方法。Memory 1302 may include one or more computer-readable storage media, which may be tangible and non-transitory. Memory 1302 may also include high-speed random access memory, and non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in memory 1302 stores at least one instruction, at least one program, a set of codes, or a set of instructions, the at least one instruction, at least one segment of a program, a set of codes, or a set of instructions consisting of The processor 1301 is loaded and executed to implement the data packet transmission method provided by each of the above method embodiments.
本申请实施例还提供一种计算机可读存储介质,该存储介质中存储有计算机程序,所述计算机程序由处理器加载并执行以实现上述各方法实施例提供的数据包的传输方法。Embodiments of the present application also provide a computer-readable storage medium, which stores a computer program. The computer program is loaded and executed by a processor to implement the data packet transmission method provided by the above method embodiments.
该计算机可读介质可以包括计算机存储介质和通信介质。计算机存储介质包括以用于存储诸如计算机可读指令、数据结构、程序模块或其他数据等信息的任何方法或技术实现的易失性和非易失性、可移动和不可移动介质。计算机存储介质包括RAM、ROM、EPROM(Erasable Programmable Read-Only Memory,可擦写可编程只读存储器)、EEPROM(Electrically Erasable Programmable Read-Only Memory,电可擦写可编程只读存储器)、闪存或其他固态存储技术,CD-ROM、DVD(Digital Video Disc,高密度数字视频光盘)或其他光学存储、磁带盒、磁带、磁盘存储或其他磁性存储设备。当然,本领域技术人员可知该计算机存储介质不局限于上述几种。The computer-readable media may include computer storage media and communication media. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media include RAM, ROM, EPROM (Erasable Programmable Read-Only Memory, Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory or Other solid-state storage technologies, CD-ROM, DVD (Digital Video Disc, high-density digital video disc) or other optical storage, tape cassettes, magnetic tapes, disk storage or other magnetic storage devices. Of course, those skilled in the art will know that the computer storage medium is not limited to the above types.
本申请实施例还提供一种计算机程序产品,所述计算机程序产品包括计算机指令,所述计算机指令存储在计算机可读存储介质中,处理器从所述计算机可读存储介质读取并执行所述计算机指令,以实现上述各方法实施例提供的数据包的传输方法。Embodiments of the present application also provide a computer program product. The computer program product includes computer instructions. The computer instructions are stored in a computer-readable storage medium. The processor reads and executes the instructions from the computer-readable storage medium. Computer instructions are used to implement the data packet transmission method provided by each of the above method embodiments.
应当理解的是,在本文中提及的“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。It should be understood that "plurality" mentioned in this article means two or more. "And/or" describes the relationship between associated objects, indicating that there can be three relationships. For example, A and/or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the related objects are in an "or" relationship.
需要说明的是,本申请所涉及的用户数据,以及信号,均为经用户授权或者经过各方充分授权的,且相关数据的收集、使用和处理需要遵守相关国家和地区的相关法律法规和标准。例如,本申请中涉及到的用户数据都是在充分授权的情况下获取的。It should be noted that the user data and signals involved in this application are authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with the relevant laws, regulations and standards of relevant countries and regions. . For example, the user data involved in this application was obtained with full authorization.
以上所述仅为本申请的可选实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同切换、改进等,均应包含在本申请的保护范围之内。The above are only optional embodiments of this application and are not intended to limit this application. Any modifications, equivalent switches, improvements, etc. made within the spirit and principles of this application shall be included in the protection of this application. within the range.
Claims (19)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211697316.1A CN117220838A (en) | 2022-12-28 | 2022-12-28 | Data packet transmission method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211697316.1A CN117220838A (en) | 2022-12-28 | 2022-12-28 | Data packet transmission method, device, equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117220838A true CN117220838A (en) | 2023-12-12 |
Family
ID=89044907
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211697316.1A Pending CN117220838A (en) | 2022-12-28 | 2022-12-28 | Data packet transmission method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117220838A (en) |
-
2022
- 2022-12-28 CN CN202211697316.1A patent/CN117220838A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2022247550A1 (en) | Data retransmission processing method and apparatus, computer device, and storage medium | |
CN109889543B (en) | Video transmission method, root node, child node, P2P server and system | |
US10542064B2 (en) | Method, server side and system for computing bandwidth of network transmission of streaming media | |
US9596281B2 (en) | Transport accelerator implementing request manager and connection manager functionality | |
US20230083441A1 (en) | Managing subpacket transmission and reception for advanced interactive services | |
CN112804707B (en) | Data transmission method, device, computer readable medium and electronic device | |
US10230651B2 (en) | Effective intra-frame refresh in multimedia communications over packet networks | |
WO2018121742A1 (en) | Method and device for transmitting stream data | |
CN112436924B (en) | Data transmission method and electronic equipment | |
WO2015000337A1 (en) | Video transmission method and apparatus | |
US20250119897A1 (en) | Data transmission method and apparatus, storage medium, electronic device, and product | |
CN115001632A (en) | Information transmission method and device, electronic equipment and readable storage medium | |
WO2024244337A1 (en) | Media data transmission method and apparatus, and electronic device, storage medium and program product | |
CN117220838A (en) | Data packet transmission method, device, equipment and storage medium | |
CN113726817B (en) | Streaming media data transmission method, device and medium | |
CN118555229A (en) | Network detection method, device, apparatus, readable storage medium and program product | |
CN114866523A (en) | UDP-based video rapid transmission method and system | |
JP7664407B2 (en) | Data retransmission processing method, device, computer device and computer program | |
CN118282585B (en) | UDP-based data transmission method, device and readable storage medium | |
EP4507277A1 (en) | Data transmission method and apparatus, computer-readable medium, and electronic device | |
US20240165508A1 (en) | Method, apparatuses and systems directed to quality of experience improvement in cloud gaming | |
WO2024001451A1 (en) | Processing method and apparatus for service data packet, and medium and electronic device | |
CN115767143A (en) | Judgment method, device, electronic equipment and readable storage medium for playing stuck | |
WO2023061555A1 (en) | Device and method for group qos control of multiple qos flows | |
CN116405468A (en) | Streaming media transmission method, system, device, equipment and medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication |