Data transmission method and electronic device

By adjusting the time division multiplexing ratio of WiFi and Bluetooth communication, we ensure that WiFi communication is allocated longer within the preset period, solving the WiFi delay problem caused by Bluetooth communication to seize time slot resources and improving the user experience.

WO2025161782A1PCT designated stage Publication Date: 2025-08-07HONOR DEVICE CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/142462
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-01-31
Filing Date
2024-12-25
Publication Date
2025-08-07

AI Technical Summary

Technical Problem

When time-division multiplexing WiFi and Bluetooth communication, Bluetooth communication may preempt time slot resources, resulting in delayed WiFi data transmission, affecting the user experience.

Method used

By dynamically adjusting the time division multiplexing ratio of WiFi and Bluetooth communication, the allocation of WiFi communication is greater than that of Bluetooth communication, ensuring that WiFi communication dominates during the preset communication cycle, and reducing the impact of Bluetooth communication on WiFi communication.

Benefits of technology

It effectively reduces the delay in WiFi data transmission, meets the real-time needs of delay-sensitive applications such as games and video applications, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024142462_07082025_PF_FP_ABST
    Figure CN2024142462_07082025_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of communications, and provides a data transmission method and an electronic device. The electronic device establishes a WiFi connection with a WiFi device and establishes a Bluetooth connection with a Bluetooth device. The method comprises: an electronic device receives a first operation of a user, the first operation being a user operation of starting a first application, or the first operation being a user operation of enabling a hotspot sharing function; in response to the first operation, the electronic device sets a time division multiplexing ratio of WiFi communication to Bluetooth communication, wherein the time division multiplexing ratio is used for indicating a ratio of a first duration allocated by the electronic device for WiFi communication to a second duration allocated for Bluetooth communication within a preset communication period, and the time division multiplexing ratio is greater than or equal to 1; and further, the electronic device carries out WiFi communication with the WiFi device in the set time division multiplexing ratio. In this way, the time latency of WiFi communication can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Data transmission method and electronic device

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on January 31, 2024, with application number 202410146560.1 and invention name “A Data Transmission Method and Electronic Device”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of communication technology, and in particular to a data transmission method and electronic device. Background Art

[0003] In order to meet the various communication needs of users, most electronic devices currently support multiple communication methods. For example, taking the electronic device as a mobile phone, the mobile phone supports multiple communication methods such as cellular network, WiFi (or recorded as Wi-Fi) communication, Bluetooth (BT) communication, etc. Different communication methods may transmit data through the same frequency band, such as WiFi and Bluetooth both transmit data on the 2.4 gigahertz frequency band (2.4G band). In this case, the electronic device can collect time division multiplexing (TDM) technology to transmit data of different communication methods. Time division multiplexing technology refers to the transmission of different data in adjacent different time periods on the same frequency band.

[0004] However, when electronic devices time-division multiplex multiple data channels, one channel of data may occupy the time slot resources and be transmitted first, while the other channel of data needs to wait until the time slot resources are released before it can be transmitted. This will increase the delay of data transmission and affect the user experience. Summary of the Invention

[0005] The present application provides a data transmission method and electronic device for dynamically adjusting the time division multiplexing ratio of WiFi data and Bluetooth data in a scenario where WiFi and Bluetooth are time-division multiplexed, thereby reducing the delay of WiFi data and Bluetooth data transmission.

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

[0007] In a first aspect, a data transmission method is provided, which is applied to an electronic device, wherein the electronic device has a WiFi connection established with a WiFi device and a Bluetooth connection established with a Bluetooth device. The method comprises: receiving a first user operation, wherein the first operation is a user operation to launch a first application, or the first operation is a user operation to enable a hotspot sharing function. In response to the first operation, a time division multiplexing ratio between WiFi communication and Bluetooth communication is set, wherein the time division multiplexing ratio indicates the ratio of a first duration allocated by the electronic device for WiFi communication to a second duration allocated for Bluetooth communication within a preset communication cycle, wherein the time division multiplexing ratio is greater than or equal to 1. In this manner, within the preset communication cycle, the first duration allocated by the electronic device for WiFi communication is greater than the second duration allocated for Bluetooth communication. Furthermore, the electronic device communicates with the WiFi device in accordance with the set time division multiplexing ratio. In this manner, the electronic device allocates a longer time period for WiFi communication than for Bluetooth communication, thereby allowing the electronic device to primarily use WiFi communication during communication, reducing the impact of Bluetooth communication on WiFi communication, and reducing the time delay in application data transmission of the first application.

[0008] In one possible implementation of the first aspect, the first application is a latency-sensitive application from a preset list of applications, such as a game application, a video application, or an instant messaging application. Alternatively, the first application is a speed measurement application used to test the communication rate of WiFi communication, such as a WiFi speed measurement application. Latency-sensitive applications and speed measurement applications have high requirements for real-time WiFi communication. The electronic device allocates a time division multiplexing ratio greater than or equal to 1 for WiFi communication and Bluetooth communication, thereby minimizing the time delay of application data transmission of the first application, thereby meeting the first application's requirement for real-time WiFi communication.

[0009] In another possible implementation of the first aspect, if the electronic device transmits Bluetooth data with the Bluetooth device, a time division multiplexing ratio is set according to a coding mode corresponding to the Bluetooth device.

[0010] In this implementation, although the electronic device has established Bluetooth communication with the Bluetooth device, the electronic device does not necessarily have Bluetooth business (i.e., transmit Bluetooth data) with the Bluetooth device. Therefore, when setting the time division multiplexing ratio of WiFi communication and Bluetooth communication, it can also be determined whether the electronic device has Bluetooth business with the Bluetooth device. If the electronic device has Bluetooth business with the Bluetooth device, the electronic device sets the time division multiplexing ratio according to the coding mode corresponding to the Bluetooth device, so that the electronic device reduces the time delay of WiFi communication through the set time division multiplexing ratio while meeting the requirements of the coding mode of Bluetooth communication.

[0011] In another possible implementation of the first aspect, the first application is in a preset application list, and the Bluetooth data is obtained based on the application data of the first application. If the electronic device meets a first preset condition, the time division multiplexing ratio is set according to the coding mode corresponding to the Bluetooth device. The first preset condition includes at least one of the following: a time delay of the application data is greater than a preset delay threshold; receiving a second user operation of turning the WiFi switch off and on while the first application is running; or detecting a preset data packet, the preset data packet being used to run the first mode of the first application.

[0012] In this implementation, if the electronic device meets the first preset condition, it indicates that the electronic device's WiFi communication has a large delay or has a high real-time requirement. In this case, the electronic device sets a time division multiplexing ratio based on the coding mode corresponding to the Bluetooth device. This allows the electronic device to reduce the time delay of WiFi communication through the set time division multiplexing ratio while also meeting the requirements of the Bluetooth communication coding mode.

[0013] In another possible implementation of the first aspect, when the coding mode corresponding to the Bluetooth device is the first coding mode, the time division multiplexing ratio is set to the first ratio. When the coding mode corresponding to the Bluetooth device is the second coding mode, the time division multiplexing ratio is set to the second ratio. The code rate of the first coding mode is less than the code rate of the second coding mode, and the first ratio is greater than the second ratio. For example, the first coding mode is any one of the SBC mode, AAC mode, aptX mode, LDAC330 mode, and LDAC660 mode, and the first ratio is 2:1. The second coding mode is the LDAC990 mode, and the second ratio is 1:1.

[0014] In another possible implementation of the first aspect, the first application is a speed measurement application for testing the communication rate of WiFi communication. If the electronic device transmits Bluetooth data with the Bluetooth device, then when the encoding mode corresponding to the Bluetooth device is the third encoding mode, the time division multiplexing ratio is set to the third ratio.

[0015] In this implementation, speed measurement applications typically have a short runtime and are used to test the maximum communication rate of WiFi communication. In this case, the electronic device can allocate a larger first duration for WiFi communication and a smaller second duration for Bluetooth communication within a preset communication cycle to maximize the communication rate of WiFi communication. For example, the third encoding mode is any one of SBC mode, AAC mode, aptX mode, LDAC330 mode, LDAC660 mode, and LDAC990 mode, and the third ratio is 10:1.

[0016] In another possible implementation of the first aspect, when the electronic device is in Bluetooth communication with the Bluetooth device, the electronic device performs Bluetooth communication with the Bluetooth device according to a time division multiplexing ratio, such as transmitting Bluetooth data with the Bluetooth device during a second duration within a preset communication cycle. In this way, time division multiplexing of WiFi communication and Bluetooth communication is achieved.

