CN117729588A - Cache queue adjusting method and electronic equipment - Google Patents

Cache queue adjusting method and electronic equipment Download PDF

Info

Publication number
CN117729588A
CN117729588A CN202310782580.3A CN202310782580A CN117729588A CN 117729588 A CN117729588 A CN 117729588A CN 202310782580 A CN202310782580 A CN 202310782580A CN 117729588 A CN117729588 A CN 117729588A
Authority
CN
China
Prior art keywords
delay
jitter
service
transmission
cache queue
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.)
Granted
Application number
CN202310782580.3A
Other languages
Chinese (zh)
Other versions
CN117729588B (en
Inventor
庄凌凡
张梦龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202310782580.3A priority Critical patent/CN117729588B/en
Publication of CN117729588A publication Critical patent/CN117729588A/en
Application granted granted Critical
Publication of CN117729588B publication Critical patent/CN117729588B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application provides a buffer queue adjusting method and electronic equipment, which are applied to a receiving end, wherein the method comprises the following steps: responding to the initiating operation of the first service, obtaining a target service type of the first service, and determining a service setting time delay corresponding to the target service type; acquiring the current first transmission time delay of a receiving end and a transmitting end; acquiring frequency band characteristic information of a receiving end and a transmitting end, determining a jitter coefficient based on the frequency band characteristic information, and determining jitter buffer delay based on a jitter instruction value of first transmission delay and the jitter coefficient; the jitter indication value is used for indicating the jitter degree of the first transmission delay; adjusting the length of a buffer queue based on service setting time delay, first transmission time delay, jitter buffer time delay and packet sending interval of a data packet sent by a sending end; the buffer queue is used for buffering the data packets of the first service, and the length of the buffer queue is equal to the number of the data packets which can be buffered in the buffer queue. According to the scheme, the length of the cache queue can be dynamically adjusted according to the network jitter degree and the service setting.

Description

一种缓存队列调整方法及电子设备Cache queue adjustment method and electronic device

技术领域Technical Field

本申请涉及网络传输技术领域,尤其涉及一种缓存队列调整方法及电子设备。The present application relates to the field of network transmission technology, and in particular to a cache queue adjustment method and an electronic device.

背景技术Background Art

在数据传输的过程中,可能出现时延抖动的情况。目前,一般采用缓存队列机制平滑时延抖动,在缓存队列机制中,通过将数据包预存到缓存队列中,从而保持递包周期。During data transmission, delay jitter may occur. Currently, a cache queue mechanism is generally used to smooth the delay jitter. In the cache queue mechanism, data packets are pre-stored in the cache queue to maintain the packet delivery cycle.

但该方案中,缓存队列的长度相对固定。如果网络环境和业务类型发生变化,可能会由于缓存队列过短而导致无法平滑时延抖动,或由于缓存队列过长而造成性能的浪费。However, in this solution, the length of the cache queue is relatively fixed. If the network environment and service type change, the delay jitter may not be smoothed due to the cache queue being too short, or the performance may be wasted due to the cache queue being too long.

发明内容Summary of the invention

本申请实施例提供一种缓存队列调整方法及电子设备,可以根据网络抖动程度与业务设置共同调整缓存队列的长度,在平滑时延抖动的同时,不会造成性能浪费。The embodiments of the present application provide a cache queue adjustment method and an electronic device, which can adjust the length of the cache queue according to the degree of network jitter and service settings, while smoothing delay jitter without causing performance waste.

为达到上述目的,本申请的实施例采用如下技术方案:To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:

第一方面,提供了一种缓存队列调整方法,可以应用于接收端。接收端与发送端建立了无线连接,接收端用于接收并缓存来自发送端的第一业务的数据包后处理数据包,以执行第一业务,该方法包括:响应于第一业务的发起操作,获取第一业务的目标业务类型,并确定目标业务类型对应的业务设置时延;其中,业务设置时延是针对第一业务设置的从发送端发送第一业务的一个数据包至接收端开始处理对应数据包需要花费的时间。获取接收端与发送端当前的第一传输时延;其中,第一传输时延用于指示从发送端发送第一业务的一个数据包至接收端接收到对应数据包需要花费的时间。基于第一传输时延的抖动指示值确定抖动缓存时延;其中,抖动指示值用于指示第一传输时延的抖动程度,抖动缓存时延用于指示抖动程度下从发送端发送一个数据包至接收端接收到对应数据包抵抗抖动需要缓存的时间。基于业务设置时延、第一传输时延、抖动缓存时延和发送端发送数据包的发包间隔,调整缓存队列的长度K;其中,缓存队列用于缓存第一业务的数据包,缓存队列的长度K等于缓存队列中能够缓存的数据包的数量。In the first aspect, a cache queue adjustment method is provided, which can be applied to a receiving end. A receiving end establishes a wireless connection with a transmitting end, and the receiving end is used to receive and cache a data packet of a first service from the transmitting end and then process the data packet to execute the first service. The method includes: in response to the initiation operation of the first service, obtaining the target service type of the first service, and determining the service setting delay corresponding to the target service type; wherein the service setting delay is the time required for the first service setting from the transmitting end sending a data packet of the first service to the receiving end starting to process the corresponding data packet. Obtain the current first transmission delay between the receiving end and the transmitting end; wherein the first transmission delay is used to indicate the time required from the transmitting end sending a data packet of the first service to the receiving end receiving the corresponding data packet. Determine the jitter cache delay based on the jitter indication value of the first transmission delay; wherein the jitter indication value is used to indicate the jitter degree of the first transmission delay, and the jitter cache delay is used to indicate the time required to cache from the transmitting end sending a data packet to the receiving end receiving the corresponding data packet to resist jitter under the jitter degree. The length K of the cache queue is adjusted based on the service setting delay, the first transmission delay, the jitter buffer delay and the packet sending interval of the data packet sent by the sender; wherein the cache queue is used to cache the data packets of the first service, and the length K of the cache queue is equal to the number of data packets that can be cached in the cache queue.

通过采用该技术方案,可以通过获取接收端与发送端之间的传输时延,探测具体的网络抖动程度。以及根据业务设置时延,传输时延和网络抖动程度共同决定缓存队列的缓存深度,最后通过调整的缓存队列深度确定递包策略。By adopting this technical solution, the specific degree of network jitter can be detected by obtaining the transmission delay between the receiving end and the sending end. The cache depth of the cache queue is determined based on the service setting delay, transmission delay and network jitter degree, and finally the packet delivery strategy is determined by adjusting the cache queue depth.

在第一方面的一种可能的实现方式中,上述获取接收端与发送端当前的第一传输时延,包括:响应于第一业务的发起操作后,每隔第一预设时长向发送端发送传输帧;其中,传输帧中包括接收端在第一预设时长内接收到第一业务的第一个数据包的接收时间到传输帧的发送时间之间的第一等待时间。接收来自发送端的传输确认帧;其中,传输确认帧中包括第一往返时延,第一往返时延是发送端的第二等待时间与第一等待时间的差值,第一往返时延为第一传输时延与传输帧的第二传输时延之和,第二等待时间为发送端发送第一个数据包的发送时间到接收到来自接收端的传输帧的接收时间之间的时间。基于传输帧的发送时间和传输确认帧的接收时间,计算第二往返时延,得到传输帧的第二传输时延;其中,传输帧的发送时间和传输确认帧的接收时间相同。计算第一往返时延与传输帧的第二传输时延的差值,得到第一传输时延。由此,接收端可以实时,准确的探测出第一业务的数据包的当前传输时延。进而可以更加准确计算出缓存队列的长度,更好平滑时延抖动。并且,不需要额外增加数据帧去探测传输时延,可以减小功耗,节省电量。In a possible implementation of the first aspect, the above-mentioned acquisition of the current first transmission delay between the receiving end and the transmitting end includes: after responding to the initiation operation of the first service, sending a transmission frame to the transmitting end every first preset time; wherein the transmission frame includes a first waiting time between the receiving time of the first data packet of the first service received by the receiving end within the first preset time and the sending time of the transmission frame. Receive a transmission confirmation frame from the transmitting end; wherein the transmission confirmation frame includes a first round-trip delay, the first round-trip delay is the difference between the second waiting time of the transmitting end and the first waiting time, the first round-trip delay is the sum of the first transmission delay and the second transmission delay of the transmission frame, and the second waiting time is the time between the sending time of the first data packet sent by the transmitting end and the receiving time of the transmission frame received from the receiving end. Based on the sending time of the transmission frame and the receiving time of the transmission confirmation frame, calculate the second round-trip delay to obtain the second transmission delay of the transmission frame; wherein the sending time of the transmission frame and the receiving time of the transmission confirmation frame are the same. Calculate the difference between the first round-trip delay and the second transmission delay of the transmission frame to obtain the first transmission delay. As a result, the receiving end can detect the current transmission delay of the data packet of the first service in real time and accurately. Then, the length of the cache queue can be calculated more accurately, and the delay jitter can be smoothed better. In addition, there is no need to add additional data frames to detect the transmission delay, which can reduce power consumption and save electricity.

在第一方面的一种可能的实现方式中,业务设置时延包括最小固定值与最大固定值,该方法包括:若第一传输时延小于最小固定值,则业务设置时延为最小固定值;若第一传输时延大于或等于最小固定值,则业务设置时延为最大固定值。由此,根据实时计算出来的传输时延进一步确定业务设置时延的值,也即,业务设置时延可以根据传输时延动态进行调整。In a possible implementation of the first aspect, the service setting delay includes a minimum fixed value and a maximum fixed value, and the method includes: if the first transmission delay is less than the minimum fixed value, the service setting delay is the minimum fixed value; if the first transmission delay is greater than or equal to the minimum fixed value, the service setting delay is the maximum fixed value. Thus, the value of the service setting delay is further determined according to the transmission delay calculated in real time, that is, the service setting delay can be dynamically adjusted according to the transmission delay.

在第一方面的一种可能的实现方式中,在基于所述第一传输时延的抖动指示值确定抖动缓存时延之前,该方法还包括:基于第二预设时长内第一传输时延的平均离差值确定抖动指示值。其中,平均离差σ的计算公式如下:In a possible implementation of the first aspect, before determining the jitter buffer delay based on the jitter indication value of the first transmission delay, the method further includes: determining the jitter indication value based on an average deviation value of the first transmission delay within a second preset duration. The calculation formula of the average deviation σ is as follows:

上述公式中,n为第二预设时长内可以计算出的传输时延的次数,是n次传输时延的平均值。每次的传输时延与平均值之差为离差,平均离差σ即为各个离差的绝对值的平均值,可以反应传输时延在预设时长内的抖动程度。In the above formula, n is the number of transmission delays that can be calculated within the second preset time length, is the average value of n transmission delays. The difference between each transmission delay and the average value is the deviation. The average deviation σ is the average value of the absolute values of each deviation, which can reflect the jitter degree of the transmission delay within the preset time length.

在第一方面的一种可能的实现方式中,基于第一传输时延的抖动指示值确定抖动缓存时延,该方法包括:获取接收端与发送端的频段特征信息,基于频段特征信息确定抖动系数;其中,频段特征信息用于指示接收端与发送端的频点与信道的关系,包括同频同信道,异频同信道与异频异信道。基于抖动指示值与抖动系数的乘积确定抖动缓存时延。In a possible implementation of the first aspect, a jitter buffer delay is determined based on a jitter indication value of a first transmission delay, and the method includes: obtaining frequency band characteristic information of a receiving end and a transmitting end, and determining a jitter coefficient based on the frequency band characteristic information; wherein the frequency band characteristic information is used to indicate the relationship between the frequency point and the channel of the receiving end and the transmitting end, including the same frequency and the same channel, different frequencies and the same channel, and different frequencies and different channels. The jitter buffer delay is determined based on the product of the jitter indication value and the jitter coefficient.

在第一方面的一种可能的实现方式中,该方法还包括:若抖动缓存时延小于发包间隔,则抖动缓存时延调整为0。可以理解的是,若是计算出的抖动缓存时延小于发包间隔,则可以认为此时网络状况比较好,网络抖动较弱,可以不引入抖动缓存。由此,在网络状态好的时候,并不会引入抖动缓存,从而不会造成性能浪费。接收端可以只根据业务需求,也就是业务设置时延确定业务缓存时延,进一步调整缓存队列的长度。In a possible implementation of the first aspect, the method further includes: if the jitter buffer delay is less than the packet interval, the jitter buffer delay is adjusted to 0. It can be understood that if the calculated jitter buffer delay is less than the packet interval, it can be considered that the network condition is relatively good at this time, the network jitter is relatively weak, and the jitter buffer can be not introduced. Therefore, when the network condition is good, the jitter buffer will not be introduced, thereby not causing performance waste. The receiving end can determine the service buffer delay only according to the service demand, that is, the service setting delay, and further adjust the length of the buffer queue.

在第一方面的一种可能的实现方式中,目标业务类型还设置有对应的抖动缓存时延阈值,该方法包括:若抖动缓存时延大于抖动缓存时延阈值,则抖动缓存时延为抖动缓存时延阈值。也就是说,本方案中对每个业务的抖动缓存时延设置了对应的最大值限制,以免计算出的抖动缓存时延过大,超出业务设置能力。In a possible implementation manner of the first aspect, the target service type is further provided with a corresponding jitter buffer delay threshold, and the method includes: if the jitter buffer delay is greater than the jitter buffer delay threshold, the jitter buffer delay is the jitter buffer delay threshold. That is, in this solution, a corresponding maximum value limit is set for the jitter buffer delay of each service to prevent the calculated jitter buffer delay from being too large and exceeding the service setting capability.

在第一方面的一种可能的实现方式中,上述基于业务设置时延、第一传输时延、抖动缓存时延和发送端发送数据包的发包间隔,调整缓存队列的长度K,包括:基于业务设置时延T1、第一传输时延T2、抖动缓存时延T3和发送端发送数据包的发包间隔S,采用以下公式:K=(T1-T2+T3)/S,计算缓存队列的长度K。由此,本方案可以根据数据包实时准确的第一传输时延探测具体的网络抖动程度,并根据网络抖动程度与业务设置时延动态调整缓存队列长度。In a possible implementation of the first aspect, the adjustment of the length K of the cache queue based on the service setting delay, the first transmission delay, the jitter buffer delay, and the packet sending interval of the data packet sent by the sender includes: based on the service setting delay T1, the first transmission delay T2, the jitter buffer delay T3, and the packet sending interval S of the data packet sent by the sender, the following formula is used: K = (T1-T2+T3)/S to calculate the length K of the cache queue. Therefore, the present solution can detect the specific degree of network jitter according to the first transmission delay of the data packet in real time and accurately, and dynamically adjust the length of the cache queue according to the degree of network jitter and the service setting delay.

在第一方面的一种可能的实现方式中,在上述基于业务设置时延、第一传输时延、抖动缓存时延和发送端发送数据包的发包间隔,调整缓存队列的长度K之后,该方法还包括:获取缓存队列中当前缓存的数据包的实际数量k,基于实际数量k与缓存队列的长度K,调整缓存队列中已缓存的数据包的处理策略,直至缓存队列中缓存有K个数据包后按照所发包间隔处理缓存队列中缓存的数据包。按照实际数量与缓存队列的长度调整数据包的处理策略,可以在时延抖动时保持处理数据包的速度。In a possible implementation of the first aspect, after adjusting the length K of the cache queue based on the service setting delay, the first transmission delay, the jitter cache delay, and the packet sending interval of the data packet sent by the sender, the method further includes: obtaining the actual number k of data packets currently cached in the cache queue, and adjusting the processing strategy of the data packets cached in the cache queue based on the actual number k and the length K of the cache queue until K data packets are cached in the cache queue and then processing the data packets cached in the cache queue according to the packet sending interval. Adjusting the processing strategy of the data packet according to the actual number and the length of the cache queue can maintain the speed of processing the data packet when the delay jitters.

在第一方面的一种可能的实现方式中,上述基于实际数量k与缓存队列的长度K,调整缓存队列中已缓存的数据包的处理策略,包括:若实际数量k小于缓存队列的长度K,按照发包间隔处理缓存队列中缓存的数据包,并记录缓存队列中丢失的数据包,对丢失的数据包进行重传;若实际数量k大于缓存队列的长度K,按照目标间隔处理缓存队列中缓存的数据包或者对缓存队列中的数据包进行丢包处理;其中,目标间隔小于发包间隔;若实际数量k为0,则在缓存队列缓存一个数据包后,立即处理对应的数据包。按照上述数据包的处理策略,可以使缓存队列快速恢复到正常状态,保证接收端可以在时延抖动时保持处理数据包的速度。In a possible implementation of the first aspect, the above-mentioned processing strategy for adjusting the cached data packets in the cache queue based on the actual number k and the length K of the cache queue includes: if the actual number k is less than the length K of the cache queue, the cached data packets in the cache queue are processed according to the packet sending interval, and the lost data packets in the cache queue are recorded, and the lost data packets are retransmitted; if the actual number k is greater than the length K of the cache queue, the cached data packets in the cache queue are processed according to the target interval or the data packets in the cache queue are processed for packet loss; wherein the target interval is less than the packet sending interval; if the actual number k is 0, then after a data packet is cached in the cache queue, the corresponding data packet is processed immediately. According to the above-mentioned data packet processing strategy, the cache queue can be quickly restored to a normal state, ensuring that the receiving end can maintain the speed of processing data packets when the delay jitters.

在第一方面的一种可能的实现方式中,上述记录缓存队列中丢失的数据包,对丢失的数据包进行重传,包括:将丢失的数据包发送到重传队列中;若重传队列中重传的数据包的序号小于当前处理的数据包的序号,则不再重传对应的数据包;若重传队列中重传的数据包的序号大于当前处理的数据包的序号,则重传对应的数据包。本申请实施例不会对所有丢失的数据包都进行重传,只对序号大于当前处理的数据包的序号的数据包进行重传,可以节省资源。In a possible implementation of the first aspect, the above-mentioned recording of lost data packets in the cache queue and retransmitting the lost data packets include: sending the lost data packets to the retransmission queue; if the sequence number of the retransmitted data packet in the retransmission queue is less than the sequence number of the data packet currently being processed, then no longer retransmitting the corresponding data packet; if the sequence number of the retransmitted data packet in the retransmission queue is greater than the sequence number of the data packet currently being processed, then retransmitting the corresponding data packet. The embodiment of the present application does not retransmit all lost data packets, but only retransmits data packets with sequence numbers greater than the sequence number of the data packet currently being processed, which can save resources.

第二方面,提供了一种电子设备,该电子设备包括:通信模块、存储器和一个或多个处理器;所述通信模块、所述存储器和所述处理器耦合;所述存储器用于存储计算机程序代码,所述计算机程序代码包括计算机指令,当所述计算机指令被所述电子设备执行时,使得所述电子设备执行上述的缓存队列调整方法。In a second aspect, an electronic device is provided, which includes: a communication module, a memory and one or more processors; the communication module, the memory and the processor are coupled; the memory is used to store computer program code, and the computer program code includes computer instructions, and when the computer instructions are executed by the electronic device, the electronic device executes the above-mentioned cache queue adjustment method.

第三方面,提供了一种计算机可读存储介质,该计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机可以执行上述第一方面中任一项所述的缓存队列调整方法。In a third aspect, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is executed on a computer, the computer can execute the cache queue adjustment method described in any one of the first aspects.

第四方面,提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机可以执行上述第一方面中任一项所述的缓存队列调整方法。In a fourth aspect, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute the cache queue adjustment method described in any one of the first aspects.

第五方面,提供了一种装置(例如,该装置可以是芯片系统),该装置包括处理器,用于支持第一设备实现上述第一方面中所涉及的功能。在一种可能的设计中,该装置还包括存储器,该存储器,用于保存第一设备必要的程序指令和数据。该装置是芯片系统时,可以由芯片构成,也可以包含芯片和其他分立器件。In a fifth aspect, a device (for example, the device may be a chip system) is provided, the device including a processor for supporting a first device to implement the functions involved in the first aspect. In one possible design, the device also includes a memory for storing program instructions and data necessary for the first device. When the device is a chip system, it may be composed of a chip, or may include a chip and other discrete devices.

其中,第二方面至第五方面中任一种设计方式所带来的技术效果可参见第一方面中不同设计方式所带来的技术效果,此处不再赘述。Among them, the technical effects brought about by any design method in the second to fifth aspects can refer to the technical effects brought about by different design methods in the first aspect, and will not be repeated here.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1为本申请实施例提供的一种现有的缓存队列解决方案示意图;FIG1 is a schematic diagram of an existing cache queue solution provided by an embodiment of the present application;

图2为本申请实施例提供的一种时延探测的流程示意图;FIG2 is a schematic diagram of a delay detection process provided by an embodiment of the present application;

图3为本申请实施例提供的一种电子设备的硬件结构示意图;FIG3 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;

图4为本申请实施例提供的一种获取当前进行的第一业务的业务类型的软件结构示意图;FIG4 is a schematic diagram of a software structure for obtaining a service type of a currently-performed first service provided in an embodiment of the present application;

图5为本申请实施例提供的一种计算传输时延的示意图;FIG5 is a schematic diagram of calculating a transmission delay provided in an embodiment of the present application;

图6为本申请实施例提供的一种帧结构示意图;FIG6 is a schematic diagram of a frame structure provided in an embodiment of the present application;

图7为本申请实施例提供的一种确定期望缓存队列的示意图;FIG7 is a schematic diagram of determining an expected cache queue provided by an embodiment of the present application;

图8为本申请实施例提供的一种缓存队列的各状态的示意图;FIG8 is a schematic diagram of various states of a cache queue provided in an embodiment of the present application;

图9为本申请实施例提供的一种缓存队列异常状态快速恢复的示意图;FIG9 is a schematic diagram of a fast recovery of a cache queue abnormal state provided by an embodiment of the present application;

图10为本申请实施例提供的一种缓存队列数据包调整策略的示意图;FIG10 is a schematic diagram of a cache queue data packet adjustment strategy provided in an embodiment of the present application;

图11为本申请实施例提供的一种芯片系统的结构示意图。FIG11 is a schematic diagram of the structure of a chip system provided in an embodiment of the present application.

具体实施方式DETAILED DESCRIPTION

下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

需要说明的是,以下术语“第一”、“第二”等仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”等的特征可以明示或者隐含地包括一个或者更多个该特征。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。It should be noted that the following terms "first", "second", etc. are only used for descriptive purposes and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, features defined as "first", "second", etc. may explicitly or implicitly include one or more of the features. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices.

在本说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。References to "one embodiment" or "some embodiments" etc. described in this specification mean that a particular feature, structure or characteristic described in conjunction with the embodiment is included in one or more embodiments of the present application. Thus, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. appearing in different places in this specification do not necessarily all refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways.

在本申请实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

用户在近场条件下可以使用不同流类型业务。其中,流类型业务即以流媒体方式进行的音频、视频播放等的实时性业务。流媒体是指采用流式传输的媒体格式,在播放前并不下载整个文件,通过边下载、边缓存、边播放的方式使媒体数据正确地输出。流类型业务是单向传输的,包括发送端与接收端。发送端将该类业务的数据包传输到接收端,接收端处理接收到的数据包,也就是向上层递交数据包,以执行该类业务。Users can use different streaming services under near-field conditions. Streaming services are real-time services such as audio and video playback in streaming media. Streaming media refers to a media format that uses streaming transmission. The entire file is not downloaded before playback. The media data is correctly output by downloading, caching, and playing at the same time. Streaming services are unidirectional transmissions, including a sender and a receiver. The sender transmits the data packets of this type of service to the receiver, and the receiver processes the received data packets, that is, submits the data packets to the upper layer to execute this type of service.

当前支持有着不同的传输需求的多种流类型业务(例如超级键鼠、超级通话、异源投屏等),如果完全依赖空口网络进行传输将导致对网络抖动敏感的业务实际体验较差,例如键鼠同频异信道、异频异信道、有外部干扰时的流传输业务等场景。Currently, multiple stream types of services with different transmission requirements are supported (such as super keyboard and mouse, super call, heterogeneous screen projection, etc.). If the transmission relies entirely on the air interface network, the actual experience of services that are sensitive to network jitter will be poor, such as scenarios where the keyboard and mouse have the same frequency but different channels, different frequencies and different channels, and streaming transmission services when there is external interference.

时延抖动是影响流类型业务的服务质量(QoS)的一项重要指标。其中,时延抖动是指时延变化。数据包离开发送端时,是按照一定的间隔均匀发送,然而在通过网络时,这一均匀的间隔因数据包经历不同的延迟而遭到破坏,从而产生抖动。现有的一些方案中,可以采用缓存队列方案抵抗网络抖动。Delay jitter is an important indicator that affects the quality of service (QoS) of streaming services. Delay jitter refers to the delay variation. When data packets leave the sender, they are sent evenly at a certain interval. However, when passing through the network, this even interval is destroyed because the data packets experience different delays, resulting in jitter. In some existing solutions, a cache queue solution can be used to resist network jitter.

请参阅图1,图1为一种缓存队列流传输模型示意图。如图1所示,发送端向接收端发送数据包,为抵抗网络抖动并向上提供保序、动态帧率能力,接收端在收到包后不立刻进行递交,而是先插入缓存队列,在缓存一定数量的数据包后再向上递交数据包。Please refer to Figure 1, which is a schematic diagram of a cache queue flow transmission model. As shown in Figure 1, the sender sends a data packet to the receiver. In order to resist network jitter and provide order preservation and dynamic frame rate capabilities to the upper end, the receiver does not submit the packet immediately after receiving it, but inserts it into the cache queue first, and then submits the packet to the upper end after caching a certain number of data packets.

时延抖动会造成接收端出现无收包窗口期和大量收包窗口期。在时延抖动导致的无收包窗口期,接收端按序按发包间隔S向上层递交缓存队列中的数据包。如图1所示,接收端在接收到第四个数据包时开始进入无收包窗口期,此时,接收端开始递交缓存队列中的第一个数据包。其中,第一个数据包从接收端到缓存队列中被递交的时间称为首包缓存时延。递包周期R指接收端递交数据包的时间间隔,这里设为4毫秒。如图1所示,在无收包窗口期结束后,接收端开始进入大量收包窗口期,接收端将接收到的数据包预存到缓存队列中。此时,接收端还在按递包周期递交之前缓存在缓存队列中的数据包。由此,在时延抖动造成的接收端收包不正常的期间,接收端的缓存队列可以通过缓存数据包,使得时延抖动不会对接收端递交数据包造成影响。Delay jitter can cause the receiving end to have a no-packet-receiving window period and a large-packet-receiving window period. During the no-packet-receiving window period caused by delay jitter, the receiving end delivers the data packets in the cache queue to the upper layer in sequence according to the packet sending interval S. As shown in Figure 1, the receiving end begins to enter the no-packet-receiving window period when it receives the fourth data packet. At this time, the receiving end begins to deliver the first data packet in the cache queue. Among them, the time from the receiving end to the first data packet being delivered to the cache queue is called the first packet cache delay. The packet delivery cycle R refers to the time interval for the receiving end to deliver the data packet, which is set to 4 milliseconds here. As shown in Figure 1, after the no-packet-receiving window period ends, the receiving end begins to enter the large-packet-receiving window period, and the receiving end pre-stores the received data packets in the cache queue. At this time, the receiving end is still delivering the data packets previously cached in the cache queue according to the packet delivery cycle. Therefore, during the period when the receiving end receives abnormal packets due to delay jitter, the cache queue of the receiving end can cache data packets so that delay jitter will not affect the delivery of data packets by the receiving end.

但该方案中,缓存队列的长度相对固定。如果网络环境和业务类型发生变化,可能会由于缓存队列过短而导致无法平滑时延抖动,或由于缓存队列过长而造成性能的浪费。However, in this solution, the length of the cache queue is relatively fixed. If the network environment and service type change, the delay jitter may not be smoothed due to the cache queue being too short, or the performance may be wasted due to the cache queue being too long.

在现有的另一些方案中,可以采用动态缓存队列方案抵抗网络抖动。其中,可以定义WIFI协商速率433~1200Mbps、100~433Mbps、0~100Mbps为好、中、差3个区间,当WIFI协商速率发生跨区间变化时,发送端发送时延探测帧进行时延探测。然后,根据时延探测的结果,调整缓存队列。In other existing solutions, a dynamic cache queue solution can be used to resist network jitter. Among them, the WIFI negotiation rate can be defined as 433-1200Mbps, 100-433Mbps, and 0-100Mbps as three intervals of good, medium, and poor. When the WIFI negotiation rate changes across intervals, the sender sends a delay detection frame for delay detection. Then, according to the result of the delay detection, the cache queue is adjusted.

请参阅图2,图2为一种时延探测的示意图。如图2所示,发送端向接收端发送时延探测帧,接收端在接收到时延探测帧后,可以立刻给发送端回发一个时延探测确认(ACK)帧。发送端记录收到时延探测确认帧的时刻,该时刻与发送时延探测帧的时刻之差即为往返时延(RTT)。最后,发送端将携带RTT的时延通知帧传给接收端。从而,可以得到传输时延,即Ts=RTT/2。Please refer to Figure 2, which is a schematic diagram of a delay detection. As shown in Figure 2, the sender sends a delay detection frame to the receiver. After receiving the delay detection frame, the receiver can immediately send a delay detection confirmation (ACK) frame back to the sender. The sender records the time when the delay detection confirmation frame is received. The difference between this time and the time when the delay detection frame is sent is the round-trip delay (RTT). Finally, the sender transmits the delay notification frame carrying the RTT to the receiver. Thus, the transmission delay can be obtained, that is, Ts = RTT/2.

其中,可以根据业务类型和当前WIFI协商速率获取到用户体验时延,可知,用户体验时延为首包缓存时延与传输时延之和,即Tu=Tc+RTT/2,由于流传输的发包间隔基本恒定,即Tu=K×S+RTT/2,变换后可以得到缓存队列期望深度为:K=(Tu-RTT/2)/S。Among them, the user experience delay can be obtained according to the service type and the current WIFI negotiation rate. It can be seen that the user experience delay is the sum of the first packet cache delay and the transmission delay, that is, Tu=Tc+RTT/2. Since the packet transmission interval of the stream transmission is basically constant, that is, Tu=K×S+RTT/2, after transformation, the expected depth of the cache queue can be obtained as: K=(Tu-RTT/2)/S.

在当WIFI协商速率发生跨区间变化时,可以重新发起时延探测,也即重新计算得到传输时延,然后得到缓存队列期望深度。最后,根据实际数据与重新得到的缓存队列的长度调整数据包的递交策略。When the WiFi negotiation rate changes across intervals, the delay detection can be re-initiated, that is, the transmission delay can be recalculated, and then the expected depth of the cache queue can be obtained. Finally, the data packet delivery strategy is adjusted according to the actual data and the length of the cache queue obtained again.

但在上述方案中,仅当网络协商速率变化时才发送时延探测帧,不能及时感知网络抖动和时延,进而导致缓存深度不准确,无法平滑抖动。并且,仅通过业务设置和网络时延决定缓存深度,无法根据网络抖动程度调整缓存队列的长度。以及,上述方案在网络条件好的时候也会引入一定的缓存时延,造成性能浪费。However, in the above scheme, the delay detection frame is sent only when the network negotiation rate changes, and the network jitter and delay cannot be detected in time, which leads to inaccurate cache depth and inability to smooth jitter. In addition, the cache depth is determined only by service settings and network delay, and the length of the cache queue cannot be adjusted according to the degree of network jitter. In addition, the above scheme will also introduce a certain cache delay when the network conditions are good, resulting in performance waste.

为了解决上述问题,本申请实施例提供一种缓存队列调整方法,该方法可以通过获取接收端与发送端之间的传输时延,探测具体的网络抖动程度。以及根据业务设置时延,传输时延和网络抖动程度共同决定缓存队列的缓存深度,最后通过调整的缓存队列深度确定递包策略。In order to solve the above problems, the embodiment of the present application provides a cache queue adjustment method, which can detect the specific network jitter level by obtaining the transmission delay between the receiving end and the sending end, and jointly determine the cache depth of the cache queue according to the service setting delay, transmission delay and network jitter level, and finally determine the packet delivery strategy through the adjusted cache queue depth.

下面将结合附图对本申请实施例的实施方式进行详细描述。本申请实施例提供的一种缓存队列调整方法应用于接收端(也称为电子设备)。本申请实施例中,以上述接收端(即电子设备)是手机为例,介绍接收端的硬件结构。The following is a detailed description of the implementation of the embodiment of the present application in conjunction with the accompanying drawings. A cache queue adjustment method provided in the embodiment of the present application is applied to a receiving end (also referred to as an electronic device). In the embodiment of the present application, the hardware structure of the receiving end is introduced by taking the above-mentioned receiving end (i.e., the electronic device) as a mobile phone as an example.

如图3所示,电子设备200可以包括:处理器210,外部存储器接口220,内部存储器221,通用串行总线(universal serial bus,USB)接口230,充电管理模块240,电源管理模块241,电池242,天线1,天线2,移动通信模块250,无线通信模块260,音频模块270,扬声器270A,受话器270B,麦克风270C,耳机接口270D,传感器模块280,按键290,马达291,指示器292,摄像头293,显示屏294,以及用户标识模块(subscriber identification module,SIM)卡接口295等。As shown in Figure 3, the electronic device 200 may include: a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, an earphone interface 270D, a sensor module 280, a button 290, a motor 291, an indicator 292, a camera 293, a display screen 294, and a subscriber identification module (SIM) card interface 295, etc.

其中,上述传感器模块280可以包括压力传感器,陀螺仪传感器,气压传感器,磁传感器,加速度传感器,距离传感器,接近光传感器,指纹传感器,温度传感器,触摸传感器,环境光传感器和骨传导传感器等传感器。Among them, the above-mentioned sensor module 280 may include sensors such as pressure sensor, gyroscope sensor, air pressure sensor, magnetic sensor, acceleration sensor, distance sensor, proximity light sensor, fingerprint sensor, temperature sensor, touch sensor, ambient light sensor and bone conduction sensor.

可以理解的是,本实施例示意的结构并不构成对电子设备200的具体限定。在另一些实施例中,电子设备200可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It is to be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device 200. In other embodiments, the electronic device 200 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

处理器210可以包括一个或多个处理单元,例如:处理器210可以包括应用处理器(applicationprocessor,AP),调制解调处理器,图形处理器(graphicsprocessingunit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 210 may include one or more processing units, for example, the processor 210 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and/or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

控制器可以是电子设备200的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller may be the nerve center and command center of the electronic device 200. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

处理器210中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器210中的存储器为高速缓冲存储器。该存储器可以保存处理器210刚用过或循环使用的指令或数据。如果处理器210需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器210的等待时间,因而提高了系统的效率。The processor 210 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 210 is a cache memory. The memory may store instructions or data that the processor 210 has just used or cyclically used. If the processor 210 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 210, and thus improves the efficiency of the system.

在一些实施例中,处理器210可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuitsound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purposeinput/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。In some embodiments, the processor 210 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver/transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (SIM) interface, and/or a universal serial bus (USB) interface, etc.

可以理解的是,本实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备200的结构限定。在另一些实施例中,电子设备200也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。It is understandable that the interface connection relationship between the modules illustrated in this embodiment is only a schematic illustration and does not constitute a structural limitation on the electronic device 200. In other embodiments, the electronic device 200 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

充电管理模块240用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块240可以通过USB接口230接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块240可以通过电子设备200的无线充电线圈接收无线充电输入。充电管理模块240为电池242充电的同时,还可以通过电源管理模块241为电子设备供电。The charging management module 240 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 240 may receive charging input from a wired charger through the USB interface 230. In some wireless charging embodiments, the charging management module 240 may receive wireless charging input through a wireless charging coil of the electronic device 200. While the charging management module 240 is charging the battery 242, it may also power the electronic device through the power management module 241.

电源管理模块241用于连接电池242,充电管理模块240与处理器210。电源管理模块241接收电池242和/或充电管理模块240的输入,为处理器210,内部存储器221,外部存储器,显示屏294,摄像头293,和无线通信模块260等供电。电源管理模块241还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块241也可以设置于处理器210中。在另一些实施例中,电源管理模块241和充电管理模块240也可以设置于同一个器件中。The power management module 241 is used to connect the battery 242, the charging management module 240 and the processor 210. The power management module 241 receives input from the battery 242 and/or the charging management module 240, and supplies power to the processor 210, the internal memory 221, the external memory, the display screen 294, the camera 293, and the wireless communication module 260. The power management module 241 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 241 can also be set in the processor 210. In other embodiments, the power management module 241 and the charging management module 240 can also be set in the same device.

电子设备200的无线通信功能可以通过天线1,天线2,移动通信模块250,无线通信模块260,调制解调处理器以及基带处理器等实现。The wireless communication function of the electronic device 200 can be implemented through the antenna 1, the antenna 2, the mobile communication module 250, the wireless communication module 260, the modem processor and the baseband processor.

天线1和天线2用于发射和接收电磁波信号。电子设备200中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 200 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

移动通信模块250可以提供应用在电子设备200上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块250可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块250可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。The mobile communication module 250 can provide solutions for wireless communications including 2G/3G/4G/5G, etc., applied to the electronic device 200. The mobile communication module 250 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 250 can receive electromagnetic waves from the antenna 1, and filter, amplify, etc. the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation.

移动通信模块250还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块250的至少部分功能模块可以被设置于处理器210中。在一些实施例中,移动通信模块250的至少部分功能模块可以与处理器210的至少部分模块被设置在同一个器件中。The mobile communication module 250 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some functional modules of the mobile communication module 250 can be set in the processor 210. In some embodiments, at least some functional modules of the mobile communication module 250 can be set in the same device as at least some modules of the processor 210.

调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器270A,受话器270B等)输出声音信号,或通过显示屏294显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器210,与移动通信模块250或其他功能模块设置在同一个器件中。The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 270A, a receiver 270B, etc.), or displays an image or video through a display screen 294. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 210 and be set in the same device as the mobile communication module 250 or other functional modules.

