CN116708317B - Data packet MTU adjustment method and device and terminal equipment - Google Patents

Data packet MTU adjustment method and device and terminal equipment Download PDF

Info

Publication number
CN116708317B
CN116708317B CN202211184760.3A CN202211184760A CN116708317B CN 116708317 B CN116708317 B CN 116708317B CN 202211184760 A CN202211184760 A CN 202211184760A CN 116708317 B CN116708317 B CN 116708317B
Authority
CN
China
Prior art keywords
mtu
size
terminal device
current
memory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211184760.3A
Other languages
Chinese (zh)
Other versions
CN116708317A (en
Inventor
王剑
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202211184760.3A priority Critical patent/CN116708317B/en
Publication of CN116708317A publication Critical patent/CN116708317A/en
Application granted granted Critical
Publication of CN116708317B publication Critical patent/CN116708317B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/36Flow control; Congestion control by determining packet size, e.g. maximum transfer unit [MTU]
    • H04L47/365Dynamic adaptation of the packet size

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Telephone Function (AREA)

Abstract

The embodiment of the application provides a method, a device and a terminal device for adjusting a data packet MTU, wherein in the method for adjusting the data packet MTU, the terminal device acquires a first moment for adjusting the size of the MTU last time, acquires the number of memory application failures and the number of packet losses after the first moment, and if the number of memory application failures is smaller than or equal to a memory application failure number threshold and the number of packet losses is smaller than or equal to a packet loss number threshold, the terminal device acquires a time interval between the current moment and the first moment, the ratio of the current residual available memory and the current data transmission rate, and increases the size of the MTU according to the time interval between the current moment and the first moment, the ratio of the current residual available memory and the current data transmission rate, so that the MTU size can be dynamically adjusted based on indexes such as the current residual available memory size, the number of memory allocation failures and the number of packet losses, so that the data transmission efficiency can be greatly improved, and service stability can be further improved.

Description

Data packet MTU adjustment method and device and terminal equipment
Technical Field
The embodiment of the application relates to the technical field of intelligent terminals, in particular to a method and a device for adjusting a maximum transmission unit (maximum transmission unit, MTU) of a data packet and terminal equipment.
Background
Because of the small memory random access memory (random access memory, RAM) size on small devices such as wearable devices, the maximum transmission unit (maximum transmission unit, MTU) size of the data packets at the transmission link layer is generally fixed to be smaller on the order of about 1K, and the MTU setting makes the data transceiving rate of request response to such interaction lower.
The transmission of data of historical wearing products is mainly used for data synchronization, and the requirement on time efficiency is not particularly high. The next generation of wearable products introduces a bluetooth internet function, and internet data packets need to be sent to a bluetooth chip after being sealed/unpacked through a link layer, and at this time, the delay of a network data request can be directly reflected on the experience of an application layer, for example: the song class application listens to songs in real time for a longer time or has a jam in the middle, which can make the user experience worse.
Disclosure of Invention
The embodiment of the application provides a method, a device and terminal equipment for adjusting the MTU of a data packet, and also provides a computer readable storage medium so as to realize dynamic adjustment of the size of the MTU and improve service stability.
In a first aspect, an embodiment of the present application provides a method for adjusting an MTU of a data packet, including: the terminal equipment acquires a first moment for adjusting the size of the MTU last time, and acquires the number of memory application failures and the number of packet losses after the first moment; if the number of the memory application failures is smaller than or equal to a preset memory application failure number threshold, and the number of the lost packets is smaller than or equal to a preset packet loss number threshold, acquiring a time interval from the current moment to the first moment, a current remaining available memory duty ratio and a current data transmission rate; the current remaining available memory ratio comprises the ratio of the current remaining available memory to the initial remaining available memory after the terminal equipment is started; and increasing the size of the MTU according to the time interval between the current time and the first time, the duty ratio of the current residual available memory and the current data transmission rate.
In one possible implementation manner, the increasing the size of the MTU according to the time interval between the current time and the first time, the duty ratio of the current remaining available memory, and the current data transmission rate includes: and if the interval between the current time and the first time is larger than a preset adjustment time interval, the duty ratio of the current residual available memory is larger than or equal to a preset duty ratio, and the current data transmission rate is smaller than or equal to a preset transmission rate threshold value, increasing the size of the MTU.
In one possible implementation, the increasing the size of the MTU includes: the size of the MTU is adjusted upward by a first predetermined number of predetermined steps.
In one possible implementation manner, after the increasing the size of the MTU, the method further includes: and if the size of the MTU after the increase is larger than the maximum value of the preset MTU, resetting the size of the MTU to the maximum value of the preset MTU.
In one possible implementation manner, the obtaining the number of memory application failures and the number of packet losses after the first time further includes: and if the number of the memory application failures is larger than a preset memory application failure number threshold, or the number of the lost packets is larger than a preset packet loss number threshold, reducing the size of the MTU.
In one possible implementation manner, the reducing the size of the MTU includes: the size of the MTU is reduced downward by a second predetermined number of predetermined steps.
In one possible implementation manner, after the reducing the size of the MTU, the method further includes: and if the size of the MTU after the reduction is smaller than the minimum value of the preset MTU, resetting the size of the MTU to the minimum value of the preset MTU.
In one possible implementation manner, the method further includes: after the size of the MTU is adjusted, the moment of adjusting the size of the MTU is recorded.
In a second aspect, an embodiment of the present application provides a device for adjusting an MTU of a data packet, where the device is included in a terminal device, and the device has a function of implementing the behavior of the terminal device in the first aspect and possible implementations of the first aspect. The functions may be realized by hardware, or may be realized by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the functions described above. For example, an MTU information acquisition module and an MTU adjustment module.
In a third aspect, an embodiment of the present application provides a terminal device, including: one or more processors; a memory; a plurality of applications; and one or more computer programs, wherein the one or more computer programs are stored in the memory, the one or more computer programs comprising instructions, which when executed by the terminal device, cause the terminal device to perform the steps of: acquiring a first moment for adjusting the size of the MTU last time, and acquiring the number of memory application failures and the number of packet losses after the first moment; if the number of the memory application failures is smaller than or equal to a preset memory application failure number threshold, and the number of the lost packets is smaller than or equal to a preset packet loss number threshold, acquiring a time interval from the current moment to the first moment, a current remaining available memory duty ratio and a current data transmission rate; the current remaining available memory ratio comprises the ratio of the current remaining available memory to the initial remaining available memory after the terminal equipment is started; and increasing the size of the MTU according to the time interval between the current time and the first time, the duty ratio of the current residual available memory and the current data transmission rate.
In one possible implementation manner, when the instruction is executed by the terminal device, the step of causing the terminal device to perform the step of increasing the size of the MTU according to the time interval between the current time and the first time, the current remaining available memory duty ratio, and the current data transmission rate includes: and if the interval between the current time and the first time is larger than a preset adjustment time interval, the duty ratio of the current residual available memory is larger than or equal to a preset duty ratio, and the current data transmission rate is smaller than or equal to a preset transmission rate threshold value, increasing the size of the MTU.
In one possible implementation, the step of causing the terminal device to perform the step of increasing the size of the MTU includes: the size of the MTU is adjusted upward by a first predetermined number of predetermined steps.
In one possible implementation, the instructions, when executed by the terminal device, cause the terminal device to perform the step of increasing the size of the MTU, further perform the following steps: and if the size of the MTU after the increase is larger than the maximum value of the preset MTU, resetting the size of the MTU to the maximum value of the preset MTU.
In one possible implementation manner, when the instruction is executed by the terminal device, after the step of obtaining the number of memory application failures and the number of packet losses after the first time, the terminal device further executes the following steps: and if the number of the memory application failures is larger than a preset memory application failure number threshold, or the number of the lost packets is larger than a preset packet loss number threshold, reducing the size of the MTU.
In one possible implementation, the step of causing the terminal device to perform the reducing the size of the MTU includes: the size of the MTU is reduced downward by a second predetermined number of predetermined steps.
In one possible implementation, the instructions, when executed by the terminal device, cause the terminal device to perform the step of reducing the size of the MTU, further perform the following steps: and if the size of the MTU after the reduction is smaller than the minimum value of the preset MTU, resetting the size of the MTU to the minimum value of the preset MTU.
In one possible implementation, the instructions, when executed by the terminal device, cause the terminal device to further perform the steps of: after the size of the MTU is adjusted, the moment of adjusting the size of the MTU is recorded.
It should be understood that, the second aspect and the third aspect of the embodiment of the present application are consistent with the technical solutions of the first aspect of the embodiment of the present application, and the beneficial effects obtained by each aspect and the corresponding possible implementation manner are similar, and are not repeated.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium having a computer program stored therein, which when run on a computer, causes the computer to perform the method provided in the first aspect.
In a fifth aspect, an embodiment of the present application provides a computer program for performing the method provided in the first aspect, when the computer program is executed by a computer.
In one possible design, the program in the fifth aspect may be stored in whole or in part on a storage medium packaged with the processor, or in part or in whole on a memory not packaged with the processor.
Drawings
Fig. 1 is a schematic structural diagram of a terminal device according to an embodiment of the present application;
Fig. 2 is a block diagram illustrating a packet transmission hierarchy of a terminal device 100 according to an embodiment of the present application;
fig. 3 is a flowchart of a method for adjusting an MTU of a data packet according to an embodiment of the present application;
fig. 4 is a flowchart of a method for adjusting an MTU of a data packet according to another embodiment of the present application;
fig. 5 is a schematic structural diagram of a terminal device according to another embodiment of the present application.
Detailed Description
The terminology used in the description of the embodiments of the application herein is for the purpose of describing particular embodiments of the application only and is not intended to be limiting of the application.
In the prior art, the next generation of wearable products introduces a bluetooth internet function, and internet data packets need to be sent to a bluetooth chip after being sealed/unpacked through a link layer, and at this time, the delay of a network data request can be directly reflected on the experience of an application layer, for example: the song class application listens to songs in real time for a longer time or has a jam in the middle.
In order to improve the above problem, if only the MTU is simply adjusted, the payload (payload) of the single interactive data volume may be increased, and the transmission rate may be correspondingly increased, specifically, the transmission rate may be increased by approximately 5-10 times according to the size of the adjusted MTU.
However, simply increasing the MTU also causes the following problems:
1) The memory is occupied too much. The single MTU is larger, the RAM of the memory required by batch data transmission is larger, and the MTU data packets can not be divided into the memory, or other businesses can not apply for the memory because the occupied memory is more.
2) Packet loss retransmissions increase the retransmission data. The single MTU is larger, if the transmitted data packet is unstable, the probability of single packet error is increased, the data volume of retransmission is increased, the time consumption of retransmission is also increased, and the speed is not beneficial to improvement.
Based on the above problems, the embodiment of the present application provides a method for adjusting MTU, which dynamically adjusts the size of MTU by combining the indexes such as the size of the current remaining available memory, the number of memory allocation failures, the number of packet loss retransmissions, and the like, and improves the service stability while maximizing the transmission rate.
The method for adjusting the MTU of the data packet provided by the embodiment of the application can be applied to a terminal device, wherein the terminal device can be a wearable device, a vehicle-mounted device, an augmented reality (augmented reality, AR)/Virtual Reality (VR) device, a netbook or a Personal Digital Assistant (PDA) device, and the like; the embodiment of the application does not limit the specific type of the terminal equipment. However, the present embodiment is described taking a terminal device as a wearable device as an example.
For example, fig. 1 is a schematic structural diagram of a terminal device according to an embodiment of the present application, and as shown in fig. 1, the terminal device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identity module (subscriber identification module, SIM) card interface 195. The sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the terminal device 100. In other embodiments of the application, terminal device 100 may include more or less components than illustrated, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 110 may include one or more processing units, such as: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (IMAGE SIGNAL processor, ISP), a controller, a video codec, a digital signal processor (DIGITAL SIGNAL processor, DSP), a baseband processor, and/or a neural-Network Processor (NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby improving the efficiency of the system.
In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an integrated circuit (inter-INTEGRATED CIRCUIT, I2C) interface, an integrated circuit built-in audio (inter-INTEGRATED CIRCUIT SOUND, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a universal serial bus (universal serial bus, USB) interface, among others.
The I2C interface is a bi-directional synchronous serial bus comprising a serial data line (SERIAL DATA LINE, SDA) and a serial clock line (derail clock line, DCL). In some embodiments, the processor 110 may contain multiple sets of I2C buses. The processor 110 may be coupled to the touch sensor 180K, charger, flash, camera 193, etc., respectively, through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through an I2C interface, so that the processor 110 and the touch sensor 180K communicate through an I2C bus interface to implement a touch function of the terminal device 100.
The I2S interface may be used for audio communication. In some embodiments, the processor 110 may contain multiple sets of I2S buses. The processor 110 may be coupled to the audio module 170 via an I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 may transmit an audio signal to the wireless communication module 160 through the I2S interface, to implement a function of answering a call through the bluetooth headset.
PCM interfaces may also be used for audio communication to sample, quantize and encode analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface. In some embodiments, the audio module 170 may also transmit audio signals to the wireless communication module 160 through the PCM interface to implement a function of answering a call through the bluetooth headset. Both the I2S interface and the PCM interface may be used for audio communication.
The UART interface is a universal serial data bus for asynchronous communications. The bus may be a bi-directional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, a UART interface is typically used to connect the processor 110 with the wireless communication module 160. For example: the processor 110 communicates with a bluetooth module in the wireless communication module 160 through a UART interface to implement a bluetooth function. In some embodiments, the audio module 170 may transmit an audio signal to the wireless communication module 160 through a UART interface, to implement a function of playing music through a bluetooth headset.
The MIPI interface may be used to connect the processor 110 to peripheral devices such as a display 194, a camera 193, and the like. The MIPI interfaces include camera serial interfaces (CAMERA SERIAL INTERFACE, CSI), display serial interfaces (DISPLAY SERIAL INTERFACE, DSI), and the like. In some embodiments, processor 110 and camera 193 communicate through a CSI interface to implement the photographing function of terminal device 100. The processor 110 and the display 194 communicate via a DSI interface to implement the display function of the terminal device 100.
The GPIO interface may be configured by software. The GPIO interface may be configured as a control signal or as a data signal. In some embodiments, a GPIO interface may be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, and the like. The GPIO interface may also be configured as an I2C interface, an I2S interface, a UART interface, an MIPI interface, etc.
The USB interface 130 is an interface conforming to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 may be used to connect a charger to charge the terminal device 100, or may be used to transfer data between the terminal device 100 and a peripheral device. And can also be used for connecting with a headset, and playing audio through the headset. The interface may also be used to connect other electronic devices, such as AR devices, etc.
It should be understood that the interfacing relationship between the modules illustrated in the embodiment of the present application is only illustrative, and does not constitute a structural limitation of the terminal device 100. In other embodiments of the present application, the terminal device 100 may also use different interfacing manners, or a combination of multiple interfacing manners in the foregoing embodiments.
The charge management module 140 is configured to receive a charge input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charge management module 140 may receive a charging input of a wired charger through the USB interface 130. In some wireless charging embodiments, the charge management module 140 may receive wireless charging input through a wireless charging coil of the terminal device 100. The charging management module 140 may also supply power to the terminal device 100 through the power management module 141 while charging the battery 142.
The power management module 141 is used for connecting the battery 142, and the charge management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 to power the processor 110, the internal memory 121, the display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 may also be configured to monitor battery capacity, battery cycle number, battery health (leakage, impedance) and other parameters. In other embodiments, the power management module 141 may also be provided in the processor 110. In other embodiments, the power management module 141 and the charge management module 140 may be disposed in the same device.
The wireless communication function of the terminal device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the terminal device 100 may be used to cover a single or multiple communication bands. Different antennas may also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed into a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution including 2G/3G/4G/5G wireless communication applied to the terminal device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA), etc. The mobile communication module 150 may receive electromagnetic waves from the antenna 1, perform processes such as filtering, amplifying, and the like on the received electromagnetic waves, and transmit the processed electromagnetic waves to the modem processor for demodulation. The mobile communication module 150 can amplify the signal modulated by the modem processor, and convert the signal into electromagnetic waves through the antenna 1 to radiate. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be provided in the same device as at least some of the modules of the processor 110.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating 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. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs sound signals through an audio device (not limited to the speaker 170A, the receiver 170B, etc.), or displays images or video through the display screen 194. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be provided in the same device as the mobile communication module 150 or other functional module, independent of the processor 110.
The wireless communication module 160 may provide solutions for wireless communication including wireless local area network (wireless local area networks, WLAN) (e.g., wireless fidelity (WIRELESS FIDELITY, wi-Fi) network), bluetooth (BT), global navigation satellite system (global navigation SATELLITE SYSTEM, GNSS), frequency modulation (frequency modulation, FM), near field communication (NEAR FIELD communication, NFC), infrared (IR), etc., applied on the terminal device 100. The wireless communication module 160 may be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signals, filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, frequency modulate it, amplify it, and convert it to electromagnetic waves for radiation via the antenna 2.
In some embodiments, antenna 1 and mobile communication module 150 of terminal device 100 are coupled, and antenna 2 and wireless communication module 160 are coupled, such that terminal device 100 may communicate with a network and other devices via wireless communication techniques. The wireless communication techniques can include the Global System for Mobile communications (global system for mobile communications, GSM), general packet radio service (GENERAL PACKET radio service, GPRS), code division multiple access (code division multiple access, CDMA), wideband code division multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), BT, GNSS, WLAN, NFC, FM, and/or IR techniques, among others. The GNSS may include a global satellite positioning system (global positioning system, GPS), a global navigation satellite system (global navigation SATELLITE SYSTEM, GLONASS), a beidou satellite navigation system (beidou navigation SATELLITE SYSTEM, BDS), a quasi zenith satellite system (quasi-zenith SATELLITE SYSTEM, QZSS) and/or a satellite based augmentation system (SATELLITE BASED AUGMENTATION SYSTEMS, SBAS).
The terminal device 100 implements display functions through a GPU, a display screen 194, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
The display screen 194 is used to display images, videos, and the like. The display 194 includes a display panel. The display panel may employ a Liquid Crystal Display (LCD) CRYSTAL DISPLAY, an organic light-emitting diode (OLED), 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), or the like. In some embodiments, the terminal device 100 may include 1 or N display screens 194, N being a positive integer greater than 1.
The terminal device 100 may implement a photographing function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
The ISP is used to process data fed back by the camera 193. For example, when photographing, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electric signal, and the camera photosensitive element transmits the electric signal to the ISP for processing and is converted into an image visible to naked eyes. ISP can also optimize the noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in the camera 193.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image onto the photosensitive element. The photosensitive element may be a charge coupled device (charge coupled device, CCD) or a Complementary Metal Oxide Semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then transferred 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 the like format. In some embodiments, the terminal device 100 may include 1 or N cameras 193, N being a positive integer greater than 1.
The digital signal processor is used for processing digital signals, and can process other digital signals besides digital image signals. For example, when the terminal device 100 selects a frequency bin, the digital signal processor is used to fourier transform the frequency bin energy, or the like.
Video codecs are used to compress or decompress digital video. The terminal device 100 may support one or more video codecs. In this way, the terminal device 100 can play or record video in various encoding formats, for example: dynamic picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
The NPU is a neural-network (NN) computing processor, and can rapidly process input information by referencing a biological neural network structure, for example, referencing a transmission mode between human brain neurons, and can also continuously perform self-learning. Applications such as intelligent awareness of the terminal device 100 may be implemented by the NPU, for example: image recognition, face recognition, speech recognition, text understanding, etc.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to realize expansion of the memory capability of the terminal device 100. The external memory card communicates with the processor 110 through an external memory interface 120 to implement data storage functions. For example, files such as music, video, etc. are stored in an external memory card.
The internal memory 121 may be used to store computer executable program code including instructions. The internal memory 121 may include a storage program area and a storage data area. The storage program area may store an application program (such as a sound playing function, an image playing function, etc.) required for at least one function of the operating system, etc. The storage data area may store data (such as audio data, phonebook, etc.) created during use of the terminal device 100, and the like. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (universal flash storage, UFS), and the like. The processor 110 performs various functional applications of the terminal device 100 and data processing by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
The terminal device 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playing, recording, etc.
The audio module 170 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be disposed in the processor 110, or a portion of the functional modules of the audio module 170 may be disposed in the processor 110.
The speaker 170A, also referred to as a "horn," is used to convert audio electrical signals into sound signals. The terminal device 100 can listen to music or to handsfree talk through the speaker 170A.
A receiver 170B, also referred to as a "earpiece", is used to convert the audio electrical signal into a sound signal. When the terminal device 100 receives a call or voice message, it is possible to receive voice by approaching the receiver 170B to the human ear.
Microphone 170C, also referred to as a "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or transmitting voice information, the user can sound near the microphone 170C through the mouth, inputting a sound signal to the microphone 170C. The terminal device 100 may be provided with at least one microphone 170C. In other embodiments, the terminal device 100 may be provided with two microphones 170C, and may implement a noise reduction function in addition to collecting sound signals. In other embodiments, the terminal device 100 may be further provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the source of sound, implement directional recording functions, etc.
The earphone interface 170D is used to connect a wired earphone. The headset interface 170D may be a USB interface 130 or a 3.5mm open mobile electronic device platform (open mobile terminal platform, OMTP) standard interface, a american cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
The pressure sensor 180A is used to sense a pressure signal, and may convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194. The pressure sensor 180A is of various types, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, and the like. The capacitive pressure sensor may be a capacitive pressure sensor comprising at least two parallel plates with conductive material. The capacitance between the electrodes changes when a force is applied to the pressure sensor 180A. The terminal device 100 determines the intensity of the pressure according to the change of the capacitance. When a touch operation is applied to the display 194, the terminal device 100 detects the intensity of the touch operation according to the pressure sensor 180A. The terminal device 100 may also calculate the position of the touch from the detection signal of the pressure sensor 180A. In some embodiments, touch operations that act on the same touch location, but at different touch operation strengths, may correspond to different operation instructions. For example: and executing an instruction for checking the short message when the touch operation with the touch operation intensity smaller than the first pressure threshold acts on the short message application icon. And executing an instruction for newly creating the short message when the touch operation with the touch operation intensity being greater than or equal to the first pressure threshold acts on the short message application icon.
The gyro sensor 180B may be used to determine a motion gesture of the terminal device 100. In some embodiments, the angular velocity of the terminal device 100 about three axes (i.e., x, y, and z axes) may be determined by the gyro sensor 180B. The gyro sensor 180B may be used for photographing anti-shake. Illustratively, when the shutter is pressed, the gyro sensor 180B detects the angle of the shake of the terminal device 100, calculates the distance to be compensated by the lens module according to the angle, and allows the lens to counteract the shake of the terminal device 100 by the reverse motion, thereby realizing anti-shake. The gyro sensor 180B may also be used for navigating, somatosensory game scenes.
The air pressure sensor 180C is used to measure air pressure. In some embodiments, the terminal device 100 calculates altitude from barometric pressure values measured by the barometric pressure sensor 180C, aiding in positioning and navigation.
The magnetic sensor 180D includes a hall sensor. The terminal device 100 can detect the opening and closing of the flip cover using the magnetic sensor 180D. In some embodiments, when the terminal device 100 is a folder, the terminal device 100 may detect opening and closing of the folder according to the magnetic sensor 180D. And then according to the detected opening and closing state of the leather sheath or the opening and closing state of the flip, the characteristics of automatic unlocking of the flip and the like are set.
The acceleration sensor 180E can detect the magnitude of acceleration of the terminal device 100 in various directions (typically three axes). The magnitude and direction of gravity may be detected when the terminal device 100 is stationary. The electronic equipment gesture recognition method can also be used for recognizing the gesture of the electronic equipment, and is applied to horizontal and vertical screen switching, pedometers and other applications.
A distance sensor 180F for measuring a distance. The terminal device 100 may measure the distance by infrared or laser. In some embodiments, the terminal device 100 may range using the distance sensor 180F to achieve fast focusing.
The proximity light sensor 180G may include, for example, a Light Emitting Diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The terminal device 100 emits infrared light outward through the light emitting diode. The terminal device 100 detects infrared reflected light from a nearby object using a photodiode. When sufficient reflected light is detected, it can be determined that there is an object in the vicinity of the terminal device 100. When insufficient reflected light is detected, the terminal device 100 may determine that there is no object in the vicinity of the terminal device 100. The terminal device 100 can detect that the user holds the terminal device 100 close to the ear to talk by using the proximity light sensor 180G, so as to automatically extinguish the screen for the purpose of saving power. The proximity light sensor 180G may also be used in holster mode, pocket mode to automatically unlock and lock the screen.
The ambient light sensor 180L is used to sense ambient light level. The terminal device 100 may adaptively adjust the brightness of the display 194 based on the perceived ambient light level. The ambient light sensor 180L may also be used to automatically adjust white balance when taking a photograph. The ambient light sensor 180L may also cooperate with the proximity light sensor 180G to detect whether the terminal device 100 is in a pocket to prevent false touches.
The fingerprint sensor 180H is used to collect a fingerprint. The terminal device 100 can utilize the collected fingerprint characteristics to realize fingerprint unlocking, access an application lock, fingerprint photographing, fingerprint incoming call answering and the like.
The temperature sensor 180J is for detecting temperature. In some embodiments, the terminal device 100 performs a temperature processing strategy using the temperature detected by the temperature sensor 180J. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the terminal device 100 performs a reduction in the performance of a processor located near the temperature sensor 180J in order to reduce power consumption to implement thermal protection. In other embodiments, when the temperature is below another threshold, the terminal device 100 heats the battery 142 to avoid the low temperature causing the terminal device 100 to shut down abnormally. In other embodiments, when the temperature is below a further threshold, the terminal device 100 performs boosting of the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperatures.
The touch sensor 180K, also referred to as a "touch device". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen". The touch sensor 180K is for detecting a touch operation acting thereon or thereabout. The touch sensor may communicate the detected touch operation to the application processor to determine the touch event type. Visual output related to touch operations may be provided through the display 194. In other embodiments, the touch sensor 180K may also be disposed on the surface of the terminal device 100 at a different location than the display 194.
The bone conduction sensor 180M may acquire a vibration signal. In some embodiments, bone conduction sensor 180M may acquire a vibration signal of a human vocal tract vibrating bone pieces. The bone conduction sensor 180M may also contact the pulse of the human body to receive the blood pressure pulsation signal. In some embodiments, bone conduction sensor 180M may also be provided in a headset, in combination with an osteoinductive headset. The audio module 170 may analyze the voice signal based on the vibration signal of the sound portion vibration bone block obtained by the bone conduction sensor 180M, so as to implement a voice function. The application processor may analyze the heart rate information based on the blood pressure beat signal acquired by the bone conduction sensor 180M, so as to implement a heart rate detection function.
The keys 190 include a power-on key, a volume key, etc. The keys 190 may be mechanical keys. Or may be a touch key. The terminal device 100 may receive key inputs, generating key signal inputs related to user settings and function controls of the terminal device 100.
The motor 191 may generate a vibration cue. The motor 191 may be used for incoming call vibration alerting as well as for touch vibration feedback. For example, touch operations acting on different applications (e.g., photographing, audio playing, etc.) may correspond to different vibration feedback effects. The motor 191 may also correspond to different vibration feedback effects by touching different areas of the display screen 194. Different application scenarios (such as time reminding, receiving information, alarm clock, game, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect may also support customization.
The indicator 192 may be an indicator light, may be used to indicate a state of charge, a change in charge, a message indicating a missed call, a notification, etc.
The SIM card interface 195 is used to connect a SIM card. The SIM card may be contacted and separated from the terminal apparatus 100 by being inserted into the SIM card interface 195 or by being withdrawn from the SIM card interface 195. The terminal device 100 may support 1 or N SIM card interfaces, N being a positive integer greater than 1. The SIM card interface 195 may support Nano SIM cards, micro SIM cards, and the like. The same SIM card interface 195 may be used to insert multiple cards simultaneously. The types of the plurality of cards may be the same or different. The SIM card interface 195 may also be compatible with different types of SIM cards. The SIM card interface 195 may also be compatible with external memory cards. The terminal device 100 interacts with the network through the SIM card to realize functions such as call and data communication. In some embodiments, the terminal device 100 employs esims, namely: an embedded SIM card. The eSIM card can be embedded in the terminal device 100 and cannot be separated from the terminal device 100.
The software system of the terminal device 100 may employ a layered architecture, an event driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the application, taking an Android system with a layered architecture as an example, a software structure of the terminal device 100 is illustrated.
Fig. 2 is a block diagram illustrating a packet transmission hierarchy of a terminal device 100 according to an embodiment of the present application. The method for adjusting the MTU of the data packet provided by the embodiment of the application relates to a transmission link layer, and is not similar to an open system interconnection communication reference model (open system interconnection reference model, OSI) seven-layer model or five-layer structure of an intelligent system such as Linux or Android (Android), the Bluetooth data interaction of the wearable device is generally a Type Length Value (TLV) protocol message, and the Bluetooth data interaction is directly transmitted to a Bluetooth chip through the package and unpacking of the transmission link layer, and the data transmission is completed through a Bluetooth channel between the Bluetooth chip and a mobile phone, so that the whole transmission efficiency is embodied in the data packet interaction efficiency of the block of the transmission link layer.
The method for adjusting the MTU of the data packet according to the embodiment of the present application may be implemented by the processor 110 in the terminal device 100, and in this embodiment, the processor 110 may include the following two functional modules: and the MTU information acquisition module and the MTU adjustment module.
1) MTU information acquisition module
The MTU information acquisition module is mainly responsible for collecting information and providing an interface for the MTU adjustment module to use, and the event sources of interest of the module are described below.
Event 1:
after the terminal equipment 100 is started, after each application program installed in the terminal equipment 100 is started normally, the terminal equipment 100 counts the size of the residual memory RAM and sends the size to the MTU information acquisition module for recording, and the residual space of the RAM is reduced along with the increase of the load pressure of application use, so that the load pressure of the terminal equipment 100 can be reflected by the residual memory duty ratio after the terminal equipment 100 is started in real time, and if the load pressure is too high and the memory consumption is too high, the MTU can be temporarily regulated.
Event 2:
if the memory application fails, the terminal device 100 immediately reports an event to the MTU information acquisition module, and the MTU information acquisition module records the time of occurrence of the memory application failure event and is used for counting the number of memory application failures after the size of the MTU is adjusted for a certain time.
Event 3:
after the transmission link layer receives the packet loss retransmission of the data packet, the terminal device 100 reports the event to the MTU information acquisition module, and the MTU information acquisition module records the occurrence time of the packet loss retransmission event and is used for counting the number of packet loss retransmission times after the size of the MTU is adjusted for a certain time.
Event 4:
after the MTU adjustment module increases or decreases the MTU, the terminal device 100 sends the adjustment event to the MTU information acquisition module, where the MTU information acquisition module is configured to record an occurrence time of the MTU adjustment event.
2) MTU adjustment module
Some of the system parameter values that the module needs to set may be as shown in table 1:
TABLE 1
The MTU is only valid in the data transceiving process, so that the size of the MTU is adjusted in the data transceiving process in this embodiment. The specific adjustment flow may include:
1. and (3) reducing the processing flow:
1) The terminal device 100 first determines whether to reduce the MTU, and if the number of times of memory application failure and the number of times of packet loss are greater than a threshold after the MTU is adjusted last time, if so, the size of the MTU after adjustment indicates that the memory occupation is excessive in the data transceiving process after the MTU is adjusted last time, and the MTU needs to be reduced to release the pressure brought by the MTU being enlarged last time to the terminal device 100.
2) If the MTU needs to be reduced, two MTUStepSize can be adjusted downwards to realize quick reduction of the MTU, so as to shorten the time of problem caused by the increase of the MTU.
2. And (3) a step of adjusting the process flow:
1) Frequent MTU adjustment is avoided, so that the MTU is frequently fluctuated, the MTU is judged according to the adjustment threshold, and the next adjustment processing is allowed only after the adjustment is more than AdjustIntervalTime intervals (namely the preset adjustment time intervals) from the last time.
2) Whether the current residual memory is insufficient or not is judged, the current strategy is to see the current residual memory of the terminal equipment 100, and if the current residual memory is smaller than 10% compared with the residual memory after the terminal equipment 100 is started, the current terminal equipment 100 is higher in load and overlarge in memory consumption, and the MTU is not suitable to be regulated.
3) Because the purpose of scaling up the MTU is to increase the payload of the data transmission process and increase the data transmission rate, if the current data transmission rate reaches or exceeds MaxDataSpeed, the MTU is not scaled up anymore because the benefit of the scaling is not large.
4) If the MTU is allowed to be scaled up, one MTUStepSize is scaled up and the scaled MTU is less than or equal to MaxMTUSize.
The MTU adjustment success event needs to be reported to the MTU information acquisition module whenever adjustment is successful, because error statistics of each round is calculated based on the adjustment time of the MTU, the influence caused by the adjustment of the round is considered, the influence caused by the adjustment should be quickly reflected in the current adjustment decision, and the adjustment sensitivity is enhanced.
For easy understanding, the following embodiments of the present application will take the terminal device 100 having the structure shown in fig. 1 and fig. 2 as an example, and specifically describe the method for adjusting the MTU of the data packet provided in the embodiments of the present application in conjunction with the accompanying drawings and application scenarios.
Fig. 3 is a flowchart of a method for adjusting a data packet MTU according to an embodiment of the present application, where, as shown in fig. 3, the method for adjusting a data packet MTU may include:
In step 301, the terminal device 100 obtains the first time of last adjustment of the size of the MTU, and obtains the number of memory application failures and the number of packet losses after the first time.
In step 302, if the number of memory application failures is less than or equal to a preset memory application failure number threshold, and the number of packet losses is less than or equal to a preset packet loss number threshold, the terminal device 100 obtains a time interval between the current time and the first time, a current remaining available memory duty ratio, and a current data transmission rate.
The duty ratio of the current residual available memory comprises the ratio of the current residual available memory to the initial residual available memory after the terminal equipment is started.
In step 303, the terminal device 100 increases the size of the MTU according to the time interval between the current time and the first time, the duty cycle of the current remaining available memory, and the current data transmission rate.
Specifically, increasing the size of the MTU according to the time interval between the current time and the first time, the current remaining available memory duty cycle, and the current data transmission rate may be: if the interval between the current time and the first time is larger than the preset adjustment time interval, the duty ratio of the current residual available memory is larger than or equal to the preset duty ratio, and the current data transmission rate is smaller than or equal to the preset transmission rate threshold value, the size of the MTU is increased.
Wherein, increasing the size of the MTU may be: the size of the MTU is adjusted upwards by a first preset number of preset step sizes. The first predetermined number may be set by itself according to system performance and/or implementation requirements, and the size of the first predetermined number is not limited in this embodiment, for example, the first predetermined number may be 1.
In this embodiment, after increasing the size of the MTU, the terminal device 100 records the time of adjusting the size of the MTU for use in the next adjustment of the MTU.
Further, after increasing the size of the MTU in step 303, if the size of the MTU after the increase is greater than the maximum value of the predetermined MTU, the terminal device 100 may reset the size of the MTU to the maximum value of the predetermined MTU, that is, maxMTUSize in table 1, that is, the maximum size of the MTU cannot exceed the maximum value of the predetermined MTU in this embodiment, and if the size of the MTU after the increase is greater than the maximum value of the predetermined MTU, the terminal device 100 may reset the size of the MTU to the maximum value of the predetermined MTU. Also, after resetting the MTU, the terminal device 100 needs to record the time of resetting the MTU for use in the next adjustment of the MTU.
In the method for adjusting the MTU of the data packet, the terminal device 100 obtains the first time when the MTU is adjusted last time, and obtains the number of memory application failures and the number of packet losses after the first time, if the number of memory application failures is smaller than or equal to a preset threshold of memory application failures and the number of packet losses is smaller than or equal to a preset threshold of packet losses, the terminal device 100 obtains a time interval between the current time and the first time, a ratio of the current remaining available memory and a current data transmission rate, and the terminal device 100 increases the size of the MTU according to the time interval between the current time and the first time, the ratio of the current remaining available memory and the current data transmission rate, so that the MTU can be dynamically adjusted based on indexes such as the current remaining available memory size, the number of memory allocation failures and the number of packet losses retransmission, so that the data transmission efficiency can be greatly improved, and the service stability can be further improved.
Fig. 4 is a flowchart of a method for adjusting an MTU of a data packet according to another embodiment of the present application, as shown in fig. 4, in the embodiment of fig. 3 of the present application, after step 301, the method may further include:
in step 401, if the number of memory application failures is greater than the predetermined threshold number of memory application failures, or the number of packet losses is greater than the predetermined threshold number of packet losses, the terminal device 100 decreases the size of the MTU.
Specifically, reducing the size of the MTU may be: the size of the MTU is reduced downwards by a second preset number of preset step sizes. The second predetermined number may be set by the user when the second predetermined number is actually implemented, and the size of the second predetermined number is not limited in this embodiment, for example, the second predetermined number may be 2; that is, when the size of the MTU is reduced, 2 predetermined steps are downwardly adjusted to achieve rapid MTU reduction in order to shorten the time in which problems occur due to the MTU being enlarged.
Further, after step 401, if the size of the reduced MTU is smaller than the predetermined minimum value of the MTU, the size of the MTU is reset to the predetermined minimum value of the MTU, that is, initMTUSize in table 1, that is, in this embodiment, the size of the MTU cannot be smaller than the predetermined minimum value of the MTU, and if the size of the reduced MTU is smaller than the predetermined minimum value of the MTU, the terminal device 100 may reset the size of the MTU to the predetermined minimum value of the MTU. Also, after resetting the MTU, the terminal device 100 needs to record the time of resetting the MTU for use in the next adjustment of the MTU.
It is to be understood that some or all of the steps or operations in the above-described embodiments are merely examples, and that embodiments of the present application may also perform other operations or variations of the various operations. Furthermore, the various steps may be performed in a different order presented in the above embodiments, and it is possible that not all of the operations in the above embodiments are performed.
It will be appreciated that the terminal device, in order to achieve the above-described functions, comprises corresponding hardware and/or software modules for performing the respective functions. The various exemplary algorithm steps described in connection with the disclosed embodiments of the application may be embodied in hardware or in a combination of hardware and computer software. Whether a function is implemented as hardware or computer software driven hardware depends upon the particular application and design constraints imposed on the solution. Those skilled in the art may implement the described functionality using different approaches for each particular application in conjunction with the embodiments, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In this embodiment, the terminal device may be divided into functional modules according to the above embodiment of the method, for example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one module. The integrated modules described above may be implemented in hardware. It should be noted that, in this embodiment, the division of the modules is schematic, only one logic function is divided, and another division manner may be implemented in actual implementation.
Fig. 5 is a schematic structural diagram of a terminal device according to another embodiment of the present application, where, in a case where respective functional modules are divided by corresponding respective functions, fig. 5 shows a possible schematic structural diagram of a terminal device 500 related to the foregoing embodiment, as shown in fig. 5, the terminal device 500 may include: an MTU information acquisition module 501 and an MTU adjustment module 502;
the MTU information obtaining module 501 is configured to obtain a first time when the size of the MTU is adjusted last time, and obtain the number of times of memory application failure and the number of packet loss after the first time; if the number of the memory application failures is smaller than or equal to a preset memory application failure number threshold, and the number of the lost packets is smaller than or equal to a preset packet loss number threshold, acquiring a time interval from the current moment to the first moment, a current remaining available memory duty ratio and a current data transmission rate; the current remaining available memory ratio comprises the ratio of the current remaining available memory to the initial remaining available memory after the terminal equipment is started;
The MTU adjusting module 502 is configured to increase the size of the MTU according to the time interval between the current time and the first time, the duty ratio of the current remaining available memory, and the current data transmission rate.
The MTU adjustment module 502 is specifically configured to increase the size of the MTU when the interval between the current time and the first time is greater than a predetermined adjustment time interval, the duty cycle of the current remaining available memory is greater than or equal to a predetermined duty cycle, and the current data transmission rate is less than or equal to a predetermined transmission rate threshold. Specifically, the MTU adjustment module 502 is specifically configured to adjust the size of the MTU upward by a first predetermined number of predetermined steps.
Further, the MTU adjustment module 502 is further configured to, after increasing the size of the MTU, reset the size of the MTU to the predetermined maximum value of the MTU if the size of the MTU after the increase is greater than the predetermined maximum value of the MTU.
Further, the MTU adjustment module 502 is further configured to reduce the size of the MTU if the number of memory application failures is greater than a predetermined threshold number of memory application failures or the number of packet losses is greater than a predetermined threshold number of packet losses after the MTU information obtaining module 501 obtains the number of memory application failures and the number of packet losses after the first time. Specifically, the MTU adjustment module 502 is specifically configured to adjust the size of the MTU by a second predetermined number of predetermined steps.
Further, the MTU adjustment module 502 is further configured to, after reducing the size of the MTU, reset the size of the MTU to the predetermined minimum value of the MTU if the reduced size of the MTU is smaller than the predetermined minimum value of the MTU.
Further, the MTU information obtaining module 501 is further configured to record, after the MTU adjusting module 502 adjusts the size of the MTU, a time for adjusting the size of the MTU.
It should be noted that, all relevant contents of each step related to the above method embodiment may be cited to the functional description of the corresponding functional module, which is not described herein.
The terminal device 500 provided in this embodiment is configured to perform the method for adjusting the MTU of the data packet according to the embodiment shown in fig. 3 and fig. 4, so that the same effects as those of the method described above can be achieved.
It should be understood that the terminal device 500 may correspond to the terminal device 100 shown in fig. 1. The functions of the MTU information acquisition module 501 and the MTU adjustment module 502 may be implemented by the processor 110 in the terminal device 100 shown in fig. 1.
In case of employing an integrated unit, the terminal device 500 may include a processing module, a storage module, and a communication module.
The processing module may be configured to control and manage the actions of the terminal device 500, for example, may be configured to support the terminal device 500 to perform the steps performed by the MTU information obtaining module 501 and the MTU adjusting module 502. The memory module may be used to support the terminal device 500 to store program codes, data, and the like. A communication module, which may be used to support communication between the terminal device 1500 and other devices.
Wherein the processing module may be a processor or controller that may implement or execute the various exemplary logic blocks, modules and circuits described in connection with the present disclosure. A processor may also be a combination that performs computing functions, e.g., including one or more microprocessors, digital Signal Processing (DSP) and a combination of microprocessors, and the like. The memory module may be a memory. The communication module may specifically be a radio frequency circuit, a bluetooth chip, a Wi-Fi chip, or other devices that interact with other electronic devices.
In an embodiment, when the processing module is a processor and the storage module is a memory, the terminal device 500 according to this embodiment may be a device having the structure shown in fig. 1.
Embodiments of the present application also provide a computer readable storage medium having a computer program stored therein, which when run on a computer causes the computer to perform the method provided by the embodiments of the present application shown in fig. 3 to 4.
Embodiments of the present application also provide a computer program product comprising a computer program which, when run on a computer, causes the computer to perform the method provided by the embodiments of the present application shown in fig. 3-4.
In the embodiments of the present application, "at least one" means one or more, and "a plurality" means two or more. "and/or", describes an association relation of association objects, and indicates that there may be three kinds of relations, for example, a and/or B, and may indicate that a alone exists, a and B together, and B alone exists. Wherein A, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship. "at least one of the following" and the like means any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c may represent: a, b, c, a and b, a and c, b and c or a and b and c, wherein a, b and c can be single or multiple.
Those of ordinary skill in the art will appreciate that the various elements and algorithm steps described in the embodiments disclosed herein can be implemented as a combination of electronic hardware, computer software, and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, and are not repeated herein.
In several embodiments provided by the present application, any of the functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a read-only memory (ROM), a random access memory (random access memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely exemplary embodiments of the present application, and any person skilled in the art may easily conceive of changes or substitutions within the technical scope of the present application, which should be covered by the present application. The protection scope of the present application shall be subject to the protection scope of the claims.

Claims (16)

1. The method for adjusting the maximum transmission unit MTU of the data packet is characterized by comprising the following steps:
the terminal equipment acquires a first moment for adjusting the size of the MTU last time, and acquires the number of memory application failures and the number of packet losses after the first moment;
If the number of the memory application failures is smaller than or equal to a preset memory application failure number threshold, and the number of the lost packets is smaller than or equal to a preset packet loss number threshold, acquiring a time interval from the current moment to the first moment, a current remaining available memory duty ratio and a current data transmission rate; the current remaining available memory ratio comprises the ratio of the current remaining available memory to the initial remaining available memory after the terminal equipment is started;
Increasing the size of the MTU according to the time interval between the current time and the first time, the current remaining available memory duty ratio and the current data transmission rate;
wherein increasing the size of the MTU according to the time interval between the current time and the first time, the duty ratio of the current remaining available memory, and the current data transmission rate includes:
And if the interval between the current time and the first time is larger than a preset adjustment time interval, the duty ratio of the current residual available memory is larger than or equal to a preset duty ratio, and the current data transmission rate is smaller than or equal to a preset transmission rate threshold value, increasing the size of the MTU.
2. The method of claim 1, wherein the increasing the size of the MTU comprises:
the size of the MTU is adjusted upward by a first predetermined number of predetermined steps.
3. The method of claim 1, wherein after the increasing the size of the MTU, further comprising:
And if the size of the MTU after the increase is larger than the maximum value of the preset MTU, resetting the size of the MTU to the maximum value of the preset MTU.
4. The method of claim 1, wherein the obtaining the number of memory application failures and the number of packet losses after the first time further comprises:
and if the number of the memory application failures is larger than a preset memory application failure number threshold, or the number of the lost packets is larger than a preset packet loss number threshold, reducing the size of the MTU.
5. The method of claim 4, wherein the reducing the size of the MTU comprises:
The size of the MTU is reduced downward by a second predetermined number of predetermined steps.
6. The method of claim 4, wherein the reducing the size of the MTU further comprises:
And if the size of the MTU after the reduction is smaller than the minimum value of the preset MTU, resetting the size of the MTU to the minimum value of the preset MTU.
7. The method of any one of claims 1-6, further comprising:
after the size of the MTU is adjusted, the moment of adjusting the size of the MTU is recorded.
8. An adjustment device for a maximum transmission unit MTU of a data packet, which is provided in a terminal device, comprising:
The MTU information acquisition module is used for acquiring a first moment for adjusting the size of the MTU last time and acquiring the number of memory application failures and the number of packet losses after the first moment; if the number of the memory application failures is smaller than or equal to a preset memory application failure number threshold, and the number of the lost packets is smaller than or equal to a preset packet loss number threshold, acquiring a time interval from the current moment to the first moment, a current remaining available memory duty ratio and a current data transmission rate; the current remaining available memory ratio comprises the ratio of the current remaining available memory to the initial remaining available memory after the terminal equipment is started;
the MTU adjusting module is used for increasing the size of the MTU according to the time interval between the current moment and the first moment, the duty ratio of the current residual available memory and the current data transmission rate;
The MTU adjusting module is specifically configured to increase the size of the MTU when the interval between the current time and the first time is greater than a predetermined adjusting time interval, the duty ratio of the current remaining available memory is greater than or equal to a predetermined duty ratio, and the current data transmission rate is less than or equal to a predetermined transmission rate threshold.
9. A terminal device, comprising:
One or more processors; a memory; a plurality of applications; and one or more computer programs, wherein the one or more computer programs are stored in the memory, the one or more computer programs comprising instructions, which when executed by the terminal device, cause the terminal device to perform the steps of:
acquiring a first moment for adjusting the size of the MTU last time, and acquiring the number of memory application failures and the number of packet losses after the first moment;
If the number of the memory application failures is smaller than or equal to a preset memory application failure number threshold, and the number of the lost packets is smaller than or equal to a preset packet loss number threshold, acquiring a time interval from the current moment to the first moment, a current remaining available memory duty ratio and a current data transmission rate; the current remaining available memory ratio comprises the ratio of the current remaining available memory to the initial remaining available memory after the terminal equipment is started;
Increasing the size of the MTU according to the time interval between the current time and the first time, the current remaining available memory duty ratio and the current data transmission rate;
wherein when the instruction is executed by the terminal device, the step of causing the terminal device to execute the step of increasing the size of the MTU according to the time interval from the current time to the first time, the duty cycle of the current remaining available memory, and the current data transmission rate includes:
And if the interval between the current time and the first time is larger than a preset adjustment time interval, the duty ratio of the current residual available memory is larger than or equal to a preset duty ratio, and the current data transmission rate is smaller than or equal to a preset transmission rate threshold value, increasing the size of the MTU.
10. The terminal device of claim 9, wherein the instructions, when executed by the terminal device, cause the terminal device to perform the step of increasing the size of the MTU comprises:
the size of the MTU is adjusted upward by a first predetermined number of predetermined steps.
11. The terminal device of claim 9, wherein the instructions, when executed by the terminal device, cause the terminal device to perform the step of increasing the size of the MTU, further comprising:
And if the size of the MTU after the increase is larger than the maximum value of the preset MTU, resetting the size of the MTU to the maximum value of the preset MTU.
12. The terminal device of claim 9, wherein the instructions, when executed by the terminal device, cause the terminal device to perform the step of obtaining the number of memory application failures and the number of packet losses after the first time, further perform the steps of:
and if the number of the memory application failures is larger than a preset memory application failure number threshold, or the number of the lost packets is larger than a preset packet loss number threshold, reducing the size of the MTU.
13. The terminal device of claim 12, wherein the instructions, when executed by the terminal device, cause the terminal device to perform the step of reducing the size of the MTU comprises:
The size of the MTU is reduced downward by a second predetermined number of predetermined steps.
14. The terminal device of claim 12, wherein the instructions, when executed by the terminal device, cause the terminal device to perform the step of reducing the size of the MTU, further comprising:
And if the size of the MTU after the reduction is smaller than the minimum value of the preset MTU, resetting the size of the MTU to the minimum value of the preset MTU.
15. A terminal device according to any of claims 9-14, characterized in that the instructions, when executed by the terminal device, cause the terminal device to further perform the steps of:
after the size of the MTU is adjusted, the moment of adjusting the size of the MTU is recorded.
16. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program which, when run on a computer, causes the computer to perform the method according to any of claims 1-7.
CN202211184760.3A 2022-09-27 2022-09-27 Data packet MTU adjustment method and device and terminal equipment Active CN116708317B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211184760.3A CN116708317B (en) 2022-09-27 2022-09-27 Data packet MTU adjustment method and device and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211184760.3A CN116708317B (en) 2022-09-27 2022-09-27 Data packet MTU adjustment method and device and terminal equipment

Publications (2)

Publication Number Publication Date
CN116708317A CN116708317A (en) 2023-09-05
CN116708317B true CN116708317B (en) 2024-05-14

Family

ID=87842065

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211184760.3A Active CN116708317B (en) 2022-09-27 2022-09-27 Data packet MTU adjustment method and device and terminal equipment

Country Status (1)

Country Link
CN (1) CN116708317B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103067791A (en) * 2012-12-11 2013-04-24 深圳市梦网科技发展有限公司 Network dynamic adaptation monitoring video transmission method
CN103647724A (en) * 2013-12-30 2014-03-19 大唐移动通信设备有限公司 Adaptation method and device of maximum transmission unit (MTU)
CN109981487A (en) * 2019-03-27 2019-07-05 北京邮电大学 A kind of data dispatching method, device, electronic equipment and readable storage medium storing program for executing
CN115037700A (en) * 2022-04-29 2022-09-09 北京龙腾佳讯科技股份公司 Complex network data packet transmission method, system, terminal and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103067791A (en) * 2012-12-11 2013-04-24 深圳市梦网科技发展有限公司 Network dynamic adaptation monitoring video transmission method
CN103647724A (en) * 2013-12-30 2014-03-19 大唐移动通信设备有限公司 Adaptation method and device of maximum transmission unit (MTU)
CN109981487A (en) * 2019-03-27 2019-07-05 北京邮电大学 A kind of data dispatching method, device, electronic equipment and readable storage medium storing program for executing
CN115037700A (en) * 2022-04-29 2022-09-09 北京龙腾佳讯科技股份公司 Complex network data packet transmission method, system, terminal and storage medium

Also Published As

Publication number Publication date
CN116708317A (en) 2023-09-05

Similar Documents

Publication Publication Date Title
CN110347269B (en) Empty mouse mode realization method and related equipment
CN113810601B (en) Terminal image processing method and device and terminal equipment
CN112806092B (en) Microphone MIC switching method and device
CN114422340B (en) Log reporting method, electronic equipment and storage medium
CN113126948B (en) Audio playing method and related equipment
WO2022262492A1 (en) Data downloading method and apparatus, and terminal device
CN113596919B (en) Data downloading method and device and terminal equipment
CN115665632B (en) Audio circuit, related device and control method
CN111935705A (en) Data service management method and device, computer readable medium and terminal equipment
CN109285563B (en) Voice data processing method and device in online translation process
CN115389927B (en) Method and system for measuring and calculating motor damping
CN114915747B (en) Video call method, electronic device and readable storage medium
CN117093068A (en) Vibration feedback method and system based on wearable device, wearable device and electronic device
CN116708317B (en) Data packet MTU adjustment method and device and terminal equipment
CN113678481B (en) Wireless audio system, audio communication method and equipment
CN115706869A (en) Terminal image processing method and device and terminal equipment
CN113674258A (en) Image processing method and related equipment
CN116048769B (en) Memory recycling method and device and terminal equipment
CN116667875B (en) Switching method and device of internet access and terminal equipment
CN114520870B (en) Display method and terminal
CN113364067B (en) Charging precision calibration method and electronic equipment
CN115550892B (en) Method and device for synchronizing system information
CN112996066B (en) Network residing method and related equipment
WO2023020420A1 (en) Volume display method, electronic device, and storage medium
CN116489684A (en) Method, device and terminal equipment for determining radio link failure of side link

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant