Method, device, medium and program product for connecting to hotspot

By setting the Wi-Fi module of the smart hardware device to a mixed mode and using the target MAC address to filter and lock the communication channel, the problem of complex operation and low success rate of smart hardware devices during the distribution process is solved, and efficient and reliable distribution network connection is achieved.

CN115834374BActive Publication Date: 2025-08-12SHANGHAI ZHANGMEN TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211489094.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-25
Publication Date
2025-08-12
Estimated Expiration
2042-11-25

AI Technical Summary

Technical Problem

Existing smart hardware devices are complex in the distribution process or have low network success rate, especially in the complex network environment, especially when using the one-click distribution method, packet loss is likely to lead to failure.

Method used

Set the Wi-Fi module of the smart hardware device to promiscuous mode, monitors message information, and locks the target communication channel through the preset target MAC address, and only monitors and parses message information containing hotspot names and passwords on the target channel to connect to the routing device.

Benefits of technology

It improves the success rate of distribution network, reduces the chance of packet loss, and simplifies the operation process, especially in the complex network environment, which can still efficiently connect to routing devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115834374B_ABST
    Figure CN115834374B_ABST
Patent Text Reader

Abstract

The purpose of this application is to provide a method, device, medium and program product for connecting to a hotspot, the method comprising: setting the Wi-Fi module of the intelligent hardware device to promiscuous mode, so that the Wi-Fi module starts to monitor message information; according to the preset target MAC address information, by filtering the message information, locking the target communication channel between the user device and the routing device; making the Wi-Fi module monitor the message information only on the target communication channel, if the monitored target message information contains the first hotspot name information and the first hotspot password information, setting the Wi-Fi module to site mode, so that the Wi-Fi module attempts to connect to the routing device based on the first hotspot name information and the first hotspot password information. The present application can quickly lock the channel for communication between the user device and the routing device, avoids cyclically receiving messages on other channels, can reduce the probability of message loss, and can greatly improve the success rate of network configuration.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communications, and in particular to a technology for connecting to a hotspot. Background Art

[0002] Since smart hardware devices do not have a human-computer interaction interface, they cannot search / select a specified router and enter a connection password like a computer. However, they are smart devices that require network configuration (connecting to a router), so the correct network configuration (connecting to a router) problem must be solved first.

[0003] There are two common network configuration methods for smart hardware devices on the market:

[0004] AP mode network configuration: First, enable the hotspot function on the smart hardware device (the device to be configured). After the mobile terminal connects to the hotspot, tell the device the SSID and password of the wireless router to be connected. The device then connects to the wireless router. The mobile terminal must manually switch the mobile Wi-Fi connection network to connect to the smart hardware's AP network. After configuration is complete, the connection must be restored to the normal Wi-Fi network. The disadvantage of this method is that it is somewhat complex to operate.

[0005] In one-click network configuration (also called promiscuous mode network configuration), the mobile terminal sends a UDP broadcast message. The device to be configured scans all available wireless channels, finds the UDP message, parses the message, and connects to the router based on the SSID and password. In this network configuration method, the operator only needs to configure the SSID and password of the AP to be connected on the mobile terminal. The operation is relatively simple and is also the mainstream network configuration method for smart hardware devices. The disadvantage of this method is that during the cyclic channel scanning process, UDP messages may be communicated on other channels, causing packet loss when the smart hardware scans and receives UDP messages, resulting in a low network configuration success rate. Especially in a more complex network environment (when there are many routers nearby), the network configuration success rate is even lower. Summary of the Invention

[0006] One object of the present application is to provide a method, device, medium, and program product for connecting to a hotspot.

[0007] According to one aspect of the present application, a method for connecting to a hotspot is provided, which is applied to an intelligent hardware device. The method includes:

[0008] Setting the Wi-Fi module of the intelligent hardware device to promiscuous mode so that the Wi-Fi module starts monitoring message information;

[0009] Locking a target communication channel between a user device and a routing device by filtering the message information according to preset target MAC address information, wherein the user device is connected to the routing device, the user device sends target message information, wherein the target message information includes first hotspot name information and first hotspot password information, and the MAC address of the user device has been modified to the target MAC address information;

[0010] The Wi-Fi module is enabled to listen to the message information only on the target communication channel. If the monitored target message information contains the first hotspot name information and the first hotspot password information, the Wi-Fi module is set to station mode, so that the Wi-Fi module attempts to connect to the routing device based on the first hotspot name information and the first hotspot password information.

[0011] According to another aspect of the present application, a method for connecting to a hotspot is provided, which is applied to a user device, and the method includes:

[0012] Obtain the first hotspot name information and first hotspot password information input by the user, modify the MAC address of the user device to the preset target MAC address information, and send target message information, wherein the target message information includes the first hotspot name information and the first hotspot password information. The user device has been connected to the routing device, so that the smart hardware device locks the target communication channel between the user device and the routing device according to the target MAC address information, only listens to the target message information on the target communication channel, and attempts to connect to the routing device based on the first hotspot name information and the first hotspot password information.

[0013] According to one aspect of the present application, there is provided an intelligent hardware device for connecting to a hotspot, the device comprising:

[0014] A module configured to set the Wi-Fi module of the intelligent hardware device to a promiscuous mode so that the Wi-Fi module starts monitoring message information;

[0015] Module one and module two are configured to lock a target communication channel between a user device and a routing device by filtering the message information according to preset target MAC address information, wherein the user device is connected to the routing device, the user device sends target message information, wherein the target message information includes first hotspot name information and first hotspot password information, and the MAC address of the user device has been modified to the target MAC address information;

[0016] Module 13 is configured to enable the Wi-Fi module to monitor the message information only on the target communication channel, and if the monitored target message information includes the first hotspot name information and the first hotspot password information, set the Wi-Fi module to station mode, so that the Wi-Fi module attempts to connect to the routing device based on the first hotspot name information and the first hotspot password information.

[0017] According to another aspect of the present application, a user device for connecting to a hotspot is provided, the device comprising:

[0018] Module 21 is used to obtain the first hotspot name information and the first hotspot password information input by the user, modify the MAC address of the user device to the preset target MAC address information, and send the target message information, wherein the target message information includes the first hotspot name information and the first hotspot password information. The user device has been connected to the routing device, so that the smart hardware device locks the target communication channel between the user device and the routing device according to the target MAC address information, only listens to the target message information on the target communication channel, and attempts to connect to the routing device based on the first hotspot name information and the first hotspot password information.

[0019] According to one aspect of the present application, a computer device for connecting to a hotspot is provided, comprising a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the operation of any of the methods described above.

[0020] According to one aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored, characterized in that when the computer program is executed by a processor, the operation of any of the methods described above is implemented.

[0021] According to one aspect of the present application, a computer program product is provided, comprising a computer program, which implements the steps of any of the above methods when executed by a processor.