无线通信模块260可以提供应用在电子设备300上的包括无线局域网(wirelesslocal areanetworks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。The wireless communication module 260 can provide wireless communication solutions for application in the electronic device 300, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication technology (NFC), infrared technology (IR), etc.

无线通信模块260可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块260经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器210。无线通信模块260还可以从处理器210接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。The wireless communication module 260 may be one or more devices integrating at least one communication processing module. The wireless communication module 260 receives electromagnetic waves via the antenna 2, modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 210. The wireless communication module 260 may also receive signals to be sent from the processor 210, modulate the frequencies of the signals, amplify the signals, and convert the signals into electromagnetic waves for radiation via the antenna 2.

在一些实施例中,电子设备200的天线1和移动通信模块250耦合,天线2和无线通信模块260耦合,使得电子设备200可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(codedivision multiple access,CDMA),宽带码分多址(wideband code division multipleaccess,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidounavigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellitesystem,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。In some embodiments, the antenna 1 of the electronic device 200 is coupled to the mobile communication module 250, and the antenna 2 is coupled to the wireless communication module 260, so that the electronic device 200 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and/or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and/or a satellite based augmentation system (SBAS).

电子设备200通过GPU,显示屏294,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏294和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器210可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 200 implements the display function through a GPU, a display screen 294, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 294 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 210 may include one or more GPUs, which execute program instructions to generate or change display information.

显示屏294用于显示图像,视频等。该显示屏294包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emittingdiode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrixorganic light emittingdiode,AMOLED),柔性发光二极管(flexlight-emittingdiode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot lightemitting diodes,QLED)等。The display screen 294 is used to display images, videos, etc. The display screen 294 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc.

电子设备200可以通过ISP,摄像头293,视频编解码器,GPU,显示屏294以及应用处理器等实现拍摄功能。The electronic device 200 can realize the shooting function through ISP, camera 293, video codec, GPU, display screen 294 and application processor.

ISP用于处理摄像头293反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头293中。The ISP is used to process the data fed back by the camera 293. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. The ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP can be set in the camera 293.

摄像头293用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备200可以包括1个或N个摄像头293,N为大于1的正整数。The camera 293 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 200 may include 1 or N cameras 293, where N is a positive integer greater than 1.

数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备200在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 200 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

视频编解码器用于对数字视频压缩或解压缩。电子设备200可以支持一种或多种视频编解码器。这样,电子设备200可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。Video codecs are used to compress or decompress digital videos. The electronic device 200 may support one or more video codecs. Thus, the electronic device 200 may play or record videos in a variety of coding formats, such as moving picture experts group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备200的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of the electronic device 200 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.

外部存储器接口220可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备200的存储能力。外部存储卡通过外部存储器接口220与处理器210通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。The external memory interface 220 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 200. The external memory card communicates with the processor 210 through the external memory interface 220 to implement a data storage function, such as storing music, video and other files in the external memory card.

内部存储器221可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器210通过运行存储在内部存储器221的指令,从而执行电子设备200的各种功能应用以及数据处理。例如,在本申请实施例中,处理器210可以通过执行存储在内部存储器221中的指令,内部存储器221可以包括存储程序区和存储数据区。The internal memory 221 may be used to store computer executable program codes, which include instructions. The processor 210 executes various functional applications and data processing of the electronic device 200 by running the instructions stored in the internal memory 221. For example, in an embodiment of the present application, the processor 210 may execute the instructions stored in the internal memory 221, and the internal memory 221 may include a program storage area and a data storage area.

其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备200使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器221可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universalflash storage,UFS)等。The program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 200 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 221 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

