A communication method, an electronic device, and a storage medium
Patent Information
- Application Number
- CN202311140851.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-05
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2043-09-05
AI Technical Summary
然而,存在一些情况,若电子设备操作系统检测到该电子设备上网时的网络信号变差、网络速率变低等现象,操作系统会重置电子设备中的WiFi模块以恢复无线网络,但是,由于实现WiFi直连传输通道的功能单元也置于WiFi模块中,重置WiFi模块会造成实现WiFi直连传输通道的功能单元也被重置,导致电子设备与其他电子设备间的WiFi直连传输通道断开,造成数据传输中断
Smart Images

Figure CN119629658B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a communication method, electronic device and storage medium. Background Technology
[0002] Currently, electronic devices (such as computers and mobile phones) can achieve smart interconnection services such as data sharing and information exchange by establishing Wireless Fidelity (WiFi) direct transmission channels. A WiFi direct transmission channel refers to the direct data transmission between two electronic devices without the intervention of intermediaries or servers. For example, ... Figure 1 As shown, computer 101 and mobile phone 102 can establish a WiFi direct connection transmission channel for smart screen projection and data sharing.
[0003] Currently, when electronic devices connect with other electronic devices via WiFi Direct, the electronic device can also act as a terminal device to establish a wireless connection with a wireless router to access the internet. However, there are situations where the electronic device's operating system detects a weakening network signal or low network speed. The operating system will reset the electronic device's WiFi module to restore the wireless network. However, since the functional unit implementing the WiFi Direct connection is also located in the WiFi module, resetting the WiFi module will also reset this functional unit, causing the WiFi Direct connection between the electronic device and other electronic devices to be disconnected, resulting in data transmission interruption.
[0004] Therefore, how to formulate a protection strategy to ensure that electronic devices and other electronic devices can continue to transmit data when the operating system resets the WiFi module is an urgent problem to be solved. Summary of the Invention
[0005] To address the aforementioned problems, this application provides a communication method, an electronic device, and a storage medium.
[0006] In a first aspect, this application provides a communication method for a first electronic device, the method comprising: the first electronic device performing WiFi direct communication with a second electronic device based on a first WiFi chip; detecting a reset command for the first WiFi chip during the WiFi direct communication; and switching to establishing WiFi direct communication with the second electronic device using a second WiFi chip in the first electronic device.
[0007] In this application, the first electronic device can be any electronic device mentioned in this application, such as a computer, mobile phone, virtual reality device, tablet computer, or laptop computer; the second electronic device can be any electronic device mentioned in this application; the first WiFi chip can be the WiFi main chip in the first electronic device mentioned in this application; the second WiFi chip can be a WiFi chip (i.e., WiFi microchip) additionally embedded in the first electronic device mentioned in this application; and the reset command can be the reset operation of the WiFi module in the first electronic device mentioned in this application.
[0008] It is understood that in this application, when the first electronic device establishes a WiFi direct connection transmission channel with the second electronic device using the first WiFi chip (i.e., the WiFi main chip), if the operating system of the first electronic device detects that the network environment has changed when accessing the Internet through the WiFi main chip, the operating system will reset the WiFi module, wherein the WiFi module has an embedded WiFi main chip; during the process of resetting the WiFi module, the first electronic device can establish a WiFi direct connection communication with the second electronic device through the additional embedded second WiFi chip (i.e., the WiFi microchip).
[0009] Based on the above method, it can be ensured that both electronic devices can continue to transmit data when the operating system resets the WiFi module, thus improving the user experience.
[0010] In one possible implementation, the method further includes: detecting that the first WiFi chip has been successfully reset; if it is determined that the second WiFi chip can meet the network transmission requirements between the first electronic device and the second electronic device, maintaining the WiFi direct communication between the second WiFi chip and the second electronic device as a connection state; if it is determined that the second WiFi chip cannot meet the network transmission requirements between the first electronic device and the second electronic device, establishing WiFi direct communication between the first electronic device and the second electronic device based on the first WiFi chip.
[0011] It is understood that in this application, when the first electronic device establishes a direct WiFi transmission channel with the second electronic device through the second WiFi chip (i.e., the WiFi microchip), after detecting that the first electronic device has successfully reset the WiFi module, if the second WiFi chip can meet the network transmission requirements, such as transmitting only a small number of images, and can meet the requirements of data transmission time and throughput (i.e., the amount of data transmitted per unit time) from the sending end to the receiving end, the transmission channel can continue to be established on the second WiFi chip. If the second WiFi chip cannot meet the network transmission requirements, the operating system of the first electronic device will switch to the first WiFi chip (i.e., the WiFi main chip) to establish a direct WiFi transmission channel with the second electronic device. This enables better data transmission performance between the first and second electronic devices.
[0012] In one possible implementation, the first electronic device includes an operating system and an application layer, wherein the application layer includes system applications; the first WiFi chip is controlled based on the operating system of the first electronic device, and the second WiFi chip is controlled based on the system applications of the first electronic device.
[0013] In this application, the system application can be the computer manager mentioned in this application.
[0014] In some embodiments, an additional WiFi chip can be embedded in the first electronic device to support the device's smart connectivity services. The main WiFi chip is controlled by the operating system, while the WiFi chip is directly controlled by a computer management system; the two do not interfere with each other.
[0015] In one possible implementation, the above switching is to establish WiFi direct communication between the first electronic device and the second electronic device using the second WiFi chip in the first electronic device, including: using the second WiFi chip to create a group owner terminal for point-to-point communication on the first electronic device; sending a connection command to the second electronic device, wherein the connection command is used to establish WiFi direct communication between the first electronic device and the second electronic device.
[0016] It is understood that in this application, during the process of resetting the WiFi module of the first electronic device, the WiFi chip can be used to create a group owner (GO) terminal for peer-to-peer (P2P) communication on the first electronic device and establish P2P communication with the second electronic device.
[0017] In some embodiments, when the first electronic device and the second electronic device establish a WiFi Direct connection, the first electronic device can directly create a GO (Go-to-Go) for P2P communication via the WiFi chip. Then, the first electronic device sends a connection command to the second electronic device. Upon receiving the connection command, the second electronic device establishes a P2P connection with the GO of the first electronic device. Thus, data transmission between the two electronic devices can continue during the WiFi module reset process.
[0018] In one possible implementation, the group owner terminal that uses the second WiFi chip to create peer-to-peer communication on the first electronic device includes: using first information to create peer-to-peer communication on the first electronic device, wherein the first information is the communication information when the first electronic device communicates directly with the second electronic device via WiFi based on the first WiFi chip.
[0019] In one possible implementation, the aforementioned communication information includes a service set identifier, a password, and one or more pieces of information in the working channel.
[0020] It is understandable that, in this application, when the first electronic device establishes a WiFi direct connection with the second electronic device, the first electronic device can use and reset the same Service Set Identifier (SSID) as when the WiFi module previously established a WiFi direct connection transmission channel with the second electronic device, i.e., the WiFi name, as well as communication information such as password and working channel.
[0021] In one possible implementation, the connection command includes first information and a basic service set identifier corresponding to the first electronic device.
[0022] It is understood that in this application, when the first electronic device establishes a WiFi direct connection with the second electronic device, the first electronic device can send a connection command to the second electronic device. The connection command includes the SSID, password, working channel, and Basic Service Set Identifier (BSSID), i.e., the physical address of the first electronic device, which is used by the first electronic device to establish a WiFi direct connection with the second electronic device.
[0023] In some embodiments, the first electronic device may send a connection command to the second electronic device via Bluetooth; or, the first electronic device may also send a connection command to the second electronic device via near field communication (NFC) or other near field communication methods. This application does not limit this.
[0024] In one possible implementation, the above-mentioned switching is to establish a WiFi direct communication between the second WiFi chip in the first electronic device and the second electronic device, including: the first electronic device connecting to the first wireless access device based on a first channel; the second electronic device connecting to the second wireless access device based on a second channel; and the second WiFi chip in the first electronic device establishing a WiFi direct communication with the second electronic device based on the second channel.
[0025] It is understood that in this application, if the second electronic device acts as a station (STA) device and connects to the wireless router via the STA channel to access the wireless network, and the STA channels of the first and second electronic devices are different, then when establishing WiFi Direct communication using the WiFi chip, the communication channel can be established on the STA channel of the second electronic device. This ensures that the channel used for communication between the second electronic device and the wireless router is the same as the channel used for communication with the first electronic device, eliminating the need for the second electronic device to switch between different channels and improving data transmission efficiency.
[0026] In one possible implementation, the method further includes: if the first electronic device does not include the second WiFi chip, when the first electronic device detects that the first WiFi chip has been successfully reset, it establishes a WiFi direct communication with the second electronic device based on the first WiFi chip.
[0027] It is understood that in this application, the first electronic device does not need to have an additional chip embedded in it, and can automatically re-establish a WiFi direct connection transmission channel with the second electronic device after the WiFi module is successfully reset.
[0028] In one possible implementation, when the first electronic device detects that the first WiFi chip has been successfully reset, it establishes a WiFi direct connection with the second electronic device based on the first WiFi chip, including: creating a soft access point on the first electronic device using the first WiFi chip; and sending a reconnection command to the second electronic device, wherein the reconnection command is used to establish a WiFi direct connection between the first electronic device and the second electronic device.
[0029] It is understood that in this application, after the WiFi module is successfully reset, the operating system of the first electronic device can automatically create a soft access point through the first WiFi chip and send a fast reconnection command to the second electronic device. Communication can then resume once the second electronic device successfully reconnects to the soft access point of the first electronic device. Thus, after resetting the WiFi module, the first and second electronic devices can communicate successfully again.
[0030] In one possible implementation, the reset duration of the first WiFi chip is greater than the first preset time, and the reset duration of the first WiFi chip is the minimum of the default recovery duration of resetting the first WiFi chip and the actual detection duration.
[0031] In this application, the reset duration of the first WiFi chip can be the recovery duration of the reset WiFi module mentioned in this application; the first preset time can be the preset time for resetting the WiFi module, whether or not a WiFi chip is additionally embedded in the first electronic device, mentioned in this application.
[0032] It is understood that in this application, if the recovery time of the reset WiFi module corresponding to the WiFi main chip embedded in the first electronic device is long (for example, greater than 1 second), another WiFi chip can be placed in the first electronic device to support the smart interconnection service of the first electronic device.
[0033] In some embodiments, the recovery time for resetting the WiFi module refers to the minimum of the default recovery time and the actual detected recovery time. The default recovery time refers to the recovery time actually tested before the product leaves the factory. The actual detected recovery time refers to the recovery time counted when the operating system resets the WiFi module due to the deterioration of the WiFi network speed when the user uses the electronic device.
[0034] In one possible implementation, the method further includes: if the first WiFi chip is detected to have been successfully reset within a second preset time, then WiFi direct communication is established between the first WiFi chip and the second electronic device after the first WiFi chip has been successfully reset; if the first WiFi chip is detected to have failed to be reset within the second preset time, then WiFi direct communication is established between the second WiFi chip in the first electronic device and the second electronic device.
[0035] In this application, the first WiFi chip can be the WiFi main chip in the first electronic device mentioned in this application; the second WiFi chip can be the WiFi chip (i.e., WiFi small chip) that is additionally embedded in the first electronic device mentioned in this application; and the second preset time can be the preset time for resetting the WiFi module by using the second WiFi chip mentioned in this application.
[0036] It is understood that in this application, a separate WiFi chip can be placed within the first electronic device to support its smart interconnection services. When the first electronic device detects that the WiFi module needs to be reset, it needs to determine the recovery time during the WiFi module reset. If the recovery time is short, it can wait for the WiFi module to be successfully reset before automatically establishing a WiFi direct connection transmission channel with the second electronic device using the main WiFi chip. If the recovery time is long, the WiFi chip can be used to establish P2P communication with the second electronic device during the WiFi module reset.
[0037] In one possible implementation, the method further includes: detecting that the wireless network connection of the first electronic device meets the network reset condition during the process of the first electronic device communicating directly with the second electronic device based on the first WiFi chip; and resetting the WiFi module of the first electronic device.
[0038] In this application, the network reset condition can be the network environment change when the first electronic device is detected to be an internet access device as a STA device, as mentioned in this application, such as network signal deterioration, inability to access the internet, or network speed reduction, which are network connection limitations.
[0039] In some embodiments, when the first electronic device establishes a WiFi direct connection transmission channel with the second electronic device, the first electronic device can also act as a STA device to establish a connection with a wireless access point (e.g., a wireless router) to access the wireless network and achieve functions such as internet access. Specifically, when a change in the network environment is detected when the first electronic device is acting as a STA device to access the internet, such as a weakening network signal, inability to access the internet, or a lower network speed, the operating system of the first electronic device will detect the limited network connection and attempt to automatically restore it by resetting the WiFi module.
[0040] Secondly, this application provides an electronic device, including: a memory and a processor, wherein the memory is used to store instructions executed by one or more processors of the electronic device, and the processor is one of one or more processors of the electronic device, used to execute the communication method mentioned in this application.
[0041] Thirdly, this application provides a readable storage medium, wherein instructions are stored on the readable storage medium, and when executed on an electronic device, the instructions cause the electronic device to perform the communication method mentioned in this application. Attached Figure Description
[0042] Figure 1 According to some embodiments of this application, a schematic diagram of a smart screen projection scenario is shown;
[0043] Figure 2AAccording to some embodiments of this application, a schematic diagram of a smart interconnected service network is shown;
[0044] Figure 2B According to some embodiments of this application, a schematic diagram of the structure of a WiFi module is shown;
[0045] Figure 3 According to some embodiments of this application, a schematic diagram of a computer embedded WiFi chip is shown;
[0046] Figure 4 According to some embodiments of this application, a schematic diagram of a scenario for establishing P2P communication is shown;
[0047] Figure 5 According to some embodiments of this application, a schematic diagram of a specific process for establishing a communication connection with a peer device via a WiFi chip is shown.
[0048] Figure 6 According to some embodiments of this application, a schematic diagram of a specific process for ensuring data transmission between two electronic devices is shown;
[0049] Figure 7 According to some embodiments of this application, a schematic diagram of the interaction process of a first electronic device is shown;
[0050] Figure 8 According to some embodiments of this application, a schematic diagram of a second electronic device interaction process is shown;
[0051] Figure 9 According to some embodiments of this application, a schematic diagram of a third electronic device interaction process is shown;
[0052] Figure 10 According to some embodiments of this application, a schematic diagram of the interaction process of an electronic device when establishing a WiFi direct transmission channel is shown;
[0053] Figure 11 According to some embodiments of this application, a schematic diagram of the hardware structure of an electronic device is shown. Detailed Implementation
[0054] The illustrative embodiments of this application include, but are not limited to, a communication method, an electronic device, and a storage medium.
[0055] To better understand the solution of this application, the relevant terms in the field will be explained first.
[0056] A Soft Access Point (SoftAP) is a device that uses its own wireless network card and software drivers to turn it into a wireless access point that can be connected to by other devices. A SoftAP can create a wireless local area network (WLAN) and provide a connectable virtual WiFi, allowing other devices to connect to the SoftAP via WiFi and enabling data transfer and sharing between devices.
[0057] The background of the method provided in the embodiments of this application will be briefly described below.
[0058] Currently, electronic devices can establish direct WiFi connections, eliminating the need for intermediaries and servers, and directly enabling smart interconnection services such as data sharing and information exchange between two devices. For example, ... Figure 1 As shown, computer 101 and mobile phone 102 can establish a WiFi direct connection transmission channel for smart screen projection and data sharing.
[0059] In some embodiments, when establishing a WiFi direct transmission link between a first electronic device and a second electronic device, the first electronic device typically acts as a soft access point (SoftAP), and the second electronic device acts as a group client (GC) connecting to the SoftAP to establish the transmission link. The SoftAP functions similarly to a wireless access point, the GC performs the functions of a terminal device, and the GC connecting to the SoftAP is analogous to a terminal device connecting to a wireless router.
[0060] In some embodiments, when establishing a WiFi direct transmission link between a first electronic device and a second electronic device, the first electronic device may sometimes act as a group owner (GO), and the second electronic device may act as a group client (GC) to connect to the GO and establish the transmission link. Here, the GO functions similarly to a wireless access point, the GC performs the functions of a terminal device, and the GC connecting to the GO is similar to a terminal device connecting to a wireless router.
[0061] Furthermore, when the first electronic device and the second electronic device establish a WiFi direct connection transmission channel, the first electronic device can also act as a station (STA) device to establish a connection with a wireless access point (e.g., a wireless router) to access the wireless network and achieve functions such as internet access. For example, Figure 2AAs shown, computer 201 can establish a WiFi direct connection transmission channel with mobile phone 202. Computer 201 acts as SoftAP and mobile phone 202 acts as GC. GC connects to SoftAP to establish a WiFi direct connection transmission channel. In addition, computer 201 can also act as STA device to establish a wireless connection with wireless access point (AP) 203 to access the Internet.
[0062] In some embodiments, if the network environment changes when the electronic device is accessing the Internet as a STA device, such as a decrease in network signal, inability to access the Internet, or a decrease in network speed, the operating system of the electronic device will detect the limited network connection and then restore the network status by resetting the WiFi module in the electronic device.
[0063] However, since the functional unit implementing the WiFi Direct transmission channel is also located in the WiFi module, resetting the WiFi module will also reset the functional unit implementing the WiFi Direct transmission channel, causing the WiFi Direct transmission channel between electronic devices and other electronic devices to be disconnected, resulting in data transmission interruption. For example, as Figure 2B As shown, in computer 201, both the SoftAP function unit and the STA function unit are located in the WiFi module of computer 201. If the network speed decreases when computer 201 is used as a STA device to access the Internet, the operating system of computer 201 will reset the entire WiFi module, causing the SoftAP function unit embedded in the WiFi module to also be reset. This results in the WiFi direct connection transmission channel between computer 201 and other electronic devices being disconnected, causing data transmission interruption. Users need to wait until the WiFi module is successfully reset before manually enabling the smart interconnection configuration again, which affects the user experience.
[0064] It's understandable that during the WiFi module reset process, the operating system needs to delete the drivers related to the Wireless Local Area Network (WLAN) adapter in the WiFi module. Afterward, the operating system will automatically reinstall and restart the WLAN adapter drivers to restore network settings. A driver is software that enables communication and interaction between the operating system and hardware devices such as the WLAN adapter; the WLAN adapter contains an embedded WiFi main chip.
[0065] To address the aforementioned issues, this application provides a communication method. In this method, an additional WiFi chip can be embedded in the electronic device to support its wireless communication and data transmission functions. When the electronic device establishes a direct WiFi transmission channel with the peer device using the WiFi main chip (i.e., the chip embedded in the aforementioned WLAN network card), if the operating system detects a change in the network environment when accessing the internet via the WiFi main chip, the operating system will reset the WiFi module. During the WiFi module reset process, point-to-point communication can be established with the peer device through the additional embedded WiFi chip. Afterwards, once the WiFi module reset is detected as successful, if the additional embedded WiFi chip can meet the network transmission requirements (e.g., transmitting only a small number of images), and can satisfy the time and throughput requirements (i.e., the amount of data transmitted per unit time) for data transmission from the sender to the receiver, the transmission channel can continue to be established on the additional embedded WiFi chip. If the additional embedded WiFi chip cannot meet the network transmission requirements, the electronic device's operating system will switch to the WiFi main chip to establish a direct WiFi transmission channel with the peer device. This ensures that both electronic devices can continue data transmission even when the operating system resets the WiFi module, improving the user experience.
[0066] It is understandable that both the WiFi chip (i.e., WiFi microchip) and the WiFi main chip embedded in electronic devices can provide wireless communication and data transmission functions for electronic devices. By receiving and sending wireless signals, wireless communication connections between electronic devices can be realized. However, the WiFi microchip is inferior to the WiFi main chip in terms of data transmission performance (e.g., data transmission speed) and signal quality.
[0067] In some embodiments, an additional WiFi chip can be embedded within the electronic device to support its smart connectivity services. For example, such as Figure 3As shown, computer 201 contains two embedded chips: a main WiFi chip and a small WiFi chip. The main WiFi chip is the one embedded in the aforementioned WLAN network card, controlled by the operating system. The small WiFi chip is directly controlled by a system application (e.g., a computer manager) at the application layer; the two chips do not interfere with each other. Specifically, during the WiFi module reset process, the small WiFi chip can be used to create a peer-to-peer (P2P) communication group owner (GO) on the electronic device, establishing P2P communication with the peer device. P2P communication refers to the direct transmission of information between two electronic devices through a channel without the intervention of intermediaries or servers; it is a type of WiFi direct connection transmission channel. In P2P communication, the GO acts similarly to a wireless access device, the GC implements the functions of a terminal device, and the GC connecting to the GO is similar to a terminal device connecting to a wireless router.
[0068] In some embodiments, if the peer device acts as a STA device and connects to the wireless router via the STA channel to access the wireless network, and the STA channel of the electronic device is different from the STA channel of the peer device, then when using a WiFi chip for P2P communication, the P2P communication channel can be established on the STA channel of the peer device. For example, Figure 4 As shown, if mobile phone 402 connects to the AP and accesses the wireless network based on channel 36, the P2P communication channel between computer 401 and mobile phone 402 can be established on channel 36. In this way, the channel through which mobile phone 402 communicates with the AP is the same as the channel through which it communicates with computer 401 in P2P. Mobile phone 402 does not need to switch back and forth between different channels, which can improve data transmission efficiency.
[0069] In some embodiments, when a successful WiFi module reset is detected, if the WiFi chip can meet the requirements of smart interconnection services for network transmission latency (i.e., the time it takes for data to be transmitted from the sending end to the receiving end) and throughput (i.e., the amount of data transmitted per unit time), the transmission channel can continue to be established on the WiFi chip. For example, if only a small number of pictures are transmitted between the computer and the mobile phone, P2P communication can continue to be established between the computer and the mobile phone by using the computer's WiFi chip.
[0070] In some embodiments, when a successful WiFi module reset is detected, if the WiFi chip cannot meet the network transmission latency and throughput requirements of smart interconnection services, the operating system will switch to the WiFi main chip to establish a direct WiFi transmission channel with the peer device. For example, if a computer and a mobile phone need to transmit a large amount of video, requiring a high data transmission rate, the computer operating system will create a SoftAP through the WiFi main chip. After successful creation, it will send connection information to the mobile phone. Upon receiving the connection information, the mobile phone will disconnect the P2P GO connection with the computer and reconnect to the computer's SoftAP.
[0071] In some embodiments, when the electronic device re-establishes a communication connection with the peer device, the same Service Set Identifier (SSID), i.e., the WiFi name, password, working channel, and other information, can be used and reset when the WiFi module previously established a WiFi direct transmission channel with the peer device.
[0072] In some embodiments, when an electronic device re-establishes a communication connection with a peer device, the electronic device can send a connection command to the peer device via Bluetooth. This connection command includes the SSID, password, operating channel, and the Basic Service Set Identifier (BSSID) of the electronic device used to establish a WiFi Direct connection with the peer device, i.e., the physical address of the electronic device. Alternatively, the electronic device can also send the connection command to the peer device via near-field communication (NFC) or other near-field communication technologies; this embodiment does not limit this approach.
[0073] It's understandable that differences in the design and architecture of WiFi chips from different manufacturers lead to varying recovery times for the WiFi module reset on electronic devices equipped with these chips. For example, computer 1 using a WiFi chip from manufacturer A might take 1 second to reset its WiFi module, while computer 2 using a WiFi chip from manufacturer B might take 6 seconds. The WiFi module reset recovery time refers to the minimum of the default recovery time and the actual detected recovery time. The default recovery time is the recovery time actually tested before the product leaves the factory; the actual detected recovery time is the recovery time recorded when the user resets the WiFi module due to a decrease in WiFi network speed while using the electronic device.
[0074] Therefore, in some embodiments, different protection strategies can be formulated based on different WiFi module reset recovery times, so that when the operating system of an electronic device resets the WiFi module, it can promptly restore the electronic device and enable data transmission between the electronic device and other electronic devices to continue.
[0075] In some embodiments, if the recovery time of the reset WiFi module corresponding to the WiFi main chip (i.e., short-range communication chip) embedded in the electronic device is long (e.g., greater than 1 second), an additional WiFi microchip can be placed in the electronic device to support the smart interconnection service of the electronic device.
[0076] If the recovery time of the WiFi module reset by the operating system of the electronic device is relatively short (e.g., less than 1 second), there is no need to embed an additional chip. After the WiFi module is successfully reset, the WiFi direct connection transmission channel with the other device can be automatically re-established.
[0077] In some embodiments, after a separate WiFi chip is installed within the electronic device to support its smart interconnection services, when the electronic device detects the need to reset the WiFi module, it needs to determine the recovery time of the current WiFi main chip. For example, it can determine the recovery time when resetting the WiFi module by using the WiFi main chip's attribute information (e.g., default recovery time) or the historical recovery time during actual use of the electronic device. If the recovery time for resetting the WiFi module is short, the device can wait for the WiFi module to be successfully reset before automatically establishing a WiFi direct connection transmission channel with the peer device using the WiFi main chip. If the recovery time for resetting the WiFi module is long, the WiFi chip can be used to establish P2P communication with the peer device during the WiFi module reset.
[0078] The following is based on Figure 5 The flowchart shown details the communication method for establishing a communication connection in the embodiments of this application. Figure 5 As shown, specifically, this method can be executed by an electronic device (or local device), and includes the following steps:
[0079] S501: Network connectivity restrictions detected.
[0080] It is understood that in the embodiments of this application, when an electronic device establishes a WiFi direct connection transmission channel with other electronic devices, the electronic device can also act as a STA device to establish a connection with a wireless access point (e.g., a wireless router) to access the wireless network and achieve functions such as Internet access.
[0081] In some embodiments, when the network environment changes when the electronic device is accessing the Internet as a STA device, such as a decrease in network signal, inability to access the Internet, or a decrease in network speed, the operating system of the electronic device will detect the limited network connection and attempt to recover automatically.
[0082] S502: Reset WiFi module.
[0083] It is understood that in this embodiment of the application, after the electronic device's operating system detects that the network connection is limited, the operating system will restore the network status by resetting the WiFi module in the electronic device.
[0084] S503: Create GO via WiFi chiplet.
[0085] It is understood that in this embodiment of the application, an additional WiFi chip can be embedded in the electronic device to support the smart interconnection service of the electronic device. During the process of resetting the WiFi module, the GO terminal of P2P communication can be directly created through the WiFi chip.
[0086] In some embodiments, when creating a GO, the same SSID, password, and working channel used when the WiFi module previously established a WiFi Direct transmission channel with the peer device can be used to create the GO.
[0087] In some embodiments, in P2P communication, the GO acts similarly to a wireless access device, the GC implements the functions of a terminal device, and the GC connecting to the GO is similar to the terminal device connecting to a wireless router.
[0088] S504: Send a connection command to the peer device.
[0089] It is understood that in this embodiment of the application, after the electronic device completes the creation of the GO, it can send a connection command to the peer device via Bluetooth. The connection command includes information such as the GO's SSID, password, working channel, and BSSID.
[0090] S505: Establishes a P2P connection with the peer device.
[0091] It is understood that in this embodiment of the application, after receiving the connection command, the peer device will establish a P2P connection with the GO device. The P2P connection is a type of WiFi direct transmission channel. In this way, data transmission can be performed between the two electronic devices.
[0092] In some embodiments, if the peer device acts as a STA device and connects to the wireless router via the STA channel to access the wireless network, and the STA channel of the electronic device is different from that of the peer device, then when using a WiFi chip for P2P communication, the P2P communication channel can be established on the STA channel of the peer device. For example, when a mobile phone connects to the AP via channel 36 and a computer connects to the AP via channel 149, when establishing a P2P connection between the computer and the mobile phone, P2P communication can be created on the mobile phone's STA channel (i.e., channel 36). This ensures that the channel used for communication between the mobile phone and the AP is the same as the channel used for communication with the computer, eliminating the need for the mobile phone to switch between different channels and improving data transmission efficiency.
[0093] In this way, data transmission between the two devices can still be maintained during the process of resetting the WiFi module.
[0094] S506: WiFi module reset successfully detected.
[0095] It is understood that in this embodiment of the application, the operating system needs to detect whether the WiFi module has been successfully reset.
[0096] S507: Determine whether the WiFi chip meets the network transmission requirements of smart interconnection services. If yes, proceed to S508; otherwise, proceed to S509.
[0097] It is understood that in this embodiment of the application, when the WiFi module is successfully reset, it is necessary to determine whether the WiFi chip meets the network transmission latency (i.e., the time it takes for data to be transmitted from the sending end to the receiving end) and throughput (i.e., the amount of data transmitted per unit time) requirements of the smart interconnection service. If the requirements are met, the process proceeds to S508 to maintain the establishment of a transmission channel on the WiFi chip; if the requirements are not met, the process proceeds to S509 to switch the WiFi main chip to establish a WiFi direct connection transmission channel with the peer device.
[0098] In some embodiments, such as when only a small number of images are being transferred between the computer and the mobile phone, the network transmission rate requirement is low; however, if a large amount of video needs to be transferred between the computer and the mobile phone, the data transmission rate requirement is high.
[0099] S508: Maintains a transmission channel on the WiFi chiplet.
[0100] It is understood that in this embodiment of the application, if the WiFi chip can meet the requirements of smart interconnection services for network transmission latency and throughput, the transmission channel can continue to be established on the WiFi chip. For example, if only a small number of pictures are transmitted between the computer and the mobile phone, the P2P communication established between the computer's WiFi chip and the mobile phone can continue to be maintained.
[0101] S509: Switches to the WiFi main chip to establish a direct WiFi transmission channel with the peer device.
[0102] It is understood that in this embodiment of the application, if the WiFi chip cannot meet the requirements of smart interconnection services for network transmission latency and throughput, the operating system will switch to the WiFi main chip to establish a WiFi direct connection transmission channel with the peer device.
[0103] In some embodiments, the operating system of the electronic device can use and reset the same SSID, password, and working channel as when the WiFi module previously established a WiFi direct transmission channel with the peer device to create a SoftAP at the operating system interface; then, it sends a connection command to the peer device via Bluetooth, wherein the connection command includes information such as the SSID, password, working channel, and BSSID of the SoftAP; after receiving the connection command, the peer device will first disconnect from the GO end of the electronic device, and then re-establish a WiFi direct transmission channel with the SoftAP.
[0104] In this way, the above process can ensure that both electronic devices can continue to transmit data when the operating system resets the WiFi module, thus improving the user experience.
[0105] The following is based on Figure 6 The flowchart shown below details the communication method in the embodiments of this application. Figure 6 The method shown is the same as Figure 5 The difference lies in the fact that this embodiment requires determining the recovery time of the WiFi module after the operating system resets. For example... Figure 6 As shown, specifically, the method includes the following steps:
[0106] S601: Network connectivity was detected as limited.
[0107] It is understood that in the embodiments of this application, when an electronic device establishes a WiFi direct connection transmission channel with other electronic devices, the electronic device can also act as a STA device to establish a connection with a wireless access point (e.g., a wireless router) to access the wireless network and achieve functions such as Internet access.
[0108] In some embodiments, when the network environment changes when the electronic device is accessing the Internet as a STA device, such as a decrease in network signal, inability to access the Internet, or a decrease in network speed, the operating system of the electronic device will detect the limited network connection and attempt to recover automatically.
[0109] S602: Reset WiFi module.
[0110] It is understood that in this embodiment of the application, after the electronic device's operating system detects that the network connection is limited, the operating system will restore the network status by resetting the WiFi module in the electronic device.
[0111] S603: Get the recovery time of the reset WiFi module.
[0112] It is understood that in this embodiment of the application, when the operating system resets the WiFi module, it is necessary to obtain the recovery time of the reset WiFi module.
[0113] In some embodiments, the recovery time for resetting the WiFi module refers to the minimum value between the default recovery time and the actual detected recovery time. The default recovery time refers to the recovery time actually tested before the product leaves the factory. The actual detected recovery time refers to the recovery time that can be statistically calculated when a user uses an electronic device, regardless of whether they are using smart interconnection services or not, due to changes in the WiFi network environment that may cause the operating system to reset the WiFi module.
[0114] In some embodiments, the recovery time of resetting the WiFi module can be obtained after triggering the WiFi module reset task in step S602 above; alternatively, the recovery time of resetting the WiFi module can be obtained at the same time as triggering the WiFi module reset task in step S602 above.
[0115] S604: Determine if the recovery time is greater than or equal to 1 second. If yes, proceed to S606; otherwise, proceed to S605.
[0116] It is understood that in this embodiment of the application, it is necessary to determine the recovery time of resetting the WiFi module. If the recovery time is greater than or equal to 1 second, the process proceeds to S606 to create a GO through the WiFi chip; if the recovery time is less than 1 second, the process proceeds to S605 to establish a WiFi direct transmission channel after the WiFi module is successfully reset.
[0117] In some embodiments, due to differences in the design and architecture of WiFi chips from different manufacturers, the recovery time for resetting the WiFi module varies when the operating system of an electronic device equipped with a WiFi chip from a different manufacturer resets the WiFi module. For example, when computer 1 uses a WiFi chip from manufacturer A, the recovery time for resetting the WiFi module is 1 second, while when computer 2 uses a WiFi chip from manufacturer B, the recovery time for resetting the WiFi module is 6 seconds. Therefore, different protection strategies need to be developed based on the different WiFi module reset recovery times to ensure that the electronic device and other electronic devices can continue data transmission when the operating system of the electronic device resets the WiFi module.
[0118] S605: Wait for the WiFi module to be successfully reset before establishing a WiFi direct transmission channel.
[0119] It is understood that in this embodiment of the application, if the recovery time of the WiFi module reset by the operating system is relatively short (e.g., less than 1 second), the operating system can automatically create a SoftAP after the WiFi module is successfully reset and send a fast reconnection command to the peer device. Communication can resume once the peer device successfully reconnects.
[0120] In some embodiments, after successfully resetting the WiFi module, the electronic device's operating system can create a SoftAP using the same SSID, password, and working channel as when the WiFi module previously established a WiFi Direct transmission channel with the peer device. Then, a fast reconnection command is sent to the peer device via Bluetooth. This fast reconnection command includes information such as the SoftAP's SSID, password, working channel, and BSSID. Upon receiving the fast reconnection command, the peer device establishes a WiFi Direct transmission channel with the SoftAP. Thus, data transmission between the two electronic devices can still occur after resetting the WiFi module.
[0121] In some embodiments, electronic devices may also send connection commands to peer devices via near-field communication methods such as NFC, and this application does not limit this.
[0122] S606: Create GO via WiFi chiplet.
[0123] It is understood that in this embodiment of the application, if the recovery time of the WiFi module reset by the operating system is long (for example, greater than or equal to 1 second), a GO terminal for P2P communication can be created through the WiFi chip during the WiFi module reset process.
[0124] In some embodiments, when creating a GO, the same SSID, password, and working channel used when the WiFi module previously established a WiFi Direct transmission channel with the peer device can be used to create the GO.
[0125] In some embodiments, in P2P communication, the GO acts similarly to a wireless access device, the GC implements the functions of a terminal device, and the GC connecting to the GO is similar to a terminal device connecting to a wireless router.
[0126] S607: Send a connection command to the peer device.
[0127] It is understood that in this embodiment of the application, after the electronic device completes the creation of the GO, it can send a connection command to the peer device via Bluetooth. The connection command includes information such as the GO's SSID, password, working channel, and BSSID.
[0128] S608: Establishes a P2P connection with the peer device.
[0129] It is understood that in this embodiment of the application, after receiving the connection command, the peer device will establish a P2P connection with the GO device. In this way, data transmission can be performed between the two electronic devices.
[0130] In some embodiments, if the peer device acts as a STA device and connects to the wireless router via the STA channel to access the wireless network, and the STA channel of the electronic device is different from that of the peer device, then when using a WiFi chip for P2P communication, the P2P communication channel can be established on the STA channel of the peer device. For example, when a mobile phone connects to the AP via channel 36 and a computer connects to the AP via channel 149, when establishing a P2P connection between the computer and the mobile phone, P2P communication can be created on the mobile phone's STA channel (i.e., channel 36). This ensures that the channel used for communication between the mobile phone and the AP is the same as the channel used for communication with the computer, eliminating the need for the mobile phone to switch between different channels and improving data transmission efficiency.
[0131] In this way, data transmission between the two devices can still be maintained during the process of resetting the WiFi module.
[0132] S609: WiFi module reset successfully detected.
[0133] It is understood that in this embodiment of the application, when the recovery time of resetting the WiFi module by the operating system is long (e.g., greater than or equal to 1 second), it is necessary to detect whether the WiFi module was successfully reset.
[0134] S610: Determine whether the WiFi chip meets the network transmission requirements of smart interconnection services. If yes, proceed to S611; otherwise, proceed to S612.
[0135] It is understood that in this embodiment of the application, when the recovery time of the WiFi module reset by the operating system is long (e.g., greater than or equal to 1 second), after the WiFi module is detected to be successfully reset, it is necessary to determine whether the WiFi chip meets the network transmission latency (i.e., the time for data to be transmitted from the sending end to the receiving end) and throughput (i.e., the amount of data transmitted per unit time) requirements of the smart interconnection service. If the requirements are met, the process proceeds to S611 to maintain the establishment of a transmission channel on the WiFi chip; if the requirements are not met, the process proceeds to S612 to switch the WiFi main chip to establish a WiFi direct connection transmission channel with the peer device.
[0136] In some embodiments, such as when only a small number of images are being transferred between the computer and the mobile phone, the network transmission rate requirement is low; however, if a large amount of video needs to be transferred between the computer and the mobile phone, the data transmission rate requirement is high.
[0137] S611: Maintains a transmission channel on the WiFi chiplet.
[0138] It is understood that in this embodiment of the application, if the WiFi chip can meet the requirements of smart interconnection services for network transmission latency and throughput, the transmission channel can continue to be established on the WiFi chip. For example, if only a small number of pictures are transmitted between the computer and the mobile phone, the P2P communication established between the computer's WiFi chip and the mobile phone can continue to be maintained.
[0139] S612: Switches to WiFi main chip to establish WiFi direct connection transmission channel with peer device.
[0140] It is understood that in this embodiment of the application, if the WiFi chip cannot meet the requirements of smart interconnection services for network transmission latency and throughput, the operating system will switch to the WiFi main chip to establish a WiFi direct connection transmission channel with the peer device.
[0141] In some embodiments, the operating system of the electronic device can use and reset the same SSID, password, and working channel as when the WiFi module previously established a WiFi direct transmission channel with the peer device to create a SoftAP at the operating system interface; then, it sends a connection command to the peer device via Bluetooth, wherein the connection command includes information such as the SSID, password, working channel, and BSSID of the SoftAP; after receiving the connection command, the peer device will first disconnect from the GO end of the electronic device, and then re-establish a WiFi direct transmission channel with the SoftAP.
[0142] In this way, the above process can ensure that both electronic devices can continue to transmit data when the operating system resets the WiFi module, thus improving the user experience.
[0143] The following is a brief introduction to device interaction when the WiFi module reset time is less than 1 second, using the electronic device as a computer and the peer device as a mobile phone. Figure 7 This paper illustrates an interactive flow diagram according to an embodiment of the present application. Specifically, Figure 7 The method shown includes the following steps:
[0144] 701: Establish a direct WiFi connection between the computer and the mobile phone.
[0145] It is understood that in this embodiment of the application, the computer can act as a SoftAP and the mobile phone can act as a GC to connect to the SoftAP and establish a WiFi direct transmission channel.
[0146] In some embodiments, the SoftAP functions similarly to a wireless access point, the GC implements the functions of the terminal device, and the GC connects to the SoftAP in a manner similar to the terminal device connecting to a wireless router.
[0147] 702: The computer detected an operating system 4003 event.
[0148] It is understood that in this embodiment of the application, when a 4003 event is detected in the computer operating system, that is, when the network environment changes when the computer is connected to the Internet as a STA device, such as a decrease in network signal, inability to access the Internet, or a decrease in network speed, the computer operating system will detect the limited network connection and attempt to recover automatically.
[0149] 703: The computer detected that the WiFi module was successfully reset.
[0150] It's understandable that the computer operating system can detect that the WiFi module reset operation was successful.
[0151] 704: Computer created SoftAP.
[0152] It is understood that in this embodiment of the application, after the WiFi module is successfully reset, the computer operating system can use the same SSID, password, and working channel as when the WiFi module established a WiFi direct connection transmission channel with the peer device before the WiFi module was reset to create a SoftAP.
[0153] 705: The computer sends a quick reconnect command to the mobile phone via Bluetooth.
[0154] It is understood that in this embodiment of the application, after the SoftAP is successfully created, the computer can send a fast reconnection command to the mobile phone via Bluetooth. The fast reconnection command includes information such as the SoftAP's SSID, password, working channel, and BSSID.
[0155] 706: Establish a direct WiFi connection between the computer and the mobile phone.
[0156] It is understood that in this embodiment of the application, after the mobile phone receives the fast reconnection command, it will establish a WiFi direct connection transmission channel with the SoftAP.
[0157] Thus, through the above interactive process, after resetting the WiFi module, the WiFi direct connection transmission channel between the two electronic devices can be automatically restored, enabling data transmission between the two electronic devices.
[0158] The following is a brief introduction to device interaction when the reset WiFi module recovery time is greater than or equal to 1 second and the electronic device has a built-in WiFi chip, using the electronic device as a computer and the peer device as a mobile phone. Figure 8 This paper illustrates an interactive flow diagram according to an embodiment of the present application. Specifically, Figure 8 The method shown includes the following steps:
[0159] 801: Establishes a WiFi direct connection transmission channel between the computer and the mobile phone.
[0160] It is understood that in this embodiment of the application, the computer can act as a SoftAP and the mobile phone can act as a GC to connect to the SoftAP and establish a WiFi direct transmission channel.
[0161] In some embodiments, the SoftAP functions similarly to a wireless access point, the GC implements the functions of the terminal device, and the GC connects to the SoftAP in a manner similar to the terminal device connecting to a wireless router.
[0162] 802: The computer detected an operating system 4003 event.
[0163] It is understood that in this embodiment of the application, when a 4003 event is detected in the computer operating system, that is, when the network environment changes when the computer is connected to the Internet as a STA device, such as a decrease in network signal, inability to access the Internet, or a decrease in network speed, the computer operating system will detect the limited network connection and attempt to recover automatically.
[0164] 803: The computer uses a WiFi chip to create GO.
[0165] It is understood that in this embodiment of the application, if the recovery time of the WiFi module reset by the operating system is long (for example, greater than or equal to 1 second), a GO terminal for P2P communication can be created through the WiFi chip during the WiFi module reset process.
[0166] In some embodiments, when creating a GO, the same SSID, password, and working channel used when the WiFi module previously established a WiFi Direct transmission channel with the mobile phone can be used and reset.
[0167] In some embodiments, in P2P communication, the GO acts similarly to a wireless access device, the GC implements the functions of a terminal device, and the GC connecting to the GO is similar to the terminal device connecting to a wireless router.
[0168] 804: The computer sends a connection command to the mobile phone via Bluetooth.
[0169] It is understood that in this embodiment of the application, after the computer completes the creation of the GO, it can send a connection command to the mobile phone via Bluetooth. The connection command includes information such as the GO's SSID, password, working channel, and BSSID.
[0170] 805: Establishes a P2P connection between a computer and a mobile phone.
[0171] It is understood that in this embodiment of the application, after the mobile phone receives the connection command, it will establish a P2P connection with the GO terminal.
[0172] In this way, data transmission between the two devices can still be maintained during the process of resetting the WiFi module.
[0173] 806: The computer detected that the WiFi module was successfully reset.
[0174] It's understandable that the computer operating system can detect that the WiFi module reset operation was successful.
[0175] 807: Computer creates SoftAP.
[0176] It is understood that in this embodiment of the application, after the WiFi module is successfully reset, if the WiFi chip cannot meet the requirements of smart interconnection services for network transmission latency and throughput, the computer operating system can use the same SSID, password, and working channel as when the WiFi module established a WiFi direct connection transmission channel with the mobile phone before the reset of the WiFi module to create a SoftAP.
[0177] 808: The computer sends a connection command to the mobile phone via Bluetooth.
[0178] It is understood that in this embodiment of the application, after a SoftAP is successfully created, the computer can send a connection command to the mobile phone via Bluetooth. The connection command includes information such as the SoftAP's SSID, password, working channel, and BSSID.
[0179] 809: Establish a direct WiFi connection between the computer and the mobile phone.
[0180] It's understandable that after receiving the connection command, the phone will first disconnect from the computer's GO terminal, and then re-establish a WiFi direct connection transmission channel with the SoftAP.
[0181] In this way, the above interaction process can enable both electronic devices to continue data transmission when the operating system resets the WiFi module, thus improving the user experience.
[0182] The following example uses a computer as the electronic device and a mobile phone as the peer device to briefly introduce the device interaction when the WiFi chip cannot meet the network transmission requirements of smart interconnection services. Figure 9 This paper illustrates an interactive flow diagram according to an embodiment of the present application. Specifically, Figure 9 The method shown includes the following steps:
[0183] 901: Establishes a P2P connection between a computer and a mobile phone.
[0184] It is understood that in this embodiment of the application, the computer can create a GO through a WiFi chip, and the mobile phone, as the GC, connects to the GO to establish a P2P connection.
[0185] In some embodiments, in P2P communication, the GO acts similarly to a wireless access device, the GC implements the functions of a terminal device, and the GC connecting to the GO is similar to the terminal device connecting to a wireless router.
[0186] 902: The computer detected that the WiFi module was successfully reset.
[0187] It's understandable that the computer operating system can detect that the WiFi module reset operation was successful.
[0188] 903: Computer creates SoftAP.
[0189] It is understood that in this embodiment of the application, after the WiFi module is successfully reset, if the WiFi chip cannot meet the requirements of smart interconnection services for network transmission latency and throughput, the computer operating system can use the same SSID, password, and working channel as when the WiFi module established a WiFi direct connection transmission channel with the mobile phone before the reset of the WiFi module to create a SoftAP.
[0190] 904: The computer sends a connection command to the mobile phone via Bluetooth.
[0191] It is understood that in this embodiment of the application, after a SoftAP is successfully created, the computer can send a connection command to the mobile phone via Bluetooth. The connection command includes information such as the SoftAP's SSID, password, working channel, and BSSID.
[0192] 905: GC connects to SoftAP.
[0193] It's understandable that after receiving the connection command, the mobile phone will first disconnect from the computer's GO terminal, and then re-establish a connection with SoftAP.
[0194] 906: Establish a direct WiFi connection between the computer and the mobile phone.
[0195] It's understandable that once the phone reconnects to SoftAP, it can re-establish a WiFi direct connection with the computer.
[0196] Thus, through the above interaction process, it is possible to ensure that both electronic devices can continue to transmit data after the operating system resets the WiFi module, while meeting the network transmission requirements of smart interconnection services and improving the user experience.
[0197] The following is based on Figure 10 This paper describes the interaction process between electronic devices when establishing a WiFi Direct transmission channel. Specifically, Figure 10 The method shown includes the following steps:
[0198] 1001: GC sends a probe request to SoftAP.
[0199] It is understandable that when a WiFi direct transmission channel needs to be established between two electronic devices, the GC will send a probe request broadcast message. This broadcast message contains the GC's identity information and related parameters. After receiving the probe request, SoftAP can respond to or ignore the request according to its configuration and policy.
[0200] In some embodiments, for example, a computer can act as a SoftAP, and a mobile phone can act as a GC to establish a direct WiFi transmission link by connecting to the SoftAP. Here, the SoftAP functions similarly to a wireless access point, the GC performs the functions of a terminal device, and the GC connecting to the SoftAP is analogous to a terminal device connecting to a wireless router.
[0201] 1002: SoftAP sends a probe response to GC.
[0202] It is understandable that after SoftAP receives the probe request from GC, if SoftAP chooses to respond to the probe request, it will reply with a probe response message to GC. The probe response message contains SoftAP's identity information, supported network features, and related information. After receiving the probe response, GC can use the response to determine the applicable conditions for establishing a connection with SoftAP and further proceed with the connection process.
[0203] Furthermore, steps 1001 and 1002 described above are the process by which electronic devices scan and discover each other when establishing a WiFi direct transmission channel.
[0204] 1003: GC sends an authentication request to SoftAP.
[0205] It is understandable that after receiving the probe response information sent by SoftAP, GC will send an authentication request (auth request) to SoftAP. The information may include GC's identity information, encryption algorithm and related parameters.
[0206] 1004: SoftAP sends an authentication response to GC.
[0207] It's understandable that after receiving the GC's authentication request, SoftAP can use a pre-shared key or other authentication mechanisms to verify the GC's identity. If the GC's authentication is successful, SoftAP will send an authentication response to the GC, confirming that the GC has been authenticated.
[0208] In addition, steps 1003 and 1004 above are the process of electronic devices authenticating their identity when establishing a WiFi direct transmission channel.
[0209] 1005: GC sends an association request to SoftAP.
[0210] It's understandable that after receiving the auth response information from SoftAP, GC will send an assoc request to SoftAP to establish a connection. This assoc request may contain information such as GC's identity and network parameters.
[0211] 1006: SoftAP replies with an associated response to GC.
[0212] It is understandable that after receiving the GC's assoc request, SoftAP will perform relevant authentication and parameter confirmation based on the identity information and parameters contained therein. If everything is normal, SoftAP will reply to the GC with an assoc response, indicating that the association was successful and ensuring that the GC obtains network access permissions.
[0213] In addition, steps 1005 and 1006 above are the process of electronic devices associating when establishing a WiFi direct transmission channel.
[0214] 1007: SoftAP sends the first part of the Extended Authentication Protocol LAN Key (Eapol Key) to GC (M1:Eapol Key(ANonce)).
[0215] It is understandable that after SoftAP sends the association response information to GC, SoftAP will also send the first part of the authentication information (M1: Eapol Key (ANonce)) to GC. Eapol is a protocol used for authentication on a local area network. During the establishment of the WiFi direct transmission channel, Eapol messages are used for authentication and key exchange between GC and SoftAP. ANonce is a random number. SoftAP sends ANonce to GC so that GC can generate a shared key and perform subsequent authentication and encryption operations, ensuring the security and reliability of communication between SoftAP and GC.
[0216] 1008: GC sends the second part of the Eapol Key information (M2: Eapol Key (SNonce, message integrity code)) to SoftAP.
[0217] It is understandable that after receiving the first part of the Eapol authentication information sent by SoftAP, GC will send the second part of the Eapol authentication information (M2: Eapol Key (SNonce, Message Integrity Code)) to SoftAP for authentication and key negotiation between GC and SoftAP. Here, SNonce is a random number; the Message Integrity Code is used to verify the integrity of the message during transmission to prevent tampering or damage.
[0218] 1009: SoftAP sends the third part of the Eapol Key (M3: Eapol Key (encryption key, message integrity code)) to GC.
[0219] It is understandable that after SoftAP receives the M2 authentication information sent by GC, SoftAP will send the third part of Eapol's authentication information (M3: Eapol Key (encryption key, message integrity code)) to GC. The encryption key is used for encryption and decryption operations in subsequent data transmission. The message integrity code is used to verify the integrity of the message during transmission to prevent tampering or damage.
[0220] 1010: GC sends the fourth part of the Eapol Key (M4: Eapol Key (Message Integrity Code)) to SoftAP.
[0221] It is understandable that after GC receives the M3 authentication information sent by SoftAP, if it successfully verifies the received encryption key and message integrity code, it will send the fourth part of Eapol's authentication information (M4: Eapol Key (message integrity code)) to SoftAP as final confirmation.
[0222] In some embodiments, after receiving an M4 message, SoftAP verifies the message integrity code to ensure that the message integrity code is consistent with the previously sent message. If the verification is successful, SoftAP confirms the success of the four authentications and marks the establishment of a secure connection between the two electronic devices.
[0223] 1011: Dynamic Host Configuration Protocol (DHCP) interaction occurs between GC and SoftAP.
[0224] Understandably, after the GC and SoftAP complete four authentications, the GC requests an Internet Protocol (IP) address and other network configuration information from the SoftAP via DHCP in order to successfully connect to the network and communicate with other devices.
[0225] 1012: Address Resolution Protocol (ARP) interaction occurs between GC and SoftAP.
[0226] It is understandable that when establishing a WiFi direct connection transmission channel between GC and SoftAP, the physical address of the other party's electronic device can be obtained by using the ARP protocol in order to achieve correct transmission of data packets on the local area network.
[0227] Based on the above interaction process, a WiFi direct connection transmission channel can be successfully established between two electronic devices.
[0228] It is understood that the electronic devices (local device and remote device) in the embodiments of this application can be any electronic device such as a computer, mobile phone, virtual reality (VR) device, tablet computer, wearable device, augmented reality (AR) device, laptop computer, etc. The embodiments of this application do not specifically limit the form of the electronic devices.
[0229] like Figure 11 The diagram illustrates the hardware structure of an electronic device 1100 according to an embodiment of this application. Figure 11 As shown, the electronic device 1100 may include a processor 110, a power module 140, a memory 180, a mobile communication module 130, a wireless communication module 120, a sensor module 190, an audio module 150, a camera 170, an interface module 160, buttons 101, a display screen 102, and a touch screen 103, etc.
[0230] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a limitation on the only possible implementation of the electronic device 1100. In other embodiments of this application, the electronic device 1100 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.
[0231] Processor 110 may include one or more processing units, such as processing modules or circuits of a Central Processing Unit (CPU), Graphics Processing Unit (GPU), Digital Signal Processor, Micro-programmed Control Unit (MCU), Artificial Intelligence (AI) processor, or Field Programmable Gate Array (FPGA). Different processing units may be independent devices or integrated into one or more processors. Processor 110 may also include a storage unit for storing instructions and data. In some embodiments, the storage unit in processor 110 is a cache memory 180, which can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to reuse the instruction or data, it can directly retrieve it from the storage unit, avoiding repeated access, reducing the processor 110's waiting time, and thus improving system efficiency.
[0232] The controller can generate operation control signals based on the instruction opcode and timing signals to complete the control of instruction fetching and execution.
[0233] It is understood that in the embodiments of this application, the processor can be used to execute the method steps performed by the local device and the remote device in the communication method of this application.
[0234] The power module 140 may include a power supply, a power management component, etc. The power supply may be a battery. The power management component manages the charging of the power supply and the power supply to other modules. In some embodiments, the power management component includes a charging management module and a power management module. The charging management module receives charging input from a charger; the power management module connects to the power supply and is connected to the processor 110. The power management module receives input from the power supply and / or the charging management module to supply power to the processor 110, the display 102, the camera 170, and the wireless communication module 120, etc.
[0235] The mobile communication module 130 may include, but is not limited to, antennas, power amplifiers, filters, and low-noise amplifiers (LANs). The mobile communication module 130 can provide wireless communication solutions, including 2G / 3G / 4G / 5G, for use on the electronic device 1100. The mobile communication module 130 can receive electromagnetic waves via its antenna, filter and amplify the received electromagnetic waves, and then transmit them to a modem processor for demodulation. The mobile communication module 130 can also amplify the signal modulated by the modem processor and radiate it as electromagnetic waves via its antenna. In some embodiments, at least some functional modules of the mobile communication module 130 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 130 and at least some modules of the processor 110 may be housed in the same device.
[0236] The wireless communication module 120 may include an antenna, which enables the transmission and reception of electromagnetic waves. The wireless communication module 120 can provide wireless communication solutions for use on the electronic device 1100, including wireless local area networks (WLANs) (such as wireless fidelity (WiFi) networks), Bluetooth, global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The electronic device 1100 can communicate with networks and other devices via wireless communication technologies.
[0237] In some embodiments, the mobile communication module 130 and the wireless communication module 120 of the electronic device 1100 may also be located in the same module.
[0238] The display screen 102 is used to display human-computer interaction interfaces, images, videos, etc. The display screen 102 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 quantum dot light-emitting diode (QLED), etc.
[0239] The sensor module 190 may include proximity sensors, pressure sensors, gyroscope sensors, barometric pressure sensors, magnetic sensors, accelerometers, distance sensors, fingerprint sensors, temperature sensors, touch sensors, ambient light sensors, bone conduction sensors, electromagnetic wave absorption rate sensors, sound sensors, etc.
[0240] The audio module 150 is used to convert digital audio signals into analog audio signals for output, or to convert analog audio input into digital audio signals. The audio module 150 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 150 may be located in the processor 110, or some functional modules of the audio module 150 may be located in the processor 110. In some embodiments, the audio module 150 may include a speaker, a handset, a microphone, and a headphone jack.
[0241] Camera 170 is used to capture still images or videos. An object passes through the lens to generate an optical image that is projected onto a photosensitive element. The photosensitive element converts the light signal into an electrical signal, which is then passed to image signal processing (ISP) to be converted into a digital image signal. Electronic device 1100 can realize the shooting function through ISP, camera 170, video codec, graphics processor, display screen 102, and application processor.
[0242] Interface module 160 includes an external memory interface and a universal serial bus (USB) interface. The external memory interface can be used to connect external memory cards, such as Micro SD cards, to expand the storage capacity of electronic device 1100. The external memory card communicates with processor 110 through the external memory interface to perform data storage. The universal serial bus interface is used for communication between electronic device 1100 and other electronic devices.
[0243] In some embodiments, the electronic device 1100 further includes buttons 101, a motor, and indicators. Buttons 101 may include volume buttons, a power button, etc. The motor is used to generate vibration effects in the electronic device 1100; different application scenarios (e.g., time reminders, receiving messages, alarm clocks, games, etc.) may correspond to different vibration feedback effects. Indicators may include laser indicators, radio frequency indicators, light-emitting diode (LED) indicators, etc.
[0244] The embodiments disclosed in this application can be implemented in hardware, software, firmware, or a combination of these implementation methods. Embodiments of this application can be implemented as computer programs or program code executable on a programmable system, the programmable system including at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device.
[0245] Program code can be applied to input instructions to execute the functions described in this application and generate output information. The output information can be applied to one or more output devices in a known manner. For the purposes of this application, the processing system includes any system having a processor such as, for example, a digital signal processor, a microcontroller, an application-specific integrated circuit, or a microprocessor.
[0246] The program code can be implemented using a high-level procedural language or an object-oriented programming language to communicate with the processing system. Assembly language or machine language can also be used when needed. In fact, the mechanisms described in this application are not limited to any particular programming language. In either case, the language can be a compiled language or an interpreted language.
[0247] In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented as instructions carried or stored thereon on one or more temporary or non-temporary machine-readable (e.g., computer-readable) storage media, which may be read and executed by one or more processors. For example, the instructions may be distributed via a network or through other computer-readable media. Therefore, machine-readable media may include any mechanism for storing or transmitting information in a machine-readable (e.g., computer-readable) form, including but not limited to floppy disks, optical disks, optical discs, magneto-optical disks, read-only memory (ROM), random access memory (RAM), magnetic cards or optical cards, flash memory, or tangible machine-readable storage for transmitting information (e.g., carrier waves, infrared signals, digital signals, etc.) using the Internet in the form of electrical, optical, acoustic, or other propagation signals. Therefore, machine-readable media include any type of machine-readable medium suitable for storing or transmitting electronic instructions or information in a machine-readable (e.g., computer-readable) form.
[0248] In the accompanying drawings, some structural or methodological features may be shown in a specific arrangement and / or order. However, it should be understood that such a specific arrangement and / or order may not be necessary. Rather, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the illustrative drawings. Furthermore, the inclusion of structural or methodological features in a particular figure does not imply that such features are required in all embodiments, and in some embodiments, these features may be omitted or may be combined with other features.
[0249] It should be noted that all units / modules mentioned in the device embodiments of this application are logical units / modules. Physically, a logical unit / module can be a physical unit / module, a part of a physical unit / module, or a combination of multiple physical units / modules. The physical implementation of these logical units / modules themselves is not the most important factor; the combination of functions implemented by these logical units / modules is the key to solving the technical problems proposed in this application. Furthermore, to highlight the innovative aspects of this application, the above-described device embodiments of this application have not introduced units / modules that are not closely related to solving the technical problems proposed in this application. This does not mean that the above-described device embodiments do not contain other units / modules.
[0250] It should be noted that in the examples and description of this patent, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one" does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the aforementioned element.
[0251] Although this application has been illustrated and described with reference to certain preferred embodiments thereof, those skilled in the art will understand that various changes in form and detail may be made thereto without departing from the scope of this application.
Claims
1. A communication method for a first electronic device, characterized in that, The method includes: The first electronic device communicates directly with the second electronic device via WiFi based on the first WiFi chip. During the WiFi direct communication process, a reset command for the first WiFi chip is detected, wherein the reset duration of the first WiFi chip is greater than a first preset time, and the reset duration of the first WiFi chip is the minimum duration between the default recovery duration of resetting the first WiFi chip and the actual detection duration. Switching to using the second WiFi chip in the first electronic device to establish a WiFi direct connection with the second electronic device; wherein... The switching to establish a WiFi direct connection with the second electronic device using the second WiFi chip in the first electronic device includes: The first electronic device is connected to the first wireless access device via a first channel; The second electronic device is connected to the second wireless access device via the second channel; The second WiFi chip in the first electronic device establishes a direct WiFi connection with the second electronic device based on the second channel, and... During the process of the first electronic device switching to use the second WiFi chip to establish WiFi direct communication with the second electronic device, the first electronic device uses the first information to create a point-to-point communication group owner terminal on the first electronic device. The first information is the communication information when the first electronic device conducts WiFi direct communication with the second electronic device based on the first WiFi chip. If the first WiFi chip is successfully reset, and it is determined that the second WiFi chip cannot meet the network transmission requirements between the first electronic device and the second electronic device, a WiFi direct connection communication is established between the first electronic device and the second electronic device based on the first WiFi chip, wherein the data transmission performance of the second WiFi chip is worse than that of the first WiFi chip.
2. The method according to claim 1, characterized in that, The method further includes: If it is determined that the second WiFi chip can meet the network transmission requirements between the first electronic device and the second electronic device, the WiFi direct communication between the second WiFi chip and the second electronic device shall be maintained in a connected state.
3. The method according to claim 2, characterized in that, The first electronic device includes an operating system and an application layer, wherein the application layer includes system applications; The first WiFi chip is controlled based on the operating system of the first electronic device, and the second WiFi chip is controlled based on the system application of the first electronic device.
4. The method according to any one of claims 1-3, characterized in that, The switching to establish a WiFi direct connection with the second electronic device using the second WiFi chip in the first electronic device includes: The second WiFi chip is used to create a group owner terminal for point-to-point communication on the first electronic device; A connection command is sent to the second electronic device, the connection command being used by the first electronic device to establish a WiFi direct connection between the second electronic device and the first electronic device.
5. The method according to claim 4, characterized in that, The communication information includes one or more of the following: service set identifier, password, and working channel.
6. The method according to claim 5, characterized in that, The connection command includes the first information and the basic service set identifier corresponding to the first electronic device.
7. The method according to claim 1, characterized in that, The method further includes: If the first electronic device does not include the second WiFi chip, when the first electronic device detects that the first WiFi chip has been successfully reset, it establishes a WiFi direct communication with the second electronic device based on the first WiFi chip.
8. The method according to claim 7, characterized in that, When the first electronic device detects that the first WiFi chip has been successfully reset, it establishes a WiFi direct connection with the second electronic device based on the first WiFi chip, including: A soft access point is created on the first electronic device using the first WiFi chip; A reconnection command is sent to the second electronic device, the reconnection command being used by the first electronic device to establish a WiFi direct connection between the second electronic device and the first electronic device.
9. The method according to claim 1, characterized in that, The method further includes: If the first WiFi chip is detected to have been successfully reset within a second preset time, WiFi direct communication will be established between the first WiFi chip and the second electronic device after the first WiFi chip has been successfully reset. If the first WiFi chip fails to reset within a second preset time, the system switches to using the second WiFi chip in the first electronic device to establish a direct WiFi connection with the second electronic device.
10. The method according to claim 1, characterized in that, The method further includes: During the process of the first electronic device communicating directly with the second electronic device via WiFi based on the first WiFi chip, it was detected that the wireless network connection of the first electronic device met the network reset condition. Reset the WiFi module of the first electronic device.
11. An electronic device, characterized in that, include: A memory and a processor, the memory being used to store instructions executed by one or more processors of the electronic device, the processor being one of one or more processors of the electronic device, for performing the communication method according to any one of claims 1-10.
12. A readable storage medium, characterized in that, The readable storage medium stores instructions that, when executed on an electronic device, cause the electronic device to perform the communication method according to any one of claims 1-10.
Citation Information
Patent Citations
WiFi scanning control method and related device
CN114867035A