Wi-fi switching method and electronic device

By acquiring the Wi-Fi parameter information of the second device and switching to the same frequency to access the target Wi-Fi network under trigger conditions, the latency and stuttering problems when multiple modes coexist in electronic devices are solved, improving communication performance and user experience.

CN123145654APending Publication Date: 2026-11-20HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510658816.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-20
Publication Date
2026-11-20

AI Technical Summary

Technical Problem

In electronic devices, the coexistence of multiple Wi-Fi modes can easily lead to problems such as high service latency, stuttering, and poor performance, which can negatively impact the user experience.

Method used

The first device obtains the Wi-Fi parameter information of the second device, and prompts the user to switch to access the target Wi-Fi network at the same frequency when the trigger condition is met. This enables flexible switching between Wi-Fi network and P2P connection, avoids frequent frequency switching, reduces data interaction latency, and improves communication performance.

Benefits of technology

It reduces data interaction latency, improves communication performance, avoids business lag or anomalies, and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123145654A_ABST
    Figure CN123145654A_ABST
Patent Text Reader

Abstract

The application provides a Wi-Fi switching method and an electronic device, and relates to the technical field of terminals. In the method, the first device accesses a first Wi-Fi network at a first frequency, the second device accesses a second Wi-Fi network at a second frequency, and the first device and the second device establish a point-to-point (P2P) connection at the second frequency. In this case, the first device acquires Wi-Fi parameter information of the second device including the second frequency, triggers a network switching prompt when a triggering condition is met, and switches to access a target Wi-Fi network at the second frequency in response to detecting a first indication operation. The method can enable the first device to access a Wi-Fi network and establish a P2P connection at the same frequency, avoid the first device switching back and forth between the first frequency of the Wi-Fi network and the second frequency of the P2P, reduce the time delay, improve the communication performance, improve the use fluency, and improve the use experience of the user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of terminal technology, and in particular to a Wi-Fi switching method and an electronic device. Background Technology

[0002] As users' demand for interconnectivity between electronic devices continues to increase, users can interact with information on different electronic devices, greatly improving work flexibility and efficiency, and providing users with a more convenient user experience.

[0003] In existing technologies, electronic devices support wireless Wi-Fi connections. The Wi-Fi operating modes of these devices can include access point (AP) mode, station (STA) mode, or peer-to-peer (P2P) mode. When multiple modes coexist, electronic devices are prone to problems such as high latency, stuttering, and poor performance, negatively impacting the user experience. Summary of the Invention

[0004] This application provides a Wi-Fi switching method and electronic device. When a first device accesses a first Wi-Fi network at a first frequency, and a second device accesses a second Wi-Fi network at a second frequency, and the first and second devices establish a peer-to-peer (P2P) connection at the second frequency, a prompt to switch Wi-Fi networks is triggered. Upon detecting an instruction to switch, the device switches to accessing the Wi-Fi network at the second frequency. This allows the first device to access the Wi-Fi network and establish a P2P connection using the same frequency, thereby reducing latency, improving communication performance, minimizing service lag or anomalies, and enhancing the user experience.

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

[0006] In a first aspect, a Wi-Fi switching method is provided, applied to a first device. The first device accesses a first Wi-Fi network at a first frequency, and a second device establishes a peer-to-peer (P2P) connection at a second frequency. The second device accesses a second Wi-Fi network at the second frequency. The method includes: the first device acquiring Wi-Fi parameter information of the second device, including the second frequency; the first device triggering a first prompt to indicate whether to switch to a target Wi-Fi network, the target Wi-Fi network corresponding to the second frequency; and the first device switching to access the target Wi-Fi network at the second frequency in response to detecting a first instruction operation.

[0007] In the aforementioned Wi-Fi switching method, in a scenario where the first device accesses the first Wi-Fi network using a first frequency, and the first and second devices establish a peer-to-peer (P2P) connection using a second frequency, and the second device accesses the second Wi-Fi network using the second frequency, the first device provides a network switching prompt, offering flexible options for switching Wi-Fi networks. Responding to the first instruction to switch Wi-Fi networks, the first device switches to accessing the target Wi-Fi network using the second frequency. This allows the first device to use the second frequency for both Wi-Fi network access and P2P connection, avoiding the first device switching back and forth between the first frequency of the Wi-Fi network and the second frequency of the P2P connection. This reduces data interaction latency, improves communication performance, minimizes service lag or anomalies, and enhances the user experience.

[0008] Among these features, by proactively triggering network switching prompts, users are given the option to flexibly switch Wi-Fi networks, allowing them to decide whether to switch Wi-Fi networks according to their own wishes, thereby increasing user autonomy and improving user satisfaction.

[0009] In one possible implementation of the first aspect, when the first device and the second device correspond to the same cloud account, the first device obtains the Wi-Fi parameter information of the second device from the cloud server. Specifically, the Wi-Fi parameter information of the second device is sent and stored on the cloud server when the second device accesses the second Wi-Fi network at a second frequency.

[0010] Therefore, when the first and second devices are under the same cloud account, they can share Wi-Fi parameter information, improving device connection efficiency and security. The Wi-Fi parameter information of the second device can be sent and stored in the cloud server, making it easy for the first device to retrieve the second device's Wi-Fi parameter information from the cloud server, thus improving the security of obtaining Wi-Fi parameter information.

[0011] In one possible implementation of the first aspect, the first device receives Wi-Fi parameter information sent by the second device via a P2P connection.

[0012] Therefore, the first device can reuse the established P2P connection to obtain the Wi-Fi parameter information of the second device in real time without occupying the memory space of the cloud server, thus improving the memory utilization of the cloud server.

[0013] In one possible implementation of the first aspect, the first device displays a first prompt message on an interface to indicate that the first device is about to access a target Wi-Fi network. The interface also includes a first control, and in response to detecting an operation on the first control, the first device switches to accessing the target Wi-Fi network at a second frequency.

[0014] Therefore, the first device can intuitively display the first prompt information on the interface, providing an entry point for flexibly choosing whether to switch to the target Wi-Fi network. When the first device detects the operation of switching to the target Wi-Fi network, that is, in response to the detection of the operation of the first control, it switches to accessing the target Wi-Fi network at the second frequency, thereby enabling the first device to access the Wi-Fi network and P2P connection at the same frequency.

[0015] In one possible implementation of the first aspect, the first device outputs a first voice prompt to indicate that the first device is about to access a target Wi-Fi network. In response to detecting a voice instruction to agree to the switch, the first device switches to accessing the target Wi-Fi network at a second frequency.

[0016] Therefore, the first device can provide an entry point for flexibly choosing whether to switch the target Wi-Fi network through voice prompts. In response to the voice instruction to agree to switch, the first device switches to access the target Wi-Fi network at the second frequency, thereby improving the user's ease of operation and enhancing the user experience.

[0017] In one possible implementation of the first aspect, the first device triggers a first prompt when the triggering condition is met.

[0018] Therefore, if the first device meets the triggering conditions, has high service performance requirements, or has the ability to switch between frequency and Wi-Fi networks, the first device can switch to use the same frequency to access the Wi-Fi network and P2P, avoiding frequent frequency switching, thereby improving the service experience, avoiding problems such as data lag or slow data transmission rate, improving the smoothness of data transmission, reducing latency, and enhancing the user experience.

[0019] In one possible implementation of the first aspect, the triggering condition includes a first triggering condition. For example, the first triggering condition includes: the first device and the second device are performing a target service via a P2P connection, the target service being a latency-sensitive service or a reliable transmission service; or, the communication rate of the P2P connection is less than a preset threshold.

[0020] Therefore, when the first device performs services with high latency requirements, high data transmission reliability, or communication rates below a preset threshold via P2P, the service performance requirements are high, and there is a need for frequency switching. This can trigger the switching of the Wi-Fi network, avoiding frequent frequency switching caused by the first device accessing the Wi-Fi network and P2P connection at different frequencies, reducing data latency and affecting the user experience.

[0021] In one possible implementation of the first aspect, the target Wi-Fi network is a connectable Wi-Fi network, and the aforementioned triggering condition includes a second triggering condition. For example, the second triggering condition includes: the first device identifies a connectable Wi-Fi network through network detection, and the connectable Wi-Fi network corresponds to a second frequency; and / or, identifies a connectable Wi-Fi network through the signal strength of the Wi-Fi network, and the connectable Wi-Fi network corresponds to a second frequency; and / or, identifies a connectable Wi-Fi network that meets the protocol requirements of the Wi-Fi network, and the connectable Wi-Fi network corresponds to a second frequency.