电子设备200可以通过音频模块270,扬声器270A,受话器270B,麦克风270C,耳机接口270D,以及应用处理器等实现音频功能。例如音乐播放,录音等。The electronic device 200 can implement audio functions such as music playing and recording through the audio module 270, the speaker 270A, the receiver 270B, the microphone 270C, the headphone jack 270D, and the application processor.

触摸传感器,也称“触控面板”。触摸传感器可以设置于显示屏294,由触摸传感器与显示屏294组成触摸屏,也称“触控屏”。触摸传感器用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏294提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器也可以设置于电子设备200的表面,与显示屏294所处的位置不同。The touch sensor is also called a "touch panel". The touch sensor can be arranged on the display screen 294, and the touch sensor and the display screen 294 form a touch screen, also called a "touch screen". The touch sensor is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 294. In other embodiments, the touch sensor can also be arranged on the surface of the electronic device 200, which is different from the position of the display screen 294.

本申请实施例中,电子设备200可以通过触摸传感器检测到用户在触摸屏输入的触摸操作,并采集该触摸操作在触摸屏上的触控位置,触控面积,触控方向,以及触控时间等中的一项或多项。在一些实施例中,电子设备200可以通过触摸传感器和压力传感器结合起来,确定触摸操作在触摸屏的触控位置。本申请实施例中,电子设备200可以通过触摸传感器检测到用户在触摸屏输入的触摸操作,确定该触摸操作在触摸屏上的触控位置对应的业务按钮,以发起第一业务。In the embodiment of the present application, the electronic device 200 can detect the touch operation input by the user on the touch screen through the touch sensor, and collect one or more of the touch position, touch area, touch direction, and touch time of the touch operation on the touch screen. In some embodiments, the electronic device 200 can determine the touch position of the touch operation on the touch screen by combining the touch sensor and the pressure sensor. In the embodiment of the present application, the electronic device 200 can detect the touch operation input by the user on the touch screen through the touch sensor, determine the service button corresponding to the touch position of the touch operation on the touch screen, and initiate the first service.