[0017] In another possible implementation of the first aspect, if there is no Bluetooth data to be transmitted between the electronic device and the Bluetooth device, then when the coding mode corresponding to the Bluetooth device is the fourth coding mode, the time division multiplexing ratio is set to the fourth ratio.

[0018] In this implementation, if there is no Bluetooth service between the electronic device and the Bluetooth device, the electronic device sets the time division multiplexing ratio according to the coding mode corresponding to the Bluetooth device, so that the electronic device reduces the time delay of WiFi communication through the set time division multiplexing ratio while also reserving a time period that meets the coding mode requirements of Bluetooth communication. For example, when the coding mode corresponding to the Bluetooth device is any one of the coding modes of SBC mode, AAC mode, aptX mode, LDAC330 mode, LDAC660 mode, and LDAC990 mode (i.e., an example of the fourth coding mode), the electronic device sets the time division multiplexing ratio to 10:1 (an example of the fourth ratio).

[0019] In a second aspect, the present application provides an electronic device comprising: a memory, a processor, and a computer program stored in the memory. When the processor runs the computer program, the electronic device executes the method described in the first aspect and any possible implementation thereof.

[0020] In a third aspect, the present application provides a computer-readable storage medium storing a computer program. When the computer program is executed by an electronic device, the electronic device executes the method described in the first aspect and any possible implementation thereof.

[0021] In a fourth aspect, the present application provides a computer program product comprising program instructions, including a computer program, which, when executed by an electronic device, enables the computer to perform the method described in the first aspect and any possible implementation thereof. For example, the computer may be the electronic device described above.

[0022] In a fifth aspect, the present application provides a chip system, which is applied to an electronic device. The chip system includes an interface circuit and a processor. The interface circuit and the processor are interconnected via a circuit. The interface circuit is configured to receive signals from a memory and send signals to the processor, the signals including computer instructions stored in the memory. When the processor executes the computer instructions, the electronic device executes the method described in the first aspect and any possible implementation thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] FIG1 is a schematic diagram of an electronic device transmitting data through multiple communication modes according to an embodiment of the present application;

[0024] FIG2 is a schematic diagram of an electronic device transmitting Bluetooth data and WiFi data through time division multiplexing according to an embodiment of the present application;

[0025] FIG3 is a flowchart of a WiFi communication process provided by an embodiment of the present application;

[0026] FIG4 is a schematic diagram of a WiFi data transmission process provided by an embodiment of the present application;

[0027] FIG5 is a schematic diagram of a time delay of WiFi data provided by an embodiment of the present application;

[0028] FIG6 is a schematic diagram of another time delay of WiFi data provided by an embodiment of the present application;

[0029] FIG7 is a hardware structure block diagram of a mobile phone 100, an example of an electronic device provided in an embodiment of the present application;

[0030] FIG8 is a diagram illustrating software and hardware interactions of a mobile phone 100, an example of an electronic device, provided in an embodiment of the present application;

[0031] FIG9 is a flowchart of a data transmission method provided in an embodiment of the present application;

[0032] FIG10 is a flow chart of a time division multiplexing ratio setting provided in an embodiment of the present application;

[0033] FIG11 is a flowchart of another time division multiplexing ratio setting provided in an embodiment of the present application. DETAILED DESCRIPTION

[0034] Electronic devices support multiple communication methods. For example, electronic devices support multiple communication methods such as cellular networks, WiFi, and Bluetooth. Electronic devices can transmit data through multiple communication methods. For example, as shown in Figure 1, the electronic device is connected to a WiFi device (such as a router) and a Bluetooth device (such as a Bluetooth headset) respectively. The electronic device communicates with the WiFi device under user control and transmits the application data of the game application via WiFi. During the communication process with the WiFi device, the electronic device also transmits the audio data of the game application to the Bluetooth device so that the user can listen to the audio data of the game application through the Bluetooth device.

[0035] For different communication modes, the frequency bands of different communication modes can be different or the same. For example, the frequency bands of cellular networks include 700 MHz, 850 MHz, and other frequency bands. The frequency bands of WiFi and Bluetooth are both 2.4 GHz. For both WiFi and Bluetooth communication modes, since both communication modes transmit data in the 2.4 GHz frequency band, if an electronic device transmits WiFi data and Bluetooth data simultaneously through the 2.4 GHz frequency band, interference will occur between the WiFi data and the Bluetooth data.

[0036] To reduce interference between WiFi data and Bluetooth data, in some implementations, electronic devices are equipped with separate antennas for WiFi and Bluetooth. The electronic device can transmit WiFi data and Bluetooth data using different antennas. For example, an electronic device may be equipped with both a cellular network antenna and a WiFi antenna. The electronic device may use the cellular network antenna to transmit Bluetooth data and the WiFi antenna to transmit WiFi data. For another example, an electronic device may be equipped with multiple antennas for transmitting Bluetooth and WiFi data. The electronic device may use one of the multiple antennas to transmit Bluetooth data and another of the multiple antennas to transmit WiFi data.

[0037] However, as electronic devices become increasingly smaller and more portable, the isolation between multiple antennas installed inside electronic devices is insufficient. When electronic devices simultaneously receive Bluetooth data and WiFi data through different antennas, interference may occur between the Bluetooth data and the WiFi data.

[0038] In other implementations, the electronic device can transmit Bluetooth data and WiFi data in a time-division multiplexing manner, that is, transmit Bluetooth data and WiFi data respectively in adjacent time periods on the same frequency band. For example, as shown in FIG2 , when the electronic device transmits Bluetooth data and WiFi data in a time-division multiplexing manner, it transmits Bluetooth data in the first time period, transmits WiFi data in the second time period, transmits Bluetooth data in the third time period, transmits WiFi data in the fourth time period, and so on. It can be seen that the electronic device transmits Bluetooth data and WiFi data alternately, and in the same time period, the electronic device only transmits data of one communication mode, such as Bluetooth data or WiFi data. In this way, the mutual influence of Bluetooth data and WiFi data during the transmission process can be reduced.

[0039] However, when an electronic device transmits Bluetooth data and WiFi data through time division multiplexing, the electronic device cannot transmit WiFi data during the period of Bluetooth data transmission, which will cause a time delay in WiFi data transmission. In addition, in some cases, the electronic device will give priority to transmitting Bluetooth data to improve the effect of Bluetooth communication. For example, in a call scenario, the electronic device will give priority to transmitting call data to the Bluetooth headset. It is understandable that the electronic device can give priority to transmitting Bluetooth data by allocating a time period longer than the WiFi communication for Bluetooth communication, so that the time division multiplexing ratio of WiFi communication to Bluetooth communication is less than 1.

[0040] Exemplarily, when an electronic device transmits Bluetooth data and WiFi data via time-division multiplexing, the electronic device acts as a station (STA) in WiFi communication and transmits WiFi data to an access point (AP) (e.g., a router). Taking the example of testing WiFi communication using an Internet packet explorer (ping), the process of WiFi communication between the station and the access point is shown in Figure 3. When the electronic device (i.e., the station) transmits WiFi data, the station sends test request 1 to the access point at time x1. The access point responds to test request 1 and returns test response 1 to the station. The station receives test response 1 at time x1+t. When the electronic device (i.e., the station) transmits Bluetooth data, the station sends test request 2 to the access point at time x2, notifying the access point through test request 2 that the station enters a sleep state. If the station enters a sleep state, the access point does not send a message to the station and waits for the station to enter a WiFi data period. When the electronic device (i.e., the station) enters a WiFi data period, the station notifies the access point that the station has entered a wake-up state. If the station enters a wake-up state, the access point returns test response 2 to the station. The station receives test response 2 at time x2+t+T.

[0041] As you can see, during the Wi-Fi data period, it takes time t for the electronic device to receive a reply to a test request (receive a test response). During the Bluetooth data period, the electronic device transmits Bluetooth data, and the Wi-Fi data is transmitted with a delay. Only when the electronic device enters the Wi-Fi data period will it transmit Wi-Fi data. In this case, it takes time t + T for the electronic device to receive a reply to a test request.

[0042] In order to more intuitively reflect the time delay of WiFi data transmission of electronic devices during time division multiplexing, the transmission process of WiFi data is exemplified below with reference to FIG4 .

