Cache queue adjustment method and electronic device

By dynamically adjusting the cache queue length and responding to network jitter according to transmission delay and business needs, the delay jitter problem caused by the fixed cache queue length in the existing technology is solved, and the stability and efficiency of network transmission are improved.

CN117729588BActive Publication Date: 2024-09-17HONOR DEVICE CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202310782580.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-28
Publication Date
2024-09-17
Estimated Expiration
2043-06-28

AI Technical Summary

Technical Problem

The length of the existing cache queue is fixed and cannot be dynamically adjusted according to the network environment and service type. As a result, delay jitter cannot be effectively smoothed or performance is wasted.

Method used

By obtaining the transmission delay between the receiving end and the sending end, the degree of network jitter is detected, and the length of the cache queue is dynamically adjusted according to the business setting delay, transmission delay and jitter degree to determine the packet delivery strategy.

Benefits of technology

It achieves smoothing delay jitter while avoiding performance waste, ensuring data packet processing speed, and adapting to different network conditions and business needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117729588B
    Figure CN117729588B
Patent Text Reader

Abstract

The present application provides a cache queue adjustment method and electronic device, which are applied to a receiving end, and 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; obtaining the current first transmission delay between the receiving end and the transmitting end; obtaining the frequency band characteristic information of the receiving end and the transmitting end, determining the jitter coefficient based on the frequency band characteristic information, and determining the jitter cache delay based on the jitter indication value of the first transmission delay and the jitter coefficient; the jitter indication value is used to indicate the jitter degree of the first transmission delay; adjusting the length 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 transmitting end; the cache queue is used to cache the data packets of the first service, and the length of the cache queue is equal to the number of data packets that can be cached in the cache queue. This solution can dynamically adjust the length of the cache queue according to the network jitter degree and service settings.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] 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

[0002] 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.

[0003] 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

[0004] 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.

[0005] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:

[0006] 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 cache 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.

[0007] 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.

[0008] 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 length; 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 length 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.

[0009] 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.

[0010] 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:

[0011]

[0012] 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.

[0013] 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.

[0014] 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.

[0015] In a possible implementation 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.

[0016] 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 scheme can detect the specific network jitter degree according to the first transmission delay of the data packet in real time and accurately, and dynamically adjust the cache queue length according to the network jitter degree and the service setting delay.

[0017] 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 packets according to the actual number and the length of the cache queue can maintain the speed of processing data packets when the delay jitters.

[0018] 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.

[0019] 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.

[0020] 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.

[0021] 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.

[0022] 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.

[0023] 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.

[0024] 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

[0025] Figure 1 A schematic diagram of an existing cache queue solution provided in an embodiment of the present application;

[0026] Figure 2 A schematic diagram of a delay detection process provided in an embodiment of the present application;

[0027] Figure 3 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;

[0028] Figure 4 A schematic diagram of a software structure for obtaining a business type of a first business currently being performed provided in an embodiment of the present application;

[0029] Figure 5 A schematic diagram of calculating transmission delay provided in an embodiment of the present application;

[0030] Figure 6 A schematic diagram of a frame structure provided in an embodiment of the present application;

[0031] Figure 7 A schematic diagram of determining an expected cache queue provided in an embodiment of the present application;

[0032] Figure 8 A schematic diagram of various states of a cache queue provided in an embodiment of the present application;

[0033] Fig. 9A schematic diagram of a fast recovery of a cache queue abnormal state provided by an embodiment of the present application;

[0034] Fig.10 A schematic diagram of a cache queue data packet adjustment strategy provided in an embodiment of the present application;

[0035] Fig.11 A schematic diagram of the structure of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0036] 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.

[0037] 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 indicated technical features. Thus, features defined as "first", "second", etc. may explicitly or implicitly include one or more of the features. In addition, the terms "include" and "have" 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.

[0038] 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.

[0039] 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.

[0040] 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.

[0041] 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.

[0042] 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.

[0043] See also Figure 1 , Figure 1 Figure 1 is a schematic diagram of a cache queue flow transmission model. Figure 1 As shown, 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.

[0044] Delay jitter can cause the receiving end to have no packet receiving window period and a large number of packet receiving window period. During the no packet receiving window period caused by delay jitter, the receiving end submits the data packets in the cache queue to the upper layer in sequence according to the packet sending interval S. Figure 1 As shown in the figure, the receiving end enters the no-packet window period when receiving the fourth data packet. At this time, the receiving end starts to deliver the first data packet in the cache queue. 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 period R refers to the time interval for the receiving end to deliver data packets, which is set to 4 milliseconds here. Figure 1As shown in the figure, after the no packet receiving window period ends, the receiving end begins to enter a large number of packet receiving window periods, 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 packets abnormally due to delay jitter, the cache queue of the receiving end can cache data packets, so that the delay jitter will not affect the delivery of data packets by the receiving end.