按键290包括开机键,音量键等。按键290可以是机械按键。也可以是触摸式按键。电子设备200可以接收按键输入,产生与电子设备200的用户设置以及功能控制有关的键信号输入。The key 290 includes a power key, a volume key, etc. The key 290 may be a mechanical key or a touch key. The electronic device 200 may receive key input and generate key signal input related to user settings and function control of the electronic device 200.

马达291可以产生振动提示。马达291可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏294不同区域的触摸操作,马达291也可对应不同的振动反馈效果。不同的应用场景(例如:时间提醒,接收信息,闹钟,游戏等)也可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。Motor 291 can generate vibration prompts. Motor 291 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 294, motor 291 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

指示器292可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。SIM卡接口295用于连接SIM卡。SIM卡可以通过插入SIM卡接口295,或从SIM卡接口295拔出,实现和电子设备200的接触和分离。电子设备200可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口295可以支持Nano SIM卡,Micro SIM卡,SIM卡等。The indicator 292 may be an indicator light, which may be used to indicate the charging status, power change, message, missed call, notification, etc. The SIM card interface 295 is used to connect the SIM card. The SIM card may be connected to or disconnected from the electronic device 200 by inserting the SIM card interface 295 or pulling the SIM card interface 295 out. The electronic device 200 may support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 295 may support Nano SIM card, Micro SIM card, SIM card, etc.

以下实施例中的方法均可以在具有上述硬件结构的电子设备200中实现。The methods in the following embodiments can all be implemented in the electronic device 200 having the above hardware structure.

本申请实施例提供的缓存队列调整方法应用于接收端。接收端与发送端建立了无线连接,接收端用于接收并缓存来自发送端的第一业务的数据包后处理该数据包,以执行第一业务。其中,第一业务可以是流类型业务,例如异源投屏。在异源投屏中,投屏设备(发送端)向被投屏设备(接收端)传输待投屏数据(数据包),被投屏设备处理接收到的待投屏数据(数据包)。本申请实施例提供的一种缓存队列调整方法可以包括S301-S306。The cache queue adjustment method provided in the embodiment of the present application is applied to the receiving end. The receiving end establishes a wireless connection with the transmitting end, and the receiving end is used to receive and cache the data packet of the first service from the transmitting end and then process the data packet to execute the first service. Among them, the first service can be a stream type service, such as heterogeneous screen projection. In heterogeneous screen projection, the projection device (transmitter) transmits the screen data (data packet) to be projected to the projected device (receiving end), and the projected device processes the received screen data (data packet) to be projected. A cache queue adjustment method provided in the embodiment of the present application may include S301-S306.

S301、接收端响应于第一业务的发起操作,接收端获取当前进行的第一业务的目标业务类型。S301: In response to an initiation operation of a first service, a receiving end obtains a target service type of the first service currently being performed.

例如,接收端的界面设置有各个业务的业务按钮,接收端响应于用户对该业务按钮的触控操作,获取该业务按钮对应业务的业务类型。其中,第一业务也可以是由发送端发起的。无论是由发送端还是由接收端发起上述第一业务,接收端在该第一业务发起后,便可以开始执行本申请实施例的方法,获取该第一业务的业务类型。For example, the interface of the receiving end is provided with service buttons for various services, and the receiving end obtains the service type of the service corresponding to the service button in response to the user's touch operation on the service button. The first service may also be initiated by the sending end. Regardless of whether the first service is initiated by the sending end or the receiving end, the receiving end can start executing the method of the embodiment of the present application after the first service is initiated to obtain the service type of the first service.

请参阅图4,图4为本申请实施例提供的一种获取当前进行的第一业务的业务类型的软件结构示意图。如图4所示,接收端的上层(如应用层)获取当前进行的第一业务的业务类型,将业务类型传递给接收端的通信模块,通信模块再将业务类型传递给接收端所在协议栈服务层。由此,接收端根据上层传递的信息确定了当前进行的第一业务的业务类型。Please refer to Figure 4, which is a schematic diagram of a software structure for obtaining the service type of the first service currently being performed provided by an embodiment of the present application. As shown in Figure 4, the upper layer (such as the application layer) of the receiving end obtains the service type of the first service currently being performed, passes the service type to the communication module of the receiving end, and the communication module then passes the service type to the protocol stack service layer where the receiving end is located. Thus, the receiving end determines the service type of the first service currently being performed based on the information transmitted by the upper layer.

其中,接收端的上层可以通过确定该业务类型对应的标识信息,将该标识信息传递给通信模块。通信模块中包括SENDSTREAM模块,SENDVI DEO模块等。通信模块中的与业务类型对应的模块接收到标识信息后,将标识信息传递到接收端所在的协议栈服务层。比如,上层确定当前进行的第一业务为超级键鼠业务,获取超级键鼠业务对应的标识信息(例如001)。上层将该标识信息(001)传递给通信模块,通信模块再将该标识信息(001)传递给接收端所在的协议栈服务层。接收端所在的协议栈服务层根据该标识信息(001)确定对应的业务类型。其中,业务类型对应的标识信息是预先存储在接收端中,标识信息也可以设置为其他形式。Among them, the upper layer of the receiving end can pass the identification information to the communication module by determining the identification information corresponding to the service type. The communication module includes a SENDSTREAM module, a SENDVIDEO module, etc. After receiving the identification information, the module corresponding to the service type in the communication module passes the identification information to the protocol stack service layer where the receiving end is located. For example, the upper layer determines that the first service currently being carried out is a super keyboard and mouse service, and obtains the identification information (for example, 001) corresponding to the super keyboard and mouse service. The upper layer passes the identification information (001) to the communication module, and the communication module then passes the identification information (001) to the protocol stack service layer where the receiving end is located. The protocol stack service layer where the receiving end is located determines the corresponding service type based on the identification information (001). Among them, the identification information corresponding to the service type is pre-stored in the receiving end, and the identification information can also be set to other forms.

其中,接收端在确定第一业务的业务类型后,可以确定该业务类型对应的业务设置时延,即执行步骤S302。After determining the service type of the first service, the receiving end may determine the service setting delay corresponding to the service type, that is, execute step S302.

S302、接收端确定目标业务类型对应的业务设置时延。S302: The receiving end determines a service setting delay corresponding to the target service type.

本申请实施例中,业务设置时延是指不同业务设置的期望从发送端发送业务的一个数据包至接收端开始处理对应数据包需要花费的时间。In the embodiment of the present application, the service setting delay refers to the time required for different service settings to be set from the time a data packet of a service is sent from the sending end to the time when the receiving end starts to process the corresponding data packet.

业务设置时延包括最小固定值与最大固定值,也就是指,业务根据不同业务类型对应的业务需求在不同网络状况下设置的最小期望时延和最大期望时延。例如,若是通话业务这种对时延较不敏感的业务,那么业务设置时延的最大固定值可以设置大一点,例如100毫秒。若是投屏这种对时延较为敏感的业务,则业务设置时延的最大固定值也需要设置小一些,例如50毫秒。The service setting delay includes a minimum fixed value and a maximum fixed value, that is, the minimum expected delay and maximum expected delay set by the service under different network conditions according to the service requirements corresponding to different service types. For example, if it is a service that is less sensitive to delay, such as a call service, then the maximum fixed value of the service setting delay can be set larger, such as 100 milliseconds. If it is a service that is more sensitive to delay, such as screen projection, the maximum fixed value of the service setting delay also needs to be set smaller, such as 50 milliseconds.

其中,业务设置时延也可以设置为0,例如有的业务可能对时延要求很低,认为不需要设置缓存深度,那么该业务对应的业务设置时延设置的最小固定值与最大固定值可以均设置为0。The service setting delay may also be set to 0. For example, some services may have very low delay requirements and it is considered unnecessary to set the cache depth. In this case, the minimum fixed value and the maximum fixed value of the service setting delay setting corresponding to the service may both be set to 0.

可以理解的是,业务设置时延是数据包从发送端到接收端的传输时延与业务缓存时延之和。接收端在获取到第一业务的业务类型后,只是可以确定业务设置时延的最小固定值和最大固定值,并没有确定业务设置时延的目标值。只有在后续计算出当前传输时延后,才可以进一步确定业务设置时延最终的目标值,进而得到最终的业务缓存时延。It is understandable that the service setup delay is the sum of the transmission delay of the data packet from the sender to the receiver and the service cache delay. After obtaining the service type of the first service, the receiver can only determine the minimum fixed value and the maximum fixed value of the service setup delay, but does not determine the target value of the service setup delay. Only after the current transmission delay is calculated later can the final target value of the service setup delay be further determined, and then the final service cache delay can be obtained.

业务设置时延根据计算出的传输时延动态调整,可以理解的是,传输时延一定程度上可以表示网络状况,传输时延越小,可以表示网络状况越好。也即,业务设置时延的最小固定值是业务在网络状况较好时对应的业务期望时延,最大固定值是业务在网络状态较差时对应的业务期望时延。The service setting delay is dynamically adjusted according to the calculated transmission delay. It can be understood that the transmission delay can represent the network status to a certain extent. The smaller the transmission delay, the better the network status. That is, the minimum fixed value of the service setting delay is the service expected delay corresponding to the service when the network status is good, and the maximum fixed value is the service expected delay corresponding to the service when the network status is poor.

由于业务设置时延的限制,即使网络状况非常好,也就是传输时延很小的情况下,业务可能也需要有一定的缓存时延,因此,在传输时延小于业务设置时延时,则确定业务设置时延为最小固定值。以及,即使网络状况较差,也就是传输时延比较大的情况下,业务也不能无限制的增加缓存时延,因此,在传输时延不小于业务设置时延时,则确定业务设置时延为最大固定值。若是传输时延大于最大固定值,由于最大固定值的限制,那么业务缓存时延即为0。Due to the limitation of service setting delay, even if the network condition is very good, that is, when the transmission delay is very small, the service may still need a certain cache delay. Therefore, when the transmission delay is less than the service setting delay, the service setting delay is determined to be the minimum fixed value. Also, even if the network condition is poor, that is, when the transmission delay is relatively large, the service cannot increase the cache delay indefinitely. Therefore, when the transmission delay is not less than the service setting delay, the service setting delay is determined to be the maximum fixed value. If the transmission delay is greater than the maximum fixed value, due to the limitation of the maximum fixed value, the service cache delay is 0.

例如,若业务设置时延的最小固定值设为30毫秒,业务设置时延的最大固定值设为50毫秒,那么若计算得到的传输时延小于30毫秒时,则此时业务设置时延为30毫秒。若计算得到的传输时延大于或等于30毫秒时,则此时业务设置时延为50毫秒。For example, if the minimum fixed value of the service setting delay is set to 30 milliseconds and the maximum fixed value of the service setting delay is set to 50 milliseconds, then if the calculated transmission delay is less than 30 milliseconds, the service setting delay is 30 milliseconds. If the calculated transmission delay is greater than or equal to 30 milliseconds, the service setting delay is 50 milliseconds.

接收端中可以预先保存有多种业务类型对应的业务设置时延,也即多种业务类型分别对应的最大固定值与最小固定值。The receiving end may pre-store service setting delays corresponding to a plurality of service types, that is, maximum fixed values and minimum fixed values corresponding to the plurality of service types.

本申请实施例中,在接收端响应于用户对第一业务的发起操作后,发送端也就开始向接收端按序发送第一业务的数据包,此时接收端可以实时去获取数据包从发送端到接收端的传输时延。也即,执行步骤S303。In the embodiment of the present application, after the receiving end responds to the user's initiation operation of the first service, the sending end starts to send the data packets of the first service to the receiving end in sequence, and the receiving end can obtain the transmission delay of the data packets from the sending end to the receiving end in real time. That is, step S303 is executed.

