Data transmission method, device and electronic equipment

By adjusting the MTU value of electronic devices in speed testing scenarios, the problem of reduced transmission rate caused by packet fragmentation is solved, the data transmission rate is improved, compatibility is ensured, and more efficient data transmission is achieved.

CN119255286BActive Publication Date: 2025-09-05HONOR DEVICE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410212802.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-26
Publication Date
2025-09-05
Estimated Expiration
2044-02-26

AI Technical Summary

Technical Problem

When electronic devices send data packets within the MTU limit, packet fragmentation reduces the transmission rate, causing the average throughput to fall below the standard and affecting the user experience.

Method used

Adjust the MTU value of electronic devices in the speed test scenario. Determine whether to enter the target scenario by checking conditions such as application and transmission rate. Adjust the MTU value if necessary to increase the transmission rate. After leaving the speed test scenario, restore the default MTU value to avoid compatibility issues.

Benefits of technology

This improves the data transmission rate of electronic devices in speed measurement scenarios, avoids network resource waste and congestion caused by MTU value adjustment, and ensures compatibility in non-speed measurement scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119255286B_ABST
    Figure CN119255286B_ABST
Patent Text Reader

Abstract

The present application provides a data transmission method, apparatus, and electronic device, the method comprising: an electronic device transmitting data based on a first maximum transmission unit (MTU) value; the electronic device determining whether it has entered a target scenario that triggers adjustment of the MTU value; and, in response to the electronic device entering the target scenario, the electronic device transmitting data based on a second MTU value, the second MTU value being greater than the first MTU value. The technical solution presented in the present application, by adjusting the MTU value of the electronic device in a speed measurement scenario, can increase the data transmission rate of the electronic device in the speed measurement scenario, thereby ensuring that the average throughput of the electronic device meets the required standards.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of electronic equipment, and in particular to a data transmission method, device and electronic equipment. Background Art

[0002] A Maximum Transmission Unit (MTU) is usually set by default in electronic devices. The MTU refers to the maximum size of a data packet that can be transmitted in an unsegmented manner over a network connection, usually in bytes.

[0003] Electronic devices need to send data packets within the MTU limit. If the size of a data packet exceeds the MTU, the electronic device needs to fragment the data packet, that is, split one data packet into two data packets. In this way, the rate at which the electronic device transmits data packets is reduced, resulting in the average throughput of the electronic device not meeting the standard, affecting the user experience. Summary of the Invention

[0004] The embodiments of the present application provide a data transmission method, apparatus, and electronic device, which improve the data transmission rate of the electronic device in a speed measurement scenario and solve the problem of the average throughput rate of the electronic device not meeting the standard.

[0005] In a first aspect, an embodiment of the present application provides a data transmission method, which is applied to an electronic device, the method comprising: the electronic device transmits data based on a first maximum transmission unit MTU value; the electronic device determines whether it enters a target scenario that triggers adjustment of the MTU value; in response to the electronic device entering the target scenario, the electronic device transmits data based on a second MTU value, and the second MTU value is greater than the first MTU value.

[0006] The data transmission method shown in the embodiment of the present application can increase the data transmission rate of the electronic device in a speed measurement scenario by adjusting the MTU value of the electronic device in a speed measurement scenario.

[0007] In one implementation, the electronic device further includes: determining whether to leave the target scenario; and in response to the electronic device leaving the target scenario, transmitting data based on the first MTU value. With this implementation, after leaving the speed measurement scenario, the electronic device can restore the default MTU value, avoiding compatibility issues in scenarios other than the speed measurement scenario.

[0008] In one implementation, an electronic device determines whether it has entered a target scenario that triggers MTU value adjustment, including: upon the electronic device detecting that a first application is on a preset whitelist, determining that it has entered the target scenario, wherein the first application is an application currently running in the foreground, and the preset whitelist includes at least one application for measuring the rate at which the electronic device transmits data. Using this implementation, the electronic device can determine whether it has entered a speed measurement scenario based on detecting whether the first application is on the preset whitelist, thereby facilitating adjustment of the electronic device's MTU value in the speed measurement scenario.

[0009] In one implementation, determining whether an electronic device has entered a target scenario that triggers MTU value adjustment includes: the electronic device obtaining a data transmission rate; and determining that the electronic device has entered the target scenario when the rate is greater than a first threshold. In this implementation, the electronic device can determine whether it has entered a speed measurement scenario based on determining whether the data transmission rate is greater than the first threshold, thereby facilitating adjustment of the electronic device's MTU value in the speed measurement scenario.

[0010] In one implementation, an electronic device determines whether it has entered a target scenario that triggers MTU value adjustment, including: the electronic device obtains a data transmission rate, a total number of data packets transmitted based on the rate, and a first number corresponding to target data packets in the data packets, wherein the packet size of the target data packets is greater than a first MTU value; when the rate is greater than a first threshold and a first ratio is greater than a second threshold, the electronic device determines that it has entered the target scenario, where the first ratio is the ratio of the first number to the total number. Using this implementation, the electronic device can determine whether it has entered a speed measurement scenario based on determining whether the data transmission rate is greater than the first threshold and whether the first ratio is greater than the second threshold, so as to adjust the MTU value of the electronic device in the speed measurement scenario.

[0011] In one implementation, the electronic device determines whether to leave the target scene, including: when the electronic device detects that the first application in the preset whitelist switches from foreground operation to background operation, the electronic device determines to leave the target scene; or when the electronic device detects that the first application is not in the preset whitelist, the electronic device determines to leave the target scene. Using this implementation, the electronic device can determine whether to leave the speed measurement scene based on whether the first application in the preset whitelist switches to the background, or whether the first application is not in the preset whitelist, so that the electronic device can restore the default first MTU value after leaving the speed measurement scene, avoiding compatibility issues of the electronic device in scenarios other than the speed measurement scene.

[0012] In one implementation, in response to the electronic device leaving the target scene, the electronic device transmits data based on the first MTU value, including: in response to the electronic device leaving the target scene, the electronic device transmits data based on the first MTU value after a first delay period. Using this implementation, the electronic device can avoid network issues caused by ping-pong settings by restoring the default first MTU value after the first delay period after leaving the speed measurement scene. Network issues caused by ping-pong settings generally refer to waste of network resources and congestion caused by round-trip data packet transmission.

[0013] In one implementation, the electronic device determines whether to leave the target scenario, including: when the rate is less than or equal to a first threshold, the electronic device determines to leave the target scenario. With this implementation, the electronic device can determine whether to leave the speed measurement scenario based on whether the rate of transmitted data is less than or equal to the first threshold. This allows the electronic device to restore the default first MTU value after leaving the speed measurement scenario, thereby avoiding compatibility issues with the electronic device in scenarios other than the speed measurement scenario.

[0014] In one implementation, the electronic device determines whether to leave the target scenario, including: when the rate is less than or equal to a first threshold, and / or the first ratio is less than or equal to a second threshold, the electronic device determines to leave the target scenario. Using this implementation, the electronic device can determine whether to leave the speed measurement scenario based on determining whether the data transmission rate is less than or equal to the first threshold, and / or determining whether the first ratio is less than or equal to the second threshold. This allows the electronic device to restore the default first MTU value after leaving the speed measurement scenario, thereby avoiding compatibility issues with the electronic device in scenarios other than the speed measurement scenario.

[0015] In one implementation, the electronic device transmits data based on the first MTU value, including: the kernel layer of the electronic device transmits data based on the first MTU value. This implementation illustrates a specific method for transmitting data at the software level of the electronic device in a speed measurement scenario.

[0016] In one implementation, determining whether an electronic device has entered a target scenario that triggers MTU value adjustment includes: determining, by a processor of the electronic device, whether the electronic device has entered the target scenario. This implementation illustrates a specific method for determining whether an electronic device has entered the target scenario at the software level in a speed measurement scenario.