[0022] Therefore, if the first device can identify a connectable Wi-Fi network through the above-mentioned multiple implementation methods or combinations when accessing Wi-Fi networks and P2P at different frequencies, and can easily determine the target Wi-Fi network from the connectable Wi-Fi networks, then it is considered to have frequency switching capability, which can trigger the switching of Wi-Fi networks. This avoids frequent frequency switching caused by the first device accessing Wi-Fi networks and P2P connections at different frequencies, reduces data latency, and improves the user experience.

[0023] In one possible implementation of the first aspect, the triggering conditions include the first triggering condition and the second triggering condition described above.

[0024] Therefore, when the first device performs services with high latency requirements, high data transmission reliability, or communication rates less than a preset threshold via P2P and identifies a connectable Wi-Fi network, the service performance requirements are high, there is a need for frequency switching, and it has the capability to trigger switching of the Wi-Fi network. This avoids frequent frequency switching caused by the first device accessing the Wi-Fi network and P2P connection at different frequencies, reduces data latency, and improves the user experience.

[0025] In one possible implementation of the first aspect, the first device obtains candidate information of Wi-Fi networks, which includes Wi-Fi parameter information historically used by the first device, and / or Wi-Fi parameter information sent to the first device by other devices via P2P connection, and / or Wi-Fi parameter information obtained from a cloud server; the connectable Wi-Fi networks are identified from the candidate information.

[0026] Therefore, the first device can obtain candidate information of Wi-Fi networks and identify connectable Wi-Fi networks from the candidate information, providing more options for the first device to identify target Wi-Fi networks. The first device does not need to obtain the Wi-Fi network information of the second device in real time and access it, reducing the latency of the first device switching target Wi-Fi networks and improving the communication quality of the target Wi-Fi network and the probability of successful switching.

[0027] In one possible implementation of the first aspect, the Wi-Fi parameter information further includes the name of the second Wi-Fi network; the method further includes: the first device determining whether the first Wi-Fi network and the second Wi-Fi network are the same network based on the name of the second Wi-Fi network; if the first Wi-Fi network and the second Wi-Fi network are the same Wi-Fi network, switching to access the second Wi-Fi network at the second frequency.

[0028] Therefore, the first device can also determine whether the first Wi-Fi network and the second Wi-Fi network are the same network based on the name of the second Wi-Fi network, and then determine whether it is necessary to switch networks. If the first Wi-Fi network and the second Wi-Fi network are the same Wi-Fi network, the first device can directly switch frequencies without changing the Wi-Fi network, reducing the complexity of switching networks.

[0029] In one possible implementation of the first aspect, when the first Wi-Fi network and the second Wi-Fi network are different Wi-Fi networks, the first device obtains candidate information of Wi-Fi networks; the candidate information of Wi-Fi networks includes Wi-Fi parameter information historically used by the first device, and / or Wi-Fi parameter information sent to the first device by other devices via P2P connection, and / or Wi-Fi parameter information obtained from a cloud server; when the candidate information includes a second Wi-Fi network, the device switches to accessing the second Wi-Fi network at the second frequency based on the password and second frequency of the second Wi-Fi network in the candidate information.

[0030] Therefore, when the first Wi-Fi network and the second Wi-Fi network are different Wi-Fi networks, the first device can obtain candidate Wi-Fi network information and check whether the candidate information includes the second Wi-Fi network. If the candidate information includes the second Wi-Fi network, the first device can directly obtain the password of the second Wi-Fi network without the second device sending the password. This reduces the latency of the first device switching to the second Wi-Fi network, avoids the leakage of the second Wi-Fi network password information during the process of the second device sending the password, improves the security of the second Wi-Fi network password, and reduces operational complexity.

[0031] In one possible implementation of the first aspect, if the candidate information does not include a second Wi-Fi network, the first device obtains the password of the second Wi-Fi network; based on the password of the second Wi-Fi network and the second frequency, the first device switches to access the second Wi-Fi network at the second frequency.

[0032] Therefore, even if the candidate information does not include the second Wi-Fi network, the first device can still obtain the password of the second Wi-Fi network, and thus be able to access the second Wi-Fi network based on the password and the second frequency.

[0033] In one possible implementation of the first aspect, the Wi-Fi parameter information further includes the name and password of the second Wi-Fi network, and the first device switches to access the second Wi-Fi network at the second frequency based on the password and the second frequency of the second Wi-Fi network.

[0034] Therefore, the first device can switch to access the second Wi-Fi network at the second frequency without checking the candidate set information, thereby improving the speed at which the first device switches to the second Wi-Fi network.

[0035] In one possible implementation of the first aspect, when the P2P connection between the first device and the second device is disconnected, the first device switches to either continuing to access the first Wi-Fi network at the first frequency or switching to access the Wi-Fi network with the best current performance.

[0036] Since the first Wi-Fi network used by the first device is usually a high-performance network, even if the first device and the second device disconnect the P2P connection, the first device can continue to access the high-performance first Wi-Fi network at the first frequency, thus ensuring the network communication quality of the first device.

[0037] In addition, the first device can also access the best-performing Wi-Fi network currently scanned by the first device, thereby improving the communication performance of the first device.

[0038] In one possible implementation of the first aspect, the first device and the second device are site STA devices for Wi-Fi network access, and the P2P connection is a Wi-Fi P2P connection.

[0039] Therefore, when the first STA device accesses the first Wi-Fi network at the first frequency, the first STA device and the second STA device establish a Wi-Fi P2P connection at the second frequency, and the second STA device accesses the second Wi-Fi network at the second frequency, the first STA device obtains the Wi-Fi parameter information of the second STA device, including the second frequency. When a trigger condition is met, the first STA device prompts whether to switch to the target Wi-Fi network. The target Wi-Fi network corresponds to the second frequency. In response to detecting the first indication operation, the first STA device switches to access the target Wi-Fi network at the second frequency.

[0040] In one possible implementation of the first aspect, the first device includes a candidate information module, a Wi-Fi network availability assessment module, a Wi-Fi network smart suggestion module, a Wi-Fi suggestion switching module, and a Wi-Fi management module. The candidate information module stores candidate information for Wi-Fi networks. The Wi-Fi network availability assessment module obtains Wi-Fi parameter information from the second device; the Wi-Fi network availability assessment module obtains candidate information from the candidate information module; based on the candidate information, the Wi-Fi network availability assessment module assesses whether there is a connectable Wi-Fi network, and the connectable Wi-Fi network corresponds to a second frequency; if the Wi-Fi network availability assessment module assesses that there is a connectable Wi-Fi network, it sends the second frequency and the network name of the target Wi-Fi network to the Wi-Fi network smart suggestion module, the target Wi-Fi network being one of the connectable Wi-Fi networks; the Wi-Fi network smart suggestion module sends the second frequency and the name of the target Wi-Fi network to the Wi-Fi network suggestion switching module; the Wi-Fi network suggestion switching module triggers a first prompt based on the second frequency and the name of the target Wi-Fi network; the Wi-Fi network management module, in response to detecting the first prompt, switches to access the target Wi-Fi network using the second frequency.

[0041] Therefore, the first device can work together through the candidate information module, Wi-Fi network availability assessment module, Wi-Fi network intelligent suggestion module, Wi-Fi suggestion switching module, and Wi-Fi management module to switch to accessing the target Wi-Fi network at the second frequency. This allows the first device to access the Wi-Fi network and P2P connection at the second frequency, avoiding the first device switching back and forth between the Wi-Fi network accessed at the first frequency and the P2P connection accessed at the second frequency. This reduces data interaction latency, improves data transmission reliability, increases data transmission rate, avoids lag, and enhances the user experience.

[0042] In a second aspect, an electronic device is provided, comprising: a memory and one or more processors; the memory and the processors are coupled; wherein the memory stores computer program code, the computer program code including computer instructions, and when the computer instructions are executed by the processor, the electronic device performs the Wi-Fi switching method of any of the first aspects above.