[0043] In the absence of Bluetooth data, the electronic device transmits data via WiFi. As shown in Figure 4A, the electronic device acts as a client for WiFi data transmission and receives data packets sent by a server (such as a server or router) via WiFi (indicated by an arrow pointing from the server to the client). Correspondingly, the electronic device can also send data packets to the server via WiFi (indicated by an arrow pointing from the client to the server).

[0044] When an electronic device transmits WiFi data and Bluetooth data via time division multiplexing, as shown in FIG4B, after the client sends a data packet to the server (represented by an arrow pointing from the client to the server), the electronic device enters a period of Bluetooth data transmission (such as a Bluetooth period). In this case, the client needs to wait for the Bluetooth data transmission period before entering a period of WiFi data transmission (such as a WiFi period), and then receive the data packet sent by the server via WiFi. It can be seen that the solid arrow used to represent the client receiving the data packet transmitted by the server is after the dotted arrow (representing a data packet received by the client via WiFi in the absence of Bluetooth data). That is, the client will delay receiving the data packet sent by the server via WiFi. Only after entering the period of WiFi data transmission will the client receive the data packet sent by the server via WiFi. This will cause the transmission rate of WiFi data to slow down, making the user experience worse.

[0045] It is understandable that the actual data transmission process of the electronic device is relatively complex. FIG4 is only an example of the two behaviors of receiving and sending WiFi data, and does not limit the transmission process of WiFi data.

[0046] As mentioned above, when an electronic device transmits Bluetooth data and WiFi data in a time-sharing manner, the Bluetooth data transmitted by the electronic device may increase the time delay of the WiFi data transmission. For Bluetooth data transmitted by the electronic device, the time delay caused by Bluetooth data to WiFi data varies under different encoding modes.

[0047] Exemplarily, the coding mode of the Bluetooth data may be any one of a subband coding (SBC) mode, an advanced audio coding (AAC) mode, an aptX (aptX) mode, LDAC330, LDAC660, and LDAC990.

[0048] Accordingly, the code rates corresponding to Bluetooth data in different coding modes are different. The code rate can also be called the bit rate, which is used to identify the number of bits of data transmitted per unit time. For example, the code rate can represent the number of bits transmitted per second. Among the various coding modes of Bluetooth data mentioned above, the code rate corresponding to the LDAC990 mode is the largest. The code rate corresponding to the LDAC660 mode is smaller than the code rate corresponding to the LDAC990 mode, and is larger than the code rates corresponding to the various coding modes such as SBC mode, AAC mode, aptX mode, and LDAC330 mode.

[0049] As the bit rate of Bluetooth data increases, the time delay of electronic devices transmitting Bluetooth data also increases.

[0050] In one example, in a ping test scenario, the time delay of an electronic device transmitting WiFi data is described with reference to FIG5 (where the horizontal axis represents the WiFi data packet sequence number and the vertical axis represents the time delay) using examples of an electronic device transmitting only WiFi data, time-sharing Bluetooth data and WiFi data in SBC mode, time-sharing Bluetooth data and WiFi data in AAC mode, and time-sharing Bluetooth data and WiFi data in LDAC660 mode. It can be seen that when the electronic device transmits only WiFi data, the time delay of WiFi data is approximately 4 milliseconds. When the electronic device transmits Bluetooth data and WiFi data in SBC mode in time-sharing, the time delay of WiFi data can reach approximately 24 milliseconds. When the electronic device transmits Bluetooth data and WiFi data in AAC mode in time-sharing, the time delay of WiFi data can reach approximately 23 milliseconds. When the electronic device transmits Bluetooth data and WiFi data in LDAC660 mode in time-sharing, the time delay of WiFi data can reach approximately 47 milliseconds.

[0051] In the above example, in the ping test scenario, the latency of the electronic device transmitting WiFi data is shown in Table 1. As can be seen, when transmitting only WiFi data, the latency is only 4 milliseconds. Similarly, when the electronic device transmits Bluetooth and WiFi data in a time-sharing manner, and if WiFi data transmission is not affected by Bluetooth data transmission, the latency is only 4 milliseconds.

[0052] In the case where the transmission of WiFi data is affected by the transmission of Bluetooth data, if the encoding mode of the Bluetooth data transmitted by the electronic device is SBC mode, the time delay for the electronic device to transmit WiFi data is 24 milliseconds. If the encoding mode of the Bluetooth data transmitted by the electronic device is AAC mode, the time delay for the electronic device to transmit WiFi data is 23 milliseconds. If the encoding mode of the Bluetooth data transmitted by the electronic device is aptX mode, the time delay for the electronic device to transmit WiFi data is 24.6 milliseconds. If the encoding mode of the Bluetooth data transmitted by the electronic device is LDAC330 mode, the time delay for the electronic device to transmit WiFi data is 25 milliseconds. If the encoding mode of the Bluetooth data transmitted by the electronic device is LDAC660 mode, the time delay for the electronic device to transmit WiFi data is 47.3 milliseconds. If the encoding mode of the Bluetooth data transmitted by the electronic device is LDAC990 mode, the time delay for the electronic device to transmit WiFi data is 152 milliseconds.

[0053] Table 1 Time delay of electronic devices transmitting WiFi data in the ping test scenario

[0054] NA stands for Not Available (NA).

[0055] In another example, using the example of a gaming application as the WiFi data, the impact of Bluetooth data transmission by an electronic device on WiFi data transmission in the above example is explained in conjunction with Table 2. Table 2 shows records of data packets transmitted by an electronic device via WiFi. Each record (corresponding to a row in the table) includes the data packet transmission time, transmission protocol, recording interval, sequence number, data packet information, and station status indication.

[0056] Table 2 Data packet records transmitted by electronic devices via WiFi

[0057] Transmission time is the moment an electronic device receives or sends a data packet. The packet number indicates the packet, and different packets have different packet numbers. The table also records the time delay for each packet transmission. Packets 1 through 3 are packets transmitted by the electronic device via Wi-Fi after waiting for Bluetooth data transmission. Packet 4 is a packet transmitted by the electronic device via Wi-Fi without waiting for Bluetooth data transmission. As can be seen, the time delays for Packets 1, 2, and 3 are all greater than the time delay for Packet 4 due to the need to wait for Bluetooth data transmission.

[0058] Therefore, when electronic devices transmit Bluetooth and WiFi data in a time-sharing manner, they may delay the transmission of gaming application data, that is, delay the transmission of WiFi data. Gaming application data generally requires high real-time performance, and a slower WiFi data transmission rate can seriously affect the user experience, resulting in a poor user experience.

[0059] The above transmission protocols are the protocols followed by electronic devices to transmit a data packet. The transmission protocols in the table include the User Datagram Protocol (UDP).

[0060] In some implementations, in addition to the information listed in the table above, the data packet record may also include one or more of the record number of each record, the time interval between two adjacent records, the Internet Protocol (IP) address and / or Media Access Control (MAC) address of the sender of the data packet, the IP address and / or MAC address of the receiver, and data packet information.

[0061] The sender IP address is the IP address of the device that sends the data packet. The receiver IP address is the IP address of the device that receives the data packet. If an electronic device sends a data packet, the electronic device is the sender of the data packet. If an electronic device receives a data packet, the electronic device is the receiver of the data packet.

[0062] The above-mentioned data packet information can be used to describe relevant information of the data packet. For example, the data packet transmission may include relevant information such as the source port number, destination port number, data packet length, and data packet sequence number.

[0063] In a gaming scenario, the time delays of WiFi data transmission are described using examples of an electronic device transmitting only WiFi data, time-sharing Bluetooth data and WiFi data in SBC mode, time-sharing Bluetooth data and WiFi data in AAC mode, time-sharing Bluetooth data and WiFi data in LDAC330 mode, and time-sharing Bluetooth data and WiFi data in LDAC990 mode. Figure 6 (the horizontal axis represents the WiFi packet sequence number, and the vertical axis represents the time delay) and Table 3 show that when the electronic device transmits only WiFi data, the WiFi data delay is approximately 24 milliseconds. When the Bluetooth data is transmitted in SBC, AAC, SBC, or LDAC330 modes, the WiFi data delays are relatively similar when the electronic device transmits Bluetooth data and WiFi data in time-sharing mode. Specifically, when the electronic device transmits Bluetooth data and WiFi data in SBC mode, the WiFi data delay can reach approximately 41 milliseconds. When the electronic device transmits Bluetooth data and WiFi data in AAC mode, the WiFi data delay can reach approximately 32 milliseconds. When the electronic device transmits Bluetooth data and WiFi data in LDAC660 mode, the WiFi data delay can reach approximately 35 milliseconds. When an electronic device transmits Bluetooth data and WiFi data in LDAC990 mode in a time-sharing manner, the time delay of WiFi data can reach approximately 169 milliseconds.

