A device networking method and apparatus
Patent Information
- Application Number
- CN202111148962.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-29
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2041-09-29
AI Technical Summary
[0004]然而,发明人研究发现,物联设备在softap入网模式下有可能连接不是提供配置数据的智能终端,而且此时物联设备还会终止sniffer入网模式,导致两种模式下都不会成功接入网络,降低联网成功率
[0043] The device networking method provided by the present invention, in response to a networking command, enables sniffer network entry mode and softap network entry mode. When the softap network entry mode is locked before the sniffer network entry mode, the specified channel used by the softap network entry mode is used as the target channel. The channel of the sniffer network entry mode is switched to the target channel and channel polling is stopped. Then, sniffer configuration data corresponding to the sniffer network entry mode and softap configuration data corresponding to the softap network entry mode are received through the target channel. Finally, the network is connected according to the sniffer configuration data or the softap configuration data.
Smart Images

Figure CN115884214B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of Internet of Things (IoT) technology, and particularly relates to a device networking method and apparatus. Background Technology
[0002] With the continuous development of IoT technology, more and more IoT devices are equipped with the ability to connect to WiFi networks, which makes the construction and application of IoT networks simpler and greatly improves the user experience when using IoT devices.
[0003] There are generally two modes for IoT devices to connect to WiFi networks: sniffer mode and softap mode. Each mode has its advantages and disadvantages. For a better user experience, most current IoT devices support both modes simultaneously. In practical applications, sniffer mode requires continuous channel polling to search for router configuration data, while softap mode waits on a fixed channel for connections from smartphones and other smart terminals, receiving configuration data initiated by the smart terminal.
[0004] However, the inventors discovered that IoT devices may connect to smart terminals that do not provide configuration data in the softap network access mode. Moreover, the IoT devices will terminate the sniffer network access mode in this case, resulting in the failure to access the network in either mode, thus reducing the network access success rate. Summary of the Invention
[0005] In view of this, the purpose of this invention is to provide a device networking method and apparatus. When the softap network entry mode is locked before the sniffer network entry mode, the sniffer network entry mode and the softap network entry mode can share the designated channel used by the softap network entry mode to receive configuration data, without terminating the sniffer network entry mode. This helps to increase the probability of successful network connection for IoT devices. The specific solution is as follows:
[0006] In a first aspect, the present invention provides a device networking method, comprising:
[0007] Responding to network access commands, enable sniffer network access mode and softap network access mode;
[0008] If the softap network entry mode is locked before the sniffer network entry mode, the specified channel used by the softap network entry mode is used as the target channel.
[0009] Switch the sniffer network entry mode channel to the target channel and stop channel polling;
[0010] The target channel receives sniffer configuration data corresponding to the sniffer network entry mode and softap configuration data corresponding to the softap network entry mode.
[0011] Connect to the network based on the sniffer configuration data or the softap configuration data.
[0012] Optionally, before receiving the sniffer configuration data corresponding to the sniffer network entry mode and the softap configuration data corresponding to the softap network entry mode through the target channel, the method further includes:
[0013] If the sniffer network entry mode is locked before the softap network entry mode, determine whether the channel used when the sniffer network entry mode is locked is the same as the specified channel of the softap network entry mode.
[0014] If the channel used when locking the sniffer network entry mode is the same as the designated channel of the softap network entry mode, the channel used when locking the sniffer network entry mode will be used as the target channel.
[0015] Optionally, the device networking method provided in the first aspect of the present invention further includes:
[0016] If the channel used when locking the sniffer network entry mode is different from the specified channel of the softap network entry mode, the sniffer configuration data corresponding to the sniffer network entry mode is received through the channel used when locking the sniffer network entry mode.
[0017] Configure the data connection network according to the sniffer.
[0018] Optionally, connecting to the network based on the sniffer configuration data or the softap configuration data includes:
[0019] The target configuration data is determined based on the order in which the sniffer configuration data and the softap configuration data are received.
[0020] Configure the data connection network according to the target.
[0021] Optionally, determining the target configuration data based on the order in which the sniffer configuration data and the softap configuration data are received completely includes:
[0022] Determine the moment when the sniffer configuration data is fully received to obtain the first reception moment;
[0023] The moment when the softap configuration data is fully received is determined to obtain the second reception moment;
[0024] The configuration data corresponding to the earlier of the first and second reception times is used as the target configuration data.
[0025] Optionally, the process of determining whether the softap network access mode is locked includes:
[0026] Monitor the data frames received on the designated channel of the softap network access mode;
[0027] If a target data frame is received, it is determined that the softap network access mode is locked.
[0028] Optionally, the process of determining whether the sniffer's network entry mode is locked includes:
[0029] Switch channels according to a preset polling cycle and acquire communication data packets for each channel;
[0030] If a target communication data packet is acquired on any channel, the sniffer's network entry mode is locked.
[0031] In a second aspect, the present invention provides a device networking apparatus, comprising:
[0032] The activation unit is used to respond to network commands and enable sniffer network entry mode and softap network entry mode;
[0033] The first determining unit is configured to, if the softap network entry mode is locked before the sniffer network entry mode, use the specified channel used by the softap network entry mode as the target channel.
[0034] The switching unit is used to switch the channel of the sniffer network entry mode to the target channel and stop channel polling;
[0035] The first receiving unit is configured to receive, through the target channel, sniffer configuration data corresponding to the sniffer network entry mode and softap configuration data corresponding to the softap network entry mode;
[0036] The first networking unit is used to connect to the network according to the sniffer configuration data or the softap configuration data.
[0037] Optionally, the device networking apparatus provided in the second aspect of the present invention further includes:
[0038] The judgment unit is used to determine whether the channel used when the sniffer network entry mode is locked is the same as the specified channel of the softap network entry mode if the sniffer network entry mode is locked before the softap network entry mode.
[0039] The second determining unit is used to take the channel used when the sniffer network entry mode is locked as the target channel if the channel used when the sniffer network entry mode is locked is the same as the specified channel of the softap network entry mode.
[0040] Optionally, the device networking apparatus provided in the second aspect of the present invention further includes:
[0041] The first receiving unit is configured to receive sniffer configuration data corresponding to the sniffer network entry mode through the channel used when the sniffer network entry mode is locked, if the channel used when the sniffer network entry mode is locked is different from the specified channel of the softap network entry mode.
[0042] The second networking unit is used to connect to the network according to the sniffer configuration data.
[0043] The device networking method provided by the present invention, in response to a networking command, enables sniffer network entry mode and softap network entry mode. When the softap network entry mode is locked before the sniffer network entry mode, the specified channel used by the softap network entry mode is used as the target channel. The channel of the sniffer network entry mode is switched to the target channel and channel polling is stopped. Then, sniffer configuration data corresponding to the sniffer network entry mode and softap configuration data corresponding to the softap network entry mode are received through the target channel. Finally, the network is connected according to the sniffer configuration data or the softap configuration data.
[0044] Compared with existing technologies, the device networking method provided by this invention, when the softap network entry mode is locked before the sniffer network entry mode, does not terminate the sniffer network entry mode regardless of whether the softap network entry mode is mistakenly interfered with. Instead, the sniffer network entry mode and the softap network entry mode share the designated channel used by the softap network entry mode to receive configuration data. If, in this case, the router to be connected also uses the designated channel used by the softap network entry mode to send configuration data, the terminal device can continue to receive configuration data through the sniffer network entry mode. Even if the softap network entry mode is mistakenly interfered with, the correct configuration data can still be obtained. If the softap network entry mode is connected to a smart terminal that can provide configuration data, then at least one of the sniffer network entry mode and the softap network entry mode can provide the correct configuration data. Therefore, the method provided by this invention can improve the possibility of receiving correct configuration data to a certain extent, which helps to improve the network connection success rate of IoT devices. Attached Figure Description
[0045] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0046] Figure 1 This is a flowchart of a device networking method provided in an embodiment of the present invention;
[0047] Figure 2 This is a flowchart of another device networking method provided in an embodiment of the present invention;
[0048] Figure 3 This is a structural block diagram of a device networking apparatus provided in an embodiment of the present invention;
[0049] Figure 4 This is a structural block diagram of another device networking device provided in an embodiment of the present invention;
[0050] Figure 5 This is a structural block diagram of another device networking device provided in an embodiment of the present invention. Detailed Implementation
[0051] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0052] The device networking method provided by this invention can be applied to terminal devices that are connected to Internet of Things (IoT) networks, such as WiFi networks. In practical applications, the terminal devices can be home appliances such as smart refrigerators, smart air conditioners, and smart TVs, or related equipment used in industrial production. In subsequent embodiments, these terminal devices will be defined as IoT devices.
[0053] See Figure 1 , Figure 1 This is a flowchart of a device networking method provided in an embodiment of the present invention. The flowchart of the device networking control method provided in an embodiment of the present invention may include:
[0054] S100 responds to network access commands and enables sniffer network access mode and softap network access mode.
[0055] In practical applications, different IoT devices obtain network commands in different ways. It can be through the user's touch operation of the corresponding preset function keys on the display screen, or through the user's click operation of the physical keys based on the operation prompts. Of course, it can also be automatically generated under specific circumstances based on the preset control program. This invention does not limit the specific process of obtaining network commands and can be implemented based on existing technologies.
[0056] After receiving the network connection command, the IoT device simultaneously activates both the sniffer network access mode and the softap network access mode.
[0057] As is known from the basic principle of the sniffer network entry mode, since IoT devices do not know the channel used by the router to send configuration data, they need to continuously poll different channels and stay on each channel for a period of time to determine whether the router should use that channel to send configuration data. Therefore, when applying the networking method provided in this embodiment of the invention, it is also necessary to pre-set the dwell time of the IoT device on each channel. After the dwell time reaches a preset timeout threshold, it switches to the next channel, and so on, continuously polling the channels. The setting of the timeout threshold and the specific implementation method of channel polling can be implemented with reference to existing technologies, and will not be detailed here.
[0058] Furthermore, IoT devices in softAP network access mode will activate an open WiFi AP hotspot on a preset designated channel. For example, in practical applications, channel 6 is one of the most commonly used channels for routers, and its frequency band does not overlap with other channel bands. Therefore, channel 6 can be used as the designated channel for IoT devices in softAP network access mode. After the IoT device activates an open WiFi AP hotspot on the designated signal, all smart terminals within the range of that hotspot (in this invention, this specifically refers to terminal devices capable of connecting to WiFi AP hotspots, such as smartphones) can establish a communication connection with the hotspot and then transmit communication data to the IoT device.
[0059] It can be inferred that because all smart terminals within the WiFi AP hotspot range of IoT devices can connect to the hotspot, it is possible that smart terminals that are not providing configuration data may connect to the hotspot, thereby interrupting the normal configuration data transmission process. This situation is known as softAP false interference.
[0060] As for the process of opening an open WiFi AP hotspot and establishing a communication connection with a smart terminal mentioned above, it can be achieved based on existing technologies, and will not be described in detail here.
[0061] S110. Determine whether the softap network entry mode is locked before the sniffer network entry mode. If so, execute S120.
[0062] It should be noted that the network access mode locking mentioned in the various embodiments of the present invention refers to the IoT device starting to receive configuration data in the corresponding network access mode. When both sniffer network access mode and softap network access mode are enabled simultaneously, it is possible that either network access mode will lock first. This embodiment focuses on the case where the softap network access mode locks before the sniffer network access mode. The case where the sniffer network access mode locks before the softap network access mode will be discussed in other embodiments.
[0063] In practical applications, IoT devices operating in softAP network access mode transmit data based on TCP or UDP protocols. Therefore, to determine whether the softAP network access mode is locked, the data frames received on the designated channel of the softAP network access mode can be monitored. If the target data frame is received, the softAP network access mode is determined to be locked. Based on the data transmission settings of the aforementioned communication protocol, the 802.11 WiFi AUTH frame can be used as the target data frame.
[0064] Furthermore, IoT devices operating in sniffer network entry mode communicate with routers via broadcast or multicast data packets. Therefore, to determine whether the sniffer network entry mode is locked, the channel can be switched according to a preset polling cycle. When staying on any channel, the communication data packets of that channel can be obtained. If the target communication data packet, i.e., the data packet containing configuration data, is obtained on any channel, it can be determined that the sniffer network entry mode is locked.
[0065] S120. Use the specified channel used in the softap network access mode as the target channel.
[0066] When the softap network entry mode is locked before the sniffer network entry mode, the designated signal used by the softap network entry mode, such as channel 6 mentioned above, can be used as the target channel.
[0067] S130, Switch the sniffer network entry mode channel to the target channel and stop channel polling.
[0068] If the sniffer network entry mode is also currently using the target channel, then channel polling is stopped and the current channel is maintained; if the sniffer network entry mode is not currently using the target signal, then the channel of the sniffer network entry mode is switched to the target channel and channel polling is stopped. At this point, both the sniffer network entry mode and the softap network entry mode are working on the target channel. Of course, the two are specifically using time-division multiplexing to achieve channel sharing.
[0069] S140: Receive sniffer configuration data corresponding to the sniffer network entry mode and softap configuration data corresponding to the softap network entry mode through the target channel.
[0070] Since the aforementioned steps only stop channel polling in the sniffer network entry mode and do not stop receiving configuration data, it is possible to receive both the softap configuration data corresponding to the softap network entry mode and the sniffer configuration data corresponding to the sniffer network entry mode through the target channel.
[0071] It should be noted that the softap configuration data and sniffer configuration data mentioned in this embodiment include the same substantive information: information required for IoT devices to connect to the router, such as the router's name and password. Of course, they may also include other information related to IoT devices joining the network. Since the two receive configuration data in different ways, for ease of description, the configuration data received in sniffer network entry mode is defined as sniffer configuration data, and correspondingly, the configuration data received in softap network entry mode is defined as softap configuration data.
[0072] It should also be noted that, as mentioned above, the actual channel used by the router to be connected is uncertain. The router may not be using the target channel determined in the previous steps. In this case, even if the sniffer network entry mode is working on the target channel, it will still be unable to receive the sniffer configuration data. In other words, if the router happens to be using the target channel, then since the sniffer network entry mode is still in the data receiving mode, it can successfully receive the sniffer configuration data. Compared with existing technologies, this can still improve the probability of successful network connection to a certain extent.
[0073] S150: Connect to the network based on sniffer configuration data or softap configuration data.
[0074] As mentioned earlier, the reception of configuration data can be divided into the following situations:
[0075] When the router uses the target channel, if the correct smart terminal is also connected in the softap network entry mode, both the sniffer network entry mode and the softap network entry mode can receive valid configuration data; if the softap network entry mode is connected to an invalid smart terminal, the sniffer network entry mode can receive valid configuration data.
[0076] If the router is not using the target channel, and the softap network entry mode connects to the correct smart terminal, it can receive valid configuration data. However, if the softap network entry mode connects to an invalid smart terminal, it cannot receive valid configuration data. Furthermore, because the router is not using the target channel, the sniffer network entry mode will also be unable to receive valid configuration data on the target channel, resulting in a failed network connection.
[0077] Once the sniffer configuration data or softap configuration data is obtained, the IoT terminal can connect to the network according to the obtained configuration data.
[0078] When both sniffer configuration data and softap configuration data are received simultaneously, the target configuration data is determined based on the order in which the sniffer configuration data and softap configuration data are received. Specifically, the moment when the sniffer configuration data is received is determined to obtain the first reception moment, and the moment when the softap configuration data is received is determined to obtain the second reception moment. The configuration data corresponding to the earlier reception moment is taken as the target configuration data, and the network is finally connected based on the target configuration data.
[0079] In summary, compared with existing technologies, the device networking method provided by this invention, when the softap network entry mode is locked before the sniffer network entry mode, does not terminate the sniffer network entry mode regardless of whether the softap network entry mode is mistakenly interfered with. Instead, it shares the designated channel used by the softap network entry mode with both the sniffer and softap network entry modes to receive configuration data. If, in this case, the router to be connected also uses the designated channel used by the softap network entry mode to send configuration data, the terminal device can continue to receive configuration data through the sniffer network entry mode. Even if the softap network entry mode is mistakenly interfered with, it can still obtain correct configuration data. If the softap network entry mode is connected to a smart terminal that can provide configuration data, then at least one of the sniffer and softap network entry modes can provide correct configuration data. Therefore, the method provided by this invention can, to a certain extent, increase the probability of receiving correct configuration data and help improve the network connection success rate of IoT devices.
[0080] Optional, see Figure 2 , Figure 2 This is a flowchart of another device networking method provided by an embodiment of the present invention. Figure 1 Based on the illustrated embodiment, the device networking method provided in this embodiment further includes:
[0081] S160. Determine whether the sniffer network entry mode is locked before the softap network entry mode. If so, execute S170.
[0082] In practical applications, the probability of both sniffer network entry mode and softap network entry mode being locked at the same time is very low. In S110, if it is not determined that softap network entry mode is locked before sniffer network entry mode, then it is determined whether sniffer network entry mode is locked before softap network entry mode. If yes, then proceed to S170. If no, it means that neither is locked and you can continue to wait.
[0083] For the method of locking the various network access modes in this step, please refer to... Figure 1 The details of S110 in the illustrated embodiment will not be repeated here.
[0084] S170. Determine whether the channel used when locking the sniffer network entry mode is the same as the specified channel of the softap network entry mode. If so, execute S180.
[0085] If the sniffer network entry mode is locked before the softap network entry mode, it is further determined whether the channel used when the sniffer network entry mode is locked is the same as the specified channel of the softap network entry mode. As mentioned above, if the channel used when the sniffer network entry mode is locked is the same as the specified channel of the softap network entry mode, then both network entry modes may be able to receive the corresponding configuration data; conversely, if the channel used when the sniffer network entry mode is locked is different from the specified channel of the softap network entry mode, the softap network entry mode will not be able to receive the configuration data.
[0086] S180, Use the channel used when locking the sniffer network entry mode as the target channel.
[0087] If the channel used when locking the sniffer network entry mode is the same as the specified channel for the softap network entry mode, the channel used when locking the sniffer network entry mode is used as the target channel, and then the subsequent S140 steps are executed.
[0088] Correspondingly, when the channel used when the sniffer network entry mode is locked is different from the designated channel of the softap network entry mode, the IoT device can only receive the sniffer configuration data corresponding to the sniffer network entry mode through the channel used when the sniffer network entry mode is locked, and connect to the network according to the sniffer configuration data.
[0089] In summary, the embodiments of the present invention in Figure 1 Based on the illustrated embodiment, a method is provided for enabling IoT devices to connect to the network when the sniffer network entry mode is locked before the softap network entry mode. When the sniffer network entry mode is locked, the softap network entry mode is not disabled, and softap configuration data reception continues if permitted. Compared with existing technologies, this increases the likelihood of IoT devices obtaining valid configuration data, thus improving the network entry success rate. Figure 1 Compared to the illustrated embodiment, this method covers situations where the sniffer network entry mode is locked before the softap network entry mode, thus having a wider range of applications and a higher network connection success rate.
[0090] The device networking apparatus provided in the embodiments of the present invention will be described below. The device networking apparatus described below can be considered as the functional module architecture that needs to be set in the central device to implement the device networking method provided in the embodiments of the present invention; the description below can be referred to in conjunction with the above.
[0091] Optional, see Figure 3 , Figure 3 This is a structural block diagram of a device networking apparatus provided in an embodiment of the present invention. The device networking apparatus provided in this embodiment includes:
[0092] Unit 10 is enabled to respond to network commands and enable sniffer network entry mode and softap network entry mode.
[0093] The first determining unit 20 is used to determine the specified channel used by the softap network entry mode as the target channel if the softap network entry mode is locked before the sniffer network entry mode.
[0094] The switching unit 30 is used to switch the channel of the sniffer network entry mode to the target channel and stop channel polling;
[0095] The first receiving unit 40 is used to receive sniffer configuration data corresponding to the sniffer network entry mode and softap configuration data corresponding to the softap network entry mode through the target channel.
[0096] The first networking unit 50 is used to connect to the network based on sniffer configuration data or softap configuration data.
[0097] Optionally, the first networking unit 50, used to connect to the network according to sniffer configuration data or softap configuration data, includes:
[0098] The target configuration data is determined based on the order in which the sniffer configuration data and softap configuration data are received.
[0099] Connect to the network according to the target configuration data.
[0100] Optionally, the first networking unit 50 is used to determine the target configuration data based on the order in which the sniffer configuration data and softap configuration data are received, including:
[0101] Determine the moment when the complete sniffer configuration data is received to obtain the first reception moment;
[0102] Determine the moment when the complete softap configuration data is received to obtain the second reception moment;
[0103] The configuration data corresponding to the earlier of the first and second reception times is used as the target configuration data.
[0104] Optionally, the first determining unit 20 is used to determine whether the softap network access mode is locked, including:
[0105] Monitor the data frames received on the designated channel in the softap network access mode;
[0106] If the target data frame is received, it is determined that the softap network access mode is locked.
[0107] Optionally, the first determining unit 20 is used to determine whether the sniffer's network entry mode is locked, including:
[0108] Switch channels according to a preset polling cycle and acquire communication data packets for each channel;
[0109] If a target communication data packet is acquired on any channel, the sniffer's network entry mode is locked.
[0110] Optional, see Figure 4 , Figure 4 This is a structural block diagram of another device networking device provided in an embodiment of the present invention. Figure 3 Based on the illustrated embodiment, the apparatus provided in this embodiment further includes:
[0111] The judgment unit 60 is used to determine whether the channel used when the sniffer network entry mode is locked is the same as the specified channel of the softap network entry mode if the sniffer network entry mode is locked before the softap network entry mode.
[0112] The second determining unit 70 is used to determine the target channel if the channel used when the sniffer enters the network mode is locked is the same as the specified channel of the softap enters the network mode.
[0113] Optional, see Figure 5 , Figure 5 This is a structural block diagram of another device networking device provided in an embodiment of the present invention. Figure 4 Based on the illustrated embodiment, the apparatus provided in this embodiment further includes:
[0114] The first receiving unit 80 is used to receive sniffer configuration data corresponding to the sniffer network entry mode through the channel used when the sniffer network entry mode is locked, if the channel used when the sniffer network entry mode is locked is different from the specified channel of the softap network entry mode.
[0115] The second networking unit 90 is used to connect to the network according to the sniffer configuration data.
[0116] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.
[0117] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0118] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0119] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the core spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for networking devices, characterized in that, include: In response to network access commands, both sniffer network access mode and softap network access mode are enabled simultaneously; If the softap network entry mode is locked before the sniffer network entry mode, the specified channel used by the softap network entry mode is used as the target channel. Switch the channel of the sniffer network entry mode to the target channel and stop channel polling so that both the sniffer network entry mode and the softap network entry mode work on the target channel; The target channel receives sniffer configuration data corresponding to the sniffer network entry mode and softap configuration data corresponding to the softap network entry mode. Connect to the network based on the sniffer configuration data or the softap configuration data.
2. The device networking method according to claim 1, characterized in that, Before receiving the sniffer configuration data corresponding to the sniffer network entry mode and the softap configuration data corresponding to the softap network entry mode through the target channel, the method further includes: If the sniffer network entry mode is locked before the softap network entry mode, determine whether the channel used when the sniffer network entry mode is locked is the same as the specified channel of the softap network entry mode. If the channel used when locking the sniffer network entry mode is the same as the designated channel of the softap network entry mode, the channel used when locking the sniffer network entry mode will be used as the target channel.
3. The device networking method according to claim 2, characterized in that, Also includes: If the channel used when locking the sniffer network entry mode is different from the specified channel of the softap network entry mode, the sniffer configuration data corresponding to the sniffer network entry mode is received through the channel used when locking the sniffer network entry mode. Configure the data connection network according to the sniffer.
4. The device networking method according to claim 1, characterized in that, The step of connecting to the network based on the sniffer configuration data or the softap configuration data includes: The target configuration data is determined based on the order in which the sniffer configuration data and the softap configuration data are received. Configure the data connection network according to the target.
5. The device networking method according to claim 4, characterized in that, The step of determining the target configuration data based on the order in which the sniffer configuration data and the softap configuration data are received completely includes: Determine the moment when the sniffer configuration data is fully received to obtain the first reception moment; The moment when the softap configuration data is fully received is determined to obtain the second reception moment; The configuration data corresponding to the earlier of the first and second reception times is used as the target configuration data.
6. The device networking method according to any one of claims 1-5, characterized in that, The process of determining whether the softap network access mode is locked includes: Monitor the data frames received on the designated channel of the softap network access mode; If a target data frame is received, it is determined that the softap network access mode is locked.
7. The device networking method according to any one of claims 1-5, characterized in that, The process of determining whether the sniffer's network entry mode is locked includes: Switch channels according to a preset polling cycle and acquire communication data packets for each channel; If a target communication data packet is acquired on any channel, the sniffer's network entry mode is locked.
8. A device networking apparatus, characterized in that, include: The unit is enabled to respond to network commands and simultaneously enable both sniffer network entry mode and softap network entry mode. The first determining unit is configured to, if the softap network entry mode is locked before the sniffer network entry mode, use the specified channel used by the softap network entry mode as the target channel. The switching unit is used to switch the channel of the sniffer network entry mode to the target channel and stop channel polling, so that both the sniffer network entry mode and the softap network entry mode work on the target channel. The first receiving unit is configured to receive, through the target channel, sniffer configuration data corresponding to the sniffer network entry mode and softap configuration data corresponding to the softap network entry mode; The first networking unit is used to connect to the network according to the sniffer configuration data or the softap configuration data.
9. The device networking apparatus according to claim 8, characterized in that, Also includes: The judgment unit is used to determine whether the channel used when the sniffer network entry mode is locked is the same as the specified channel of the softap network entry mode if the sniffer network entry mode is locked before the softap network entry mode. The second determining unit is used to take the channel used when the sniffer network entry mode is locked as the target channel if the channel used when the sniffer network entry mode is locked is the same as the specified channel of the softap network entry mode.
10. The device networking apparatus according to claim 9, characterized in that, Also includes: The first receiving unit is configured to receive sniffer configuration data corresponding to the sniffer network entry mode through the channel used when the sniffer network entry mode is locked, if the channel used when the sniffer network entry mode is locked is different from the designated channel for the softap network entry mode. The second networking unit is used to connect to the network according to the sniffer configuration data.
Citation Information
Patent Citations
Method and equipment for transmitting and collecting equipment identification information
CN108377533A
Equipment network access method and device, computer readable storage medium and electronic device
CN111885563A