[0043] Thirdly, a computer-readable storage medium is provided, including computer instructions that, when executed on an electronic device, cause the electronic device to perform the Wi-Fi switching method described in any of the first aspects above.

[0044] Fourthly, a computer program product is provided that, when the computer program product is run on a computer, causes the computer to execute the Wi-Fi switching method described in any of the first aspects above.

[0045] It is understood that the beneficial effects achieved by the electronic device of the second aspect, the computer-readable storage medium of the third aspect, and the computer program product of the fourth aspect provided above can be referred to the beneficial effects of the first aspect and any possible implementation thereof, which will not be repeated here. Attached Figure Description

[0046] Figure 1 This is a schematic diagram of a communication scenario where STA and P2P modes coexist.

[0047] Figure 2 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;

[0048] Figure 3 A schematic diagram of the software structure of an electronic device provided in an embodiment of this application;

[0049] Figure 4 A flowchart illustrating a Wi-Fi switching method provided in an embodiment of this application;

[0050] Figure 5 A flowchart illustrating another Wi-Fi switching method provided in an embodiment of this application;

[0051] Figure 6 This is a schematic diagram illustrating a first device displaying a first prompt message, provided in an embodiment of this application.

[0052] Figure 7 This is a schematic diagram illustrating another first device displaying a first prompt message provided in an embodiment of this application;

[0053] Figure 8 This is a schematic diagram illustrating the internal implementation of a Wi-Fi switching method provided in an embodiment of this application;

[0054] Figure 9 This is a schematic diagram of the structure of another electronic device provided in an embodiment of this application. Detailed Implementation

[0055] The technical solutions of the embodiments of this application will be described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, features defined with "first," "second," etc., may explicitly or implicitly include one or more of that feature. "Multiple" can be understood as "at least two"; "multiple items" can be understood as "at least two items."

[0056] In embodiments of this application, 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 limitation, 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 that element.

[0057] In the embodiments of this application, "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.

[0058] In the embodiments of this application, it should be noted that, unless otherwise explicitly specified and limited, the terms "set", "connected", and "linked" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection. For those skilled in the art, the specific meaning of the above terms in the embodiments of this application can be understood according to the specific circumstances.

[0059] Electronic devices support Wi-Fi connectivity. They can operate in AP mode, STA mode, or P2P mode, or in a combination of these three modes. For example, an electronic device can establish a network connection in STA mode and interact with other devices (such as mobile phones or computers) through P2P mode. Alternatively, an electronic device can provide access to other devices in AP mode and interact with them through P2P mode.

[0060] In P2P mode, a direct connection mode, multiple electronic devices can directly connect via Wi-Fi to transmit data. For example, when a mobile phone and a TV perform wireless screen mirroring via P2P, both the phone and TV are in P2P mode. In STA mode, the electronic device acts as a STA (Station) connecting to the Wi-Fi network. For example, the electronic device connects to a wireless router and accesses the internet through the router to play games. In AP mode, the electronic device acts as a wireless access point, creating a Wi-Fi network that allows other devices to connect and share its network resources.

[0061] However, when multiple modes coexist, electronic devices are prone to problems such as large service latency, service lag, and poor performance, which affect the user experience.

[0062] This section describes the various operating modes of electronic devices, using STA and P2P modes as examples. Please refer to [link / reference]. Figure 1 , Figure 1 This is a schematic diagram of a communication scenario where STA and P2P modes coexist. For example... Figure 1 As shown, the first device establishes a first Wi-Fi network connection at a first frequency in STA mode and accesses the first Wi-Fi network. The second device establishes a second Wi-Fi network connection at a second frequency in STA mode and accesses the second Wi-Fi network. The first and second devices also establish a P2P connection at a second frequency in P2P mode to exchange data. Here, the first and second devices are STA devices for Wi-Fi network access, and the P2P connection is a Wi-Fi P2P connection.

[0063] Because the first device operates on a different frequency in STA mode (first frequency, e.g., 5180) and P2P mode (second frequency, e.g., 5745), this is particularly noticeable in environments such as coffee shops, corporate networks, dual-band routers, Mesh networks, and enterprise routers. This causes the first device to switch back and forth between the first and second frequencies, resulting in problems such as large transmission latency, service lag, and poor performance between the first and second devices, which affects the user experience.

[0064] For example, a first device plays a video over a Wi-Fi network and then uses a P2P connection to cast the video to a second device. When playing the video, the first device uses a first frequency to access the Wi-Fi network. When casting, it switches to a second frequency to access the P2P connection. This frequent switching between the first and second frequencies can easily lead to significant communication latency, causing service interruptions or other issues, thus impacting the user experience.

[0065] Based on this, this application provides a Wi-Fi switching method. In this method, a first device accesses a first Wi-Fi network at a first frequency, and a first device and a second device establish a peer-to-peer (P2P) connection at a second frequency. The second device then accesses a second Wi-Fi network at the second frequency. The first device can assess and identify whether a second-frequency Wi-Fi network is available for connection and suggests switching networks. This allows the first device to establish both Wi-Fi and P2P connections at the same frequency, avoiding the first device switching back and forth between the first Wi-Fi frequency and the second P2P frequency, reducing latency, improving communication performance, minimizing service lag or anomalies, and enhancing the user experience.

[0066] The first and second devices can operate in STA mode or AP mode, and there is a Wi-Fi P2P connection between them. The method provided in this application is applied to a Wi-Fi multi-mode coexistence scenario.

[0067] In a scenario where the first device accesses the first Wi-Fi network in STA mode and on the first frequency, and the second device accesses the second Wi-Fi network in STA mode and on the second frequency, and the first and second devices establish a Wi-Fi P2P connection on the second frequency, the first device can prompt and suggest switching networks. This allows the first device to establish both Wi-Fi network and Wi-Fi P2P connections on the same frequency, avoiding the first device switching back and forth between the first and second frequencies, reducing latency, improving communication performance, minimizing service lag or anomalies, and enhancing the user experience.

[0068] Please see Figure 2 , Figure 2 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device can be a first device or a second device. Figure 2 As shown, the electronic device 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, antenna 1, antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a camera 191, a display screen 192, etc. The sensor module 180 may include a pressure sensor 180A, an accelerometer 180B, a proximity sensor 180C, a fingerprint sensor 180D, a touch sensor 180E, etc.

[0069] It is understood that the structure illustrated in this application does not constitute a specific limitation on the electronic device 100. In other embodiments, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0070] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), central processing unit (CPU), memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0071] The GPU is used to perform mathematical and geometric calculations and for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0072] For example, the GPU in this application embodiment can render the display interface of an electronic device, thereby facilitating the display of prompt information on the interface.

[0073] Electronic device 100 implements interface display function through GPU, display screen 192, and application processor.

[0074] The display screen 192 is used to display images, videos, prompts, etc. The display screen 192 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 Mini LED, a Micro LED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc.

[0075] For example, electronic devices display data shared by other devices on display screen 192, thereby facilitating data sharing and multi-screen collaboration between electronic devices.

[0076] For example, the electronic device displays a network switching prompt on the display screen 192, thereby prompting the user to switch networks and improving communication efficiency.

[0077] The CPU may include a controller, which can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals based on the instruction opcode and timing signals to control the fetching and execution of instructions.

[0078] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0079] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.

[0080] For example, an electronic device can connect to other devices through an external storage interface to obtain file information shared by those other devices.

[0081] Internal memory 121 can be used to store executable program code, including instructions. Processor 110 executes various functional applications and data processing of electronic device 100 by running the instructions stored in internal memory 121. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of electronic device 100 (such as audio data, phonebook, etc.).

[0082] For example, the internal memory 121 in this application embodiment can store Wi-Fi parameter information of the electronic device.

[0083] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLAN) (such as Wi-Fi), Bluetooth, Global Navigation Satellite System (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR). The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signal, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.

[0084] For example, electronic device 100 can access a Wi-Fi network via wireless communication module 160.

[0085] Touch sensor 180E, also known as a "touch panel," can be located on display screen 192. The touch sensor 180E and display screen 192 together form a touchscreen, also known as a "touch screen." Touch sensor 180E detects touch operations applied to or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 192. In other embodiments, touch sensor 180E may also be located on the surface of electronic device 100, in a different position than display screen 192.