[0022] Compared with the prior art, the present application sets the Wi-Fi module of the smart hardware device to promiscuous mode, so that the Wi-Fi module starts to monitor message information; according to the preset target MAC address information, by filtering the message information, the target communication channel between the user device and the routing device is locked, wherein the user device has been connected to the routing device, and the user device sends target message information, wherein the target message information includes the first hotspot name information and the first hotspot password information, and the MAC address of the user device has been modified to the target MAC address information; so that the Wi-Fi module only monitors the message information on the target communication channel, if the monitored target message information contains the first hotspot name information and the first hotspot password information, The Wi-Fi module is set to site mode, so that the Wi-Fi module attempts to connect to the routing device based on the first hotspot name information and the first hotspot password information, thereby optimizing the one-click network configuration method. By modifying the MAC address of the Wi-Fi module of the user device to a specific MAC address, the smart hardware device can find the current working channel between the user device and the routing device according to the specific MAC address in promiscuous mode, and directly lock the channel. Then, the smart hardware device receives and parses the message for the specific MAC address on the channel, thereby quickly locking the channel for communication between the user device and the routing device, avoiding cyclic reception of messages on other channels, reducing the probability of message loss, and greatly improving the success rate of network configuration. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Other features, objects and advantages of the present application will become more apparent upon reading the detailed description of non-limiting embodiments made with reference to the following drawings:

[0024] Figure 1 A flow chart of a method for connecting to a hotspot according to one embodiment of the present application is shown;

[0025] Figure 2 A flow chart of a method for connecting to a hotspot according to one embodiment of the present application is shown;

[0026] Figure 3 A schematic diagram showing a method for connecting to a hotspot according to an embodiment of the present application is shown;

[0027] Figure 4 A flow chart of a method for connecting to a hotspot according to one embodiment of the present application is shown;

[0028] Figure 5 A flow chart of a method for connecting to a hotspot according to one embodiment of the present application is shown;

[0029] Figure 6A diagram showing the structure of an intelligent hardware device for connecting to a hotspot according to one embodiment of the present application is shown;

[0030] Figure 7 A structural diagram of a user device for connecting to a hotspot according to an embodiment of the present application is shown;

[0031] Figure 8 An exemplary system is shown that can be used to implement the various embodiments described in this application.

[0032] The same or similar reference numerals in the drawings represent the same or similar components. DETAILED DESCRIPTION

[0033] The present application is described in further detail below with reference to the accompanying drawings.

[0034] In a typical configuration of the present application, the terminal, the device of the service network and the trusted party all include one or more processors (eg, a central processing unit (CPU)), an input / output interface, a network interface and a memory.

[0035] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash memory. Memory is an example of a computer-readable medium.

[0036] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PCM), programmable random access memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device.

[0037] The devices referred to in this application include but are not limited to user devices, network devices, or devices formed by integrating user devices and network devices through a network. The user devices include but are not limited to any mobile electronic product that can interact with a user (for example, through a touchpad), such as a smartphone, a tablet computer, etc. The mobile electronic product can use any operating system, such as the Android operating system, the iOS operating system, etc. Among them, the network device includes an electronic device that can automatically perform numerical calculations and information processing according to pre-set or stored instructions, and its hardware includes but is not limited to a microprocessor, an application specific integrated circuit (ASIC), a programmable logic device (PLD), a field programmable gate array (FPGA), a digital signal processor (DSP), an embedded device, etc. The network device includes but is not limited to a computer, a network host, a single network server, a set of multiple network servers, or a cloud composed of multiple servers; here, the cloud is composed of a large number of computers or network servers based on cloud computing, wherein cloud computing is a type of distributed computing, a virtual supercomputer composed of a group of loosely coupled computers. The network includes but is not limited to the Internet, a wide area network, a metropolitan area network, a local area network, a VPN network, a wireless self-organizing network (Ad Hoc network), etc. Preferably, the device may also be a program running on the user device, the network device, or a device formed by integrating the user device and the network device, the network device and the touch terminal, or the network device and the touch terminal via a network.

[0038] Of course, those skilled in the art should understand that the above-mentioned devices are only examples, and other existing or future devices that are applicable to this application should also be included in the scope of protection of this application and are included here by reference.

[0039] In the description of the present application, “plurality” means two or more, unless otherwise clearly defined.

[0040] Figure 1A flow chart of a method for connecting to a hotspot according to an embodiment of the present application is shown, the method comprising steps S11, S12, and S13. In step S11, the intelligent hardware device sets the Wi-Fi module of the intelligent hardware device to promiscuous mode, so that the Wi-Fi module starts to monitor message information; in step S12, the intelligent hardware device locks the target communication channel between the user device and the routing device by filtering the message information according to the preset target MAC address information, wherein the user device has been connected to the routing device, and the user device sends target message information, wherein the target message information includes first hotspot name information and first hotspot password information, and the MAC address of the user device has been modified to the target MAC address information; in step S13, the intelligent hardware device enables the Wi-Fi module to monitor the message information only on the target communication channel, and if the monitored target message information contains the first hotspot name information and the first hotspot password information, sets the Wi-Fi module to station mode, so that the Wi-Fi module attempts to connect to the routing device based on the first hotspot name information and the first hotspot password information.

[0041] In step S11, the smart hardware device sets the Wi-Fi module of the smart hardware device to promiscuous mode, so that the Wi-Fi module starts to monitor message information. In some embodiments, the present invention refers to a smart hardware device with a Wi-Fi module, such as a smart projector, a printer, a smart socket, a smart air conditioner, a smart air purifier, etc. In some embodiments, after the smart hardware device is started, the Wi-Fi module of the smart hardware device is set to promiscuous mode (also called sniffer mode), so that the Wi-Fi module starts to monitor air interface messages in the current environment.

[0042] In step S12, the intelligent hardware device locks the target communication channel between the user device and the routing device by filtering the message information according to the preset target MAC address information, wherein the user device has been connected to the routing device, and the user device sends the target message information, wherein the target message information includes the first hotspot name information and the first hotspot password information, and the MAC address of the user device has been modified to the target MAC address information. In some embodiments, the user device has been connected to the routing device, and the user device obtains the first hotspot name information and the first hotspot password information input by the user, temporarily modifies the MAC address of the user device to the target MAC address information, and then the user device sends the target message information via UDP broadcast, or the user device sends the target message information to the routing device via TCP, wherein the target message information includes the first hotspot name information and the first hotspot password information. In some embodiments, the user device has been connected to the routing device, that is, the user device has established a Wi-Fi connection with the routing device that the smart hardware device needs to connect to. The user opens the network configuration app on the user device. The network configuration app is an app used in conjunction with the smart hardware device, and has a built-in specific MAC address agreed with the smart hardware device, namely the target MAC address. The user enters the first hotspot name information (SSID) and the first hotspot password information of the routing device that the smart hardware device needs to connect to in the network configuration app. Then, the network configuration app will temporarily modify the current MAC address of the user device to the target MAC address, and send the target message information, namely the UDP message, via UDP broadcast. The target message information includes the first hotspot name information and the first hotspot password information. The target message information will carry the current MAC address of the user device, namely the target MAC address, by default. For example, the packet header of the target message information contains the current MAC address of the user device, namely the target MAC address. In some embodiments, a specific MAC address, namely the target MAC address, is preset in the smart hardware device. The Wi-Fi module of the smart hardware device monitors air interface messages in the current environment and filters the air interface messages according to the target MAC address to obtain a first message (data message) carrying the target MAC address. For example, the first message containing the target MAC address in the corresponding packet header is filtered out. At this time, when the Wi-Fi module receives the first message, the channel on which the Wi-Fi module operates is the target communication channel between the user device and the routing device.