S303、接收端获取接收端与发送端当前的第一传输时延。S303: The receiving end obtains a current first transmission delay between the receiving end and the sending end.

本申请实施例中,接收端响应于上述第一业务的发起操作后,发送端与接收端之间会定时交互传输已完成确认(ACK)帧,可以实时、准确的计算出流业务数据帧的实时传输时延。In an embodiment of the present application, after the receiving end responds to the initiation operation of the above-mentioned first service, the sending end and the receiving end will periodically exchange and transmit completed confirmation (ACK) frames, and the real-time transmission delay of the streaming service data frame can be calculated in real time and accurately.

其中,发送端与接收端之间定时交互传输完成确认帧,也就是指,接收端会定时向发送端发送一个信令帧,即传输已完成(TransferDone)帧。发送端在接收到传输已完成帧后,向接收端返回一个传输已完成确认帧。其中,传输已完成帧中携带有接收端延迟确认等待时间D1,即接收端在预设时间段内从接收到第一个数据包到最后一个数据包的等待时间。其中,可以在接收端接收到第一个数据包时打上一个时间戳,即记录此时的时刻1,在接收端发送传输已完成帧时记录此时的时刻2,由此可以计算得到上述接收端延迟确认等待时间D1,即时刻2与时刻1的差值。Among them, the transmission completion confirmation frames are periodically exchanged between the sending end and the receiving end, that is, the receiving end will periodically send a signaling frame to the sending end, that is, the transmission is completed (TransferDone) frame. After receiving the transmission completed frame, the sending end returns a transmission completed confirmation frame to the receiving end. Among them, the transmission completed frame carries the receiving end delayed confirmation waiting time D1, that is, the waiting time from the reception of the first data packet to the last data packet within the preset time period. Among them, a timestamp can be added when the receiving end receives the first data packet, that is, the moment 1 at this time is recorded, and the moment 2 at this time is recorded when the receiving end sends the transmission completed frame. From this, the above-mentioned receiving end delayed confirmation waiting time D1, that is, the difference between moment 2 and moment 1, can be calculated.

发送端在接收到传输已完成帧后,可以计算得到发送端等待时间D2,也就是指发送端从发送第一数据包到接收到传输已完成帧的时间。具体的,在发送端发送第一数据包时打上时间戳,即记录此时的时刻3,在发送端接收到传输完成帧时记录此时的时刻4,可以计算得到上述发送端等待时间D2,即时刻4与时刻3的差值。After receiving the transmission completion frame, the sender can calculate the sender waiting time D2, which is the time from when the sender sends the first data packet to when it receives the transmission completion frame. Specifically, when the sender sends the first data packet, a timestamp is added, that is, time 3 is recorded at this time, and when the sender receives the transmission completion frame, time 4 is recorded at this time, and the sender waiting time D2 can be calculated, that is, the difference between time 4 and time 3.

此时,发送端可以根据发送端等待时间D2减去接收端延迟确认等待时间D1,得到数据包从发送端到接收端的传输时延S1与传输已完成帧从接收端到发送端的传输时延S2之和,设为第一往返时延S3,即S3=S1+S2=D2-D1。At this time, the sending end can subtract the delayed confirmation waiting time D1 of the receiving end from the sending end waiting time D2 to obtain the sum of the transmission delay S1 of the data packet from the sending end to the receiving end and the transmission delay S2 of the transmission completed frame from the receiving end to the sending end, and set it as the first round-trip delay S3, that is, S3=S1+S2=D2-D1.

接收端在接收到传输已完成确认帧后,也记录此时的时刻5。接收端将时刻5与接收端发送传输已完成帧的时刻2相减得到接收端信令帧的往返时延(RTT),设为第二往返时延。由于传输已完成帧与传输已完成确认帧的大小相同,各自的传输时延是相同的,那么接收端可以计算出传输已完成帧的传输时延S2=RTT/2。After receiving the transmission completion confirmation frame, the receiving end also records the time 5 at this time. The receiving end subtracts the time 5 from the time 2 when the receiving end sends the transmission completion frame to obtain the round trip time (RTT) of the receiving end signaling frame, which is set as the second round trip time. Since the transmission completion frame and the transmission completion confirmation frame have the same size and their respective transmission delays are the same, the receiving end can calculate the transmission delay of the transmission completion frame S2 = RTT/2.

其中,发送端在向接收端发送传输已完成确认帧时,在确认帧中可以包含有发送端计算出的数据包的传输时延S1与传输已完成帧的传输时延S2之和,即第一往返时延S3。最后,接收端可以计算出数据包的传输时延S1=D2-D1-S2=D2-D1-RTT/2。When the sender sends a transmission completion confirmation frame to the receiver, the confirmation frame may include the sum of the transmission delay S1 of the data packet calculated by the sender and the transmission delay S2 of the transmission completion frame, that is, the first round trip delay S3. Finally, the receiver can calculate the transmission delay S1 of the data packet = D2-D1-S2 = D2-D1-RTT/2.

在本申请的一些实施例中,发送端在计算出发送端等待时间后,可以在向接收端发送传输已完成确认帧时,在该确认帧中包含上述发送端等待时间D2。在接收端接收到传输已完成确认帧后,根据确认帧中包含的发送端等待时间D2,以及接收端计算出的接收端延迟确认等待时间D1与传输已完成帧的传输时延S2,计算得到数据包从发送端到接收端的传输时延S1。也即,数据包从发送端到接收端的传输时延为发送端等待时间减去接收端延迟确认等待时间,再减去传输已完成帧从接收端到发送端的传输时延S1=D2-D1-S2。In some embodiments of the present application, after calculating the sending end waiting time, the sending end may include the sending end waiting time D2 in the confirmation frame when sending a transmission completion confirmation frame to the receiving end. After the receiving end receives the transmission completion confirmation frame, the transmission delay S1 of the data packet from the sending end to the receiving end is calculated based on the sending end waiting time D2 contained in the confirmation frame, the receiving end delayed confirmation waiting time D1 calculated by the receiving end, and the transmission delay S2 of the transmission completed frame. That is, the transmission delay of the data packet from the sending end to the receiving end is the sending end waiting time minus the receiving end delayed confirmation waiting time, minus the transmission delay S1 of the transmission completed frame from the receiving end to the sending end = D2-D1-S2.

如图5所示,发送端向接收端按序发送数据包,接收端在接收到10个数据包后向发送端发送传输已完成帧。发送端在接收到传输已完成帧后,向接收端返回传输已完成确认帧。从图5中,可以得知发送端等待时间D1,接收端延迟确认等待时间D2,传输已完成帧的传输时延S2,传输已完成确认帧的传输时延S3与数据包传输时延S1之间的关系,即D1=S1+D2+S2,其中,S2=S3。As shown in Figure 5, the sender sends data packets to the receiver in sequence, and the receiver sends a transmission completion frame to the sender after receiving 10 data packets. After receiving the transmission completion frame, the sender returns a transmission completion confirmation frame to the receiver. From Figure 5, we can know the relationship between the sender's waiting time D1, the receiver's delayed confirmation waiting time D2, the transmission delay S2 of the transmission completion frame, the transmission delay S3 of the transmission completion confirmation frame and the data packet transmission delay S1, that is, D1 = S1 + D2 + S2, where S2 = S3.

如图6所示,传输已完成确认帧的帧结构包括帧头,若干传输单元(tansferUnit)和若干传输信息(tansferinfo)。其中,帧头包括类型(type),标志(flag),会话标识(sessionid),传输标识(transID)和长度(length)。传输单元包括类型(type),长度(len)和传输标识(transID)。传输信息包括类型(type),长度(len)和接收端延迟确认等待时间(Waittime)。其中,接收端延迟确认等待时间为未使用字段,因此可以通过此字段携带传输时延。这里的传输时延是指第一往返时延,即传输已完成帧从接收端到发送端的传输时延与数据包从发送端到接收端的传输时延之和。As shown in Figure 6, the frame structure of the transmission completion confirmation frame includes a frame header, several transmission units (transferUnit) and several transmission information (transferinfo). Among them, the frame header includes type (type), flag (flag), session identifier (sessionid), transmission identifier (transID) and length (length). The transmission unit includes type (type), length (len) and transmission identifier (transID). The transmission information includes type (type), length (len) and receiving end delayed confirmation waiting time (Waittime). Among them, the receiving end delayed confirmation waiting time is an unused field, so the transmission delay can be carried through this field. The transmission delay here refers to the first round-trip delay, that is, the sum of the transmission delay of the transmission completed frame from the receiving end to the sending end and the transmission delay of the data packet from the sending end to the receiving end.

本申请实施例中,在接收端响应于用户对第一业务的发起操作后,接收端每隔预设时长向发送端发送传输已完成帧。例如,预设时长可以是200毫秒,在接收端响应于用户对第一业务的发起操作后,接收端每隔200毫秒向发送端发送传输已完成帧。也就是,接收端每隔200毫秒就重新计算一次当前的传输时延,并且计算出的传输时延是第一业务的业务数据包的传输时延。由此,接收端可以实时,准确的探测出第一业务的数据包的当前传输时延。并且,不需要额外增加数据帧去探测传输时延,可以减小功效,节省电量。In an embodiment of the present application, after the receiving end responds to the user's initiation operation on the first service, the receiving end sends a transmission completed frame to the sending end every preset time. For example, the preset time can be 200 milliseconds. After the receiving end responds to the user's initiation operation on the first service, the receiving end sends a transmission completed frame to the sending end every 200 milliseconds. That is, the receiving end recalculates the current transmission delay every 200 milliseconds, and the calculated transmission delay is the transmission delay of the service data packet of the first service. As a result, the receiving end can detect the current transmission delay of the data packet of the first service in real time and accurately. In addition, there is no need to add additional data frames to detect the transmission delay, which can reduce power efficiency and save electricity.

S304、接收端基于第一传输时延的抖动指示值确定抖动缓存时延。S304: The receiving end determines a jitter buffer delay based on the jitter indication value of the first transmission delay.

本申请实施例中,还可以通过计算预设时长内传输时延的平均离差σ反应该预设时长内传输时延的抖动程度。其中,平均离差σ的计算公式如下:In the embodiment of the present application, the jitter degree of the transmission delay within the preset time length can also be reflected by calculating the average deviation σ of the transmission delay within the preset time length. The calculation formula of the average deviation σ is as follows:

其中,n为预设时长内可以计算出的传输时延的次数,是n次传输时延的平均值。每次的传输时延与平均值之差为离差,平均离差σ即为各个离差的绝对值的平均值。本申请实施例中,接收端将计算出的传输时延的平均离差,就确定为传输时延的抖动指示值,也即可以反应传输时延在预设时长内的抖动程度。Where n is the number of transmission delays that can be calculated within the preset time length. is the average value of n transmission delays. The difference between each transmission delay and the average value is the deviation, and the average deviation σ is the average value of the absolute values of each deviation. In the embodiment of the present application, the receiving end determines the average deviation of the calculated transmission delay as the jitter indication value of the transmission delay, which can reflect the jitter degree of the transmission delay within the preset time length.

例如,记录4秒内每一次计算出的传输时延,若每隔200毫秒计算一次传输已完成帧,那么上述n为20。则记录20次计算出的传输时延后,根据每一次的传输时延与20次传输时延的平均值计算得到传输时延的平均离差σ。For example, if the transmission delay calculated each time within 4 seconds is recorded and the transmission completed frame is calculated every 200 milliseconds, then the above n is 20. After recording the transmission delay calculated 20 times, the average deviation σ of the transmission delay is calculated based on each transmission delay and the average value of the 20 transmission delays.

通过定时计算传输时延,进而计算得到传输时延的平均离差σ,可以及时感知网络抖动程度。其中,平均离差越大,则表示网络抖动越强;平均离差越小,则表示网络抖动越弱。By calculating the transmission delay regularly and then calculating the average deviation σ of the transmission delay, the degree of network jitter can be perceived in time. The larger the average deviation, the stronger the network jitter; the smaller the average deviation, the weaker the network jitter.

本申请实施例中,并不限制只能将传输时延的平均离差确定为传输时延的抖动指示值,只需要可以较为准确的反应传输时延的抖动程度即可。在一些实施例中,也可以是通过计算出的传输时延的平均值的标准差来确定为传输时延的抖动指示值。In the embodiment of the present application, it is not limited to determine the average deviation of the transmission delay as the jitter indication value of the transmission delay, as long as it can more accurately reflect the jitter degree of the transmission delay. In some embodiments, the jitter indication value of the transmission delay can also be determined by the standard deviation of the calculated average value of the transmission delay.

本申请实施例中,业务还可以感知接收端设备和发送端设备的频点信息,也就是频段特征信息。频段特征信息用于指示接收端与发送端的频点与信道的关系,包括同频同信道,异频同信道与异频异信道。抖动系数可以根据感知到的双端频段特征信息进行调整。例如,当发送端与接收端同频同信道时,抖动系数p1可以为0;当发送端与接收端同频异信道时,抖动系数p2可以为3;当发送端与接收端异频异信道时,抖动系数p3可以为6。其中,抖动系数p1,p2和p3也可以进行调整,但是要保证p1<p2<p3。In an embodiment of the present application, the service can also perceive the frequency information of the receiving device and the transmitting device, that is, the frequency band characteristic information. The frequency band characteristic information is used to indicate the relationship between the frequency and channel of the receiving end and the transmitting end, including the same frequency and the same channel, different frequencies and the same channel, and different frequencies and different channels. The jitter coefficient can be adjusted according to the perceived dual-end frequency band characteristic information. For example, when the transmitting end and the receiving end have the same frequency and the same channel, the jitter coefficient p1 can be 0; when the transmitting end and the receiving end have the same frequency and different channels, the jitter coefficient p2 can be 3; when the transmitting end and the receiving end have different frequencies and different channels, the jitter coefficient p3 can be 6. Among them, the jitter coefficients p1, p2 and p3 can also be adjusted, but it is necessary to ensure that p1<p2<p3.

