An iot device non-inductive control method and system based on ssid dynamic change
Patent Information
- Application Number
- CN202611476770.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-22
- Publication Date
- 2026-10-27
AI Technical Summary
[0007]本发明提供了一种基于SSID动态变更的物联网设备无感控制方法及系统,以解决现有技术中物联网设备工作在SoftAP模式下,因“有连接、无网络”特性导致手机终端在控制操作完成后无法自动断开连接、无法快速恢复互联网访问的技术问题
[0040]1、用完自动断网,无需用户手动操作。物联网设备在控制指令执行成功后自动变更SSID,手机终端因SSID变化而无法自动重连,自动切换回4G/5G网络或现场可用Wi-Fi,全程无需用户手动断开连接,一方面使得用户手机可以及时更换网络,避免手机出现无网状态而影响通信,另一方面也避免了手机CPU频繁唤醒并持续消耗射频资源;同时也极大地提升了用户体验。
Smart Images

Figure CN122994713A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of IoT near-field control technology, specifically to a contactless control method and system for IoT devices based on dynamically changing SSID. Background Technology
[0002] With the widespread adoption of IoT technology, smart switches, relays, and other IoT devices based on low-cost Wi-Fi chips have become ubiquitous. These devices typically operate in SoftAP (Soft Access Point) mode, where users establish a direct local area network connection by connecting their smartphones to the device's Wi-Fi hotspot. They can then send relay on / off commands via WeChat mini-programs or dedicated mini-programs to achieve near-field IoT control. However, limited by hardware costs and design architecture, the Wi-Fi chips in these IoT devices only possess IEEE 802.11 physical and data link layer connectivity, lacking a complete network layer (IP layer) protocol stack and routing forwarding capabilities, exhibiting a typical "connection-only, no-network" characteristic. When a user's mobile device connects to the hotspot and completes control operations, the Wi-Fi cannot provide internet access, which will forcibly block functions that rely on the public network, such as WeChat message push and web browsing. At the same time, modern smartphone operating systems have built-in aggressive "network quality assessment mechanisms" that constantly attempt to detect network connectivity (Captive Portal detection), causing the phone's CPU to wake up frequently and continuously consume radio frequency resources. Users must manually go to the system settings to disconnect or switch back to mobile data network. This disjointed interactive experience is very likely to arouse user resentment.
[0003] In addition, existing solutions to the problem of mobile terminals being unable to access the internet due to the chip's "connection without network" limitation have the following significant drawbacks:
[0004] First, the over-reliance on manual user intervention results in a poor user experience. Most existing technologies require users to manually disconnect the Wi-Fi connection after completing the control operation. However, ordinary users often lack the relevant technical knowledge and easily forget to disconnect afterward, causing the phone to remain offline for extended periods and severely interfering with its normal communication functions.
[0005] Second, the application-layer delayed shutdown mechanism has timing conflicts and reliability risks. Some solutions attempt to send commands from a mini-program to delay the shutdown of the Wi-Fi hotspot, but this method is difficult to control precisely. If it shuts down too early, the control command may not have been executed successfully; if it shuts down too late, the phone will still experience a painful period of network outage. In addition, if the mini-program exits unexpectedly or the phone goes into sleep mode, the device will not be aware of it, which may cause the hotspot to remain on for a long time, continuously interfering with the mobile network, or cause the device to become "disconnected" due to abnormal shutdown.
[0006] Third, it's difficult to reconcile the need for accidental connection prevention mechanisms with convenience. While changing the Wi-Fi password directly to prevent automatic reconnection might force a disconnect, it forces users to scan the code and re-enter the password the next time they use the service, significantly increasing the barrier to entry. Current technology lacks a dynamic identifier management mechanism that adapts and changes regularly based on the underlying hardware status (such as relay completion or restart), making it impossible to effectively block unintended secondary connections while ensuring seamless switching for legitimate users. Summary of the Invention
[0007] This invention provides a seamless control method and system for IoT devices based on dynamically changing SSID, in order to solve the technical problem in the prior art where IoT devices operate in SoftAP mode, and due to the "connection but no network" characteristic, the mobile terminal cannot automatically disconnect after the control operation is completed and cannot quickly restore Internet access.
[0008] This invention provides the following technical solution:
[0009] In a first aspect, the present invention provides a method for contactless control of IoT devices based on dynamically changing SSID, comprising the following steps:
[0010] After an IoT device is started, it generates a dynamic SSID consisting of at least a fixed prefix for identifying the device type, an identifier for ensuring the uniqueness of the device identity, and a random character sequence.
[0011] The mobile terminal scans and connects to the dynamic SSID broadcast by the IoT device, establishing a direct wireless LAN connection channel between the mobile terminal and the IoT device.
[0012] The mobile terminal sends control commands to the IoT device through a wireless LAN direct connection channel, and the IoT device receives and executes the control commands.
[0013] After the IoT device successfully executes the control command, the IoT device automatically changes its currently broadcast SSID, generates a new dynamic SSID, and broadcasts it.
[0014] The mobile terminal disconnects from the IoT device and switches to a mobile data network or other networks because it cannot recognize or automatically connect to a new dynamic SSID.
[0015] Preferably, the dynamic SSID further includes an auto-incrementing counter field, which is located at the end of the random character sequence and is used to perform an auto-incrementing count each time the IoT device is started or each time the SSID is changed.
[0016] Preferably, the auto-incrementing counter field is a hexadecimal counter with a counting range of 0x0000 to 0xFFFF; when the terminal scans multiple SSID copies of the same MAC address, it forcibly selects the SSID with the largest last digit value for connection; when the counter overflows from 0xFFFF and wraps back to 0x0000, it selects the SSID with a count value of 0x0001 for connection.
[0017] Preferably, the steps for establishing a network connection between the mobile terminal and the IoT device include:
[0018] The mobile terminal obtains the BSSID information of the IoT device by scanning the QR code on the casing of the IoT device.
[0019] The mobile terminal matches the corresponding dynamic SSID in the surrounding Wi-Fi list based on the BSSID information and connects.
[0020] Preferably, the mobile terminal and the IoT device establish a communication connection via TCP or UDP protocol. The mobile terminal sends a control command containing a verification code to the IoT device. The IoT device verifies the verification code and executes the control command after successful verification.
[0021] Preferably, the verification code verification includes:
[0022] The mobile terminal sends a verification command to the IoT device, and the verification command is in HEX format.
[0023] The IoT device verifies the verification code. If the verification is successful, it returns a verification success response to the mobile terminal; if the verification fails, it returns a verification failure response.
[0024] After receiving a verification failure response, the mobile terminal regenerates the verification code and re-initiates the verification.
[0025] Preferably, after the mobile terminal loses connection with the IoT device, the following is also included:
[0026] After the mobile terminal switches to another available network, it synchronizes data with the backend server and uploads the data of this control operation to the backend server.
[0027] The mobile terminal initiates a synchronization request to the backend server every preset time interval until it receives a synchronization success response from the backend server.
[0028] Secondly, the present invention provides a seamless control system for IoT devices based on dynamically changing SSIDs, comprising:
[0029] IoT devices operate in SoftAP mode, which is used to broadcast SSID, receive and execute control commands sent by the terminal, and automatically change the currently broadcast SSID after the control command is successfully executed;
[0030] The mobile terminal is used to obtain the device's unique identifier by scanning the QR code on the IoT device, connect to the SSID broadcast by the IoT device, send the control command, and automatically switch to the mobile data network or other networks after detecting a change in the SSID and disconnection.
[0031] Preferably, the IoT device includes:
[0032] The SSID generation module is used to generate SSIDs that include a fixed prefix, a unique device identifier, a random character sequence, and an auto-incrementing counter value according to preset naming rules.
[0033] The instruction processing module is used to receive, verify, and execute the control instructions;
[0034] The SSID change module is used to trigger the reset and update of the SSID after the control command is successfully executed.
[0035] Preferably, the mobile terminal includes:
[0036] The scanning module is used to parse the QR code and extract the device's unique identifier;
[0037] The SSID matching module is used to scan the surrounding Wi-Fi signals based on the device's unique identifier and select the target SSID for connection according to the principle of the largest last digit.
[0038] The network switching module is used to automatically enable mobile data network or other networks after detecting that the original SSID has disappeared and the connection has been lost.
[0039] The present invention has the following beneficial effects:
[0040] 1. Automatic network disconnection upon completion, requiring no manual user intervention. After successful execution of the control command, the IoT device automatically changes its SSID. Due to the SSID change, the mobile terminal cannot automatically reconnect and automatically switches back to a 4G / 5G network or available Wi-Fi. The entire process requires no manual disconnection from the user. This allows the user's mobile phone to switch networks promptly, preventing network outages that could affect communication. It also avoids frequent CPU wake-ups and continuous consumption of radio frequency resources, significantly improving the user experience.
[0041] 2. Fast network recovery speed, avoiding network lag. After control is completed, the phone instantly restores internet access, avoiding problems such as failed WeChat message sending and inability to open web pages due to no network connection, and resolving lag and white screen issues that occur when using the mini-program for control.
[0042] 3. The QR code on the device casing remains unchanged. Each time a user uses the device, they only need to scan the QR code to connect to the new SSID. This ensures that the network can be quickly disconnected and communication restored after each operation, and there is no need to reconfigure the network or enter a password. This achieves a balance between convenience and prevention of accidental connection.
[0043] 4. Anti-caching matching strategy ensures connection accuracy. By using an auto-incrementing counter in the SSID naming rules and a mechanism that selects the terminal based on the maximum last digit, the connection error caused by the mobile terminal caching old SSIDs is effectively solved, ensuring that the terminal can always connect to the latest SSID currently broadcast by the device. Attached Figure Description
[0044] Figure 1 This is a flowchart of the control method of the present invention.
[0045] Figure 2 This is a diagram of the chip appearance in Embodiment 1 of the present invention.
[0046] Figure 3 This is a diagram of the application interface of the mobile terminal of the present invention.
[0047] Figure 4 This is a diagram of the application interface of the mobile terminal of the present invention after scanning a QR code.
[0048] Figure 5 This is an application interface diagram of the mobile terminal of the present invention when connecting to the chip's Wi-Fi.
[0049] Figure 6 This is a diagram of the application interface after the mobile terminal of the present invention connects to the Wi-Fi chip.
[0050] Figure 7 This is another application interface diagram after the mobile terminal of the present invention connects to the chip's Wi-Fi. Detailed Implementation
[0051] The technical solutions of the embodiments of this specification will be explained and described below with reference to the accompanying drawings. However, the following embodiments are only preferred embodiments of this specification and not all of them. Other embodiments obtained by those skilled in the art based on the embodiments in the implementation methods without creative effort are all within the protection scope of this specification.
[0052] Example 1
[0053] Please see Figure 1-7As shown, this invention provides a method for contactless control of IoT devices based on dynamically changing SSID, comprising the following steps:
[0054] S1. After the IoT device is started, a dynamic SSID is generated, consisting of at least a fixed prefix for identifying the device type, an identifier for ensuring the uniqueness of the device identity, and a random character sequence. The dynamic SSID also includes an auto-incrementing count field, which is located at the end of the random character sequence and is used to increment the count each time the IoT device is started or each time the SSID is changed.
[0055] In the SSID generation step, the naming format for dynamic SSIDs is "fixed prefix, device unique identifier, random character sequence, and auto-incrementing counter field". In this embodiment:
[0056] Fixed prefix: HYX;
[0057] Unique identifier: BSSID (MAC address);
[0058] Random character sequence: The last 8 characters are automatically generated when the chip starts up. The character set includes 0-9, af, AF, and can be processed into a hexadecimal character set, so that the SSID is different each time it is powered on, preventing it from being tracked.
[0059] The auto-incrementing counter field is a hexadecimal counter with a counting range of 0x0000 to 0xFFFF.
[0060] In this embodiment, after the device is powered on and started, the following SSID generation process is executed:
[0061] (1) Read the chip's own BSSID (MAC address), for example, "A1:B2:C3:D4:E5:F6".
[0062] (2) Call the random number generator to generate a random character sequence, such as "3F8A2C7E".
[0063] (3) Initialize the auto-increment counter to 0x0000.
[0064] (4) Construct the SSID according to the naming rules: fixed prefix "HYX" + BSSID ("A1B2C3D4E5F6") + 8 random characters + 4 auto-incrementing counter value. In this example, the generated SSID is: HYXA1B2C3D4E5F63F8A2C7E0000.
[0065] When a terminal scans multiple copies of the same MAC address, it will forcibly select the SSID with the largest last digit for connection. For example, suppose that due to some abnormal situation (such as frequent restarts, counter overflow wraparound), multiple SSIDs with the same BSSID are broadcast in the surrounding environment (in reality, the device will only broadcast one SSID at a time, but due to historical scanning records, the phone's Wi-Fi list may cache multiple SSIDs with the same BSSID). When the user scans the code to connect again, the mini-program's scan result may include the following SSIDs:
[0066] HYXA1B2C3D4E5F6B7E8F1C3000B (Current broadcast, counter 0x000B);
[0067] HYXA1B2C3D4E5F63F8A2C7E000A (History cache, counter 0x000A);
[0068] HYXA1B2C3D4E5F6A9B1C3D5000C (History cache, counter 0x000C);
[0069] Following the principle of maximizing the last digit, the mini-program selects the SSID "HYXA1B2C3D4E5F6A9B1C3D5000C" corresponding to 0x000C, which has the largest counter value, for connection. If the device corresponding to 0x000C does not actually exist (due to an abnormal restart causing a mismatch between the SSID and the device's actual broadcast), the connection fails. In this case, the mini-program should downgrade to the next largest counter value (0x000B) and try them one by one until a successful connection is established. If all historical SSIDs cannot be connected, the user is prompted to ensure that the device is powered on and in a discoverable state. In actual product implementation, the chip increments the counter every time the SSID changes, without reusing old counter values. By using the auto-incrementing counter in the SSID naming rules and the terminal's maximum last digit selection mechanism, the connection error problem caused by the mobile terminal caching old SSIDs is effectively solved, ensuring that the terminal can always connect to the latest SSID currently broadcast by the device.
[0070] When the counter overflows from 0xFFFF and wraps back to 0x0000, the SSID with a count value of 0x0001 is selected for connection.
[0071] S2. The mobile terminal scans and connects to the dynamic SSID broadcast by the IoT device, establishing a direct wireless LAN connection between the mobile terminal and the IoT device. The steps for the mobile terminal and the IoT device to establish a network connection include: the mobile terminal obtaining the BSSID information of the IoT device by scanning the QR code on the casing of the IoT device; the mobile terminal matching the corresponding dynamic SSID in the surrounding Wi-Fi list based on the BSSID information and connecting to it.
[0072] In this embodiment, when a user uses the chip for the first time or subsequently, they scan the QR code on the chip casing using a WeChat mini-program on their mobile phone. The mini-program parses the QR code content and extracts information such as BSSID "A1B2C3D4E5F6", prefix "HYX", port "8888", gateway "192.168.4.1", and password "12345678".
[0073] Subsequently, the mini-program calls the phone's system Wi-Fi scanning interface to obtain a list of surrounding Wi-Fi hotspots. Based on the BSSID information, the mini-program filters the hotspot list for hotspots whose SSIDs begin with "HYX" and whose BSSIDs match (since the BSSID is the device's MAC address in SoftAP mode, it can uniquely match). When the same BSSID corresponds to multiple SSIDs (for example, the device may have multiple cached SSIDs with different random characters and / or auto-incrementing counter values due to multiple startups or restarts), the mini-program applies the "largest last digit" principle, selecting the SSID with the largest auto-incrementing counter value for connection. Assume the following two SSIDs are scanned:
[0074] HYXA1B2C3D4E5F63F8A2C7E0000 (counter value 0x0000);
[0075] HYXA1B2C3D4E5F6A9B1C3D5000A (counter value 0x000A);
[0076] The mini-program then selects the SSID "HYXA1B2C3D4E5F6A9B1C3D5000A" corresponding to the counter value 0x000A (i.e., hexadecimal "000A") for connection.
[0077] After user confirmation, the phone automatically connects to the SSID and enters the preset password "12345678" to complete the Wi-Fi connection. Once connected, the phone will be assigned an IP address (e.g., 192.168.4.2) and a gateway of 192.168.4.1.
[0078] S3. The mobile terminal sends control commands to the IoT device through a wireless LAN direct connection channel, and the IoT device receives and executes the control commands.
[0079] The mobile terminal establishes a communication connection with the IoT device via TCP or UDP protocol. The mobile terminal sends a control command containing a verification code to the IoT device. The IoT device verifies the verification code and executes the control command after successful verification.
[0080] The TCP / UDP server IP address is the gateway IP obtained after a successful Wi-Fi connection. The default gateway IP is XXX.XXX.XX.X (if the obtained gateway IP is different from the default value, the actual obtained gateway IP shall prevail); the server port is fixed at XXXX. The terminal needs to establish a communication connection with the chip through this port. An incorrect port will cause communication failure.
[0081] All data interactions with the chip (including verification commands, power on / off commands, status query commands, etc.) must first undergo a data verification operation. Only after successful verification can subsequent data transmission or command sending proceed. If verification fails, it must be re-initiated. The specific verification rules and return results are as follows:
[0082] (1) Sending verification command
[0083] The control terminal sends a verification command to the chip. The command format is HEX: 0x08 + 4 bytes of checksum (used by the chip to verify the identity of the terminal). The total length of the command is 5 bytes.
[0084] (2) Verification results are returned (HEX format, two types of results, clearly distinguished).
[0085] Verification successful: The chip returns HEX data "0x090x01" to the terminal, indicating that the terminal identity verification has passed and subsequent command interaction can proceed;
[0086] Verification failed: The chip returns HEX data "0x090x00" to the terminal, indicating that the terminal identity verification failed. It is necessary to regenerate the 4-byte verification code and initiate the verification command again until the verification is successful.
[0087] The chip executes the instructions and returns the execution results.
[0088] In this embodiment, the command interaction process is as follows:
[0089] Step 1: Verification Command Sending. The mobile phone sends 5 bytes of HEX data to the device: 0x08 + 4 bytes of checksum. The checksum is generated in real time by the mobile phone based on a preset algorithm (e.g., MD5 truncation based on timestamps and random numbers), for example, 0x120x340x560x78. The complete command is: 08 12 34 56 78.
[0090] Step 2: Chip Verification and Response. After receiving the command, the device extracts the last 4 bytes of the checksum and compares it with the locally stored expected checksum. The locally stored expected checksum is dynamically generated by the chip based on the key negotiated with the mobile phone during connection establishment. If the checksum matches, the device returns HEX data 0x090x01 (2 bytes in total), indicating successful verification; if it does not match, it returns 0x090x00, and the mobile phone needs to regenerate the checksum and resend the verification command until successful verification. A maximum of 3 retries are allowed; if more than 3 are attempted, the connection is disconnected and the user is notified.
[0091] Step 3: Send control command. After successful verification, the mobile phone sends a power on / off command. The command format is HEX: 0x10 (representing on, 0x11 representing off) + 1 byte device address + 2 bytes checksum. For example, the power on command is: 10 01 11 (checksum is 0x01 + 0x10 = 0x11). After receiving the command, the device executes the relay action.
[0092] Step 4: Return execution result. After the device completes the relay action, it returns HEX data 0x120x01 (success) or 0x120x00 (failure) to the mobile phone.
[0093] S4. After the IoT device successfully executes the control command, the IoT device automatically changes its currently broadcast SSID, generates a new dynamic SSID, and broadcasts it.
[0094] Once the power on / off command is successfully executed and the chip control operation is completed, the mobile terminal will receive a verification success flag (HEX data 0x090x01) returned by the chip, indicating that the power on / off command has been successfully executed. This will trigger the SSID reset process (generating new random characters and resetting the auto-increment counter to zero) and start a new round of broadcasting.
[0095] In the SSID dynamic change process, after step 4 in S3 returns a success message (0x120x01), the device immediately triggers the SSID reset process, as follows:
[0096] (1) Increment the value of the auto-increment counter by 1: The current counter value is 0x000A, and after incrementing by 1, it becomes 0x000B.
[0097] (2) Regenerate 8-bit random characters: Call the random number generator to generate a new random character sequence, such as "B7E8F1C3" (random characters include 0-9, AF, af).
[0098] (3) Assemble the new SSID: The original BSSID remains unchanged, and the new SSID is:
[0099] HYXA1B2C3D4E5F6B7E8F1C3000B.
[0100] (4) The device stops broadcasting the original SSID and immediately starts broadcasting with the new SSID.
[0101] (5) The device actively disconnects the current TCP connection with the mobile phone and cancels the Wi-Fi association. The mobile phone detects that the Wi-Fi connection is disconnected, and at the same time, the original SSID disappears from the system's Wi-Fi list (or becomes unsaved). The mobile phone cannot automatically reconnect (because the original SSID is no longer in the broadcast).
[0102] In this application, different SSIDs correspond to different passwords, which will be automatically entered according to the algorithm rules when the mini program is configuring the network.
[0103] S5. The mobile terminal disconnects from the IoT device and switches to a mobile data network or other networks because it cannot recognize or automatically connect to a new dynamic SSID.
[0104] The chip will automatically disconnect the currently connected control terminal (mobile phone) from the chip AP node and reset its own Wi-Fi name (regenerating "HYX+BSSID+8-digit random characters+4-digit hexadecimal auto-incrementing digits") to prevent the control terminal from automatically connecting to the Wi-Fi again and avoid subsequent user terminals being without network access.
[0105] After the chip resets the Wi-Fi name, the control terminal (mobile phone) will experience a network downtime of 3 to 15 seconds (during which the mobile terminal is not connected to any Wi-Fi and the network is interrupted). During this period, no new control operations can be initiated. At this time, the operator's network awareness on the mobile terminal interface is almost zero. This solution mainly aims to restore the wireless or cellular network after the operation is completed and the operator leaves the interface.
[0106] After a mobile terminal loses connection with an IoT device, the following also applies:
[0107] After the mobile terminal switches to another available network, it immediately synchronizes the power-on / off data with the backend server. If the network recovery is slow, it can send a synchronization request to the server every 1000ms (1 second) until it receives the synchronization success data returned by the server, thus completing the entire operation process of the Wi-Fi chip control. After detecting that the connection is lost and the SSID has changed, it automatically enables mobile data to synchronize data with the cloud, thus completing the control loop.
[0108] After the IoT device successfully executes the control command, it automatically changes its SSID. Due to the change in SSID, the mobile terminal cannot automatically reconnect and automatically switches back to the 4G / 5G network or the available Wi-Fi on site. The entire process does not require the user to manually disconnect. On the one hand, it allows the user's mobile phone to switch networks in time, avoiding the mobile phone being in a network-free state and affecting communication. On the other hand, it also avoids the mobile phone CPU frequently waking up and continuously consuming radio frequency resources. At the same time, it greatly improves the user experience.
[0109] Example 2
[0110] Please see Figure 1-7 As shown, the present invention provides a seamless control system for IoT devices based on dynamic SSID changes, comprising:
[0111] The Internet of Things (IoT) device, operating in SoftAP mode, is used to broadcast SSIDs, receive and execute control commands sent by terminals, and automatically change the currently broadcast SSID after successful execution of the control commands; the IoT device includes:
[0112] The SSID generation module is used to generate SSIDs that include a fixed prefix, a unique device identifier, a random character sequence, and an auto-incrementing counter value according to preset naming rules.
[0113] The instruction processing module is used to receive, verify, and execute the control instructions;
[0114] The SSID change module is used to trigger the reset and update of the SSID after the control command is successfully executed.
[0115] A mobile terminal is used to obtain a unique device identifier by scanning a QR code on the IoT device, connect to the SSID broadcast by the IoT device, send the control commands, and automatically switch to a mobile data network or other networks after detecting a change in the SSID and a disconnection. The mobile terminal includes:
[0116] The scanning module is used to parse the QR code and extract the device's unique identifier;
[0117] The SSID matching module is used to scan the surrounding Wi-Fi signals based on the device's unique identifier and select the target SSID for connection according to the principle of the largest last digit.
[0118] The network switching module is used to automatically enable mobile data network or other networks after detecting that the original SSID has disappeared and the connection has been lost.
[0119] The present invention provides a seamless control method and system for IoT devices based on dynamically changing SSIDs. This method and system can be widely applied to various low-cost Wi-Fi IoT devices, including but not limited to: smart switches, smart sockets, smart lights, smart curtains, smart door locks, smart sensors, and smart home appliances. The implementation of this invention requires no additional hardware costs; it only requires adding dynamic SSID changing logic to the existing Wi-Fi chip firmware and adding QR code parsing and anti-cache matching functions to the terminal application. This enables seamless network recovery after control failure, demonstrating high industrial application value and promising market prospects.
[0120] The embodiments described above are merely preferred embodiments of this specification and are not intended to limit the scope of this specification. Any modifications and improvements made by those skilled in the art to the technical solutions of this specification without departing from the spirit of this specification should fall within the protection scope defined by the claims of this specification.
Claims
1. A method for contactless control of IoT devices based on dynamically changing SSID, characterized in that, Includes the following steps: After an IoT device is started, it generates a dynamic SSID consisting of at least a fixed prefix for identifying the device type, an identifier for ensuring the uniqueness of the device identity, and a random character sequence. The mobile terminal scans and connects to the dynamic SSID broadcast by the IoT device, establishing a direct wireless LAN connection channel between the mobile terminal and the IoT device. The mobile terminal sends control commands to the IoT device through a wireless LAN direct connection channel, and the IoT device receives and executes the control commands. After the IoT device successfully executes the control command, the IoT device automatically changes its currently broadcast SSID, generates a new dynamic SSID, and broadcasts it. The mobile terminal disconnects from the IoT device and switches to a mobile data network or other networks because it cannot recognize or automatically connect to a new dynamic SSID.
2. The method for contactless control of IoT devices based on dynamic SSID changes according to claim 1, characterized in that, The dynamic SSID also includes an auto-incrementing counter field, which is located at the end of the random character sequence and is used to increment the counter each time the IoT device is started or each time the SSID is changed.
3. The method for contactless control of IoT devices based on dynamic SSID changes according to claim 2, characterized in that, The auto-incrementing counter field is a hexadecimal counter with a counting range of 0x0000 to 0xFFFF. When the terminal scans multiple SSID copies of the same MAC address, it forcibly selects the SSID with the largest last digit value for connection. When the counter overflows from 0xFFFF and wraps back to 0x0000, it selects the SSID with a count value of 0x0001 for connection.
4. The method for contactless control of IoT devices based on dynamic SSID changes according to claim 1, characterized in that, The steps for mobile terminals and IoT devices to connect to the network include: The mobile terminal obtains the BSSID information of the IoT device by scanning the QR code on the casing of the IoT device. The mobile terminal matches the corresponding dynamic SSID in the surrounding Wi-Fi list based on the BSSID information and connects.
5. The method for contactless control of IoT devices based on dynamic SSID changes according to claim 4, characterized in that, The mobile terminal establishes a communication connection with the IoT device via TCP or UDP protocol. The mobile terminal sends a control command containing a verification code to the IoT device. The IoT device verifies the verification code and executes the control command after successful verification.
6. The method for contactless control of IoT devices based on dynamic SSID changes according to claim 5, characterized in that, The verification code verification includes: The mobile terminal sends a verification command to the IoT device, and the verification command is in HEX format. The IoT device verifies the verification code. If the verification is successful, it returns a verification success response to the mobile terminal; if the verification fails, it returns a verification failure response. After receiving a verification failure response, the mobile terminal regenerates the verification code and re-initiates the verification.
7. The method for contactless control of IoT devices based on dynamic SSID changes according to claim 1, characterized in that, After a mobile terminal loses connection with an IoT device, the following also applies: After the mobile terminal switches to another available network, it synchronizes data with the backend server and uploads the data of this control operation to the backend server. The mobile terminal initiates a synchronization request to the backend server every preset time interval until it receives a synchronization success response from the backend server.
8. A seamless control system for IoT devices based on dynamically changing SSID, the system being applicable to the method described in any one of claims 1-7, characterized in that, include: IoT devices operate in SoftAP mode, which is used to broadcast SSID, receive and execute control commands sent by the terminal, and automatically change the currently broadcast SSID after the control command is successfully executed; The mobile terminal is used to obtain the device's unique identifier by scanning the QR code on the IoT device, connect to the SSID broadcast by the IoT device, send the control command, and automatically switch to the mobile data network or other networks after detecting a change in the SSID and disconnection.
9. The IoT device seamless control system based on dynamically changing SSID according to claim 8, characterized in that, The IoT devices include: The SSID generation module is used to generate SSIDs that include a fixed prefix, a unique device identifier, a random character sequence, and an auto-incrementing counter value according to preset naming rules. The instruction processing module is used to receive, verify, and execute the control instructions; The SSID change module is used to trigger the reset and update of the SSID after the control command is successfully executed.
10. The IoT device seamless control system based on dynamically changing SSID according to claim 8, characterized in that, The mobile terminal includes: The scanning module is used to parse the QR code and extract the device's unique identifier; The SSID matching module is used to scan the surrounding Wi-Fi signals based on the device's unique identifier and select the target SSID for connection according to the principle of the largest last digit. The network switching module is used to automatically enable mobile data network or other networks after detecting that the original SSID has disappeared and the connection has been lost.