[0043] In step S13, the intelligent hardware device enables the Wi-Fi module to monitor the message information only on the target communication channel. If the monitored target message information contains the first hotspot name information and the first hotspot password information, the Wi-Fi module is set to station mode, so that the Wi-Fi module attempts to connect to the routing device based on the first hotspot name information and the first hotspot password information. In some embodiments, after the intelligent hardware device locks the target communication channel, its Wi-Fi module will only work on the target communication channel to monitor air interface messages, and will no longer continue to work on other channels to monitor air interface messages. In some embodiments, the air interface messages received in the target communication channel are filtered according to the target MAC address to obtain the target message (UDP message) carrying the target MAC address. For example, the target message containing the target MAC address in the corresponding packet header is filtered. In some embodiments, the target message is parsed. If the first hotspot name information and the first hotspot password information can be parsed from the target message, that is, if the target message contains the first hotspot name information and the first hotspot password information, then the Wi-Fi module of the smart hardware device will be set to site mode (also called STA (Station) mode), and the first hotspot name information and the first hotspot password information will be used to try to connect to the routing device. The one-click network configuration method of the present application is optimized. By modifying the MAC address of the Wi-Fi module of the user device to a specific MAC address, the smart hardware device can find the current working channel between the user device and the routing device according to the specific MAC address in the promiscuous mode, directly lock the channel, and then the smart hardware device receives and parses the message for the specific MAC address on the channel, thereby quickly locking the channel for communication between the user device and the routing device, avoiding cyclic reception of messages on other channels, reducing the probability of message loss, and greatly improving the success rate of network configuration.

[0044] In some embodiments, the method further includes: storing the first hotspot name information and the first hotspot password information in a local memory of the user device; wherein, step S11 includes: reading the second hotspot name information and the second hotspot password information stored in the local memory; causing the Wi-Fi module to attempt to connect to the routing device based on the second hotspot name information and the second hotspot password information; if the connection fails, setting the Wi-Fi module to promiscuous mode so that the Wi-Fi module begins to monitor message information. In some embodiments, if the Wi-Fi module successfully connects to the routing device using the first hotspot name information and the first hotspot password information in the target message information, the first hotspot name information and the first hotspot password information will be stored locally on the user device. In some embodiments, after the smart hardware device is started, the Wi-Fi module will first be set to site mode, and the locally saved second hotspot name information and second hotspot password information will be read, and the second hotspot name information and second hotspot password information will be used to try to connect to the routing device. The return information of the routing device will be used to determine whether the connection to the routing device is successful. If the connection is successful, the smart hardware device can directly access the network / server. If the connection fails, the Wi-Fi module will be set to promiscuous mode, so that the Wi-Fi module starts to monitor the air interface messages in the current environment. In some embodiments, when the smart hardware device is started for the first time, since no hotspot name information and hotspot password information are saved locally, the Wi-Fi module will be directly set to promiscuous mode, so that the Wi-Fi module starts to monitor the air interface messages in the current environment.

[0045] In some embodiments, the method further includes: the smart hardware device deleting the second hotspot name information and the second hotspot password information from the local storage. In some embodiments, the locally stored second hotspot name information and the second hotspot password information are used to attempt to connect to the routing device. If the connection fails, the locally stored second hotspot name information and the second hotspot password information are deleted.

[0046] In some embodiments, the method further includes: the intelligent hardware device reads the connection failure count information corresponding to the second hotspot name information stored in the local memory; wherein, deleting the second hotspot name information and the second hotspot password information in the local memory includes: updating the connection failure count information, and if the updated connection failure count information reaches a predetermined number threshold, deleting the second hotspot name information and the second hotspot password information in the local memory; otherwise, saving the updated connection failure count in the local memory. In some embodiments, the locally stored second hotspot name information and the second hotspot password information are used to try to connect to the routing device. If the connection fails, the locally stored second hotspot name information and the second hotspot password information will not be deleted immediately. Instead, the locally stored connection failure count corresponding to the second hotspot name information will be read and the connection failure count will be increased by 1. If the connection failure count after the increase by 1 is less than the predetermined number threshold, the connection failure count after the increase by 1 will be saved locally. If the connection failure count after the increase by 1 reaches the predetermined number threshold, the locally stored second hotspot name information and the second hotspot password information will be deleted.

[0047] In some embodiments, the step of causing the Wi-Fi module to start monitoring message information comprises: scanning through the Wi-Fi module to obtain at least one communication channel in which a hotspot near the smart hardware device operates; configuring the Wi-Fi module to monitor message information on the at least one communication channel; wherein the step S12 comprises: if the MAC address information in the target message information monitored on the first communication channel is a preset target MAC address information, locking the first communication channel as the target communication channel between the user device and the routing device. In some embodiments, the Wi-Fi module of the smart hardware device is set to promiscuous mode and scans at least one routing device (also known as an AP or hotspot) near the smart hardware device in the current environment to obtain the channel (Channel) on which each routing device operates, and then configuring the Wi-Fi module to operate on one of the channels just scanned to receive message information. If no message is received, or if the received message does not carry the preset target MAC address, then continuing to configure the Wi-Fi module to operate on another channel, and so on, until the target message received by the Wi-Fi module on the first communication channel carries the target MAC address, at which point the first communication channel is locked as the target communication channel between the user device and the routing device.

[0048] In some embodiments, step S13 includes: the intelligent hardware device configures the Wi-Fi module to monitor the message information only on the target communication channel, and if the MAC address information in the first message information monitored is the target MAC address information, the first message information is used as the target message information. In some embodiments, after the intelligent hardware device locks the target communication channel, its Wi-Fi module will only work on the target communication channel to monitor air interface messages, and will no longer continue to work on other channels to monitor air interface messages. In some embodiments, if the first message received on the target communication channel carries the target MAC address, the first message is used as the target message.

[0049] In some embodiments, the method further includes: if the target message information does not include the first hotspot name information and the first hotspot password information, the intelligent hardware device stops monitoring the message information on the target communication channel and restarts the Wi-Fi module to monitor the message information. In some embodiments, if the target message does not include the first hotspot name information and the first hotspot password information, the Wi-Fi module will restart monitoring the air interface messages in the current environment, that is, the Wi-Fi module will no longer only monitor the air interface messages on the target communication channel, but will monitor the air interface messages on all channels.

[0050] In some embodiments, if the monitored target message information contains the first hotspot name information and the first hotspot password information, the Wi-Fi module is set to station mode, so that the Wi-Fi module attempts to connect to the routing device based on the first hotspot name information and the first hotspot password information, including: if the monitored target message information is decrypted using the predetermined first key information to obtain the first hotspot name information and the first hotspot password information, the Wi-Fi module is set to station mode, so that the Wi-Fi module attempts to connect to the routing device based on the first hotspot name information and the first hotspot password information. In some embodiments, it is necessary to use the predetermined first key information to decrypt the target message received on the target communication channel. If the decrypted target message contains the first hotspot name information and the first hotspot password information, the Wi-Fi module of the smart hardware device will be set to station mode, and the first hotspot name information and the first hotspot password information will be used to attempt to connect to the routing device.