[0064] Table 3 Time delay of electronic devices transmitting WiFi data in gaming scenarios

[0065] In the two examples above, as the bit rate corresponding to the Bluetooth data encoding mode increases, the impact of Bluetooth data transmission on WiFi data transmission increases, and the time delay of WiFi data transmission increases accordingly. Among the various encoding modes mentioned above, the LDAC990 mode corresponds to the highest bit rate and the longest WiFi data transmission delay.

[0066] It is understandable that the time delay of WiFi data transmission varies in different data transmission scenarios. For example, in the above-mentioned ping test scenario, when only WiFi data is transmitted, the time delay of the electronic device transmitting WiFi data is 4 milliseconds. In the above-mentioned gaming scenario, when only WiFi data is transmitted, the time delay of the electronic device transmitting WiFi data is 24 milliseconds. It can be seen that in different data transmission scenarios, even without the influence of Bluetooth communication, the time delay of WiFi communication is different. The embodiments of the present application do not impose any restrictions on the specific time delay of WiFi data transmission.

[0067] Therefore, although electronic devices can reduce the mutual interference between Bluetooth communication and WiFi communication sharing the same frequency band through time division multiplexing, during the time division multiplexing process of Bluetooth communication and WiFi communication, Bluetooth communication may interrupt WiFi aggregation or WiFi communication data packet transmission, causing the time delay of WiFi communication to increase, resulting in a decrease in the throughput of WiFi communication, and causing the user experience of WiFi communication to deteriorate. Bluetooth communication may also cause the electronic device to have a poor ability to receive key messages of WiFi communication, such as the electronic device's ability to receive key messages such as REKEY messages and DHCP messages. Among them, the rekey message is used to provide the electronic device with a WiFi device to communicate with the WiFi device. If the electronic device does not obtain the key in the rekey message, the electronic device may be disconnected from the WiFi device. The DHCP message is used to provide an Internet Protocol (IP) address. If the electronic device delays receiving the DHCP message, the electronic device's connection to the WiFi device will be slowed down. If the Bluetooth data transmitted by Bluetooth communication is obtained based on the WiFi data of WiFi communication, the time delay of WiFi communication will also cause the time delay of Bluetooth communication.

[0068] Another method is also provided in an embodiment of the present application to reduce the impact of Bluetooth communication on WiFi communication when Bluetooth communication and WiFi communication coexist. Specifically, an electronic device is connected to a WiFi device and a Bluetooth device. The electronic device receives a first operation from a user. If the first operation is a user operation to start a first application, or a user operation to turn on a hotspot sharing function, the electronic device sets a time division multiplexing ratio of WiFi communication and Bluetooth communication in response to the first operation. The time division multiplexing ratio is used to indicate the ratio of the first duration allocated by the electronic device for WiFi communication to the second duration allocated for Bluetooth communication within a preset communication cycle. The time division multiplexing ratio is greater than or equal to 1. In this way, within the preset communication cycle, the first duration allocated by the electronic device for WiFi communication is greater than the second duration allocated for Bluetooth communication. Further, the electronic device performs WiFi communication with the WiFi device according to the set time division multiplexing ratio.

[0069] In this way, compared with Bluetooth communication, the electronic device allocates a longer time period for WiFi communication, so that during the communication process, the electronic device mainly uses WiFi communication, reducing the impact of Bluetooth communication on WiFi communication, and reducing the time delay of application data transmission of the first application.

[0070] The first application is an application with high real-time requirements for WiFi communication. For example, the first application is a game application, a video application, an instant messaging application, etc. When the electronic device runs the first application, the electronic device has high real-time requirements for WiFi communication. The electronic device allocates a time division multiplexing ratio greater than or equal to 1 for WiFi communication and Bluetooth communication, thereby reducing the time delay of the application data transmission of the first application, thereby meeting the first application's real-time requirements for WiFi communication.

[0071] The hotspot sharing feature provides a hotspot to other devices. When hotspot sharing is enabled, the electronic device shares its hotspot with other devices, enabling them to communicate via Wi-Fi. When the hotspot feature is enabled, the electronic device has a high demand for real-time Wi-Fi communication. By allocating a time-division multiplexing ratio of greater than or equal to 1 between Wi-Fi and Bluetooth communications, the electronic device minimizes latency in Wi-Fi transmission, thus meeting the electronic device's demand for real-time Wi-Fi communication.

[0072] For example, in the embodiments of the present application, the electronic devices may be mobile phones, tablet computers, desktop computers, laptop computers, handheld computers, notebook computers, ultra-mobile personal computers (UMPCs), netbooks, as well as cellular phones, personal digital assistants (PDAs), augmented reality (AR) and virtual reality (VR) devices, media players, wearable devices and other devices. The Bluetooth devices in the embodiments of the present application may be Bluetooth speakers, Bluetooth headsets, Bluetooth bracelets, multimedia players, Bluetooth TVs and other devices. The WiFi devices in the embodiments of the present application are devices for connecting electronic devices to WiFi. WiFi devices may be WiFi communication entities such as communication servers, routers, switches, and bridges. The embodiments of the present application do not impose any special restrictions on the specific forms of electronic devices, Bluetooth devices, and WiFi devices.

[0073] In the embodiment of the present application, the electronic device is a mobile phone 100 as an example, and the hardware structure of the electronic device is described through the mobile phone 100. As shown in Figure 7, the mobile phone 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identification module (SIM) card interface 195.

[0074] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), a driver processor, etc. Different processing units may be independent devices or integrated into one or more processors. The processor 110 may be the nerve center and command center of the mobile phone 100. The processor 110 may generate an operation control signal based on the instruction opcode and timing signal to complete the control of instruction fetching and execution.

[0075] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.

[0076] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the mobile phone 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.

[0077] The internal memory 121 can be used to store computer executable program code, which includes instructions. The processor 110 executes various functional applications and data processing of the mobile phone 100 by running the instructions stored in the internal memory 121. For example, in an embodiment of the present application, the processor 110 can execute instructions stored in the internal memory 121, and the internal memory 121 can include a program storage area and a data storage area.

[0078] The program storage area can store an operating system, at least one application required for a function (such as a sound playback function, an image playback function, etc.), a configuration file for the motor 191, etc. The data storage area can store data created during the use of the mobile phone 100 (such as audio data, a phone book, etc.). In addition, the internal memory 121 can include high-speed random access memory and non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0079] The charging management module 140 is used to receive charging input from a charger. The charger can be a wireless charger or a wired charger. While charging the battery 142, the charging management module 140 can also provide power to the mobile phone 100 through the power management module 141.

[0080] The wireless communication function of the mobile phone 100 can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor, and baseband processor. In some embodiments, antenna 1 of the mobile phone 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, so that the mobile phone 100 can communicate with the network and other devices through wireless communication technology.

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

[0082] The mobile communication module 150 can provide wireless communication solutions for mobile phone 100, including 2G / 3G / 4G / 5G. The mobile communication module 150 can include at least one filter, switch, power amplifier, low-noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modem processor for demodulation. Mobile phone 100 can achieve cellular network communication through the mobile communication module 150.