[0017] In one implementation, in response to the electronic device entering a target scenario, the electronic device transmits data based on a second MTU value, including: in response to the electronic device entering the target scenario, the processor generates a first instruction and sends the first instruction to the kernel layer; and the kernel layer transmits data based on the second MTU value in response to the first instruction. This implementation demonstrates a specific method for adjusting the electronic device's MTU value at the software level in a speed measurement scenario, thereby increasing the data transmission rate of the electronic device in this scenario.

[0018] In one implementation, the electronic device determines whether it has left the target scene, including: a processor determines whether the electronic device has left the target scene. This implementation illustrates a specific method for the electronic device to determine whether it has entered the target scene at the software level in a speed measurement scenario.

[0019] In one implementation, in response to the electronic device leaving a target scenario, the electronic device transmits data based on a first MTU value, including: in response to the electronic device leaving the target scenario, the processor generates a second instruction and sends the second instruction to the kernel layer; and the kernel layer transmits data based on the first MTU value in response to the second instruction. This implementation illustrates a specific method for restoring the default MTU value at the software level after leaving a speed measurement scenario, thereby avoiding compatibility issues in scenarios other than speed measurement.

[0020] In a second aspect, an embodiment of the present application provides a data transmission device, which is applied to an electronic device, and the device includes: a first transmission module, which is used to transmit data based on a first maximum transmission unit MTU value; a scene recognition module, which is used to determine whether the electronic device enters a target scene that triggers adjustment of the MTU value; the first transmission module is also used to transmit data based on a second MTU value in response to the electronic device entering the target scene, and the second MTU value is greater than the first MTU value.

[0021] The data transmission device shown in the embodiment of the present application can increase the data transmission rate of the electronic device in the speed measurement scenario by adjusting the MTU value of the electronic device in the speed measurement scenario.

[0022] In a third aspect, an embodiment of the present application provides an electronic device comprising: a processor and a memory; the memory stores program instructions, and when the program instructions are executed by the processor, the electronic device executes the data transmission method as described in the first aspect and any implementation thereof.

[0023] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on an electronic device, the electronic device executes the data transmission method as described in the first aspect and any implementation thereof.

[0024] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes the data transmission method as described in the first aspect and any implementation thereof.

[0025] It can be understood that the electronic devices, computer-readable storage media and computer program products provided in the above aspects are all applied to the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the technical solution of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0027] Figure 1 It is a schematic diagram of the data packet transmission scenario;

[0028] Figure 2 Schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application;

[0029] Figure 3 is a schematic diagram of the software structure of the electronic device provided in an embodiment of the present application;

[0030] Figure 4 is a flowchart of a data transmission method provided in an embodiment of the present application;

[0031] Figure 5 This is an interactive diagram of the data transmission method provided in an embodiment of the present application;

[0032] Figure 6 is another flow chart of the data transmission method provided in an embodiment of the present application;

[0033] Figure 7 This is another interactive diagram of the data transmission method provided in an embodiment of the present application;

[0034] Figure 8 is another flow chart of the data transmission method provided in an embodiment of the present application;

[0035] Figure 9 This is another interactive schematic diagram of the data transmission method provided in an embodiment of the present application;

[0036] Figure 10 is another flow chart of the data transmission method provided in an embodiment of the present application;

[0037] Figure 11is a structural diagram of a data transmission device provided in an embodiment of the present application;

[0038] Figure 12 It is a structural diagram of a data transmission device provided in another embodiment of the present application. DETAILED DESCRIPTION

[0039] The technical solutions of the embodiments of the present application will be clearly described below in conjunction with the drawings in the embodiments of the present application.

[0040] In the description of this application, unless otherwise specified, " / " means "or", for example, A / B can mean A or B. "And / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, "at least one" means one or more, and "a plurality" means two or more. Words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not limit them to be necessarily different.

[0041] It should be noted that, in this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described in this application as "exemplary" or "for example" should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0042] The following first describes the application scenarios of the embodiments of the present application with reference to the accompanying drawings.

[0043] The method provided in the embodiment of the present application can be applied in data packet transmission scenarios.

[0044] A data packet is the basic unit of data transmission in network communications. It can divide data into small blocks and encapsulate them in a structure of a specific format to facilitate data transmission and exchange.

[0045] Data packets can be transmitted over wired or wireless networks. A wired network uses physical cables, such as copper wire or optical fiber, as a transmission medium. Wired networks convert data signals into electrical or optical signals for transmission. A wireless network uses radio waves for data transmission. These typically include wireless fidelity (Wi-Fi) networks and cellular mobile networks (such as 4G and 5G networks). Wireless networks convert data signals into wireless signals for transmission.

[0046] Figure 1 It is a schematic diagram of the data packet transmission scenario.

[0047] like Figure 1 As shown in (a) of Figure 1, a data packet transmission scenario can involve multiple electronic devices, such as electronic device A, electronic device B, and electronic device C. Based on the direction of data packet transmission from one electronic device to another, electronic devices can be divided into sending devices, transfer devices, and receiving devices. For example, electronic device A can serve as the sending device, electronic device B can serve as the transfer device, and electronic device C can serve as the receiving device.

[0048] The transmission process on a Wi-Fi network involving a sending device, a transfer device, and a receiving device is used as an example. The sending device is the device that sends data packets and can be a mobile phone 10, a tablet computer, a wearable device, etc. The transfer device is a device that can act as a transfer station for wireless signal transmission and can be a router 20, a switch, etc. The receiving device is the device that receives data packets and can be a mobile phone, a server 30, etc.

[0049] like Figure 1 As shown in (b), the transmission process of a sending device, a transfer device, and a receiving device in a cellular mobile network is exemplified, wherein the sending device can be a mobile phone 10, the transfer device can be a base station 40, and the receiving device can be a server 30.

[0050] In the following embodiments of the present application, the sending device is a mobile phone 10, the transfer device is a router 20, and the receiving device is a server 30 for exemplary description, but it does not constitute a specific limitation on the device types of the sending device, the transfer device, and the receiving device.

[0051] In this way, the sending device can transmit the data packet through the network via at least one transit device to forward the data packet to the receiving device. The receiving device will parse the header information in the data packet and extract the data in the payload from the data packet.

[0052] During data packet transmission, mobile phone 10 typically sends data packets within the limits of its corresponding Maximum Transmission Unit (MTU). The MTU refers to the maximum size of a data packet transmitted unfragmented over a network connection, typically measured in bytes. Mobile phone 10 typically has a default MTU value, typically determined by network standards or the default configuration of the operating system. When mobile phone 10 needs to send a data packet, it sets the packet size based on the default MTU value. Accordingly, router 20 receives and forwards data packets within the limits of its corresponding MTU. Different models of routers 20 may have different default MTU values, typically determined by network standards or the vendor's default configuration. The default MTU value in router 20 is typically set to a value suitable for most network conditions to provide good performance and compatibility. For example, the MTU value of router 20 can be set to 1500 bytes. However, in some virtual private networks (VPNs), router 20 may need to be set to a smaller MTU value to avoid data packet fragmentation and latency. For example, in VPN, the MTU value of router 20 is set to 1400 bytes.

[0053] When the mobile phone 10 sends a data packet with a large MTU value to the router 20, the router 20 may refuse to forward the data packet with a large MTU value due to its own insufficient processing capacity. If the MTU value is too small, the rate at which the mobile phone 10 transmits data packets will be affected.

[0054] In other words, the default MTU value of the mobile phone 10 needs to be compatible with the default MTU value of the router 20. To make the default MTU value of the mobile phone 10 compatible with different models of routers 20, if the MTU value of the router 20 can be 1500 bytes or 1400 bytes, the default MTU value of the mobile phone 10 generally needs to be set to 1400 bytes so that the router 20 can receive data packets transmitted by the mobile phone 10 at the maximum MTU value.

[0055] If the default MTU value of mobile phone 10 is 1400 bytes and a 1430-byte data packet needs to be transmitted, mobile phone 10 will fragment the 1430-byte data packet to accommodate the MTU. Fragmentation refers to the process of breaking a larger data packet into smaller segments. Specifically, a 1430-byte data packet can be split into a 1400-byte data packet and a 30-byte data packet to accommodate the default MTU value of mobile phone 10. This fragmentation reduces the data packet transmission rate of mobile phone 10 by half.