[0051] In some embodiments, the method further includes: the smart hardware device sends a connection success prompt message to the network device, wherein the connection success prompt message includes the target MAC address information, so that the network device sends the connection success prompt message to the user device based on the target MAC address information. In some embodiments, if the Wi-Fi module successfully connects to the routing device using the first hotspot name information and the first hotspot password information in the target message information, the smart hardware device can access the network / server at this time, and the smart hardware device will generate a connection success prompt message including the target MAC address information, and send the connection success prompt message to the corresponding network device (i.e., the server corresponding to the network configuration App), thereby registering the smart hardware device on the network device, wherein the access address information of the network device has been preset in the smart hardware device. In some embodiments, after the network device receives the connection success prompt message, since the association relationship between the user device and the target MAC address information has been established on the network device, the network device will send the connection success prompt message to the user device to prompt the user that the network configuration is successful, and restore the MAC address of the user device to the default MAC address, i.e., the MAC address at the factory.

[0052] Figure 2 A flow chart of a method for connecting to a hotspot according to an embodiment of the present application is shown, the method comprising step S21. In step S21, the user device obtains the first hotspot name information and the first hotspot password information input by the user, modifies the MAC address of the user device to the preset target MAC address information, and sends target message information, wherein the target message information includes the first hotspot name information and the first hotspot password information, and the user device is connected to a routing device so that the smart hardware device locks the target communication channel between the user device and the routing device according to the target MAC address information, listens to the target message information only on the target communication channel, and attempts to connect to the routing device based on the first hotspot name information and the first hotspot password information.

[0053] In step S21, the user device obtains the first hotspot name information and the first hotspot password information input by the user, modifies the MAC address of the user device to the preset target MAC address information, and sends the target message information, wherein the target message information includes the first hotspot name information and the first hotspot password information. The user device has been connected to the routing device, so that the smart hardware device locks the target communication channel between the user device and the routing device according to the target MAC address information, only listens to the target message information on the target communication channel, and attempts to connect to the routing device based on the first hotspot name information and the first hotspot password information. In some embodiments, the user device is connected to the routing device, and the user device sends the target message information via UDP broadcast, or the user device sends the target message information to the routing device via TCP. In some embodiments, the intelligent hardware device sets the Wi-Fi module of the intelligent hardware device to promiscuous mode, so that the Wi-Fi module starts to monitor message information, and according to the target MAC address information, by filtering the message information, locks the target communication channel between the user device and the routing device, so that the Wi-Fi module only monitors the message information on the target communication channel. If the target message information monitored contains the first hotspot name information and the first hotspot password information, the Wi-Fi module is set to site mode, so that the Wi-Fi module attempts to connect to the routing device based on the first hotspot name information and the first hotspot password information. In some embodiments, the present invention refers to an intelligent hardware device with a Wi-Fi module, such as a smart projector, a printer, a smart socket, a smart air conditioner, a smart air purifier, etc. In some embodiments, after the smart hardware device is started, the Wi-Fi module of the smart hardware device is set to promiscuous mode (also called sniffer mode), so that the Wi-Fi module starts to monitor air interface messages in the current environment.In some embodiments, the user device has been connected to the routing device, that is, the user device has established a Wi-Fi connection with the routing device that the smart hardware device needs to connect to. The user opens the network configuration app on the user device. The network configuration app is an app used in conjunction with the smart hardware device, and has a built-in specific MAC address agreed with the smart hardware device, namely the target MAC address. The user enters the first hotspot name information (SSID) and the first hotspot password information of the routing device that the smart hardware device needs to connect to in the network configuration app. Then, the network configuration app will temporarily modify the current MAC address of the user device to the target MAC address, and send the target message information, namely the UDP message, via UDP broadcast. The target message information includes the first hotspot name information and the first hotspot password information. The target message information will carry the current MAC address of the user device, namely the target MAC address, by default. For example, the packet header of the target message information contains the current MAC address of the user device, namely the target MAC address. In some embodiments, a specific MAC address, namely the target MAC address, is preset in the smart hardware device. The Wi-Fi module of the smart hardware device monitors the air interface messages in the current environment and filters the air interface messages according to the target MAC address to obtain the first message carrying the target MAC address. For example, the first message (data message) containing the target MAC address in the corresponding packet header is filtered. At this time, the channel on which the Wi-Fi module works when receiving the first message is the target communication channel between the user device and the routing device. In some embodiments, after the smart hardware device locks the target communication channel, its Wi-Fi module will only work on the target communication channel to monitor the air interface messages, and will no longer continue to work on other channels to monitor the air interface messages. In some embodiments, the air interface messages received in the target communication channel are filtered according to the target MAC address to obtain the target message (UDP message) carrying the target MAC address. For example, the target message containing the target MAC address in the corresponding packet header is filtered. In some embodiments, the target message is parsed. If the first hotspot name information and the first hotspot password information can be obtained from the target message, that is, if the target message contains the first hotspot name information and the first hotspot password information, then the Wi-Fi module of the smart hardware device will be set to site mode (also called STA (Station) mode), and the first hotspot name information and the first hotspot password information will be used to try to connect to the routing device.

[0054] In some embodiments, the sending of target message information includes: generating target message information, wherein the target message information includes the first hotspot name information and the first hotspot password information; encrypting the target message information using a predetermined second key information, and sending the encrypted target message information. In some embodiments, target message information including the first hotspot name information and the first hotspot password information is first generated, and then the target message information is encrypted using a predetermined second key information, and the encrypted target message information is sent via UDP broadcast. In some embodiments, the second key information is the same as the first key information described above, that is, the first key information and the second key information are symmetric keys, or the second key information is different from the first key information described above, that is, the first key information and the second key information are asymmetric keys.

[0055] In some embodiments, the method further includes: if a connection success prompt message is received from a network device, and the connection success prompt message includes the target MAC address information, restoring the MAC address of the user device to the default MAC address information, wherein the connection success prompt message is sent by the intelligent hardware device to the network device. In some embodiments, if the user device receives a connection success prompt message from a network device, and the connection success prompt message includes the target MAC address information, the user will be prompted that the network configuration is successful, and the MAC address of the user device will be restored to the default MAC address, i.e., the factory MAC address.

[0056] In some embodiments, the method further includes: if no connection success prompt message sent by the network device is received within a predetermined time range, or if none of the connection success prompt messages sent by the network device received within the predetermined time range include the target MAC address information, restoring the MAC address of the user device to the default MAC address information. In some embodiments, if no connection success prompt message is received from the network device within the predetermined time range, or if none of the connection success prompt messages sent by the network device received within the predetermined time range include the target MAC address information, the user will be prompted that the network configuration has timed out / failed, and the MAC address of the user device will be restored to the default MAC address, i.e., the factory MAC address.

[0057] Figure 3 A schematic diagram for connecting to a hotspot according to an embodiment of the present application is shown.

[0058] like Figure 3As shown, a Wi-Fi connection has been established between the mobile terminal and the router, and the communication channel between the mobile terminal and the router is communication channel K, where the specific MAC is the MAC address agreed upon by the smart hardware device (device to be configured) and the corresponding APP when it leaves the factory, and needs to be bound for use. When the smart hardware device is in promiscuous mode, it can directly filter the monitored data packets based on the MAC address, thereby quickly locking the communication channel K between the mobile terminal and the router, and then monitoring the UDP packets on channel K.