可以理解的是,同频异信道由于天线分时发送本身就会存在类似网络抖动的情况,相比同频同信道来说,抖动系数就会大一点。那么,异频异信道则相比同频异信道来说,抖动系数就会更大。It is understandable that the same frequency and different channels will have similar network jitter due to the time-sharing transmission of the antenna. Compared with the same frequency and the same channel, the jitter coefficient will be larger. Then, the jitter coefficient of different frequencies and different channels will be larger than that of the same frequency and different channels.

在获取到网络抖动程度和抖动系数后,可以通过抖动系数和抖动程度共同决定抖动缓存深度,也就是抖动缓存时延T3。其中,抖动缓存时延T3=抖动系数p*抖动程度σ(平均离差)。After obtaining the network jitter degree and jitter coefficient, the jitter buffer depth, that is, the jitter buffer delay T3, can be determined by the jitter coefficient and the jitter degree. Wherein, the jitter buffer delay T3 = jitter coefficient p* jitter degree σ (average deviation).

本申请实施例中,若是计算出的抖动缓存深度T3小于发包间隔S,则可以不引入抖动缓存。可以理解的是,若是计算出的抖动缓存深度T3小于发包间隔S,则可以认为此时网络状况比较好,网络抖动较弱,可以不引入抖动缓存。由此,在网络状态好的时候,并不会引入抖动缓存,从而不会造成性能浪费。接收端可以只根据业务需求,也就是业务设置时延确定业务缓存时延,进一步调整缓存队列的长度。In the embodiment of the present application, if the calculated jitter buffer depth T3 is less than the packet interval S, the jitter buffer may not be introduced. It is understandable that if the calculated jitter buffer depth T3 is less than the packet interval S, it can be considered that the network condition is relatively good at this time, the network jitter is relatively weak, and the jitter buffer may not be introduced. Therefore, when the network condition is good, the jitter buffer will not be introduced, thereby not causing performance waste. The receiving end can determine the service cache delay only according to the service demand, that is, the service setting delay, and further adjust the length of the cache queue.

其中,业务也为抖动缓存时延设置了最大值限制,即业务在网络抖动情况下设置了最大抖动缓存时延,不同业务类型对应的抖动缓存时延可以不相同。The service also sets a maximum value limit for the jitter buffer delay, that is, the service sets a maximum jitter buffer delay under network jitter, and the jitter buffer delays corresponding to different service types may be different.

本申请实施例中,可以将业务设置时延对应的最小固定值,最大固定值以及上述最大抖动缓存时延作为业务对应的时延信息。接收端中可以预先保存有多种业务类型的时延信息。In the embodiment of the present application, the minimum fixed value, the maximum fixed value and the above-mentioned maximum jitter buffer delay corresponding to the service setting delay can be used as the delay information corresponding to the service. The receiving end can pre-store delay information of multiple service types.

接收端可以采用表格方式保存上述多种业务类型的时延信息。如表1所示:The receiving end can save the delay information of the above-mentioned multiple service types in a table format. As shown in Table 1:

表1Table 1

接收端在获取到第一业务的业务类型后,可以从预先保存的第一业务的业务类型的时延信息中,查询第一业务对应的业务设置时延的最小固定值和最大固定值,以及最大抖动缓存深度。After acquiring the service type of the first service, the receiving end can query the minimum fixed value and the maximum fixed value of the service setting delay corresponding to the first service, and the maximum jitter buffer depth from the pre-stored delay information of the service type of the first service.

应注意,接收端在获取到第一业务的业务类型后,只是可以确定业务类型对应的参数信息,包括业务设置时延的最小固定值和最大固定值,以及最大抖动缓存深度。只有计算出数据包的传输时延后,才可以进一步确定业务设置时延的目标值,以及根据传输时延确定抖动指示值与抖动缓存时延。It should be noted that after obtaining the service type of the first service, the receiving end can only determine the parameter information corresponding to the service type, including the minimum fixed value and the maximum fixed value of the service setting delay, and the maximum jitter buffer depth. Only after calculating the transmission delay of the data packet can the target value of the service setting delay be further determined, and the jitter indication value and the jitter buffer delay can be determined according to the transmission delay.

接收端在获取到业务设置时延的最小固定值和最大固定值,传输时延,抖动缓存时延后,就可以去对缓存队列的长度进行调整,即执行步骤S305。After obtaining the minimum fixed value and the maximum fixed value of the service setting delay, the transmission delay, and the jitter buffer delay, the receiving end can adjust the length of the buffer queue, that is, execute step S305.

S305、接收端基于业务设置时延、第一传输时延、抖动缓存时延和发送端发送数据包的发包间隔,调整缓存队列的长度K。S305: The receiving end adjusts the length K of the cache queue based on the service setting delay, the first transmission delay, the jitter cache delay, and the packet sending interval of the data packet sent by the sending end.

本申请实施例中,在计算出当前的传输时延(第一传输时延)后,可以确定最终的业务设置时延,然后进一步计算出业务缓存时延。业务缓存时延等于业务设置时延减去第一传输时延。In the embodiment of the present application, after calculating the current transmission delay (first transmission delay), the final service setting delay can be determined, and then the service buffering delay can be further calculated. The service buffering delay is equal to the service setting delay minus the first transmission delay.

在计算出业务缓存时延和抖动缓存时延之后,则可以得到目标缓存时延。这里得到的目标缓存时延,就是最终的首包缓存时延,也即第一个数据包从接收端到缓存队列中被递交的时间。其中,首包缓存时延Tc为缓存队列的长度K与发包间隔S的乘积,即Tc=K×S。After calculating the service cache delay and jitter cache delay, the target cache delay can be obtained. The target cache delay obtained here is the final first packet cache delay, that is, the time it takes for the first data packet to be delivered from the receiving end to the cache queue. Among them, the first packet cache delay Tc is the product of the length of the cache queue K and the packet sending interval S, that is, Tc = K×S.

其中,设业务设置时延为T1、第一传输时延为T2(也即上述S1)、抖动缓存时延为T3。也就是如下等式成立:Tc=T1-T2+T3=K×S。由此,计算可知,缓存队列的长度K=(T1-T2+T3)/S。缓存队列的长度K即表示缓存队列中期望缓存K个数据包。Here, let the service setting delay be T1, the first transmission delay be T2 (i.e., S1 above), and the jitter buffer delay be T3. That is, the following equation holds true: Tc = T1-T2+T3 = K×S. Thus, it can be calculated that the length of the buffer queue K = (T1-T2+T3)/S. The length of the buffer queue K means that K data packets are expected to be buffered in the buffer queue.

在本申请实施例中,在第一业务刚发起时,接收端还未计算出传输时延,此时,可以认为传输时延为0,传输时延的抖动指示值也为0,也即抖动缓存时延为0。根据传输时延与业务设置时延的关系,可以确定此时业务设置时延为最小固定值。那么可知,缓存队列的长度K0=T1/S。即为,在第一业务刚发起时,对应的缓存队列的初始长度。In the embodiment of the present application, when the first service is just initiated, the receiving end has not yet calculated the transmission delay. At this time, the transmission delay can be considered to be 0, and the jitter indication value of the transmission delay is also 0, that is, the jitter buffer delay is 0. According to the relationship between the transmission delay and the service setting delay, it can be determined that the service setting delay is the minimum fixed value at this time. Then it can be known that the length of the cache queue K 0 =T1/S. That is, when the first service is just initiated, the initial length of the corresponding cache queue.

然后,在接收端计算出传输时延后,根据实时的传输时延调整业务设置时延,以及确定抖动缓存时延,重新对缓存队列进行调整。Then, after the transmission delay is calculated at the receiving end, the service setting delay is adjusted according to the real-time transmission delay, and the jitter buffer delay is determined, and the buffer queue is readjusted.

请参阅图7,图7为本申请实施例提供的一种确定期望缓存队列的示意图。接收端在第一业务发起后,定时向发送端发送传输已完成帧,以及接收发送端的传输已完成确认帧,从而实时计算出第一业务的数据包的传输时延。如图7所示,接收端在接收到第二个数据包时向发送端发送传输已完成帧,也即接收端在第一业务发起的时刻到接收到第二个数据包的时刻之间的时长为接收端设置的发送传输已完成帧的预设时长。Please refer to Figure 7, which is a schematic diagram of determining an expected cache queue provided by an embodiment of the present application. After the first service is initiated, the receiving end periodically sends a transmission completed frame to the sending end, and receives a transmission completed confirmation frame from the sending end, thereby calculating the transmission delay of the data packet of the first service in real time. As shown in Figure 7, the receiving end sends a transmission completed frame to the sending end when the second data packet is received, that is, the duration between the time when the first service is initiated and the time when the second data packet is received is the preset duration for sending the transmission completed frame set by the receiving end.

图7中,首包缓存时延为业务缓存时延和抖动缓存时延之和,业务缓存时延的确定值根据第一业务的业务类型对应的业务设置时延与计算出来的传输时延确定,抖动缓存时延根据计算出来的传输时延的抖动程度和频段特征信息计算出来。由此,根据首包缓存时延来调整缓存队列的长度,也即根据网络抖动程度和业务设置时延来调整缓存队列的长度。In Figure 7, the first packet cache delay is the sum of the service cache delay and the jitter cache delay. The determined value of the service cache delay is determined according to the service setting delay corresponding to the service type of the first service and the calculated transmission delay. The jitter cache delay is calculated according to the jitter degree of the calculated transmission delay and the frequency band characteristic information. Therefore, the length of the cache queue is adjusted according to the first packet cache delay, that is, the length of the cache queue is adjusted according to the network jitter degree and the service setting delay.

其中,发送端发送数据包的发包间隔可以是指发送端发送各个数据包的各个发包间隔的平均值。如图7所示,发包间隔S可以是S1和S2的平均值。The packet transmission interval of the data packet sent by the transmitting end may refer to the average value of each packet transmission interval of each data packet sent by the transmitting end. As shown in FIG7 , the packet transmission interval S may be the average value of S1 and S2.

本申请实施例中,可以在业务一开始时,就调整缓存队列的长度,而不是基于固定的缓存队列长度,因此可以达到较佳的抗时延抖动效果。In the embodiment of the present application, the length of the cache queue can be adjusted at the beginning of the service, rather than being based on a fixed cache queue length, so that a better anti-delay jitter effect can be achieved.

在S305之后,接收端中缓存队列的长度已基于业务设置时延、第一传输时延、抖动缓存时延完成调整。但是,当前缓存队列中缓存的数据包的实际数量并不一定与缓存队列中能够缓存的数据包的数量相同。After S305, the length of the buffer queue in the receiving end has been adjusted based on the service setting delay, the first transmission delay, and the jitter buffer delay. However, the actual number of packets buffered in the current buffer queue is not necessarily the same as the number of packets that can be buffered in the buffer queue.

如图8所示,在实际场景中,当前缓存队列可能包括如下状态。状态1:在网络状态良好的情况下,接收端均匀收包。此时,缓存队列的长度k=K。状态2:在网络抖动的情况下,接收端未收包。此时,缓存队列的长度k<K。状态3:在网络抖动的情况下,接收端短时间内大量收包。此时,缓存队列的长度k>K。状态4:缓存队列的长度k=0。状态5:缓存队列的长度k=最大值。As shown in FIG8 , in an actual scenario, the current cache queue may include the following states. State 1: When the network is in good condition, the receiving end receives packets evenly. At this time, the length of the cache queue k=K. State 2: When the network is jittery, the receiving end does not receive packets. At this time, the length of the cache queue k<K. State 3: When the network is jittery, the receiving end receives a large number of packets in a short period of time. At this time, the length of the cache queue k>K. State 4: The length of the cache queue k=0. State 5: The length of the cache queue k=maximum value.

基于此,接收端还可以按照实际数量与缓存队列的目标长度调整数据包的处理策略,以保证接收端可以在时延抖动时保持处理数据包的速度。Based on this, the receiving end can also adjust the data packet processing strategy according to the actual number and the target length of the cache queue to ensure that the receiving end can maintain the speed of processing data packets when the delay jitter occurs.

具体的,在调整缓存队列的长度之后,本申请实施例的方法还可以包括S306。Specifically, after adjusting the length of the cache queue, the method of the embodiment of the present application may further include S306.

S306、接收端获取缓存队列中当前缓存的数据包的实际数量k,基于实际数量k与缓存队列的长度K,调整缓存队列中已缓存的数据包的处理策略,直至缓存队列中缓存有K个数据包后按照发包间隔处理缓存队列中缓存的数据包。S306. The receiving end obtains the actual number k of data packets currently cached in the cache queue, and adjusts the processing strategy of the data packets cached in the cache queue based on the actual number k and the length K of the cache queue, until there are K data packets cached in the cache queue, and then processes the data packets cached in the cache queue according to the packet sending interval.

本申请实施例中,接收端中存储有不同的数据包处理策略,根据当前缓存的数据包的实际数量k与待调整的缓存队列的长度K来确定。In the embodiment of the present application, different data packet processing strategies are stored in the receiving end, which are determined according to the actual number k of data packets currently cached and the length K of the cache queue to be adjusted.

S306a、若实际数量k小于缓存队列的长度K,则接收端按照发包间隔处理缓存队列中缓存的数据包,并记录缓存队列中丢失的数据包,对丢失的数据包进行重传。S306a, if the actual number k is less than the length K of the cache queue, the receiving end processes the data packets cached in the cache queue according to the packet sending interval, records the data packets lost in the cache queue, and retransmits the lost data packets.