[0056] Therefore, the current data transmission rate of the sending device is low and the average throughput rate does not meet the standard.

[0057] In order to solve the above problems, an embodiment of the present application provides a data transmission method.

[0058] The data transmission method provided in the embodiments of the present application can be applied to electronic devices serving as transmitting devices, including but not limited to mobile phones, tablet computers, personal computers, workstations, large-screen devices (e.g., smart screens, smart TVs, etc.), wearable devices (e.g., smart bracelets, smart watches), handheld game consoles, home game consoles, virtual reality devices, augmented reality devices, mixed reality devices, etc., in-vehicle smart terminals, etc. The embodiments of the present application do not limit the specific types of electronic devices.

[0059] Figure 2 This is a schematic diagram of the hardware structure of the electronic device provided in an embodiment of the present application.

[0060] like Figure 2 As shown, the electronic device 100 may include a processor 110, a memory 120, a Universal Serial Bus (USB) interface 130, a charging 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 button 190, a motor 191, a camera 192, a display 193, and a Subscriber Identification Module (SIM) card interface 194. The sensor module 180 may include a touch sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a geomagnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, and the like. Among them, the gyroscope sensor 180B, the air pressure sensor 180C, the geomagnetic sensor 180D, the acceleration sensor 180E, etc. can all be used to detect the motion state of the electronic device, and therefore, can also be called motion sensors.

[0061] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0062] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors.

[0063] In an embodiment of the present application, the AP can be a separate chip or integrated with other devices. For example, the AP and GPU can be integrated on the same chip. In this way, the AP or the chip integrated with the AP can run applications on the operating system of the electronic device 100 and interact with the kernel of the operating system to access system resources and perform specific tasks.

[0064] The memory 120 can be used to store computer executable program codes, and the executable program codes include instructions. The memory 120 may include a program storage area and a data storage area. Among them, 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 100 (such as audio data, a phone book, etc.), etc. In addition, the memory 120 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 memory (Universal Flash Storage, UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the memory 120, and / or instructions stored in a memory provided in the processor.

[0065] The USB interface 130 is an interface that complies with USB standards and may be a Mini USB interface, a Micro USB interface, a USB Type-C interface, or the like. The USB interface 130 can be used to connect a charger to charge the electronic device 100, or to transfer data between the electronic device 100 and peripheral devices. It can also be used to connect headphones to play audio. This interface can also be used to connect other electronic devices, such as augmented reality devices.

[0066] It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.

[0067] The charging management module 140 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also provide power to the electronic device via the power management module 141.

[0068] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 and provides power to the processor 110, the memory 120, the display 193, the camera 192, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance). In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

[0069] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0070] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.

[0071] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0072] In the embodiment of the present application, the electronic device 100 can realize the transmission of data packets in the cellular mobile network based on the mobile communication module 150.

[0073] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted 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 being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 193. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0074] The wireless communication module 160 can provide wireless communication solutions including Wireless Local Area Networks (WLAN) (such as Wi-Fi network), Bluetooth (BT), Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), Infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0075] In the embodiment of the present application, the electronic device 100 can implement the transmission of data packets in the Wi-Fi network based on the wireless communication module 160.

[0076] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, so that electronic device 100 can communicate with a network and other devices via wireless communication technologies. Wireless communication technologies 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 technologies. GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the Beidou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS) and / or the Satellite Based Augmentation System (SBAS).

[0077] Electronic device 100 implements display functionality through a GPU, display screen 193, and an application processor. The GPU is a microprocessor for image processing that connects display screen 193 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 modify display information.

[0078] Display screen 193 is used to display images, videos, etc. Display screen 193 includes a display panel. The display panel can be a liquid crystal display (LCD), organic light-emitting diode (OLED), active-matrix organic light-emitting diode or active-matrix organic light-emitting diode (AMOLED), flexible light-emitting diode (FLED), MiniLED, MicroLED, Micro-oLed, quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 100 may include one or N display screens 193, where N is a positive integer greater than 1.

[0079] The electronic device 100 can implement a shooting function through an ISP, a camera 192, a video codec, a GPU, a display screen 193, and an application processor.

[0080] The ISP processes data fed back by camera 192. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then passed to the ISP for processing and transformed into a visible image. The ISP can also perform algorithmic optimization for image noise, brightness, and skin tone. It can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be located within camera 192.

[0081] Camera 192 is used to capture still images or videos. The lens generates an optical image of an object and projects it onto a photosensitive element. The photosensitive element converts the optical signal into an electrical signal, which is then transmitted to the ISP for conversion 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 format such as RGB, RYYB, or YUV. In some embodiments, electronic device 100 may include one or N cameras 192, where N is a positive integer greater than one.

[0082] The electronic device 100 can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0083] Touch sensor 180A, also known as a "touch device," can be disposed on display screen 193. Touch sensor 180A and display screen 193 form a touch screen, also known as a "touch screen." Touch sensor 180A is used to detect touch operations applied thereto or in the vicinity thereof. The touch sensor can transmit the detected touch operations to an application processor to determine the type of touch event. Visual output related to the touch operations can be provided via display screen 193. In other embodiments, touch sensor 180A can also be disposed on the surface of electronic device 100, at a location different from that of display screen 193.

[0084] The gyroscope sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyroscope sensor 180B. The gyroscope sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyroscope sensor 180B can also be used for navigation and somatosensory game scenes.

[0085] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude using the air pressure value measured by the air pressure sensor 180C to assist in positioning and navigation.

[0086] The geomagnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the geomagnetic sensor 180D to detect the opening and closing of the flip case. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover based on the geomagnetic sensor 180D. Based on the detected opening and closing status of the leather case or flip cover, features such as automatic unlocking of the flip cover can be configured.

[0087] Accelerometer 180E can detect the magnitude of acceleration of electronic device 100 in all directions (generally three axes). When electronic device 100 is stationary, it can detect the magnitude and direction of gravity. It can also be used to identify the electronic device's posture, enabling applications such as switching between landscape and portrait modes and pedometers.

[0088] The distance sensor 180F is used to measure distance. The electronic device 100 can measure distance using infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure distance to achieve fast focusing.

[0089] The proximity light sensor 180G may include, for example, a light emitting diode and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the proximity light sensor 180G to detect when the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode and pocket mode to automatically unlock and lock the screen.

[0090] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.

[0091] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of the processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to prevent the electronic device 100 from shutting down abnormally due to low temperature. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 boosts the output voltage of the battery 142 to prevent abnormal shutdown due to low temperature.

[0092] The buttons 190 include a power button, a volume button, and the like. The buttons 190 may be mechanical buttons or touch buttons. The electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100.

[0093] Motor 191 can generate vibration prompts. Motor 191 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 193, motor 191 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.

[0094] The SIM card interface 194 is used to connect a SIM card. The SIM card can be connected to and separated from the electronic device 100 by inserting it into the SIM card interface 194 or removing it from the SIM card interface 194. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 194 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 194 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 194 can also be compatible with different types of SIM cards. The SIM card interface 194 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.

[0095] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present application, the Android system with a layered architecture is used as an example to illustrate the software structure of the electronic device 100.

[0096] Figure 3 This is a schematic diagram of the software structure of the electronic device provided in an embodiment of the present application.

[0097] A layered architecture divides software into several layers, each with distinct roles and responsibilities. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.

[0098] The application layer can include a series of application packages.

[0099] like Figure 3 As shown, the application package may include battery management, camera, gallery, calendar, call, map, navigation, music, video, short message and other applications.

[0100] In the embodiment of the present application, the application package also includes a setting application and a speed measurement application.

[0101] The Settings app can provide developer options to enable network data monitoring based on developer options to obtain network data usage.

[0102] The speed test application can be used to measure the rate at which the electronic device 100 transmits data, so as to evaluate the quality and stability of the network connection based on the measurement data.

