Data transmission method and device and electronic equipment

By adjusting the MTU value in the speed measurement scenario of electronic devices, the problem of data transmission rate reduction caused by MTU restrictions is solved, the transmission efficiency is improved, compatibility is avoided, and user experience is improved.

CN119255286AActive Publication Date: 2025-01-03HONOR DEVICE CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

When electronic devices transmit data, due to MTU restrictions, they need to shard data packets, resulting in a decrease in transmission rate and affecting the user experience.

Method used

By adjusting the MTU value in the speed test scenario, change from the default first MTU value to the second MTU value (greater than the first MTU value), to improve the data transmission rate, and restore the default MTU value after leaving the speed test scenario to avoid compatibility question.

Benefits of technology

It improves the data transmission rate of electronic devices in speed measurement scenarios, ensures data transmission efficiency, and avoids compatibility issues in non-speed measurement scenarios, improving user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119255286A_ABST
    Figure CN119255286A_ABST
Patent Text Reader

Abstract

The invention provides a data transmission method and device and electronic equipment. The method comprises the steps that the electronic equipment transmits data based on a first maximum transmission unit (MTU) value; the electronic equipment determines whether to enter a target scene for triggering and adjusting the MTU value; in response to the electronic equipment entering the target scene, the electronic equipment transmits data based on a second MTU value, and the second MTU value is larger than the first MTU value. According to the technical scheme, the MTU value of the electronic equipment is adjusted in the speed measurement scene, so that the data transmission rate of the electronic equipment in the speed measurement scene can be improved, and the average throughput rate of the electronic equipment reaches the standard.
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. MTU refers to the maximum size of a data packet transmitted in an unsegmented manner in a network connection, usually in bytes.

[0003] Electronic devices need to send data packets within the limits of MTU. If the size of a data packet exceeds 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 standards, affecting the user experience. Summary of the invention

[0004] The embodiments of the present application provide a data transmission method, device and electronic device, which improve the data transmission rate of the electronic device in a speed measurement scenario and solve the problem that the average throughput rate of the electronic device does not meet 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, and 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; 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 the speed measurement scenario by adjusting the MTU value of the electronic device in the speed measurement scenario.

[0007] In one implementation, the electronic device further includes: 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. With this implementation, after leaving the speed measurement scene, the electronic device can restore the default MTU value to avoid compatibility issues in scenes other than the speed measurement scene.

[0008] In one implementation, the electronic device determines whether to enter a target scenario that triggers adjustment of the MTU value, including: when the electronic device detects that a first application is in 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. With this implementation, the electronic device can determine whether to enter a speed measurement scenario based on detecting whether the first application is in the preset whitelist, so as to adjust the MTU value of the electronic device in the speed measurement scenario.

[0009] In one implementation, the electronic device determines whether to enter a target scenario that triggers adjustment of the MTU value, including: the electronic device obtains the rate of transmission data; when the rate is greater than a first threshold, the electronic device determines that it has entered the target scenario. With this implementation, the electronic device can determine whether to enter a speed measurement scenario based on determining whether the rate of transmission data is greater than the first threshold, so as to adjust the MTU value of the electronic device in the speed measurement scenario.

[0010] In one implementation, the electronic device determines whether to enter a target scenario that triggers adjustment of the MTU value, including: the electronic device obtains the rate at which the data is transmitted, 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 packets is greater than the first MTU value; when the rate is greater than a first threshold value, and the first ratio is greater than a second threshold value, the electronic device determines that it has entered the target scenario, and the first ratio is the ratio of the first number to the total number. With this implementation, the electronic device can determine whether to enter a speed measurement scenario based on determining whether the rate of data transmission is greater than the first threshold value, and based on determining whether the first ratio is greater than the second threshold value, 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 determines that 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 scenes 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. With this implementation, the electronic device can avoid network problems caused by ping-pong settings by restoring the default first MTU value after the first delay period after leaving the speed measurement scene. Among them, the network problem caused by the ping-pong setting generally refers to the waste and congestion of network resources caused by the round-trip data packet transmission.

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