[0059] Figure 4 A flow chart of a method for connecting to a hotspot according to an embodiment of the present application is shown.

[0060] like Figure 4 As shown, S1: The user opens the network configuration APP on the mobile terminal. The APP is an APP that is compatible with the smart hardware device and has a built-in specific MAC address agreed with the smart hardware device;

[0061] S2: The user enters the SSID and password of the router to which the device to be configured (smart hardware device) needs to connect in the APP.

[0062] S3: When the user clicks on the one-click network configuration, the app will temporarily modify the MAC address of the mobile terminal to a specific MAC address; then the configured SSID and password will be sent out in an encrypted message via UDP broadcast;

[0063] S4: Wait for the smart hardware device to monitor and parse the message. If the connection is successful, it will send a message to the mobile terminal to indicate the connection is successful. If the network configuration success message is not received within a certain period of time, the mobile terminal app will prompt that the network configuration has timed out / failed. The MAC address will be changed to the factory MAC address.

[0064] Figure 5 A flow chart of a method for connecting to a hotspot according to an embodiment of the present application is shown.

[0065] like Figure 5 As shown, SS1: After the smart hardware device is started, it will first set the Wi-Fi chip to STA mode so that it can directly connect to the AP through the locally saved SSID and password;

[0066] SS2: Read the locally saved SSID and password and try to connect to the AP. When the device is started for the first time, no SSID and password are saved and it will jump directly to SS4;

[0067] SS3: After attempting to connect, the AP returns information to determine whether the connection is successful. If the connection is successful, proceed to step SS9 to directly access the network / server.

[0068] SS4: If the connection fails, the smart hardware device will set the Wi-Fi chip to promiscuous mode. In this mode, the smart hardware device has the ability to monitor air interface messages in the current environment, filter relevant messages, and parse specific information in the messages (mainly SSID and password information) according to the encryption protocol.

[0069] SS5: Monitors air interface messages, filters them based on the specified MAC address, and quickly locks the communication channel K between the mobile terminal and the AP.

[0070] SS6: On channel K, it monitors air interface messages and filters them based on the specified MAC address. It finds and decrypts UDP messages.

[0071] SS7: Check the parsed message to see if it contains the SSID and password. If not, return to the SS5 step to monitor the air interface message.

[0072] SS8: If the required SSID and password information is parsed, the SSID and password are saved to the local storage of the intelligent hardware device and the process goes to step SS1.

[0073] Figure 6 A structural diagram of an intelligent hardware device for connecting to a hotspot according to an embodiment of the present application is shown, and the device includes a first module 11, a second module 12, and a third module 13. The first module 11 is used to set the Wi-Fi module of the intelligent hardware device to promiscuous mode, so that the Wi-Fi module starts to monitor message information; the first module 12 is used to lock the target communication channel between the user device and the routing device by filtering the message information according to preset target MAC address information, wherein the user device is connected to the routing device and sends target message information, wherein the target message information includes first hotspot name information and first hotspot password information, and the MAC address of the user device has been modified to the target MAC address information; the third module 13 is used to enable the Wi-Fi module to monitor the message information only on the target communication channel, and if the monitored target message information includes the first hotspot name information and the first hotspot password information, set the Wi-Fi module to station mode, so that the Wi-Fi module attempts to connect to the routing device based on the first hotspot name information and the first hotspot password information.

[0074] A module 11 is used to set the Wi-Fi module of the smart hardware device to a promiscuous mode so that the Wi-Fi module starts to monitor message information. In some embodiments, the present invention refers to a smart hardware device with a Wi-Fi module, such as a smart projector, a printer, a smart socket, a smart air conditioner, a smart air purifier, etc. In some embodiments, after the smart hardware device is started, the Wi-Fi module of the smart hardware device is set to a promiscuous mode (also called a sniffer mode), so that the Wi-Fi module starts to monitor air interface messages in the current environment.

[0075] Module 12 is configured to lock a target communication channel between a user device and a routing device by filtering the message information according to preset target MAC address information, wherein the user device has been connected to the routing device, and the user device sends target message information, wherein the target message information includes first hotspot name information and first hotspot password information, and the MAC address of the user device has been modified to the target MAC address information. In some embodiments, the user device has been connected to the routing device, and the user device obtains the first hotspot name information and first hotspot password information input by the user, temporarily modifies the MAC address of the user device to the target MAC address information, and then the user device sends the target message information via UDP broadcast, or the user device sends the target message information to the routing device via TCP, wherein the target message information includes the first hotspot name information and the first hotspot password information. In some embodiments, the user device has been connected to the routing device, that is, the user device has established a Wi-Fi connection with the routing device that the smart hardware device needs to connect to. The user opens the network configuration app on the user device. The network configuration app is an app used in conjunction with the smart hardware device, and has a built-in specific MAC address agreed with the smart hardware device, namely the target MAC address. The user enters the first hotspot name information (SSID) and the first hotspot password information of the routing device that the smart hardware device needs to connect to in the network configuration app. Then, the network configuration app will temporarily modify the current MAC address of the user device to the target MAC address, and send the target message information, namely the UDP message, via UDP broadcast. The target message information includes the first hotspot name information and the first hotspot password information. The target message information will carry the current MAC address of the user device, namely the target MAC address, by default. For example, the packet header of the target message information contains the current MAC address of the user device, namely the target MAC address. In some embodiments, a specific MAC address, namely the target MAC address, is preset in the smart hardware device. The Wi-Fi module of the smart hardware device monitors air interface messages in the current environment and filters the air interface messages according to the target MAC address to obtain a first message (data message) carrying the target MAC address. For example, the first message containing the target MAC address in the corresponding packet header is filtered out. At this time, when the Wi-Fi module receives the first message, the channel on which the Wi-Fi module operates is the target communication channel between the user device and the routing device.

[0076] The first three modules 13 are used to enable the Wi-Fi module to monitor the message information only on the target communication channel. If the monitored target message information contains the first hotspot name information and the first hotspot password information, the Wi-Fi module is set to the station mode, so that the Wi-Fi module attempts to connect to the routing device based on the first hotspot name information and the first hotspot password information. In some embodiments, after the smart hardware device locks the target communication channel, its Wi-Fi module will only work on the target communication channel to monitor air interface messages, and will no longer continue to work on other channels to monitor air interface messages. In some embodiments, the air interface messages received in the target communication channel are filtered according to the target MAC address to obtain the target message (UDP message) carrying the target MAC address. For example, the target message containing the target MAC address in the corresponding packet header is filtered. In some embodiments, the target message is parsed. If the first hotspot name information and the first hotspot password information can be parsed from the target message, that is, if the target message contains the first hotspot name information and the first hotspot password information, then the Wi-Fi module of the smart hardware device will be set to site mode (also called STA (Station) mode), and the first hotspot name information and the first hotspot password information will be used to try to connect to the routing device. The one-click network configuration method of the present application is optimized. By modifying the MAC address of the Wi-Fi module of the user device to a specific MAC address, the smart hardware device can find the current working channel between the user device and the routing device according to the specific MAC address in the promiscuous mode, directly lock the channel, and then the smart hardware device receives and parses the message for the specific MAC address on the channel, thereby quickly locking the channel for communication between the user device and the routing device, avoiding cyclic reception of messages on other channels, reducing the probability of message loss, and greatly improving the success rate of network configuration.