[0103] The application framework layer provides an application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0104] like Figure 3 As shown, the application framework layer may include a window manager, an input manager, a sensor manager, a phone manager, a resource manager, a notification manager, and the like.

[0105] The input manager can be used to monitor user input events, such as click events and slide events performed by the user's finger on the display screen 193 of the electronic device 100. By monitoring the input events, the electronic device 100 can determine whether the electronic device is being used.

[0106] The sensor manager is used to monitor the data returned by various sensors in the electronic device, such as motion sensor data, proximity sensor data, temperature sensor data, etc. Using the data returned by each sensor, the electronic device can determine whether it is shaking or whether the display screen 193 is blocked.

[0107] Android Runtime includes core libraries and a virtual machine. Android runtime is responsible for scheduling and management of the Android system.

[0108] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.

[0109] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.

[0110] The system library can include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0111] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.

[0112] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0113] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0114] A 2D graphics engine is a drawing engine for 2D drawings.

[0115] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, sensor driver and network driver.

[0116] Network drivers can be used to manage the network interface card (NIC) or network adapter (NIC) in a computer system, enabling the computer to communicate over a network. Specifically, network drivers can send and receive network packets, establish and maintain network connections, and parse and process network protocols.

[0117] Among them, the network driver may include an Ethernet driver, a wireless network driver, a Bluetooth driver, and a modem driver, etc., so that the electronic device 100 can support wired network communication based on the Ethernet protocol, wireless network communication based on the Wi-Fi protocol or other wireless network protocols, Bluetooth communication based on the Bluetooth protocol, and dial-up Internet access based on a telephone line or other transmission medium. Under these communication modes, the kernel layer can perform data transmission. It is understandable that the structure illustrated in the embodiment of the present application does not constitute a specific limitation to the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange different components. The illustrated components can be implemented in hardware, software, or a combination of software and hardware.

[0118] Figure 4 This is a flowchart of the data transmission method provided in an embodiment of the present application.

[0119] like Figure 4 As shown, the method includes the following steps S101-S105.

[0120] Step S101: The electronic device 100 transmits data based on a first MTU value.

[0121] In an embodiment of the present application, the electronic device 100 may be a transmitting device, and the transmitting device may transmit data to the receiving device through a transit device, and such data may be uplink data. The uplink data may include data during the process of the electronic device 100 uploading files, data during the process of sending emails, data during online games, data during real-time video, etc., and these data can be used to measure the network transmission capability and transmission rate of the electronic device 100. The uplink data may be transmitted in a wired network or a wireless network, and may be data transmitted in the form of electrical signals or optical signals in a wired network, or data transmitted in the form of wireless signals in a wireless network. The embodiment of the present application does not limit the specific type of uplink data. In an embodiment of the present application, the transmission process of uplink data in a Wi-Fi network is exemplified.

[0122] A first MTU value is set by default in the electronic device 100. The numerical value of the first MTU value can be used to make the data packets transmitted by the electronic device 100 compatible with routers of different models. For example, the first MTU value is 1400 bytes. In this way, the electronic device 100 is compatible with routers with a default MTU value of 1500 bytes and routers with a default MTU value of 1400 bytes, so that the router will not discard the data packet when receiving the data packet transmitted by the electronic device 100. It should be noted here that the first MTU value is only used for exemplary description, and the embodiments of the present application do not limit the specific numerical value of the first MTU value.

[0123] Specifically, the kernel layer of the electronic device 100 transmits data based on the first MTU value.

[0124] In one implementation, the electronic device 100 may set an MTU value parameter in the program code of the kernel layer to transmit data based on this parameter. The parameter may default to the first MTU value. Specifically, the parameter may call the first MTU value by reading the first MTU value from a configuration file, mapping to the first MTU value, or obtaining the first MTU value based on a function. The specific method for calling the MTU value parameter is not limited in this embodiment of the application.

[0125] In step S102 , when the electronic device 100 detects that the first application is in a preset whitelist, it determines to enter a target scene.

[0126] The first application is an application currently running in the foreground, and the preset whitelist includes at least one application for measuring the rate at which the electronic device 100 transmits data.

[0127] For example, the preset whitelist may include a speed measurement application built into the electronic device 100, a speed measurement application provided by a third party (e.g., Ookla ), etc., the embodiment of the present application does not limit the specific type of speed measurement applications in the preset whitelist.

[0128] In the embodiments of the present application, the target scenario can be a speed test scenario. A speed test scenario refers to a scenario used during a specific network speed test. This scenario typically includes specific network conditions and test parameters to simulate the operating conditions of actual network applications. In the speed test scenario, the electronic device 100 can implement functions such as simulating real-world scenarios, comparing different network services, optimizing network services, and verifying network service quality.

[0129] Specifically, a user can click on a first application on the desktop. In response to the user's click operation on the first application, the electronic device 100 starts the first application and causes the first application to run in the foreground. The electronic device 100 can set a preset whitelist in the foreground to detect whether the first application is on the preset whitelist. When the first application is on the preset whitelist, the electronic device 100 can determine that the first application is currently in the foreground and can implement the function of measuring the transmission rate of the electronic device 100, thereby determining to enter the speed measurement scenario.

[0130] Figure 5 It is an interactive schematic diagram of the data transmission method provided in an embodiment of the present application.

[0131] like Figure 5 As shown, step S102 includes step S1021.

[0132] In step S1021 , when the processor of the electronic device 100 detects that the first application is in a preset whitelist, it determines to enter the target scene.

[0133] In one implementation, the processor may be an application processor AP. The embodiment of the present application does not limit the specific type of the processor.

[0134] That is, the electronic device 100 determines whether it has entered a speed measurement scenario through the processor. In one implementation, the processor can obtain program information corresponding to the first application through a system interface, such as the package name, program name, etc. After the processor obtains the program information, the processor compares the program information with a preset whitelist and determines whether the electronic device 100 has entered a speed measurement scenario based on the comparison result.

[0135] For example, the user clicks on the desktop In response to the user The operating system of the electronic device 100 is started by clicking the make When running in the foreground, the operating system can set a preset whitelist in the foreground, and the processor can detect Is it in the preset whitelist? If the device is in the preset whitelist, it is confirmed that the speed test scenario has been entered.

[0136] Step S103 : In response to the electronic device 100 entering the target scene, the electronic device 100 transmits data based on the second MTU value.

[0137] The second MTU value is greater than the first MTU value. For example, when the first MTU value is 1400 bytes, the second MTU value is 1500 bytes.

[0138] It should be noted that although the electronic device 100 sets the first MTU value by default so that data packets are transmitted within the limits of the first MTU value in most scenarios, this does not mean that the transmission capacity of the electronic device 100 is always limited by the first MTU value. Therefore, in the embodiment of the present application, after the electronic device 100 enters the speed measurement scenario, the electronic device 100 can modify the MTU value parameter to increase the size of the transmitted data packet, thereby increasing the rate at which the data packet is transmitted.

[0139] Further Figure 5 As shown, step S103 includes steps S1031-S1032.

[0140] Step S1031: In response to the electronic device 100 entering the target scene, the processor generates a first instruction and sends the first instruction to the kernel layer.

[0141] In one implementation, the processor may send the first instruction to the kernel layer through a system call interface, wherein the system call is a mechanism for entering the kernel state from the user state, and may implement communication and data exchange between the user program and the kernel.

[0142] In one implementation, the processor may implement instruction interaction with the kernel layer through a hardware abstraction layer (HAL) or an inter-process communication (IPC) mechanism.

[0143] Step S1032: The kernel layer transmits data based on the second MTU value in response to the first instruction.

[0144] Specifically, the electronic device 100 is preset with a second MTU value. The second MTU value can be used to prevent data packet fragmentation in the speed measurement scenario, thereby increasing the rate at which data packets are transmitted. For example, when the second MTU value is 1500 bytes, a 1430-byte data packet is transmitted without fragmentation. It should be noted that the second MTU value is for illustrative purposes only, and the embodiments of the present application do not limit the specific data of the second MTU value.

[0145] The following specifically describes the process of transmitting data at the kernel layer based on the second MTU value.