[0014] In one implementation, the electronic device determines whether to leave the target scene, including: 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 to leave the target scene. With this implementation, the electronic device can determine whether to leave the speed measurement scene based on determining whether the rate of data transmission 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, 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 scenes other than the speed measurement scene.

[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 shows a specific method for the electronic device to transmit data at the software level in a speed measurement scenario.

[0016] In one implementation, the electronic device determines whether to enter a target scenario that triggers adjustment of the MTU value, including: a processor of the electronic device determines whether the electronic device enters the target scenario. This implementation shows a specific method for the electronic device to determine whether to enter the target scenario at the software level in a speed measurement scenario.

[0017] In one implementation, in response to the electronic device entering the target scene, the electronic device transmits data based on the second MTU value, including: 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. This implementation shows a specific method for the electronic device to adjust the MTU value of the electronic device at the software level in the speed measurement scenario, so that the rate at which the electronic device transmits data in the speed measurement scenario can be increased.

[0018] In one implementation, the electronic device determines whether to leave the target scene, including: the processor determines whether the electronic device leaves the target scene. This implementation shows a specific method for the electronic device to determine whether to enter the target scene at the software level in a speed measurement scenario.

[0019] 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 processor generates a second instruction, and sends the second instruction to the kernel layer; the kernel layer responds to the second instruction and transmits data based on the first MTU value. This implementation shows a specific method for the electronic device to restore the default MTU value at the software level after leaving the speed measurement scene, so that compatibility issues can be avoided in scenes other than the speed measurement scene.

[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 in the first aspect and any implementation method 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 in the first aspect and any implementation method 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 in the above-mentioned first aspect and any implementation method thereof.

[0025] It can be understood that the electronic devices, computer-readable storage media and computer program products provided in the above-mentioned 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 drawings required for use in the embodiments are briefly introduced below. 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 a data packet transmission scenario;

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

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

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

[0031] Figure 5 is an interactive schematic diagram of a 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 is another interactive schematic 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 the embodiment of the present application;

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

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

[0037] Fig.11is a schematic diagram of the structure of a data transmission device provided in an embodiment of the present application;

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

[0039] The technical solution of the embodiment of the present application will be clearly described below in conjunction with the drawings in the embodiment 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 may 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 "plurality" means two or more. The words "first", "second", etc. do not limit the quantity and execution order, and the words "first", "second", etc. do not limit them to be 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 as "exemplary" or "for example" in this application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

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

[0043] The method provided in the embodiment of the present application can be applied to 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 in wired networks or wireless networks. A wired network refers to a network that uses physical cables as transmission media, such as copper wires and optical fibers. A wired network can convert data signals into electrical or optical signals for transmission. A wireless network refers to a network that uses radio waves for data transmission, usually including wireless fidelity (Wi-Fi) networks and cellular mobile networks (such as 4G and 5G networks). A wireless network can convert data signals into wireless signals for transmission.

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

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

[0048] The transmission process of a sending device, a transfer device, and a receiving device in a Wi-Fi network is used as an example to illustrate, wherein the sending device refers to the party that sends the data packet, which can be a mobile phone 10, a tablet computer, a wearable device, etc. The transfer device is a device that can act as a transmission transfer station for wireless signals, which can be a router 20, a switch, etc. The receiving device refers to the party that receives the data packet, which 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 transit 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 transit 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 the data packet transmission process, the mobile phone 10 usually sends data packets under the limitation of the corresponding maximum transmission unit (Maximum Transmission Unit, MTU). MTU refers to the maximum size of a data packet transmitted in an unsegmented manner in a network connection, usually in bytes. The mobile phone 10 usually has a default MTU value, which is usually determined according to the network standard or the default configuration of the operating system. When the mobile phone 10 needs to send a data packet, the mobile phone 10 sets the size of the data packet based on the default MTU value. Correspondingly, the router 20 receives and forwards data packets under the limitation of the corresponding MTU. Routers 20 of different models may have different default MTU values, which are usually determined according to the network standard or the default configuration of the supplier. The default MTU value in the router 20 is usually set to a value suitable for most network situations to provide good performance and compatibility. For example, the MTU value of the router 20 can be set to 1500 bytes. However, in some virtual private networks (VPNs), the router 20 may need to set a smaller MTU value to avoid fragmentation and delay of data packets. 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 larger MTU value to the router 20, the router 20 may refuse to forward the data packet with a larger MTU value due to its insufficient processing capacity. If the MTU value is too small, the rate at which the mobile phone 10 transmits data packets is affected.

[0054] That is, the default MTU value of the mobile phone 10 needs to be compatible with the default MTU value of the router 20. In order to make the default MTU value of the mobile phone 10 compatible with different models of routers 20, when the MTU value of the router 20 can be 1500 bytes or 1400 bytes, the default MTU value of the mobile phone 10 usually needs to be set to 1400 bytes, so that the router 20 can receive the data packets transmitted by the mobile phone 10 with the maximum MTU value.

[0055] When the default MTU value of the mobile phone 10 is 1400 bytes, when a 1430-byte data packet needs to be transmitted, the mobile phone 10 will fragment the 1430-byte data packet to adapt to the MTU. Fragmentation refers to the process of splitting a larger data packet into smaller fragments. Specifically, a 1430-byte data packet can be split into a 1400-byte data packet and a 30-byte data packet to adapt to the default MTU value of the mobile phone 10. In this way, since the mobile phone 10 fragments a data packet into two data packets for transmission, the rate at which the mobile phone 10 transmits the data packet is reduced 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 as transmitting devices, wherein the electronic devices include but are not limited to mobile phones, tablet computers, personal computers, workstation devices, 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 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application.

[0060] like Figure 2 As shown, the electronic device 100 may include a processor 110, a memory 120, a USB (Universal Serial Bus) 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 screen 193, and a Subscriber Identification Module (SIM) card interface 194, etc. Among them, 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, etc. 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 is to be understood that the structure illustrated in the embodiment of the present application does 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 in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[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 processor (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), etc. Different processing units may be independent devices or integrated into one or more processors.

[0063] In an embodiment of the present application, the AP may be a separate chip or integrated with other devices. For example, the AP and GPU may be integrated on the same chip. In this way, the AP or the chip integrated with the AP can run application programs 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 the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and a peripheral device. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices, etc.

[0066] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic 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 in the above embodiments, or a combination of multiple interface connection methods.

[0067] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the electronic device through 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 supplies power to the processor 110, the memory 120, the display screen 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 number, battery health status (leakage, impedance), etc. 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 the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[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 implement the transmission of data packets in a cellular mobile network based on the mobile communication module 150 .

[0073] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a 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 networks), 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, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of the signal, 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, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include Global System for Mobile communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time-Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. 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] The electronic device 100 implements the display function through a GPU, a display screen 193, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 193 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

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

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

[0080] The ISP is used to process the data fed back by the camera 192. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. The ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP can be set in the camera 192.

[0081] The camera 192 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element 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 RGB, RYYB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 192, where N is a positive integer greater than 1.

[0082] The electronic device 100 can implement audio functions such as music playing 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] The touch sensor 180A is also called a "touch control device". The touch sensor 180A can be set on the display screen 193, and the touch sensor 180A and the display screen 193 form a touch screen, also called a "touch control screen". The touch sensor 180A is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 193. In other embodiments, the touch sensor 180A can also be set on the surface of the electronic device 100, which is different from the position of the display screen 193.

[0084] The gyro 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 gyro sensor 180B. The gyro sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyro 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 gyro 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 through the air pressure value measured by the air pressure sensor 180C to assist 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 leather 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 according to the geomagnetic sensor 180D. Then, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, the flip cover can be automatically unlocked.

[0087] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in all directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.

[0088] The distance sensor 180F is used to measure the distance. The electronic device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure the 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 that 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 a 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 avoid abnormal shutdown of the electronic device 100 due to low temperature. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 performs a boost on the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.

[0092] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input 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 pulling it out 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, and the like. 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 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device 100.

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

[0097] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system library, 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 applications such as battery management, camera, gallery, calendar, call, map, navigation, music, video, short message, etc.

[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 the network data monitoring feature 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 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 a 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 the user's 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 light 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, etc.

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

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

[0109] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0110] The system library may 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 the fusion of 2D and 3D layers for multiple applications.

[0112] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. 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] The network driver can be used to manage the network interface card or network adapter in the computer system, so that the computer can communicate through the network. Specifically, the network driver can send and receive network data packets, establish and maintain network connections, and parse and process network protocols.

