Data transmission method, electronic device, chip system and readable storage medium
Patent Information
- Application Number
- CN202510469554.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-11
- Publication Date
- 2026-10-20
AI Technical Summary
[0002]随着互联网的普及和发展,越来越多的电子设备通过无线保真(wirelessfidelity,Wi-Fi)芯片与路由器连接从而接入网络,电子设备通过Wi-Fi芯片与路由器连接的过程中,可能出现Wi-Fi芯片故障,以及大量电子设备通过Wi-Fi芯片连接到路由器,使得路由器的网络资源难以合理分配等情况
[0032]第五方面,本申请提供一种计算机程序产品,当计算机程序产品在计算机上运行时,使得计算机执行第一方面及第一方面任一种可能的实现方式中的方法。
Smart Images

Figure HDA0005360678430000011 
Figure HDA0005360678430000012 
Figure HDA0005360678430000013
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technology, specifically to a data transmission method, electronic device, chip system, and readable storage medium. Background Technology
[0002] With the popularization and development of the Internet, more and more electronic devices are connecting to the network by connecting to routers through wireless fidelity (Wi-Fi) chips. During the process of electronic devices connecting to routers through Wi-Fi chips, Wi-Fi chip failures may occur, and a large number of electronic devices connecting to routers through Wi-Fi chips may make it difficult for routers to allocate network resources reasonably.
[0003] Currently, an additional Wi-Fi chip can be added to an electronic device, meaning the device includes two Wi-Fi chips: a primary Wi-Fi chip and a secondary Wi-Fi chip, enabling dual-chip collaborative transmission. However, to trigger dual-chip collaborative transmission, the secondary Wi-Fi chip also needs to establish a link with the router. Establishing a link between the secondary Wi-Fi chip and the router takes a long time, which may cause latency issues for dual-chip collaborative transmission, making it difficult for the electronic device and the router to communicate normally. Summary of the Invention
[0004] This application provides a data transmission method, an electronic device, a chip system, and a readable storage medium, which can ensure normal communication between the electronic device and the router and minimize data transmission delay.
[0005] In a first aspect, this application provides a data transmission method applied to an electronic device, the electronic device including a first Wi-Fi chip and a second Wi-Fi chip; the method includes:
[0006] The system controls the first Wi-Fi chip to establish a first link with the access point device, and controls the second Wi-Fi chip to establish a second link with the access point device. If it is determined that the first event has not been triggered, the system controls the second Wi-Fi chip to send a first message to the access point device based on the second link, and controls the first Wi-Fi chip to perform data transmission with the access point device based on the first link. The first event is an event of abnormal data transmission between the first Wi-Fi chip and the access point device based on the first link. The first message is used to keep the second link connected. If it is determined that the first event has been triggered, the system controls the second Wi-Fi chip to perform data transmission with the access point device based on the second link.
[0007] The access point device can be a router. The first message can be a heartbeat packet.
[0008] In the above method, the electronic device includes a first Wi-Fi chip and a second Wi-Fi chip. The electronic device can first control the first Wi-Fi chip to establish a first link with the access point device, and control the second Wi-Fi chip to establish a second link with the access point device. If there is no abnormal data transmission between the first Wi-Fi chip and the access point device based on the first link, that is, if the first event is not triggered, the electronic device can control the second Wi-Fi chip to send a first message to the access point device based on the second link to maintain the second link between the second Wi-Fi chip and the access point device. If there is an abnormal data transmission between the first Wi-Fi chip and the access point device based on the first link, that is, if the first event is triggered, since the second link between the second Wi-Fi chip and the access point device is not disconnected, the electronic device can directly transmit data through the second link between the second Wi-Fi chip and the access point device. By establishing the second link between the second Wi-Fi chip and the access point device in advance and maintaining it continuously, the time for establishing the second link between the second Wi-Fi chip and the access point device can be saved when the second Wi-Fi chip needs to be used, ensuring the continuity and efficiency of communication between the electronic device and the access point device, and minimizing data transmission delay.
[0009] In conjunction with the first aspect, in certain implementations of the first aspect, if it is determined that the first event has not been triggered, controlling the second Wi-Fi chip to send a first message to the access point device based on the second link, and controlling the first Wi-Fi chip to perform data transmission with the access point device based on the first link, includes:
[0010] If it is determined that the first event has not been triggered, the second Wi-Fi chip is controlled to enter the first state, the first Wi-Fi chip is controlled to send the first message to the access point device based on the first link, and the first Wi-Fi chip is controlled to transmit data with the access point device based on the first link. The first state is the state in which the second Wi-Fi chip does not perform any operation.
[0011] In the above method, if no abnormal data transmission occurs between the first Wi-Fi chip and the access point device based on the first link, that is, if the first event is not triggered, the electronic device can control the second Wi-Fi chip to enter a first state of not performing any operation, and control the first Wi-Fi chip to send a first message to the access point device to maintain the second link between the second Wi-Fi chip and the access point device. In this way, by controlling the second Wi-Fi chip to enter a first state of not performing any operation, and maintaining the second link without disconnection through the first Wi-Fi chip instead of the second Wi-Fi chip, power consumption can be reduced, ensuring that the overall power consumption of the electronic device does not increase when the electronic device has two Wi-Fi chips.
[0012] In conjunction with the first aspect, in certain implementations of the first aspect, controlling the first Wi-Fi chip to send a first message to the access point device based on the first link includes:
[0013] The first Wi-Fi chip is controlled to periodically send a first message to the access point device according to a first cycle based on the first link. The first message includes the media access control address of the second Wi-Fi chip. The first message is used to notify the access point device not to disconnect the second link of the second Wi-Fi chip corresponding to the media access control address.
[0014] In the above method, the electronic device controls the first Wi-Fi chip to periodically send the first message to the access point device according to the first cycle based on the first link, which can ensure that the second link is maintained for a long time and avoid the second link from being disconnected.
[0015] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes: if it is determined that a first event is triggered, controlling the first Wi-Fi chip to stop sending the first message to the access point device based on the first link.
[0016] In the above method, if the first event is triggered, the electronic device will interact with the access point device through the second link corresponding to the second Wi-Fi chip. The access point device will not disconnect the second link, and the access point device no longer needs to maintain the second link through the first message. Therefore, the first Wi-Fi chip can stop sending the first message to the access point device based on the first link.
[0017] In conjunction with the first aspect, in some implementations of the first aspect, after determining that the first event has been triggered and controlling the second Wi-Fi chip to transmit data with the access point device based on the second link, the method further includes:
[0018] If the first event is determined to have ended, the second Wi-Fi chip is controlled to enter the first state again, the first Wi-Fi chip is controlled to send the first message to the access point device again, and the first Wi-Fi chip and the access point device are controlled to transmit data based on the first link.
[0019] In the above method, if the first event ends, the electronic device will stop controlling the second Wi-Fi chip to interact with the access point device based on the second link, and continue to control the first Wi-Fi chip to interact with the access point device based on the first link. The electronic device needs to control the first Wi-Fi chip to send the first message to the access point device again to keep the second link open, so as to ensure that the electronic device can interact with the access point device in a timely manner when it needs to interact with the router through the second link next time.
[0020] In conjunction with the first aspect, in some implementations of the first aspect, the first event includes a first sub-event or a second sub-event. The first sub-event is the event in which the first link between the first Wi-Fi chip and the access point device is disconnected, and the second sub-event is the event in which the bandwidth required for data transmission between the first Wi-Fi chip and the access point device is greater than or equal to a preset threshold.
[0021] In the above method, the first event can be triggered when the first link between the first Wi-Fi chip and the access point device is disconnected, or when the bandwidth required for data transmission between the first Wi-Fi chip and the access point device is greater than or equal to a preset threshold.
[0022] In conjunction with the first aspect, in certain implementations of the first aspect, if it is determined that the first event is triggered, controlling the second Wi-Fi chip to transmit data with the access point device based on the second link includes:
[0023] If the first sub-event is triggered, the control of the first Wi-Fi chip to transmit data with the access point device based on the first link is switched to the control of the second Wi-Fi chip to transmit data with the access point device based on the second link; if the second sub-event is triggered, the control of the first Wi-Fi chip to transmit data with the access point device based on the first link is simultaneously controlled to transmit data with the access point device based on the second link.
[0024] In the above method, if it is determined that the first sub-event is triggered, the electronic device cannot control the first Wi-Fi chip to transmit data with the access point device based on the first link. Since the electronic device maintains the second link with the access point device through the first message, the second link is not disconnected. Therefore, the electronic device can control the second Wi-Fi chip to transmit data with the access point device based on the second link, thereby ensuring that the electronic device and the access point device can transmit data normally.
[0025] If the second sub-event is triggered, since the electronic device maintains the second link with the access point device through the first message, ensuring that the second link is not disconnected, the electronic device can not only control the first Wi-Fi chip to transmit data with the access point device based on the first link, but also control the second Wi-Fi chip to transmit data with the access point device based on the second link. Thus, by having two Wi-Fi chips communicate with the access point device simultaneously, the electronic device can obtain more bandwidth and achieve more efficient data transmission with the access point device.
[0026] In conjunction with the first aspect, in certain implementations of the first aspect, if it is determined that the first event is triggered, controlling the second Wi-Fi chip to transmit data with the access point device based on the second link includes:
[0027] If the first event is triggered, the second Wi-Fi chip is controlled to enter the second state, which is a state that supports data transmission between the second Wi-Fi chip and the access point device based on the second link; the second Wi-Fi chip is controlled to transmit data with the access point device based on the second link.
[0028] In the above method, controlling the second Wi-Fi chip to enter the second state can be understood as waking up the second Wi-Fi chip. The current of the second Wi-Fi chip will change. If the electronic device has data that needs to be sent to the access point device, it can send the data to the access point device based on the second link. If the access point device has data that needs to be sent to the access point device, it can send the data to the electronic device based on the second link.
[0029] In a second aspect, this application provides an electronic device comprising: one or more processors, and a memory; the memory is coupled to one or more processors, the memory being used to store computer program code, the computer program code including computer instructions, and the one or more processors invoking the computer instructions to cause the electronic device to perform the methods of the first aspect and any possible implementation thereof.
[0030] Thirdly, this application provides a chip system applied to an electronic device. The chip system includes one or more processors, which are used to invoke computer instructions to cause the electronic device to perform the methods in the first aspect and any possible implementation thereof.
[0031] Fourthly, this application provides a computer-readable storage medium including instructions that, when executed on an electronic device, cause the electronic device to perform the methods of the first aspect and any possible implementation thereof.
[0032] Fifthly, this application provides a computer program product that, when run on a computer, causes the computer to perform the methods of the first aspect and any possible implementation thereof.
[0033] It is understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description
[0034] Figure 1 This is a schematic diagram illustrating the interaction scenario between a dual Wi-Fi chip and a router, provided as an embodiment of this application.
[0035] Figure 2 This is a schematic diagram illustrating the interaction scenario between a dual Wi-Fi chip and a router, provided as an embodiment of this application.
[0036] Figure 3 This is a schematic diagram illustrating the interaction process between a dual Wi-Fi chip and a router, provided as an embodiment of this application.
[0037] Figure 4 This is a schematic diagram of the structure of an electronic device provided in one embodiment of this application;
[0038] Figure 5 A schematic diagram of the software architecture of an electronic device provided in an embodiment of this application;
[0039] Figure 6 A schematic flowchart illustrating a data transmission method according to an embodiment of this application;
[0040] Figure 7 A schematic flowchart illustrating a data transmission method according to an embodiment of this application;
[0041] Figure 8 A schematic diagram of the current of a Wi-Fi chip provided in one embodiment of this application;
[0042] Figure 9 A schematic diagram of the current of a Wi-Fi chip provided in one embodiment of this application;
[0043] Figure 10 A schematic flowchart illustrating a data transmission method according to an embodiment of this application;
[0044] Figure 11 This is a schematic diagram illustrating the construction of a Null Data frame according to an embodiment of this application;
[0045] Figure 12 A schematic flowchart illustrating a data transmission method according to an embodiment of this application;
[0046] Figure 13 This is a schematic flowchart illustrating a data transmission method according to an embodiment of this application. Detailed Implementation
[0047] In this application, "at least one" means one or more, and "more than one" means two or more. "And / or" describes the first transformation relationship of the related objects, indicating that three relationships can exist. For example, A and / or B can mean: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c alone can mean: a alone, b alone, c alone, a combination of a and b, a combination of a and c, a combination of b and c, or a, b, and c, where a, b, and c can be single or multiple. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0048] For ease of understanding, the examples provided are for reference only and are related to the concepts in the embodiments of this application.
[0049] 1. Wi-Fi chip
[0050] The Wi-Fi chip in mobile phones and other electronic devices is a key hardware component, used to enable electronic devices to connect to Wi-Fi networks.
[0051] Wi-Fi chips can receive and transmit wireless signals, meaning they can receive wireless signals from routers and transmit data from electronic devices to routers in the form of wireless signals.
[0052] 2. Heartbeat Pack
[0053] A heartbeat packet is a mechanism in network communication used to maintain connections and detect the availability of devices or services. The core function of a heartbeat packet is to periodically send small data packets to confirm the online status and connection validity of both communicating parties (such as a terminal and a router, a terminal and a server, or a terminal and a gateway).
[0054] With the popularization and development of the internet, more and more electronic devices are connecting to the internet via wireless fidelity (Wi-Fi) technology. For example, mobile phones / PCs can access the internet via Wi-Fi to watch online videos and download files.
[0055] Electronic devices access the internet via Wi-Fi technology by connecting to a router through a Wi-Fi chip (also known as a Wi-Fi module, wireless network card, or wireless network adapter) within the device. During this connection process, Wi-Fi chip malfunctions may occur. Furthermore, in public places such as offices, shopping malls, and campuses, a large number of electronic devices connect to routers via Wi-Fi. To balance the internet access needs of these devices and ensure the rational allocation of network resources, routers limit the Wi-Fi speed of each device. This makes it difficult for electronic devices to obtain sufficient bandwidth for data transmission with the router, resulting in data transmission delays.
[0056] Based on this, a Wi-Fi chip can be added to the electronic device, that is, the electronic device includes two Wi-Fi chips, namely the main Wi-Fi chip (hereinafter referred to as the first Wi-Fi chip) and the auxiliary Wi-Fi chip (hereinafter referred to as the second Wi-Fi chip), to achieve dual-chip collaborative transmission.
[0057] Specifically, dual-chip collaborative transmission includes two scenarios: one is a concurrent scenario, such as... Figure 1 As shown, the links between the main Wi-Fi chip and the secondary Wi-Fi chip and the router are both normal. Electronic devices can transmit data with the router simultaneously through both the main Wi-Fi chip and the secondary Wi-Fi chip. Another scenario is a handover scenario, such as... Figure 2 As shown, when the link between the main Wi-Fi chip and the router is abnormal, the electronic device can switch from transmitting data through the main Wi-Fi chip to transmitting data through the secondary Wi-Fi chip, thereby reducing service interruption time.
[0058] Under normal circumstances, electronic devices transmit services with the router through the main Wi-Fi chip, during which the secondary Wi-Fi chip is in a turned-off / sleep state. When a collaborative service is started (i.e. when the secondary Wi-Fi chip needs to work), the electronic device establishes a link between the secondary Wi-Fi chip and the router. When the current data transmission ends, the secondary Wi-Fi chip disconnects the link with the router.
[0059] Specifically, such as Figure 3As shown, the electronic device can first establish a link between the main Wi-Fi chip and the router, and then transmit data through this link. When the main Wi-Fi chip malfunctions and needs to be switched, a switching scenario is triggered. The electronic device can wake up the secondary Wi-Fi chip and establish a link between the secondary Wi-Fi chip and the router, allowing the electronic device to transmit data with the router through this link. When the main Wi-Fi chip returns to normal, the electronic device can switch back to the main Wi-Fi chip and transmit data with the router through the link between the main Wi-Fi chip and the router.
[0060] When the bandwidth required for data transmission between the main Wi-Fi chip and the router is greater than or equal to a preset threshold, a concurrent scenario is triggered. The electronic device can wake up the secondary Wi-Fi chip and establish a link between the secondary Wi-Fi chip and the router. This allows the electronic device to transmit data with the router through both the link between the main Wi-Fi chip and the router and the link between the secondary Wi-Fi chip and the router. When the bandwidth required for data transmission between the main Wi-Fi chip and the router is less than the preset threshold, the electronic device can switch back to the main Wi-Fi chip and transmit data with the router through the link between the main Wi-Fi chip and the router.
[0061] As can be seen, in the scenario where the primary Wi-Fi chip malfunctions and switches to a secondary Wi-Fi chip, the secondary Wi-Fi chip needs to establish a link with the router before data transmission can occur. Similarly, in the concurrent transmission scenario where both the primary and secondary Wi-Fi chips interact with the router simultaneously, the secondary Wi-Fi chip also needs to establish a link with the router before data transmission can occur. Establishing a link between the secondary Wi-Fi chip and the router takes time, which still introduces a certain latency (e.g., 250ms) into data transmission. This latency-sensitive services are particularly affected, making normal communication between electronic devices and the router difficult.
[0062] To address the aforementioned issues, this application provides a data transmission method, an electronic device, a chip system, a computer-readable storage medium, and a computer program product. The electronic device can be an electronic device with a main Wi-Fi chip and a secondary Wi-Fi chip. To ensure that the dual Wi-Fi chips can quickly perform collaborative service transmission when a collaborative scenario is triggered, the electronic device can first control both the main Wi-Fi chip and the secondary Wi-Fi chip to establish links with the router. If no abnormal data transmission occurs between the main Wi-Fi chip and the router, the secondary Wi-Fi chip can be controlled to send a message to the router to maintain the continuous link between the secondary Wi-Fi chip and the router. The open message ensures that the link between the secondary Wi-Fi chip and the router remains unbroken. In situations where abnormal data transmission between the primary Wi-Fi chip and the router necessitates the use of the secondary Wi-Fi chip, the electronic device does not need to control the secondary Wi-Fi chip to establish a link with the router. The electronic device can directly transmit data through the link between the secondary Wi-Fi chip and the router. This saves time in establishing a link between the secondary Wi-Fi chip and the router when it is needed, ensuring normal communication between the electronic device and the router and minimizing data transmission latency.
[0063] Specifically, abnormal data transmission events between the main Wi-Fi chip and the router can include events such as the link between the main Wi-Fi chip and the router being disconnected, and events such as the bandwidth required for data transmission between the secondary Wi-Fi chip and the router being greater than or equal to a preset threshold. If the abnormal transmission event is the link between the main Wi-Fi chip and the router being disconnected, the electronic device can control the secondary Wi-Fi chip to transmit data based on the link between the secondary Wi-Fi chip and the router. If the abnormal data transmission event is the bandwidth required for data transmission between the secondary Wi-Fi chip and the router being greater than or equal to a preset threshold, the electronic device can control both the main Wi-Fi chip to transmit data with the router based on the link between the main Wi-Fi chip and the router, and the secondary Wi-Fi chip to transmit data with the router based on the link between the secondary Wi-Fi chip and the router.
[0064] Among them, the aforementioned electronic devices can be mobile phones, tablets, in-vehicle devices, laptops, wearable devices, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), smart cars, smart TVs, robots, and other devices.
[0065] It should be noted that in some possible implementations, the electronic device may also be referred to as a terminal device (station), user equipment (UE), etc., and the embodiments of this application do not limit this.
[0066] For ease of explanation, Figure 4 In the example below, we will use a mobile phone as an example of electronic device 100.
[0067] like Figure 4 As shown, in some embodiments, the electronic device 100 may include a processor 101, a communication module 102, a display screen 103, a camera 104, a sensor 105, an internal memory 106, a USB interface 107, an external memory interface 108, a charging management module 109, a power management module 110, and a battery 111, etc.
[0068] The processor 101 may include one or more processing units, such as an application processor (AP), a modem processor, a graphics processor, an image signal processor (ISP), a controller, a memory, a video stream codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). These different processing units may be independent devices or integrated into one or more processors 101.
[0069] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of fetching and executing instructions.
[0070] The processor 101 may also include a memory for storing instructions and data.
[0071] The communication module 102 may include antenna 1 and antenna 2, a mobile communication module, and / or a wireless communication module.
[0072] The wireless communication module can provide solutions for wireless communication applications on electronic device 100, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module can be one or more devices integrating at least one communication processing module. The wireless communication module receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signal, and sends the processed signal to processor 101. The wireless communication module can also receive signals to be transmitted from processor 101, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.
[0073] The wireless communication module includes two Wi-Fi chips, namely a first Wi-Fi chip and a second Wi-Fi chip, which are used to handle WLAN communication. The two Wi-Fi chips can be two independent chips, or they may be integrated with functions such as Bluetooth into a single chip; this application does not limit this.
[0074] Optionally, the electronic device 100 may also include peripheral devices, such as a mouse, buttons, indicator lights, keyboard, speaker, microphone, etc.
[0075] It is understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device 100.
[0076] In other embodiments, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0077] Please refer to Figure 5 This is a schematic diagram of the software architecture of an electronic device provided in an embodiment of this application. The ground data transmission method provided in this embodiment is applied to... Figure 4 When the electronic device 100 is shown, the software in the electronic device 100 can be divided into, for example: Figure 5 The application layer 201, the application framework layer (FWK) 202, and the kernel layer 203 are shown.
[0078] Multiple applications can be installed in application layer 201.
[0079] Application framework layer 202 provides a set of basic functions and services for application layer 201 to call and use.
[0080] The application framework layer 202 includes a dual-chip business scenario identification module and a dual-chip power consumption management module.
[0081] The dual-chip service scenario identification module is used to determine whether an event of link disconnection between the Wi-Fi chip and the router is triggered, and whether an event of the required bandwidth for data transmission between the first Wi-Fi chip and the router being greater than or equal to a preset threshold is triggered.
[0082] The dual-chip power management module is used to instruct either the first Wi-Fi chip or the second Wi-Fi chip to send a message to the router to maintain the link between the second Wi-Fi chip and the router.
[0083] Correspondingly, the dual-chip power management module is also used to notify the first Wi-Fi chip or the second Wi-Fi chip to stop sending messages to the router to maintain the link between the second Wi-Fi chip and the router.
[0084] The dual-chip power management module is also used to notify the second Wi-Fi chip to enter a state of inactivity (this state can be called a deep sleep state). The dual-chip power management module is also used to wake up the second Wi-Fi chip.
[0085] Kernel layer 203 can contain multiple drivers for driving hardware operations. For example, kernel layer 203 includes a first chip driver and a second chip driver. The first chip driver controls a first Wi-Fi chip at the chip layer. The second chip driver controls a second Wi-Fi chip at the chip layer. Interaction between the dual-chip power management module and the first Wi-Fi chip is achieved through the second chip driver.
[0086] It should be noted that the application layer 201, application framework layer 202, and kernel layer 203 may also include other content, which is not specifically limited here.
[0087] Based on the above description, the data transmission method provided in the embodiments of this application will be described in detail below with reference to the accompanying drawings and application scenarios.
[0088] The data transmission method provided in this application embodiment can be executed by an electronic device, which can be... Figure 4The electronic device 100 shown includes two Wi-Fi chips, namely a first Wi-Fi chip and a second Wi-Fi chip. Both the first Wi-Fi chip and the second Wi-Fi chip can establish a link with an access point device, which can be a router.
[0089] Please see Figure 6 , Figure 6 A schematic flowchart of a data transmission method provided in an embodiment of this application is shown.
[0090] like Figure 6 As shown, the data transmission method provided in this application may include:
[0091] S301, control the first Wi-Fi chip to establish a first link with the access point device, and control the second Wi-Fi chip to establish a second link with the access point device.
[0092] The process of an electronic device controlling a first Wi-Fi chip to establish a first link with an access point device may include: the electronic device actively or passively scanning and detecting beacon frames of surrounding access point devices through the first Wi-Fi chip, and sending an authentication request to the access point device. The authentication request typically includes the media access control (MAC) address of the first Wi-Fi chip. The access point device returns an authentication response message (indicating whether it accepts the access of the electronic device). If authentication is successful, the electronic device sends an association request to the access point device through the first Wi-Fi chip. The access point device replies with an association response message. The electronic device and the access point device then perform a four-way handshake through the first Wi-Fi chip, thereby completing the establishment of the first link. This application does not limit the specific implementation method of the electronic device controlling the first Wi-Fi chip to establish the first link with the access point device.
[0093] The four-way handshake process is as follows: First handshake: The access point device (APD) sends an ANonce (a random number generated by the APD) to the electronic device. Second handshake: The electronic device generates a SNonce (random number) and, based on the ANonce and the pre-shared key (PSK), i.e., the user-set Wi-Fi password, generates a pairwise transient key (PTK), and sends the SNonce and a message integrity code (MIC) to the APD. Third handshake: The APD generates the PTK based on the SNonce, ANonce, and PSK, verifies the MIC, and then sends a group temporal key (GTK). Fourth handshake: The electronic device confirms the GTK installation is complete and sends an acknowledgment message to the APD, which includes the MIC. The PTK is a unique key between the electronic device and the APD, used to protect unicast communication. The GTK is a shared key among all devices under the APD, used to protect broadcast / multicast communication. The MIC is used to verify that the message has not been tampered with during the handshake process.
[0094] The process by which an electronic device controls a second Wi-Fi chip to establish a second link with an access point device is usually the same as or similar to the process by which an electronic device controls a first Wi-Fi chip to establish a first link with an access point device, and will not be described in detail here.
[0095] In some embodiments, the electronic device can simultaneously control the first Wi-Fi chip to establish a first link with the access point device and control the second Wi-Fi chip to establish a second link with the access point device.
[0096] In other embodiments, the electronic device may first control the first Wi-Fi chip to establish a first link with the access point device, and then control the second Wi-Fi chip to establish a second link with the access point device. This application does not specifically limit the order in which the first link and the second link are established.
[0097] S302. If it is determined that the first event has not been triggered, control the second Wi-Fi chip to send a first message to the access point device based on the second link, and control the first Wi-Fi chip to transmit data with the access point device based on the first link. The first event is an event in which the first Wi-Fi chip transmits data abnormally with the access point device based on the first link. The first message is used to keep the second link open.
[0098] If the first event is not triggered, it means that the first link between the first Wi-Fi chip and the access point device can transmit data normally. Then, when there is data that needs to be transmitted between the electronic device and the access point device, the electronic device can control the first Wi-Fi chip to transmit data with the access point device based on the first link (the electronic device sends data to the access point device based on the first link, and receives data sent by the access point device based on the first link).
[0099] In some embodiments, the first event includes a first sub-event or a second sub-event. The first sub-event is an event in which the first link between the first Wi-Fi chip and the access point device is disconnected, or the second sub-event includes an event in which the bandwidth required for data transmission between the first Wi-Fi chip and the access point device is greater than or equal to a preset threshold.
[0100] Typically, the bandwidth required for data transmission between the first Wi-Fi chip and the access point device can be understood as the required transmission rate for data transmission between the first Wi-Fi chip and the access point device, measured in Mbps or Gbps.
[0101] The preset threshold is a pre-set value; for example, the preset threshold is 40Mbps; this application does not limit the specific value of the preset threshold.
[0102] For example, if the preset threshold is 40Mbps, and the data transmitted between the first Wi-Fi chip and the access point device is a 4K video stream, and the required transmission rate for data transmission between the first Wi-Fi chip and the access point device is 50Mbps, then the second sub-event is triggered.
[0103] It should be understood that if the first link between the first Wi-Fi chip and the access point device is not disconnected, and the bandwidth required for data transmission between the first Wi-Fi chip and the access point device is less than a preset threshold, the first link between the first Wi-Fi chip and the access point device can transmit data normally. Therefore, when there is a need to transmit data between the electronic device and the access point device, the electronic device can control the first Wi-Fi chip to transmit data with the access point device based on the first link.
[0104] Furthermore, if the second Wi-Fi chip does not interact with the access point device for a preset time or longer, there may be situations such as the second Wi-Fi chip being powered off or moving away from the signal coverage area of the access point device. In such cases, the access point device will actively disconnect the second link. Therefore, the electronic device can control the second Wi-Fi chip to send a first message to the access point device to notify the access point device not to disconnect the second link, that is, to maintain the second link.
[0105] The aforementioned interactions may include beacon frame listening (the electronic device listens to the beacon frame of the access point device through a second Wi-Fi chip), data transmission (the electronic device sends data to the access point device and receives data from the access point device), management frame interactions (probe requests / responses, reassociation requests), and control frame interactions (acknowledgment frames, requests / permissions). This application does not limit the specific content of the interactions.
[0106] S303. If the first event is determined to be triggered, control the second Wi-Fi chip and the access point device to transmit data based on the second link.
[0107] If the first event is triggered, it indicates that the first link between the first Wi-Fi chip and the access point device cannot transmit data normally. Since the electronic device maintains the second link with the access point device through the first message, the second link is not disconnected. Therefore, the electronic device can control the second Wi-Fi chip and the access point device to transmit data based on the second link.
[0108] Based on the above description, the first event may be a first sub-event or a second sub-event. The first sub-event is the event where the first link between the first Wi-Fi chip and the access point device is disconnected. The second sub-event is the event where the bandwidth required for data transmission between the first Wi-Fi chip and the access point device is greater than or equal to a preset threshold. Therefore, in some embodiments, if it is determined that the first event is triggered, controlling the second Wi-Fi chip to perform data transmission with the access point device based on the second link includes:
[0109] If the first sub-event is triggered, the control of the first Wi-Fi chip to transmit data with the access point device based on the first link is switched to the control of the second Wi-Fi chip to transmit data with the access point device based on the second link; if the second sub-event is triggered, the control of the first Wi-Fi chip to transmit data with the access point device based on the first link is simultaneously controlled to transmit data with the access point device based on the second link.
[0110] If the first sub-event is triggered, the electronic device cannot control the first Wi-Fi chip to transmit data with the access point device based on the first link. Since the electronic device maintains the second link with the access point device through the first message, ensuring that the second link is not disconnected, the electronic device can control the second Wi-Fi chip to transmit data with the access point device based on the second link, thereby ensuring that the electronic device and the access point device can transmit data normally.
[0111] If the second sub-event is triggered, since the electronic device maintains the second link with the access point device through the first message, ensuring that the second link is not disconnected, the electronic device can not only control the first Wi-Fi chip to transmit data with the access point device based on the first link, but also control the second Wi-Fi chip to transmit data with the access point device based on the second link. Thus, by having two Wi-Fi chips communicate with the access point device simultaneously, the electronic device can obtain more bandwidth and achieve more efficient data transmission with the access point device.
[0112] Furthermore, in some embodiments, the data transmission method further includes: if it is determined that a first event is triggered, controlling the second Wi-Fi chip to stop sending the first message to the access point device based on the second link.
[0113] It should be understood that if the first event is triggered, the electronic device will interact with the access point device through the second link corresponding to the second Wi-Fi chip. The access point device will not disconnect the second link, and the access point device does not need to maintain the second link open through the first message. Therefore, the second Wi-Fi chip can stop sending the first message to the access point device based on the second link.
[0114] S304. If it is determined that the first event has ended, control the second Wi-Fi chip to send the first message to the access point device again based on the second link, and control the first Wi-Fi chip to perform data transmission with the access point device based on the first link.
[0115] Similar to S302, once the first event ends, the electronic device will stop controlling the second Wi-Fi chip to interact with the access point device via the second link, and will continue to control the first Wi-Fi chip to interact with the access point device via the first link. The electronic device needs to control the second Wi-Fi chip again to send the first message to the access point device to maintain the second link, so as to ensure that the electronic device can interact with the router via the second link in a timely manner the next time it needs to interact with the access point device.
[0116] Based on the above description, the first event may be a first sub-event or a second sub-event. The first sub-event is the event where the first link between the first Wi-Fi chip and the access point device is disconnected. The second sub-event is the event where the bandwidth required for data transmission between the first Wi-Fi chip and the access point device is greater than or equal to a preset threshold. Therefore, the termination of the first or second sub-event is specifically described as follows:
[0117] If the first event is the first sub-event, the end of the first sub-event means that the first link between the first Wi-Fi chip and the access point device has been restored. The electronic device can realize the interaction between the first Wi-Fi chip and the access point device through the first link. Therefore, the electronic device no longer controls the second Wi-Fi chip to transmit data with the access point device based on the second link. The electronic device can control the second Wi-Fi chip to send the first message to the access point device based on the second link to maintain the second link, and control the first Wi-Fi chip to transmit data with the access point device based on the first link.
[0118] If the first event is the second sub-event, the end of the second sub-event means that the bandwidth required for data transmission between the first Wi-Fi chip and the access point device is less than a preset threshold. The electronic device does not need to transmit data more efficiently with the access point device through the first link and the second link. The interaction between the dual Wi-Fi chips and the access point device ends. Therefore, the electronic device no longer controls the second Wi-Fi chip to transmit data with the access point device based on the second link. The electronic device can again control the second Wi-Fi chip to send the first message to the access point device to maintain the second link, and control the first Wi-Fi chip to transmit data with the access point device based on the first link.
[0119] In the data transmission method of this application embodiment, the electronic device includes a first Wi-Fi chip and a second Wi-Fi chip. The electronic device can first control both the first Wi-Fi chip and the second Wi-Fi chip to establish a link with the access point device. If there is no abnormal data transmission between the first Wi-Fi chip and the access point device based on the first link, that is, if the first event is not triggered, the electronic device can control the second Wi-Fi chip to send a first message to the access point device based on the second link to maintain the second link between the second Wi-Fi chip and the access point device. If there is an abnormal data transmission between the first Wi-Fi chip and the access point device based on the first link, that is, if the first event is triggered, since the second link between the second Wi-Fi chip and the access point device is not disconnected, the electronic device can directly transmit data through the second link between the second Wi-Fi chip and the access point device. By establishing the second link between the second Wi-Fi chip and the access point device in advance and maintaining it continuously, the time for the second Wi-Fi chip to establish the second link with the access point device can be saved when the second Wi-Fi chip needs to be used, which can ensure the continuity and efficiency of communication between the electronic device and the access point device and minimize data transmission delay.
[0120] Based on the above Figure 6The description considers that the simultaneous operation of the first Wi-Fi chip and the second Wi-Fi chip, that is, the electronic device controls the second Wi-Fi chip to send the first message to the access point device based on the second link, and controls the first Wi-Fi chip to transmit data with the access point device based on the first link, will result in a large power consumption of the electronic device. The electronic device can control the second Wi-Fi chip to enter a state of not performing any operation, and send the first message to the access point device through the first Wi-Fi chip, and maintain the second link through the first message.
[0121] Below, in conjunction with Figure 7 This paper details the data transmission method of this application.
[0122] Please see Figure 7 , Figure 7 A schematic flowchart of a data transmission method provided in an embodiment of this application is shown.
[0123] like Figure 7 As shown, the data transmission method provided in this application embodiment may include:
[0124] S401. Control the first Wi-Fi chip to establish a first link with the access point device, and control the second Wi-Fi chip to establish a second link with the access point device.
[0125] Among them, S401 and Figure 6 The implementation of S301 in the illustrated embodiment is similar and will not be repeated here.
[0126] S402. If it is determined that the first event has not been triggered, control the second Wi-Fi chip to enter the first state, control the first Wi-Fi chip to send the first message to the access point device based on the first link, and control the first Wi-Fi chip to perform data transmission with the access point device based on the first link. The first state is the state in which the second Wi-Fi chip does not perform any operation.
[0127] The first state can be understood as a deep sleep state. When the second Wi-Fi chip enters a deep sleep state, it will not perform any operations, such as not listening to beacon frames or sending the first message.
[0128] like Figure 8 The diagram shows the current when the second Wi-Fi chip enters the first state. It can be seen that when the second Wi-Fi chip enters the first state, almost no current flows through it.
[0129] In some embodiments, controlling the first Wi-Fi chip to send a first message to the access point device based on the first link includes: controlling the first Wi-Fi chip to periodically send a first message to the access point device according to a first cycle based on the first link, wherein the first message includes the MAC address of the second Wi-Fi chip, and the first message is used to notify the access point device not to disconnect the second link of the second Wi-Fi chip corresponding to the MAC address.
[0130] Based on the description in S301, during the process of the electronic device controlling the second Wi-Fi chip to establish a second link with the access point device, it can send an Auth request to the access point device. The Auth request usually includes the MAC address of the second Wi-Fi chip. Thus, the first Wi-Fi chip sends a first message including the MAC address of the second Wi-Fi chip to the access point device based on the first link, which can notify the access point device not to disconnect the second link of the second Wi-Fi chip corresponding to the MAC address.
[0131] Furthermore, the electronic device controls the first Wi-Fi chip to periodically send the first message to the access point device based on the first link and according to the first cycle, which can ensure that the second link is maintained for a long time and avoid the second link from being disconnected.
[0132] For example, the first cycle is 15 seconds, and the electronic device controls the first Wi-Fi chip to periodically send the first message to the access point device based on the first link every 15 seconds.
[0133] Specifically, controlling the first Wi-Fi chip to periodically send a first message to the access point device based on the first link and according to the first cycle includes: starting a timer at the first moment, controlling the first Wi-Fi chip to periodically send the first message to the access point device according to the timer's duration, wherein the duration of the first cycle is the timer's duration, and the first moment is the moment when it is determined that the first event has not been triggered.
[0134] For example, if the first moment is 10 o'clock and the timer duration is 15 seconds, then the electronic device can start the timer at 10 o'clock to control the first Wi-Fi chip to send the first message to the access point device every 15 seconds based on the first link.
[0135] The first message can be a heartbeat packet. During the process of the second Wi-Fi chip entering the first state, the first Wi-Fi chip needs to send a heartbeat packet to the access point device based on the first link, and also needs to receive the beacon from the access point device, and control the first Wi-Fi chip to perform data transmission with the access point device based on the first link. The current diagram of the first Wi-Fi chip at this time is as follows. Figure 9As shown, the first Wi-Fi chip can receive beacons from the access point device and send heartbeat packets including the MAC address of the second Wi-Fi chip to the access point device. This state of the first Wi-Fi chip can be called a light sleep state or other states. This application embodiment does not specifically limit this state.
[0136] like Figure 10 As shown, after establishing a link with the access point device, device 1 can transmit data. If there is no data transmission, device 1 can send a heartbeat packet to the access point device to maintain the link between device 1 and the access point device. Based on this, the electronic device can control the electronic device to send a heartbeat packet to the access point device through the first Wi-Fi chip to maintain the second link between the second Wi-Fi chip and the access point device, and transmit data with the access point device through the first Wi-Fi chip.
[0137] In some embodiments, the heartbeat packet is typically a null data frame. Specifically, the null data frame includes a MAC frame header but does not include the actual encrypted data. The first Wi-Fi chip can construct a null data frame and set the transmitter address in the null data frame to the MAC address of the second Wi-Fi chip. For example, ... Figure 11 Replace 2e:6c:77:9a:1d:43 in the data frame with the MAC address of the second Wi-Fi chip. When the access point device receives this null data frame, it can determine that the sender is the second Wi-Fi chip (not the actual first Wi-Fi chip) based on the Transmitter address. As a result, the access point device will assume that the second Wi-Fi chip is still online, thus maintaining the second link between the second Wi-Fi chip and the access point device.
[0138] S403. If the first event is determined to be triggered, control the second Wi-Fi chip to enter the second state, which is a state that supports the second Wi-Fi chip and the access point device to transmit data based on the second link.
[0139] The second state can be understood as the wake-up state. If the first event is triggered, the electronic device can wake up the second Wi-Fi chip, enabling the second Wi-Fi chip to transmit data with the access point device based on the second link.
[0140] In some embodiments, the data transmission method further includes: if it is determined that a first event is triggered, controlling the first Wi-Fi chip to stop sending the first message to the access point device based on the first link.
[0141] It should be understood that if the first event is triggered, the electronic device will interact with the access point device through the second link corresponding to the second Wi-Fi chip. The access point device will not disconnect the second link, and the access point device no longer needs to maintain the second link through the first message. Therefore, the first Wi-Fi chip can stop sending the first message to the access point device based on the first link.
[0142] Based on S402, if the electronic device controls the first Wi-Fi chip to send a first message to the access point device by controlling the first Wi-Fi chip to periodically send the first message to the access point device according to the timer duration, then if the electronic device determines that the first event has been triggered, it can stop the first Wi-Fi chip from sending the first message to the access point device by turning off the timer.
[0143] S404. Control the second Wi-Fi chip and the access point device to transmit data based on the second link.
[0144] S405. If it is determined that the first event has ended, control the second Wi-Fi chip to enter the first state again, control the first Wi-Fi chip to send the first message to the access point device again, and control the first Wi-Fi chip and the access point device to transmit data based on the first link.
[0145] Among them, S404 and S405 are respectively with Figure 6 The implementations of S303 and S304 in the illustrated embodiment are similar and will not be described again here.
[0146] Based on the above description and Figure 12 In a specific embodiment, the following description is provided:
[0147] When the first event is the disconnection of the first link between the first Wi-Fi chip and the router, a switching scenario is triggered, and the electronic device wakes up the second Wi-Fi chip, enabling the electronic device to transmit data with the router based on the second link (the second link between the second Wi-Fi chip and the router); when the first Wi-Fi chip returns to normal, that is, when the first event ends, the electronic device can switch back to the first Wi-Fi chip and transmit data with the router based on the first link.
[0148] When the first event is an event in which the bandwidth required for data transmission between the first Wi-Fi chip and the router is greater than or equal to a preset threshold, a concurrent scenario is triggered. The electronic device wakes up the second Wi-Fi chip, enabling the electronic device to transmit data with the router via both the first and second links. When the bandwidth required for data transmission between the first Wi-Fi chip and the router is less than the preset threshold, i.e., when the first event ends, the electronic device can switch back to the first Wi-Fi chip and transmit data with the router via the first link.
[0149] In the data transmission method of this application embodiment, if there is no abnormal data transmission between the first Wi-Fi chip and the access point device based on the first link, that is, if the first event is not triggered, the electronic device can control the second Wi-Fi chip to enter a first state of not performing any operation, and control the first Wi-Fi chip to send a first message to the access point device to maintain the second link between the second Wi-Fi chip and the access point device. When there is an abnormal data transmission between the first Wi-Fi chip and the access point device based on the first link, since the second link between the second Wi-Fi chip and the access point device is not disconnected, the electronic device can directly transmit data through the second link between the second Wi-Fi chip and the access point device. Thus, the second Wi-Fi chip enters the first state, and the second link is maintained by the first Wi-Fi chip instead of the second Wi-Fi chip. This can reduce power consumption, ensure that the overall power consumption of the electronic device does not increase when the electronic device has two Wi-Fi chips, and save the time for the second Wi-Fi chip to establish a link with the access point device. This can ensure normal communication between the electronic device and the access point device and minimize data transmission delay.
[0150] Based on the foregoing description, in a specific embodiment, the following assumptions are made:
[0151] 1. The access point device is a router.
[0152] 2. After the first Wi-Fi chip establishes a first connection with the router, the second Wi-Fi chip establishes a second connection with the router.
[0153] 3. The electronic device sends a first message to the router through the first Wi-Fi chip. The first message is a heartbeat packet, which uses a null data frame as the heartbeat packet.
[0154] 4. The first Wi-Fi chip periodically sends null data frames to the router by starting a timer, and stops sending null data frames to the router by turning off the timer.
[0155] 5. The first state is deep sleep state.
[0156] Based on the above assumptions, the following will combine... Figure 13 The data transmission method provided in this application embodiment is described in detail, including the dual-chip power management module and the dual-chip service scenario identification module included in the electronic device.
[0157] like Figure 13 As shown, the data transmission method provided in this application embodiment includes:
[0158] S11. The first Wi-Fi chip establishes the first link with the router.
[0159] S12, The first Wi-Fi chip reports the status of the first chip to the dual-chip power management module.
[0160] The first chip status indicates that the first Wi-Fi chip is connected to the router.
[0161] After the first Wi-Fi chip establishes the first link with the router, the first Wi-Fi chip and the router are in a connected state. The first Wi-Fi chip can report its status to the dual-chip power management module to notify the dual-chip power management module that the first Wi-Fi chip and the router are in a connected state.
[0162] S13, The dual-chip power management module notifies the second Wi-Fi chip to establish a link with the router.
[0163] Upon receiving the status of the first chip, the dual-chip power management module can notify the second Wi-Fi chip to establish a link with the router.
[0164] S14. The second Wi-Fi chip establishes a second link with the router.
[0165] S15, the second Wi-Fi chip reports the status of the second chip to the dual-chip power management module.
[0166] The second chip status indicates that the second Wi-Fi chip is connected to the router.
[0167] After the second Wi-Fi chip establishes a second link with the router, the second Wi-Fi chip and the router are in a connected state. The second Wi-Fi chip can report its status to the dual-chip power management module to notify the dual-chip power management module that the second Wi-Fi chip and the router are in a connected state.
[0168] S16. The dual-chip power management module determines whether it has received the trigger notification of the first event.
[0169] The first event trigger notification is used to indicate that the electronic device has triggered the first event.
[0170] If the dual-chip service scenario identification module detects that the electronic device has triggered the first event, it can send a trigger notification of the first event to the dual-chip power consumption management module; if the dual-chip service scenario identification module does not detect that the electronic device has triggered the first event, it will not send a trigger notification of the first event to the dual-chip power consumption management module.
[0171] The dual-chip service scenario identification module detects that the electronic device triggering the first event may occur at any point during the operation of the electronic device, such as when the second Wi-Fi chip ends its second link with the router. In this case, the dual-chip service scenario identification module can detect the electronic device triggering the first event and send a trigger notification to the dual-chip power management module, which can receive the trigger notification. This application does not limit the time at which the dual-chip service scenario identification module detects the electronic device triggering the first event.
[0172] S17, the dual-chip power management module controls the second Wi-Fi chip to enter a deep sleep state.
[0173] S18. The dual-chip power management module sends the deep sleep time point of the second Wi-Fi chip and the MAC address of the second Wi-Fi chip to the first Wi-Fi chip.
[0174] The second Wi-Fi chip sleep time point is also the first moment in S402 above, which can be found in the relevant description of the first moment in S402 above.
[0175] S19. The first Wi-Fi chip starts a timer and sends a Null Data frame to the router based on the first link. The Null Data frame includes the MAC address of the second Wi-Fi chip.
[0176] S20, the first Wi-Fi chip transmits data with the router based on the first link.
[0177] The execution order of S17, S18, and S20 is not important; they can be executed simultaneously or sequentially. This application does not impose any restrictions on this. When executed sequentially, this application does not impose any restrictions on the execution order of S17, S18, and S20.
[0178] Furthermore, when the first Wi-Fi chip transmits data with the router based on the first link, the first Wi-Fi chip is in a light sleep state. At this time, the first Wi-Fi chip may send a heartbeat packet including the MAC address of the first Wi-Fi chip to the router, or it may not send it. This application does not limit this.
[0179] S21. The dual-chip service scenario identification module sends a trigger notification for the first event to the dual-chip power consumption management module.
[0180] If the dual-chip service scenario identification module detects that the electronic device has triggered the first event, it can send a trigger notification of the first event to the dual-chip power consumption management module.
[0181] S22, the dual-chip power management module wakes up the second Wi-Fi chip.
[0182] The specific implementation method for waking up the second Wi-Fi chip can be found in the description of controlling the second Wi-Fi chip to enter the second state in S403 above.
[0183] In addition, after the dual-chip power management module wakes up the second Wi-Fi chip, it can control the second Wi-Fi chip to enter a light sleep state. The light sleep state is a state in which the second Wi-Fi chip can receive beacon frames from the access point device and can also transmit data with the router.
[0184] S23, The dual-chip power management module sends a shutdown notification to the first Wi-Fi chip.
[0185] The shutdown notification is used to instruct the first Wi-Fi chip to turn off the timer.
[0186] If the first event is triggered, the electronic device will interact with the router through the second link corresponding to the second Wi-Fi chip. The router will not disconnect the second link, and the router no longer needs to maintain the second link through null data frames. Therefore, the dual-chip power management module can send a shutdown notification to the first Wi-Fi chip so that the first Wi-Fi chip can turn off its timer.
[0187] S24, First Wi-Fi chip shuts down timer.
[0188] Specifically, after the first Wi-Fi chip disables its timer, it no longer sends null data frames to the router.
[0189] S25, the second Wi-Fi chip transmits data with the router based on the second link.
[0190] Furthermore, when the second Wi-Fi chip is able to transmit data with the router based on the second link, the second Wi-Fi chip is in a light sleep state. At this time, the second Wi-Fi chip can send a heartbeat packet including the MAC address of the second Wi-Fi chip to the router, or it can choose not to send it. This application does not limit this.
[0191] S26. The dual-chip service scenario identification module sends the end notification of the first event to the dual-chip power consumption management module.
[0192] If the dual-chip service scenario identification module detects the end of the first event, it can send an end notification of the first event to the dual-chip power consumption management module.
[0193] S27. The dual-chip power management module controls the second Wi-Fi chip to enter a deep sleep state.
[0194] Upon receiving the end notification of the first event, the dual-chip power management module can again control the second Wi-Fi chip to enter a deep sleep state and execute S18-S20 again.
[0195] For example, this application provides an electronic device including a processor; when the processor executes computer code or instructions in memory, the electronic device performs the data transmission method described in the preceding embodiments.
[0196] For example, this application provides an electronic device, including: a memory and a processor; the memory is coupled to the processor, and the memory is used to store program code or instructions; the processor is used to call the program code or instructions in the memory to cause the electronic device to execute the data transmission method in the preceding embodiments.
[0197] For example, this application provides a chip system applied to an electronic device including a memory, a display screen, and sensors; the chip system includes: one or more interface circuits and one or more processors; the interface circuits and processors are interconnected via lines; the interface circuits are used to receive signals from the memory and send signals to the processors, the signals including computer code or instructions stored in the memory; when the processor executes the computer code or instructions, the electronic device executes the data transmission method in the preceding embodiments.
[0198] For example, this application provides a computer-readable storage medium storing code or instructions that, when executed on an electronic device, cause the electronic device to implement the data transmission method described in the preceding embodiments.
[0199] For example, this application provides a computer program product that, when run on a computer, enables an electronic device to implement the data transmission method described in the preceding embodiments.
[0200] In the above embodiments, all or part of the functionality can be implemented by software, hardware, or a combination of software and hardware. When implemented using software, it can be implemented wholly or partially in the form of a computer program product. A computer program product includes one or more computer codes or instructions. When the computer program code or instructions are loaded and executed on a computer, all or part of the flow or functionality according to this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer code or instructions can be stored in a computer-readable storage medium. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).
[0201] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A data transmission method, characterized in that, Applied to an electronic device, the electronic device including a first Wi-Fi chip and a second Wi-Fi chip; the method includes: Control the first Wi-Fi chip to establish a first link with the access point device, and control the second Wi-Fi chip to establish a second link with the access point device; If it is determined that the first event has not been triggered, the second Wi-Fi chip is controlled to send a first message to the access point device based on the second link, and the first Wi-Fi chip is controlled to transmit data with the access point device based on the first link. The first event is an event in which the data transmission between the first Wi-Fi chip and the access point device based on the first link is abnormal. The first message is used to keep the second link from disconnecting. If the first event is triggered, the second Wi-Fi chip is controlled to transmit data with the access point device based on the second link.
2. The method according to claim 1, characterized in that, If it is determined that the first event has not been triggered, controlling the second Wi-Fi chip to send a first message to the access point device based on the second link, and controlling the first Wi-Fi chip to perform data transmission with the access point device based on the first link, includes: If it is determined that the first event has not been triggered, the second Wi-Fi chip is controlled to enter the first state, the first Wi-Fi chip is controlled to send the first message to the access point device based on the first link, and the first Wi-Fi chip is controlled to perform data transmission with the access point device based on the first link. The first state is a state in which the second Wi-Fi chip does not perform any operation.
3. The method according to claim 2, characterized in that, The step of controlling the first Wi-Fi chip to send a first message to the access point device based on the first link includes: The first Wi-Fi chip is controlled to periodically send the first message to the access point device according to the first cycle based on the first link. The first message includes the media access control address of the second Wi-Fi chip. The first message is used to notify the access point device not to disconnect the second link of the second Wi-Fi chip corresponding to the media access control address.
4. The method according to claim 2 or 3, characterized in that, The method further includes: If the first event is determined to be triggered, control the first Wi-Fi chip to stop sending the first message to the access point device based on the first link.
5. The method according to any one of claims 2 to 4, characterized in that, If the first event is determined to be triggered, and the second Wi-Fi chip is then controlled to transmit data with the access point device via the second link, the method further includes: If the first event is determined to have ended, the second Wi-Fi chip is controlled to enter the first state again, the first Wi-Fi chip is controlled to send the first message to the access point device again, and the first Wi-Fi chip and the access point device are controlled to transmit data based on the first link.
6. The method according to any one of claims 1 to 5, characterized in that, The first event includes a first sub-event or a second sub-event. The first sub-event is the event in which the first link between the first Wi-Fi chip and the access point device is disconnected. The second sub-event is the event in which the bandwidth required for data transmission between the first Wi-Fi chip and the access point device is greater than or equal to a preset threshold.
7. The method according to claim 6, characterized in that, If the first event is determined to be triggered, controlling the second Wi-Fi chip to transmit data with the access point device based on the second link includes: If the first sub-event is determined to be triggered, the control of the first Wi-Fi chip to transmit data with the access point device based on the first link is switched to the control of the second Wi-Fi chip to transmit data with the access point device based on the second link; If the second sub-event is triggered, the first Wi-Fi chip is controlled to transmit data with the access point device based on the first link, while the second Wi-Fi chip is controlled to transmit data with the access point device based on the second link.
8. The method according to any one of claims 1 to 7, characterized in that, If the first event is determined to be triggered, controlling the second Wi-Fi chip to transmit data with the access point device based on the second link includes: If the first event is triggered, the second Wi-Fi chip is controlled to enter a second state, which is a state that supports data transmission between the second Wi-Fi chip and the access point device based on the second link; The second Wi-Fi chip is controlled to transmit data with the access point device based on the second link.
9. An electronic device, characterized in that, The electronic device includes: one or more processors, and a memory; the memory is coupled to the one or more processors, the memory being used to store computer program code, the computer program code including computer instructions, the one or more processors invoking the computer instructions to cause the electronic device to perform the method as described in any one of claims 1 to 8.
10. A chip system, characterized in that, The chip system is applied to an electronic device, the chip system including one or more processors, the one or more processors being used to invoke computer instructions to cause the electronic device to perform the method as described in any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in any one of claims 1 to 8.
12. A computer program product, characterized in that, The computer program product includes a computer program that, when run on an electronic device, causes the electronic device to perform the method as described in any one of claims 1 to 8.