[0083] The wireless communication module 160 can provide wireless communication solutions applied to the mobile phone 100, including wireless local area networks (WLAN) (such as Wi-Fi (or WiFi), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication technology (NFC), infrared technology (IR), etc.

[0084] The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, frequency-modulates and filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 can also receive signals to be transmitted from the processor 110, frequency-modulate and amplify them, and then convert them into electromagnetic waves for radiation via antenna 2. The mobile phone 100 can implement WiFi communication and / or Bluetooth communication via at least one antenna through the wireless communication module 160. For example, the mobile phone 100 can implement WiFi communication and / or Bluetooth communication via two different antennas through the wireless communication module 160 in a time-sharing manner.

[0085] The sensor module 180 may include a pressure sensor, a gyro sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a Hall sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc. The mobile phone 100 may collect various data through the sensor module 180 .

[0086] Mobile phone 100 implements display functionality through a GPU, display screen 194, and an application processor. The GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.

[0087] Display screen 194 is used to display images, videos, etc. Display screen 194 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 (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. Mobile phone 100 can display the application interface of the first application through display screen 194.

[0088] It is to be understood that the interface connection relationship between the modules illustrated in this embodiment is merely a schematic illustration and does not constitute a structural limitation on the electronic device. In other embodiments, the electronic device may also include more or fewer modules than those provided in the above embodiments, and different interface connection methods or a combination of multiple interface connection methods may be used between the modules. The hardware structure of the electronic device provided in the embodiments of the present application may also refer to the hardware structure of the mobile phone 100 shown in the figure. The methods in the following embodiments can all be implemented in an electronic device having the above hardware structure.

[0089] The software system of the electronic device can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a microservice architecture, or a cloud architecture. In the embodiment of the present application, the electronic device is the mobile phone 100, and the software system of the electronic device adopts the layered architecture of the Android system as an example to illustrate the software structure of the electronic device.

[0090] A layered architecture divides software into several layers, each with distinct roles and responsibilities. Layers communicate with each other through software interfaces. In some embodiments, the Android system may include an application layer, an application framework layer, an Android runtime and system libraries, a hardware abstraction layer (HAL), and a kernel layer.

[0091] The application layer may include a series of application packages. For example, the application package may include games, cameras, gallery, calendar, calls, maps, navigation, WLAN, Bluetooth, music, video, short messages and other applications, which are not limited in this embodiment of the present application.

[0092] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions. For example, the application framework layer may include a window manager, content provider, view system, phone manager, resource manager, WiFi application framework, and notification manager, etc., which are not limited in this embodiment of the application.

[0093] The Android runtime consists of core libraries and a virtual machine (VM). The Android runtime is responsible for scheduling and management of the Android system. The core libraries consist of two parts: one containing the Java language's callable functions and the other the Android core library. The application layer and the application framework layer run in the VM. The VM executes the Java files in the application layer and application framework layer as binary files. The VM is responsible for performing functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

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

[0095] The HAL layer encapsulates the Linux kernel driver, provides an interface to the upper layer, and shields the implementation details of the underlying hardware. For example, the HAL layer may include the camera HAL, WiFi HAL, Bluetooth HAL, etc.

[0096] The kernel layer is the layer between hardware and software. It includes drivers and system services. Drivers include at least display drivers, camera drivers, audio drivers, sensor drivers, and Wi-Fi drivers.

[0097] The following example illustrates the process of setting the time-division multiplexing ratio for mobile phone 100, using the structure shown in FIG8 as an example. A user operates mobile phone 100 to open a game application (e.g., a first application). In response to the user's operation to open the game application, mobile phone 100 runs the game application in the application layer. While running the game application, the WiFi application framework in the application framework layer determines the time-division multiplexing ratio for WiFi and Bluetooth communications based on the encoding mode corresponding to the Bluetooth device. Furthermore, the WiFi application framework transmits the determined time-division multiplexing ratio to the WiFi driver via the WiFi hardware abstraction layer. The WiFi driver further transmits the determined time-division multiplexing ratio to the wireless communication module 160 of mobile phone 100. Wireless communication module 160 adjusts the WiFi communication period and the Bluetooth communication period according to the time-division multiplexing ratio, so that the ratio of the WiFi communication period (e.g., the first duration) to the Bluetooth communication period (e.g., the second duration) equals the time-division multiplexing ratio. In this manner, mobile phone 100 performs WiFi communication during the adjusted WiFi communication period and performs Bluetooth communication during the adjusted Bluetooth communication period.

[0098] As described above, upon receiving the first operation, the electronic device, in response to the first operation, adjusts the time division multiplexing ratio based on the coding mode corresponding to the Bluetooth device, such that the first duration of WiFi communication within the preset communication period is greater than or equal to the second duration of Bluetooth communication. In some implementations, the electronic device can set the time division multiplexing ratio between WiFi communication and Bluetooth communication based on a specific scenario of WiFi communication. For example, the electronic device can set the time division multiplexing ratio between WiFi communication and Bluetooth communication based on specific scenarios such as whether the first application is running, the time delay of WiFi communication, whether Bluetooth data is transmitted, the coding mode of Bluetooth communication, and whether preset conditions are met.

[0099] The first application is an application that has high requirements for real-time communication (or is called a delay-sensitive application). For example, the first application is a game application, a video application, an instant messaging application, etc. Alternatively, the first application is an application for testing the communication rate of WiFi communication (or is called a speed test application). For example, the first application is a WiFi network speed test application.

[0100] In one embodiment, the first operation is a user operation to start a first application. In response to the first operation, the electronic device sets the time division multiplexing ratio according to the coding mode corresponding to the Bluetooth device, and performs WiFi transmission according to the time division multiplexing ratio of the device. In the following embodiment, the electronic device is a mobile phone, the Bluetooth device is a Bluetooth headset, and the WiFi device is a router as an example to illustrate the method provided by the embodiment of the present application. As shown in Figure 9, the method provided by the embodiment of the present application includes the following steps:

[0101] S901: In response to a first operation by a user, the mobile phone displays an application interface of a first application.

[0102] The first application is one of multiple applications installed on the mobile phone. The first operation is used to instruct the launch of the first application. For example, the mobile phone displays a shortcut icon for the first application on the desktop. The mobile phone receives the first operation of a user clicking the shortcut icon for the first application. In response to the first operation, the mobile phone launches the first application and displays the application interface of the first application.

[0103] Before the mobile phone launches the first application, the interface displayed on the mobile phone can be called the initial interface. In response to the first operation, the mobile phone launches the first application and switches the displayed initial interface to the application interface of the first application. The foreground application of the mobile phone switches from the application corresponding to the initial interface to the first application. As a result of the first operation, the foreground application of the mobile phone changes. The foreground application is the application running in the foreground of the mobile phone. The application interface displayed on the mobile phone is the application interface of the foreground application. If the foreground application changes, the mobile phone executes S902.

[0104] S902: The mobile phone determines whether the first application is an application that has high real-time requirements for WiFi communication, such as a delay-sensitive application or a speed measurement application.

[0105] Latency-sensitive apps and speed-testing apps both require high real-time Wi-Fi communication. Bluetooth communication significantly impacts the Wi-Fi communication associated with latency-sensitive apps. If the phone detects a change in the foreground app, it further determines whether the first app is a latency-sensitive or speed-testing app.

[0106] In some implementations, the latency-sensitive application is an application in a preset application list. The mobile phone is provided with a preset application list, which contains at least one latency-sensitive application. The mobile phone can search for a first application in the preset application list. If the first application is in the preset application list, the first application can be considered a latency-sensitive application.

[0107] In other implementations, the speed test application is an application used to test the communication rate of WiFi communications. For example, the speed test application is used to test the maximum communication rate of WiFi communications. If the mobile phone detects an application process of the speed test application, such as an application process with a preset process name, the mobile phone may determine that the first application is a speed test application.

[0108] If the first application is a delay-sensitive application or a speed measurement application, the mobile phone executes S903 .

[0109] If the first application is not a delay-sensitive application or a speed measurement application, the mobile phone ends the current process.

[0110] S903: The mobile phone determines whether it is connected to a router and a Bluetooth headset.

[0111] The router operates in the 2.4G frequency band and can be used as a WiFi access point in the 2.4G frequency band, and can communicate with the mobile phone via WiFi in the 2.4G frequency band. The Bluetooth headset also operates in the 2.4G frequency band and can communicate with the mobile phone via Bluetooth in the 2.4G frequency band. If the first application is a delay-sensitive application or a speed measurement application, the first application has higher requirements for the real-time performance of WiFi communication. In this case, when the mobile phone is transmitting the application data of the first application via WiFi, if there is also Bluetooth data being transmitted, the transmission of the Bluetooth data will have a greater impact on the transmission of the application data of the first application. Therefore, if the first application is a delay-sensitive application or a speed measurement application, the mobile phone will further determine whether a router for WiFi communication and a Bluetooth headset for Bluetooth communication are connected at the same time.

[0112] If the mobile phone is connected to the router and the Bluetooth headset at the same time, the mobile phone executes S904.

[0113] If the mobile phone is not connected to a router or a Bluetooth headset, Bluetooth communication has little impact on the transmission of the application data of the first application. In this case, the mobile phone ends the current process.

[0114] S904: The mobile phone sets a time division multiplexing ratio according to the coding mode corresponding to the Bluetooth headset, and performs WiFi communication according to the set time division multiplexing ratio.

[0115] The time-division multiplexing ratio indicates the ratio between the first duration of WiFi communication and the second duration of Bluetooth communication within a preset communication cycle. A preset communication cycle is a period for WiFi communication and / or Bluetooth communication. Within a preset communication cycle, the mobile phone time-division multiplexes WiFi communication and Bluetooth communication. A preset communication cycle includes the first duration corresponding to WiFi communication and the second duration corresponding to Bluetooth communication. For example, if the preset communication cycle is 100 milliseconds and the time-division multiplexing ratio is 1:1, then within the 100 millisecond preset communication cycle, 50 milliseconds are used for WiFi communication and 50 milliseconds are used for Bluetooth communication.

[0116] If the mobile phone is connected to a router and a Bluetooth headset at the same time, the mobile phone sets the time division multiplexing ratio according to the coding mode corresponding to the Bluetooth headset, and the time division multiplexing ratio is greater than or equal to 1. The coding mode of Bluetooth communication is related to the quality of Bluetooth communication. The higher the sampling frequency corresponding to the coding mode of Bluetooth communication, the better the quality of Bluetooth communication, and the longer the time period required for Bluetooth communication within the preset communication cycle. Accordingly, the time division multiplexing ratio set by the mobile phone may also be different depending on the coding mode. For example, when the coding mode corresponding to the Bluetooth headset is SBC mode, the mobile phone sets the time division multiplexing ratio of WiFi communication and Bluetooth communication to 2:1. For another example, when the coding mode corresponding to the Bluetooth headset is LDAC990 mode, the time division multiplexing ratio of WiFi communication and Bluetooth communication is set to 1:1.

[0117] After the mobile phone sets the time division multiplexing ratio, the mobile phone performs WiFi communication in the first duration of the preset communication cycle and performs Bluetooth communication in the second duration of the preset communication cycle according to the set time division multiplexing ratio.

[0118] Through the method provided in the embodiment of the present application, the mobile phone can allocate a longer time period for WiFi communication when it is connected to a router and a Bluetooth headset at the same time and enters a delay-sensitive application or a speed measurement application. For example, when a router and a Bluetooth headset are connected, if the mobile phone enters a WiFi speed measurement application, the mobile phone sets the time division multiplexing ratio of WiFi communication and Bluetooth communication to 10:1 for any encoding mode among SBC mode, AAC mode, aptx mode, LDAC330 mode, LDAC660 mode and LDAC990 mode. In this way, the mobile phone can mainly use WiFi communication, reduce the impact of Bluetooth communication on WiFi communication, and reduce the time delay of application data transmission of the first application.

[0119] In other implementations, the mobile phone may first determine whether a router and a Bluetooth headset are connected, and then determine whether the first application is a latency-sensitive application or a speed measurement application. Alternatively, the mobile phone may simultaneously determine whether a router and a Bluetooth headset are connected and whether the first application is a latency-sensitive application or a speed measurement application. This embodiment of the application does not limit the order in which S902 and S903 are executed.

[0120] In an embodiment of the present application, the mobile phone can set the time division multiplexing ratio according to the coding mode corresponding to the Bluetooth headset. In some implementations, when the first application is a delay-sensitive application, as shown in Figure 10, the mobile phone sets the time division multiplexing ratio according to the coding mode corresponding to the Bluetooth headset, which may include the following steps:

[0121] S9041, the mobile phone determines whether Bluetooth data is being transmitted to the Bluetooth headset.

[0122] If the electronic device is connected to a router and a Bluetooth headset at the same time, the mobile phone can communicate with the router via WiFi during the process of running the first application to transmit the application data of the first application (i.e., WiFi data). The mobile phone can also transmit Bluetooth data to the Bluetooth headset during the process of running the first application. In some implementations, the Bluetooth data transmitted by the mobile phone to the Bluetooth headset is obtained based on the application data transmitted between the mobile phone and the router. For example, the application data of the first application may include image data and audio data. If the mobile phone is connected to a Bluetooth headset, and the application data of the first application also includes audio data, the mobile phone transmits the audio data of the first application to the Bluetooth headset during the process of running the first application to play the audio data of the first application through the Bluetooth headset.

[0123] Of course, even if the mobile phone is connected to a Bluetooth headset, there may not be any Bluetooth data transmitted between the mobile phone and the Bluetooth headset. For example, if the application data of the first application does not include audio data, the mobile phone will only transmit the application data of the first application via WiFi during the operation of the first application, and will not transmit Bluetooth data to the Bluetooth headset.

[0124] Since Bluetooth communication can affect WiFi communication, the mobile phone further determines whether there is Bluetooth service between the mobile phone and the Bluetooth headset when the mobile phone is connected to the router and the Bluetooth headset at the same time, such as determining whether the mobile phone transmits Bluetooth data of the first application to the Bluetooth headset.

[0125] If the mobile phone and the Bluetooth headset are transmitting Bluetooth data, the mobile phone executes S9042.

[0126] If there is no Bluetooth data transmitted between the mobile phone and the Bluetooth headset, the mobile phone executes S9046.

[0127] S9042: The mobile phone determines whether a first preset condition is met.

[0128] If the mobile phone meets the first preset condition, it indicates that the mobile phone's WiFi communication has a large delay or has a high real-time requirement. The first preset condition can be set according to the actual application scenario or requirements. For example, the first preset condition includes at least one of the following: the time delay of the application data of the first application is greater than the preset delay threshold; receiving a second user operation of turning the WiFi switch off and on while the first application is running; or detecting a preset data packet for the preset operating mode of the first application.

[0129] The above-mentioned preset delay threshold can be set according to the actual application scenario or requirements. For example, the preset delay threshold is a value such as 200 milliseconds or 250 milliseconds. For example, when the mobile phone is running a first application, it can periodically obtain the time delay of the application data of the first application. If the mobile phone detects that the time delay of the application data of the first application is greater than the preset delay threshold, it can be considered that the time delay corresponding to the first application is large, and the operation of the first application may be stuck.

[0130] The above-mentioned WiFi switch is used to indicate whether the WiFi communication function is turned on or off. When the WiFi communication function is turned on in the mobile phone, the WiFi switch is in the on state. When the WiFi communication function is turned off in the mobile phone, the WiFi switch is in the off state. The mobile phone can display the WiFi switch control in the top drop-down function window or in the setting function page, so that the user can choose to turn on or off the WiFi communication function through the WiFi switch control. For example, when the mobile phone is running a first application, if the mobile phone receives a second operation from the user to turn off and on the WiFi switch, it can be considered that due to reasons such as the first application being stuck or delayed, the user manipulated the mobile phone to re-establish the WiFi connection with the router.

[0131] The above-mentioned first application may include a first mode and a second mode. Compared with the second mode of the first application, in the first mode of the first application, the mobile phone has higher requirements for the latency of WiFi communication. The mobile phone can enter the first mode or the second mode of the first application under user operation. For example, taking the first application as an example, the first mode of the first application is the mode in which the game application is in the process of a game, and the second mode of the first application is the mode in which the game application is not in the process of a game. When the mobile phone is running the first application, if it is detected that the first application is in the process of a game, it can be considered that the mobile phone has higher requirements for the latency of WiFi communication at this time.

[0132] If the mobile phone meets at least one of the first preset conditions, the mobile phone executes S9043.

[0133] If the mobile phone does not meet any of the first preset conditions, the mobile phone ends the current process.

[0134] S9043: The mobile phone determines whether the encoding mode corresponding to the Bluetooth headset is the first encoding mode.

[0135] The mobile phone sets the time division multiplexing ratio of WiFi communication and Bluetooth communication according to the coding mode corresponding to the Bluetooth headset. The time division multiplexing ratio set by the mobile phone can also be different depending on the coding mode. The first coding mode is any one of SBC mode, AAC mode, aptX mode, LDAC330 mode, and LDAC660 mode.

[0136] If the encoding mode corresponding to the Bluetooth headset is the first encoding mode, the mobile phone executes S9044.

[0137] If the encoding mode corresponding to the Bluetooth headset is not the first encoding mode, the encoding mode corresponding to the Bluetooth headset is the second encoding mode. The second encoding mode is LDAC990. The second encoding mode is different from the first encoding mode. In this case, the bit rate of the second encoding mode is greater than the bit rate of the second encoding mode, the mobile phone executes S9045.

[0138] It is understood that the encoding mode corresponding to the Bluetooth headset is the encoding mode for Bluetooth communication. The encoding mode for Bluetooth communication is related to the Bluetooth headset connected to the mobile phone. Different Bluetooth headsets can support different encoding modes. A Bluetooth headset may only support one encoding mode. Of course, a Bluetooth headset can also support multiple encoding modes. If a Bluetooth headset supports multiple encoding modes, the Bluetooth headset can change the encoding mode under user control. After the Bluetooth headset's encoding mode is set, the Bluetooth headset's encoding mode will not change automatically.

[0139] S9044: The mobile phone sets the time division multiplexing ratio to the first ratio.

[0140] If the Bluetooth communication coding mode is the first coding mode, the mobile phone sets the time division multiplexing ratio to the first ratio. The first ratio is greater than or equal to 1. The specific value of the first ratio can be set according to the actual application scenario or requirements. For example, a represents the first ratio, where a = a1:a2, and a1 is greater than or equal to a2.

[0141] In one example, while a mobile phone is transmitting application data of a first application via WiFi, it also transmits audio data of the first application to a Bluetooth headset. If the mobile phone detects that the time delay of the application data is greater than a preset delay threshold (e.g., greater than 200 milliseconds), or if the mobile phone receives a second operation of the user turning off and on the WiFi switch, the mobile phone sets the time division multiplexing ratio of WiFi communication and Bluetooth communication to 2:1 (an example of the first ratio), if the encoding mode corresponding to the Bluetooth headset is any one of SBC mode, AAC mode, aptX mode, LDAC330 mode, and LDAC660 mode.

[0142] At S9045, the mobile phone sets the time division multiplexing ratio to the second ratio.

[0143] If the Bluetooth communication coding mode is the second coding mode, the phone sets the time division multiplexing ratio to the second ratio. The second ratio is greater than or equal to 1. The specific value of the second ratio can be set according to the actual application scenario or requirements. For example, b represents the second ratio, where b = b1:b2, and b1 is greater than or equal to b2.

[0144] The second coding mode can be the LDAC990 mode. Compared to the first coding mode, the second coding mode has a higher sampling frequency. The higher the sampling frequency, the higher the quality of the Bluetooth data. Compared to the first coding mode, when the coding mode of Bluetooth communication is the second coding mode, the mobile phone can allocate a larger second duration for Bluetooth communication within the preset communication cycle. Accordingly, the time division multiplexing ratio corresponding to the second coding mode is smaller than the time division multiplexing ratio corresponding to the first coding mode. That is, the second ratio is smaller than the above-mentioned first ratio.

[0145] In one example, while a mobile phone is transmitting application data of a first application via WiFi, it is also transmitting audio data of the first application to a Bluetooth headset. If the mobile phone detects that the time delay of the application data is greater than a preset delay threshold (e.g., greater than 200 milliseconds), or if the mobile phone receives a second operation of the user turning the WiFi switch off and on, the mobile phone sets the time division multiplexing ratio of WiFi communication and Bluetooth communication to 1:1 (an example of the second ratio) when the encoding mode corresponding to the Bluetooth headset is LDAC990 mode.

[0146] S9046: The mobile phone sets the time division multiplexing ratio to the fourth ratio.

[0147] If there is no Bluetooth data being transmitted between the phone and the Bluetooth headset, the phone sets the time division multiplexing ratio to the fourth ratio if the Bluetooth communication coding mode is the fourth coding mode. The fourth ratio is greater than or equal to 1. The specific value of the fourth ratio can be set based on actual application scenarios or requirements. For example, d represents the fourth ratio, where d = d1:d2, and d1 is greater than or equal to d2.

[0148] The fourth encoding mode can be any one of SBC mode, AAC mode, aptX mode, LDAC330 mode, LDAC660 mode, and LDAC990 mode. Since there is no Bluetooth data currently being transmitted between the mobile phone and the Bluetooth headset, the mobile phone can allocate a smaller second duration for Bluetooth communication within the preset communication cycle. Accordingly, the fourth ratio is greater than the second ratio or the first ratio.

[0149] In one example, a mobile phone has a WiFi connection with a router and a Bluetooth connection with a Bluetooth headset. In response to a first operation, the mobile phone enters a first application and transmits application data of the first application via WiFi, but no Bluetooth data is transmitted to the Bluetooth headset. In this case, when the encoding mode corresponding to the Bluetooth headset is any one of SBC mode, AAC mode, aptX mode, LDAC330 mode, LDAC660 mode, and LDAC990 mode, the mobile phone sets the time division multiplexing ratio of WiFi communication and Bluetooth communication to 10:1 (an example of a fourth ratio).

[0150] It is understandable that although the mobile phone and the Bluetooth headset may not transmit Bluetooth data in the current preset communication cycle, the mobile phone may transmit Bluetooth data with the Bluetooth headset in the next preset communication cycle. To ensure timely transmission of Bluetooth data, the mobile phone can reserve a time period for Bluetooth communication (i.e., reserve a second time period) within the preset communication cycle.

[0151] It will be appreciated that the above implementation uses the example of a mobile phone sequentially executing S9041, S9042, and S9043 to illustrate the process of setting the time division multiplexing ratio. In other implementations, the mobile phone may also execute S9042 or S9043 first, or execute S9041, S9042, and S9043 simultaneously. The embodiments of the present application do not limit the order in which S9041, S9042, and S9043 are executed.

[0152] In the embodiment of the present application, taking the first application as a delay-sensitive application as an example, the process of adaptively adjusting the time division multiplexing ratio of a mobile phone according to the coding mode of Bluetooth communication is described. In another implementation, when the first application is a speed measurement application for testing the communication rate of WiFi communication, as shown in Figure 11, the mobile phone sets the time division multiplexing ratio according to the coding mode corresponding to the Bluetooth headset, which may include the following steps:

[0153] S904a, the mobile phone determines whether there is Bluetooth data being transmitted with the Bluetooth headset.

[0154] This step can refer to the content described in S9041 and will not be repeated here.

[0155] If the mobile phone and the Bluetooth headset are transmitting Bluetooth data, the mobile phone executes S904b.

[0156] If there is no Bluetooth data to be transmitted between the mobile phone and the Bluetooth headset, the mobile phone executes S904c.

[0157] S904b: The mobile phone sets the time division multiplexing ratio to the third ratio.

[0158] If the mobile phone is transmitting Bluetooth data to a Bluetooth headset, the mobile phone, when the Bluetooth communication coding mode is the third coding mode, sets the time division multiplexing ratio to the third ratio. The third ratio is greater than or equal to 1. The specific value of the third ratio can be set according to the actual application scenario or requirements. For example, if c represents the third ratio, c = c1:c2, where c1 is greater than or equal to c2.

[0159] The third encoding mode can be any one of SBC mode, AAC mode, aptX mode, LDAC330 mode, LDAC660 mode, and LDAC990 mode. Since the first application running on the mobile phone is a speed measurement application, which typically has a short running time and is used to test the maximum communication rate of WiFi communication, the mobile phone can allocate a larger first duration for WiFi communication and a smaller second duration for Bluetooth communication within the preset communication cycle.

[0160] In one example, a mobile phone establishes a WiFi connection with a router and a Bluetooth connection with a Bluetooth headset. In response to a first operation, the mobile phone enters a first application and transmits application data of the first application via WiFi. The mobile phone also transmits Bluetooth data with the Bluetooth headset. In this case, when the encoding mode corresponding to the Bluetooth headset is any one of SBC mode, AAC mode, aptX mode, LDAC330 mode, LDAC660 mode, and LDAC990 mode, the mobile phone sets the time division multiplexing ratio of WiFi communication and Bluetooth communication to 10:1 (an example of the third ratio).

[0161] At S904c, the mobile phone sets the time division multiplexing ratio to the fourth ratio.

[0162] This step can refer to the content described in S9046 and will not be repeated here.

[0163] It can be understood that the fourth ratio may be the same as or different from the third ratio.

[0164] In this embodiment, taking the first application being a speed measurement application as an example, the process of adaptively adjusting the time division multiplexing ratio of a mobile phone according to the coding mode of Bluetooth communication is described. When Bluetooth data is being transmitted between the mobile phone and the Bluetooth headset, if the mobile phone enters the speed measurement software, the mobile phone sets the time division multiplexing ratio of WiFi communication and Bluetooth communication to a third ratio (e.g., set to 5:1, 10:1, etc.) when the coding mode of Bluetooth communication is the third coding mode. When no Bluetooth data is being transmitted between the mobile phone and the Bluetooth headset, if the mobile phone enters the speed measurement software, the mobile phone sets the time division multiplexing ratio of WiFi communication and Bluetooth communication to a fourth ratio (e.g., set to 5:1, 10:1, etc.) when the coding mode of Bluetooth communication is the fourth coding mode. In this way, the mobile phone can adaptively adjust the time division multiplexing ratio of WiFi communication and Bluetooth communication based on the scenario of starting the speed measurement application. In this way, the mobile phone can perform WiFi communication and Bluetooth communication according to the adjusted time division multiplexing ratio, reducing the time delay of WiFi communication.

[0165] In another embodiment, the first operation is a user operation to enable the hotspot sharing function. In response to the first operation, the mobile phone sets the time division multiplexing ratio according to the coding mode corresponding to the Bluetooth headset, and performs WiFi transmission according to the time division multiplexing ratio of the device. For example, when there is no Bluetooth data transmitted between the mobile phone and the Bluetooth headset, for any coding mode corresponding to the Bluetooth headset among SBC mode, AAC mode, aptX mode, LDAC330 mode, LDAC660 mode and LDAC990 mode, the mobile phone sets the time division multiplexing ratio of WiFi communication and Bluetooth communication to 10:1.

[0166] In an embodiment of the present application, the mobile phone can also adaptively adjust the time division multiplexing ratio of WiFi communication and Bluetooth communication according to different application scenarios. For example, in the first application scenario, the time division multiplexing ratio set by the mobile phone is the initial ratio. In the second application scenario, the mobile phone switches the time division multiplexing ratio from the initial ratio to the target ratio. The initial ratio or target ratio can be any one of the first ratio, the second ratio, the third ratio and the fourth ratio that is greater than or equal to 1. Alternatively, the initial ratio or target ratio can also be a ratio value less than 1. The initial ratio is different from the target ratio. In this way, the mobile phone can set an appropriate time division multiplexing ratio for the application scenario of data transmission, reduce the time delay of WiFi communication, and increase the rate of WiFi communication.

[0167] For example, the coding mode corresponding to the Bluetooth headset is SBC mode. In the first application scenario, the mobile phone transmits the application data of a game of the first application via WiFi, and transmits the audio data of the game application (an example of the first application) to the Bluetooth headset. At this time, the time division multiplexing ratio of WiFi communication and Bluetooth communication is the initial ratio (such as 2:1). If the mobile phone exits the game application and enters the speed test application, the mobile phone switches the time division multiplexing ratio of WiFi communication and Bluetooth communication from the initial ratio to the target ratio (such as 10:1).

[0168] In other embodiments of the present application, an electronic device is provided, comprising: a memory, a processor, and a computer program stored in the memory. When the computer program is executed by the processor, the electronic device can perform the various functions or steps in the above-described method embodiments. Of course, the electronic device may also include other hardware structures. For example, the electronic device may also include hardware structures such as sensors and communication modules. The structure of the electronic device can refer to the structure of the mobile phone 100 shown in Figure 7.

[0169] An embodiment of the present application also provides a chip system, which is applied to an electronic device. The chip system includes at least one processor and at least one interface circuit. The processor and the interface circuit can be interconnected through lines. For example, the interface circuit can be used to receive signals from other devices (such as memories). For another example, the interface circuit can be used to send signals to other devices (such as processors). Exemplarily, the interface circuit can read a computer program stored in a memory and send the computer program to the processor. When the computer program is 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 embodiments of the present application.

[0170] An embodiment of the present application also provides a computer-readable storage medium, which includes a computer program. When the computer program runs on the above-mentioned electronic device, it enables the electronic device to perform various functions or steps in the above-mentioned method embodiment.

[0171] The present application also provides a computer program product, which, when executed on a computer, enables the computer to perform the functions or steps of the above method embodiment. For example, the computer may be the above electronic device.

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

[0173] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0174] The units described as separate components may or may not be physically separate, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

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

[0176] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0177] The above content is only a specific implementation method of the present application, but the protection scope of the present application is not limited thereto. Any changes or replacements within the technical scope disclosed in the present application should be included in the protection scope of the present application.