[0146] The MTU value parameter set in the program code of the kernel layer can be a variable. When the electronic device 100 enters the target scenario, the MTU value parameter needs to call the second MTU value. The parameter can call the second MTU value by reading the second MTU value from a configuration file, mapping it to the second MTU value, or calling a function to obtain the second MTU value. The embodiment of the present application does not limit the specific calling method of the MTU value parameter. In this way, in the speed measurement scenario, the kernel layer can respond to the first instruction and change the MTU value parameter from calling the first MTU value of 1400 bytes to calling the second MTU value of 1500 bytes, so as to transmit data based on 1500 bytes and increase the rate of transmitting data packets.

[0147] In the embodiment of the present application, the MTU value may be set by calling the first MTU value and the second MTU value in other ways besides assignment. The embodiment of the present application does not limit the specific setting method of the MTU value.

[0148] It should be noted here that when the electronic device 100 transmits data based on the second MTU value in the speed measurement scenario, there is a small probability that incompatibility with the router will occur. When this problem occurs, the electronic device 100 handles it in the same way as when it determines to leave the target scenario. Please refer to the following embodiment for details.

[0149] In step S104, the electronic device 100 determines to leave the target scene when it detects that the first application in the preset whitelist switches from foreground operation to background operation, or when it detects that the first application is not in the preset whitelist, it determines to leave the target scene.

[0150] Further Figure 5 As shown, step S104 includes step S1041.

[0151] In step S1041, the processor determines to leave the target scene when it detects that the first application in the preset whitelist switches from foreground operation to background operation, or when it detects that the first application is not in the preset whitelist, it determines to leave the target scene.

[0152] In one implementation, after determining that the first application is on a preset whitelist, the processor can monitor changes in the activity component (Activity) corresponding to the first application to determine whether the first application switches from foreground operation to background operation. After the first application switches to background operation, it determines to leave the speed measurement scenario.

[0153] In one implementation, the first application running in the foreground may be replaced, for example, by The first application is replaced with a chat application. In this way, when the processor detects that the first application is not in the preset whitelist, it determines to leave the speed test scenario.

[0154] Step S105 , in response to the electronic device 100 leaving the target scene, the electronic device 100 transmits data based on the first MTU value after a first delay time.

[0155] For example, the first delay duration is 10 seconds. The embodiment of the present application does not limit the specific value of the first delay duration. In fact, in the embodiment of the present application, the delay duration can be set in an optional manner. When the system is relatively stable, the first delay duration of the embodiment of the present application can be 0 seconds. Whether the electronic device 100 sets the delay duration can be determined based on the actual operation of the electronic device 100.

[0156] It should be noted that when the same first application switches from the foreground to the background, or when the first application changes in the foreground, a ping-pong setting problem is likely to occur. Ping-pong settings usually occur during the rapid interaction of the electronic device 100 system, causing the system to fall into an infinite loop or unstable state. Therefore, the electronic device 100 can slow down the interaction speed of the system by setting a first delay time, thereby avoiding the ping-pong setting problem.

[0157] Further Figure 5 As shown, step S105 includes steps S1051-S1052.

[0158] Step S1051: In response to the electronic device 100 leaving the target scene, the processor generates a second instruction after a first delay time, and sends the second instruction to the kernel layer.

[0159] It should be noted here that the interaction process of the second instruction between the processor and the kernel layer can refer to the interaction process of the first instruction, and the embodiment of the present application will not go into details about this.

[0160] Step S1052: The kernel layer transmits data based on the first MTU value in response to the second instruction.

[0161] That is to say, when the electronic device 100 leaves the target scene, the parameter of the MTU value needs to call the first MTU value again. The specific calling method of the first MTU value can refer to the above embodiment, and this application will not elaborate on it.

[0162] In this way, the kernel layer can respond to the second instruction and change the MTU value parameter from 1500 bytes calling the second MTU value to 1400 bytes calling the first MTU value to transmit data based on 1400 bytes to avoid compatibility issues after the electronic device 100 leaves the speed measurement scenario.

[0163] Figure 6 This is another flowchart of the data transmission method provided in an embodiment of the present application.

[0164] like Figure 6 As shown, in one implementation, the method further includes steps S106-S110 after step S101.

[0165] In step S106 , the electronic device 100 obtains a data transmission rate.

[0166] In one implementation, the electronic device 100 can obtain the current network speed through a built-in network monitoring tool to determine the data transmission rate. The electronic device 100 can also obtain the current data upload speed and download speed through a third-party network monitoring application to determine the data transmission rate. The electronic device 100 can also obtain the current upload and download data volume through a traffic monitoring application to determine the data transmission rate. In the embodiments of the present application, the specific method for the electronic device 100 to obtain the data transmission rate is not limited.

[0167] Since the third-party network monitoring application can obtain the current data download speed, the traffic monitoring application can obtain the current downloaded data volume, that is, the data transmitted by the electronic device 100 includes not only uplink data, but also downlink data. The downlink data may include data in the process of downloading files and receiving emails by the electronic device 100, etc. The transmission method of the downlink data corresponds to that of the uplink data, and can be transmitted in a wired network or a wireless network. The embodiment of the present application does not limit the specific type of downlink data.

[0168] Therefore, the rate at which electronic device 100 acquires transmitted data is actually a throughput rate, including the uplink rate corresponding to uplink data and / or the downlink rate corresponding to downlink data. The uplink rate is the rate at which data is uploaded from electronic device 100 to the network, and the downlink rate is the rate at which data is downloaded from the network to electronic device 100. Throughput refers to the amount of data transmitted over the network per unit time. For example, the uplink rate acquired by electronic device 100 is 230 Mbps and the downlink rate is 250 Mbps.

[0169] Figure 7 This is another interactive schematic diagram of the data transmission method provided in an embodiment of the present application.

[0170] like Figure 7 As shown, step S106 includes step S1061.

[0171] In step S1061 , the processor obtains the rate of data transmission.

[0172] Step S107: When the rate is greater than the first threshold, the electronic device 100 determines that it has entered the target scene.

[0173] In the case that the data transmission rate includes an uplink rate, the first threshold may correspond to the uplink rate.

[0174] For example, when the electronic device 100 is in a Wi-Fi network, the first threshold of the electronic device 100 can be 200Mbps. Therefore, when the uplink rate of the electronic device 100 is 230Mbps, the uplink rate is greater than the first threshold. The electronic device 100 can determine that it has entered a speed measurement scenario, so as to adjust the MTU value in the speed measurement scenario and increase the uplink rate.

[0175] In the case that the data transmission rate includes a downlink rate, the first threshold may correspond to the downlink rate.

[0176] For example, when the electronic device 100 is on a Wi-Fi network, the first threshold of the electronic device 100 may be 200 Mbps. Therefore, when the downlink rate of the electronic device 100 is 250 Mbps, the downlink rate is greater than the first threshold, and the electronic device 100 may determine that it has entered a speed measurement scenario. Since in some speed measurement scenarios, the electronic device 100 prioritizes the downlink rate before measuring the uplink rate, if the electronic device 100 measures the downlink rate and the measured downlink rate meets the speed requirement, the electronic device 100 can adjust the MTU value before measuring the uplink rate to increase the uplink rate.

[0177] When the data transmission rate includes an uplink rate and a downlink rate, the first threshold may include a first sub-threshold and a second sub-threshold, the first sub-threshold may correspond to the uplink rate, and the second sub-threshold may correspond to the downlink rate.

[0178] For example, when the electronic device 100 is on a Wi-Fi network, the first sub-threshold of the electronic device 100 can be 200 Mbps, and the second sub-threshold can be 200 Mbps. Therefore, when the uplink rate of the electronic device is 230 Mbps and the downlink rate is 250 Mbps, when the uplink rate is greater than the first sub-threshold, and / or the downlink rate is greater than the second sub-threshold, the electronic device 100 can determine that it has entered a speed measurement scenario. In this way, the electronic device 100 adds a comparison of the downlink rate, which can improve the accuracy of determining whether it has entered a speed measurement scenario. It should be noted here that since the electronic device 100 can not only connect to a Wi-Fi network, but also to other different types of networks, such as a 4G network, a 5G network, etc., the electronic device 100 can correspond to different transmission rates in each network type. Accordingly, the first threshold can be set to different values ​​corresponding to different network types. The embodiment of the present application does not limit the specific value of the first threshold.