[0077] In some embodiments, the device is further configured to: store the first hotspot name information and the first hotspot password information in a local memory of the user device; wherein, step S11 includes: reading the second hotspot name information and the second hotspot password information stored in the local memory; enabling the Wi-Fi module to attempt to connect to a routing device based on the second hotspot name information and the second hotspot password information; if the connection fails, setting the Wi-Fi module to promiscuous mode so that the Wi-Fi module starts to monitor message information. Here, the related operations are similar to Figure 1 The embodiments shown are the same or similar and therefore will not be described in detail, but are incorporated herein by reference.

[0078] In some embodiments, the device is further configured to: delete the second hotspot name information and the second hotspot password information in the local memory. Figure 1 The embodiments shown are the same or similar and therefore will not be described in detail, but are incorporated herein by reference.

[0079] In some embodiments, the device is further used to: read the connection failure count information corresponding to the second hotspot name information stored in the local memory; wherein, deleting the second hotspot name information and the second hotspot password information in the local memory includes: updating the connection failure count information, if the updated connection failure count information reaches a predetermined number threshold, deleting the second hotspot name information and the second hotspot password information in the local memory, otherwise, saving the updated connection failure count in the local memory. Here, the related operations are the same as Figure 1 The embodiments shown are the same or similar and therefore will not be described in detail, but are incorporated herein by reference.

[0080] In some embodiments, the step of causing the Wi-Fi module to start monitoring message information includes: obtaining at least one communication channel where the hotspot near the smart hardware device works by scanning with the Wi-Fi module; configuring the Wi-Fi module to monitor message information on the at least one communication channel; wherein the first and second modules 12 are used to: if the MAC address information in the target message information monitored on the first communication channel is the preset target MAC address information, lock the first communication channel as the target communication channel between the user device and the routing device. Here, the related operations are similar to Figure 1 The embodiments shown are the same or similar and therefore will not be described in detail, but are incorporated herein by reference.

[0081] In some embodiments, the first three modules 13 are used to: configure the Wi-Fi module to monitor the message information only on the target communication channel, and if the MAC address information in the monitored first message information is the target MAC address information, use the first message information as the target message information. Figure 1 The embodiments shown are the same or similar and therefore will not be described in detail, but are incorporated herein by reference.

[0082] In some embodiments, the device is further configured to: if the target message information does not include the first hotspot name information and the first hotspot password information, stop monitoring the message information on the target communication channel, and restart the Wi-Fi module to monitor the message information. Figure 1 The embodiments shown are the same or similar and therefore will not be described in detail, but are incorporated herein by reference.

[0083] In some embodiments, if the monitored target message information contains the first hotspot name information and the first hotspot password information, the Wi-Fi module is set to the station mode, so that the Wi-Fi module attempts to connect to the routing device based on the first hotspot name information and the first hotspot password information, including: if the first hotspot name information and the first hotspot password information are obtained after decrypting the monitored target message information using the predetermined first key information, the Wi-Fi module is set to the station mode, so that the Wi-Fi module attempts to connect to the routing device based on the first hotspot name information and the first hotspot password information. Here, the relevant operations are the same as Figure 1 The embodiments shown are the same or similar and therefore will not be described in detail, but are incorporated herein by reference.

[0084] In some embodiments, the device is further configured to: send a successful connection prompt message to a network device, wherein the successful connection prompt message includes the target MAC address information, so that the network device sends the successful connection prompt message to the user device based on the target MAC address information. Figure 1 The embodiments shown are the same or similar and therefore will not be described in detail, but are incorporated herein by reference.

[0085] Figure 7 A structural diagram of a user device for connecting to a hotspot according to an embodiment of the present application is shown, and the device includes a 21 module. The 21 module 21 is used to obtain the first hotspot name information and the first hotspot password information input by the user, modify the MAC address of the user device to the preset target MAC address information, and send target message information, wherein the target message information includes the first hotspot name information and the first hotspot password information. The user device has been connected to a routing device, so that the smart hardware device locks the target communication channel between the user device and the routing device according to the target MAC address information, listens to the target message information only on the target communication channel, and attempts to connect to the routing device based on the first hotspot name information and the first hotspot password information.

[0086] Module 21 is used to obtain the first hotspot name information and the first hotspot password information input by the user, modify the MAC address of the user device to the preset target MAC address information, and send the target message information, wherein the target message information includes the first hotspot name information and the first hotspot password information. The user device has been connected to the routing device, so that the smart hardware device locks the target communication channel between the user device and the routing device according to the target MAC address information, only listens to the target message information on the target communication channel, and attempts to connect to the routing device based on the first hotspot name information and the first hotspot password information. In some embodiments, the user device is connected to the routing device, and the user device sends the target message information via UDP broadcast, or the user device sends the target message information to the routing device via TCP. In some embodiments, the intelligent hardware device sets the Wi-Fi module of the intelligent hardware device to promiscuous mode, so that the Wi-Fi module starts to monitor message information, and according to the target MAC address information, by filtering the message information, locks the target communication channel between the user device and the routing device, so that the Wi-Fi module only monitors the message information on the target communication channel. If the target message information monitored contains the first hotspot name information and the first hotspot password information, the Wi-Fi module is set to site mode, so that the Wi-Fi module attempts to connect to the routing device based on the first hotspot name information and the first hotspot password information. In some embodiments, the present invention refers to an intelligent hardware device with a Wi-Fi module, such as a smart projector, a printer, a smart socket, a smart air conditioner, a smart air purifier, etc. In some embodiments, after the smart hardware device is started, the Wi-Fi module of the smart hardware device is set to promiscuous mode (also called sniffer mode), so that the Wi-Fi module starts to monitor air interface messages in the current environment.In some embodiments, the user device has been connected to the routing device, that is, the user device has established a Wi-Fi connection with the routing device that the smart hardware device needs to connect to. The user opens the network configuration app on the user device. The network configuration app is an app used in conjunction with the smart hardware device, and has a built-in specific MAC address agreed with the smart hardware device, namely the target MAC address. The user enters the first hotspot name information (SSID) and the first hotspot password information of the routing device that the smart hardware device needs to connect to in the network configuration app. Then, the network configuration app will temporarily modify the current MAC address of the user device to the target MAC address, and send the target message information, namely the UDP message, via UDP broadcast. The target message information includes the first hotspot name information and the first hotspot password information. The target message information will carry the current MAC address of the user device, namely the target MAC address, by default. For example, the packet header of the target message information contains the current MAC address of the user device, namely the target MAC address. In some embodiments, a specific MAC address, namely the target MAC address, is preset in the smart hardware device. The Wi-Fi module of the smart hardware device monitors the air interface messages in the current environment and filters the air interface messages according to the target MAC address to obtain the first message carrying the target MAC address. For example, the first message (data message) containing the target MAC address in the corresponding packet header is filtered. At this time, the channel on which the Wi-Fi module works when receiving the first message is the target communication channel between the user device and the routing device. In some embodiments, after the smart hardware device locks the target communication channel, its Wi-Fi module will only work on the target communication channel to monitor the air interface messages, and will no longer continue to work on other channels to monitor the air interface messages. In some embodiments, the air interface messages received in the target communication channel are filtered according to the target MAC address to obtain the target message (UDP message) carrying the target MAC address. For example, the target message containing the target MAC address in the corresponding packet header is filtered. In some embodiments, the target message is parsed. If the first hotspot name information and the first hotspot password information can be obtained from the target message, that is, if the target message contains the first hotspot name information and the first hotspot password information, then the Wi-Fi module of the smart hardware device will be set to site mode (also called STA (Station) mode), and the first hotspot name information and the first hotspot password information will be used to try to connect to the routing device.