[0117] Wherein, network driver can include Ethernet driver, wireless network driver, Bluetooth driver and modem driver etc., like this, electronic device 100 can support wired network communication based on Ethernet protocol, wireless network communication based on Wi-Fi protocol or other wireless network protocols, Bluetooth communication based on Bluetooth protocol and dial-up Internet access based on telephone line or other transmission medium. Under these communication modes, kernel layer can carry out data transmission. It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation to electronic device 100. In other embodiments of the present application, electronic device 100 can include more or less parts than shown in the figure, or combine some parts, or split some parts, or different parts are arranged. The parts shown in the figure can be implemented in hardware, software or software and hardware combination.

[0118] Figure 4 It 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 specific type of uplink data is not limited in the embodiment of the present application. In an embodiment of the present application, the transmission process of uplink data in a Wi-Fi network is exemplified.

[0122] The electronic device 100 is set with a first MTU value by default, and 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 can be 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 embodiment of the present application does 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 the parameter, and the parameter may call the first MTU value by default. 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, and the specific calling method of the MTU value parameter is not limited in the embodiment of the present application.

[0125] 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 (for example: Ookla ), etc., the embodiments of the present application do not limit the specific types of speed measurement applications in the preset whitelist.

[0128] In the embodiment of the present application, the target scenario can be a speed test scenario, which refers to a scenario used in a specific network speed test, and this scenario usually includes specific network conditions and test parameters to simulate the operating conditions of actual network applications. The electronic device 100 can simulate real scenarios, compare different network services, optimize network services, and verify network service quality in the speed test scenario.

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