[0086] For example, electronic device 100 can switch or unswitch the Wi-Fi network via touch sensor 180E, thereby flexibly selecting the Wi-Fi network.

[0087] The software system of electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application embodiment uses the layered architecture Android system as an example to exemplify the software structure of electronic device 100. However, this application embodiment does not limit the type of operating system for the electronic device. For example, system, system, system, Systems, etc.

[0088] Please see Figure 3 , Figure 3 This is a schematic diagram of the software structure of an electronic device provided in an embodiment of this application. For example... Figure 3 As shown, the layered architecture divides the hardware and software structure into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, ... Taking the system as an example, The system is divided into four layers, from top to bottom: application layer, application framework layer, system library, and kernel layer.

[0089] The application layer may include application 201, trust ring sharing module 202, Wi-Fi network smart suggestion module 203, and Wi-Fi network suggestion switching module 204.

[0090] Application 201 can be a third-party application and / or a system application. This application embodiment does not limit the content of the application layer.

[0091] For example, application 201 can provide an entry point for screen projection operation for electronic device 100. For instance, application 201 can be an AirLink APK.

[0092] Among them, the Trust Ring Sharing Module 202 is an electronic device module that enables trusted interconnection between multiple electronic devices across systems based on an identity authentication system, allowing services to flow and be shared intelligently among electronic devices.

[0093] For example, the trust ring sharing module 202 can enable multiple electronic devices to establish a trust connection and perform data interaction, such as keyboard and mouse sharing, cross-screen projection, etc.

[0094] Among them, the Wi-Fi network smart suggestion module 203 is used by electronic devices to suggest switching Wi-Fi networks.

[0095] The Wi-Fi network switching suggestion module 204 is used to prompt users to switch Wi-Fi networks.

[0096] For example, the Wi-Fi network switching suggestion module 204 can display a prompt message suggesting switching to a Wi-Fi network.

[0097] The application framework layer can provide application programming interfaces (APIs) and programming frameworks for applications.

[0098] The application framework layer may include a Wi-Fi P2P service module 211, a Wi-Fi network candidate information module 212, a Wi-Fi network availability assessment module 213, and a Wi-Fi network management module 214.

[0099] Among them, the Wi-Fi P2P service module 211 is used to realize direct communication and resource sharing between electronic devices.

[0100] For example, electronic devices can achieve file sharing, multimedia sharing, game interaction, etc. through the Wi-Fi P2P service module 211.

[0101] The Wi-Fi network candidate information module 212 is used to store candidate network information of electronic devices, which facilitates network switching of electronic devices.

[0102] For example, the Wi-Fi network candidate information module 212 is used to store the name, password and frequency of the Wi-Fi network.

[0103] The Wi-Fi network availability assessment module 213 is used to assess whether the Wi-Fi networks in the candidate information can be connected.

[0104] The Wi-Fi network management module 214 is used to switch Wi-Fi networks.

[0105] The system library may include multiple functional modules. For example: surface manager 221, 3D graphics processing library 222 (e.g., OpenGL ES), 2D graphics engine 223 (e.g., SGL), etc.

[0106] The Surface Manager 221 is used to manage the display subsystem and provides the fusion of two-dimensional and three-dimensional layers for multiple applications.

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

[0108] 2D Graphics Engine 223 is a drawing engine for 2D drawing.

[0109] For example, an electronic device renders and displays its interface through multiple functional modules in the system library.

[0110] The kernel layer is the layer between hardware and software. The kernel layer may include the display driver 231 and the GPU driver 232, and may also include other content. This application embodiment does not limit the content of the kernel layer.

[0111] The display driver 231 enables the operating system to communicate with the display device, such as a display screen.

[0112] Among them, GPU driver 232 is the software used to control and manage the GPU.

[0113] For example, in this embodiment of the application, the electronic device 100 can be connected to the display screen 192 through the display driver 231 to display the interface.

[0114] It should be understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0115] The technical solutions involved in the following embodiments can all be implemented in the electronic device 100 having the above-described hardware or software architecture.

[0116] The electronic devices in this application embodiment can be mobile phones, tablets, smart screen devices, smart TVs (television, TV), ultra-mobile personal computers (UMPCs), netbooks, as well as cellular phones, personal digital assistants (PDAs), wearable devices (such as smartwatches, smart bracelets), and other devices with image display capabilities. This application embodiment does not impose any special limitations on the specific form of the electronic device. The method in this application embodiment can be applied to application scenarios such as game development, virtual reality (VR) and augmented reality (AR), autonomous driving, and mobile devices. This application embodiment does not limit the application scenarios of the method.

[0117] Below, embodiments of this application will be used to illustrate the concept of having Figure 2 and Figure 3 Taking the illustrated electronic devices (first device and second device) as an example, and in conjunction with the accompanying drawings and application scenarios, the Wi-Fi switching method provided in this application will be described in detail. It is understood that the illustrative flowcharts provided in this application mainly use electronic devices as the execution subject of the interaction to illustrate the method, but this application does not limit the execution subject of the interaction. For example, the device in the illustrative flowchart can also be a chip, chip system, or processor that supports the device in implementing the method, or it can be a logic module or software that can implement all or part of the functions of the device.

[0118] Please see Figure 4 , Figure 4 This is a flowchart illustrating a Wi-Fi switching method provided in an embodiment of this application. Figure 4 As shown, a first device accesses a first Wi-Fi network at a first frequency, and a second device accesses a second Wi-Fi network at a second frequency. The first device and the second device establish a P2P connection at the second frequency. The Wi-Fi switching method provided in this application embodiment may include:

[0119] S101, The first device obtains the Wi-Fi parameter information of the second device.

[0120] The Wi-Fi parameter information of the second device is used to represent the Wi-Fi access parameters of the second device. This Wi-Fi parameter information includes a second frequency, which is the frequency at which the second device accesses the Wi-Fi network.

[0121] In some embodiments, the Wi-Fi parameter information may also include other information, such as any one or more combinations of the Wi-Fi network name, Wi-Fi network password, or encryption method of the Wi-Fi parameter information. The embodiments of this application do not limit the content of the Wi-Fi parameter information.

[0122] Among them, the Wi-Fi parameter information is used by the first device to switch Wi-Fi networks.

[0123] Because the first device accesses the first Wi-Fi network at a first frequency and establishes a P2P connection at a second frequency, it constantly switches between the first and second frequencies to perform data interaction under Wi-Fi and P2P connections respectively. This results in significant data interaction latency and severe lag, negatively impacting the user experience. Therefore, the first device can obtain the Wi-Fi parameter information of the second device and switch networks based on this information, thereby achieving access to both the Wi-Fi network and P2P connection at the same frequency and avoiding frequent frequency switching between Wi-Fi and P2P.

[0124] The first device can obtain the Wi-Fi parameter information of the second device in a variety of ways.

[0125] In some embodiments, where the first device and the second device correspond to the same cloud account, the first device can obtain the Wi-Fi parameter information of the second device from the cloud server.

[0126] The cloud server is used to store Wi-Fi parameter information of multiple electronic devices, such as the Wi-Fi parameter information of the first electronic device and the Wi-Fi parameter information of the second electronic device.

[0127] The Wi-Fi parameter information of the second device can be sent to and stored on the cloud server when the second device accesses the second Wi-Fi network at the second frequency. Alternatively, the second device can store the Wi-Fi parameter information locally and send it to the cloud server periodically or periodically. This application embodiment does not limit the storage format of the second device's Wi-Fi parameter information.

[0128] Therefore, when the first and second devices are under the same cloud account, they can share Wi-Fi parameter information, improving device connection efficiency and security. The Wi-Fi parameter information of the second device can be sent and stored in the cloud server, making it easy for the first device to retrieve the second device's Wi-Fi parameter information from the cloud server, thus improving the security of obtaining Wi-Fi parameter information.

[0129] In other embodiments, the first device reuses the established P2P connection to receive Wi-Fi parameter information sent by the second device. The embodiments of this application do not limit the method of obtaining the Wi-Fi parameter information of the second device.

[0130] Therefore, the first device can reuse the established P2P connection to obtain the Wi-Fi parameter information of the second device in real time without occupying the memory space of the cloud server, thus improving the memory utilization of the cloud server.

[0131] S102, The first device triggers the first prompt.