Claims

1. A data transmission method, characterized in that: Applied to an electronic device, the electronic device establishes a WiFi connection with a WiFi device, and the electronic device establishes a Bluetooth connection with a Bluetooth device, the method comprising: Receiving a first operation of a user, wherein the first operation is a user operation of starting a first application, or the first operation is a user operation of enabling a hotspot sharing function; In response to the first operation, setting a time division multiplexing ratio between WiFi communication and Bluetooth communication, the time division multiplexing ratio being used to indicate a ratio of a first duration allocated by the electronic device for WiFi communication to a second duration allocated for Bluetooth communication within a preset communication cycle, wherein the time division multiplexing ratio is greater than or equal to 1; Perform WiFi communication with the WiFi device according to the time division multiplexing ratio.

2. The method according to claim 1, characterized in that The first application is a delay-sensitive application in a preset application list, or the first application is a speed measurement application for testing the communication rate of WiFi communication.

3. The method according to claim 1 or 2, characterized in that The time division multiplexing ratio of WiFi communication and Bluetooth communication is set, including: If the electronic device transmits Bluetooth data with the Bluetooth device, the time division multiplexing ratio is set according to the coding mode corresponding to the Bluetooth device.

4. The method according to any one of claims 1 to 3, characterized in that The first application is an application in a preset application list, the Bluetooth data is obtained based on the application data of the first application, and setting the time division multiplexing ratio of WiFi communication and Bluetooth communication includes: If the electronic device meets a first preset condition, the time division multiplexing ratio is set according to the coding mode corresponding to the Bluetooth device; the first preset condition includes at least one of the following: The time delay of the application data is greater than a preset delay threshold; a second operation of the user turning off and turning on the WiFi switch is received during the running of the first application; a preset data packet is detected, and the preset data packet is used to run the first mode of the first application.