[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] 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, and the embodiment of the present application does not limit the specific type of the processor.

[0134] That is, the electronic device 100 determines whether to enter the speed measurement scenario through the processor. In one implementation, the processor can obtain program information corresponding to the first application through the system interface, such as the package name, program name, etc. After the processor obtains the program information, the processor compares the program information with the preset whitelist, and determines whether the electronic device 100 enters the 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 starts make 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? When it is in the preset whitelist, it is determined to enter the speed test scenario.

[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 here that although the electronic device 100 sets the first MTU value by default so that the data packet is transmitted under the restriction of the first MTU value in most scenarios, it does not mean that the transmission capacity of the electronic device 100 is limited by the first MTU value in any case. 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 of transmitting the data packet.

[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, a second MTU value is preset in the electronic device 100, and the second MTU value can be used to enable the electronic device 100 to avoid fragmentation of data packets in a speed measurement scenario and increase the rate of transmitting data packets. 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 only used for exemplary description, and the embodiment of the present application does 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 the configuration file, mapping 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 1400 bytes of calling the first MTU value to 1500 bytes of calling the second MTU value, 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 setting of the MTU value can also be performed by calling the first MTU value and the second MTU value in other ways except 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] Step S104, when the electronic device 100 detects that the first application in the preset whitelist switches from foreground operation to background operation, it determines to leave the target scene, or when the electronic device 100 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] Step S1041, when the processor detects that the first application in the preset whitelist switches from foreground operation to background operation, it determines to leave the target scene, or when the processor 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, and after the first application switches to background operation, determine 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 measurement 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, and 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 a non-essential setting mode. 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 here that when the same first application is switched from the foreground to the background, or the first application is replaced in the foreground, the problem of ping-pong setting is easy to occur. Ping-pong setting usually occurs during the rapid interaction of the system of the electronic device 100, 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 the first delay time, thereby avoiding the problem of ping-pong setting.