[0179] Further Figure 7 As shown, step S107 includes step S1071.

[0180] Step S1071: When the rate is greater than a first threshold, the processor determines that the target scene has been entered.

[0181] Step S108 : In response to the electronic device 100 entering the target scene, the electronic device 100 transmits data based on the second MTU value.

[0182] Further Figure 7 As shown, step S108 includes steps S1081-S1082.

[0183] Step S1081: In response to the electronic device 100 entering the target scene, the processor generates a first instruction and sends the first instruction to the kernel layer.

[0184] Step S1082: The kernel layer transmits data based on the second MTU value in response to the first instruction.

[0185] The specific implementation of step S108 can refer to step S103 in the above embodiment, which will not be described in detail in this embodiment of the application.

[0186] In this way, in the speed test scenario, the kernel layer can respond to the first instruction and change the MTU value parameter from 1400 bytes calling the first MTU value to 1500 bytes calling the second MTU value to transmit data based on 1500 bytes, thereby increasing the rate of transmitting data packets.

[0187] Step S109: When the speed is less than or equal to the first threshold, the electronic device 100 determines that it has left the target scene.

[0188] For example, when the electronic device 100 is in a Wi-Fi network and the first threshold is 200 Mbps, when the speed of the electronic device 100 decreases from 230 Mbps to 100 Mbps, the electronic device 100 can determine to leave the speed measurement scenario because 100 Mbps is less than 200 Mbps.

[0189] Further Figure 7 As shown, step S109 includes step S1091.

[0190] Step S1091: When the speed is less than or equal to the first threshold, the processor determines to leave the target scene.

[0191] Step S110 : In response to the electronic device 100 leaving the target scene, the electronic device 100 transmits data based on the first MTU value.

[0192] It should be noted that since this embodiment does not involve switching between applications or switching between the foreground and background, there is no need to set a delay time to avoid the problem of ping-pong settings. In fact, this embodiment can also refer to the previous embodiment to set the delay time, and this embodiment does not restrict whether to set the delay time.

[0193] Further Figure 7 As shown, step S110 includes steps S1101-S1102.

[0194] Step S1101: In response to the electronic device 100 leaving the target scene, the processor generates a second instruction and sends the second instruction to the kernel layer.

[0195] It should be noted here that the interaction process of the second instruction between the processor and the kernel layer can refer to the interaction process of the first instruction, and the embodiment of the present application will not go into details about this.

[0196] Step S1102: The kernel layer transmits data based on the first MTU value in response to the second instruction.

[0197] In this way, the kernel layer can respond to the second instruction and change the MTU value parameter from 1500 bytes calling the second MTU value to 1400 bytes calling the first MTU value to transmit data based on 1400 bytes to avoid compatibility issues after the electronic device 100 leaves the speed measurement scenario.

[0198] Figure 8 This is another flow chart of the data transmission method provided in an embodiment of the present application.

[0199] like Figure 8As shown, in one implementation, the method further includes steps S111-S115 after step S101.

[0200] In step S111 , the electronic device 100 obtains a data transmission rate, a total number of data packets transmitted based on the rate, and a first number of target data packets in the data packets.

[0201] The data packet size of the target data packet is greater than the first MTU value.

[0202] The manner in which the electronic device 100 obtains the rate of transmission data may refer to the specific implementation of step S106.

[0203] In one implementation, the electronic device 100 can enable developer options in its settings application and start the network data monitoring function to obtain network data usage, thereby obtaining the total number of data packets and the first number of target data packets in the data packets. The electronic device 100 can also obtain the network activity of the electronic device 100 through a third-party network monitoring application, thereby obtaining the total number of data packets and the first number of target data packets in the data packets. In the embodiment of the present application, the specific method for the electronic device 100 to obtain the total number of data packets and the first number of target data packets in the data packets is not limited.

[0204] For example, the rate at which the electronic device 100 acquires transmission data is 230 Mbps. At a rate of 230 Mbps, the electronic device 100 can transmit 10 data packets with data packet sizes of 1410 bytes, 1420 bytes, 1430 bytes, 1440 bytes, 1450 bytes, 1460 bytes, 1360 bytes, 1350 bytes, 1340 bytes, and 1330 bytes, respectively. Therefore, the total number of data packets is 10. Accordingly, the target data packets include data packets of 1410 bytes, 1420 bytes, 1430 bytes, 1440 bytes, 1450 bytes, and 1460 bytes, so the first number is 6.

[0205] Figure 9 This is another interactive schematic diagram of the data transmission method provided in an embodiment of the present application.

[0206] like Figure 9 As shown, step S111 includes step S1111.

[0207] In step S1111 , the processor obtains a data transmission rate, a total number of data packets transmitted based on the rate, and a first number corresponding to target data packets in the data packets.

[0208] Step S112: When the rate is greater than the first threshold and the first ratio is greater than the second threshold, the electronic device 100 determines that it has entered the target scene, and the first ratio is the ratio of the first number to the total number.

[0209] Taking the electronic device 100 in a Wi-Fi network as an example, the first threshold of the electronic device 100 can be 200 Mbps, and the second threshold of the electronic device 100 can be 0.5. Therefore, when the speed of the electronic device 100 is 230 Mbps, the electronic device 100 can determine that the speed is greater than the first threshold. In addition, the electronic device 100 needs to obtain a first ratio based on the ratio of the first number to the total number. When the first number is 6 and the total number is 10, the first ratio is 0.6. In this way, the electronic device 100 can determine that the first ratio is greater than the second threshold, and then determine that it has entered the speed measurement scenario when the speed is greater than the first threshold and the first ratio is greater than the second threshold.

[0210] It should be noted here that the embodiment of the present application does not limit the specific value of the second threshold.

[0211] Further Figure 9 As shown, step S112 includes step S1121.

[0212] Step S1121: When the rate is greater than the first threshold and the first ratio is greater than the second threshold, the processor determines that the target scene has been entered.

[0213] Step S113 : In response to the electronic device 100 entering the target scene, the electronic device 100 transmits data based on the second MTU value.

[0214] Further Figure 9 As shown, step S113 includes steps S1131-S1132.

[0215] Step S1131: In response to the electronic device 100 entering the target scene, the processor generates a first instruction and sends the first instruction to the kernel layer.

[0216] Step S1132: The kernel layer transmits data based on the second MTU value in response to the first instruction.

[0217] The specific implementation of step S113 can refer to step S103 in the aforementioned embodiment, which will not be described in detail in this embodiment of the present application.

[0218] In this way, in the speed test scenario, the kernel layer can respond to the first instruction and change the MTU value parameter from 1400 bytes calling the first MTU value to 1500 bytes calling the second MTU value to transmit data based on 1500 bytes, thereby increasing the rate of transmitting data packets.

[0219] Step S114: When the rate is less than or equal to the first threshold, and / or the first ratio is less than or equal to the second threshold, the electronic device 100 determines that it has left the target scene.

[0220] For example, when the electronic device 100 is in a Wi-Fi network, the first threshold is 200Mbps, and the second threshold is 0.5, when the rate of the electronic device 100 decreases from 230Mbps to 100Mbps, and / or when the first ratio decreases from 0.6 to 0.4, since 100Mbps is less than 200Mbps and 0.4 is less than 0.5, the electronic device 100 can determine that it has left the speed measurement scenario.

[0221] Further Figure 9 As shown, step S114 includes step S1141.

[0222] Step S1141: When the rate is less than or equal to the first threshold, and / or the first ratio is less than or equal to the second threshold, the processor determines to leave the target scene.

[0223] Step S115 : In response to the electronic device 100 leaving the target scene, the electronic device 100 transmits data based on the first MTU value.