[0132] When the first device accesses the first Wi-Fi network at the first frequency and establishes a P2P connection at the second frequency, the first device can trigger a first prompt to remind the user to switch the Wi-Fi network, so that the first device accesses the Wi-Fi network and the P2P connection at the same frequency, thereby minimizing service interruptions or abnormalities and reducing latency.

[0133] In some embodiments, the first device may trigger a first prompt when the triggering conditions are met, thereby facilitating the switching of Wi-Fi networks.

[0134] Therefore, if the first device meets the triggering conditions, has high service performance requirements, or has the ability to switch between frequency and Wi-Fi networks, the first device can switch to use the same frequency to access the Wi-Fi network and P2P, avoiding frequent frequency switching, thereby improving the service experience, avoiding problems such as data lag or slow data transmission rate, improving the smoothness of data transmission, reducing latency, and enhancing the user experience.

[0135] In some embodiments, the triggering condition may include a triggering scenario (first triggering condition).

[0136] The triggering scenario is one with high requirements for data interaction and communication. In some embodiments, the triggering scenario can be a scenario where the first device and the second device are performing a target service through a P2P connection.

[0137] The target service can be a latency-sensitive service or a reliable transmission service, such as screen sharing or keyboard and mouse sharing, which requires low transmission latency and high data accuracy between electronic devices.

[0138] In other embodiments, the triggering scenario can be a scenario where the communication rate between the first device and the second device establishing a P2P connection is less than a preset threshold.

[0139] The preset threshold can be a threshold predefined by the first device or a threshold predefined by the second device. This application embodiment does not limit the source of the preset threshold.

[0140] The communication rate at which the first device establishes a P2P connection with the second device is less than a preset threshold, which prevents the first device and the second device from exchanging data in a timely manner, causing phenomena such as service lag.

[0141] This application embodiment may also include other triggering scenarios, and this application embodiment does not limit the form of the triggering scenario.

[0142] In some embodiments, for services in non-triggered scenarios, such as file transfer services between a mobile phone and a tablet computer, where latency and communication rate requirements are low, the first device may not trigger the first prompt.

[0143] Therefore, when the first device performs services with high latency requirements, high data transmission reliability, or communication rates below a preset threshold via P2P, the service performance requirements are high, and there is a need for frequency switching. This can trigger the switching of the Wi-Fi network, avoiding frequent frequency switching caused by the first device accessing the Wi-Fi network and P2P connection at different frequencies, reducing data latency and affecting the user experience.

[0144] In other embodiments, the triggering condition may include the presence of a connectable Wi-Fi network on the first device (a second triggering condition).

[0145] If the first device has a connectable Wi-Fi network, the first prompt can be triggered. If the first device does not have a connectable Wi-Fi network, the electronic device will not trigger a prompt or switch Wi-Fi networks.

[0146] The first device can determine whether a switchable Wi-Fi network exists through various methods.

[0147] In some embodiments, the first device identifies a connectable Wi-Fi network through network detection, and the connectable Wi-Fi network corresponds to a second frequency. The first device can detect whether the Wi-Fi network can connect to the Internet through network detection, thereby identifying the connectable Wi-Fi network.

[0148] In other embodiments, the first device identifies a connectable Wi-Fi network based on the signal strength of the Wi-Fi network, and the connectable Wi-Fi network corresponds to a second frequency. The first device can identify the Wi-Fi network with the optimal signal strength or the Wi-Fi network with a signal strength that meets a predefined threshold based on the differences in the signal strength of the Wi-Fi networks.

[0149] In other embodiments, the first device identifies a connectable Wi-Fi network that meets the protocol requirements of the Wi-Fi network, and the connectable Wi-Fi network corresponds to a second frequency. The first device can identify whether there is a connectable Wi-Fi network based on whether the Wi-Fi network meets the protocol requirements, such as Wi-Fi 6 protocol requirements or Wi-Fi 7 protocol requirements.

[0150] It should be understood that the embodiments of this application can also identify connectable Wi-Fi networks through other methods or combinations of the above-mentioned multiple implementation methods. The embodiments of this application do not limit the implementation method of identifying connectable Wi-Fi networks.

[0151] Therefore, if the first device can identify a connectable Wi-Fi network through the above-mentioned multiple implementation methods or combinations when accessing Wi-Fi networks and P2P at different frequencies, and can easily determine the target Wi-Fi network from the connectable Wi-Fi networks, then it is considered to have frequency switching capability, which can trigger the switching of Wi-Fi networks. This avoids frequent frequency switching caused by the first device accessing Wi-Fi networks and P2P connections at different frequencies, reduces data latency, and improves the user experience.

[0152] The aforementioned connectable Wi-Fi networks can be identified from the candidate information of the first device. The first device first obtains the candidate information of Wi-Fi networks, and then identifies the connectable Wi-Fi networks from the candidate information.

[0153] The candidate information includes Wi-Fi parameter information historically used by the first device, and / or Wi-Fi parameter information sent to the first device by other devices via P2P connection, and / or Wi-Fi parameter information obtained by the first device from the cloud server. This application embodiment does not limit the Wi-Fi parameter information in the candidate information.

[0154] When the first device establishes a connection with a Wi-Fi network that has not been established before, it can store the parameter information of the Wi-Fi network in the candidate information, thereby facilitating the first device to quickly establish a Wi-Fi network connection without having to obtain the parameter information of the Wi-Fi network again.

[0155] The first device can also receive Wi-Fi parameter information from other devices, or historical Wi-Fi parameter information used by other devices, through a P2P connection established with other devices, and store it in the candidate information.

[0156] The first device can also obtain historical Wi-Fi parameter information from the cloud server or Wi-Fi parameter information sent and stored in the cloud server by other devices, and store it in the candidate information.

[0157] In summary, the first device can obtain candidate information for Wi-Fi networks. This candidate information includes Wi-Fi parameter information historically used by the first device, and / or Wi-Fi parameter information sent to the first device by other devices via P2P connections, and / or Wi-Fi parameter information obtained by the first device from a cloud server. This allows the first device to identify connectable Wi-Fi networks from the candidate information, thus providing more options for the first device to identify target Wi-Fi networks. It eliminates the need for the first device to obtain and access the Wi-Fi network information of the second device in real time, reducing the latency of the first device switching target Wi-Fi networks and improving the communication quality and success rate of switching to the target Wi-Fi network.

[0158] In other embodiments, the triggering conditions may include a triggering scenario and the presence of a connectable Wi-Fi network on the first device.

[0159] The first device triggers the first prompt when the triggering conditions are met, that is, when the triggering scenario is met and a connectable Wi-Fi network exists.

[0160] Therefore, when the first device performs services with high latency requirements, high data transmission reliability, or communication rates less than a preset threshold via P2P and identifies a connectable Wi-Fi network, the service performance requirements are high, there is a need for frequency switching, and it has the capability to trigger switching of the Wi-Fi network. This avoids frequent frequency switching caused by the first device accessing the Wi-Fi network and P2P connection at different frequencies, reduces data latency, and improves the user experience.

[0161] Please see Figure 5 , Figure 5 This is a flowchart illustrating another Wi-Fi switching method provided in an embodiment of this application. Figure 5 As shown, the first device and the second device are STA devices accessing a Wi-Fi network. The first device accesses the first Wi-Fi network at a first frequency, and the second device accesses the second Wi-Fi network at a second frequency. The first device and the second device establish a point-to-point Wi-Fi P2P connection at the second frequency. When the triggering conditions are met, the first device triggers a first prompt.

[0162] The first prompt is used to ask whether to switch to the target Wi-Fi network.

[0163] The target Wi-Fi network corresponds to the second frequency. The target Wi-Fi network can be the first Wi-Fi network or other Wi-Fi networks accessing at the second frequency. This application embodiment does not limit the target Wi-Fi network.

[0164] The first prompt may include prompt content, or it may include a switching control. In this embodiment of the application, the content of the first prompt is not limited.

[0165] The first prompt can be an interface prompt or a voice prompt. This application embodiment does not limit the form of the first prompt.

[0166] In one implementation, the first prompt can be an interface prompt, whereby the first device can display the first prompt information on the interface, which is used to prompt access to the target Wi-Fi network.

