Network communication control method and device, electronic equipment and storage medium
By judging the matching between the Wi-Fi channel and the preset channel and controlling the turning on or off of the network communication mode, the problem of Wi-Fi signals being interfered with by radar signals in the same frequency band in the wireless access point mode is solved, and the stability and cost-effectiveness of Wi-Fi communication are achieved.
Patent Information
- Application Number
- CN202510376722.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-27
- Publication Date
- 2025-06-24
AI Technical Summary
In wireless access point mode, Wi-Fi signals cannot dynamically select frequency and are easily interfered by radar signals in the same frequency band, resulting in communication problems such as connection failure and serious data packet loss.
By determining whether the working channel of the first network communication mode matches the first preset channel, the opening or closing of the first network communication mode and the second network communication mode is controlled. If the second network communication mode is susceptible to interference, turn it on to avoid interference from the Wi-Fi signal being interfered with by radar signals in the same frequency band.
It effectively avoids connection failure and data packet loss problems of Wi-Fi signals under interference from radar signals in the same frequency band, ensures the normal operation of Wi-Fi communication, and does not require replacement or addition of hardware devices, saving costs.
Smart Images

Figure CN120201588A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of network communication technologies, and particularly to a network communication control method, apparatus, electronic device, and storage medium. Background Art
[0002] In a wireless network system, a Wi-Fi module in an electronic device has three working modes, including an access point mode, a station mode, and a mixed mode. When the working mode of the Wi-Fi module is the access point mode, the Wi-Fi module forms an independent wireless network as a base station; when the working mode of the Wi-Fi module is the station mode, the Wi-Fi module joins the wireless network as a wireless terminal.
[0003] In related technologies, the Wi-Fi module of an electronic device transmits and receives Wi-Fi signals, and a channel in the 5G band of the Wi-Fi signals has the same frequency as that of a radar signal.
[0004] Because the access point mode of an embedded device does not have a dynamic frequency selection function, when the frequencies of the Wi-Fi signals and the radar signals are the same, there is interference between the Wi-Fi signals and the radar signals. Under the interference of the radar signals in the same frequency band, the Wi-Fi signals in the access point mode will have communication problems such as connection failure and serious data packet loss, affecting Wi-Fi communication.
[0005] It should be noted that the information disclosed in the background art part of this application is only intended to deepen the understanding of the general background technology of this application, and should not be regarded as an admission or any form of suggestion that this information constitutes the prior art known to those skilled in the art. Summary of the Invention
[0006] In view of this, this application provides a network communication control method, apparatus, electronic device, and storage medium, which helps to solve the problem that in the prior art, under the interference of radar signals in the same frequency band, the Wi-Fi signals in the access point mode will have communication problems such as connection failure and serious data packet loss, affecting Wi-Fi communication.
[0007] In a first aspect, an embodiment of this application provides a network communication control method, which is applied to an electronic device. The electronic device includes a first network communication mode and a second network communication mode. The method includes: In response to an instruction to turn on the second network communication mode, determine whether a working channel corresponding to the first network communication mode matches a first preset channel, where the first preset channel is a channel where other signals interfere with the second network communication mode; Control the activation or deactivation of the first network communication mode and the second network communication mode according to the matching result between the working channel corresponding to the first network communication mode and the first preset channel.
[0008] In an embodiment of the present application, the activation or deactivation of the first network communication mode and the second network communication mode is controlled according to the matching result between the working channel corresponding to the first network communication mode and the first preset channel, where the first preset channel is a channel where other signals interfere with the second network communication mode. It can be understood that when the second network communication mode is vulnerable to interference, turning off the second network communication mode can prevent Wi-Fi signals from being interfered by radar signals in the same frequency band, thus ensuring the normal operation of Wi-Fi signals and radar signals. In addition, the method provided in the embodiment of the present application does not require replacing or adding hardware devices, saving costs.
[0009] In a possible implementation manner, the controlling the activation or deactivation of the first network communication mode and the second network communication mode according to the matching result between the working channel corresponding to the first network communication mode and the first preset channel includes: If the working channel corresponding to the first network communication mode matches the first preset channel, control the first network communication mode to be activated, and control the second network communication mode to be activated or deactivated; If the working channel corresponding to the first network communication mode does not match the first preset channel, control both the first network communication mode and the second network communication mode to be activated.
[0010] In an embodiment of the present application, if the working channel corresponding to the first network communication mode matches the first preset channel, control the first network communication mode to be activated, and control the second network communication mode to be activated or deactivated according to the actual situation.
[0011] In a possible implementation manner, the if the working channel corresponding to the first network communication mode matches the first preset channel, control the first network communication mode to be activated, and control the second network communication mode to be activated or deactivated includes: If the working channel corresponding to the first network communication mode matches the first preset channel, switch the working channel of the second network communication mode to a second conversion channel that does not interfere with the first preset channel, and the second network communication mode is activated; Or, If the working channel corresponding to the first network communication mode matches the first preset channel, output second interaction information, where the second interaction information is used to prompt the user to modify the working channel corresponding to the first network communication mode, and obtain a second control instruction input by the user; Control the enabling or disabling of the first network communication mode and the second network communication mode according to the second control instruction; If the working channel corresponding to the modified first network communication mode matches the first preset channel, the second control instruction for controlling the enabling of the second network communication mode is not responded to.
[0012] In the embodiment of the present application, when the working channel corresponding to the first network communication mode matches the first preset channel, the working channel of the second network communication mode can be switched to a second conversion channel that does not interfere with the first preset channel, so as to enable the second network communication mode. Because the second conversion channel does not interfere with the first preset channel, the second network communication mode can be quickly enabled by switching the working channel of the second network communication mode. Second interaction information can also be output, so as to obtain the second control instruction input by the user, and control the enabling or disabling of the first network communication mode and the second network communication mode according to the second control instruction, so that the network communication result better meets the user's expectations. In addition, if the working channel corresponding to the modified first network communication mode still matches the first preset channel, the second control instruction for controlling the enabling of the second network communication mode is not responded to. That is to say, when the working channel corresponding to the modified first network communication mode matches the first preset channel, whether the second control instruction input by the user wants to enable the second network communication mode or not, the second network communication mode will not be enabled, so as to avoid network communication interference. It should be noted that these two technical solutions can be stored in the same electronic device at the same time, but the electronic device will only execute one of them at the same time.
[0013] In a possible implementation manner, after outputting the second interaction information if the working channel corresponding to the first network communication mode matches the first preset channel, it further includes: If the second control instruction is used to represent canceling the connection, control both the first network communication mode and the second network communication mode to be closed.
[0014] It can be understood that when the user selects to cancel the connection, both the first network communication mode and the second network communication mode are closed, making the network communication control operation better meet the user's expectations and improving the user experience.
[0015] In a possible implementation manner, if the working channel corresponding to the first network communication mode matches the first preset channel, controlling the first network communication mode to be enabled and controlling the second network communication mode to be enabled or disabled includes: If the working channel corresponding to the first network communication mode matches the first preset channel, output first interaction information, where the first interaction information is used to prompt the user that the working channel corresponding to the first network communication mode matches the first preset channel, and obtain a first control instruction selected by the user; If the first control instruction is used to indicate continuous connection, control the first network communication mode to be turned on and control the second network communication mode to be turned off.
[0016] In the embodiments of the present application, according to the first control instruction selected by the user, control the turning on or off of the first network communication mode and the second network communication mode. It can be understood that the first control instruction is an instruction that meets the user's expectations, so as to ensure that the network communication method better meets the user's expectations and improve the user experience.
[0017] In a possible implementation manner, the method further includes: If the first control instruction is used to indicate cancellation of connection, control both the first network communication mode and the second network communication mode to be turned off.
[0018] It can be understood that when the user selects to cancel the connection, both the first network communication mode and the second network communication mode are turned off, so that the network communication control operation better meets the user's expectations and improves the user experience.
[0019] In a possible implementation manner, the determining whether the working channel corresponding to the first network communication mode matches the first preset channel in response to the second network communication mode opening instruction includes: In response to the second network communication mode opening instruction, determine whether the first network communication mode is in a connected state; If the first network communication mode is in a connected state, determine whether the working channel corresponding to the first network communication mode matches the first preset channel; If the first network communication mode is not in a connected state, turn on the second network communication mode according to a second preset channel, where the second preset channel is different from the first preset channel.
[0020] In the embodiments of the present application, after receiving the second network communication mode opening instruction, first determine whether the first network communication mode is in a connected state. If the first network communication mode is not in a connected state, turn on the second network communication mode according to a second preset channel, where the second preset channel is different from the first preset channel. It can be understood that if the first network communication mode is not in a connected state, the working channel corresponding to the second network communication mode can be set to any channel, and it does not need to be the same as the working channel corresponding to the first network communication mode. By setting the working channel corresponding to the second network communication mode in this way, the second network communication mode can be directly controlled to work on a working channel that is not easily interfered with.
[0021] In a second aspect, an embodiment of the present application provides a network communication control device, including: A judgment module, configured to judge whether a working channel corresponding to the first network communication mode matches a first preset channel in response to a second network communication mode opening instruction, where the first preset channel is a channel where other signals interfere with the second network communication mode; A second network communication mode control module, configured to control the opening or closing of the first network communication mode and the second network communication mode according to a matching result between the working channel corresponding to the first network communication mode and the first preset channel.
[0022] In a third aspect, an embodiment of the present application provides an electronic device, including: A processor; A memory; A communication unit, configured to establish a communication channel; And a computer program, where the computer program is stored in the memory, and the computer program includes instructions that, when executed by the processor, cause the electronic device to execute the method described in any item of the first aspect.
[0023] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium includes a stored program, and when the program runs, it controls a device where the computer-readable storage medium is located to execute the method described in any item of the first aspect.
[0024] It can be understood that the network communication control device provided in the second aspect, the electronic device provided in the third aspect, and the computer-readable storage medium provided in the fourth aspect are used to execute the method provided in the present application. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method, and will not be elaborated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings required for the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0026] Figure 1 It is a schematic structural diagram of an application scenario provided by an embodiment of the present application; Figure 2 It is a schematic diagram of a working channel of a Wi-Fi signal provided by an embodiment of the present application; Figure 3Schematic flowchart of a network communication control method provided by an embodiment of the present application; Figure 4 Schematic diagram of a first interaction information provided by an embodiment of the present application; Figure 5 Schematic flowchart of another network communication control method provided by an embodiment of the present application; Figure 6 Schematic flowchart of another network communication control method provided by an embodiment of the application; Figure 7 Schematic diagram of a second interaction information provided by an embodiment of the present application; Figure 8 Schematic structural diagram of a network communication control device provided by an embodiment of the present application; Figure 9 Schematic structural diagram of an electronic device provided by an embodiment of the present application; Figure 10 Schematic diagram of a network working mode provided by an embodiment of the present application. Detailed implementation manners
[0027] For a better understanding of the technical solutions of the present application, the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0028] It should be clear that the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative efforts shall fall within the scope of protection of the present application.
[0029] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. The singular forms of "a", "the" and "said" used in the embodiments of the present application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.
[0030] It should be understood that the term " / and / " used herein is only a description of the association relationship of associated objects, indicating that three relationships may exist. For example, a and / or b may represent: a exists alone, a and b exist simultaneously, and b exists alone. In addition, the character " / " herein generally represents an "or" relationship between the associated objects before and after.
[0031] In a wireless network system, the Wi-Fi module in an electronic device has three working modes, including the Access Point (AP) mode, the Station (STA) mode, and the mixed mode (i.e., the STA-AP mode). When the working mode of the Wi-Fi module is the AP mode, the Wi-Fi module forms an independent wireless network as a base station; when the working mode of the Wi-Fi module is the STA mode, the Wi-Fi module joins the wireless network as a wireless terminal.
[0032] Among them, an AP is the center point of a wireless network and can be regarded as a server. As the central node of a network, it provides wireless access services. Other wireless devices are allowed to access this node, and the wireless signal data of all devices accessing this node needs to pass through the AP to be exchanged and accessed mutually.
[0033] For ease of understanding, the embodiments of the present application provide a structural schematic diagram of an application scenario.
[0034] See Figure 1 , which is a structural schematic diagram of an application scenario provided by the embodiments of the present application. As Figure 1 shown, in this application scenario, a router 101, a first electronic device 102, and a second electronic device 103 are shown. Among them, the router 101 is connected to the first electronic device 102 through a wireless communication network, and the first electronic device 102 is connected to the second electronic device 103 through a wireless communication network for information transmission. In this communication network, the router 101 is an AP, the first electronic device 102 is both an AP and an STA. The first electronic device 102 communicates with the router 101 as an STA, and at the same time, the first electronic device 102 communicates with the second electronic device 103 as an AP. The second electronic device 103 communicates with the first electronic device 102 as an STA. The router 101 converts the network signal into a wireless signal, enabling other devices to connect to the Internet wirelessly. Specifically, the router hotspot function allows other devices (such as mobile phones, tablets, laptops, etc.) to connect to the router through Wi-Fi within a certain range, thereby accessing the Internet. This function is very common in places such as homes and offices, and can conveniently enable multiple devices to access the Internet simultaneously.
[0035] Of course, in an application scenario, the second electronic device 103 can also be connected to the router 101 as an STA through a wireless communication network, Figure 1 and the connection manner shown in
[0036] should not be regarded as a limitation of the protection scope of the present application. Figure 1The first electronic device 102 shown in the figure is an image forming device, and the second electronic device 103 is a mobile phone. The router 101, the first electronic device 102, and the second electronic device 103 are only exemplary descriptions. In practical applications, the router 101 can also be any electronic device with an AP mode. The first electronic device 102 can be any electronic device with a hybrid mode (i.e., STA-AP mode), including but not limited to printers, copiers, fax machines, multifunctional image production and copying devices, electrophotographic devices, mobile phones, tablets, personal computers (PCs), personal digital assistants (PDAs), smart watches, netbooks, wearable electronic devices, augmented reality (AR) devices, virtual reality (VR) devices, in-vehicle devices, robots, smart glasses, etc. Similarly, in addition to mobile phones, the second electronic device 103 can be any electronic device with an STA mode, which will not be elaborated here.
[0037] In practical applications, in an electronic device with the STA-AP mode enabled, the working channel corresponding to the AP mode will be default adjusted to be the same as the working channel corresponding to the STA mode, and some of the working channels corresponding to the STA mode are the same as the radar channel frequencies, especially in the 5G band of the Wi-Fi signal.
[0038] See Figure 2 , which is a schematic diagram of the working channels of a Wi-Fi signal provided by an embodiment of this application. As Figure 2 shown, when the Wi-Fi signal frequency band is 2.4 GHz, the working channels of the Wi-Fi signal include 1-14, and at this time, the Wi-Fi signal will not be interfered by the radar signal. When the Wi-Fi signal frequency band is 5 GHz, the working channels of the Wi-Fi signal include 36-165. When the working channel of the Wi-Fi signal is 36-48, the Wi-Fi signal will not be interfered by the radar signal; when the working channel of the Wi-Fi signal is 52-144, the Wi-Fi signal will be interfered by the radar signal; when the working channel of the Wi-Fi signal is 149-165, the Wi-Fi signal will not be interfered by the radar signal. That is to say, when the Wi-Fi signal frequency band is 5 GHz and the working channel of the Wi-Fi signal is 52-144, the Wi-Fi signal will be interfered by the radar signal.
[0039] As described above, when the working channel corresponding to the STA mode of an electronic device in STA-AP mode is 52-144, the working channel corresponding to the AP mode will be default adjusted to be the same as the working channel corresponding to the STA mode. Since the AP mode of the embedded device does not have the DFS (Dynamic Frequency Selection) function, at this time, the Wi-Fi signal in the AP mode will have communication problems such as connection failure and serious data packet loss under the interference of radar signals in the same frequency band, affecting Wi-Fi communication.
[0040] In view of the above problems, the embodiment of the present application provides a network communication control method. When the second network communication mode is vulnerable to interference, the second network communication mode can be turned off, which can avoid the interference of the Wi-Fi signal by the radar signal in the same frequency band, thereby ensuring the normal operation of the Wi-Fi signal and the radar signal. In addition, the method provided by the embodiment of the present application does not require replacing or adding hardware devices, saving costs. Specifically, it will be described in detail below in combination with the drawings and specific embodiments.
[0041] See Figure 3 , which is a schematic flowchart of a network communication control method provided by an embodiment of the present application. This method can be applied to Figure 1 the application scenario shown in Figure 3 as shown, and mainly includes the following steps.
[0042] Step S301: In response to a second network communication mode opening instruction, determine whether the working channel corresponding to the first network communication mode matches a first preset channel.
[0043] Specifically, in the hybrid mode, after the electronic device receives the second network communication mode opening instruction, in response to the second network communication mode opening instruction, determine whether the working channel corresponding to the first network communication mode matches the first preset channel. Wherein, the first preset channel is the channel where other signals interfere with the second network communication mode, and the hybrid mode means that the electronic device can simultaneously turn on at least one of the first network communication mode and the second network communication mode. In a possible implementation manner, the first network communication mode is the STA mode, the second network communication mode is the AP mode, and the first preset channel is the radar channel (i.e., the 52-144 channel described above). Of course, this is only an exemplary illustration. The first network communication mode and the second network communication mode can also be set to other communication modes, and the first preset channel can also be set to other channels. The embodiment of the present application does not make specific limitations in this regard.
[0044] In practical applications, the AP mode of some electronic devices with a hybrid mode can be enabled independently, that is, the AP mode is enabled when the STA mode is turned off. For such electronic devices, the working channel of the AP mode does not necessarily have to be the same as that of the STA mode. When the STA mode is enabled, the working channel of the AP mode is the same as that of the STA mode; when the STA mode is turned off, the working channel of the AP mode can be any channel. Therefore, in the embodiments of the present application, after receiving the instruction to enable the second network communication mode (i.e., the AP mode), first determine whether the first network communication mode is in a connected state. If the first network communication mode (i.e., the STA mode) is in a connected state, then determine whether the working channel corresponding to the first network communication mode matches the first preset channel; if the first network communication mode is not in a connected state, then enable the second network communication mode according to the second preset channel. Among them, the second preset channel is different from the first preset channel, that is to say, the second preset channel is a channel where the second network communication mode is not interfered by other signals. In a possible implementation, the second preset channel is a non-radar channel.
[0045] Step S302: Control the enabling or disabling of the first network communication mode and the second network communication mode according to the matching result between the working channel corresponding to the first network communication mode and the first preset channel.
[0046] Specifically, control the enabling or disabling of the first network communication mode and the second network communication mode according to the matching result between the working channel corresponding to the first network communication mode and the first preset channel. As described above, the first network communication mode can be the STA mode, and the first preset channel is the radar channel.
[0047] In a possible implementation, some electronic devices must enable the STA mode before they can enable the AP mode, and the working channel of the AP mode is default to be the same as that of the STA mode. At this time, if the working channel corresponding to the first network communication mode matches the first preset channel, then control the first network communication mode to be enabled and control the second network communication mode to be disabled; if the working channel corresponding to the first network communication mode does not match the first preset channel, then control both the first network communication mode and the second network communication mode to be enabled.
[0048] It can be understood that because the working channel of the AP mode is the same as that of the STA mode, when the working channel of the STA mode is the first preset channel, only the STA mode is enabled and the AP mode is disabled, so as to avoid the Wi-Fi signal of the AP mode being interfered by other signals. And the method provided by the embodiments of the present application does not require setting other network communication modes, nor does it require modifying or adding other hardware devices, saving costs.
[0049] In a possible implementation, when the working channel corresponding to the first network communication mode matches the first preset channel, the first interaction information is output, and the first control instruction is obtained from the first interaction information. If the first control instruction is used to indicate continuous connection, the first network communication mode is controlled to be turned on and the second network communication mode is controlled to be turned off. Here, the first interaction information is used to prompt the user that the working channel corresponding to the first network communication mode matches the first preset channel and to obtain the first control instruction selected by the user.
[0050] In addition, if the first control instruction is used to indicate disconnection, both the first network communication mode and the second network communication mode are controlled to be turned off.
[0051] It can be understood that the first interaction information is an interaction interface through which prompt information can be output and the first control instruction selected by the user can be obtained. For ease of understanding, an embodiment of the present application also provides a schematic diagram of the first interaction information.
[0052] See Figure 4 , which is a schematic diagram of the first interaction information provided by an embodiment of the present application. As Figure 4 shown, the prompt information of the first interaction information is "The connected wireless router uses the radar channel (52 - 144). Please confirm whether to connect to the router." It can be understood that the wireless router is the router 101 in the Figure 1 application scenario shown. The router enables the AP mode, allowing the electronic device to connect to the router through the wireless network. The radar channel is the first preset channel. When the working channel of the AP mode of the electronic device is the radar channel, the Wi-Fi signal of the electronic device is prone to interference from radar signals. Also, two options, "Continue to connect" and "Cancel connection", are provided for the user to select on the first interaction information interface. If the user selects "Continue to connect", the first network communication mode is controlled to be turned on and the second network communication mode is controlled to be turned off. If the user selects "Cancel connection", both the first network communication mode and the second network communication mode are controlled to be turned off, that is, the connection to the router is cancelled.
[0053] In the embodiment of the present application, by obtaining the first control instruction selected by the user through the first interaction information, options can be provided for the user to make an independent choice while prompting the user, improving the user's participation and facilitating the operation of users who are not familiar with network settings, thus enhancing the user experience.
[0054] Corresponding to the above embodiment, the present application also provides another network communication control method. This method is applicable to an electronic device with an STA - AP mode.
[0055] Refer to Figure 5 , which is a schematic flowchart of another network communication control method provided by an embodiment of the present application. This method can be applied to Figure 1The application scenarios shown, such as Figure 5 shown, mainly include the following steps.
[0056] Step S501: Turn on the STA mode.
[0057] Specifically, in the embodiment of the present application, it is about how to turn on the AP mode when the STA mode has already been turned on, so the STA mode needs to be turned on.
[0058] Step S502: Receive a request to connect to the router.
[0059] Specifically, the request to connect to the router is a request for the electronic device to connect to the router. This request can be input by the user or triggered by the electronic device independently. For example, when the electronic device restarts, it generates a request to connect to the router independently. Of course, the request to connect to the router can also be obtained through other means, and the embodiment of the present application does not make specific limitations on this.
[0060] Step S503: Determine whether the AP mode is in the working state.
[0061] Specifically, when the AP mode is turned on, the AP mode is in the working state; when the AP mode is turned off, the AP mode is in the non - working state. If the AP mode is in the working state, step S504 is executed; if the AP mode is in the non - working state, step S505 is executed.
[0062] Step S504: Temporarily turn off the AP mode and set the timer to automatically restart after 30 seconds.
[0063] Specifically, if the AP mode is in the working state, the AP mode is temporarily turned off and restarted after 30 seconds. It can be understood that some electronic devices can only turn on the STA mode after turning off the AP mode, so this step can ensure the normal turn - on of the STA mode. Of course, the 30 seconds in the embodiment of the present application is only an exemplary illustration, and the embodiment of the present application does not make specific limitations on this.
[0064] Step S505: Start connecting to the router.
[0065] Specifically, after the STA mode is normally enabled, it can start connecting to the router. When the electronic device connects to the router, it obtains the MAC address of the router, the Service Set Identifier (SSID), the pre-shared key (PSK), the encryption method, the frequency band, and the bandwidth information, etc. Among them, the SSID is used to identify the name of the Wireless Local Area Network (WLAN), which is similar to the network name in a wired network or the name of the router. Devices identify and connect to a specific wireless network through the SSID. The PSK is usually the password set by the router. The PSK is a relatively secure and highly compatible encryption mode used to protect the security of data transmission in the wireless network.
[0066] The SSID and PSK work together in the wireless local area network to ensure the security and stability of the network. The SSID is used to identify and distinguish different wireless networks, while the PSK provides encryption protection to prevent unauthorized devices from accessing the network. Only devices that know the SSID and correctly enter the PSK password can connect to a specific wireless network. Among them, the PSK password can be the password currently entered by the user or the password pre-stored by the user. When the user pre-stores the PSK password, the electronic device can automatically connect to the router.
[0067] Among them, the process of temporarily turning off and restarting the AP mode also includes the following steps.
[0068] Step S5041: Receive the AP mode activation instruction.
[0069] Specifically, the AP mode activation instruction is an instruction generated independently by the electronic device. When the duration of the AP mode being turned off reaches 30 seconds, the electronic device automatically generates the AP mode activation instruction.
[0070] Step S5042: Determine whether the STA mode is in a connected state.
[0071] Because for some electronic devices, the AP mode needs to be enabled on the premise that the STA mode is enabled, it is necessary to first determine whether the STA mode is in a connected state. If the STA mode is in a connected state, step S5043 is executed; if the STA mode is in a non-connected state, step S5044 is executed.
[0072] Step S5043: Determine whether the working channel of the STA mode is a radar channel.
[0073] Specifically, since the working channel of the AP mode needs to refer to the working channel of the STA mode, and when the working channel of the AP mode is a radar channel, the Wi-Fi signal is prone to interference, it is necessary to determine whether the working channel of the STA mode is a radar channel. If the working channel of the STA mode is a radar channel, step S5045 is executed; if the working channel of the STA mode is a non-radar channel, step S5046 is executed.
[0074] Step S5044: Control the AP mode to turn on according to a non-radar channel.
[0075] Specifically, if the STA mode is in a non-connected state, the working channel of the AP mode can be directly controlled to be a non-radar channel to prevent the Wi-Fi signal from being interfered.
[0076] Step S5045: Output the first interaction information.
[0077] As Figure 4 described in the embodiments shown, the first interaction information is used to prompt the user that the working channel corresponding to the first network communication mode matches the first preset channel, and obtain the first control instruction selected by the user. If the first control instruction is used to indicate continuing the connection, the STA mode is turned on and the AP mode is turned off; if the first control instruction is used to indicate canceling the connection, the STA mode is turned off.
[0078] Step S5046: Control the AP mode to turn on according to the working channel of the STA mode.
[0079] Specifically, since the working channel of the AP mode is default to be the same as the working channel of the STA mode, the AP mode is controlled to turn on according to the working channel of the STA mode.
[0080] Step S5047: The AP mode does not work.
[0081] Step S5048: The AP mode starts to work.
[0082] The specific content involved in the embodiments of this application can be referred to the description in the above Figure 3 shown embodiments. For the sake of brevity of description, it will not be elaborated here.
[0083] In practical applications, there are usually more than one hotspot device around the electronic device. At this time, when the working channel of the STA mode of the electronic device is the same as the radar channel, the electronic device can output the second interaction information, which can prompt the user to switch the hotspot device while indicating that the signal is prone to interference, so as to adjust the working channel of the STA mode to a non-radar channel, and further ensure that the Wi-Fi signal in the AP mode is not interfered by the radar signal.
[0084] Specifically, if the working channel corresponding to the first network communication mode matches the first preset channel, the second interaction information is output, where the second interaction information is used to prompt the user to modify the working channel corresponding to the first network communication mode and obtain the second control instruction input by the user; according to the second control instruction, control the opening or closing of the first network communication mode and the second network communication mode; if the working channel corresponding to the first network communication mode does not match the first preset channel, control the second network communication mode to be opened.
[0085] It can be understood that the user is prompted to modify the working channel corresponding to the first network communication mode through the second interaction information. If the user needs to open the second network communication mode, the user can modify the working channel corresponding to the first network communication mode to a channel that does not match the first preset channel. This improves the user's participation, facilitates the operation of users who are not familiar with network settings, and enhances the user experience.
[0086] In a possible implementation manner, if the second control instruction is used to represent continuing the connection, when the working channel corresponding to the first network communication mode does not match the first preset channel, control the second network communication mode to be opened; if the second control instruction is used to represent canceling the connection, control both the first network communication mode and the second network communication mode to be closed.
[0087] It can be understood that the second network communication mode is controlled to be opened only when the working channel corresponding to the first network communication mode does not match the first preset channel. While improving the user's participation, it ensures that network communication is not interfered with.
[0088] In the following, the STA-AP mode is taken as an example, and a detailed description is given in combination with the accompanying drawings and specific embodiments.
[0089] See Figure 6 , which is a schematic flowchart of another network communication control method provided for the application embodiment. This method can be applied to Figure 1 the application scenario shown in Figure 6 As shown, it mainly includes the following steps.
[0090] Step S601: Turn on the STA mode.
[0091] Step S602: Receive a connection router request.
[0092] Specifically, the connection router request is a request input by the user on the electronic device, and the request may include the name of the target router and the connection password of the target router. After receiving the link router request, the electronic device sends a connection request to the target router according to the name of the target router and the connection password of the target router.
[0093] Step S603: Determine whether the first target router channel is a radar channel.
[0094] Specifically, when the electronic device receives a request to connect to a router, it obtains the working channel of the first target router (i.e., the first target router channel). After obtaining the first target router channel, it determines whether the first target router channel is a radar channel. Here, the router channel is the working channel of the electronic device in STA mode. If the first target router channel is a radar channel, step S604 is executed; if the first target router channel is not a radar channel, step S609 is executed.
[0095] Step S604: Output the second interaction information and obtain the second control instruction.
[0096] Specifically, when the first target router channel is a radar channel, the second interaction information is output and the second control instruction is obtained. The second interaction information is used to prompt the user to modify the working channel corresponding to the STA mode.
[0097] For ease of understanding, the embodiment of the present application also provides a schematic diagram of the second interaction information.
[0098] See Figure 7 , which is a schematic diagram of the second interaction information provided by the embodiment of the present application. As Figure 7 shown, the prompt information of the second interaction information is "The connected wireless router uses a radar channel (52 - 144), and Wi-Fi Direct will be turned off. You can click Continue after modifying the router working channel." It can be understood that when the working channel of the AP mode of the electronic device is a radar channel, the Wi-Fi signal of the electronic device is easily interfered by the radar signal. Also, two options, "Continue to connect" and "Cancel connection", are set for the user on the first interaction information interface for the user to choose. After the user modifies the router working channel, they can choose "Continue to connect" to facilitate the electronic device to continue connecting to the router; if the user chooses "Cancel connection", the electronic device cancels the connection with the router.
[0099] In a possible implementation manner, the way for the user to modify the working channel corresponding to the STA mode is to change the first target router to a second target router. Since the working frequency bands of each router are usually different, the user only needs to modify the target router to modify the working channel corresponding to the STA mode.
[0100] To facilitate the user in selecting a router on a non-radar channel, in the embodiments of the present application, the operating channel of the router is marked in the router name. Exemplarily, if the operating channel of the router is a radar channel, "radar channel" is added after the router name; if the operating channel of the router is a non-radar channel, "non-radar channel" is added after the router name. In a possible implementation, when the electronic device displays the router list, it can display only the routers on non-radar channels or block the routers on radar channels.
[0101] In practical applications, when the electronic device displays the router name, the router name cannot be fully displayed. At this time, the names of routers with a name similarity greater than or equal to a preset threshold are merged and displayed as one router name. Of course, the preset threshold can be any value, and the embodiments of the present application do not make specific limitations on this.
[0102] However, the operating channels of routers with similar names may also be different. Therefore, in the embodiments of the present application, the names of the routers are not merged, and the routers whose names cannot be fully displayed are renamed so that the router name and the operating channel can be fully displayed on the interface to facilitate the user in selecting a router on a non-radar channel.
[0103] Step S605: Determine whether the second control instruction is used to represent continued connection.
[0104] Specifically, after obtaining the second control instruction, determine whether the second control instruction is used to represent continued connection. If the second control instruction is used to represent continued connection, execute step S606; if the second control instruction is used to represent cancellation of connection, execute step S608.
[0105] Step S606: Determine whether the second target router channel is a radar channel.
[0106] Specifically, when the second control instruction is used to represent continued connection, the electronic device can determine whether the user modifies the router channel by determining whether the second target router is a radar channel. If the second target router channel is a radar channel, execute step S607; if the second target router channel is a non-radar channel, execute step S609.
[0107] Step S607: Turn off the AP mode.
[0108] Step S608: Cancel the Wi-Fi connection.
[0109] Step S609: Start connecting to the second target router.
[0110] In an embodiment of the present application, the user is prompted to modify the working channel corresponding to the first network communication mode through the second interaction information. If the user needs to enable the second network communication mode, the user can modify the working channel corresponding to the first network communication mode to a channel that does not match the first preset channel. This improves the user's participation, facilitates the operation of users who are not familiar with network settings, and enhances the user experience.
[0111] Corresponding to the above embodiment, the present application further provides a network communication control device.
[0112] See Figure 8 , which is a schematic structural diagram of a network communication control device provided by an embodiment of the present application. As Figure 8 shown, the network communication control device may include: a judgment module 801 and a second network communication mode control module 802. These components communicate through one or more buses. Those skilled in the art can understand that the structure of the electronic device shown in the figure does not constitute a limitation on the embodiments of the present application. It can be a bus structure, a star structure, and may also include more or fewer components than shown, or combine certain components, or different component arrangements.
[0113] Among them, the judgment module 801 is used to judge whether the working channel corresponding to the first network communication mode matches the first preset channel in response to the second network communication mode opening instruction, and the first preset channel is a channel where other signals interfere with the second network communication mode; The second network communication mode control module 802 is used to control the opening or closing of the first network communication mode and the second network communication mode according to the matching result between the working channel corresponding to the first network communication mode and the first preset channel.
[0114] Corresponding to the above embodiment, the present application further provides an electronic device.
[0115] See Figure 9 , which is a schematic structural diagram of an electronic device provided by an embodiment of the present application. As Figure 9 shown, the electronic device 900 may include: a processor 901, a memory 902, and a communication unit 903. These components communicate through one or more buses. Those skilled in the art can understand that the structure of the electronic device shown in the figure does not constitute a limitation on the embodiments of the present application. It can be a bus structure, a star structure, and may also include more or fewer components than shown, or combine certain components, or different component arrangements.
[0116] Among them, the communication unit 903 is used to establish a communication channel, so that the electronic device can communicate with other devices, receive user data sent by other devices, or send user data to other devices.
[0117] The processor 901 is the control center of the electronic device. It uses various interfaces and circuits to connect all parts of the electronic device. By running or executing software programs, instructions, and / or modules stored in the memory 902, and by calling data stored in the memory, it can execute various functions of the electronic device and / or process data. The processor can be composed of an integrated circuit (IC). For example, it can be composed of a single-packaged IC, or it can be composed of multiple packaged ICs with the same or different functions connected together. For example, the processor 901 may only include a central processing unit (CPU). In the embodiments of the present application, the CPU can be a single-core processor or include multiple cores.
[0118] The memory 902 is used to store the execution instructions of the processor 901. The memory 902 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk.
[0119] When the execution instructions in the memory 902 are executed by the processor 901, the electronic device 900 can execute Figure 1 some or all of the steps in the illustrated embodiments.
[0120] In a possible implementation, different electronic devices may have different network working modes. Specifically, the network working modes include but are not limited to dual-band mode and triple-band mode. For the convenience of understanding, the embodiments of the present application also provide a schematic diagram of a network working mode.
[0121] See Figure 10 , which is a schematic diagram of a network working mode provided by the embodiments of the present application. As Figure 10 shown, the dual-band mode includes 5G STA + 2.4G AP / 5G AP. Among them, 5G STA is the first network communication mode in the dual-band mode, and both 2.4G AP and 5G AP are the second network communication modes. And as Figure 2As shown, the channels corresponding to 2.4G do not interfere with the radar channels. Therefore, 2.4G is the second conversion channel that does not interfere with the first preset channel (i.e., the radar channel). In the dual-band mode, the 5G AP can only work in the same frequency as the 5G STA. Therefore, the 5G AP is more vulnerable to radar signals. When the working channel of the 5G STA matches the radar channel, the working channel of the second network communication mode (AP mode) can be directly switched to the second conversion channel (2.4G) that does not interfere with the first preset channel (radar channel), thereby enabling the second network communication mode. The tri-band mode is 5G STA + 2.4G AP + 5G AP. Among them, the 5G AP can work independently using a frequency different from that of the 5G STA. In this case, regardless of whether the 5G STA matches the radar channel or not, the working channel of the 5G AP can be adjusted to be different from the radar channel, thereby avoiding interference from radar signals.
[0122] In specific implementation, the embodiment of the present application also provides a computer storage medium. Among them, the computer storage medium can store a program, and when the program is executed, it can include some or all of the steps in the embodiments of the simulation scenario generation method provided by the embodiment of the present application. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM), etc.
[0123] In the embodiment of the present application, "at least one" means one or more, and "a plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent the situation of A existing alone, A and B existing simultaneously, and B existing alone. Among them, A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects before and after. "At least one of the following" and its similar expressions refer to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, and c can represent: a, b, c, a - b, a - c, b - c, or a - b - c, where a, b, and c can be single or multiple.
[0124] Those of ordinary skill in the art can realize that the various units and algorithm steps described in the embodiments disclosed herein can be implemented by a combination of electronic hardware, computer software, and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but this implementation should not be considered to exceed the scope of the present application.
[0125] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.
[0126] In several embodiments provided in the present application, if any function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present application. The foregoing storage medium includes: various media that can store program codes such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs.
[0127] The same or similar parts among the various embodiments in this specification can be referred to each other. In particular, for the device embodiments and terminal embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the description in the method embodiments.
Claims
1. A network communication control method, characterized in that: Applied to an electronic device, the electronic device includes a first network communication mode and a second network communication mode, the method includes: In response to the second network communication mode start instruction, determining whether the working channel corresponding to the first network communication mode matches a first preset channel, where the first preset channel is a channel where other signals interfere with the second network communication mode; According to the matching result between the working channel corresponding to the first network communication mode and the first preset channel, the first network communication mode and the second network communication mode are controlled to be turned on or off.
2. The method according to claim 1, characterized in that: The controlling the turning on or off of the first network communication mode and the second network communication mode according to the matching result between the working channel corresponding to the first network communication mode and the first preset channel includes: If the working channel corresponding to the first network communication mode matches the first preset channel, the first network communication mode is controlled to be turned on, and the second network communication mode is controlled to be turned on or off; If the working channel corresponding to the first network communication mode does not match the first preset channel, both the first network communication mode and the second network communication mode are controlled to be turned on.
3. The method according to claim 2, characterized in that If the working channel corresponding to the first network communication mode matches the first preset channel, the first network communication mode is controlled to be turned on, and the second network communication mode is controlled to be turned on or off, including: If the working channel corresponding to the first network communication mode matches the first preset channel, the working channel of the second network communication mode is switched to a second conversion channel that does not interfere with the first preset channel, and the second network communication mode is turned on; or, If the working channel corresponding to the first network communication mode matches the first preset channel, outputting second interaction information, wherein the second interaction information is used to prompt the user to modify the working channel corresponding to the first network communication mode and obtain a second control instruction input by the user; According to the second control instruction, controlling the opening or closing of the first network communication mode and the second network communication mode; If the modified working channel corresponding to the first network communication mode matches the first preset channel, the second control instruction for controlling the activation of the second network communication mode is not responded to.
4. The method according to claim 3, characterized in that After outputting the second interaction information if the working channel corresponding to the first network communication mode matches the first preset channel, the method further includes: If the second control instruction is used to represent the cancellation of the connection, then both the first network communication mode and the second network communication mode are controlled to be closed.
5. The method according to claim 2, characterized in that: If the working channel corresponding to the first network communication mode matches the first preset channel, the first network communication mode is controlled to be turned on, and the second network communication mode is controlled to be turned on or off, including: If the working channel corresponding to the first network communication mode matches the first preset channel, outputting first interaction information, wherein the first interaction information is used to prompt the user that the working channel corresponding to the first network communication mode matches the first preset channel, and obtaining the first control instruction selected by the user; If the first control instruction is used to indicate continued connection, the first network communication mode is controlled to be turned on and the second network communication mode is controlled to be turned off.
6. The method according to claim 5, characterized in that The method further comprises: If the first control instruction is used to represent the cancellation of the connection, then both the first network communication mode and the second network communication mode are controlled to be closed.
7. The method according to claim 1, characterized in that The step of responding to the second network communication mode start instruction and determining whether the working channel corresponding to the first network communication mode matches the first preset channel includes: In response to the second network communication mode start instruction, determining whether the first network communication mode is in a connected state; If the first network communication mode is in a connected state, determining whether the working channel corresponding to the first network communication mode matches the first preset channel; If the first network communication mode is not in a connected state, the second network communication mode is enabled according to a second preset channel, and the second preset channel is different from the first preset channel.
8. A network communication control device, characterized in that: include: A judgment module, configured to judge, in response to a second network communication mode start instruction, whether a working channel corresponding to the first network communication mode matches a first preset channel, where the first preset channel is a channel where other signals interfere with the second network communication mode; The second network communication mode control module is used to control the opening or closing of the first network communication mode and the second network communication mode according to the matching result between the working channel corresponding to the first network communication mode and the first preset channel.
9. An electronic device, characterized in that: include: processor; Memory; A communication unit, used for establishing a communication channel; And a computer program, wherein the computer program is stored in the memory, and the computer program includes instructions, and when the instructions are executed by the processor, the electronic device executes the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method according to any one of claims 1 to 7.