[0045] 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.

[0046] 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.

[0047] See also Figure 2 , Figure 2 FIG. 1 is a schematic diagram of a time delay detection. Figure 2 As shown in the figure, 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.

[0048] 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.

[0049] 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.

[0050] 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 sensed 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.

[0051] 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.

[0052] 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.

[0053] like Figure 3 As shown, 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.

[0054] 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.

[0055] 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.

[0056] 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.

[0057] 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.

[0058] 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.

[0059] 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.

[0060] It is understandable that the interface connection relationship between the modules shown 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.

[0061] 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.

[0062] 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.

[0063] 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.

[0064] 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.

[0065] 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 perform filtering, amplification, etc. on the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation.

[0066] 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.

[0067] 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.

[0068] 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.

[0069] 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.

[0070] 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, etc. 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).

[0071] 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.

[0072] 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.

[0073] The electronic device 200 can realize the shooting function through ISP, camera 293, video codec, GPU, display screen 294 and application processor.

[0074] 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.

[0075] 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.

[0076] 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.

[0077] 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.

[0078] 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.

[0079] 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.

[0080] 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.

[0081] 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.

[0082] 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.

[0083] 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.

[0084] 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.

[0085] The key 290 includes a power key, a volume key, etc. The key 290 can be a mechanical key or a touch key. The electronic device 200 can receive key input and generate key signal input related to user settings and function control of the electronic device 200.

[0086] 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.

[0087] 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.

[0088] The methods in the following embodiments can all be implemented in the electronic device 200 having the above hardware structure.

[0089] 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.

[0090] 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.

[0091] 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.

[0092] See also Figure 4 , Figure 4 A schematic diagram of a software structure for obtaining the service type of a currently-performed first service provided in an embodiment of the present application. Figure 4 As shown, the upper layer (such as the application layer) of the receiving end obtains the service type of the first service currently being carried out, and 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 carried out according to the information passed by the upper layer.

[0093] 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.

[0094] 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.

[0095] S302: The receiving end determines a service setting delay corresponding to the target service type.

[0096] In the embodiment of the present application, the service setting delay refers to the time required for different service settings from when a data packet of the service is expected to be sent from the sending end to when the receiving end starts to process the corresponding data packet.

[0097] 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, 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.

[0098] 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.

[0099] 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.

[0100] 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.

[0101] 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.

[0102] 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.

[0103] 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.

[0104] 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.

[0105] S303: The receiving end obtains a current first transmission delay between the receiving end and the sending end.

[0106] 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.

[0107] 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 receiving end receiving 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, thereby calculating the above-mentioned receiving end delayed confirmation waiting time D1, that is, the difference between moment 2 and moment 1.

[0108] 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.

[0109] 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.

[0110] 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.

[0111] 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.

[0112] 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.

[0113] like Figure 5 As shown in the figure, the sender sends data packets to the receiver in sequence. After receiving 10 data packets, the receiver sends a transmission completion frame to the sender. After receiving the transmission completion frame, the sender returns a transmission completion confirmation frame to the receiver. Figure 5 From the figure, we can know the relationship between the sending end waiting time D1, the receiving end delayed confirmation waiting time D2, the transmission delay S2 of the transmission completed frame, the transmission delay S3 of the transmission completed confirmation frame and the data packet transmission delay S1, that is, D1=S1+D2+S2, where S2=S3.

[0114] like Figure 6 As shown, the frame structure of the transmission completion confirmation frame includes a frame header, several transmission units (tansferUnit) and several transmission information (tansferinfo). 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.

[0115] 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.

[0116] S304: The receiving end determines a jitter buffer delay based on the jitter indication value of the first transmission delay.

[0117] 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:

[0118]

[0119] 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 duration.

[0120] 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.

[0121] 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.

[0122] 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.

[0123] In an embodiment of the present application, the service can also sense 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。

[0124] 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.

[0125] 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).

[0126] 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.

[0127] 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.

[0128] 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.

[0129] The receiving end can save the delay information of the above-mentioned multiple service types in a table format. As shown in Table 1:

[0130] Table 1

[0131]

[0132]

[0133] 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.

[0134] 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.

[0135] 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.

[0136] S305: The receiving end adjusts the length K of the buffer 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 sending end.