S306b、若实际数量k大于缓存队列的长度K,则接收端按照目标间隔处理缓存队列中缓存的数据包或者对缓存队列中的数据包进行丢包处理;其中,目标间隔小于发包间隔。S306b, if the actual number k is greater than the length K of the cache queue, the receiving end processes the data packets cached in the cache queue according to the target interval or performs packet loss processing on the data packets in the cache queue; wherein the target interval is smaller than the packet sending interval.

S306c、若实际数量k为0,则接收端在缓存队列缓存一个数据包后,立即处理对应的数据包。S306c: If the actual number k is 0, the receiving end immediately processes the corresponding data packet after caching a data packet in the cache queue.

其中,在预设时长内,若接收端的缓存队列接收到一个数据包就立即递交。若在预设时长内未接收到数据包,则可以重新启动缓存。If a data packet is received by the cache queue of the receiving end within a preset time period, the data packet is immediately delivered. If no data packet is received within the preset time period, the cache can be restarted.

请参阅图9,图9为本申请实施例提供的一种缓存队列异常状态快速恢复的示意图。如图9所示,对于状态1,若是缓存队列中数据包的实际数量k等于K,此时接收端仍然均匀递包。对于状态2,即对应上述步骤S306a,在此不作赘述。对于状态3,即对应上述步骤S306b,在此不作赘述。对于状态3,即对应上述步骤S306c,在此不作赘述。Please refer to Figure 9, which is a schematic diagram of a fast recovery of a cache queue abnormal state provided by an embodiment of the present application. As shown in Figure 9, for state 1, if the actual number k of data packets in the cache queue is equal to K, the receiving end still delivers packets evenly at this time. For state 2, that is, corresponding to the above-mentioned step S306a, it will not be repeated here. For state 3, that is, corresponding to the above-mentioned step S306b, it will not be repeated here. For state 3, that is, corresponding to the above-mentioned step S306c, it will not be repeated here.

对于状态4,接收端长时间收不到包,缓存队列中数据包的实际数量k等于0时,可以设置一个预设时长,例如10秒,8秒等。以预设时长为10秒为例,在10秒内,若接收端的缓存队列接收到一个数据包就立即递交。若在10秒内未接收到数据包,则可以重新启动缓存。For state 4, the receiving end cannot receive packets for a long time, and the actual number of packets in the cache queue k is equal to 0, a preset time length can be set, such as 10 seconds, 8 seconds, etc. Taking the preset time length of 10 seconds as an example, within 10 seconds, if the cache queue of the receiving end receives a packet, it will be delivered immediately. If no packet is received within 10 seconds, the cache can be restarted.

对于状态5,接收端长时间大量收包,缓存队列中数据包的实际数量k达到缓存队列可容纳数据包数量的最大值时,若接收端接收到衣蛾数据包就立即递交。For state 5, the receiving end receives a large number of packets for a long time. When the actual number k of packets in the cache queue reaches the maximum number of packets that the cache queue can accommodate, if the receiving end receives a clothes moth packet, it will submit it immediately.

由此,基于上述数据包的处理策略,以使缓存队列快速恢复到正常状态,保证接收端可以在时延抖动时保持处理数据包的速度。Therefore, based on the above data packet processing strategy, the cache queue is quickly restored to a normal state, ensuring that the receiving end can maintain the speed of processing data packets when the delay jitters.

举例来说,请参阅图10,图10为本申请实施例提供的一种缓存队列数据包调整策略的示意图。如图10所示,若缓存队列中当前缓存的数据包的实际数量k小于缓存队列的长度K,按照发包间隔处理缓存队列中缓存的数据包,并记录缓存队列中丢失的数据包,对丢失的数据包进行重传(即执行S306a)。For example, please refer to Figure 10, which is a schematic diagram of a cache queue packet adjustment strategy provided by an embodiment of the present application. As shown in Figure 10, if the actual number k of packets currently cached in the cache queue is less than the length K of the cache queue, the packets cached in the cache queue are processed according to the packet sending interval, and the lost packets in the cache queue are recorded, and the lost packets are retransmitted (i.e., S306a is executed).

其中,接收端将丢失的数据包发送到重传队列中,但不是所有重传队列中的数据包都需要进行重传。若重传队列中重传的数据包的序号小于当前处理的数据包的序号,则不再重传对应的数据包,以避免资源浪费。若重传队列中重传的数据包的序号大于当前处理的数据包的序号,则重传对应的数据包。The receiving end sends the lost data packets to the retransmission queue, but not all data packets in the retransmission queue need to be retransmitted. If the sequence number of the retransmitted data packet in the retransmission queue is smaller than the sequence number of the currently processed data packet, the corresponding data packet will not be retransmitted to avoid resource waste. If the sequence number of the retransmitted data packet in the retransmission queue is larger than the sequence number of the currently processed data packet, the corresponding data packet will be retransmitted.

例如,若缓存队列的长度K为6,当前缓存的数据包的实际数量k为4,当前缓存的数据包为数据包1,数据包3,数据包5和数据包6,则记录缓存队列中丢失的数据包为数据包2和数据包4。将数据包2和数据包4发送到重传队列中,若当前处理的数据包的序号为3,那么对数据包2不再进行重传,只对数据包4进行重传。For example, if the length K of the cache queue is 6, the actual number k of currently cached packets is 4, and the currently cached packets are packet 1, packet 3, packet 5, and packet 6, then the lost packets in the cache queue are recorded as packet 2 and packet 4. Packet 2 and packet 4 are sent to the retransmission queue. If the sequence number of the currently processed packet is 3, packet 2 is no longer retransmitted, and only packet 4 is retransmitted.

如图10所示,若缓存队列中当前缓存的数据包的实际数量k大于缓存队列的长度K,则接收端按照目标间隔处理缓存队列中缓存的数据包或者对缓存队列中的数据包进行丢包处理(即执行S306b)。其中,目标间隔小于发包间隔,也即加速递交缓存队列中的数据包,直到当前缓存的数据包的实际数量k等于缓存队列的长度K。As shown in FIG10 , if the actual number k of packets currently cached in the cache queue is greater than the length K of the cache queue, the receiving end processes the packets cached in the cache queue according to the target interval or performs packet loss processing on the packets in the cache queue (i.e., executing S306b). The target interval is less than the packet sending interval, that is, the packets in the cache queue are delivered faster until the actual number k of packets currently cached is equal to the length K of the cache queue.

例如,若缓存队列的长度K为6,当前缓存的数据包的实际数量k为8,若当前的发包间隔为4ms,那么可以设处理数据包的目标间隔为3ms。或者,对当前缓存的数据包中的两个数据包进行丢包处理,以使当前缓存的数据包的实际数量k等于缓存队列的长度K。For example, if the length K of the cache queue is 6, the actual number k of the currently cached data packets is 8, and if the current packet sending interval is 4ms, then the target interval for processing data packets can be set to 3ms. Alternatively, two data packets in the currently cached data packets are dropped so that the actual number k of the currently cached data packets is equal to the length K of the cache queue.

如图10所示,若缓存队列中当前缓存的数据包的实际数量k为0,则接收端在缓存队列缓存一个数据包后,立即处理对应的数据包(即执行S306c)。也就是说,缓存队列中先前缓存的数据包已经被处理完,此时,则只要缓存队列中新加入一个数据包后,接收端就立即处理对应的数据包。As shown in FIG10 , if the actual number k of packets currently buffered in the buffer queue is 0, the receiving end immediately processes the corresponding packet after buffering a packet in the buffer queue (i.e., executing S306c). In other words, the packets previously buffered in the buffer queue have been processed. At this time, as long as a new packet is added to the buffer queue, the receiving end immediately processes the corresponding packet.

综上所述,本申请实施例提供的缓存队列调整方法可以根据数据包的传输时延探测具体的网络抖动程度,并根据网络抖动程度与业务设置动态调整缓存队列长度,从而通过缓存队列长度确定缓存队列中处理数据包的策略,可以较好的抵抗网络抖动带来的业务体验不佳问题。To sum up, the cache queue adjustment method provided in the embodiment of the present application can detect the specific degree of network jitter according to the transmission delay of the data packet, and dynamically adjust the cache queue length according to the network jitter degree and service settings, so as to determine the strategy for processing data packets in the cache queue through the cache queue length, which can better resist the problem of poor service experience caused by network jitter.

本申请实施例还提供一种芯片系统,如图11所示,该芯片系统1100包括至少一个处理器1101和至少一个接口电路1102。处理器1101和接口电路1102可通过线路互联。例如,接口电路1102可用于从其它装置(例如电子设备的存储器)接收信号。又例如,接口电路1102可用于向其它装置(例如处理器1101)发送信号。示例性的,接口电路1102可读取存储器中存储的指令,并将该指令发送给处理器1101。当所述指令被处理器1101执行时,可使得电子设备执行上述实施例中的各个步骤。当然,该芯片系统还可以包含其他分立器件,本申请实施例对此不作具体限定。The embodiment of the present application also provides a chip system, as shown in Figure 11, the chip system 1100 includes at least one processor 1101 and at least one interface circuit 1102. The processor 1101 and the interface circuit 1102 can be interconnected through lines. For example, the interface circuit 1102 can be used to receive signals from other devices (such as a memory of an electronic device). For another example, the interface circuit 1102 can be used to send signals to other devices (such as processor 1101). Exemplarily, the interface circuit 1102 can read instructions stored in the memory and send the instructions to the processor 1101. When the instruction is executed by the processor 1101, the electronic device can perform the various steps in the above embodiments. Of course, the chip system can also include other discrete devices, which is not specifically limited in the embodiment of the present application.

本申请实施例还提供一种计算机存储介质,该计算机存储介质包括计算机指令,当所述计算机指令在上述电子设备上运行时,使得该电子设备执行上述方法实施例中手机执行的各个功能或者步骤。An embodiment of the present application also provides a computer storage medium, which includes computer instructions. When the computer instructions are executed on the above-mentioned electronic device, the electronic device executes each function or step executed by the mobile phone in the above-mentioned method embodiment.

本申请实施例还提供一种计算机程序产品,当所述计算机程序产品在计算机上运行时,使得所述计算机执行上述方法实施例中手机执行的各个功能或者步骤。The embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute each function or step executed by the mobile phone in the above method embodiment.

通过以上实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read on ly memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

以上内容,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (12)