[0167] For example, such as Figure 5 As shown, the first device can display the first prompt information as a prompt box 101. The first device can also display the first prompt information in the form of a card or capsule (e.g., the way suggested by YoYo). This application embodiment does not limit the form of the first prompt information.

[0168] The first prompt message can also be displayed as a notification, in the status bar or notification center, on the negative one screen, or on the main desktop interface. The first prompt message can also be displayed on the interface for business interaction, etc. This application embodiment does not limit the specific prompting method and display location of the first prompt message.

[0169] Please see Figure 6 , Figure 6 This is a schematic diagram illustrating a first device displaying a first prompt message, provided as an embodiment of this application. Figure 6 As shown, the first device can display a prompt box 101 with the first prompt information on the interface. The prompt box 101 may include the content of the first prompt information and controls for the first prompt information.

[0170] The first prompt message indicates whether to connect to the target Wi-Fi network, and the controls in the first prompt message are used to connect to or cancel connection to the target Wi-Fi network.

[0171] Therefore, when the first device meets the first triggering condition, it can display the first prompt information on the interface, providing an entry point for flexibly choosing whether to switch to the target Wi-Fi network. When the first device detects the operation of switching to the target Wi-Fi network, that is, in response to the detection of the operation of the first control, it switches to accessing the target Wi-Fi network at the second frequency, thereby enabling the first device to access the Wi-Fi network and P2P connection at the same frequency.

[0172] In some embodiments, the content of the first prompt message may include the name of the target Wi-Fi network, such as "target Wi-Fi network". Figure 5As shown, the content of the first prompt message can be "It is recommended to switch Wi-Fi to the target Wi-Fi network to improve the overall service experience." In other embodiments, the content of the first prompt message may include the name of the target Wi-Fi network and the frequency of the target Wi-Fi network. For example... Figure 6 As shown in (a), the content of the first prompt message can be "It is recommended to switch Wi-Fi to the target Wi-Fi network, which uses the second frequency, to improve the overall service experience." In other embodiments, the content of the first prompt message may simply prompt the user to switch networks. For example... Figure 6 As shown in (b) in the figure, the content of the first prompt message can be "It is recommended to switch to a Wi-Fi network". This application embodiment does not limit the content of the first prompt message.

[0173] In another implementation, the first prompt can be a voice prompt. The first device can output the first voice prompt, which is used to prompt access to the target Wi-Fi network. The embodiments of this application do not limit the form of the first prompt.

[0174] The first device can play a first voice prompt in the form of speech when the first triggering condition is met.

[0175] Please see Figure 7 , Figure 7 This is a schematic diagram illustrating another first device displaying a first prompt message, provided in an embodiment of this application. In some embodiments, such as... Figure 7 As shown in (a), the first device displays a speaker on the interface, and the speaker can play a first voice prompt. In other embodiments, such as Figure 7 As shown in (b), the first device displays a speaker and switching controls on the interface, such as "Yes" and "No" controls. The speaker can play a first voice prompt, and the controls are used by the first device to switch or cancel switching to the target Wi-Fi network. The first device may also not display the speaker and / or controls, and directly play the first voice prompt. The embodiments of this application do not limit the form of the first voice prompt.

[0176] In some embodiments, the content of the first voice prompt may include the name of the target Wi-Fi network, and the first device may play a voice message such as "It is recommended to switch Wi-Fi to the target Wi-Fi network to improve the overall service experience".

[0177] In other embodiments, the content of the first voice prompt may include the name of the target Wi-Fi network and the frequency of the target Wi-Fi network. For example, the first device may play a voice message saying, "It is recommended to switch Wi-Fi to the target Wi-Fi network. The frequency of the target Wi-Fi network is the second frequency to improve the service experience across all scenarios." This application embodiment does not limit the content of the first voice prompt.

[0178] Therefore, the first device can provide an entry point for flexibly choosing whether to switch the target Wi-Fi network through voice prompts. In response to the voice instruction to agree to switch, the first device switches to access the target Wi-Fi network at the second frequency, thereby improving the user's ease of operation and enhancing the user experience.

[0179] S103, the first device, in response to detecting the first instruction operation, switches to access the target Wi-Fi network at the second frequency.

[0180] The first instruction operation can be a touch or press control operation, or a voice control operation. This application embodiment does not limit the form of the first instruction operation.

[0181] In some embodiments, the first device further includes a first control on the interface displaying the first prompt information. In response to detecting an operation on the first control, such as a tap on the first control, the first device switches to accessing the target Wi-Fi network at a second frequency. Figure 6 As shown in (a), the first control is the "Yes" control 102, and so on. Figure 7 As shown in (b) above, the first control is the "Yes" control 104.

[0182] In other embodiments, the first instruction operation may be a voice-activated operation, such as... Figure 7 As shown in (a), upon receiving a voice response "Yes", the first device switches to access the target Wi-Fi network at the second frequency.

[0183] The first device maintains access to the first Wi-Fi network at the first frequency in response to detecting the second instruction operation or not detecting the first instruction operation within a preset time period.

[0184] In some embodiments, the first device may further include a second control on the interface displaying the first prompt information, such as... Figure 6 As shown in (a), the second control is the "No" control 103, and so on. Figure 7 As shown in (b) above, the first control is the "No" control 105.

[0185] In response to detecting an operation on the second control, such as a tap on the second control, the first device cancels the switch to access the target Wi-Fi network at the second frequency and continues to access the first Wi-Fi network at the first frequency.

[0186] In other embodiments, the first instruction operation may be a voice control operation, in which the first device receives a voice response such as "no" or "disagree" to express a negative switch, and the first device cancels the switch to access the target Wi-Fi network at the second frequency.

[0187] It should be understood that the first or second control can also have other display formats, such as Figure 6 As shown in (b) in the figure, the control “√” indicates that you agree to switch, and the control “×” indicates that you cancel switching. This application embodiment does not limit the appearance of the first control and the second control.

[0188] In response to detecting the first instruction operation, the first device switches to access the target Wi-Fi network at a second frequency. Figure 5 As shown, in response to detecting a first instruction operation, such as detecting a user clicking the "Yes" control 102, the first device accesses the target Wi-Fi network at a second frequency.

[0189] and Figure 1 In contrast, the first device accesses the Wi-Fi network and P2P connection at the second frequency, avoiding the first device switching back and forth between the first and second frequencies, reducing the data transmission latency of the first device, improving the data transmission reliability of the first device, avoiding lag, and improving the user experience.

[0190] In summary, when the triggering conditions are met, the first device triggers the first prompt, thereby providing a flexible option to switch Wi-Fi networks. Responding to the first instruction to switch Wi-Fi networks, the first device switches to access the target Wi-Fi network using the second frequency. This allows the first device to access the Wi-Fi network and establish P2P connections on the second frequency, avoiding the first device switching back and forth between the first and second frequencies, reducing data interaction latency, improving communication performance, minimizing service interruptions or anomalies, and enhancing the user experience.

[0191] Based on the above description, the first device can identify a target Wi-Fi network that can be connected based on the second frequency in the Wi-Fi parameter information, and switch to access the target Wi-Fi network using the second frequency.

[0192] The target Wi-Fi network may be different from the second Wi-Fi network, or it may be the same as the second Wi-Fi network. In some embodiments, the Wi-Fi parameter information may also include the name of the second Wi-Fi network, and the first device may switch to access the second Wi-Fi network at a second frequency, that is, the target Wi-Fi network is the second Wi-Fi network.

[0193] The first device determines whether the first Wi-Fi network and the second Wi-Fi network are the same network based on the name of the second Wi-Fi network. If the names of the first and second Wi-Fi networks are the same, they are determined to be the same network; if the names are different, they are determined to be different networks. The first device can also determine whether the first and second Wi-Fi networks are the same network based on any one or more combinations of their Internet Protocol (IP) addresses, subnet masks, or Media Access Control (MAC) addresses. This application does not limit the method used to determine whether the first and second Wi-Fi networks are the same network.

[0194] When the first Wi-Fi network and the second Wi-Fi network are the same Wi-Fi network, the first device switches to access the second Wi-Fi network at the second frequency.

[0195] In summary, the first device can also determine whether the first Wi-Fi network and the second Wi-Fi network are the same network based on the name of the second Wi-Fi network, and then determine whether to switch networks. If the first Wi-Fi network and the second Wi-Fi network are the same Wi-Fi network, the first device can directly switch frequencies without changing the Wi-Fi network, reducing the complexity of switching networks.