[0087] In some embodiments, the sending of target message information includes: generating target message information, wherein the target message information includes the first hotspot name information and the first hotspot password information; encrypting the target message information using a predetermined second key information, and sending the encrypted target message information. Figure 2The embodiments shown are the same or similar and therefore will not be described in detail, but are incorporated herein by reference.

[0088] In some embodiments, the device is further configured to: if a connection success prompt message sent by a network device is received, and the connection success prompt message includes the target MAC address information, restore the MAC address of the user device to the default MAC address information, wherein the connection success prompt message is sent by the smart hardware device to the network device. Figure 2 The embodiments shown are the same or similar and therefore will not be described in detail, but are incorporated herein by reference.

[0089] In some embodiments, the device is further configured to: if no connection success prompt information sent by the network device is received within a predetermined time range, or if none of the connection success prompt information sent by the network device received within the predetermined time range includes the target MAC address information, restore the MAC address of the user device to the default MAC address information. Figure 2 The embodiments shown are the same or similar and therefore will not be described in detail, but are incorporated herein by reference.

[0090] In addition to the methods and devices described in the above embodiments, the present application also provides a computer-readable storage medium, which stores computer code. When the computer code is executed, the method described in any of the above items is executed.

[0091] The present application also provides a computer program product. When the computer program product is executed by a computer device, the method described in any one of the preceding items is executed.

[0092] The present application also provides a computer device, comprising:

[0093] one or more processors;

[0094] a memory for storing one or more computer programs;

[0095] When the one or more computer programs are executed by the one or more processors, the one or more processors are caused to implement the method as described in any one of the preceding items.

[0096] Figure 8 shows an exemplary system that can be used to implement the various embodiments described in this application;

[0097] like Figure 8In some embodiments, the system 300 can function as any of the devices described in the various embodiments. In some embodiments, the system 300 can include one or more computer-readable media (e.g., system memory or NVM / storage device 320) having instructions and one or more processors (e.g., processor(s) 305) coupled to the one or more computer-readable media and configured to execute the instructions to implement the modules and thereby perform the actions described herein.

[0098] For one embodiment, system control module 310 may include any suitable interface controller to provide any suitable interface to at least one of processor(s) 305 and / or any suitable device or component in communication with system control module 310 .

[0099] The system control module 310 may include a memory controller module 330 to provide an interface to the system memory 315. The memory controller module 330 may be a hardware module, a software module, and / or a firmware module.

[0100] System memory 315 can be used, for example, to load and store data and / or instructions for system 300. For one embodiment, system memory 315 can include any suitable volatile memory, such as a suitable DRAM. In some embodiments, system memory 315 can include double data rate type four synchronous dynamic random access memory (DDR4 SDRAM).

[0101] For one embodiment, system control module 310 may include one or more input / output (I / O) controllers to provide interfaces to NVM / storage device 320 and communication interface(s) 325 .

[0102] For example, NVM / storage 320 may be used to store data and / or instructions. NVM / storage 320 may include any suitable non-volatile memory (e.g., flash memory) and / or may include any suitable non-volatile storage device(s) (e.g., one or more hard disk drives (HDDs), one or more compact disk (CD) drives, and / or one or more digital versatile disk (DVD) drives).

[0103] NVM / storage device 320 may include storage resources that are physically part of the device on which system 300 is installed, or it may be accessible to the device without being part of the device. For example, NVM / storage device 320 may be accessed over a network via communication interface(s) 325.

[0104] Communication interface(s) 325 may provide an interface for system 300 to communicate over one or more networks and / or with any other suitable devices. System 300 may wirelessly communicate with one or more components of a wireless network in accordance with any of one or more wireless network standards and / or protocols.

[0105] For one embodiment, at least one of the processor(s) 305 may be packaged together with the logic of one or more controllers of the system control module 310 (e.g., the memory controller module 330). For one embodiment, at least one of the processor(s) 305 may be packaged together with the logic of one or more controllers of the system control module 310 to form a system-in-package (SiP). For one embodiment, at least one of the processor(s) 305 may be integrated on the same die with the logic of one or more controllers of the system control module 310. For one embodiment, at least one of the processor(s) 305 may be integrated on the same die with the logic of one or more controllers of the system control module 310 to form a system-on-chip (SoC).

[0106] In various embodiments, system 300 may be, but is not limited to, a server, a workstation, a desktop computing device, or a mobile computing device (e.g., a laptop computing device, a handheld computing device, a tablet computer, a netbook, etc.). In various embodiments, system 300 may have more or fewer components and / or a different architecture. For example, in some embodiments, system 300 includes one or more cameras, a keyboard, a liquid crystal display (LCD) screen (including a touchscreen display), a non-volatile memory port, multiple antennas, a graphics chip, an application-specific integrated circuit (ASIC), and a speaker.

[0107] It should be noted that the application can be implemented in software and / or a combination of software and hardware, for example, can be implemented using an application specific integrated circuit (ASIC), a general purpose computer or any other similar hardware device. In one embodiment, the software program of the application can be executed by a processor to realize the steps or functions described above. Similarly, the software program of the application (including relevant data structures) can be stored in a computer-readable recording medium, for example, a RAM memory, a magnetic or optical drive or a floppy disk and similar devices. In addition, some steps or functions of the application can be implemented using hardware, for example, as a circuit that cooperates with a processor to perform each step or function.

[0108] In addition, a part of the present application may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present application through the operation of the computer. Those skilled in the art should understand that the form in which the computer program instruction exists in a computer-readable medium includes but is not limited to a source file, an executable file, an installation package file, etc. Accordingly, the way in which the computer program instruction is executed by the computer includes but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium that can be accessed by the computer.

[0109] Communication media include media by which communication signals containing, for example, computer-readable instructions, data structures, program modules, or other data are transmitted from one system to another. Communication media may include guided transmission media such as cables and wires (e.g., fiber optic, coaxial, etc.) and wireless (unguided transmission) media capable of propagating energy waves, such as acoustic, electromagnetic, RF, microwave, and infrared. Computer-readable instructions, data structures, program modules, or other data may be embodied as, for example, a modulated data signal in a wireless medium such as a carrier wave or similar mechanism such as that embodied as part of spread spectrum technology. The term "modulated data signal" refers to a signal that has one or more of its characteristics changed or set in such a manner as to encode information in the signal. Modulation may be analog, digital, or a hybrid modulation technique.