5. The method according to claim 4, characterized in that Setting the time division multiplexing ratio according to the coding mode corresponding to the Bluetooth device includes: When the coding mode corresponding to the Bluetooth device is the first coding mode, setting the time division multiplexing ratio to the first ratio; When the coding mode corresponding to the Bluetooth device is the second coding mode, the time division multiplexing ratio is set to the second ratio; wherein, the code rate of the first coding mode is less than the code rate of the second coding mode, and the first ratio is greater than the second ratio.

6. The method according to claim 5, characterized in that The first coding mode is any one of a sub-band coding mode, an advanced audio coding mode, an aptX mode, an LDAC330 mode, and an LDAC660 mode; and the second coding mode is an LDAC990 mode.

7. The method according to any one of claims 1 to 3, characterized in that The first application is a speed measurement application for testing the communication rate of WiFi communication, and the setting of the time division multiplexing ratio of WiFi communication and Bluetooth communication includes: If the electronic device transmits Bluetooth data with the Bluetooth device, then when the encoding mode corresponding to the Bluetooth device is the third encoding mode, the time division multiplexing ratio is set to the third ratio, and the third ratio is greater than 1.

8. The method according to any one of claims 1 to 7, characterized in that The method further comprises: Perform Bluetooth communication with the Bluetooth device according to the time division multiplexing ratio.

9. The method according to any one of claims 1 to 7, characterized in that The time division multiplexing ratio of WiFi communication and Bluetooth communication is set, including: If there is no Bluetooth data to be transmitted between the electronic device and the Bluetooth device, then when the encoding mode corresponding to the Bluetooth device is the fourth encoding mode, the time division multiplexing ratio is set to the fourth ratio, and the fourth ratio is greater than 1.

10. An electronic device, characterized in that: The electronic device comprises a memory, a processor, and a computer program stored in the memory, and when the processor runs the computer program, the electronic device executes the method according to any one of claims 1 to 9.

11. A computer-readable storage medium, characterized in that A computer program is stored, and when the computer program is executed by an electronic device, the electronic device executes the method according to any one of claims 1 to 9.

12. A computer program product, characterized in that The invention comprises a computer program, which, when executed by an electronic device, causes the electronic device to perform the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Network connection method and device, and electronic equipment

    CN109151784A

  • Time slice allocation method and device, and electronic equipment

    CN109152057A

  • Wireless connection control method and device and medium

    CN111246583A

  • Data transmission method and device and readable storage medium

    CN114095939A