[0196] When the first Wi-Fi network and the second Wi-Fi network are different Wi-Fi networks, the first device obtains candidate Wi-Fi network information. The candidate Wi-Fi network information includes Wi-Fi parameter information historically used by the first device, and / or Wi-Fi parameter information sent to the first device by other devices via P2P connection, and / or Wi-Fi parameter information obtained from a cloud server.

[0197] If the candidate information includes a second Wi-Fi network, the first device can obtain the Wi-Fi parameter information of the second Wi-Fi network in the candidate information, and switch to access the second Wi-Fi network at the second frequency based on the password and second frequency of the second Wi-Fi network in the candidate information.

[0198] If the candidate information does not include a second Wi-Fi network, the first device can reuse the established P2P connection or obtain the password of the second Wi-Fi network from the cloud server, and switch to access the second Wi-Fi network at the second frequency based on the password and the second frequency of the second Wi-Fi network.

[0199] In summary, when the first Wi-Fi network and the second Wi-Fi network are different Wi-Fi networks, the first device can obtain candidate Wi-Fi network information and check whether the candidate information includes the second Wi-Fi network. If the candidate information includes the second Wi-Fi network, the first device can directly obtain the password of the second Wi-Fi network without the second device sending the password. This reduces the latency of the first device switching to the second Wi-Fi network, avoids the leakage of the second Wi-Fi network password information during the process of the second device sending the password, improves the security of obtaining the second Wi-Fi network password, and reduces the complexity of operation.

[0200] If the candidate information does not include the second Wi-Fi network, the first device still needs to obtain the password of the second Wi-Fi network, so that the first device can access the second Wi-Fi network based on the password and the second frequency.

[0201] In other embodiments, the Wi-Fi parameter information may also include the name and password of the second Wi-Fi network, and the first device switches to access the second Wi-Fi network at the second frequency based on the password and the second frequency of the second Wi-Fi network.

[0202] In summary, the first device can switch to access the second Wi-Fi network at the second frequency without checking the candidate set information, thereby improving the speed at which the first device switches to the second Wi-Fi network.

[0203] When a first device accesses a first Wi-Fi network at a first frequency, and a second device accesses a second Wi-Fi network at a second frequency, and the first and second devices establish a peer-to-peer (P2P) connection at the second frequency, the first and second devices can switch to accessing the Wi-Fi network and establishing the P2P connection at the same frequency, thereby avoiding the problem of the first device switching frequencies back and forth. When the first and second devices disconnect from the P2P connection, the first device switches to accessing the first Wi-Fi network at the first frequency or switches to accessing the currently optimal-performing Wi-Fi network. Alternatively, the first device can remain connected to the target Wi-Fi network at the second frequency. This application embodiment does not limit the frequency accessed by the first device or the Wi-Fi network accessed by the first device.

[0204] In summary, since the first Wi-Fi network used by the first device is usually a high-performance network, even if the first device and the second device disconnect the P2P connection, the first device can continue to access the high-performance first Wi-Fi network at the first frequency, thus ensuring the network communication quality of the first device.

[0205] In addition, the first device can also access the best-performing Wi-Fi network currently scanned by the first device, thereby improving the communication performance of the first device.

[0206] In one specific implementation, the first device includes a candidate information module, a Wi-Fi network availability assessment module, a Wi-Fi network intelligent suggestion module, a Wi-Fi suggestion switching module, and a Wi-Fi management module. The first device can work together through the above modules to enable the first device to access the target Wi-Fi network at a second frequency.

[0207] Please see Figure 8 , Figure 8 This is a schematic diagram illustrating the internal implementation of a Wi-Fi switching method provided in an embodiment of this application. Figure 8 As shown, the Wi-Fi switching method provided in this application embodiment may include:

[0208] S201, the Wi-Fi network availability assessment module obtains the Wi-Fi parameter information of the second device.

[0209] S202, The Wi-Fi network availability assessment module obtains candidate information for Wi-Fi networks from the candidate information module.

[0210] The candidate information module is used to store candidate information for Wi-Fi networks.

[0211] S203. Based on the candidate information, the Wi-Fi network availability assessment module assesses whether there is a Wi-Fi network that can be connected.

[0212] The connectable Wi-Fi network corresponds to the second frequency.

[0213] S204. If the Wi-Fi network availability assessment module evaluates that there is a target Wi-Fi network that can be connected, send the second frequency and the network name of the target Wi-Fi network to the Wi-Fi network smart suggestion module.

[0214] The target Wi-Fi network is one of the connectable Wi-Fi networks.

[0215] S205, the Wi-Fi network intelligent suggestion module sends the second frequency and the network name of the target Wi-Fi network to the Wi-Fi network suggestion switching module.

[0216] S206. The Wi-Fi network suggestion switching module triggers the first prompt based on the second frequency and the network name of the target Wi-Fi network.

[0217] S207. In response to detecting the operation of the first instruction, the Wi-Fi network management module switches to access the target Wi-Fi network at the second frequency.

[0218] In summary, the first device can collaborate with the candidate information module, Wi-Fi network availability assessment module, Wi-Fi network intelligent suggestion module, Wi-Fi suggestion switching module, and Wi-Fi management module to switch to accessing the target Wi-Fi network at a second frequency. This allows the first device to access the Wi-Fi network and establish P2P connections at the second frequency, avoiding the need for the first device to switch back and forth between accessing the Wi-Fi network at the first frequency and establishing P2P connections at the second frequency. This reduces data interaction latency, improves communication performance, minimizes service interruptions or anomalies, and enhances the user experience.

[0219] The above description is based on Figure 5 The description of the first and second devices shown is based on the example of establishing a Wi-Fi P2P connection in STA mode. The first and second devices can also work in AP mode. The method provided in this application embodiment can also be applied to Wi-Fi multi-mode coexistence scenarios, which will not be elaborated here.

[0220] In the above implementation, the first device switches the frequency of its access to the Wi-Fi network to enable it to access both the Wi-Fi network and the P2P connection at the same frequency. In another implementation, the first device can switch the frequency of its access to the P2P connection, allowing it to access both the Wi-Fi network and the P2P connection at the same frequency. For example, the first device can switch to a first frequency and establish a P2P connection using that first frequency.

[0221] Compared to the frequency at which the first device switches to access the P2P connection, the frequency at which the first device switches to access the Wi-Fi network ensures that both the first and second devices access the Wi-Fi network and P2P connection at the same frequency (such as the second frequency). This prevents the situation where the first device accesses the Wi-Fi network and P2P connection at the same frequency, while the second device accesses the Wi-Fi network and P2P connection at a different frequency, thus avoiding impacting the service performance of the second device and affecting the user experience.

[0222] Furthermore, the frequency at which the first device switches to access the P2P connection is limited by protocol complexity and hardware resources. Compared to the frequency at which the first device switches to access the P2P connection, the operation of switching the frequency at which the first device switches to access the Wi-Fi network is less complex, requires no back-and-forth signaling negotiation between devices, and has higher switching efficiency.

[0223] Therefore, compared with the frequency at which the first device switches to access the P2P connection, the frequency at which the first device switches to access the Wi-Fi network can better ensure the stability of the overall data interaction between the first and second devices, reduce latency and switching complexity, and better achieve the target effect.

[0224] It is understood that, in order to achieve the above functions, the electronic device includes hardware and / or software modules that perform the respective functions. Based on the algorithmic steps of the examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is implemented in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in conjunction with the embodiments, but such implementation should not be considered beyond the scope of this application.

[0225] This embodiment can divide the electronic device into functional modules according to the above method example. For example, each function can be divided into its own functional modules, or two or more functions can be integrated into one processing module. The integrated modules can be implemented in hardware. It should be noted that the module division in this embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.

[0226] This application also provides an electronic device; please refer to [link / reference]. Figure 9 , Figure 9 This is a schematic diagram of the structure of another electronic device provided in an embodiment of this application. For example... Figure 9 As shown, the electronic device may include one or more processors 901, memory 902, and communication interfaces 903.

[0227] The memory 902, communication interface 903, and processor 901 are coupled together. For example, the memory 902, communication interface 903, and processor 901 can be coupled together via bus 904.