[0110] By way of example and not limitation, computer-readable storage media may include volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of information such as computer-readable instructions, data structures, program modules or other data. For example, computer-readable storage media include, but are not limited to, volatile memory, such as random access memory (RAM, DRAM, SRAM); and non-volatile memory, such as flash memory, various read-only memories (ROM, PROM, EPROM, EEPROM), magnetic and ferromagnetic / ferroelectric memories (MRAM, FeRAM); and magnetic and optical storage devices (hard disks, magnetic tapes, CDs, DVDs); or other media now known or later developed that can store computer-readable information / data for use by a computer system.

[0111] Here, according to one embodiment of the present application, a device is included, which includes a memory for storing computer program instructions and a processor for executing the program instructions, wherein, when the computer program instructions are executed by the processor, the device is triggered to run the methods and / or technical solutions based on the aforementioned multiple embodiments of the present application.

[0112] It is obvious to those skilled in the art that the present application is not limited to the details of the above-mentioned exemplary embodiments, and that the present application can be implemented in other specific forms without departing from the spirit or basic characteristics of the present application. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-restrictive, and the scope of the present application is defined by the appended claims rather than the above description, and it is intended that all changes that fall within the meaning and scope of the equivalent elements of the claims are included in the present application. Any figure mark in the claims should not be regarded as limiting the claims involved. In addition, it is obvious that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the device claim can also be implemented by one unit or device through software or hardware. Words such as first and second are used to indicate names and do not indicate any particular order.

Claims

1. A method for connecting to a hotspot, applied to an intelligent hardware device, wherein: The method includes: Setting the Wi-Fi module of the intelligent hardware device to promiscuous mode so that the Wi-Fi module starts monitoring message information; According to preset target MAC address information, the target communication channel between the user device and the routing device is locked by filtering the message information, wherein the user device is connected to the routing device, and the user device sends target message information via UDP broadcast, wherein the target message information includes first hotspot name information and first hotspot password information, the target message information carries the target MAC address information, and the MAC address of the user device has been modified to the target MAC address information; The Wi-Fi module is configured to monitor the message information only on the target communication channel, and if the monitored target message information includes the first hotspot name information and the first hotspot password information, the Wi-Fi module is set to a station mode, so that the Wi-Fi module attempts to connect to the routing device based on the first hotspot name information and the first hotspot password information; The step of causing the Wi-Fi module to start monitoring message information includes: Scanning by the Wi-Fi module to obtain at least one communication channel in which a hotspot near the intelligent hardware device operates; configuring the Wi-Fi module to monitor message information on the at least one communication channel; The filtering of the message information according to the preset target MAC address information to lock the target communication channel between the user equipment and the routing device includes: If the MAC address information in the target message information monitored on the first communication channel is the preset target MAC address information, the first communication channel is locked as the target communication channel between the user equipment and the routing device.

2. The method according to claim 1, wherein The method further comprises: Saving the first hotspot name information and the first hotspot password information in a local memory of the user device; The step of setting the Wi-Fi module of the intelligent hardware device to a promiscuous mode so that the Wi-Fi module starts to monitor message information includes: Read the second hotspot name information and the second hotspot password information stored in the local memory; The Wi-Fi module attempts to connect to the routing device based on the second hotspot name information and the second hotspot password information; If the connection fails, the Wi-Fi module is set to promiscuous mode so that the Wi-Fi module starts to monitor message information.

3. The method according to claim 2, wherein: The method further comprises: The second hotspot name information and the second hotspot password information are deleted from the local memory.

4. The method according to claim 3, wherein: The method further comprises: Reading the connection failure count information corresponding to the second hotspot name information stored in the local memory; The deleting the second hotspot name information and the second hotspot password information in the local memory includes: Update the connection failure count information. If the updated connection failure count information reaches a predetermined threshold, delete the second hotspot name information and the second hotspot password information in the local memory. Otherwise, save the updated connection failure count in the local memory.

5. The method according to claim 1, wherein The method further comprises: The Wi-Fi module is configured to monitor the message information only on the target communication channel, and if the MAC address information in the monitored first message information is the target MAC address information, the first message information is used as the target message information.

6. The method according to claim 5, wherein: The method further comprises: If the target message information does not include the first hotspot name information and the first hotspot password information, stop monitoring the message information on the target communication channel, and enable the Wi-Fi module to start monitoring the message information again.

7. The method according to claim 1, wherein If the monitored target message information includes the first hotspot name information and the first hotspot password information, setting the Wi-Fi module to a station mode so that the Wi-Fi module attempts to connect to the routing device based on the first hotspot name information and the first hotspot password information, including: If the first hotspot name information and the first hotspot password information are obtained after decrypting the monitored target message information using the predetermined first key information, the Wi-Fi module is set to site mode, so that the Wi-Fi module attempts to connect to the routing device based on the first hotspot name information and the first hotspot password information.

8. The method according to claim 1, wherein The method further comprises: Sending connection success prompt information to the network device, wherein the connection success prompt information includes the target MAC address information, so that the network device sends the connection success prompt information to the user equipment based on the target MAC address information.

9. A method for connecting to a hotspot, applied to a user device, wherein: The method includes: Obtain first hotspot name information and first hotspot password information input by a user, modify the MAC address of the user device to preset target MAC address information, and send target message information, wherein the target message information is sent via UDP broadcast, the target message information includes the first hotspot name information and the first hotspot password information, the user device is connected to a routing device, and the target message information carries the target MAC address information, so that the smart hardware device scans through a Wi-Fi module to obtain at least one communication channel where a hotspot near the smart hardware device operates, configures the Wi-Fi module to listen for message information on the at least one communication channel, and enables the Wi-Fi module to start listening for message information. If the MAC address information in the target message information listened on the first communication channel is the preset target MAC address information, the first communication channel is locked as the target communication channel between the user device and the routing device, the target message information is only listened on the target communication channel, and based on the first hotspot name information and the first hotspot password information, an attempt is made to connect to the routing device.

10. The method according to claim 9, wherein: Send target message information, including: Generate target message information, wherein the target message information includes the first hotspot name information and the first hotspot password information; The target message information is encrypted using the predetermined second key information, and the encrypted target message information is sent.

11. The method according to claim 9, wherein: The method further comprises: If a successful connection prompt message is received from a network device, and the successful connection prompt message includes the target MAC address information, the MAC address of the user device is restored to the default MAC address information, wherein the successful connection prompt message is sent from the intelligent hardware device to the network device.

12. The method according to claim 11, wherein The method further comprises: If no connection success prompt information sent by the network device is received within the predetermined time range, or if none of the connection success prompt information sent by the network device received within the predetermined time range includes the target MAC address information, the MAC address of the user device is restored to the default MAC address information.

13. A computer device for connecting to a hotspot, wherein: The device includes: processor; and A memory arranged to store computer executable instructions which, when executed, cause the processor to perform the steps of the method as claimed in any one of claims 1 to 12.

14. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: The computer program / instructions, when executed, cause the system to perform the steps of the method as claimed in any one of claims 1 to 12.

15. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.

Citation Information

Patent Citations

  • Method and system for quickly having access to WIFI wireless network

    CN104010327A

  • Method, apparatus and device for connecting wireless access point, and storage medium

    CN107995671A