Detailed Description
The technical solution in the embodiments of the present application will be described in detail and removed with reference to the accompanying drawings. In the description of the embodiments herein, "/" means "or" unless otherwise specified, for example, a/B may mean a or B; "and/or" in the text is only an association relationship describing an associated object, and means that three relationships may exist, for example, a and/or B may mean: three cases of a alone, a and B both, and B alone exist, and in addition, "a plurality" means two or more than two in the description of the embodiments of the present application.
In the following, the terms "first", "second" are used for descriptive purposes only and are not to be understood as implying or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of embodiments of the application, unless stated otherwise, "plurality" means two or more.
Some terms appearing herein are explained below:
1. the term "application" in embodiments of the present invention is a computer program that performs one or more specific tasks, and has a visual display interface for interacting with a user.
2. The term wifi module in the embodiment of the invention is also named as a serial port wifi module, belongs to an internet of things transmission layer, and has the function of converting a serial port or TTL level into an embedded module which accords with a wifi wireless network communication standard. The traditional hardware equipment embedded with the wifi module can directly utilize wifi To access the internet, and is an important component for realizing internet of things application such as wireless smart home and Machine-To-Machine (M2M).
3. In the embodiment of the present invention, the term "SSID", i.e., Service Set Identifier (SSID), may divide a wireless local area network into several sub-networks requiring different authentication, where each sub-network requires independent authentication, and only users passing authentication may enter the corresponding sub-network, so as to prevent unauthorized users from entering the local network.
4. In the embodiment of the present invention, the term "MAC address", i.e. a Medium Access Control (MAC) address, also referred to as a local area network address, an ethernet address or a physical address, is an address used to confirm the location of a network device. The MAC address is used to uniquely identify a network card in the network, and if one or more network cards exist in a device, each network card needs to have a unique MAC address.
5. The term "flash memory" in the embodiments of the present invention refers to a flash memory (flash memory) which is a form of electrically erasable programmable read-only memory, allowing multiple erasing or writing operations.
6. The term "universal channel" in the embodiment of the invention refers to a wifi channel which is supported by a wifi module in a set geographical range; for example, wifi channels may be supported by various countries around the world.
7. The term "non-universal channel" in the embodiment of the invention refers to a wifi channel supported by a part of area of a wifi module in a set geographical range; for example, wifi channels supported by parts of the world.
Fig. 1 shows a schematic configuration of a mobile terminal 100.
The following describes an embodiment specifically by taking the mobile terminal 100 as an example. It should be understood that the mobile terminal 100 shown in fig. 1 is merely an example, and that the mobile terminal 100 may have more or fewer components than shown in fig. 1, may combine two or more components, or may have a different configuration of components. The various components shown in the figures may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
A block diagram of a hardware configuration of a mobile terminal 100 according to an exemplary embodiment is exemplarily shown in fig. 1. As shown in fig. 1, the mobile terminal 100 includes: a Radio Frequency (RF) circuit 110, a memory 120, a display unit 130, a camera 140, a sensor 150, an audio circuit 160, a Wireless Fidelity (Wi-Fi) module 170, a processor 180, a bluetooth module 181, and a power supply 190.
The RF circuit 110 may be used for receiving and transmitting signals during information transmission and reception or during a call, and may receive downlink data of a base station and then send the downlink data to the processor 180 for processing; the uplink data may be transmitted to the base station. Typically, the RF circuitry includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like.
The memory 120 may be used to store software programs and data. The processor 180 performs various functions of the mobile terminal 100 and data processing by executing software programs or data stored in the memory 120. The memory 120 may include high speed random access memory and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. The memory 120 stores an operating system that enables the mobile terminal 100 to operate. The memory 120 may store an operating system and various application programs, and may also store codes for performing the methods described in the embodiments of the present application.
The display unit 130 may be used to receive input numeric or character information and generate signal input related to user settings and function control of the mobile terminal 100, and particularly, the display unit 130 may include a touch screen 131 disposed on the front of the mobile terminal 100 and may collect touch operations of a user thereon or nearby, such as clicking a button, dragging a scroll box, and the like.
The display unit 130 may also be used to display a Graphical User Interface (GUI) of information input by or provided to the user and various menus of the terminal 100. In particular, the display unit 130 may include a display screen 132 disposed on the front surface of the mobile terminal 100. The display screen 132 may be configured in the form of a liquid crystal display, a light emitting diode, or the like. The display unit 130 may be used to display various graphical user interfaces described herein.
The touch screen 131 may cover the display screen 132, or the touch screen 131 and the display screen 132 may be integrated to implement the input and output functions of the mobile terminal 100, and after the integration, the touch screen may be referred to as a touch display screen for short. In the present application, the display unit 130 may display the application programs and the corresponding operation steps.
The camera 140 may be used to capture still images or video. The object generates an optical image through the lens and projects the optical image to the photosensitive element. The photosensitive element may be a Charge Coupled Device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The light sensing elements convert the light signals into electrical signals which are then passed to the processor 180 for conversion into digital image signals.
The mobile terminal 100 may further include at least one sensor 150, such as an acceleration sensor 151, a distance sensor 152, a fingerprint sensor 153, a temperature sensor 154. The mobile terminal 100 may also be configured with other sensors such as a gyroscope, barometer, hygrometer, thermometer, infrared sensor, light sensor, motion sensor, and the like.
The audio circuitry 160, speaker 161, microphone 162 may provide an audio interface between a user and the mobile terminal 100. The audio circuit 160 may transmit the electrical signal converted from the received audio data to the speaker 161, and convert the electrical signal into a sound signal for output by the speaker 161. The mobile terminal 100 may also be provided with a volume button for adjusting the volume of the sound signal. On the other hand, the microphone 162 converts the collected sound signal into an electrical signal, converts the electrical signal into audio data after being received by the audio circuit 160, and outputs the audio data to the RF circuit 110 to be transmitted to, for example, another terminal or outputs the audio data to the memory 120 for further processing. In this application, the microphone 162 may capture the voice of the user.
wifi belongs to a short-distance wireless transmission technology, and the mobile terminal 100 can help a user to receive and send e-mails, browse webpages, access streaming media and the like through the Wi-Fi module 170, and provides wireless broadband internet access for the user.
The processor 180 is a control center of the mobile terminal 100, connects various parts of the entire terminal using various interfaces and lines, and performs various functions of the mobile terminal 100 and processes data by running or executing software programs stored in the memory 120 and calling data stored in the memory 120. In some embodiments, processor 180 may include one or more processing units; the processor 180 may also integrate an application processor, which mainly handles operating systems, user interfaces, applications, etc., and a baseband processor, which mainly handles wireless communications. It will be appreciated that the baseband processor described above may not be integrated into the processor 180. In the present application, the processor 180 may run an operating system, an application program, a user interface display, and a touch response, and the processing method described in the embodiments of the present application. Further, the processor 180 is coupled with the display unit 130.
And the bluetooth module 181 is configured to perform information interaction with other bluetooth devices having a bluetooth module through a bluetooth protocol. For example, the mobile terminal 100 may establish a bluetooth connection with a wearable electronic device (e.g., a smart watch) having a bluetooth module via the bluetooth module 181, so as to perform data interaction.
The mobile terminal 100 also includes a power supply 190 (e.g., a battery) that powers the various components. The power supply may be logically connected to the processor 180 through a power management system to manage charging, discharging, power consumption, etc. through the power management system. The mobile terminal 100 may also be configured with power buttons for powering the terminal on and off, and locking the screen.
Fig. 2 is a block diagram of a software configuration of the mobile terminal 100 according to the embodiment of the present invention.
The layered architecture divides the software into several layers, each layer having a clear role and division of labor. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into four layers, an application layer, an application framework layer, an Android runtime (Android runtime) and system library, and a kernel layer from top to bottom.
The application layer may include a series of application packages.
As shown in fig. 2, the application package may include applications such as camera, gallery, calendar, phone call, map, navigation, WLAN, bluetooth, music, video, short message, etc.
The application framework layer provides an Application Programming Interface (API) and a programming framework for the application program of the application layer. The application framework layer includes a number of predefined functions.
As shown in FIG. 2, the application framework layers may include a window manager, content provider, view system, phone manager, resource manager, notification manager, and the like.
The window manager is used for managing window programs. The window manager can obtain the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like.
The content provider is used to store and retrieve data and make it accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
The view system includes visual controls such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, the display interface including the short message notification icon may include a view for displaying text and a view for displaying pictures.
The phone manager is used to provide a communication function of the mobile terminal 100. Such as management of call status (including on, off, etc.).
The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and the like.
The notification manager enables the application to display notification information in the status bar, can be used to convey notification-type messages, can disappear automatically after a short dwell, and does not require user interaction. Such as a notification manager used to inform download completion, message alerts, etc. The notification manager may also be a notification that appears in the form of a chart or scroll bar text at the top status bar of the system, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialog window. For example, text information is prompted in the status bar, a prompt tone is given, the mobile terminal vibrates, an indicator light flashes, and the like.
The Android Runtime comprises a core library and a virtual machine. The Android runtime is responsible for scheduling and managing an Android system.
The core library comprises two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the application framework layer run in a virtual machine. And executing java files of the application program layer and the application program framework layer into a binary file by the virtual machine. The virtual machine is used for performing the functions of object life cycle management, stack management, thread management, safety and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. For example: surface managers (surface managers), Media Libraries (Media Libraries), three-dimensional graphics processing Libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), and the like.
The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.
The media library supports a variety of commonly used audio, video format playback and recording, and still image files, among others. The media library may support a variety of audio-video encoding formats, such as MPEG4, h.264, MP3, AAC, AMR, JPG, PNG, and the like.
The three-dimensional graphic processing library is used for realizing three-dimensional graphic drawing, image rendering, synthesis, layer processing and the like.
The 2D graphics engine is a drawing engine for 2D drawing.
The kernel layer is a layer between hardware and software. The inner core layer at least comprises a display driver, a camera driver, an audio driver and a sensor driver.
The following describes exemplary workflow of the mobile terminal 100 software and hardware in connection with capturing a photo scene.
When the touch screen 131 receives a touch operation, a corresponding hardware interrupt is issued to the kernel layer. The kernel layer processes the touch operation into an original input event (including touch coordinates, a time stamp of the touch operation, and other information). The raw input events are stored at the kernel layer. And the application program framework layer acquires the original input event from the kernel layer and identifies the control corresponding to the input event. Taking the touch operation as a touch click operation, and taking a control corresponding to the click operation as a control of a camera application icon as an example, the camera application calls an interface of an application framework layer, starts the camera application, further starts a camera drive by calling a kernel layer, and captures a still image or a video through the camera 140.
The mobile terminal 100 in the embodiment of the present application may be a mobile phone, a tablet computer, a wearable device, a notebook computer, a television, and the like.
Fig. 3 is a schematic diagram illustrating a user interface on a mobile terminal (e.g., mobile terminal 100 of fig. 1). In some implementations, a user can open a corresponding application by touching an application icon on the user interface, or can open a corresponding folder by touching a folder icon on the user interface.
Along with the development of the internet of things technology, electronic home equipment is gradually common, and great convenience is provided for the life of a user. The user controls the electronic home equipment through an application program installed on the mobile terminal, and the control is usually realized by connecting a cloud server. Before the electronic home devices are connected with the cloud server, the gateway devices, such as a router, need to be accessed through wifi modules of the electronic home devices, and then the connection between the electronic home devices and the cloud server is achieved. And determining a network to be accessed by the electronic home equipment and a process of accessing the network as a network distribution process.
Fig. 4 is a working topological diagram of the electronic home devices of the internet of things, wherein the electronic home devices with the wifi module are connected with the router and are connected with the mobile terminal through the cloud and the wide area network, and all the devices perform wireless communication according to the topological structure of the wifi module, the router, the cloud, the wide area network and the mobile terminal. The premise that the transmission path is established by the structure is that the wifi module is connected to the router firstly, namely the distribution network is successful, namely the wifi module is connected to the router after acquiring the ssid and password of the router. After the electronic home equipment completes the network distribution, the wifi module can report the MAC address comprising the wifi module, the information of the electronic home and the like to the cloud end through the network, the binding relation of the wifi module, cloud and mobile terminal APP can be established at the cloud end, and the mobile terminal and the wifi module establish a one-to-one communication relation at the moment.
The above-mentioned electronic household equipment wifi module obtains the mode of ssid and password of router can be: and the wifi module acquires the ssid and password of the router by actively scanning the channel. The channels scanned by the wifi module are determined by configured country codes, channels supported by the wifi module corresponding to different country codes are different, and different countries correspond to different country codes; for example, different country codes need to be configured for electronic home devices used in different countries, so that the electronic home devices reasonably select scanning channels in the process of network distribution, which brings huge workload for maintaining the electronic home devices, is very easy to make mistakes, and brings great risk to the electronic home devices. Moreover, different countries may limit the use of different channels (i.e. frequency bands), and the wifi module of the electronic home device in each country must configure the channel according to the regulations of the corresponding country.
Based on the above problem, as shown in fig. 5, an embodiment of the present invention provides a network distribution system for electronic home devices, including: a mobile terminal 50 and an electronic home device 51.
The mobile terminal 50 is installed with an application program to control the electronic home equipment 51.
The electronic home equipment 51 powers on the wifi module, enters a distribution network state, sets channel parameters of a SoftAP hotspot, and starts the SoftAP hotspot.
In response to the user operation, the mobile terminal 50 opens the application program, enters the distribution network state, and establishes connection with the electronic home equipment 51 through the SoftAP hotspot of the wifi module 52.
Specifically, as shown in fig. 6, the user opens an application installed on the mobile terminal device, scans SoftAP hotspots of wifi modules around, and filters SoftAP hotspots of a specific rule from the scanning result, such as a hyaline, where the wifi module hotspot name rule is HIS-xxxxxxxxxx, and a MAC (media Access Control) address of a HIS-suffix 6byte, and the application on the mobile terminal filters and connects to the SoftAP hotspots of the specific rule.
After the mobile terminal is successfully connected with the SoftAP hotspot, a TCP (Transmission Control Protocol) connection request is initiated, the electronic home device receives the request, and at this time, the mobile terminal and the electronic home device establish TCP communication.
After TCP communication is established between the mobile terminal and the electronic home equipment, the mobile terminal sends a scanning instruction to the electronic home equipment, and the electronic home equipment receives the scanning instruction which is sent by the mobile terminal and indicates to scan the available network; the method comprises the steps that the electronic home equipment scans available networks in different scanning modes on channels supported by a wifi module and acquires network configuration information of at least one scanned available network;
the channels supported by the wifi module in the embodiment of the invention can be all wifi channels; the channels supported by the wifi module comprise a general channel and a non-general channel;
it should be noted that, because the country code needs to be preset in the wifi module of the electronic home device, the country code of the country supporting all wifi channels may be preset in the wifi module in the embodiment of the present invention.
The universal channel can be a wifi channel supported by each country around the world; the non-universal channel is a wifi channel supported by part of countries all over the world;
for example, 1-11 channels among the channels supported by the wifi module are general channels, and 12-14 channels are general channels.
The corresponding relationship between the wifi channel and the frequency band as shown in table 1:
channel/band
| Unit MHz |
|
1
|
2412
|
2
|
2417
|
3
|
2422
|
4
|
2427
|
5
|
2432
|
6
|
2437
|
7
|
2442
|
8
|
2447
|
9
|
2452
|
10
|
2457
|
11
|
2462
|
12
|
2467
|
13
|
2472
|
14
|
2484 |
TABLE 1
The electronic home equipment in the embodiment of the invention scans the available network by using different scanning modes on the supported channel, and has the following two conditions:
in the situation 1, an electronic home device scans an available network by using an active scanning mode on a general channel in channels supported by a wifi module;
the following describes in detail a manner in which the electronic home device performs active scanning on the common channel in the embodiment of the present invention.
An optional implementation manner is that the electronic home equipment monitors a general channel; if the data frame transmission is determined to exist on the general channel, the electronic home equipment sends a detection request message on the general channel; after receiving the probe response message returned by the general channel, the electronic home equipment determines that the available network is scanned on the general channel.
Aiming at a plurality of general channels in the channels supported by the wifi module, the wifi module of the electronic home equipment sequentially monitors the general channels;
in the active scanning process, the wifi module of the electronic home device can monitor a plurality of general channels in sequence according to the size sequence of the channel index values, or the wifi module of the electronic home device can randomly monitor a plurality of general channels in sequence.
It should be noted that, in the process that the wifi module of the electronic home device monitors the common channel, if a data frame is monitored on the common channel, it indicates that a device uses the common channel, and an AP BSS (Access Point Base Service Set, basic Service Set Access Point) may exist on the common channel; sending a probe request message on the common channel; if there is an AP BSS on the common channel, the AP BSS returns a probe response message. Correspondingly, after the wifi module of the electronic home device receives the probe response message returned through the general channel, it may be determined that an AP BSS exists on the general channel, which indicates that an available network is scanned on the general channel.
In addition, if the transmitted data frame is not monitored on the general channel after the preset monitoring time (probe Delay) is reached in the process that the wifi module of the electronic home device monitors the general channel, it may be determined that the general channel is an idle channel, an available network is not scanned on the general channel, and the wifi module of the electronic home device monitors the next general channel.
For example, a plurality of common channels in the channels supported by the wifi module are channels 1-11; firstly, a wifi module of the electronic home equipment monitors a channel 1, judges whether a transmitted data frame exists on the channel 1, if the data frame is monitored on the channel 1, sends a detection request message on the channel 1, receives a detection response message through the channel 1, and determines that an available network is scanned on the channel 1; the wifi module of the electronic home device monitors the channel 2, judges whether a transmitted data frame exists on the channel 2, and determines that no available network is scanned on the channel 2 if the data frame is not monitored after the probe Delay arrives during the monitoring time. And so on until it is determined whether an available network is scanned on channel 11.
After the electronic home equipment scans the available network in an active scanning mode, the electronic home equipment also needs to acquire network configuration information of the available network;
in implementation, the electronic home device may obtain the network configuration information of the available network according to the following manner:
and the electronic home equipment acquires the network configuration information of the available network scanned on the general channel from the received detection response message.
Case 2, the electronic home device scans an available network by using a passive scanning mode on a non-universal channel in channels supported by a wifi module;
the following describes in detail a manner in which the electronic home device performs active scanning on the common channel in the embodiment of the present invention.
An optional implementation manner is that the electronic home equipment monitors each non-universal channel; after listening to beacon frames on the non-generic channels, it is determined that available networks are scanned on the generic channels.
Aiming at a plurality of non-universal channels in the channels supported by the wifi module, the wifi module of the electronic home equipment sequentially monitors the plurality of non-universal channels;
in the passive scanning process, the wifi module of the electronic home device can monitor a plurality of non-universal channels in sequence according to the size sequence of the channel index values, or the wifi module of the electronic home device can randomly monitor a plurality of non-universal channels in sequence.
It should be noted that, when passive scanning is adopted, when a wifi module of the electronic home device monitors a non-universal channel, if a beacon frame is monitored through the non-universal channel, it is determined that an available network is scanned on the non-universal channel; the wifi module of the electronic home equipment only receives beacon frames of the router and does not actively send signals. In the scanning mode, the electronic home equipment does not send any frame, so that the power consumption of the electronic home equipment can be reduced.
In addition, if the beacon frame is not monitored on the non-universal channel after the preset monitoring time is up in the process that the wifi module of the electronic home equipment monitors the non-universal channel, it can be determined that the non-universal channel is an idle channel, no available network is scanned on the universal channel, and the wifi module of the electronic home equipment monitors the next non-universal channel.
For example, the plurality of non-common channels among the channels supported by the wifi module are channel 12, channel 13, and channel 14; firstly, monitoring a channel 12 by a wifi module of the electronic home equipment, and if a beacon frame is monitored on the channel 12, determining that an available network is scanned on the channel 12; a wifi module of the electronic home equipment monitors the channel 13, and if no beacon frame is monitored after the monitoring duration is reached, it is determined that no available network is scanned on the channel 13; the wifi module of the electronic home device monitors the channel 14, and if a beacon frame is monitored on the channel 14, it is determined that an available network is scanned on the channel 14.
After the electronic home equipment scans the available network in a passive scanning mode, the network configuration information of the available network is required to be acquired;
in implementation, the electronic home device may obtain the network configuration information of the available network according to the following manner:
and the electronic home equipment acquires BSS information from the monitored beacon frame and acquires network configuration information of the available network scanned on the non-universal channel from the BSS information.
After scanning at least one available network by the electronic home equipment in an active scanning and passive scanning mode, sending network configuration information of the scanned at least one available network to the mobile terminal;
after receiving the network configuration information of at least one available network sent by the electronic home equipment, the mobile terminal selects a target network to which the electronic home equipment needs to access from the at least one available network.
In implementation, the mobile terminal presents at least one available network to the user, and the mobile terminal takes the network selected by the user from the at least one available network as a target network in response to the operation of selecting the network by the user.
Specifically, after the mobile terminal receives at least one available candidate network, the SSIDs of all available networks and icons for indicating signal strength are displayed to the user in a display interface of the mobile terminal. As shown in fig. 7, the mobile terminal displays the received identifier of the router and an icon representing the signal strength to the user in the display interface. The user performs an operation of selecting a network in the display interface shown in fig. 7, specifically, the SSID of the network to be selected is clicked in the display interface, and the network corresponding to the SSID selected by the user is taken as the target network.
In an actual process, if the SSIDs of the available networks sent to the mobile terminal by the electronic home device do not include the SSID of the network that the user wants to select, the user can select to rescan in the display interface of the mobile terminal, the mobile terminal will resend the scanning instruction to the electronic home device through the TCP link, the electronic home device resends the network scanning according to the scanning instruction again, and sends the scanning result to the mobile terminal through the TCP link.
After the user selects the target network on the display interface of the mobile terminal, the mobile terminal enters the display interface for obtaining password according to the operation of the user selecting the network, as shown in fig. 8, and password is verification information required when the user selects the target network.
After the mobile terminal acquires the password corresponding to the target network input by the user on the display interface of the password, the SSID corresponding to the target network is combined with the password to obtain the access information of the target network comprising the SSID corresponding to the target network and the password, and the access information of the target network is sent to the electronic home equipment through the TCP channel.
And the electronic home equipment accesses the target network according to the access information after receiving the access information of the target network sent by the mobile terminal.
In specific implementation, if the electronic home equipment is successfully accessed to the target network, after the distribution network completion message is sent to the mobile terminal through the TCP link, the mobile terminal disconnects the SoftAP hotspot of the wifi module of the electronic home equipment.
As shown in fig. 9, a complete flowchart of a network distribution method for electronic home devices in an embodiment of the present invention includes:
in step S901, the electronic home device is started, and the wifi module is powered on to enter a distribution network state;
in step S902, the electronic home device sets a channel parameter of a SoftAP hotspot, and starts the SoftAP hotspot of the wifi module;
wherein, the SoftAP hotspot of the wifi module can be configured as channel 6;
in step S903, in response to a user operation, the mobile terminal enters a network distribution state, and scans SoftAP hotspots of electronic home devices to be distributed around;
in step S904, the mobile terminal filters the SoftAP hotspot of the specific rule from the scanning result;
in step S905, the mobile terminal establishes a connection with the electronic home device corresponding to the SoftAP hotspot of the specific rule;
in step S906, the mobile terminal initiates a TCP connection request to the electronic home device;
in step S907, the electronic home equipment establishes a TCP connection with the mobile terminal after receiving the TCP connection request;
in step S908, the mobile terminal sends a scanning instruction to the electronic home device through TCP connection;
in step S909, the electronic home device scans an available network using an active scanning mode on a general channel in the channels supported by the wifi module, and scans an available network using a passive scanning mode on a non-general channel in the channels supported by the wifi module;
in step S910, the electronic home device sends the scanned configuration information of the available network to the mobile terminal through a TCP connection;
in step S911, the mobile terminal selects a target network from at least one available network, and determines access information of the target network;
in step S912, the mobile terminal sends the access information of the target network to the electronic home device;
in step S913, the electronic home device accesses the target network according to the access information of the target network;
in step S914, the electronic home device sends a distribution network completion message to the mobile terminal;
in step S915, the mobile terminal disconnects the SoftAP hotspot, and it is determined that the distribution of the electronic home devices is completed.
As shown in fig. 10, which is a flowchart of a network distribution method for electronic home devices provided in an embodiment of the present invention, the method may include the following steps:
step S1001: the method comprises the steps that electronic home equipment receives a scanning instruction which is sent by a mobile terminal and indicates that available networks are scanned;
step S1002: the electronic home equipment scans available networks by using different scanning modes on channels supported by the wifi module and acquires network configuration information of at least one scanned available network;
step S1003: the electronic home equipment sends the scanned network configuration information of the at least one available network to the mobile terminal, so that the mobile terminal selects a target network to which the electronic home equipment needs to access from the at least one available network.
An optional implementation manner is that the electronic home device scans available networks using different scanning modes on supported channels, including:
the electronic home equipment scans available networks on a general channel in channels supported by the wifi module in an active scanning mode; and
the electronic home equipment scans available networks by using a passive scanning mode on a non-universal channel in channels supported by the wifi module.
An optional implementation manner is that, the electronic home device scans an available network using an active scanning manner on a general channel in channels supported by a wifi module, including:
the electronic home equipment monitors the general channel;
if the data frame transmission is determined to exist on the general channel, the electronic home equipment sends a detection request message on the general channel;
and after receiving the probe response message returned by the general channel, the electronic home equipment determines that the available network is scanned on the general channel.
An optional implementation manner is that the electronic home device obtains network configuration information of an available network according to the following manner, including:
and the electronic home equipment acquires the network configuration information of the available network scanned on the general channel from the received detection response message.
An optional implementation manner is that, the electronic home device scans available networks using a passive scanning manner on a non-general channel in channels supported by a wifi module, including:
the electronic home equipment monitors each non-universal channel;
after the electronic home equipment monitors beacon frames on a non-universal channel, determining that available networks are scanned on the universal channel.
An optional implementation manner is that the electronic home device obtains network configuration information of an available network according to the following manner, including:
and the electronic home equipment acquires BSS information from the monitored beacon frame and acquires the network configuration information of the available network scanned on the non-universal channel from the BSS information.
Based on the same inventive concept, an embodiment of the present invention provides an electronic home device, as shown in fig. 11, including at least one processor 1101 and a wifi module 1102.
The wifi module 1102 is configured to receive a scanning instruction which is sent by a mobile terminal and indicates that available networks are scanned, and send network configuration information of at least one scanned available network to the mobile terminal, so that the mobile terminal selects a target network to which the electronic home equipment needs to access from the at least one available network;
the processor 1101 is configured to scan available networks on channels supported by the wifi module 1102 using different scanning manners, and obtain network configuration information of at least one scanned available network.
In particular, the processor 1101 is configured to:
scanning an available network by using an active scanning mode on a general channel in channels supported by the wifi module 1102; and
available networks are scanned using a passive scanning approach on non-generic ones of the channels supported by the wifi module 1102.
In an optional embodiment, the processor 1101 is configured to generate a probe request message for transmission on the general channel if it is determined that there is a data frame transmission on the general channel; after receiving a detection response message returned by the wifi module 1102 through the general channel, determining that an available network is scanned on the general channel;
the wifi module 1102 is configured to listen to the common channel; and receiving a probe response message returned through a general channel, and transmitting the received probe response message to the processor.
In particular, the processor 1101 is configured to:
and acquiring the network configuration information of the scanned available network on the general channel from the received probe response message.
In an optional embodiment, the wifi module 1102 is configured to listen to each non-common channel;
the processor 1101 is configured to determine that an available network is scanned on a non-generic channel after listening for beacon frames on the generic channel.
In particular, the processor 1101 is configured to:
and acquiring BSS information from the monitored beacon frame, and acquiring network configuration information of the available network scanned on the non-general channel from the BSS information.
Based on the same inventive concept, an embodiment of the present invention provides a network distribution apparatus of an electronic home device, as shown in fig. 12, including a receiving module 1201, a scanning module 1202, and a sending module 1203;
the receiving module 1201 is configured to receive a scanning instruction, which is sent by the mobile terminal and indicates to scan an available network;
the scanning module 1202 is configured to scan available networks in different scanning manners on channels supported by the wifi module, and acquire network configuration information of at least one scanned available network;
the sending module 1203 is configured to send the scanned network configuration information of the at least one available network to the mobile terminal, so that the mobile terminal selects a target network that the electronic home device needs to access from the at least one available network.
In an optional implementation manner, the scanning module 1202 is specifically configured to:
scanning an available network by using an active scanning mode on a general channel in channels supported by a wifi module; and
and scanning available networks on non-general channels in the channels supported by the wifi module in a passive scanning mode.
In an optional implementation manner, the scanning module 1202 is specifically configured to:
monitoring the general channel;
if the data frame transmission is determined on the general channel, sending a detection request message on the general channel;
determining that an available network is scanned on the common channel upon receiving a probe response message returned over the common channel.
In an optional implementation manner, the scanning module 1202 is specifically configured to:
and acquiring the network configuration information of the scanned available network on the general channel from the received probe response message.
In an optional implementation manner, the scanning module 1202 is specifically configured to:
monitoring each non-universal channel;
after listening to beacon frames on a non-generic channel, determining that an available network is scanned on the generic channel.
In an optional implementation manner, the scanning module 1202 is specifically configured to:
and acquiring BSS information from the monitored beacon frame, and acquiring network configuration information of the available network scanned on the non-general channel from the BSS information.
The embodiment of the invention also provides a computer storage medium, wherein the computer storage medium stores computer program instructions, and when the instructions run on a computer, the computer is enabled to execute the steps of the network distribution method of the electronic home equipment.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.