[0137] 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.

[0138] 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.

[0139] 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.

[0140] 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 K0 = T1 / S. That is, when the first service is just initiated, the initial length of the corresponding cache queue.

[0141] 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.

[0142] See also Figure 7 , Figure 7 A schematic diagram of determining an expected cache queue provided in an embodiment of the present application. After the first service is initiated, the receiving end periodically sends a transmission completion frame to the sending end, and receives a transmission completion confirmation frame from the sending end, thereby calculating the transmission delay of the data packet of the first service in real time. Figure 7 As shown, the receiving end sends a transmission completed frame to the sending end when receiving the second data packet, that is, the duration between the moment the first service is initiated and the moment the second data packet is received is the preset duration for sending the transmission completed frame set by the receiving end.

[0143] Figure 7 In the example, 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.

[0144] 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. Figure 7 As shown, the packet sending interval S may be the average value of S1 and S2.

[0145] 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.

[0146] 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.

[0147] As Figure 8 shown, in an actual scenario, the current cache queue may include the following states. State 1: When the network status is good, the receiving end receives packets evenly. At this time, the length k of the cache queue is k = K. State 2: When there is network jitter, the receiving end does not receive packets. At this time, the length k of the cache queue is k < K. State 3: When there is network jitter, the receiving end receives a large number of packets in a short time. At this time, the length k of the cache queue is k > K. State 4: The length k of the cache queue is k = 0. State 5: The length k of the cache queue is the maximum value.

[0148] Based on this, the receiving end can also adjust the processing policy of the data packets according to the actual quantity and the target length of the cache queue to ensure that the receiving end can maintain the speed of processing data packets during delay jitter.

[0149] Specifically, after adjusting the length of the cache queue, the method of the embodiment of the present application may further include S306.

[0150] S306. The receiving end obtains the actual quantity k of the data packets currently cached in the cache queue, and based on the actual quantity k and the length K of the cache queue, adjusts the processing policy of the cached data packets in the cache queue until there are K data packets cached in the cache queue, and then processes the cached data packets in the cache queue according to the packet sending interval.

[0151] In the embodiment of the present application, different data packet processing policies are stored in the receiving end, which are determined according to the actual quantity k of the currently cached data packets and the length K of the cache queue to be adjusted.

[0152] S306a. If the actual quantity 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 lost data packets in the cache queue, and retransmits the lost data packets.

[0153] S306b. If the actual quantity 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; where the target interval is less than the packet sending interval.

[0154] S306c. If the actual quantity k is 0, the receiving end processes the corresponding data packet immediately after caching a data packet in the cache queue.

[0155] Among them, within a preset duration, if a data packet is received by the cache queue of the receiving end, it is immediately delivered. If no data packet is received within the preset duration, the cache can be restarted.

[0156] Please refer to Fig. 9 , Fig. 9A schematic diagram of a fast recovery of a cache queue abnormal state provided by an embodiment of the present application. Fig. 9 As shown, 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. For state 2, it corresponds to the above step S306a, which will not be described in detail here. For state 3, it corresponds to the above step S306b, which will not be described in detail here. For state 3, it corresponds to the above step S306c, which will not be described in detail here.

[0157] 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.

[0158] 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.

[0159] 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.

[0160] For example, see Fig.10 , Fig.10 A schematic diagram of a cache queue data packet adjustment strategy provided in an embodiment of the present application. Fig.10 As shown, if the actual number k of data packets currently cached in the cache queue 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 retransmitted (i.e., executing S306a).

[0161] 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.

[0162] 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.

[0163] like Fig.10 As shown, 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., executes S306b). Wherein, 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.

[0164] 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.

[0165] like Fig.10 As shown, if the actual number k of packets currently cached in the cache queue is 0, the receiving end immediately processes the corresponding packet after caching a packet in the cache queue (i.e., executes S306c). In other words, the packets previously cached in the cache queue have been processed. At this time, as long as a new packet is added to the cache queue, the receiving end immediately processes the corresponding packet.

[0166] 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.

[0167] The present application also provides a chip system, such as Fig.11As shown, 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 via 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 instructions are executed by the processor 1101, the electronic device can execute the various steps in the above embodiments. Of course, the chip system may also include other discrete devices, which are not specifically limited in the embodiments of the present application.

[0168] 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.

[0169] 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.

[0170] 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.

[0171] 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.

[0172] 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.

[0173] 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.

[0174] 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.

[0175] 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