[0224] It should be noted that since this embodiment does not involve switching between applications or switching between the foreground and background, there is no need to set a delay time to avoid the problem of ping-pong settings. In fact, this embodiment can also refer to the previous embodiment to set the delay time, and this embodiment does not restrict whether to set the delay time.

[0225] Further Figure 9 As shown, step S115 includes steps S1151-S1152.

[0226] Step S1151: In response to the electronic device 100 leaving the target scene, the processor generates a second instruction and sends the second instruction to the kernel layer.

[0227] It should be noted here that the interaction process of the second instruction between the processor and the kernel layer can refer to the interaction process of the first instruction, and the embodiment of the present application will not go into details about this.

[0228] Step S1152: The kernel layer transmits data based on the first MTU value in response to the second instruction.

[0229] In this way, the kernel layer can respond to the second instruction and change the MTU value parameter from 1500 bytes calling the second MTU value to 1400 bytes calling the first MTU value to transmit data based on 1400 bytes to avoid compatibility issues after the electronic device 100 leaves the speed measurement scenario.

[0230] Figure 10 This is another flow chart of the data transmission method provided in an embodiment of the present application.

[0231] like Figure 10 As shown, in one embodiment, the method may include the following steps S201-S203.

[0232] In step S201 , the electronic device 100 transmits data based on a first MTU value.

[0233] In step S202 , the electronic device 100 determines whether it enters a target scenario that triggers adjustment of the MTU value.

[0234] Step S203 , in response to the electronic device 100 entering the target scene, the electronic device 100 transmits data based on a second MTU value, where the second MTU value is greater than the first MTU value.

[0235] In one implementation, step S203 further includes steps S204-S205.

[0236] In step S204 , the electronic device 100 determines whether it has left the target scene.

[0237] Step S205 : In response to the electronic device 100 leaving the target scene, the electronic device 100 transmits data based on the first MTU value.

[0238] In this way, after leaving the speed measurement scenario, the electronic device 100 can restore the default first MTU value, avoiding compatibility issues in scenarios other than the speed measurement scenario.

[0239] Steps S201-S203 and their respective implementation methods may be specifically implemented with reference to the above examples, and will not be described in detail here.

[0240] In the embodiment of the present application, the electronic device 100 can improve the efficiency of transmitting data packets in the speed measurement scenario by modifying the default MTU value in the speed measurement scenario and restoring the default MTU value in the non-speed measurement scenario, so that the throughput rate in the speed measurement scenario meets the standard, while avoiding compatibility issues in the non-speed measurement scenario. In this way, the technical solution shown in the embodiment of the present application can enhance the user experience of the electronic device 100 in multiple scenarios.

[0241] In the embodiments provided in the present application above, each scheme of the data transmission method provided in the present application is introduced from the perspective of the electronic device 100. It is understandable that, in order to implement the above functions, the electronic device 100 includes a hardware structure and / or software module corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present application.

[0242] Figure 11 It is a structural diagram of the data transmission device provided in an embodiment of the present application.

[0243] like Figure 11 As shown, the data transmission device 200 provided in the embodiment of the present application can be applied to the electronic device 100, including:

[0244] The first transmission module 201 is configured to transmit data based on a first maximum transmission unit (MTU) value.

[0245] The scene recognition module 202 is used to determine whether the electronic device 100 enters a target scene that triggers the adjustment of the MTU value.

[0246] The first transmission module 201 is further configured to transmit data based on a second MTU value in response to the electronic device 100 entering a target scene, where the second MTU value is greater than the first MTU value.

[0247] In one implementation, the scene recognition module 202 is further configured to determine whether the electronic device 100 has left the target scene.

[0248] The first transmission module 201 is further configured to transmit data based on the first MTU value in response to the electronic device 100 leaving the target scene.

[0249] The data transmission device 200 in the embodiment of the present application can improve the efficiency of transmitting data packets in the speed measurement scenario by modifying the default MTU value in the speed measurement scenario and restoring the default MTU value in the non-speed measurement scenario, so that the throughput rate in the speed measurement scenario meets the standard, while avoiding compatibility issues in the non-speed measurement scenario. In this way, the technical solution shown in the embodiment of the present application can enhance the user experience of the electronic device 100 in multiple scenarios.

[0250] Figure 12 It is a structural diagram of a data transmission device provided in another embodiment of the present application.

[0251] like Figure 12 As shown, the data transmission device provided in the embodiment of the present application may include: a display screen 1001, a memory 1002, a processor 1003 and a communication module 1004. The above-mentioned components can be connected via one or more communication buses 1005. The display screen 1001 may include a display panel 10011 and a touch sensor 10012, wherein the display panel 10011 is used to display an image, and the touch sensor 10012 can transmit the detected touch operation to the application processor to determine the type of touch event and provide a visual output related to the touch operation through the display panel 10011. The processor 1003 may include one or more processing units, for example: the processor 1003 may include an application processor, a modem processor, a graphics processor, an image signal processor, a controller, a video codec, a digital signal processor, a baseband processor, and / or a neural network processor. The different processing units may be independent devices or integrated into one or more processors. The memory 1002 is coupled to the processor 1003 and is used to store various software programs and / or computer instructions. The memory 1002 may include volatile memory and / or non-volatile memory. When the processor executes the computer instructions, the data transmission device can perform the various functions or steps performed by the electronic device 100 in the above method embodiment.

[0252] In some embodiments, when the software program and / or multiple sets of instructions in the memory 1002 are executed by the processor 1003, the device is used to perform the following method steps: transmitting data based on a first maximum transmission unit MTU value; determining whether to enter a target scenario that triggers adjustment of the MTU value; in response to the electronic device entering the target scenario, transmitting data based on a second MTU value, the second MTU value being greater than the first MTU value.

[0253] In some embodiments, when the software program and / or multiple sets of instructions in the memory 1002 are executed by the processor 1003, the device is used to perform the following method steps: determining whether to leave the target scene; in response to the electronic device leaving the target scene, the electronic device transmits data based on the first MTU value.

[0254] In some embodiments, when the software program and / or multiple sets of instructions in the memory 1002 are executed by the processor 1003, the device is used to perform the following method steps: when it is detected that the first application is in a preset whitelist, it is determined to enter the target scene, wherein the first application is the application currently running in the foreground, and the preset whitelist includes at least one application for measuring the rate at which the electronic device transmits data.

[0255] In some embodiments, when the software program and / or multiple sets of instructions in the memory 1002 are executed by the processor 1003, the device is used to perform the following method steps: obtaining the rate of transmitted data; when the rate is greater than a first threshold, determining to enter the target scene.

[0256] In some embodiments, when the software program and / or multiple sets of instructions in the memory 1002 are executed by the processor 1003, the device is used to perform the following method steps: obtaining the rate of transmitted data, the total number of data packets transmitted based on the rate, and the first number corresponding to the target data packets in the data packets, wherein the data packet size of the target data packet is greater than the first MTU value; when the rate is greater than the first threshold and the first ratio is greater than the second threshold, it is determined that the target scenario has been entered, and the first ratio is the ratio of the first number to the total number.

[0257] In some embodiments, when the software program and / or multiple sets of instructions in the memory 1002 are executed by the processor 1003, the device is used to perform the following method steps: when it is detected that the first application located in the preset whitelist switches from foreground operation to background operation, it is determined to leave the target scene; or when the electronic device detects that the first application is not located in the preset whitelist, it is determined to leave the target scene.

[0258] In some embodiments, when the software program and / or multiple sets of instructions in the memory 1002 are executed by the processor 1003, the device is used to perform the following method steps: in response to the electronic device leaving the target scene, transmitting data based on the first MTU value after a first delay period.

[0259] In some embodiments, when the software program and / or multiple groups of instructions in the memory 1002 are executed by the processor 1003, the device is configured to perform the following method steps: when determining that the rate is less than or equal to a first threshold, determining to leave the target scene.

[0260] In some embodiments, when the software program and / or multiple groups of instructions in the memory 1002 are executed by the processor 1003, the device is used to perform the following method steps: when the rate is less than or equal to the first threshold, and / or the first ratio is less than or equal to the second threshold, determine to leave the target scene.