[0228] The communication interface 903 is used for data transmission with other devices. The memory 902 stores computer program code. The computer program code includes computer instructions, which, when executed by the processor 901, cause the electronic device to perform the screen projection method described in this embodiment.

[0229] The processor 901 can be a processor or controller, such as a CPU, a general-purpose processor, a DSP, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with this disclosure. The processor 901 can also be a combination that implements computational functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0230] The bus 904 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The aforementioned bus 904 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 9 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0231] This application also provides a computer-readable storage medium storing computer program code. When the processor executes the computer program code, the electronic device executes the relevant method steps in the above method embodiments.

[0232] This application also provides a computer program product that, when run on a computer, causes the computer to execute the relevant method steps described in the above method embodiments.

[0233] The electronic devices, computer storage media, or computer program products provided in this application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods provided above, and will not be repeated here.

[0234] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0235] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another apparatus, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0236] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0237] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0238] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, in essence, or the contributing parts, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0239] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A Wi-Fi switching method, characterized in that, The method, applied to a first device, wherein the first device accesses a first Wi-Fi network at a first frequency, the first device and a second device establish a peer-to-peer (P2P) connection at a second frequency, and the second device accesses a second Wi-Fi network at the second frequency, includes: Obtain the Wi-Fi parameter information of the second device, wherein the Wi-Fi parameter information includes the second frequency; If the triggering conditions are met, a first prompt is triggered; the first prompt is used to indicate whether to switch to the target Wi-Fi network, the target Wi-Fi network corresponding to the second frequency; In response to the detection of the first instruction operation, the device switches to access the target Wi-Fi network at the second frequency.

2. The method according to claim 1, characterized in that, The step of obtaining the Wi-Fi parameter information of the second device includes: The Wi-Fi parameter information of the second device is obtained from the cloud server. The first device and the second device correspond to the same cloud account. The Wi-Fi parameter information of the second device is sent and stored to the cloud server when the second device accesses the second Wi-Fi network at the second frequency.

3. The method according to claim 1, characterized in that, The step of obtaining the Wi-Fi parameter information of the second device includes: The device receives Wi-Fi parameter information sent by the second device through the P2P connection.

4. The method according to any one of claims 1-3, characterized in that, The triggering of the first prompt includes: The interface displays a first prompt message, which prompts the user to connect to the target Wi-Fi network. The interface also includes a first control, and the step of switching to access the target Wi-Fi network at the second frequency in response to detecting a first instruction operation includes: In response to detecting an operation on the first control, the system switches to access the target Wi-Fi network at the second frequency.

5. The method according to any one of claims 1-3, characterized in that, The triggering of the first prompt includes: Output a first voice prompt, which is used to prompt access to the target Wi-Fi network; The operation of switching to access the target Wi-Fi network at the second frequency in response to detecting the first indication includes: In response to a detected voice instruction to agree to the switch, the system switches to access the target Wi-Fi network at the second frequency.

6. The method according to any one of claims 1-5, characterized in that, The conditions for triggering the event include: The first device and the second device are executing a target service through the P2P connection, whereby the target service is a latency-sensitive service or a reliable transmission service; or... The communication rate of the P2P connection is less than a preset threshold.

7. The method according to any one of claims 1-6, characterized in that, The target Wi-Fi network is a connectable Wi-Fi network, and the triggering conditions include: A connectable Wi-Fi network is identified through network detection, and the connectable Wi-Fi network corresponds to the second frequency; and / or, A connectable Wi-Fi network is identified by the signal strength of the Wi-Fi network, and the connectable Wi-Fi network corresponds to the second frequency; and / or, A connectable Wi-Fi network that meets the protocol requirements of a Wi-Fi network is identified, and the connectable Wi-Fi network corresponds to the second frequency.

8. The method according to claim 7, characterized in that, The method further includes: Obtain candidate information for Wi-Fi networks, which includes Wi-Fi parameter information historically used by the first device, and / or Wi-Fi parameter information sent to the first device by other devices via P2P connection, and / or Wi-Fi parameter information obtained from a cloud server; the connectable Wi-Fi network is identified from the candidate information.

9. The method according to any one of claims 1-6, characterized in that, The Wi-Fi parameter information also includes the name of the second Wi-Fi network; the method further includes: Based on the name of the second Wi-Fi network, determine whether the first Wi-Fi network and the second Wi-Fi network are the same network; The switching to access the target Wi-Fi network at the second frequency includes: If the first Wi-Fi network and the second Wi-Fi network are the same Wi-Fi network, switch to accessing the second Wi-Fi network at the second frequency.

10. The method according to claim 9, characterized in that, The switching to access the target Wi-Fi network at the second frequency further includes: When the first Wi-Fi network and the second Wi-Fi network are different Wi-Fi networks, candidate information of the Wi-Fi networks is obtained; the candidate information of the Wi-Fi networks includes Wi-Fi parameter information historically used by the first device, and / or Wi-Fi parameter information sent to the first device by other devices through P2P connection, and / or Wi-Fi parameter information obtained from the cloud server; If the candidate information includes the second Wi-Fi network, the user switches to access the second Wi-Fi network at the second frequency based on the password of the second Wi-Fi network and the second frequency in the candidate information.

11. The method according to claim 10, characterized in that, The switching to access the target Wi-Fi network at the second frequency further includes: If the candidate information does not include the second Wi-Fi network, obtain the password for the second Wi-Fi network; Based on the password of the second Wi-Fi network and the second frequency, the system switches to access the second Wi-Fi network using the second frequency.

12. The method according to any one of claims 1-6, characterized in that, The Wi-Fi parameter information also includes the name and password of the second Wi-Fi network. Switching to access the target Wi-Fi network at the second frequency includes: Based on the password of the second Wi-Fi network and the second frequency, the system switches to access the second Wi-Fi network using the second frequency.

13. The method according to any one of claims 1-12, characterized in that, The method further includes: If the P2P connection between the first device and the second device is disconnected, the device switches to access the first Wi-Fi network at the first frequency or switches to access the Wi-Fi network with the best current performance.

14. The method according to any one of claims 1-13, characterized in that, The first device and the second device are site STA devices for Wi-Fi network access, and the P2P connection is a Wi-Fi P2P connection.

15. The method according to claim 1, characterized in that, The first device includes a candidate information module, a Wi-Fi network availability assessment module, a Wi-Fi network intelligent suggestion module, a Wi-Fi suggestion switching module, and a Wi-Fi management module. The candidate information module is used to store candidate information for Wi-Fi networks. The step of obtaining the Wi-Fi parameter information of the second device includes: The Wi-Fi network availability assessment module obtains the Wi-Fi parameter information of the second device; The triggering of the first prompt when the triggering conditions are met includes: The Wi-Fi network availability assessment module obtains the candidate information from the candidate information module; Based on the candidate information, the Wi-Fi network availability assessment module assesses whether there is a connectable Wi-Fi network, and the connectable Wi-Fi network corresponds to the second frequency; If the Wi-Fi network availability assessment module determines that there is a connectable Wi-Fi network, it sends the second frequency and the network name of the target Wi-Fi network to the Wi-Fi network smart suggestion module, wherein the target Wi-Fi network is one of the connectable Wi-Fi networks; The Wi-Fi network smart suggestion module sends the second frequency and the name of the target Wi-Fi network to the Wi-Fi network suggestion switching module; The Wi-Fi network suggestion switching module triggers the first prompt based on the second frequency and the name of the target Wi-Fi network; The step of switching to access the target Wi-Fi network at the second frequency in response to detecting a first indication operation includes: In response to detecting the operation of the first indication, the Wi-Fi network management module switches to access the target Wi-Fi network at the second frequency.

16. An electronic device, characterized in that, The electronic device includes: one or more processors; a memory; wherein the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code including computer instructions, and the one or more processors call the computer instructions to cause the electronic device to perform the method as described in any one of claims 1-15.

17. A computer program product containing instructions, characterized in that, When the computer program product is run on an electronic device, it causes the electronic device to perform the method as described in any one of claims 1-15.

18. A computer-readable storage medium comprising instructions, characterized in that, When the instructions are executed on an electronic device, the electronic device causes the electronic device to perform the method as described in any one of claims 1-15.