1. A cache queue adjustment method, It is characterized in that Applied to a receiving end, the receiving end establishes a wireless connection with a sending end, the receiving end is used to receive and cache a data packet of a first service from the sending end and then process the data packet to execute the first service, the method comprising: In response to the initiation operation of the first service, a target service type of the first service is obtained, and a service setting delay corresponding to the target service type is determined; wherein the service setting delay is the time required for the first service setting from the sending end sending a data packet of the first service to the receiving end starting to process the corresponding data packet; Obtaining a current first transmission delay between the receiving end and the sending end; wherein the first transmission delay is used to indicate the time required from the sending end sending a data packet of the first service to the receiving end receiving the corresponding data packet; Determine a jitter buffer delay based on a jitter indication value of the first transmission delay; wherein the jitter indication value is used to indicate a jitter degree of the first transmission delay, and the jitter buffer delay is used to indicate a time required for buffering to resist jitter from the sending end sending the one data packet to the receiving end receiving the corresponding data packet under the jitter degree; 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, adjust the length K of the cache queue; 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.

2. The cache queue adjustment method according to claim 1, It is characterized in that The obtaining of a current first transmission delay between the receiving end and the transmitting end includes: In response to the initiation operation of the first service, a transmission frame is sent to the sending end every first preset time period; wherein the transmission frame includes a first waiting time between the reception time of the first data packet of the first service received by the receiving end within the first preset time period 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, a second round trip delay is calculated to obtain a second transmission delay of the transmission frame; wherein the sending time of the transmission frame is the same as the receiving time of the transmission confirmation frame; A 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. The cache queue adjustment method according to claim 1 or 2, It is characterized in that 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.

4. The cache queue adjustment method according to claim 1 or 2, It is characterized in that Before determining the jitter buffer delay based on the jitter indication value of the first transmission delay, the method further includes: Determining a jitter indication value based on an average deviation value of the first transmission delay within a second preset time length; The determining of the jitter buffer delay based on the jitter indication value of the first transmission delay includes: Acquire frequency band characteristic information of the receiving end and the transmitting end, and determine a jitter coefficient based on the frequency band characteristic information; wherein the frequency band characteristic information is used to indicate a relationship between a frequency point and a channel of the receiving end and the transmitting end; The jitter buffer delay is determined based on a product of the jitter indication value and the jitter coefficient.

5. The cache queue adjustment method according to claim 4, It is characterized in that The method further comprises: If the jitter buffer delay is less than the packet sending interval, the jitter buffer delay is adjusted to 0.

6. The cache queue adjustment method according to claim 5, It is characterized in that The target service type is also provided with a corresponding jitter buffer delay threshold, and the method comprises: If the jitter buffer delay is greater than the jitter buffer delay threshold, the jitter buffer delay is the jitter buffer delay threshold.

7. The cache queue adjustment method according to any one of claims 1-2, 5-6, It is characterized in that The adjusting 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 The length K of the cache queue is calculated.

8. The cache queue adjustment method according to any one of claims 1-2, 5-6, It is characterized in that After adjusting 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, the method further includes: Obtain an actual number k of data packets currently cached in the cache queue, and adjust a processing strategy for data packets cached in the cache queue based on the actual number k and a length K of the cache queue, until K data packets are cached in the cache queue and then the data packets cached in the cache queue are processed according to the packet sending interval.

9. The cache queue adjustment method according to claim 8, It is characterized in that The adjusting the processing strategy of the buffered data packets in the buffer queue based on the actual number k and the length K of the buffer queue includes: 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 retransmitted; 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 packet loss processing is performed on the data packets in the cache queue; wherein the target interval is less than the packet sending interval; If the actual number k is 0, after a data packet is buffered in the buffer queue, the corresponding data packet is processed immediately.

10. The cache queue adjustment method according to claim 9, It is characterized in that The recording of the lost data packets in the cache queue and retransmitting the lost data packets includes: Sending the lost data packet to a retransmission queue; 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 is no longer 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. An electronic device, It is characterized in that The electronic device comprises: 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 comprises computer instructions, and when the computer instructions are executed by the electronic device, the electronic device executes the method as described in any one of claims 1-10.

12. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer instructions, and when the computer instructions are executed in an electronic device, the electronic device executes the method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Data processing method and device, equipment and storage medium

    CN113037853A

  • Data processing method and related device

    CN113254120A

  • Data transmission method, related device, equipment and storage medium

    CN114979091A

  • Method and device for adjusting buffer length, electronic equipment and storage medium

    CN116095395A

  • Adjusting a Jitter Buffer based on Inter Arrival Jitter

    US20150092585A1