[0261] In some embodiments, when the software program and / or multiple groups of instructions in the memory 1002 are executed by the processor 1003, the apparatus is configured to perform the following method steps: the kernel layer transmits data based on the first MTU value.

[0262] In some embodiments, when the software program and / or multiple groups of instructions in the memory 1002 are executed by the processor 1003, the apparatus is configured to perform the following method steps: the processor determines whether the electronic device enters a target scene.

[0263] In some embodiments, when the software program and / or multiple groups of instructions in the memory 1002 are executed by the processor 1003, the device is used to perform the following method steps: in response to the electronic device entering the target scene, the processor generates a first instruction and sends the first instruction to the kernel layer; the kernel layer responds to the first instruction and transmits data based on the second MTU value.

[0264] In some embodiments, when the software program and / or multiple groups of instructions in the memory 1002 are executed by the processor 1003, the apparatus is configured to perform the following method steps: the processor determines whether the electronic device leaves the target scene.

[0265] In some embodiments, when the software program and / or multiple groups of instructions in the memory 1002 are executed by the processor 1003, the device is used to perform the following method steps: in response to the electronic device leaving the target scene, the processor generates a second instruction and sends the second instruction to the kernel layer; the kernel layer transmits data based on the first MTU value in response to the second instruction.

[0266] The data transmission device in the embodiment of the present application can improve the efficiency of transmitting data packets in the speed measurement scenario by modifying the default MTU value in the speed measurement scenario and restoring the default MTU value in the non-speed measurement scenario, so that the throughput rate in the speed measurement scenario meets the standard, while avoiding compatibility issues in the non-speed measurement scenario. In this way, the technical solution shown in the embodiment of the present application can enhance the user experience of electronic devices in multiple scenarios.

[0267] Some embodiments of the present application provide an electronic device, which may include: a touch screen, a memory, and one or more processors. The touch screen, the memory, and the processor are coupled. The memory is used to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the electronic device can perform the various functions or steps performed by the electronic device in the above method embodiment. The structure of the electronic device can refer to Figure 2 The structure of the electronic device 100 is shown.

[0268] The embodiment of the present application also provides a chip system, for example, a system on a chip (SoC), which includes at least one processor and at least one interface circuit. The processor and the interface circuit can be interconnected by lines. For example, the interface circuit can be used to receive signals from other devices (such as a memory of an electronic device). For another example, the interface circuit can be used to send signals to other devices (such as a processor or a touch screen of an electronic device). Exemplarily, the interface circuit can read instructions stored in the memory and send the instructions to the processor. When the instructions are executed by the processor, the electronic device can perform the various steps in the above embodiments. Of course, the chip system can also include other discrete devices, and the embodiment of the present application does not specifically limit this.

[0269] An embodiment of the present application also provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on the above-mentioned electronic device, the electronic device executes the various functions or steps executed by the electronic device in the above-mentioned method embodiment.

[0270] An embodiment of the present application further provides a computer program product. When the computer program product is run on an electronic device, the electronic device is enabled to perform the functions or steps performed by the electronic device in the above method embodiment.

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

[0272] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules or units is merely a logical function division. In actual implementation, there may be other division methods, 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 through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0273] The units described as separate components may or may not be physically separate, 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 places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0274] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0275] 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 and includes several instructions for enabling a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0276] The above content is only a specific embodiment of this application, but the scope of protection of this application is not limited to this. Any changes or replacements within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. A data transmission method, characterized in that: Applied to electronic equipment, the method includes: The electronic device transmits data based on a first maximum transmission unit (MTU) value; The electronic device determines whether it enters a target scenario that triggers adjustment of the MTU value; the target scenario includes a speed measurement scenario; When the electronic device determines that a speed measurement application is running in the foreground, or when a current data transmission rate is greater than a first threshold and a first ratio is greater than a second threshold, the electronic device determines that it has entered the target scenario, where the rate includes an uplink rate and / or a downlink rate, and the first ratio is a ratio of a first number to a total number of data packets transmitted based on the rate, the first number is the number of target data packets in the data packets, and a data packet size of the target data packet is greater than the first MTU value; In the target scenario, the electronic device transmits data based on a second MTU value, and the second MTU value is greater than the first MTU value.

2. The data transmission method according to claim 1, wherein: Also includes: The electronic device determines whether to leave the target scene; In response to the electronic device leaving the target scene, the electronic device transmits data based on the first MTU value.

3. The data transmission method according to claim 2, wherein: The electronic device determines whether it enters a target scenario that triggers adjustment of the MTU value, including: When the electronic device detects that the first application is in a preset whitelist, it determines to enter the target scene, wherein the first application is the application currently running in the foreground, and the preset whitelist includes at least one application for measuring the rate at which the electronic device transmits data.

4. The data transmission method according to claim 3, wherein: The electronic device determining whether to leave the target scene includes: The electronic device detects that the first application in the preset whitelist switches from foreground operation to background operation, and determines to leave the target scene; Alternatively, when the electronic device detects that the first application is not in the preset whitelist, it determines to leave the target scene.

5. The data transmission method according to claim 4, characterized in that: In response to the electronic device leaving the target scene, the electronic device transmitting data based on the first MTU value, including: In response to the electronic device leaving the target scene, the electronic device transmits data based on the first MTU value after a first delay period.

6. The data transmission method according to claim 2, wherein: The electronic device determining whether to leave the target scene includes: When the rate is less than or equal to the first threshold, the electronic device determines that it has left the target scene.

7. The data transmission method according to claim 2, wherein: The electronic device determining whether to leave the target scene includes: When the rate is less than or equal to the first threshold, and / or the first ratio is less than or equal to the second threshold, the electronic device determines that it has left the target scene.

8. The data transmission method according to any one of claims 2 to 7, characterized in that: The electronic device transmitting data based on the first MTU value includes: The kernel layer of the electronic device transmits data based on the first MTU value.

9. The data transmission method according to claim 8, characterized in that: The electronic device determines whether it enters a target scenario that triggers adjustment of the MTU value, including: The processor of the electronic device determines whether the electronic device enters the target scene.

10. The data transmission method according to claim 9, characterized in that: The electronic device transmitting data based on the second MTU value in the target scenario includes: The processor generates a first instruction and sends the first instruction to the kernel layer; The kernel layer transmits data based on the second MTU value in response to the first instruction.

11. The data transmission method according to claim 10, wherein: The electronic device determining whether to leave the target scene includes: The processor determines whether the electronic device leaves the target scene.

12. The data transmission method according to claim 11, characterized in that: In response to the electronic device leaving the target scene, the electronic device transmitting data based on the first MTU value, including: In response to the electronic device leaving the target scene, the processor generates a second instruction and sends the second instruction to the kernel layer; The kernel layer transmits data based on the first MTU value in response to the second instruction.

13. A data transmission device, characterized in that: Applied to electronic equipment, the device comprises: A first transmission module, configured to transmit data based on a first maximum transmission unit (MTU) value; A scene recognition module, the scene recognition module is used to determine whether the electronic device enters a target scene that triggers adjustment of the MTU value; the target scene includes a speed measurement scene; a determination module, the determination module being configured to determine that the target scenario has been entered when it is determined that a speed measurement application is running in the foreground, or when a current data transmission rate is greater than a first threshold and a first ratio is greater than a second threshold, the rate including an uplink rate and / or a downlink rate; the first ratio being a ratio of a first number to a total number of data packets transmitted based on the rate, the first number being the number of target data packets in the data packets, and the data packet size of the target data packet being greater than the first MTU value; The first transmission module is further configured to transmit data based on a second MTU value in the target scenario, where the second MTU value is greater than the first MTU value.

14. An electronic device, characterized in that: include: processor and memory; The memory stores program instructions, and when the processor executes the program instructions, the electronic device executes the data transmission method according to any one of claims 1 to 12.

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

Citation Information

Patent Citations

  • Maximum transmission unit size selection for wireless data transfer

    US20190306072A1