Network configuration method and device of internet of things equipment, and electronic equipment
By broadcasting BLE beacon frames through the WiFi gateway, IoT devices select the optimal gateway for Bluetooth connection, receive WiFi credential information, and register. This solves the problems of complex manual credential input and multi-device conflicts in existing technologies, achieving seamless network configuration and improving network configuration efficiency and security.
Patent Information
- Application Number
- CN202511587545.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-03
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2045-11-03
AI Technical Summary
Existing IoT device configuration technologies require users to manually enter credentials, resulting in complex interaction processes. Furthermore, they suffer from high conflict rates and low efficiency when multiple devices are running concurrently, making it particularly difficult to achieve seamless configuration in smart home scenarios.
By broadcasting BLE beacon frames through the WiFi gateway, IoT devices select the optimal gateway, connect via Bluetooth, receive WiFi credential information, and register through the cloud, achieving seamless network configuration without user intervention.
It achieves seamless network configuration, improves network configuration efficiency and success rate, reduces the complexity of user interaction, and enhances the convenience and security of smart home devices.
Smart Images

Figure CN121037945B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of Internet of Things (IoT) distribution network technology, specifically relating to a distribution network method and apparatus for IoT devices, and electronic equipment. Background Technology
[0002] Currently, IoT devices typically connect to gateways via WiFi Direct or Bluetooth-assisted configuration. Traditional WiFi configuration requires users to manually enter the SSID and password, resulting in a complex interaction process. While existing Bluetooth-assisted solutions simplify credential transmission, they still require devices to actively broadcast requests or rely on mobile apps for relaying, leading to issues such as high configuration latency and conflicts between multiple devices. Especially in smart home scenarios, when multiple smart sensors (such as thermometers, hygrometers, and door / window sensors) need to be connected to a WiFi gateway in batches, current technologies struggle to achieve seamless configuration without user intervention. Summary of the Invention
[0003] The purpose of this application is to provide a network distribution method and apparatus for Internet of Things (IoT) devices, which can solve the problem of seamless network distribution.
[0004] To solve the above-mentioned technical problems, this application is implemented as follows:
[0005] In a first aspect, embodiments of this application provide a network configuration method for IoT devices, the method comprising:
[0006] During the process of the WiFi gateway broadcasting BLE beacon frames, if the IoT device to be configured scans one or more BLE beacon frames, the optimal gateway is selected based on the one or more BLE beacon frames.
[0007] Control the optimal gateway to establish a Bluetooth connection with the IoT device to be configured on the network;
[0008] Receive the WiFi credential information of the router sent by the optimal gateway;
[0009] The IoT device to be configured is connected to the router based on the WiFi credentials, and network registration is performed in the cloud through the router.
[0010] Optionally, the step of filtering the optimal gateway based on the one or more BLE beacon frames includes:
[0011] Determine the raw data corresponding to the one or more BLE beacons;
[0012] Based on the raw data, a preliminary candidate gateway list is formed by filtering according to a preset filtering algorithm.
[0013] The gateway evaluation score corresponding to each candidate gateway in the candidate gateway list is determined according to the preset evaluation indicators;
[0014] The optimal gateway is determined from the list of candidate gateways based on the gateway evaluation score.
[0015] Optionally, the step of filtering the original data according to a preset filtering algorithm to form a preliminary candidate gateway list includes:
[0016] Verify whether the network identifier in the original data matches the preset target network;
[0017] When the network identifier in the beacon frame matches the target network, check whether the authentication method in the original data is compatible with the preset protocol version;
[0018] When it is determined that the authentication method is compatible with the preset protocol version, weak signal gateways with signal strength below the minimum connection threshold in the original data are removed to obtain a preliminary candidate gateway list.
[0019] Optionally, determining the optimal gateway from the candidate gateway list based on the gateway evaluation score includes:
[0020] Based on the gateway evaluation score, sort the multiple candidate gateways in the candidate gateway list by size;
[0021] Based on the descending sequence, determine the top N candidate gateways, where N is a positive integer greater than 1;
[0022] The optimal gateway is determined from the top N candidate gateways.
[0023] Optionally, controlling the optimal gateway to establish a Bluetooth connection with the IoT device to be configured includes:
[0024] Control the optimal gateway to establish an encrypted Bluetooth connection with the IoT device to be configured.
[0025] Optionally, controlling the optimal gateway to establish an encrypted Bluetooth connection with the IoT device to be configured includes:
[0026] The optimal gateway and the IoT device to be configured are controlled to establish a secure channel in the encrypted Bluetooth connection through elliptic curve key exchange and symmetric encryption.
[0027] Optionally, receiving the WiFi credential information of the router sent by the optimal gateway includes:
[0028] Receive the WiFi credential information of the router sent by the optimal gateway encoding fragment.
[0029] Optionally, it also includes:
[0030] When an abnormal WiFi connection is detected, a fine-tuning instruction is first issued through the high-priority BLE emergency channel;
[0031] WiFi connection repair is performed based on the aforementioned fine-tuning instructions.
[0032] Optionally, it also includes:
[0033] If WiFi connection repair fails based on the fine-tuning instructions, the BLE beacon frame is re-authenticated.
[0034] Secondly, embodiments of this application provide a network distribution device for IoT devices, the device comprising:
[0035] The optimal gateway determination module is used to select the optimal gateway based on one or more BLE beacon frames if the IoT device to be configured scans one or more BLE beacon frames during the broadcasting of BLE beacon frames by the WiFi gateway.
[0036] A Bluetooth connectivity module is used to control the optimal gateway to establish a Bluetooth connection with the IoT device to be configured on the network;
[0037] The WiFi credential information receiving module is used to receive the WiFi credential information of the router sent by the optimal gateway;
[0038] The network access module is used to connect the IoT device to be configured with the router based on the WiFi credential information, and to register for network access in the cloud through the router.
[0039] Thirdly, embodiments of this application provide an electronic device including a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the method described in the first aspect.
[0040] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.
[0041] Fifthly, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the method as described in the first aspect.
[0042] In this embodiment, during the broadcasting of BLE beacon frames by the WiFi gateway, if the IoT device to be configured scans one or more BLE beacon frames, the optimal gateway is selected based on the one or more BLE beacon frames; the optimal gateway is controlled to establish a Bluetooth connection with the IoT device to be configured; the WiFi credential information of the router sent by the optimal gateway is received; the IoT device to be configured is connected to the router based on the WiFi credential information; and network registration is performed in the cloud through the router. Seamless network configuration can be achieved without user intervention. Attached Figure Description
[0043] Figure 1 This is a flowchart of the steps of a network distribution method for an Internet of Things (IoT) device implemented in this application;
[0044] Figure 2 This is a flowchart of the steps of another IoT device network configuration method implemented in this application;
[0045] Figure 3 This is a schematic diagram of the structure of a distribution network device for an Internet of Things (IoT) device implemented in this application;
[0046] Figure 4 This is a schematic diagram of an electronic device structure in an embodiment of this application;
[0047] Figure 5 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of this application. Detailed Implementation
[0048] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0049] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0050] Currently, IoT devices typically connect to gateways via WiFi Direct or Bluetooth-assisted configuration. Traditional WiFi configuration requires users to manually enter the SSID and password, resulting in a complex interaction process. While existing Bluetooth-assisted solutions simplify credential transmission, they still require devices to actively broadcast requests or rely on mobile apps for relaying, leading to issues such as high configuration latency and conflicts between multiple devices. Especially in smart home scenarios, when multiple smart sensors (such as thermometers, hygrometers, and door / window sensors) need to be connected to a WiFi gateway in batches, current technologies struggle to achieve seamless configuration without user intervention.
[0051] A home visualization system based on a ZigBee network is disclosed in this practical application, including a signal coverage device, a signal extension device, and smart devices. The signal coverage device is a wireless router; the smart devices support ZigBee networks. This invention achieves efficient communication between smart devices by optimizing the network architecture, possessing the advantages of high data transmission and low power consumption. It also utilizes multiple antennas and WiFi to extend the coverage range, is compatible with a large number of connected devices, and improves the stability and control precision of the smart home system.
[0052] In practical applications, a method and system for configuring smart devices based on Bluetooth Mesh are also disclosed. The method includes: the device to be configured discovers a proxy node in the Mesh network via Bluetooth broadcast; the proxy node forwards the configuration request to the central gateway; the gateway generates a dynamic configuration key and transmits it in fragments to the proxy node, which then completes key negotiation with the device to be configured. This invention utilizes the multi-hop relay characteristics of Mesh networks to solve the problem of limited distance in traditional Bluetooth configuration, while improving security through a dynamic key fragmentation mechanism, making it suitable for large-scale smart home device networking scenarios.
[0053] However, the above technical solutions have the following problems: they rely on a single communication protocol, resulting in poor compatibility with devices from different brands. The network configuration process requires manual user intervention, leading to a choppy user experience. Furthermore, the conflict rate is high and efficiency is low when multiple devices are configuring the network concurrently.
[0054] Current smart home device configuration technologies suffer from significant limitations: the barriers between different communication protocols (such as Wi-Fi, Bluetooth, and ZigBee) force users to perform complex configuration operations for each device individually, severely impacting the user experience. Even with improved solutions like Bluetooth-assisted configuration, the reliance on manual intervention remains, forcing users to manually confirm network selection or enter passwords, further affecting the smart home experience. More seriously, in scenarios involving multiple devices configuring simultaneously, traditional technologies lack effective conflict management mechanisms, often leading to configuration failures or delays; and sacrificing security for convenience exposes the system to security threats such as man-in-the-middle attacks. The root of these problems lies in the current solutions' failure to achieve intelligent collaboration between protocols, their lack of autonomous decision-making capabilities, and the disconnect between security mechanisms and configuration processes, severely restricting the plug-and-play experience and large-scale deployment feasibility of IoT devices.
[0055] In this embodiment of the application, by broadcasting BLE beacon frames on the WiFi gateway, the IoT devices to be configured can achieve seamless network configuration based on the BLE beacon frames, thereby improving network configuration efficiency and enabling multiple devices to perform network configuration simultaneously.
[0056] The network configuration method for IoT devices provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.
[0057] Reference Figure 1 The diagram illustrates a step-by-step flowchart of a network configuration method for an Internet of Things (IoT) device according to an embodiment of this application. The method includes the following steps:
[0058] Step 101: During the process of the WiFi gateway broadcasting BLE beacon frames, if the IoT device to be configured scans one or more BLE beacon frames, the optimal gateway is selected based on the one or more BLE beacon frames.
[0059] In practical applications, network connections can be established between IoT devices to be configured, WiFi gateways, routers, and the cloud. The technical solution in this application embodiment can achieve seamless network configuration through the interaction between the above-mentioned parts.
[0060] The embodiments of this application can be applied to the non-sensory network distribution process of one or more IoT devices to be distributed.
[0061] During the initialization phase, a dual-mode communication protocol stack runs concurrently with the WiFi gateway upon startup. It continuously broadcasts BLE beacon frames containing gateway information at preset intervals (e.g., 200ms). These beacons are encoded using the format of Bluetooth broadcast data packets. The digital fingerprint of the gateway device is extracted by hashing the complete MAC address (e.g., 00:1A:7D:DA:71:13) and extracting the last 4 bytes (e.g., the hash value of DA7113 is 0x3F8B2C). This allows the device to quickly identify known gateways, avoiding redundant processing of the full MAC address (6 bytes) while protecting privacy (by not exposing the real MAC address). Other information includes a unique gateway identifier (the last 4 bytes of the MAC address hash), supported WiFi frequency bands (2.4GHz / 5GHz dual-band identifier), and network load status (number of currently connected devices).
[0062] During the broadcasting of BLE beacon frames by the WiFi gateway, the IoT devices to be networked can scan their surroundings and obtain one or more BLE beacon frames. Each BLE beacon frame represents a WiFi gateway that can be accessed.
[0063] This allows for the selection of the optimal gateway from one or more WiFi gateways to perform the network configuration process for IoT devices.
[0064] In one embodiment of this application, the step of selecting the optimal gateway based on the one or more BLE beacon frames includes the following sub-steps:
[0065] Sub-step S11: Determine the raw data corresponding to the one or more BLE beacons;
[0066] The raw data may include one or more of the following: source MAC address, RSSI signal strength, frame content, etc.
[0067] Sub-step S12: Based on the original data, filter according to a preset filtering algorithm to form a preliminary candidate gateway list;
[0068] The preset filtering algorithm can be an intelligent filtering algorithm.
[0069] Once the IoT devices in the distribution network scan for a beacon, they can automatically select the optimal gateway through an intelligent filtering algorithm. The intelligent filtering algorithm comprehensively considers multiple indicators such as signal strength, network load, and protocol compatibility to ensure that the optimal choice can still be made in complex wireless environments.
[0070] Sub-step S13: Determine the gateway evaluation score corresponding to each candidate gateway in the candidate gateway list according to the preset evaluation indicators;
[0071] Sub-step S14: Determine the optimal gateway from the candidate gateway list based on the gateway evaluation score.
[0072] In one embodiment of this application, sub-step S12 includes: verifying whether the network identifier in the original data matches a preset target network; when the network identifier in the beacon frame matches the target network, checking whether the authentication method in the original data is compatible with a preset protocol version; when it is determined that the authentication method is compatible with the preset protocol version, removing weak signal gateways in the original data whose signal strength is lower than the minimum connection threshold to obtain a preliminary candidate gateway list.
[0073] In one embodiment of this application, determining the optimal gateway in the candidate gateway list according to the gateway evaluation score includes: sorting multiple candidate gateways in the candidate gateway list by size based on the gateway evaluation score; determining the top N candidate gateways according to the descending order, where N is a positive integer greater than 1; and determining the optimal gateway from the top N candidate gateways.
[0074] In practical applications, the process of determining the optimal gateway is as follows:
[0075] After the IoT device to be configured is started, its wireless module enters a continuous listening state, capturing beacon frames periodically broadcast from surrounding gateways, and sending the raw data of each beacon (such as source MAC address, RSSI signal strength, frame content, etc.) to the preprocessing queue of the intelligent filtering algorithm. The algorithm first performs a round of hard filtering: verifying whether the network identifier (such as SSID) in the beacon frame matches the target network, checking whether its authentication method and protocol version are compatible, and eliminating weak signal gateways with signal strength below the minimum connection threshold (such as RSSI < -85 dBm), forming a preliminary candidate gateway list. Next, the core multi-dimensional weighted scoring is initiated, and the algorithm calculates a comprehensive score for each gateway in the list.
[0076] The overall score does not solely rely on RSSI, but rather deeply integrates instantaneous signal quality (assessing signal clarity by calculating signal-to-noise ratio (SNR) to avoid the trap of high RSSI but high interference), real-time load conditions (analyzing fields such as the number of clients carried in the beacon, channel utilization, and even the gateway's own CPU load to predict post-access performance), and historical network performance (if the device supports it, it will refer to indicators such as average round-trip delay, jitter, and packet loss rate calculated based on previous probe packets to select the most stable path). All these indicators are quantified and weighted summed in a preset, dynamically adjustable weight model.
[0077] Ultimately, the algorithm does not simply choose the maximum value, but rather makes a final trade-off among the candidate gateways with the highest scores, selecting the gateway that achieves the optimal balance between connection stability, data throughput, and long-term reliability. This gateway is marked as the "optimal gateway," and a secure two-way authentication and key negotiation process is immediately triggered to establish the final data connection.
[0078] Step 102: Control the optimal gateway to establish a Bluetooth connection with the IoT device to be configured.
[0079] In one embodiment of this application, the optimal gateway can be controlled to establish an encrypted Bluetooth connection with the IoT device to be networked. Specifically, the optimal gateway and the IoT device to be networked are controlled to construct a secure channel in the encrypted Bluetooth connection through elliptic curve key exchange and symmetric encryption.
[0080] Once a suitable gateway is selected, a Bluetooth connection is established. To ensure security, an improved hybrid encryption scheme is employed. This scheme combines elliptic curve key exchange (ECE) with symmetric encryption to construct a secure channel. Specifically, the device and gateway generate a temporary key pair based on the secp256r1 curve, use the HKDF key derivation function to generate a session key, and finally establish an AES-128-CCM encrypted link.
[0081] In practical applications, the establishment of the entire secure channel begins with the generation and exchange of key materials. Each device and gateway independently generates a temporary key pair based on the secp256r1 elliptic curve: the device generates a private key d_device and its corresponding public key Q_device (a point on the curve), and the gateway similarly generates d_gateway and Q_gateway. Subsequently, both parties exchange their public key data via the wireless network. This process is in plaintext, but the crucial private key is always secretly stored locally.
[0082] When a device receives the gateway's public key Q_gateway, it uses its private key d_device to perform elliptic curve scalar multiplication, calculating the shared point S = d_device * Q_gateway. The gateway, upon receiving the device's public key, performs a symmetric calculation S = d_gateway * Q_device. Due to the mathematical properties of elliptic curves, both parties calculate the same point S, and the x-coordinate of this point becomes a shared secret seed. Next, to obtain a usable key, both parties use this shared secret as input to the HKDF key derivation function. HKDF combines an optional salt value with specific contextual information (such as strings identifying the protocol version and purpose), deterministically deriving a fixed-length, cryptographically stronger key from the shared secret, much like "stretching" dough. For the AES-128-CCM algorithm, this ultimately derives the required 128-bit symmetric encryption key and a random number to ensure communication freshness.
[0083] At this point, a secure channel has been established. All subsequent application data communications will be protected by this encrypted link. Before transmission, data is encrypted using a generated AES-128 key and a random number, and a message authentication code is calculated, encapsulated into a data frame conforming to CCM mode. The receiver then uses the same key to decrypt and verify the integrity and authenticity of the data, thus ensuring the confidentiality and tamper-proof nature of the communication.
[0084] Step 103: Receive the WiFi credential information of the router sent by the optimal gateway;
[0085] The WiFi credentials mainly include the router's SSID and password. After the connection is established, the WiFi credentials can be transmitted.
[0086] In one embodiment of this application, receiving the WiFi credential information of the router sent by the optimal gateway includes: receiving the WiFi credential information of the router sent by the optimal gateway in a coded fragment.
[0087] In practical applications, to ensure data transmission security and stability, the WiFi credential transmission process employs fragmented redundancy coding technology. The SSID and password combination data blocks are fragmented using Reed-Solomon coding, ensuring reliable recovery even if some data packets are lost. At the same time, the addition of serial numbers and timestamp mechanisms effectively prevents replay attacks.
[0088] The following example illustrates the fragmentation redundancy coding technique:
[0089] Assuming the Wi-Fi connection information to be transmitted is the SSID "MyHomeWiFi" and password "SecurePass123", they are first combined and encoded into a single data block. To enhance transmission robustness, Reed-Solomon encoding is used for fragmentation redundancy: the original data block is divided into three original data fragments, and two additional redundancy check fragments are generated. Thus, the original information is encoded into a set containing five fragments. During broadcasting, the device continuously transmits these five fragments in turn. The receiving device does not need to capture all five fragments; as long as it successfully receives any three fragments (whether original data fragments or redundancy check fragments), it can use the Reed-Solomon decoding algorithm to completely and accurately recover the original "MyHomeWiFi" and "SecurePass123" information. This method significantly improves the success rate of one-time network configuration in wireless environments with unstable signals or interference.
[0090] Step 104: Connect the IoT device to be configured with the network to the router based on the WiFi credential information, and register for network access in the cloud through the router.
[0091] In this embodiment, during the broadcasting of BLE beacon frames by the WiFi gateway, if the IoT device to be configured scans one or more BLE beacon frames, the optimal gateway is selected based on the one or more BLE beacon frames; the optimal gateway is controlled to establish a Bluetooth connection with the IoT device to be configured; the WiFi credential information of the router sent by the optimal gateway is received; the IoT device to be configured is connected to the router based on the WiFi credential information; and network registration is performed in the cloud through the router. Seamless network configuration can be achieved without user intervention.
[0092] Reference Figure 2 This paper illustrates the steps of another IoT device network configuration method in an embodiment of this application, the method comprising the following steps:
[0093] Step 201: During the process of the WiFi gateway broadcasting BLE beacon frames, if the IoT device to be configured scans one or more BLE beacon frames, the optimal gateway is selected based on the one or more BLE beacon frames.
[0094] With the current network connection, the technical solution in this application embodiment can achieve seamless network distribution through the interaction between the above-mentioned parts.
[0095] The embodiments of this application can be applied to the non-sensory network distribution process of one or more IoT devices to be distributed.
[0096] During the initialization phase, a dual-mode communication protocol stack runs concurrently with the WiFi gateway upon startup. It continuously broadcasts BLE beacon frames containing gateway information at preset intervals (e.g., 200ms). These beacons are encoded using the format of Bluetooth broadcast data packets. The digital fingerprint of the gateway device is extracted by hashing the complete MAC address (e.g., 00:1A:7D:DA:71:13) and extracting the last 4 bytes (e.g., the hash value of DA7113 is 0x3F8B2C). This allows the device to quickly identify known gateways, avoiding redundant processing of the full MAC address (6 bytes) while protecting privacy (by not exposing the real MAC address). Other information includes a unique gateway identifier (the last 4 bytes of the MAC address hash), supported WiFi frequency bands (2.4GHz / 5GHz dual-band identifier), and network load status (number of currently connected devices).
[0097] During the broadcasting of BLE beacon frames by the WiFi gateway, the IoT devices to be networked can scan their surroundings and obtain one or more BLE beacon frames. Each BLE beacon frame represents a WiFi gateway that can be accessed.
[0098] This allows for the selection of the optimal gateway from one or more WiFi gateways to perform the network configuration process for IoT devices.
[0099] In practical applications, the process of determining the optimal gateway is as follows:
[0100] After the IoT device to be configured is started, its wireless module enters a continuous listening state, capturing beacon frames periodically broadcast from surrounding gateways, and sending the raw data of each beacon (such as source MAC address, RSSI signal strength, frame content, etc.) to the preprocessing queue of the intelligent filtering algorithm. The algorithm first performs a round of hard filtering: verifying whether the network identifier (such as SSID) in the beacon frame matches the target network, checking whether its authentication method and protocol version are compatible, and eliminating weak signal gateways with signal strength below the minimum connection threshold (such as RSSI < -85 dBm), forming a preliminary candidate gateway list. Next, the core multi-dimensional weighted scoring is initiated, and the algorithm calculates a comprehensive score for each gateway in the list.
[0101] The overall score does not solely rely on RSSI, but rather deeply integrates instantaneous signal quality (assessing signal clarity by calculating signal-to-noise ratio (SNR) to avoid the trap of high RSSI but high interference), real-time load conditions (analyzing fields such as the number of clients carried in the beacon, channel utilization, and even the gateway's own CPU load to predict post-access performance), and historical network performance (if the device supports it, it will refer to indicators such as average round-trip delay, jitter, and packet loss rate calculated based on previous probe packets to select the most stable path). All these indicators are quantified and weighted summed in a preset, dynamically adjustable weight model.
[0102] Ultimately, the algorithm does not simply choose the maximum value, but rather makes a final trade-off among the candidate gateways with the highest scores, selecting the gateway that achieves the optimal balance between connection stability, data throughput, and long-term reliability. This gateway is marked as the "optimal gateway," and a secure two-way authentication and key negotiation process is immediately triggered to establish the final data connection.
[0103] Step 202: Control the optimal gateway to establish a Bluetooth connection with the IoT device to be configured.
[0104] Once a suitable gateway is selected, a Bluetooth connection is established. To ensure security, an improved hybrid encryption scheme is employed. This scheme combines elliptic curve key exchange (ECE) with symmetric encryption to construct a secure channel. Specifically, the device and gateway generate a temporary key pair based on the secp256r1 curve, use the HKDF key derivation function to generate a session key, and finally establish an AES-128-CCM encrypted link.
[0105] In practical applications, the establishment of the entire secure channel begins with the generation and exchange of key materials. Each device and gateway independently generates a temporary key pair based on the secp256r1 elliptic curve: the device generates a private key d_device and its corresponding public key Q_device (a point on the curve), and the gateway similarly generates d_gateway and Q_gateway. Subsequently, both parties exchange their public key data via the wireless network. This process is in plaintext, but the crucial private key is always secretly stored locally.
[0106] When a device receives the gateway's public key Q_gateway, it uses its private key d_device to perform elliptic curve scalar multiplication, calculating the shared point S = d_device * Q_gateway. The gateway, upon receiving the device's public key, performs a symmetric calculation S = d_gateway * Q_device. Due to the mathematical properties of elliptic curves, both parties calculate the same point S, and the x-coordinate of this point becomes a shared secret seed. Next, to obtain a usable key, both parties use this shared secret as input to the HKDF key derivation function. HKDF combines an optional salt value with specific contextual information (such as strings identifying the protocol version and purpose), deterministically deriving a fixed-length, cryptographically stronger key from the shared secret, much like "stretching" dough. For the AES-128-CCM algorithm, this ultimately derives the required 128-bit symmetric encryption key and a random number to ensure communication freshness.
[0107] At this point, a secure channel has been established. All subsequent application data communications will be protected by this encrypted link. Before transmission, data is encrypted using a generated AES-128 key and a random number, and a message authentication code is calculated, encapsulated into a data frame conforming to CCM mode. The receiver then uses the same key to decrypt and verify the integrity and authenticity of the data, thus ensuring the confidentiality and tamper-proof nature of the communication.
[0108] Step 203: Receive the WiFi credential information of the router sent by the optimal gateway;
[0109] The WiFi credentials mainly include the router's SSID and password. After the connection is established, the WiFi credentials can be transmitted.
[0110] In one embodiment of this application, receiving the WiFi credential information of the router sent by the optimal gateway includes: receiving the WiFi credential information of the router sent by the optimal gateway in a coded fragment.
[0111] In practical applications, to ensure data transmission security and stability, the WiFi credential transmission process employs fragmented redundancy coding technology. The SSID and password combination data blocks are fragmented using Reed-Solomon coding, ensuring reliable recovery even if some data packets are lost. At the same time, the addition of serial numbers and timestamp mechanisms effectively prevents replay attacks.
[0112] The following example illustrates the fragmentation redundancy coding technique:
[0113] Assuming the Wi-Fi connection information to be transmitted is the SSID "MyHomeWiFi" and password "SecurePass123", they are first combined and encoded into a single data block. To enhance transmission robustness, Reed-Solomon encoding is used for fragmentation redundancy: the original data block is divided into three original data fragments, and two additional redundancy check fragments are generated. Thus, the original information is encoded into a set containing five fragments. During broadcasting, the device continuously transmits these five fragments in turn. The receiving device does not need to capture all five fragments; as long as it successfully receives any three fragments (whether original data fragments or redundancy check fragments), it can use the Reed-Solomon decoding algorithm to completely and accurately recover the original "MyHomeWiFi" and "SecurePass123" information. This method significantly improves the success rate of one-time network configuration in wireless environments with unstable signals or interference.
[0114] Step 204: Connect the IoT device to be configured with the network to the router based on the WiFi credential information, and register for network access in the cloud through the router.
[0115] Step 205: When an abnormal WiFi connection is detected, a fine-tuning instruction is first issued through the high-priority BLE emergency channel;
[0116] Step 206: Repair the WiFi connection based on the fine-tuning instructions.
[0117] In one embodiment of this application, after the WiFi connection repair fails based on the fine-tuning instruction, the re-authentication of the BLE beacon frame is triggered.
[0118] After receiving the WiFi credential information, the device can connect to the router and register with the cloud. Once successfully connected, the device sends connection parameters back via the BLE channel. The gateway then updates the device status table and triggers the DHCP service to assign a reserved IP address. The persistent BLE heartbeat connection provides a fast recovery channel for the device; by establishing a persistent BLE heartbeat, a repair process can be triggered immediately when the WiFi connection is abnormal.
[0119] The repair process is as follows:
[0120] First, fine-tuning commands (such as switching WiFi channels or adjusting modulation rates) are issued through a high-priority BLE emergency channel to attempt a lightweight, millisecond-level repair. If this fails, a key re-verification process is triggered, using the pre-shared PMKID to quickly update security credentials and complete authentication via a simplified four-way handshake protocol. When a network topology change is detected (such as an AP restart), the system automatically obtains the list of neighboring APs via BLE and intelligently selects the optimal node for switching. Throughout this process, state caching and predictive mechanisms can be employed. The device retains the three most recent valid keys, and the gateway maintains a 24-hour valid device context, ensuring that the connection can be restored in a short time even if the protocol layer is completely interrupted.
[0121] The specific modification process based on the fine-tuning instructions is as follows:
[0122] When the gateway detects a sudden drop in Wi-Fi link quality, its coordinating chip immediately sends a structured fine-tuning command frame to the device via the established high-priority, low-latency BLE data channel. This frame contains a specific "opcode" (such as 0x01 representing channel switching) and corresponding parameters (such as target channel number 6 or modulation rate index). Upon receiving the frame, the device's Wi-Fi driver layer directly parses and executes these parameter adjustments, achieving millisecond-level lightweight repair.
[0123] The re-authentication repair process after a failed fine-tuning instruction repair is as follows:
[0124] If the link quality metrics still do not recover after this operation, the gateway will send a "trigger re-authentication" signaling through the BLE channel. This signaling encapsulates a new random number ANonce calculated using the pre-shared master key identifier (PMKID). After receiving this signaling on the Wi-Fi end, the device uses the stored PMK and ANonce to calculate the PTK and replies with an authentication frame containing SNonce. The gateway then replies with an acknowledgment frame, thus completing a simplified, fast four-way handshake based on PMKID caching. If the gateway further determines that it needs to restart or for load balancing, its BLE service will broadcast a "network topology beacon" containing information about itself and neighboring APs. This beacon encodes information such as the BSSID, channel, load, and signal strength of each AP. After parsing this beacon, the device applies an intelligent filtering algorithm to select the optimal AP and confirms the target AP's BSSID with the gateway via BLE. Subsequently, a seamless and fast roaming handover is achieved under the coordination of the gateway.
[0125] In one aspect, the embodiments of the present invention can utilize Bluetooth Low Energy (BLE) broadcast to automatically discover IoT devices to be configured on the network, transmit WiFi network credentials through an encrypted channel, use the Dynamic Time Division Access (TDMA) algorithm to resolve conflicts in concurrent network configuration of multiple devices, and ensure transmission security through a fragmented encryption mechanism of temporary session keys.
[0126] This breaks through protocol barriers and intelligent collaboration with WiFi, completely eliminating user interaction steps. The device automatically completes network configuration upon power-on. For the first time, it integrates device discovery, security authentication, and resource scheduling during the network configuration phase, and enables Bluetooth functionality, which can significantly improve network configuration speed, batch configuration quantity, and success rate.
[0127] On the other hand, it can monitor the RSSI values of devices to be configured and gateways in real time, dynamically adjust the network topology, automatically assign Bluetooth relay roles to edge nodes, and expand network coverage. This advances network optimization from the operation and maintenance phase to the configuration phase, implementing a protocol-independent signal quality assessment model, thereby improving the connection stability of devices with weak signals and reducing overall network power consumption.
[0128] In this embodiment, during the broadcasting of BLE beacon frames by the WiFi gateway, if the IoT device to be configured scans one or more BLE beacon frames, the optimal gateway is selected based on the one or more BLE beacon frames; the optimal gateway is controlled to establish a Bluetooth connection with the IoT device to be configured; the WiFi credential information of the router sent by the optimal gateway is received; the IoT device to be configured is connected to the router based on the WiFi credential information; and network registration is performed in the cloud through the router. Seamless network configuration can be achieved without user intervention.
[0129] It should be noted that the network configuration method for an IoT device provided in this application embodiment can be executed by a network configuration device for the IoT device, or a control module within the network configuration device for executing the network configuration method for loading the IoT device. This application embodiment uses the execution of the network configuration method for loading the IoT device by a network configuration device for the IoT device as an example to illustrate the network configuration method for the IoT device provided in this application embodiment.
[0130] Reference Figure 3 The diagram shows a structural schematic of a distribution network device for an Internet of Things (IoT) device according to an embodiment of this application. The device includes the following modules:
[0131] The optimal gateway determination module 301 is used to select the optimal gateway based on one or more BLE beacon frames if the IoT device to be configured scans one or more BLE beacon frames during the process of the WiFi gateway broadcasting BLE beacon frames.
[0132] Bluetooth connection module 302 is used to control the optimal gateway to establish a Bluetooth connection with the IoT device to be configured.
[0133] WiFi credential information receiving module 303 is used to receive WiFi credential information of the router sent by the optimal gateway;
[0134] The network access module 304 is used to connect the IoT device to be configured with the router based on the WiFi credential information, and to perform network access registration in the cloud through the router.
[0135] In one embodiment of this application, the optimal gateway determination module 301 may include:
[0136] The raw data determination submodule is used to determine the raw data corresponding to the one or more BLE beacons;
[0137] The candidate gateway list determination submodule is used to filter the original data according to a preset filtering algorithm to form a preliminary candidate gateway list.
[0138] The gateway evaluation score determination submodule is used to determine the gateway evaluation score corresponding to each candidate gateway in the candidate gateway list according to preset evaluation indicators.
[0139] The optimal gateway determination submodule is used to determine the optimal gateway from the candidate gateway list based on the gateway evaluation score.
[0140] In one embodiment of this application, the candidate gateway list determination submodule may include:
[0141] A network identifier matching unit is used to verify whether the network identifier in the original data matches a preset target network.
[0142] A version compatibility detection unit is used to check whether the authentication method in the original data is compatible with a preset protocol version when the network identifier in the beacon frame matches the target network;
[0143] The candidate gateway list determination unit is used to remove weak signal gateways with signal strength below the minimum connection threshold from the original data when it is determined that the authentication method is compatible with the preset protocol version, so as to obtain a preliminary candidate gateway list.
[0144] In one embodiment of this application, the optimal gateway determination submodule may include:
[0145] A sorting unit is used to sort multiple candidate gateways in the candidate gateway list by size based on the gateway evaluation score;
[0146] The filtering unit is used to determine the top N candidate gateways based on a descending sequence, where N is a positive integer greater than 1.
[0147] The selection unit is used to determine the optimal gateway from the top N candidate gateways.
[0148] In one embodiment of this application, the Bluetooth connection module 302 may include:
[0149] The encrypted Bluetooth connection submodule is used to control the optimal gateway to establish an encrypted Bluetooth connection with the IoT device to be configured.
[0150] In one embodiment of this application, the encrypted Bluetooth connection submodule may include:
[0151] The encryption unit is used to control the optimal gateway and the IoT device to be configured to build a secure channel in the encrypted Bluetooth connection through elliptic curve key exchange and symmetric encryption.
[0152] In one embodiment of this application, the WiFi credential information receiving module 303 may include:
[0153] The WiFi credential information receiving submodule is used to receive the WiFi credential information of the router sent by the optimal gateway encoding fragment.
[0154] In one embodiment of this application, the apparatus further includes:
[0155] The fine-tuning instruction sending module is used to send fine-tuning instructions through the high-priority BLE emergency channel when an abnormal WiFi connection is detected.
[0156] The repair module is used to repair the WiFi connection based on the fine-tuning instructions.
[0157] In one embodiment of this application, the apparatus further includes:
[0158] The re-authentication module is used to trigger the re-authentication of the BLE beacon frame after the WiFi connection repair based on the fine-tuning instruction fails.
[0159] In this embodiment, during the broadcasting of BLE beacon frames by the WiFi gateway, if the IoT device to be configured scans one or more BLE beacon frames, the optimal gateway is selected based on the one or more BLE beacon frames; the optimal gateway is controlled to establish a Bluetooth connection with the IoT device to be configured; the WiFi credential information of the router sent by the optimal gateway is received; the IoT device to be configured is connected to the router based on the WiFi credential information; and network registration is performed in the cloud through the router. Seamless network configuration can be achieved without user intervention.
[0160] The network configuration of the IoT device in this application embodiment can be a device, or a component, integrated circuit, or chip in the terminal. The device can be a mobile electronic device or a non-mobile electronic device. For example, mobile electronic devices can be mobile phones, tablets, laptops, PDAs, in-vehicle electronic devices, wearable devices, ultra-mobile personal computers (UMPCs), netbooks, or personal digital assistants (PDAs), etc., while non-mobile electronic devices can be servers, network attached storage (NAS), personal computers (PCs), televisions (TVs), ATMs, or self-service machines, etc. This application embodiment does not impose specific limitations.
[0161] The network distribution device for IoT devices in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit the specific operating system used.
[0162] The network configuration provided in this application embodiment enables the IoT device to achieve… Figures 1 to 2 The various processes implemented by the distribution network device of the IoT device in the method embodiment will not be described again here to avoid repetition.
[0163] In this embodiment, during the broadcasting of BLE beacon frames by the WiFi gateway, if the IoT device to be configured scans one or more BLE beacon frames, the optimal gateway is selected based on the one or more BLE beacon frames; the optimal gateway is controlled to establish a Bluetooth connection with the IoT device to be configured; the WiFi credential information of the router sent by the optimal gateway is received; the IoT device to be configured is connected to the router based on the WiFi credential information; and network registration is performed in the cloud through the router. Seamless network configuration can be achieved without user intervention.
[0164] Reference Figure 4 An electronic device provided in this application includes a processor 1010, a memory 1009, and a program or instructions stored in the memory 1009 and executable on the processor 1010. When the program or instructions are executed by the processor 1010, they implement the various processes of the above-described IoT device distribution method embodiment and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0165] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.
[0166] Figure 5 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of this application.
[0167] The electronic device 1000 includes, but is not limited to, the following components: radio frequency unit 1001, network module 1002, audio output unit 1003, input unit 1004, sensor 1005, display unit 1006, user input unit 1007, interface unit 1008, memory 1009, and processor 1010.
[0168] The input unit 1004 may include a graphics processor 10041 and a microphone 10042, the memory 1009 may include applications and an operating system, the user input unit 1007 may include a touch panel 10071 and other input devices 10072, and the display unit 1006 may include a display panel 10061.
[0169] Those skilled in the art will understand that the electronic device 1000 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 1010 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 4 and Figure 5 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.
[0170] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described IoT device network distribution method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0171] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0172] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0173] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0174] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A network configuration method for Internet of Things (IoT) devices, characterized in that, The method includes: During the process of the WiFi gateway broadcasting BLE beacon frames, if the IoT device to be configured scans one or more BLE beacon frames, the optimal gateway is selected based on the one or more BLE beacon frames. Control the optimal gateway to establish a Bluetooth connection with the IoT device to be configured on the network; Receive the WiFi credential information of the router sent by the optimal gateway; The IoT device to be configured is connected to the router based on the WiFi credential information, and network registration is performed in the cloud through the router. The step of selecting the optimal gateway based on the one or more BLE beacon frames includes: Determine the raw data corresponding to the one or more BLE beacons; Based on the raw data, a preliminary candidate gateway list is formed by filtering according to a preset filtering algorithm. The gateway evaluation score corresponding to each candidate gateway in the candidate gateway list is determined according to the preset evaluation indicators; The optimal gateway is determined from the candidate gateway list based on the gateway evaluation score. The step of filtering the original data according to a preset filtering algorithm to form a preliminary candidate gateway list includes: Verify whether the network identifier in the original data matches the preset target network; When the network identifier in the beacon frame matches the target network, check whether the authentication method in the original data is compatible with the preset protocol version; When it is determined that the authentication method is compatible with the preset protocol version, weak signal gateways with signal strength below the minimum connection threshold in the original data are removed to obtain a preliminary candidate gateway list.
2. The method according to claim 1, characterized in that, The optimal gateway is determined from the candidate gateway list based on the gateway evaluation score, including: Based on the gateway evaluation score, sort the multiple candidate gateways in the candidate gateway list by size; Based on the descending sequence, determine the top N candidate gateways, where N is a positive integer greater than 1; The optimal gateway is determined from the top N candidate gateways.
3. The method according to claim 1, characterized in that, The step of controlling the optimal gateway to establish a Bluetooth connection with the IoT device to be configured includes: Control the optimal gateway to establish an encrypted Bluetooth connection with the IoT device to be configured.
4. The method according to claim 3, characterized in that, The control of the optimal gateway to establish an encrypted Bluetooth connection with the IoT device to be configured includes: The optimal gateway and the IoT device to be configured are controlled to establish a secure channel in the encrypted Bluetooth connection through elliptic curve key exchange and symmetric encryption.
5. The method according to claim 1, characterized in that, The process of receiving the WiFi credential information of the router sent by the optimal gateway includes: Receive the WiFi credential information of the router sent by the optimal gateway encoding fragment.
6. The method according to claim 1, characterized in that, Also includes: When an abnormal WiFi connection is detected, a fine-tuning instruction is first issued through the high-priority BLE emergency channel; WiFi connection repair is performed based on the aforementioned fine-tuning instructions.
7. The method according to claim 6, characterized in that, Also includes: If WiFi connection repair fails based on the fine-tuning instructions, the BLE beacon frame is re-authenticated.
8. A distribution network device for Internet of Things (IoT) devices, characterized in that, The device includes: The optimal gateway determination module is used to select the optimal gateway based on one or more BLE beacon frames if the IoT device to be configured scans one or more BLE beacon frames during the broadcasting of BLE beacon frames by the WiFi gateway. A Bluetooth connectivity module is used to control the optimal gateway to establish a Bluetooth connection with the IoT device to be configured on the network; The WiFi credential information receiving module is used to receive the WiFi credential information of the router sent by the optimal gateway; The network access module is used to connect the IoT device to be configured with the network and the router based on the WiFi credential information, and to register for network access in the cloud through the router; The optimal gateway determination module includes: The raw data determination submodule is used to determine the raw data corresponding to the one or more BLE beacons; The candidate gateway list determination submodule is used to filter the original data according to a preset filtering algorithm to form a preliminary candidate gateway list. The gateway evaluation score determination submodule is used to determine the gateway evaluation score corresponding to each candidate gateway in the candidate gateway list according to preset evaluation indicators. The optimal gateway determination submodule is used to determine the optimal gateway from the candidate gateway list based on the gateway evaluation score. The candidate gateway list determination submodule includes: A network identifier matching unit is used to verify whether the network identifier in the original data matches a preset target network. A version compatibility detection unit is used to check whether the authentication method in the original data is compatible with a preset protocol version when the network identifier in the beacon frame matches the target network; The candidate gateway list determination unit is used to remove weak signal gateways with signal strength below the minimum connection threshold from the original data when it is determined that the authentication method is compatible with the preset protocol version, so as to obtain a preliminary candidate gateway list.
9. An electronic device, characterized in that, It includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the network configuration method for the Internet of Things device as described in any one of claims 1-7.
10. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the network configuration method for the Internet of Things device as described in any one of claims 1-7.
Citation Information
Patent Citations
Method, system and apparatus for accessing intelligent device to wireless local area network
CN111918252A
Intelligent equipment network distribution method and related device
CN116112926A