1.一种缓存队列调整方法,其特征在于,应用于接收端,所述接收端与发送端建立了无线连接,所述接收端用于接收并缓存来自所述发送端的第一业务的数据包后处理所述数据包,以执行所述第一业务,所述方法包括:1. A buffer queue adjustment method, characterized in that it is applied to the receiving end, the receiving end has established a wireless connection with the sending end, and the receiving end is used to receive and cache the data packet of the first service from the sending end. Post-processing the data packet to perform the first service, the method includes: 响应于所述第一业务的发起操作,获取所述第一业务的目标业务类型,并确定所述目标业务类型对应的业务设置时延;其中,所述业务设置时延是针对所述第一业务设置的从所述发送端发送所述第一业务的一个数据包至所述接收端开始处理对应数据包需要花费的时间;In response to the initiating operation of the first service, obtain the target service type of the first service, and determine the service setting delay corresponding to the target service type; wherein the service setting delay is for the first service The time required by the service setting from the sending end to send a data packet of the first service to the receiving end to start processing the corresponding data packet; 获取所述接收端与所述发送端当前的第一传输时延;其中,所述第一传输时延用于指示从所述发送端发送所述第一业务的一个数据包至所述接收端接收到对应数据包需要花费的时间;Obtain the current first transmission delay between the receiving end and the sending end; wherein the first transmission delay is used to indicate that a data packet of the first service is sent from the sending end to the receiving end. The time it takes to receive the corresponding data packet; 基于所述第一传输时延的抖动指示值确定抖动缓存时延;其中,所述抖动指示值用于指示所述第一传输时延的抖动程度,所述抖动缓存时延用于指示所述抖动程度下从所述发送端发送所述一个数据包至所述接收端接收到对应数据包抵抗抖动需要缓存的时间;The jitter buffer delay is determined based on the jitter indication value of the first transmission delay; wherein the jitter indication value is used to indicate the jitter degree of the first transmission delay, and the jitter buffer delay is used to indicate the jitter degree of the first transmission delay. Under the degree of jitter, the time from the sending end to sending the one data packet to the receiving end receiving the corresponding data packet that needs to be buffered to resist jitter; 基于所述业务设置时延、所述第一传输时延、所述抖动缓存时延和所述发送端发送数据包的发包间隔,调整缓存队列的长度K;其中,所述缓存队列用于缓存所述第一业务的数据包,所述缓存队列的长度K等于所述缓存队列中能够缓存的数据包的数量。Based on the service setting delay, the first transmission delay, the jitter buffer delay and the sending interval of data packets sent by the sending end, adjust the length K of the buffer queue; wherein, the buffer queue is used for buffering For the data packets of the first service, the length K of the cache queue is equal to the number of data packets that can be cached in the cache queue. 2.根据权利要求1所述的缓存队列调整方法,其特征在于,所述获取所述接收端与所述发送端当前的第一传输时延,包括:2. The cache queue adjustment method according to claim 1, wherein said obtaining the current first transmission delay between the receiving end and the sending end includes: 响应于所述第一业务的发起操作后,每隔第一预设时长向所述发送端发送传输帧;其中,所述传输帧中包括所述接收端在所述第一预设时长内接收到所述第一业务的第一个数据包的接收时间到所述传输帧的发送时间之间的第一等待时间;After responding to the initiating operation of the first service, a transmission frame is sent to the sending end every first preset time length; wherein the transmission frame includes the information received by the receiving end within the first preset time length. a first waiting time between the reception time of the first data packet of the first service and the sending time of the transmission frame; 接收来自所述发送端的传输确认帧;其中,所述传输确认帧中包括第一往返时延,所述第一往返时延是所述发送端的第二等待时间与所述第一等待时间的差值,所述第一往返时延为所述第一传输时延与所述传输帧的第二传输时延之和,所述第二等待时间为所述发送端发送所述第一个数据包的发送时间到接收到来自所述接收端的所述传输帧的接收时间之间的时间;Receive a transmission confirmation frame from the sending end; wherein the transmission confirmation frame includes a first round-trip delay, and the first round-trip delay is the difference between the second waiting time of the sending end and the first waiting time. value, the first round-trip delay is the sum of the first transmission delay and the second transmission delay of the transmission frame, and the second waiting time is when the sending end sends the first data packet The time between the sending time and the receiving time of receiving the transmission frame from the receiving end; 基于所述传输帧的发送时间和所述传输确认帧的接收时间,计算第二往返时延,得到所述传输帧的第二传输时延;其中,所述传输帧的发送时间和所述传输确认帧的接收时间相同;Based on the sending time of the transmission frame and the receiving time of the transmission confirmation frame, calculate the second round-trip delay to obtain the second transmission delay of the transmission frame; wherein, the sending time of the transmission frame and the transmission The acknowledgment frames are received at the same time; 计算所述第一往返时延与所述传输帧的第二传输时延的差值,得到所述第一传输时延。The difference between the first round-trip delay and the second transmission delay of the transmission frame is calculated to obtain the first transmission delay. 3.根据权利要求1或2中所述的缓存队列调整方法,其特征在于,所述业务设置时延包括最小固定值与最大固定值,所述方法包括:3. The cache queue adjustment method according to claim 1 or 2, wherein the service setting delay includes a minimum fixed value and a maximum fixed value, and the method includes: 若所述第一传输时延小于所述最小固定值,则所述业务设置时延为所述最小固定值;If the first transmission delay is less than the minimum fixed value, then the service setting delay is the minimum fixed value; 若所述第一传输时延大于或等于所述最小固定值,则所述业务设置时延为所述最大固定值。If the first transmission delay is greater than or equal to the minimum fixed value, the service setting delay is the maximum fixed value. 4.根据权利要求1-3中任一项所述的缓存队列调整方法,其特征在于,在所述基于所述第一传输时延的抖动指示值确定抖动缓存时延之前,还包括:4. The cache queue adjustment method according to any one of claims 1-3, characterized in that, before determining the jitter cache delay based on the jitter indication value of the first transmission delay, it further includes: 基于第二预设时长内所述第一传输时延的平均离差值确定抖动指示值;Determine the jitter indication value based on the average dispersion value of the first transmission delay within the second preset time period; 其中,所述基于所述第一传输时延的抖动指示值确定抖动缓存时延,包括:Wherein, determining the jitter cache delay based on the jitter indication value of the first transmission delay includes: 获取所述接收端与所述发送端的频段特征信息,基于所述频段特征信息确定抖动系数;其中,所述频段特征信息用于指示所述接收端与所述发送端的频点与信道的关系;Obtain the frequency band characteristic information of the receiving end and the transmitting end, and determine the jitter coefficient based on the frequency band characteristic information; wherein the frequency band characteristic information is used to indicate the relationship between the frequency points and channels of the receiving end and the transmitting end; 基于所述抖动指示值与所述抖动系数的乘积确定所述抖动缓存时延。The jitter cache delay is determined based on a product of the jitter indication value and the jitter coefficient. 5.根据权利要求4中所述的缓存队列调整方法,其特征在于,所述方法还包括:5. The cache queue adjustment method according to claim 4, characterized in that the method further includes: 若所述抖动缓存时延小于所述发包间隔,则所述抖动缓存时延调整为0。If the jitter buffer delay is less than the packet sending interval, the jitter buffer delay is adjusted to 0. 6.根据权利要求4或5中所述的缓存队列调整方法,其特征在于,所述目标业务类型还设置有对应的抖动缓存时延阈值,所述方法包括:6. The cache queue adjustment method according to claim 4 or 5, characterized in that the target service type is also set with a corresponding jitter cache delay threshold, and the method includes: 若所述抖动缓存时延大于所述抖动缓存时延阈值,则所述抖动缓存时延为所述抖动缓存时延阈值。If the jitter cache delay is greater than the jitter cache delay threshold, the jitter cache delay is the jitter cache delay threshold. 7.根据权利要求1-6中任一项所述的缓存队列调整方法,其特征在于,所述基于所述业务设置时延、所述第一传输时延、所述抖动缓存时延和所述发送端发送数据包的发包间隔,调整缓存队列的长度K,包括:7. The cache queue adjustment method according to any one of claims 1 to 6, characterized in that the setting delay based on the service, the first transmission delay, the jitter cache delay and the Describe the sending interval of data packets sent by the sender, and adjust the length K of the cache queue, including: 基于所述业务设置时延T1、所述第一传输时延T2、所述抖动缓存时延T3和所述发送端发送数据包的发包间隔S,采用以下公式:Based on the service setting delay T1, the first transmission delay T2, the jitter buffer delay T3 and the packet sending interval S for sending data packets by the sending end, the following formula is used: K=(T1-T2+T3)/SK=(T1-T2+T3)/S 计算所述缓存队列的长度K。Calculate the length K of the cache queue. 8.根据权利要求1-7中任一项所述的缓存队列调整方法,其特征在于,在所述基于所述业务设置时延、所述第一传输时延、所述抖动缓存时延和所述发送端发送数据包的发包间隔,调整缓存队列的长度K之后,所述方法还包括:8. The cache queue adjustment method according to any one of claims 1 to 7, characterized in that, in the setting delay based on the service, the first transmission delay, the jitter cache delay and After adjusting the packet sending interval of data packets sent by the sending end and adjusting the length K of the cache queue, the method further includes: 获取所述缓存队列中当前缓存的数据包的实际数量k,基于所述实际数量k与缓存队列的长度K,调整所述缓存队列中已缓存的数据包的处理策略,直至所述缓存队列中缓存有K个数据包后按照所述发包间隔处理所述缓存队列中缓存的数据包。Obtain the actual number k of data packets currently cached in the cache queue, and based on the actual number k and the length K of the cache queue, adjust the processing strategy of the cached data packets in the cache queue until After K data packets are cached, the data packets cached in the cache queue are processed according to the packet sending interval. 9.根据权利要求8所述的缓存队列调整方法,其特征在于,所述基于所述实际数量k与缓存队列的长度K,调整所述缓存队列中已缓存的数据包的处理策略,包括:9. The cache queue adjustment method according to claim 8, characterized in that, based on the actual number k and the length K of the cache queue, adjusting the processing strategy of the cached data packets in the cache queue includes: 若所述实际数量k小于所述缓存队列的长度K,按照所述发包间隔处理所述缓存队列中缓存的数据包,并记录所述缓存队列中丢失的数据包,对所述丢失的数据包进行重传;If the actual number k is less than the length K of the cache queue, the data packets cached in the cache queue are processed according to the packet sending interval, and the lost data packets in the cache queue are recorded, and the lost data packets are recorded. perform retransmission; 若所述实际数量k大于所述缓存队列的长度K,按照目标间隔处理所述缓存队列中缓存的数据包或者对所述缓存队列中的数据包进行丢包处理;其中,所述目标间隔小于所述发包间隔;If the actual number k is greater than the length K of the cache queue, the data packets cached in the cache queue are processed according to the target interval or the data packets in the cache queue are discarded; wherein the target interval is less than The said packet sending interval; 若所述实际数量k为0,则在所述缓存队列缓存一个数据包后,立即处理对应的数据包。If the actual number k is 0, after the cache queue caches a data packet, the corresponding data packet will be processed immediately. 10.根据权利要求9所述的缓存队列调整方法,其特征在于,所述记录所述缓存队列中丢失的数据包,对所述丢失的数据包进行重传,包括:10. The cache queue adjustment method according to claim 9, wherein recording the data packets lost in the cache queue and retransmitting the lost data packets includes: 将所述丢失的数据包发送到重传队列中;Send the lost data packet to the retransmission queue; 若所述重传队列中重传的数据包的序号小于当前处理的数据包的序号,则不再重传对应的数据包;If the sequence number of the retransmitted data packet in the retransmission queue is less than the sequence number of the currently processed data packet, the corresponding data packet will not be retransmitted; 若所述重传队列中重传的数据包的序号大于当前处理的数据包的序号,则重传对应的数据包。If the sequence number of the retransmitted data packet in the retransmission queue is greater than the sequence number of the currently processed data packet, the corresponding data packet is retransmitted. 11.一种电子设备,其特征在于,所述电子设备包括:通信模块、存储器和一个或多个处理器;所述通信模块、所述存储器和所述处理器耦合;所述存储器用于存储计算机程序代码,所述计算机程序代码包括计算机指令,当所述计算机指令被所述电子设备执行时,使得所述电子设备执行如权利要求1-10任一项所述的方法。11. An electronic device, characterized in that the electronic device includes: a communication module, a memory and one or more processors; the communication module, the memory and the processor are coupled; the memory is used to store Computer program code, the computer program code comprising computer instructions, when the computer instructions are executed by the electronic device, cause the electronic device to perform the method according to any one of claims 1-10. 12.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有计算机指令,当所述计算机指令在电子设备中运行时,使得所述电子设备执行如权利要求1至10中任一项所述的方法。12. A computer-readable storage medium, characterized in that computer instructions are stored in the computer-readable storage medium, and when the computer instructions are run in an electronic device, the electronic device executes claims 1 to 1 The method described in any one of 10.
CN202310782580.3A 2023-06-28 2023-06-28 Cache queue adjusting method and electronic equipment Active CN117729588B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310782580.3A CN117729588B (en) 2023-06-28 2023-06-28 Cache queue adjusting method and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310782580.3A CN117729588B (en) 2023-06-28 2023-06-28 Cache queue adjusting method and electronic equipment

Publications (2)

Publication Number Publication Date
CN117729588A true CN117729588A (en) 2024-03-19
CN117729588B CN117729588B (en) 2024-09-17

Family

ID=90205807

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310782580.3A Active CN117729588B (en) 2023-06-28 2023-06-28 Cache queue adjusting method and electronic equipment

Country Status (1)

Country Link
CN (1) CN117729588B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118041874A (en) * 2024-01-10 2024-05-14 荣耀终端有限公司 Data processing method and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150092585A1 (en) * 2013-09-30 2015-04-02 Apple Inc. Adjusting a Jitter Buffer based on Inter Arrival Jitter
CN113037853A (en) * 2021-03-22 2021-06-25 北京字节跳动网络技术有限公司 Data processing method, device, equipment and storage medium
CN113254120A (en) * 2021-04-02 2021-08-13 荣耀终端有限公司 Data processing method and related device
CN114979091A (en) * 2022-07-28 2022-08-30 腾讯科技(深圳)有限公司 Data transmission method, related device, equipment and storage medium
CN116095395A (en) * 2021-11-08 2023-05-09 腾讯科技(深圳)有限公司 A method, device, electronic device and storage medium for adjusting buffer length

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150092585A1 (en) * 2013-09-30 2015-04-02 Apple Inc. Adjusting a Jitter Buffer based on Inter Arrival Jitter
CN113037853A (en) * 2021-03-22 2021-06-25 北京字节跳动网络技术有限公司 Data processing method, device, equipment and storage medium
CN113254120A (en) * 2021-04-02 2021-08-13 荣耀终端有限公司 Data processing method and related device
CN116095395A (en) * 2021-11-08 2023-05-09 腾讯科技(深圳)有限公司 A method, device, electronic device and storage medium for adjusting buffer length
CN114979091A (en) * 2022-07-28 2022-08-30 腾讯科技(深圳)有限公司 Data transmission method, related device, equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118041874A (en) * 2024-01-10 2024-05-14 荣耀终端有限公司 Data processing method and electronic equipment
CN118041874B (en) * 2024-01-10 2025-06-20 荣耀终端股份有限公司 Data processing method and electronic device

Also Published As

Publication number Publication date
CN117729588B (en) 2024-09-17

Similar Documents

Publication Publication Date Title
CN115426064B (en) Audio data synchronization method and equipment
CN112640505B (en) A transmission rate control method and device
WO2021175300A1 (en) Data transmission method and apparatus, electronic device, and readable storage medium
WO2020143380A1 (en) Data transmission method and electronic device
CN117376615A (en) Screen-throwing display method and electronic equipment
WO2021043219A1 (en) Bluetooth reconnection method and related apparatus
CN113795040B (en) Channel switching method, electronic device and storage medium
CN112740728B (en) Bluetooth communication method and electronic equipment
CN111316604B (en) A data transmission method and electronic device
WO2021043250A1 (en) Bluetooth communication method, and related device
WO2022048371A1 (en) Cross-device audio playing method, mobile terminal, electronic device and storage medium
WO2022111712A1 (en) Audio and video synchronization method and device
CN116709432B (en) Cache queue adjustment method and electronic device
CN117337588A (en) Channel switching method, electronic device and storage medium
WO2023011380A1 (en) Multi-frame fusion transmission method in beidou communication system, and related apparatus
CN117729588B (en) Cache queue adjusting method and electronic equipment
CN111935705A (en) Data service management method and device, computer readable medium and terminal equipment
WO2022199613A1 (en) Method and apparatus for synchronous playback
CN115460445B (en) Screen projection method of electronic equipment and electronic equipment
WO2021114950A1 (en) Multipath http channel multiplexing method and terminal
CN113453274B (en) Uplink data distribution method and terminal
CN115119214B (en) Stereo networking method, system and related device
CN116708317B (en) Data packet MTU adjustment method and device and terminal equipment
CN116684036B (en) Data processing methods and related devices
CN117714835B (en) Image processing method, electronic equipment and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040

Patentee after: Honor Terminal Co.,Ltd.

Country or region after: China

Address before: 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong

Patentee before: Honor Device Co.,Ltd.

Country or region before: China