[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 go into details.

[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 flow chart 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] 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 rate of data transmission. 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 rate of data transmission. The electronic device 100 can also obtain the current upload and download data volume through a traffic monitoring application to determine the rate of data transmission. In the embodiment of the present application, the specific method for the electronic device 100 to obtain the rate of data transmission 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 to say, 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 of 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 the electronic device 100 acquires the transmitted data is actually a throughput rate, including the uplink rate corresponding to the uplink data, and / or the downlink rate corresponding to the downlink data. The uplink rate is the rate at which data is uploaded from the electronic device 100 to the network, and the downlink rate is the rate at which data is downloaded from the network to the electronic device 100. The throughput rate refers to the amount of data transmitted over the network per unit time. For example, the uplink rate acquired by the electronic device 100 is 230Mbps, and the downlink rate is 250Mbps.

[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] Step S1061: The processor obtains the rate of transmitting data.

[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 rate of transmitting data 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 may be 200 Mbps. Therefore, when the uplink rate of the electronic device 100 is 230 Mbps, the uplink rate is greater than the first threshold. The electronic device 100 may 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 rate of transmitting data includes a downlink rate, the first threshold may correspond to the downlink rate.

[0176] For example, when the electronic device 100 is in 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 will first measure the downlink rate and then measure the uplink rate, therefore, when the electronic device 100 measures the downlink rate and the downlink rate meets the speed measurement standard, the electronic device 100 can adjust the MTU value before measuring the uplink rate to increase the uplink rate.

[0177] In the case where 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 in a Wi-Fi network, the first sub-threshold of the electronic device 100 can be 200Mbps, and the second sub-threshold can be 200Mbps. Therefore, when the uplink rate of the electronic device is 230Mbps and the downlink rate is 250Mbps, 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 the speed measurement scene. In this way, the electronic device 100 adds a comparison of the downlink rate, which can improve the accuracy of judging whether to enter the speed measurement scene. It should be noted here that since the electronic device 100 can not only connect to a Wi-Fi network, but also connect 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, and accordingly, the first threshold can be set to different values ​​corresponding to different network types, and the specific value of the first threshold is not limited in the embodiment of the present application.

[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 method of step S108 can refer to step S103 in the above embodiment, which will not be described in detail in this embodiment of the present 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 rate is less than or equal to the first threshold, the electronic device 100 determines to leave 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, since 100 Mbps is less than 200 Mbps, the electronic device 100 can determine to leave the speed measurement scenario.

[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 of applications and switching of applications between the foreground and the 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 above-mentioned embodiment to set the delay time, and this embodiment does not limit 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 the 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 rate of transmitting data, 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 manner 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 the 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 packet includes data packets of 1410 bytes, 1420 bytes, 1430 bytes, 1440 bytes, 1450 bytes, and 1460 bytes, so the first number is 6.

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

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

[0207] In step S1111, the processor obtains a rate of transmitting data, 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 may be 200Mbps, and the second threshold of the electronic device 100 may be 0.5. Therefore, when the rate of the electronic device 100 is 230Mbps, the electronic device 100 may determine that the rate is greater than the first threshold, and 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 may determine that the first ratio is greater than the second threshold, and then determine to enter the speed measurement scenario when the rate 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 numerical value of the second threshold.

[0211] Further Fig. 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 Fig. 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 method of step S113 can refer to step S103 in the aforementioned embodiment, which will not be described in detail in the 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 to leave 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 to leave the speed measurement scenario.

[0221] Further Fig. 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 of applications and switching of applications between the foreground and the 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 above-mentioned embodiment to set the delay time, and this embodiment does not limit whether to set the delay time.

[0225] Further Fig. 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] Fig.10 This is another flow chart of the data transmission method provided in the embodiment of the present application.

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

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

[0233] Step S202: The electronic device 100 determines whether it has entered 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, and the second MTU value is greater than the first MTU value.

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

[0236] Step S204: the electronic device 100 determines whether to leave 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 to avoid compatibility issues in scenarios other than the speed measurement scenario.

[0239] Steps S201-S203 and their 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 above-mentioned embodiments provided by the present application, various schemes of the data transmission method provided by the present application are introduced from the perspective of the electronic device 100. It is understandable that, in order to realize the above-mentioned functions, the electronic device 100 includes a hardware structure and / or software module corresponding to each function. It should be easily appreciated by those skilled in the art 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] Fig.11 It is a structural diagram of the data transmission device provided in an embodiment of the present application.

[0243] like Fig.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 used 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 used 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 leaves the target scene.

[0248] The first transmission module 201 is further used 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] Fig.12 It is a structural diagram of a data transmission device provided in another embodiment of the present application.

[0251] like Fig.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 devices may 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 may pass 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, etc. Among them, different processing units may be independent devices or integrated in one or more processors. The memory 1002 is coupled to the processor 1003 for storing various software programs and / or computer instructions, and the memory 1002 may include a volatile memory and / or a non-volatile memory. When the processor executes the computer instructions, the data transmission device can execute each function or step executed by the electronic device 100 in the above method embodiment.

[0252] 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: 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 groups 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 groups 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 located 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 groups 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 transmitting 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 groups of instructions in the memory 1002 are executed by the processor 1003, the device is used to perform the following method steps: obtain 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 is 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 groups 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 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, 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 used to perform the following method steps: when it is determined that the rate is less than or equal to the first threshold, it is determined 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 a first threshold, and / or the first ratio is less than or equal to a 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 device 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 device is configured to perform the following method steps: the processor determines whether the electronic device enters the 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 device 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 the electronic device 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, which are not specifically limited in the embodiment of the present application.

[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 each function or step executed by the electronic device in the above-mentioned method embodiment.

[0270] The embodiment of the present application also provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes each function or step executed 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 the present 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 only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be 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 separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0274] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[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, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0276] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims

1. A data transmission method, characterized in that: Applied to electronic equipment, the method comprises: 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 scene, the electronic device transmits data based on a second MTU value, where the second MTU value is greater than the first MTU value.

2. The data transmission method according to claim 1, characterized in that: 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, characterized in that: The electronic device determines whether to enter 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 2, characterized in that: The electronic device determines whether to enter a target scenario that triggers adjustment of the MTU value, including: The rate at which the electronic device acquires transmission data; When the rate is greater than a first threshold, the electronic device determines that it has entered the target scene.

5. The data transmission method according to claim 2, characterized in that: The electronic device determines whether to enter a target scenario that triggers adjustment of the MTU value, including: The electronic device acquires a rate of transmitting data, a total number of data packets transmitted based on the rate, and a first number of target data packets in the data packets, wherein a data packet size of the target data packet is greater than the 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 scene, and the first ratio is a ratio of the first number to the total number.

6. The data transmission method according to claim 3, characterized in that: The electronic device determines whether to leave the target scene, including: 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.

7. The data transmission method according to claim 6, characterized in that: In response to the electronic device leaving the target scene, the electronic device transmitting data based on the first MTU value, comprising: 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.

8. The data transmission method according to claim 4, characterized in that: The electronic device determines whether to leave the target scene, including: When the rate is less than or equal to the first threshold, the electronic device determines that it has left the target scene.

9. The data transmission method according to claim 5, characterized in that: The electronic device determines whether to leave the target scene, including: 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.

10. The data transmission method according to any one of claims 2 to 9, characterized in that: 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.

11. The data transmission method according to claim 10, characterized in that: The electronic device determines whether to enter 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.

12. The data transmission method according to claim 11, characterized in that: In response to the electronic device entering the target scene, the electronic device transmitting data based on the second MTU value, including: 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 transmits data based on the second MTU value in response to the first instruction.

13. The data transmission method according to claim 12, characterized in that: The electronic device determines whether to leave the target scene, including: The processor determines whether the electronic device leaves the target scene.

14. The data transmission method according to claim 13, characterized in that: In response to the electronic device leaving the target scene, the electronic device transmitting data based on the first MTU value, comprising: 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.

15. A data transmission device, characterized in that: Applied to electronic equipment, the device comprises: A first transmission module, wherein the first transmission module is used 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 first transmission module is further used to transmit data based on a second MTU value in response to the electronic device entering the target scene, where the second MTU value is greater than the first MTU value.

16. An electronic device, characterized in that: include: 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 any one of claims 1-14.

17. 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 14.

Citation Information

Patent Citations

  • Temperature control method and related equipment

    CN116709417A

  • Detecting maximum transmission unit value

    EP3917116A1

  • Method for processing data and an electronic device thereof

    US20150131469A1

  • Maximum transmission unit size selection for wireless data transfer

    US20190306072A1

  • Adjustment method and apparatus for maximum transmission unit of terminal, and terminal device

    WO2017190467A1