WO2022068601A1 - Network repairing method, electronic device, and mobile terminal - Google Patents

Network repairing method, electronic device, and mobile terminal Download PDF

Info

Publication number
WO2022068601A1
WO2022068601A1 PCT/CN2021/118805 CN2021118805W WO2022068601A1 WO 2022068601 A1 WO2022068601 A1 WO 2022068601A1 CN 2021118805 W CN2021118805 W CN 2021118805W WO 2022068601 A1 WO2022068601 A1 WO 2022068601A1
Authority
WO
WIPO (PCT)
Prior art keywords
antenna
routing device
distance
routing
electronic device
Prior art date
Application number
PCT/CN2021/118805
Other languages
French (fr)
Chinese (zh)
Inventor
甘璐
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from CN202011539963.0A external-priority patent/CN114338356B/en
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2022068601A1 publication Critical patent/WO2022068601A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/04Key management, e.g. using generic bootstrapping architecture [GBA]
    • H04W12/043Key management, e.g. using generic bootstrapping architecture [GBA] using a trusted network node as an anchor
    • H04W12/0431Key distribution or pre-distribution; Key agreement
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/06Authentication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/60Context-dependent security
    • H04W12/63Location-dependent; Proximity-dependent
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W24/00Supervisory, monitoring or testing arrangements
    • H04W24/04Arrangements for maintaining operational condition

Definitions

  • the present application relates to the field of control, and in particular, to a network repair method, an electronic device and a mobile device.
  • IoT Internet of Things
  • a mobile device communicates with other devices in the network through the routing device to which it is connected.
  • most IoT devices cannot directly interact with the mobile device held by the user, and need to route the device to interact with the mobile device. After the IoT device is connected to the routing device through the distribution network, the user controls the IoT device through the mobile device.
  • the mobile device cannot control the IoT device.
  • the IoT device needs to enter the network distribution mode. After the network is connected to the routing device again, the mobile device can control the IoT device again. In this way, the user operation is more complicated.
  • some IoT devices will be reset to factory settings after entering the network configuration mode, which will result in the loss of previously saved data on the IoT device. In this way, it is also not conducive to the subsequent operation of the IoT device by the mobile device.
  • the present application proposes a network repair method, electronic device and mobile device, so that after the routing device identifier or the access password of the routing device is modified, the IoT device can automatically and quickly access the routing device without the need for User operation, without losing previously saved data.
  • a network repair method is provided, which is applied to an electronic device.
  • the electronic device is disconnected from a routing device.
  • the electronic device includes: a processor; a memory; and a first antenna, where the transmission distance of the first antenna is a first distance , the first distance is greater than the preset safety distance; the second antenna, the transmission distance of the second antenna is the second distance, and the second distance is less than or equal to the preset safety distance; wherein, the first antenna and the second antenna are different an antenna; the method includes: reconnecting the routing device using the first distribution network parameters of the routing device through the first antenna; after the reconnection of the routing device fails, periodically sending a first request message through the second antenna; the first request The message includes the session key; the first response message of the mobile device connected to the routing device is received; the first response message includes the encrypted second configuration network parameter; in response to the first response message, the encrypted second The network distribution parameters are obtained, and the second distribution network parameters are obtained; and the second distribution network parameters are used to connect to the routing device through the first
  • the IoT device is disconnected from the routing device, and the automatic reconnection of the routing device fails.
  • the IoT device requests the mobile device to send the new configuration network parameters of the routing device to it through the weak antenna (the weak antenna and the strong antenna are different antennas).
  • the IoT device also sends a session key to the mobile device, which is used by the mobile device to encrypt new configuration parameters. Since the transmission distance of the weak antenna is less than or equal to the preset safe transmission distance, only the mobile device within the safe distance can receive the session key, which can ensure data security.
  • the IoT device uses the new configuration parameters to connect to the routing device. In this way, after the routing device ID or the routing device's access password is modified, the IoT device can automatically and quickly access the routing device without user operation or loss of previously saved data.
  • a network repair method is provided, which is applied to an electronic device, where the connection between the electronic device and the routing device is disconnected, and the electronic device includes: a processor; a memory; distance, the first distance is greater than the preset safe distance; the transmitting distance of the antenna under the second transmit power is the second distance, and the second distance is less than or equal to the preset safe distance; the first transmit power is greater than the second transmit power; the The method includes: reconnecting the routing device by using the first distribution network parameter of the routing device through the antenna under the first transmission power; after the reconnection of the routing device fails, periodically sending the first request through the antenna under the second transmission power message; the first request message includes the session key; the first response message of the mobile device connected to the routing device is received; the first response message includes the encrypted second configuration network parameter; in response to the first response message, the session key Decrypt the encrypted second distribution network parameters to obtain the second distribution network parameters; use the second distribution network parameters to connect to the routing device through the antenna under the first transmit power.
  • the IoT device is disconnected from the routing device, and the automatic reconnection of the routing device fails.
  • the IoT device requests the mobile device to send the new configuration network parameters of the routing device to it through the weak antenna (the weak antenna and the strong antenna are realized by different transmit powers of the same antenna).
  • the IoT device also sends a session key to the mobile device, which is used by the mobile device to encrypt new configuration parameters. Since the transmission distance of the weak antenna is less than or equal to the preset safe transmission distance, only the mobile device within the safe distance can receive the session key, which can ensure data security.
  • the IoT device uses the new configuration parameters to connect to the routing device. In this way, after the routing device ID or the routing device's access password is modified, the IoT device can automatically and quickly access the routing device without user operation or loss of previously saved data.
  • the failure to reconnect to the routing device includes: the number of times that the routing device fails to reconnect is greater than or equal to a preset number of times; or, the duration of reconnecting the routing device is greater than or equal to a preset duration.
  • the method before decrypting the encrypted second network configuration parameter by using the session key, the method further includes: responding to the first response message The signature information in the verification is performed; the signature information is used to indicate the validity of the identity of the mobile device. In this way, IoT devices only use the configuration parameters sent by authorized mobile devices to ensure data security and correctness.
  • the first request message is periodically sent. IoT devices continue to wait to receive new configuration parameters.
  • the routing device is reconnected using the first configuration network parameter of the routing device.
  • the IoT device After the IoT device is disconnected from the routing device, it loops into the automatic reconnection routing device and network repair mode; and so on, until the IoT device automatically connects to the routing device successfully or reconfigures the network successfully. There is no need for users to manually reset the IoT device to restore the network connection, which is convenient and fast, and the success rate of network recovery is high.
  • the electronic device periodically broadcasts the first request message if the number of times the electronic device periodically broadcasts the first request message is greater than the set number of times; or, the electronic device periodically broadcasts the first request message. If the duration of a request message is greater than the set duration; then switch to using a strong antenna to communicate with other devices. In this way, after the IoT device sends the first request message, in subsequent steps, a strong antenna can be used to exchange information with the mobile device, and the user does not need to carry the mobile device close to the IoT device for a long time.
  • the IoT device receives the second network configuration parameter of the routing device; then switches to using a strong antenna to communicate with other devices. In this way, data between IoT devices and mobile devices all use weak antennas for interaction, ensuring data security.
  • an electronic device in which the connection between the electronic device and the routing device is disconnected, wherein the electronic device includes: a processor; a memory; The distance is greater than the preset safety distance; the second antenna, the transmission distance of the second antenna is the second distance, and the second distance is less than or equal to the preset safety distance; wherein, the first antenna and the second antenna are different antennas; and A computer program, wherein the computer program is stored on the memory, and when the computer program is executed by the processor, the electronic device executes: reconnecting the routing device using the first distribution network parameters of the routing device through the first antenna; the first distribution network The parameters include the first device identifier of the routing device and the first access password; after the reconnection of the routing device fails, periodically send a first request message through the second antenna; the first request message includes the session key; The first response message to the mobile device of the routing device; the first response message includes the encrypted second configuration network parameter; in response to the first response message, decrypt the encrypted second configuration network parameter through the session key, and obtain
  • an electronic device wherein the connection between the electronic device and the routing device is disconnected, wherein the electronic device comprises: a processor; a memory; and an antenna, and the transmission distance of the antenna under the first transmission power is the first distance, The first distance is greater than the preset safety distance; the transmission distance of the antenna under the second transmission power is the second distance, and the second distance is less than or equal to the preset safety distance; the first transmission power is greater than the second transmission power; and the computer program , wherein the computer program is stored on the memory, and when the computer program is executed by the processor, the electronic device is made to execute: reconnect the routing device using the first distribution network parameters of the routing device through the antenna under the first transmit power; the first distribution network The parameters include the first device identifier and the first access password of the routing device; after the reconnection of the routing device fails, the first request message is periodically sent through the antenna under the second transmit power; the first request message includes the session key ; Receive the first response message of the mobile device connected to the routing device; the first
  • the failure to reconnect to the routing device includes: the number of times that the routing device fails to reconnect is greater than or equal to a preset number of times; or, the duration of reconnecting the routing device is greater than or equal to a preset duration.
  • the electronic device when the computer program is executed by one or more processors, the electronic device also causes the electronic device to execute: after decrypting with the session key Before encrypting the second network configuration parameters, verify the signature information in the first response message; the signature information is used to indicate the identity validity of the mobile device. If the verification of the signature information in the first response message fails, the first request message is periodically sent.
  • the computer program when executed by the one or more processors, the computer program further causes the electronic device to execute: if not The second network configuration parameter is obtained, and the first configuration network parameter of the routing device is used to reconnect the routing device.
  • the electronic device periodically broadcasts the first request message if the number of times the electronic device periodically broadcasts the first request message is greater than the set number of times; or, the electronic device periodically broadcasts the first request message. If the duration of a request message is greater than the set duration; then switch to using a strong antenna to communicate with other devices. In this way, after the IoT device sends the first request message, in subsequent steps, a strong antenna can be used to exchange information with the mobile device, and the user does not need to carry the mobile device close to the IoT device for a long time.
  • the electronic device receives the second network distribution parameter of the routing device; then switches to using a strong antenna to communicate with other devices. In this way, data between IoT devices and mobile devices all use weak antennas for interaction, ensuring data security.
  • the third aspect and any implementation manner of the third aspect correspond to the first aspect and any implementation manner of the first aspect, respectively.
  • the technical effects corresponding to the third aspect and any implementation manner of the third aspect reference may be made to the technical effects corresponding to the first aspect and any implementation manner of the first aspect, which will not be repeated here.
  • the fourth aspect and any implementation manner of the fourth aspect correspond to the second aspect and any implementation manner of the second aspect, respectively.
  • the technical effects corresponding to the fourth aspect and any implementation manner of the fourth aspect reference may be made to the technical effects corresponding to the second aspect and any implementation manner of the second aspect, which will not be repeated here.
  • a fifth aspect provides a network repair method, which is applied to a network repair system, the system includes a mobile device, an electronic device and a routing device; the mobile device is connected to the routing device using the second distribution network parameter, and the mobile device is disconnected from the electronic device through the The connection established by the routing device; the electronic device includes: a first antenna, the transmission distance of the first antenna is the first distance, and the first distance is greater than the preset safety distance; the second antenna, the transmission distance of the second antenna is the second distance, The second distance is less than or equal to a preset safety distance; wherein the first antenna and the second antenna are different antennas; the method includes: the electronic device reconnects the routing device through the first antenna and using the first distribution network parameter of the routing device ; The first distribution network parameter includes the first device identification and the first access password of the routing device; after the reconnection of the routing device fails, the electronic device periodically sends the first request message through the second antenna; the first request message includes a session key; within a second distance from the electronic device, the mobile device receives
  • the fifth aspect corresponds to the first aspect.
  • the technical effect of the fifth aspect reference may be made to the technical effect of the above-mentioned first aspect, which will not be repeated here.
  • a network repair method is provided, applied to a network repair system, the system includes a mobile device, an electronic device and a routing device; the mobile device is connected to the routing device using the second distribution network parameter, and the mobile device is disconnected from the electronic device through the The connection established by the routing device; the electronic device includes: an antenna, the transmission distance of the antenna under the first transmission power is the first distance, and the first distance is greater than the preset safety distance; the transmission distance of the antenna under the second transmission power is the second distance distance, the second distance is less than or equal to the preset safety distance; the first transmit power is greater than the second transmit power; the method includes: the electronic device reconnects by using the first distribution network parameters of the routing device through the antenna under the first transmit power a routing device; the first network distribution parameter includes a first device identifier and a first access password of the routing device; after the reconnection to the routing device fails, the electronic device periodically sends a first request message through the antenna under the second transmit power
  • the first request message includes a session key; within
  • the sixth aspect corresponds to the second aspect.
  • the technical effect of the sixth aspect reference may be made to the technical effect of the second aspect, which will not be repeated here.
  • a network repair system including a mobile device, an electronic device, and a routing device; the mobile device is connected to the routing device using the second network distribution parameter, the mobile device and the electronic device are disconnected from the connection established by the routing device, and the mobile device comprising: a first processor; a first memory; and a first computer program, wherein the first computer program is stored on the first memory, and when the first computer program is executed by the first processor, causes the mobile device to perform the following steps : within the second distance from the electronic device, the first request message of the electronic device is received; the first request message includes the session key; the second distance is less than or equal to the preset safe distance; in response to the first request message, the The electronic device sends a first response message; the first response message includes the second network configuration parameter encrypted by the session key, and the second network configuration parameter includes the second device identification and the second access password of the routing device; the electronic device includes: two processors; a second memory; a first antenna, the transmission distance of the first antenna is the first
  • the seventh aspect corresponds to the first aspect.
  • the technical effect of the seventh aspect reference may be made to the technical effect of the above-mentioned first aspect, which will not be repeated here.
  • a network repair system including a mobile device, an electronic device, and a routing device; the mobile device is connected to the routing device using the second network distribution parameter, the mobile device and the electronic device are disconnected from the connection established by the routing device, and the mobile device comprising: a first processor; a first memory; and a first computer program, wherein the first computer program is stored on the first memory, and when the first computer program is executed by the first processor, causes the mobile device to perform the following steps: Within a second distance from the electronic device, the first request message of the electronic device is received; the first request message includes the session key; the second distance is less than or equal to the preset safe distance; in response to the first request message, the electronic device is sent to the electronic device.
  • the electronic device includes: a second process a second memory; an antenna, the transmission distance of the antenna under the first transmission power is the first distance, and the first distance is greater than the preset safety distance; the transmission distance of the antenna under the second transmission power is the second distance, the second distance The distance is less than or equal to a preset safety distance; the first transmit power is greater than the second transmit power; and a second computer program, wherein the second computer program is stored on the second memory, when the second computer program is executed by the second processor , so that the electronic device executes: reconnecting the routing device using the first distribution network parameter of the routing device through the antenna under the first transmit power; the first distribution network parameter includes the first device identification and the first access password of the routing device; After the reconnection of the routing device fails, the first request message is periodically sent through the antenna under the second transmit power; the first request message includes
  • the eighth aspect corresponds to the second aspect.
  • the technical effect of the eighth aspect reference may be made to the technical effect of the second aspect, which will not be repeated here.
  • a computer-readable storage medium includes a computer program that, when executed on an electronic device, causes the electronic device to perform a method such as the first aspect or the second aspect, or any one of the above first or second aspects. .
  • the ninth aspect and any implementation manner of the ninth aspect respectively correspond to the first aspect or the second aspect, or any implementation manner of the above first aspect or the second aspect.
  • the technical effects corresponding to the ninth aspect and any one of the implementations of the ninth aspect refer to the above-mentioned first aspect or the second aspect, or the technical effects corresponding to any one of the above-mentioned first or second aspects. It will not be repeated here.
  • a computer program product When run on a computer, it causes the computer to perform the method of the first aspect or the second aspect, or any one of the implementations of the above first or second aspect.
  • the tenth aspect and any implementation manner of the tenth aspect respectively correspond to the first aspect or the second aspect, or any implementation manner of the above first aspect or the second aspect.
  • the technical effects corresponding to the tenth aspect and any one of the implementations of the tenth aspect refer to the above-mentioned first aspect or the second aspect, or the technical effects corresponding to any one of the above-mentioned first or second aspects. It will not be repeated here.
  • FIG. 1 is a schematic diagram of a scenario of a method for repairing an IoT device network provided by an embodiment of the present application
  • FIGS. 2A-2C are schematic diagrams of an initial network distribution process of IoT devices provided by an embodiment of the present application.
  • 3A-3B are schematic diagrams of a disconnection process between an IoT device and a routing device according to an embodiment of the present application
  • FIG. 4 is a schematic diagram of a hardware structure of an IoT device provided by an embodiment of the present application.
  • 5A is a schematic structural diagram of a wireless communication module and an antenna in an IoT device provided by an embodiment of the present application;
  • 5B is a schematic structural diagram of another wireless communication module and an antenna in an IoT device provided by an embodiment of the present application;
  • 6A-6C are schematic diagrams of specific structures in a wireless communication module and an antenna provided by an embodiment of the present application;
  • FIG. 7 is a schematic diagram of two transmission distances in a method for repairing an IoT device network provided by an embodiment of the present application.
  • 8A-FIG. 10 are schematic flowcharts of a method for repairing an IoT device network according to an embodiment of the present application.
  • Fig. 11 is the schematic diagram of the graphical user interface of IoT APP in the IoT device network repair method provided by the embodiment of this application;
  • FIG. 12 is a schematic flowchart of a method for repairing an IoT device network provided by an embodiment of the present application
  • FIG. 13 is a schematic diagram of a graphical user interface of an IoT APP in a method for repairing an IoT device network provided by an embodiment of the present application;
  • FIG. 14 and 15 are schematic flowcharts of a method for repairing an IoT device network according to an embodiment of the present application
  • 16 is a schematic diagram of a scenario example of a method for repairing an IoT device network provided by an embodiment of the present application.
  • 17 is a schematic flowchart of a method for repairing a network of an IoT device provided by an embodiment of the present application.
  • FIG. 18 is a schematic structural composition diagram of an IoT device according to an embodiment of the present application.
  • references in this specification to "one embodiment” or “some embodiments” and the like mean that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application.
  • appearances of the phrases “in one embodiment,” “in some embodiments,” “in other embodiments,” “in other embodiments,” etc. in various places in this specification are not necessarily All refer to the same embodiment, but mean “one or more but not all embodiments” unless specifically emphasized otherwise.
  • the terms “including”, “including”, “having” and their variants mean “including but not limited to” unless specifically emphasized otherwise.
  • the term “connected” includes both direct and indirect connections unless otherwise specified.
  • first and second are only used for descriptive purposes, and should not be construed as indicating or implying relative importance or implicitly indicating the number of indicated technical features.
  • a feature defined as “first” or “second” may expressly or implicitly include one or more of that feature.
  • words such as “exemplarily” or “for example” are used to represent examples, illustrations or illustrations. Any embodiment or design described in the embodiments of the present application as “exemplarily” or “such as” should not be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as “exemplarily” or “such as” is intended to present the related concepts in a specific manner.
  • the Internet of Things refers to the real-time acquisition of sound, light, heat, electricity, mechanics, chemistry, biology, location, etc. All kinds of needed information, through various possible network access, realize the ubiquitous connection between things and things, things and people, and realize the intelligent perception, identification and management of objects and processes.
  • the Internet of Things is an information carrier based on the Internet, traditional telecommunication networks, etc. It enables all common physical objects that can be independently addressed to form an interconnected network.
  • IoT devices such as IoT lights, IoT speakers, IoT refrigerators, etc.
  • IoT devices are electronic devices that are remotely or remotely controlled and/or monitored via IoT.
  • smart home appliances are typical IoT devices.
  • FIG. 1 is a schematic diagram of a scenario of a method for repairing a network of an IoT device provided by an embodiment of the present application.
  • network system 100 may include mobile device 110 , routing device 120 and IoT device 130 .
  • the network system 100 also includes an IoT server 140 .
  • the IoT server 140 may be a local server or a cloud server.
  • the mobile device 110 is used to configure and control the IoT device 130 .
  • the mobile device 110 may share control of the IoT device 130 to other devices for control.
  • the mobile device 110 may be a mobile device with an IoT application (application, APP) installed.
  • IoT application application, APP
  • mobile device 110 includes, but is not limited to, onboard Portable devices for Windows, Linux or other operating systems. It should also be understood that in some other embodiments, the mobile device 110 may not be a portable device, but a desktop computer.
  • the routing device 120 is used to provide a network access service for the IoT device 130 .
  • the IoT device 130 may access the wireless local area network provided by the routing device 120 .
  • the routing device 120 corresponds to a routing device identifier, and the IoT device 130 can access the routing device 120 through the routing device identifier.
  • the routing device identifier is a service set identifier (SSID).
  • the mobile device 110 may control the IoT device 130 through the routing device 120 .
  • the IoT device 130 may be a smart home device (eg, smart TV, smart refrigerator, smart air conditioner, smart washing machine, smart speaker, smart rice cooker, smart chandelier, smart desk lamp, smart camera, smart circulation fan, smart door lock, smart socket, smart Power strips, smart humidifiers, smart robot vacuums, smart range hoods, etc.), portable computers (eg, smartphones, tablets, laptops, etc.), wearable devices (eg, smart watches, smart glasses, smart headphones, etc.) , smart bracelet, smart ring, smart helmet, etc.), augmented reality (AR) ⁇ virtual reality (virtual reality, VR) equipment, car computer, etc.
  • the specific form of the IoT device 130 is not particularly limited in this embodiment of the present application.
  • the network system 100 may also include an IoT server 140 .
  • the IoT server 140 may be used to store the device information of the mobile device 110 , the account information of the IoT APP on the mobile device 110 , the device information of the IoT device 130 , the correspondence between the mobile device 110 and the IoT device 130 , and the device sharing information of the IoT device 130 at least one of etc.
  • the IoT server 140 can also be used for message forwarding, message push, etc. between the mobile device 110 and the IoT device 130 under the remote control of the mobile device 110 .
  • the IoT server 140 may provide services such as status query for the mobile device 110 .
  • the IoT server 140 may be a local server (such as an enterprise local server), a cloud server (such as a home cloud server), etc., or a server cluster composed of multiple servers.
  • the mobile device 110 has previously accessed the routing device 120 and stores the SSID and access password of the routing device 120 .
  • the IoT device 130 enters the network configuration mode.
  • the IoT device 130 switches its Wi-Fi module to an access point (access point, AP) state.
  • the mobile device 110 can search for the SSID of the IoT device 130 through the IoT APP, and the mobile device 110 accesses the SSID of the IoT device 130 to establish communication with the IoT device 130.
  • Mobile device 110 sends the SSID and access password of routing device 120 to IoT device 130 .
  • the above-mentioned sending of the SSID and the access password of the routing device 120 may be sent after encryption.
  • mobile device 110 (IoT APP on mobile device 110) and IoT device 130 exchange respective identity credentials with each other.
  • the mobile device 110 and the IoT device 130 respectively generate their own public and private key pairs, and the mobile device 110 (the IoT APP on the mobile device 110) and the IoT device 130 send their own public keys to the other party, and save the other party's public key.
  • the IoT device 130 switches its Wi-Fi module to the station state, and uses the SSID and access password of the routing device 120 to access Routing device 120.
  • the IoT device 130 is connected to the routing device 120 , and the mobile device 110 disconnects the Wi-Fi connection with the IoT device 130 .
  • the mobile device 110 automatically searches for the SSID of the Wi-Fi of the routing device 120, and uses the previously saved access password to access the routing device 120, as shown in FIG. 2C .
  • the IoT device 130 may be newly purchased by the user, or may be moved by the user from another place to connect to the routing device 120 .
  • the user lives in a villa with two floors. There is one routing device upstairs and one downstairs. The user moves the IoT device 130 upstairs to the downstairs for connecting the routing device 120 downstairs.
  • the IoT device 130 and the mobile device 110 may also establish communication via Bluetooth. That is, the mobile device 110 sends the previously saved SSID and access password of the routing device 120 to the IoT device 130 through Bluetooth.
  • the above-mentioned Bluetooth communication can also be replaced by other short-range communication methods. It will not be expanded here.
  • the above-mentioned SSID can also be replaced with other identifiers. As long as each device can locate the corresponding device through the identifier.
  • the IoT device 130 communicates with the routing device 120 normally. For example, the IoT device 130 receives the control message sent by the mobile device 110 through the routing device 120, and executes the corresponding function. After that, if at least one of the device identification (eg, SSID) and the access password of the routing device 120 is modified, the IoT device 130 will be disconnected from the routing device 120, as shown in FIG. 3B . The IoT device 130 is still unable to re-connect to the routing device 120 after many attempts.
  • the device identification eg, SSID
  • the IoT device 130 it is usually necessary to manually reset the IoT device 130 to make it re-enter the network distribution mode, and perform the network distribution process of FIG. 2A-FIG. 2B again.
  • the IoT device 130 can enter the network configuration mode by pressing the physical button.
  • the user also needs to re-enter the relevant information (such as the SSID and access password of the routing device 120) on the IoT APP, and click the relevant button again, which is cumbersome to operate and has a poor user experience.
  • some manufacturers' IoT devices will automatically restore the factory settings after pressing the above physical buttons and before entering the network configuration mode.
  • the factory settings are automatically restored, and then the network configuration mode is entered.
  • the data previously saved by the IoT device (such as some memory data closely related to the user) will be lost, causing inconvenience to the user.
  • the IoT lock was previously set to automatically unlock when the mobile device of the male owner approaches from the outside to the inside, and make a sound of "Dad is back"; the IoT lock was also set to automatically unlock when the mobile device of the female owner approaches from the outside to the inside. Open the lock and make a sound of "Mom is back".
  • the IoT lock is restored to factory settings, the user needs to set the relevant parameters again, which brings inconvenience to the user.
  • An embodiment of the present application provides a network repair method for an IoT device. After at least one of an identifier of a routing device and an access password is modified, causing the IoT device to disconnect from the routing device, the IoT device is automatically connected to the routing device. .
  • the method does not require user operation, nor does it need to restore the IoT device to factory settings, so that the IoT device can be automatically and quickly connected to the routing device.
  • FIG. 4 shows a schematic structural diagram of the IoT device 130 .
  • the IoT device 130 may be a mobile device or a fixed device (such as a wall-mounted smart air conditioner).
  • the IoT device 130 may include a processor 131, an internal memory 132, an external memory interface 133, a universal serial bus (USB) interface 134, a charge management module 136, a power management module 137, a battery 138, an antenna 1, an antenna 2 , the wireless communication module 135, the sensor module 139, etc.
  • USB universal serial bus
  • the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the IoT device 130 .
  • the IoT device 130 may include more or less components than shown, or combine some components, or separate some components, or arrange different components.
  • the illustrated components may be implemented in hardware, software, or a combination of software and hardware.
  • the processor 131 may include one or more processing units.
  • the processor 131 may include an application processor, a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal A digital signal processor (DSP), a baseband processor, and/or a neural-network processing unit (NPU), etc.
  • different processing units may be independent components, or may be integrated in one or more processors.
  • IoT device 130 may also include one or more processors 131 .
  • the controller can generate an operation control signal according to the instruction operation code and the timing signal, and complete the control of fetching and executing instructions.
  • the processor 131 may include one or more interfaces.
  • the interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver (universal asynchronous receiver) /transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, SIM card interface, and/or USB interface, etc.
  • the USB interface 230 is an interface that conforms to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like.
  • the USB interface 230 can be used to connect a charger to charge the IoT device 130, and can also be used to transmit data between the IoT device 130 and peripheral devices.
  • the interface connection relationship between the modules illustrated in the embodiments of the present application is only a schematic illustration, and does not constitute a structural limitation of the IoT device 130 .
  • the IoT device 130 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
  • the charging management module 136 is used to receive charging input from the charger.
  • the charger may be a wireless charger or a wired charger.
  • the charging management module 136 may receive charging input from the wired charger through the USB interface 134 .
  • the charging management module 136 may receive wireless charging input through the wireless charging coil of the IoT device 130 . While the charging management module 136 charges the battery 138, the IoT device 130 can also be powered by the power management module 137.
  • the power management module 137 is used to connect the battery 138 , the charge management module 136 and the processor 131 .
  • the power management module 137 receives input from the battery 138 and/or the charge management module 136, and supplies power to the processor 131, the internal memory 132, the external memory interface 133, the wireless communication module 135, and the like.
  • the power management module 137 can also be used to monitor parameters such as battery capacity, battery cycle times, battery health status (leakage, impedance).
  • the power management module 137 may also be provided in the processor 131 .
  • the power management module 137 and the charging management module 136 may also be provided in the same device.
  • the wireless communication function of the IoT device 130 may be implemented by the antenna 1, the antenna 2, the wireless communication module 135, and the like.
  • the wireless communication module 135 may provide wireless communication solutions including Wi-Fi, Bluetooth (BT), and wireless data transmission modules (eg, 433MHz, 868MHz, 915MHz) applied to the IoT device 130 .
  • the wireless communication module 135 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 135 receives electromagnetic waves via the antenna 1 or the antenna 2 , filters and frequency modulates the electromagnetic wave signals, and sends the processed signals to the processor 131 .
  • the wireless communication module 135 can also receive the signal to be sent from the processor 131 , perform frequency modulation on it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 1 or the antenna 2 .
  • the IoT device 130 may send a broadcast message through the wireless communication module, and the broadcast message may carry the device identifier or product identifier of the IoT device 130, which is used by a second device around to discover the IoT device.
  • the IoT device 130 may also receive a message sent by the second device through the wireless communication module.
  • the external memory interface 133 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the IoT device 130 .
  • the external memory card communicates with the processor 131 through the external memory interface 133 to realize the data storage function. For example to save files like music, video etc in external memory card.
  • Internal memory 132 may be used to store one or more computer programs including instructions.
  • the processor 131 may execute the above-mentioned instructions stored in the internal memory 132, thereby causing the IoT device 130 to execute the IoT device network repair method, various applications and data processing provided in some embodiments of the present application.
  • Internal memory 132 may include code storage areas and data storage areas. Among them, the code storage area can store the operating system. The data storage area may store data and the like created during use of the IoT device 130 .
  • the internal memory 132 may include high-speed random access memory, and may also include non-volatile memory, such as one or more disk storage components, flash memory components, universal flash storage (UFS), and the like.
  • the processor 131 may execute the instructions stored in the internal memory 132 and/or the instructions stored in the memory provided in the processor 131 to cause the IoT device 130 to execute the instructions provided in the embodiments of the present application IoT device network repair methods, and other applications and data processing.
  • FIG. 5A shows a structure of the above IoT device.
  • the IoT device 130 may include a processor 131 , a wireless communication module 135 , an antenna 1 and an antenna 2 .
  • antenna 1 such as a strong antenna
  • antenna 2 such as a weak antenna
  • the wireless communication module 135 converts the electromagnetic wave received from the antenna 1 or the antenna 2 into a signal, and sends the signal to the processor 131 for processing; or the wireless communication module 135 receives the signal to be sent from the processor 131, via a strong antenna Or weak antennas turn into electromagnetic waves and radiate out.
  • the first transmission distance such as 10 meters, 50 meters, etc., which can be set by the user
  • the second transmission distance of the signal transmitted by the weak antenna such as 0.2 meters, 0.3 meters, etc., specifically can be set by the user).
  • the second transmission distance of the weak antenna transmission signal is less than or equal to the preset safe transmission distance; wherein, the safe transmission distance is the safe distance for the owner of the IoT device 130 to exchange secret information with the IoT device 130 through the mobile device.
  • the safe transmission distance can be The default settings are 100cm, 50cm, 30cm, 20cm, etc., so that the owner of the IoT device 130 can receive the secret information sent by the IoT device 130 at a distance of up to 100cm, so as to avoid unsafe behaviors (such as stealing routing device access) password), to ensure network security and other aspects of security.
  • the processor 131 may control the switching of strong antennas and weak antennas.
  • the mobile device When the IoT device 130 adopts a strong antenna, the mobile device receives the signal sent by the IoT device 130 only when the distance between the mobile device and the IoT device 130 is less than the first transmission distance; when the IoT device 130 adopts a weak antenna, The mobile device receives the signal sent by the IoT device 130 only when the distance between the mobile device and the IoT device 130 is smaller than the second transmission distance.
  • the first transmission distance and the second transmission distance may be referred to as a first distance and a second distance, respectively.
  • FIG. 5B shows another structure of the above IoT device.
  • the IoT device 130 may include a processor 131 , a wireless communication module 135 and an antenna 1 .
  • the wireless communication module 135 includes a wireless module 1351 and a variable impedance circuit module 1352 .
  • Antenna 1 is used to transmit and receive wireless signals.
  • the variable impedance circuit module 1352 may be a circuit composed of variable impedance, an integrated circuit, or the like.
  • the processor 131 controls and adjusts the resistance value of the variable impedance circuit module 1352 to adjust the power loaded on the antenna 1, thereby controlling the transmission distance of the antenna 1 when transmitting wireless signals.
  • the transmission power of the antenna 1 is the second transmission power
  • the distance for transmitting the wireless signal is the first transmission distance (to realize the function of a strong antenna)
  • the transmission power of the antenna 1 is the first transmission power
  • the distance for transmitting wireless signals is the second transmission distance (to realize the function of a weak antenna).
  • the first transmission power is less than the second transmission power
  • the first transmission distance is greater than the second transmission distance
  • the second transmission distance is less than or equal to the preset safe transmission distance.
  • the first transmission distance and the second transmission distance may be referred to as a first distance and a second distance, respectively.
  • the structures illustrated in the embodiments of the present application do not constitute a specific limitation on IoT devices.
  • the IoT device may include more or less components than shown, or some components may be combined, or some components may be split, or different component arrangements.
  • the illustrated components may be implemented in hardware, software, or a combination of software and hardware.
  • the above-mentioned strong antenna and weak antenna may share a part of the wiring, for example, as described in the embodiments shown in FIGS. 6A-6C .
  • Figures 6A-6C illustrate three implementations of the weak antenna in Figure 5A.
  • the strong antenna and the weak antenna may share a part of the wiring.
  • the strong antenna and the weak antenna in the IoT device in the embodiment of the present application can be switched by a radio frequency switch.
  • both the weak antenna and the radio frequency switch (the weak antenna shown in the dashed box in FIG. 6A-FIG. 6C ) can be placed in the shielding case or the weak antenna can be placed in the chip.
  • the purpose of the weak antenna in the embodiment of the present application is to reduce the transmission distance as much as possible.
  • the principle of constructing a weak antenna can be:
  • weak antenna The specific implementation of weak antenna can be used:
  • the function of the above-mentioned shielding cover is to cut off the path from the electromagnetic wave radiated by the antenna to the receiver, so as to achieve the purpose of weakening the radiation.
  • the above-mentioned shortening of the antenna means that the weak antenna is shorter than the strong antenna.
  • the structures of the three weak antennas are shown in FIGS. 6A to 6C , and the weak antennas are shown as the structures in the dotted boxes in FIGS. 6A to 6C .
  • the structures of the strong antennas shown in FIGS. 6A to 6C are connected to a filter circuit (eg, a ⁇ -type circuit), a matching circuit (eg, a ⁇ -type circuit) and a matching circuit through radio frequency input/output (RFIO) pins.
  • External antenna body eg, the antenna body may be a length of metal trace).
  • the weak antenna shown in the dashed box in FIG.
  • the weak antenna b shown in the dashed box in FIG. 6B , and the weak antenna c shown in the dashed box in FIG. 6C have different lengths, but are shorter than the strong antennas.
  • the function of the filter circuit is to prevent interference, and the matching circuit is used to match the strong antenna.
  • the weak antenna a may be located in the shield.
  • the weak antenna a may include the RFIO pin of the Wi-Fi chip in the shield and the first switch of the 2 switches (the first switch is not connected to any device).
  • the weak antenna a may also include a trace between the RFIO pin and the first switch.
  • the 2-way switch refers to the switch between the trace or RFIO pin and the filter circuit. Through the 2-way switch, the trace or RFIO pin can be connected or disconnected from the filter circuit.
  • the first switch is the switch shown in FIG. 6A that is connected to the RFIO pin or trace and disconnected from the filter circuit. It should be understood that the 2-way switch in the embodiment of the present application may be a single-pole double-throw switch.
  • the weak antenna b may be located in the shielding case.
  • the weak antenna b may include the RFIO pin of the Wi-Fi chip in the shield, the first switch of the 2-way switch (the first switch is connected to a resistor), and a matching device.
  • the weak antenna b may also include a first trace between the RFIO pin and the first switch.
  • the weak antenna b may also include a second trace between the matching device and the ground.
  • the matching device can be a resistor. Part of the electromagnetic wave radiation can be converted into heat energy and consumed by grounding the resistance, thereby reducing the radiation efficiency of the weak antenna b.
  • the 2-way switch refers to the switch between the RFIO pin or the first trace and the resistor and filter circuit. Through this switch, the RFIO pin or the first trace can be connected to the resistor and disconnected from the filter circuit. On, or the RFIO pin or the first trace can be disconnected from the resistor and connected to the filter circuit.
  • the first switch is a switch connected to the matching device and disconnected from the filter circuit among the two switches.
  • the weak antenna c may be located in the shield.
  • the filter circuit matched by the chip is followed by a matching device (for example, a resistor) to the ground.
  • the weak antenna c may include the RFIO pin of the Wi-Fi chip in the shield, the filter circuit, the first switch of the 2-way switch (the first switch is connected to a resistor), and a matching device (eg, a resistor).
  • the weak antenna c may also include a first trace between the RFIO pin and the filter circuit.
  • the weak antenna c may further include a second trace between the filter circuit and the matching device.
  • the 2-way switch refers to the switch between the filter circuit inside the shield, the matching device, and the matching circuit outside the shield.
  • the first switch is a switch used to connect the filter circuit and the matching device in the shield.
  • the above-mentioned strong antennas in FIGS. 6A to 6B may include RFIO pins, the second switch among the 2-way switches, a filter circuit, a matching circuit, and an antenna body externally connected to the matching circuit.
  • the strong antenna in FIGS. 6A to 6B may also include a trace between the RFIO pin and the second switch of the 2-way switches.
  • the second switch is a switch used to connect the RFIO pin and the filter circuit.
  • the above-mentioned strong antenna in FIG. 6C may include an RFIO pin, a filter circuit, a second switch in the 2-way switch, a matching circuit, and an antenna body connected outside the matching circuit.
  • the strong antenna in Figure 6C can also include traces between the RFIO pins and the filter circuit.
  • the second switch is a switch used to connect the filter circuit inside the shield and the matching circuit outside the shield.
  • the wireless communication module 135 shown in FIG. 5A may be a Wi-Fi chip, or may be a Wi-Fi chip and its matching circuit.
  • the wireless module 1351 shown in FIG. 5B may be a Wi-Fi chip, and the wireless communication module 135 shown in FIG. 5B may be a Wi-Fi chip and its matching circuit.
  • the above different weak antenna structures, together with the different transmit power (Tx power) settings of the Wi-Fi chip, can meet different ultra-short-range communication requirements (for example, from 10cm to 2m).
  • Table 1 shows the communication distances of several different weak antenna structures with different transmit powers.
  • the thickness of the smart air conditioner housing may be different, so under the condition of the same weak antenna structure and the same transmit power, the communication distance at which the smart air conditioner can be discovered may also be different.
  • the user can set the transmit power for the three weak antennas (weak antenna a, weak antenna b and weak antenna c) according to Table 1, and adjust the transmit power according to the test results, so that the weak antenna can reach the corresponding distance when transmitting.
  • the IoT device adopts a strong antenna, if the distance between the IoT device and other devices (such as mobile devices) is less than the first distance (such as the mobile device is at position 1 as shown in Figure 7), the IoT device can communicate with other devices (such as mobile devices) device) communication; when the IoT device adopts a weak antenna, if the distance between the IoT device and other devices (such as mobile devices) is less than the second distance (such as other devices located at position 2 shown in Figure 7), the IoT device can communicate with other devices device (eg mobile device) communication.
  • a strong antenna if the distance between the IoT device and other devices (such as mobile devices) is less than the first distance (such as the mobile device is at position 1 as shown in Figure 7), the IoT device can communicate with other devices (such as mobile devices) device) communication; when the IoT device adopts a weak antenna, if the distance between the IoT device and other devices (such as mobile devices) is less than the second distance (such as other devices
  • the IoT device network repair method provided in this embodiment of the present application may be applied to the system shown in any one of FIG. 1 to FIG. 2C .
  • the method may include:
  • the IoT device is connected to the routing device.
  • the method for the IoT device to connect to the routing device may include:
  • the mobile device configures the IoT device to a network.
  • the IoT device and the mobile device discover each other through Bluetooth, and establish a Bluetooth connection.
  • the user may input the first network configuration parameter on the mobile device (for example, the first configuration network parameter includes the first device identifier and the first access password of the routing device).
  • the mobile device sends the first network configuration parameter to the IoT device through Bluetooth.
  • the IoT device after the IoT device is started, it switches its own Wi-Fi module to the AP state; the user enters the device ID and AP password of the IoT device on the mobile device, and the mobile device establishes communication with the IoT device.
  • the user inputs the first network configuration parameter on the mobile device (for example, the first network configuration parameter includes the first device identifier and the first access password of the routing device).
  • the mobile device sends the first network configuration parameter to the IoT device.
  • the IoT device connects to the routing device according to the received first distribution network parameter.
  • the IoT device after the IoT device is configured with the network, it registers with the IoT server, so that it can receive services from the IoT server.
  • the method may also include:
  • the IoT device registers with the IoT server.
  • the IoT server sends the local authentication control code to the IoT device.
  • the IoT server sends the local authentication control code to the mobile device.
  • a method for connecting an IoT device to a routing device may include:
  • the mobile device configures the IoT device; and the mobile device and the IoT device exchange identity credentials.
  • the IoT device and the mobile device discover each other through Bluetooth, and establish a Bluetooth connection.
  • the user may input the first network configuration parameter on the mobile device (for example, the first configuration network parameter includes the first device identifier and the first access password of the routing device).
  • the mobile device sends the first network configuration parameter to the IoT device through Bluetooth.
  • the IoT device After the IoT device is started, it switches its own Wi-Fi module to the AP state; the user enters the device ID and AP password of the IoT device on the mobile device, and the mobile device establishes communication with the IoT device.
  • the user inputs the first network configuration parameter on the mobile device (for example, the first network configuration parameter includes the first device identifier and the first access password of the routing device).
  • the mobile device sends the first network configuration parameter to the IoT device.
  • Mobile and IoT devices send their own credentials to each other.
  • the mobile device (IoT APP on the mobile device) and the IoT device respectively generate their own public and private key pairs, and the mobile device and the IoT device respectively send their own public keys to each other, and save the other party's public key.
  • the identity certificate of the mobile device is the public key of the mobile device; the identity certificate of the IoT device is the public key of the IoT device.
  • the IoT device connects to the routing device according to the received first distribution network parameter.
  • IoT devices are registered to the IoT server.
  • the mobile device and the IoT device exchange identity credentials; in the subsequent process, even if the mobile device and the IoT device relay messages through the IoT server, the identity credentials are authenticated.
  • the IoT device is disconnected from the routing device.
  • the IoT device may be disconnected from the routing device. For example, if the routing device fails, the device ID of the routing device is modified, or the access password of the routing device is modified, the IoT device will be disconnected from the routing device.
  • the IoT device fails to automatically reconnect to the routing device.
  • the IoT device detects that it is disconnected from the routing device, and initiates the process of automatically reconnecting the routing device using the saved device ID and access password of the routing device. If the IoT device is disconnected from the routing device due to a short-term failure of the routing device, the IoT device can repair the network connection by automatically reconnecting the routing device. If the device ID of the routing device is modified, the access password of the routing device is modified, etc., because the network configuration parameters used by the IoT device remain unchanged when the routing device is automatically reconnected, the network cannot be repaired by automatically reconnecting the routing device. connect. The IoT device fails to automatically reconnect to the routing device m times.
  • the IoT device obtains the device identification and access password of the routing device from the mobile device.
  • the IoT device triggers network reconfiguration, sends a network repair request to the mobile device, and requests the mobile device to send network configuration parameters.
  • the mobile device receives the device ID and access password of the routing device entered by the user, or obtains the device ID and access password of the routing device stored locally, and sends the IoT device network configuration parameters to the IoT device.
  • the IoT device reconnects the routing device according to the obtained device identification and access password of the routing device.
  • the IoT device receives the network configuration parameters and reconnects the routing device according to the network configuration parameters.
  • the IoT device network repair method provided by the embodiments of the present application, after the IoT device detects that it is disconnected from the routing device, it obtains new network configuration parameters from the mobile device, and reconnects to the routing device; the IoT device does not need to be restarted.
  • the IoT device network can be repaired more quickly and conveniently, and data loss caused by restarting the IoT device can be avoided.
  • An embodiment of the present application provides a method for repairing an IoT device network. As shown in FIG. 9 , the method may include:
  • the IoT device detects that it is disconnected from the routing device, and fails to automatically reconnect to the routing device m times, and enters the network repair mode. The IoT device enters the first working state.
  • the user modifies the access password of the routing device.
  • the device ID of the routing device exists, but the access password is incorrect, and the automatic reconnection to the routing device fails m times.
  • the user modifies the device identification of the routing device.
  • the IoT device reconnects to the routing device, the device ID before modification is not found, and it fails to automatically reconnect to the routing device m times.
  • the IoT device enters network repair mode. Among them, m>1, the specific value can be set by the user.
  • the IoT device enters the first working state.
  • IoT devices communicate with mobile devices over Wi-Fi.
  • the IoT device enters the first working state, that is, switches its Wi-Fi module to the AP state.
  • the IoT device communicates with the mobile device via Bluetooth.
  • the IoT device enters the first working state, that is, turns on Bluetooth.
  • IoT devices can also communicate with mobile devices through other wireless communication methods.
  • the embodiments of the present application are not listed one by one.
  • the IoT device includes an indicator light, and the IoT device can flash the indicator light to prompt the IoT device to enter a network repair mode.
  • the IoT device may play a prompt message by voice to prompt the IoT device to enter the network repair mode.
  • the mobile device displays the first prompt information.
  • the mobile device After the IoT device is disconnected from the routing device, the mobile device cannot communicate with the IoT device through the routing device. The mobile device determines that the IoT device is offline.
  • the mobile device sends a first keep-alive request to the IoT device according to a first period (for example, 1s). After receiving the first keep-alive request, the IoT device sends a first keep-alive response to the mobile device. If the mobile device receives the first keep-alive response within a preset time period (for example, 10ms), it is determined that the IoT device is normally connected to the routing device (not offline). It can be understood that the mobile device sends the first keep-alive request to the IoT device through the routing device, and receives the first keep-alive response through the routing device.
  • a preset time period for example, 10ms
  • the mobile device may send the first keep-alive request to the IoT device again. If the number of times the mobile device sends the first keep-alive request to the IoT device exceeds the preset number of times, and the first keep-alive response is not received, it is determined that the IoT device is offline.
  • a preset time period for example, 10ms
  • the mobile device displays the first prompt information.
  • the first prompt information is used to prompt the user to bring the mobile device close to the IoT device.
  • the mobile device 110 displays a device management interface 1110 , and the device management interface 1110 includes operation information of the IoT device “smart desk lamp”.
  • the mobile device detects that the smart desk lamp is not connected to the routing device, and displays the prompt message 1111 "Device is offline”.
  • the mobile device receives the user's click operation on the prompt information 1111 and displays the help interface 1120 .
  • the help interface 1120 includes prompt information 1121 "Whether the name or password of the working Wi-Fi has been modified, you can try to reset the working Wi-Fi of the device by bringing the mobile phone close to the device.”
  • the mobile device may not display the first prompt information.
  • the IoT device periodically broadcasts the first request message by using the second antenna.
  • the IoT device includes a first antenna and a second antenna.
  • the first antenna is the aforementioned strong antenna
  • the second antenna is the aforementioned weak antenna.
  • the strong antenna and the weak antenna can work at the same time, and the IoT device turns on the weak antenna.
  • the strong antenna and the weak antenna can be switched to each other, and the IoT device switches to use the weak antenna to communicate.
  • the IoT device uses a weak antenna to periodically broadcast the first request message at a set period (such as 1s, 500ms, etc., which can be specifically set by the user).
  • the transmission distance of the weak antenna is the second distance (for example, 0.3 meters, 0.2 meters, etc., which can be specifically set by the user).
  • the first request message may be received if the mobile device moves within a second distance from the IoT device.
  • the first request message is a network repair request.
  • the weak antenna is turned off or switched to use the strong antenna for communication (using the first antenna to communicate).
  • the IoT device can use a strong antenna to exchange information with the mobile device, and the user does not need to carry the mobile device close to the IoT device for a long time.
  • the IoT device may also turn off the weak antenna or switch to use the strong antenna for communication (using the first antenna for communication) after the IoT device receives the first response message in S907. This embodiment of the present application does not limit this.
  • the first request message includes the device identification and access password of the IoT device, and the session key.
  • the network repair request is used to request the mobile device to send the network configuration parameters; the device ID and access password of the IoT device are used to establish communication between the mobile device and the IoT device; the session key is used for the mobile device to encrypt the network configuration parameters.
  • the device identifier of the IoT device may include at least one of a MAC address and a Product ID.
  • Product ID can display the specific type of the IoT device (for example, the IoT device is a lamp, air conditioner, refrigerator, etc.), manufacturer, specific model, manufacturer's contact information, customer service number and other information.
  • the untrusted IoT server-based solution shown in FIG. 8C is adopted; the first request message further includes a first signature; the first signature is used by the mobile device to verify the identity of the IoT device .
  • the first signature may be generated using the private key of the IoT device to sign the session key.
  • the mobile device receives the first request message.
  • the user brings the mobile device close to the IoT device. If the distance between the mobile device and the IoT device is less than or equal to the second distance of the signal transmitted by the second antenna, the mobile device receives the first request message.
  • the first request message includes the first signature.
  • the mobile device receives the first signature, and uses the public key of the IoT device stored in the mobile device to verify the first signature (when the mobile device and the IoT device are initially connected to the network, the other party's public key is obtained). If the mobile device uses the public key of the IoT device to verify that the first signature is signed by the private key of the IoT device, the first request message is verified and passed, and S904 is performed.
  • the mobile device establishes a communication connection with the IoT device by using the device identification and access password of the IoT device.
  • FIG. 12 is a schematic flowchart of establishing a communication connection between a mobile device and an IoT device.
  • the mobile device sends a connection request message to the IoT device (S1201).
  • the connection request message may be an association request message.
  • the connection request message includes the identification of the mobile device, the device identification of the IoT device, and the access password.
  • the verification is passed (S1203). If the IoT device is verified through the connection request message (for example, verifying the device identification and access password of the IoT device), a connection response message is sent to the mobile device (S1204).
  • the connection response message is used to confirm that a communication connection is established between the mobile device and the IoT device (for example, establishing a Wi-Fi connection or a Bluetooth connection, etc.). After the mobile device receives the connection response message, a communication connection is established between the mobile device and the IoT device (S1205 and S1206).
  • the mobile device obtains the device identification and access password of the routing device.
  • the mobile device receives the device identification and access password of the routing device input by the user.
  • the mobile device displays a configuration interface for network configuration parameters.
  • the user can select the routing device connected to the IoT device on the configuration interface of the network configuration parameters, and enter the access password of the routing device.
  • the mobile device 110 displays a network setting interface 1310 , and the network setting interface 1310 includes a “routing device” option 1311 and a “password” input box 1312 .
  • the "Routing Device” option 1311 can display the default routing device SSID (for example, the routing device is the routing device with the strongest signal detected by the mobile phone; for another example, the routing device is the routing device that the IoT device was connected to last time);
  • the “password” input box 1312 inputs the access password corresponding to the routing device displayed in the “routing device” option 1311 .
  • the network setting interface 1310 further includes an "OK" button 1313, and the user can click the "OK” button 1313 to confirm the configuration of the IoT device.
  • the network setting interface 1310 may also include a "Use other Wi-Fi" option 1314, and the user may modify the routing device connected by the IoT device by selecting the "Use other Wi-Fi” option 1314.
  • the mobile device stores the device identification and access password of the routing device.
  • the mobile device obtains the saved device identification and access password of the routing device.
  • both the mobile device and the IoT device access one routing device.
  • the user modifies the device ID or access password of the routing device, and the mobile device uses the new device ID and access password of the routing device to access the routing device again, and saves the new device ID and access password.
  • the IoT device is reconfigured, the mobile device obtains the saved device ID and access password of the routing device.
  • a mobile device and multiple IoT devices are connected to a routing device.
  • the user has modified the device ID or access password of the routing device.
  • the user uses the mobile device to reconfigure one of the multiple IoT devices.
  • the mobile device receives the device ID and access password entered by the user and saves the device ID and access password.
  • the mobile device obtains the device ID and access password of the saved routing device.
  • the mobile device sends a first response message to the IoT device.
  • the first response message may include network configuration parameters (including the device identification and access password of the routing device).
  • the network configuration parameter is encrypted using a session key.
  • the first response message includes a second signature; the second signature is used by the IoT device to verify the identity of the mobile device.
  • the second signature is generated using the private key of the user account to sign the session key.
  • the first response message includes an authentication credential (when the IoT device is connected to the IoT server for the first time, the IoT server issues an authentication credential for the mobile device and the IoT device respectively).
  • the authentication credential is encrypted with a session key.
  • the IoT device receives the first response message.
  • the IoT device receives the first response message, and verifies the identity information (including the second signature or authentication certificate) in the first response message. If the verification is passed, the IoT device obtains the network configuration parameters according to the first response message, and executes S908, IoT The device enters the second working state; if the verification fails, perform S902, and the IoT device periodically broadcasts the first request message by using the second antenna.
  • the solution based on the untrusted IoT server shown in FIG. 8C is adopted; the first response message includes the second signature.
  • the IoT device verifies the second signature.
  • the IoT device verifies the second signature using the public key of the user account. If the IoT device uses the public key of the user account to verify that the second signature is signed by the private key of the user account, the verification is passed, and S908 is executed, and the IoT device enters the second working state; if the verification fails, S902 is executed, and the IoT device uses the second working state.
  • the antenna periodically broadcasts the first request message.
  • the solution shown in FIG. 8B is adopted; the first response message includes an authentication credential.
  • the IoT device verifies the authentication credential; if the verification passes, execute S908, the IoT device enters the second working state; if the verification fails, execute S902, and the IoT device periodically broadcasts the first request message using the first antenna.
  • IoT devices verify the identity of mobile devices to ensure security and prevent illegal users from controlling IoT devices.
  • the IoT device obtains network configuration parameters according to the first response message. For example, the IoT device obtains the encrypted configuration parameters in the first response message, decrypts the encrypted second configuration parameters with the session key, and obtains the configuration parameters.
  • the IoT device enters the second working state.
  • IoT devices communicate with mobile devices over Wi-Fi.
  • the IoT device enters the second working state, that is, switches its own Wi-Fi module to the workstation state.
  • the IoT device communicates with the mobile device via Bluetooth.
  • the IoT device enters the second working state, that is, turning off the Bluetooth. It should be noted that the IoT device can also not turn off the Bluetooth. This embodiment of the present application does not limit this.
  • IoT devices can also communicate with mobile devices through other wireless communication methods.
  • the embodiments of the present application are not listed one by one.
  • the IoT device establishes communication with the routing device according to the distribution network parameters.
  • FIG. 14 is a schematic flowchart of establishing a communication connection between an IoT device and a routing device.
  • the IoT device sends a connection request message to the routing device (S1401).
  • the connection request message may be an association request message.
  • the connection request message includes the identifier of the IoT device, the device identifier of the routing device, and the access password.
  • the routing device receives the connection request message (S1402), the verification is passed (S1403).
  • connection response message is sent to the IoT device (S1404).
  • the connection response message is used to confirm the establishment of a Wi-Fi connection between the IoT device and the routing device.
  • a Wi-Fi connection is established between the IoT device and the routing device (S1405 and S1406).
  • the IoT device automatically enters a network repair mode after detecting that it is disconnected from the routing device.
  • the IoT device enters the first working state, so that the mobile device can access the IoT device.
  • the mobile device obtains the network configuration parameters according to the user input and sends them to the IoT device.
  • the IoT device re-establishes communication with the routing device according to the received distribution network parameters.
  • the network connection can be restored without requiring the user to manually reset the IoT device, which is convenient and quick and avoids data loss.
  • the mobile device sends the saved configuration parameters to the IoT device.
  • the IoT device re-establishes communication with the routing device according to the received distribution network parameters. After the IoT device is disconnected from the routing device, the user can reconfigure the IoT device and restore the network connection by bringing the mobile device close to the IoT device.
  • the network repair process does not require user operations, which is convenient and fast; it also does not require users to manually reset IoT devices, which can avoid data loss.
  • the IoT device uses the second antenna (weak antenna) to communicate with the mobile device. Only the mobile device close to the IoT device can obtain the device ID, access password and session key of the IoT device to ensure data security.
  • This embodiment of the present application also provides a method for repairing an IoT device network. As shown in FIG. 15 , the method may include:
  • the IoT device detects that it is disconnected from the routing device, and fails to automatically reconnect to the routing device m times, and enters the network repair mode. The IoT device enters the first working state.
  • the mobile device displays the first prompt information.
  • the IoT device periodically broadcasts the first request message by using the second transmit power of the antenna.
  • the transmit power of the antenna of the IoT device can be adjusted.
  • the transmit power of the antenna is the second transmit power
  • the distance at which the signal is transmitted is the second distance
  • the transmit power of the antenna is the first transmit power
  • the distance at which the signal is transmitted is the first distance
  • the second transmission power is smaller than the first transmission power
  • the second distance is smaller than the first distance.
  • the transmit power of the antenna is the second transmit power
  • the above-mentioned weak antenna function is implemented
  • the transmit power of the antenna is the first transmit power
  • the above-mentioned strong antenna function is implemented.
  • the IoT device uses the second transmit power of the antenna to periodically broadcast the first request message at a set period (eg, 1s, 500ms, etc., which can be specifically set by the user).
  • a set period e.g, 1s, 500ms, etc., which can be specifically set by the user.
  • the transmit power of the antenna is the second transmit power
  • the distance of the transmit signal is the second distance (for example, 0.3 meters, 0.2 meters, etc., which can be set by the user).
  • the first request message may be received if the mobile device moves within a second distance from the IoT device.
  • the transmit power of the antenna is adjusted to be the first transmit power, and the first transmit power of the antenna is used for communication.
  • the IoT device can use a strong antenna to exchange information with the mobile device, and the user does not need to carry the mobile device close to the IoT device for a long time.
  • the IoT device may also use the first transmit power of the antenna to communicate in S1507, after the IoT device receives the first response message. This embodiment of the present application does not limit this.
  • the first request message includes a network repair request, a device identification and access password of the IoT device, and a session key.
  • the network repair request is used to request the mobile device to send the network configuration parameters; the device ID and access password of the IoT device are used to establish communication between the mobile device and the IoT device; the session key is used for the mobile device to encrypt the network configuration parameters.
  • the device identifier of the IoT device includes at least one of a MAC address and a Product ID.
  • Product ID can display the specific type of the IoT device (for example, the IoT device is a lamp, air conditioner, refrigerator, etc.), manufacturer, specific model, manufacturer's contact information, customer service number and other information.
  • the untrusted IoT server-based solution shown in FIG. 8C is adopted; the first request message further includes a first signature; the first signature is used by the mobile device to verify the identity of the IoT device .
  • the first signature may be generated using the private key of the IoT device to sign the session key.
  • the mobile device receives the first request message.
  • the mobile device establishes a communication connection with the IoT device by using the device identification and access password of the IoT device.
  • the mobile device acquires the device identification and access password of the routing device.
  • the mobile device sends a first response message to the IoT device.
  • the IoT device receives the first response message.
  • the IoT device enters the second working state.
  • the IoT device establishes communication with the routing device according to the distribution network parameters.
  • the IoT device automatically enters a network repair mode after detecting that it is disconnected from the routing device.
  • the IoT device enters the first working state, so that the mobile device can access the IoT device.
  • the mobile device sends the network configuration parameters to the IoT device.
  • the IoT device re-establishes communication with the routing device according to the received distribution network parameters.
  • the network connection can be restored without requiring the user to manually reset the IoT device, which is convenient and quick and can avoid data loss.
  • the IoT device uses the second transmit power of the antenna (weak antenna) to communicate with the mobile device. Only the mobile device close to the IoT device can obtain the device ID, access password and session key of the IoT device to ensure data security.
  • FIG. 16 shows a scenario of the IoT device network repair method provided by the embodiment of the present application.
  • the IoT device 130 includes a strong antenna and a weak antenna, and the transmission distance of the weak antenna is 0.2 meters.
  • the IoT device 130 is connected to the routing device 120 through the distribution network.
  • the user modifies the access password of the routing device 120 , and the IoT device 130 is disconnected from the routing device 120 .
  • IoT device 130 enters network repair mode.
  • the user moves the mobile device 110 to a location less than 0.2 meters from the IoT device 130 .
  • the user inputs a new access password of the routing device 120 in the IoT APP of the mobile device 110.
  • IoT device 130 reconnects routing device 120 .
  • the embodiment of the present application also provides a method for repairing an IoT device network, as shown in FIG. 17 , the method may include:
  • the IoT device detects that it is disconnected from the routing device.
  • the IoT device After the IoT device is connected to the routing device through the distribution network, it may be disconnected from the routing device during the use of the IoT device. For example, if the routing device fails, the device ID of the routing device is modified, or the access password of the routing device is modified, the IoT device will be disconnected from the routing device.
  • the IoT device automatically reconnects to the routing device.
  • the IoT device detects a disconnection from the routing device and automatically reconnects the routing device. If the routing device roadblock is not recovered, the device ID of the routing device is modified, or the access password of the routing device is modified, the IoT device fails to automatically reconnect to the routing device. In an implementation manner, if the IoT device fails to automatically reconnect to the routing device m times (m>1, the specific value can be set by the user), S1703 is executed, and the IoT device enters the network repair mode. In another implementation manner, the IoT device automatically reconnects to the routing device. If the routing device is not successfully connected after the set duration T1, S1703 is executed, and the IoT device enters the network repair mode.
  • the IoT device enters the network repair mode.
  • the IoT device enters the first working state.
  • IoT devices communicate with mobile devices over Wi-Fi.
  • the IoT device enters the first working state, that is, switches its Wi-Fi module to the AP state.
  • the IoT device communicates with the mobile device via Bluetooth.
  • the IoT device enters the first working state, that is, turns on Bluetooth. Understandably, IoT devices can also communicate with mobile devices through other wireless communication methods. The embodiments of the present application are not listed one by one.
  • the IoT device includes an indicator light, and the IoT device can flash the indicator light to prompt the IoT device to enter a network repair mode.
  • the IoT device may play a prompt message by voice to prompt the IoT device to enter the network repair mode.
  • the IoT device exits the network repair mode.
  • a timer is started, and the duration of the timer is the first duration.
  • the IoT device cannot receive the configuration parameters.
  • the IoT device periodically broadcasts the first request message using a weak antenna, and the distance between the mobile device and the IoT device is greater than the second distance of the signal transmitted by the weak antenna, and the mobile device does not receive the first request message, so the network configuration parameters will not be sent.
  • the mobile device does not obtain the device identification and access password of the routing device, and thus does not send network configuration parameters.
  • the IoT device does not receive the network configuration parameters sent by the mobile device and exits the network repair mode.
  • the IoT device enters the second working state.
  • IoT devices communicate with mobile devices over Wi-Fi.
  • the IoT device enters the second working state, that is, switches its own Wi-Fi module to the workstation state.
  • the IoT device communicates with the mobile device via Bluetooth.
  • the IoT device enters the second working state, that is, turning off the Bluetooth. It should be noted that the IoT device can also not turn off the Bluetooth. This embodiment of the present application does not limit this. Understandably, IoT devices can also communicate with mobile devices through other wireless communication methods. The embodiments of the present application are not listed one by one.
  • the IoT device network repair method provided by the embodiment of the present application, after the IoT device is disconnected from the routing device, it cyclically enters the automatic reconnection to the routing device and the network repair mode; and so on, until the IoT device automatically connects to the routing device successfully or reconfigures the network successfully. It is convenient and quick to restore the network connection without requiring the user to manually reset the IoT device, and the success rate of network recovery is high.
  • each time the routing device is automatically reconnected the number of automatic reconnections m is gradually decreased (or the value of T1 is gradually decreased); and/or each time the network repair mode is entered When , the value of the first duration increases gradually; so that in the case of being unable to connect to the routing device for a long time, the time in the network repair mode becomes longer and longer, and the probability of successful network repair is improved.
  • the above IoT device includes corresponding hardware structures and/or software modules for executing each function.
  • the embodiments of the present application can be implemented in hardware or a combination of hardware and computer software. Whether a function is performed by hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of the embodiments of the present application.
  • the above-mentioned IoT device may be divided into functional modules according to the above-mentioned method examples.
  • each functional module may be divided into each function, or two or more functions may be integrated into one processing module.
  • the above-mentioned integrated modules can be implemented in the form of hardware, and can also be implemented in the form of software function modules. It should be noted that, the division of modules in the embodiments of the present application is schematic, and is only a logical function division, and there may be other division manners in actual implementation.
  • FIG. 18 shows a possible schematic structural diagram of the IoT device involved in the above embodiment.
  • the IoT device 1800 includes: a processing unit 1810 , a storage unit 1820 and a communication unit 1830 .
  • the processing unit 1810 is used to control and manage the actions of the IoT device 1800 .
  • it can be used to perform each step in FIG. 8A; or it can be used to perform the processing steps of S901, S902, S904 and S907-S909 in FIG. 9; or it can be used to perform the processing steps of S1501, S1502, S1504 and S1507 in FIG. 15 .
  • the processing steps of S1509 may be used to perform various steps in Figure 17; and/or other processes for the techniques described herein.
  • the storage unit 1820 is used to save program codes and data of the IoT device 1800 .
  • the communication unit 1830 is used to support communication between the IoT device 1800 and other devices. For example, may be used to perform the processing steps of S904 and S909 in FIG. 9; or may be used to perform the processing steps of S1504 and S1509 of FIG. 15; and/or other processes for the techniques described herein.
  • the unit modules in the above-mentioned IoT device 1800 include but are not limited to the above-mentioned processing unit 1810 , storage unit 1820 and communication unit 1830 .
  • the IoT device 1800 may further include a power supply unit and the like. The power supply unit is used to power the IoT device 1800 .
  • the processing unit 1810 may be a processor or a controller, for example, a central processing unit (CPU), a digital signal processor (DSP), an application-specific integrated circuit (ASIC) ), field programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof.
  • the storage unit 1820 may be a memory.
  • the communication unit 1830 may be a transceiver, a transceiver circuit, or the like.
  • the processing unit 1810 may be a processor (such as the processor 131 shown in FIG. 4 ), the storage unit 1820 may be a memory (such as the internal memory 132 shown in FIG. 4 ), and the communication unit 1830 may be referred to as a communication interface, including wireless communication module (the wireless communication module 135 shown in FIG. 4 ).
  • the IoT device 1800 provided in this embodiment of the present application may be the IoT device 130 shown in FIG. 4 .
  • the above-mentioned processors, memories, communication interfaces, etc. can be connected together, for example, connected by a bus.
  • Embodiments of the present application further provide a computer-readable storage medium, where computer program codes are stored in the computer-readable storage medium.
  • the processor executes the computer program codes
  • the IoT device executes the methods in the foregoing embodiments.
  • Embodiments of the present application also provide a computer program product, which when the computer program product runs on a computer, causes the computer to execute the method in the above-mentioned embodiments.
  • the IoT device 1800, the computer-readable storage medium, or the computer program product provided by the embodiments of the present application are all used to execute the corresponding methods provided above. Therefore, for the beneficial effects that can be achieved, reference may be made to the provided above. The beneficial effects in the corresponding method will not be repeated here.
  • the disclosed apparatus and method may be implemented in other manners.
  • the device embodiments described above are only illustrative.
  • the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be Incorporation may either be integrated into another device, or some features may be omitted, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware, and can also be implemented in the form of software functional units.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a readable storage medium.
  • the technical solutions of the embodiments of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, which are stored in a storage medium , including several instructions to make a device (may be a single chip microcomputer, a chip, etc.) or a processor (processor) to execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage medium includes: a U disk, a removable hard disk, a ROM, a magnetic disk or an optical disk and other media that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The present application relates to the field of control. Disclosed are a network repairing method, an electronic device, and a mobile terminal. When an identifier or access password of a routing device is changed, an IoT device is disconnected from the routing device and fails to reconnect to the routing device using a stored device identifier and access password of the routing device. The IoT device, using a weak antenna cycle, broadcasts a first request message and a session key to request a mobile terminal to transmit the device identifier and access password of the routing device. The mobile device transmits a new device identifier and access password of the routing device encrypted with the session key to the IoT device. The IoT device uses the new device identifier and access password to connect to the routing device. As such, after being disconnected from the routing device, the IoT device is automatically and quickly connected to the routing device, the need for user operation is obviated, and the loss of previously stored data is also avoided.

Description

一种网络修复方法、电子设备及移动设备A network repair method, electronic device and mobile device
本申请要求于2020年09月29日提交国家知识产权局、申请号为202011052568.X、申请名称为“一种IoT设备网络修复方法、IoT设备及移动设备”及于2020年12月23日提交国家知识产权局、申请号为202011539963.0、申请名称为“一种网络修复方法、电子设备及移动设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application is required to be submitted to the State Intellectual Property Office on September 29, 2020, the application number is 202011052568.X, the application name is "An IoT device network repair method, IoT device and mobile device" and submitted on December 23, 2020 The State Intellectual Property Office, the application number is 202011539963.0, the application title is "a network repair method, electronic equipment and mobile equipment" Chinese patent application priority, the entire content of which is incorporated by reference in this application.
技术领域technical field
本申请涉及控制领域,尤其涉及一种网络修复方法、电子设备及移动设备。The present application relates to the field of control, and in particular, to a network repair method, an electronic device and a mobile device.
背景技术Background technique
物联网(internet of things,IoT)的快速发展,使得诸如工业生产、智能家居、防灾监控、物流追踪等诸多领域中的许多IoT设备接入至网络。移动设备通过其所连接的路由设备,与网络中其他设备通信。不过,大多数IoT设备无法直接与用户持有的移动设备交互,需要通过路由设备,才能与移动设备交互。在IoT设备通过配网接入路由设备后,用户通过移动设备控制IoT设备。The rapid development of the Internet of Things (IoT) has enabled many IoT devices in many fields, such as industrial production, smart home, disaster prevention monitoring, and logistics tracking, to be connected to the network. A mobile device communicates with other devices in the network through the routing device to which it is connected. However, most IoT devices cannot directly interact with the mobile device held by the user, and need to route the device to interact with the mobile device. After the IoT device is connected to the routing device through the distribution network, the user controls the IoT device through the mobile device.
在一些情形下,比如路由设备标识或者路由设备的接入密码被修改,此时移动设备就无法控制IoT设备。IoT设备需要进入配网模式,再次配网接入路由设备后,移动设备才能再次控制IoT设备。这样,用户操作较为繁琐。另外,有些IoT设备在进入配网模式后,会恢复出厂设置;会导致IoT设备上之前保存的数据丢失。这样,也不利于后续移动设备对IoT设备操作。In some cases, such as the routing device ID or the routing device's access password is modified, the mobile device cannot control the IoT device. The IoT device needs to enter the network distribution mode. After the network is connected to the routing device again, the mobile device can control the IoT device again. In this way, the user operation is more complicated. In addition, some IoT devices will be reset to factory settings after entering the network configuration mode, which will result in the loss of previously saved data on the IoT device. In this way, it is also not conducive to the subsequent operation of the IoT device by the mobile device.
发明内容SUMMARY OF THE INVENTION
因此,在诸如路由设备标识或路由设备的接入密码被修改的情形下,IoT设备如何自动快捷地接入路由设备是我们需要解决的问题。Therefore, in a situation such as the routing device identification or the routing device's access password is modified, how to automatically and quickly access the routing device for IoT devices is a problem that we need to solve.
为了解决上述技术问题,本申请提出了一种网络修复方法、电子设备及移动设备,使得在路由设备标识或路由设备的接入密码被修改后,IoT设备能够自动快捷地接入路由设备,无需用户操作,也不丢失之前保存的数据。In order to solve the above technical problems, the present application proposes a network repair method, electronic device and mobile device, so that after the routing device identifier or the access password of the routing device is modified, the IoT device can automatically and quickly access the routing device without the need for User operation, without losing previously saved data.
第一方面,提供一种网络修复方法,应用于电子设备,该电子设备与路由设备的连接断开,电子设备包括:处理器;存储器;第一天线,第一天线的发射距离为第一距离,第一距离大于预设的安全距离;第二天线,第二天线的发射距离为第二距离,第二距离小于或等于预设的安全距离;其中,第一天线和第二天线为不同的天线;该方法包括:通过第一天线,使用路由设备的第一配网参数重连路由设备;在重连路由设备失败后,通过第二天线,周期性地发送第一请求消息;第一请求消息包括会话秘钥;接收到连接至路由设备的移动设备的第一响应消息;第一响应消息包括加密的第二配网参数;响应于第一响应消息,通过会话秘钥解密加密的第二配网参数,获取到第二配网参数;通过第一天线,使用第二配网参数连接至路由设备。其中,第一配网参数包括路由设备的第一设备标识和第一接入密码;第二配网参数包括路由设备的第二设备标识和第二接入密码。In a first aspect, a network repair method is provided, which is applied to an electronic device. The electronic device is disconnected from a routing device. The electronic device includes: a processor; a memory; and a first antenna, where the transmission distance of the first antenna is a first distance , the first distance is greater than the preset safety distance; the second antenna, the transmission distance of the second antenna is the second distance, and the second distance is less than or equal to the preset safety distance; wherein, the first antenna and the second antenna are different an antenna; the method includes: reconnecting the routing device using the first distribution network parameters of the routing device through the first antenna; after the reconnection of the routing device fails, periodically sending a first request message through the second antenna; the first request The message includes the session key; the first response message of the mobile device connected to the routing device is received; the first response message includes the encrypted second configuration network parameter; in response to the first response message, the encrypted second The network distribution parameters are obtained, and the second distribution network parameters are obtained; and the second distribution network parameters are used to connect to the routing device through the first antenna. The first network configuration parameter includes a first device identifier and a first access password of the routing device; the second network configuration parameter includes a second device identifier and a second access password of the routing device.
在该方法中,由于路由设备的设备标识或接入密码修改,IoT设备从路由设备断开,并且自动重连路由设备失败。IoT设备通过弱天线(弱天线和强天线是不同的天线)请求移动设备向其发送路由设备新的配网参数。IoT设备还向移动设备发送会话秘钥,用于移动设备加密新的配网参数。由于弱天线的发射距离小于等于预设的安全发射距离,只有在安全距离内的移动设备才能接收到会话秘钥,可以保证数据安全。IoT设备从移动设备接收到新的配网参数后,使用新的配网参数连接路由设备。这样,在路由设备标识或路由设备的接入密码被修改后,IoT设备自动快捷地接入路由设备,无需用户操作,也不丢失之前保存的数据。In this method, due to the modification of the device identification or access password of the routing device, the IoT device is disconnected from the routing device, and the automatic reconnection of the routing device fails. The IoT device requests the mobile device to send the new configuration network parameters of the routing device to it through the weak antenna (the weak antenna and the strong antenna are different antennas). The IoT device also sends a session key to the mobile device, which is used by the mobile device to encrypt new configuration parameters. Since the transmission distance of the weak antenna is less than or equal to the preset safe transmission distance, only the mobile device within the safe distance can receive the session key, which can ensure data security. After the IoT device receives the new configuration parameters from the mobile device, it uses the new configuration parameters to connect to the routing device. In this way, after the routing device ID or the routing device's access password is modified, the IoT device can automatically and quickly access the routing device without user operation or loss of previously saved data.
第二方面,提供一种网络修复方法,应用于电子设备,电子设备与路由设备的连接断开,电子设备包括:处理器;存储器;天线,天线在第一发射功率下的发射距离为第一距离,第一距离大于预设的安全距离;天线在第二发射功率下的发射距离为第二距离,第二距离小于或等于预设的安全距离;第一发射功率大于第二发射功率;该方法包括:通过第一发射功率下的天线,使用路由设备的第一配网参数重连路由设备;在重连路由设备失败后,通过第二发射功率下的天线,周期性地发送第一请求消息;第一请求消息包括会话秘钥;接收到连接至路由设备的移动设备的第一响应消息;第一响应消息包括加密的第二配网参数;响应于第一响应消息,通过会话秘钥解密加密的第二配网参数,获取到第二配网参数;通过第一发射功率下的天线,使用第二配网参数连接至路由设备。其中,第一配网参数包括路由设备的第一设备标识和第一接入密码;第二配网参数包括路由设备的第二设备标识和第二接入密码。In a second aspect, a network repair method is provided, which is applied to an electronic device, where the connection between the electronic device and the routing device is disconnected, and the electronic device includes: a processor; a memory; distance, the first distance is greater than the preset safe distance; the transmitting distance of the antenna under the second transmit power is the second distance, and the second distance is less than or equal to the preset safe distance; the first transmit power is greater than the second transmit power; the The method includes: reconnecting the routing device by using the first distribution network parameter of the routing device through the antenna under the first transmission power; after the reconnection of the routing device fails, periodically sending the first request through the antenna under the second transmission power message; the first request message includes the session key; the first response message of the mobile device connected to the routing device is received; the first response message includes the encrypted second configuration network parameter; in response to the first response message, the session key Decrypt the encrypted second distribution network parameters to obtain the second distribution network parameters; use the second distribution network parameters to connect to the routing device through the antenna under the first transmit power. The first network configuration parameter includes a first device identifier and a first access password of the routing device; the second network configuration parameter includes a second device identifier and a second access password of the routing device.
在该方法中,由于路由设备的设备标识或接入密码修改,IoT设备从路由设备断开,并且自动重连路由设备失败。IoT设备通过弱天线(弱天线和强天线由同一天线的不同发射功率实现)请求移动设备向其发送路由设备新的配网参数。IoT设备还向移动设备发送会话秘钥,用于移动设备加密新的配网参数。由于弱天线的发射距离小于等于预设的安全发射距离,只有在安全距离内的移动设备才能接收到会话秘钥,可以保证数据安全。IoT设备从移动设备接收到新的配网参数后,使用新的配网参数连接路由设备。这样,在路由设备标识或路由设备的接入密码被修改后,IoT设备自动快捷地接入路由设备,无需用户操作,也不丢失之前保存的数据。In this method, due to the modification of the device identification or access password of the routing device, the IoT device is disconnected from the routing device, and the automatic reconnection of the routing device fails. The IoT device requests the mobile device to send the new configuration network parameters of the routing device to it through the weak antenna (the weak antenna and the strong antenna are realized by different transmit powers of the same antenna). The IoT device also sends a session key to the mobile device, which is used by the mobile device to encrypt new configuration parameters. Since the transmission distance of the weak antenna is less than or equal to the preset safe transmission distance, only the mobile device within the safe distance can receive the session key, which can ensure data security. After the IoT device receives the new configuration parameters from the mobile device, it uses the new configuration parameters to connect to the routing device. In this way, after the routing device ID or the routing device's access password is modified, the IoT device can automatically and quickly access the routing device without user operation or loss of previously saved data.
根据第一方面或第二方面,重连路由设备失败包括:重连路由设备失败的次数大于或等于预设的次数;或者,重连路由设备的时长大于或等于预设的时长。According to the first aspect or the second aspect, the failure to reconnect to the routing device includes: the number of times that the routing device fails to reconnect is greater than or equal to a preset number of times; or, the duration of reconnecting the routing device is greater than or equal to a preset duration.
根据第一方面或第二方面,或者以上第一方面或第二方面的任意一种实现方式,在通过会话秘钥解密加密的第二配网参数之前,该方法还包括:对第一响应消息中的签名信息进行验证;该签名信息用于指示移动设备的身份合法性。这样,IoT设备只采用被授权的移动设备发送的配网参数,保证数据安全性和正确性。According to the first aspect or the second aspect, or any implementation manner of the above first aspect or the second aspect, before decrypting the encrypted second network configuration parameter by using the session key, the method further includes: responding to the first response message The signature information in the verification is performed; the signature information is used to indicate the validity of the identity of the mobile device. In this way, IoT devices only use the configuration parameters sent by authorized mobile devices to ensure data security and correctness.
如果对第一响应消息中的签名信息进行验证失败,周期性地发送第一请求消息。IoT设备继续等待接收新的配网参数。If the verification of the signature information in the first response message fails, the first request message is periodically sent. IoT devices continue to wait to receive new configuration parameters.
根据第一方面或第二方面,或者以上第一方面或第二方面的任意一种实现方式,如果未获取到第二配网参数,使用路由设备的第一配网参数重连路由设备。According to the first aspect or the second aspect, or any implementation manner of the above first aspect or the second aspect, if the second network configuration parameter is not obtained, the routing device is reconnected using the first configuration network parameter of the routing device.
该方法中,IoT设备从路由设备断开后,循环进入自动重连路由设备和网络修复模式;如此往复,直到IoT设备自动连接路由设备成功或者重新配网成功。不需要用 户手动重置IoT设备就恢复网络连接,方便快捷且网络恢复成功率高。In this method, after the IoT device is disconnected from the routing device, it loops into the automatic reconnection routing device and network repair mode; and so on, until the IoT device automatically connects to the routing device successfully or reconfigures the network successfully. There is no need for users to manually reset the IoT device to restore the network connection, which is convenient and fast, and the success rate of network recovery is high.
根据第一方面或第二方面,或者以上第一方面或第二方面的任意一种实现方式,如果电子设备周期性广播第一请求消息的次数大于设定次数;或者,电子设备周期性广播第一请求消息的时长大于设定时长;则切换至使用强天线与其他设备通信。这样,IoT设备发送第一请求消息之后,后续步骤中,可以使用强天线与移动设备交互信息,不需要用户长时间携带移动设备靠近IoT设备。According to the first aspect or the second aspect, or any implementation manner of the first aspect or the second aspect above, if the number of times the electronic device periodically broadcasts the first request message is greater than the set number of times; or, the electronic device periodically broadcasts the first request message. If the duration of a request message is greater than the set duration; then switch to using a strong antenna to communicate with other devices. In this way, after the IoT device sends the first request message, in subsequent steps, a strong antenna can be used to exchange information with the mobile device, and the user does not need to carry the mobile device close to the IoT device for a long time.
根据第一方面或第二方面,或者以上第一方面或第二方面的任意一种实现方式,IoT设备接收到路由设备的第二配网参数;则切换至使用强天线与其他设备通信。这样,IoT设备和移动设备之间的数据都使用弱天线进行交互,保证数据安全性。According to the first aspect or the second aspect, or any implementation manner of the above first aspect or the second aspect, the IoT device receives the second network configuration parameter of the routing device; then switches to using a strong antenna to communicate with other devices. In this way, data between IoT devices and mobile devices all use weak antennas for interaction, ensuring data security.
第三方面,提供一种电子设备,电子设备与路由设备的连接断开,其特征在于,电子设备包括:处理器;存储器;第一天线,第一天线的发射距离为第一距离,第一距离大于预设的安全距离;第二天线,第二天线的发射距离为第二距离,第二距离小于或等于预设的安全距离;其中,第一天线和第二天线为不同的天线;以及计算机程序,其中计算机程序存储在存储器上,当计算机程序被所述处理器执行时,使得电子设备执行:通过第一天线,使用路由设备的第一配网参数重连路由设备;第一配网参数包括路由设备的第一设备标识和第一接入密码;在重连路由设备失败后,通过第二天线,周期性地发送第一请求消息;第一请求消息包括会话秘钥;接收到连接至路由设备的移动设备的第一响应消息;第一响应消息包括加密的第二配网参数;响应于第一响应消息,通过会话秘钥解密加密的第二配网参数,获取到第二配网参数;第二配网参数包括路由设备的第二设备标识和第二接入密码;通过第一天线,使用第二配网参数连接至路由设备。In a third aspect, an electronic device is provided in which the connection between the electronic device and the routing device is disconnected, wherein the electronic device includes: a processor; a memory; The distance is greater than the preset safety distance; the second antenna, the transmission distance of the second antenna is the second distance, and the second distance is less than or equal to the preset safety distance; wherein, the first antenna and the second antenna are different antennas; and A computer program, wherein the computer program is stored on the memory, and when the computer program is executed by the processor, the electronic device executes: reconnecting the routing device using the first distribution network parameters of the routing device through the first antenna; the first distribution network The parameters include the first device identifier of the routing device and the first access password; after the reconnection of the routing device fails, periodically send a first request message through the second antenna; the first request message includes the session key; The first response message to the mobile device of the routing device; the first response message includes the encrypted second configuration network parameter; in response to the first response message, decrypt the encrypted second configuration network parameter through the session key, and obtain the second configuration network parameter. network parameters; the second network configuration parameters include a second device identification and a second access password of the routing device; and the second network configuration parameters are used to connect to the routing device through the first antenna.
第四方面,提供一种电子设备,电子设备与路由设备的连接断开,其特征在于,电子设备包括:处理器;存储器;天线,天线在第一发射功率下的发射距离为第一距离,第一距离大于预设的安全距离;天线在第二发射功率下的发射距离为第二距离,第二距离小于或等于预设的安全距离;第一发射功率大于第二发射功率;以及计算机程序,其中计算机程序存储在存储器上,当计算机程序被处理器执行时,使得电子设备执行:通过第一发射功率下的天线,使用路由设备的第一配网参数重连路由设备;第一配网参数包括路由设备的第一设备标识和第一接入密码;在重连路由设备失败后,通过第二发射功率下的天线,周期性地发送第一请求消息;第一请求消息包括会话秘钥;接收到连接至路由设备的移动设备的第一响应消息;第一响应消息包括加密的第二配网参数;响应于第一响应消息,通过会话秘钥解密加密的第二配网参数,获取到第二配网参数;第二配网参数包括路由设备的第二设备标识和第二接入密码;通过第一发射功率下的天线,使用第二配网参数连接至路由设备。In a fourth aspect, an electronic device is provided, wherein the connection between the electronic device and the routing device is disconnected, wherein the electronic device comprises: a processor; a memory; and an antenna, and the transmission distance of the antenna under the first transmission power is the first distance, The first distance is greater than the preset safety distance; the transmission distance of the antenna under the second transmission power is the second distance, and the second distance is less than or equal to the preset safety distance; the first transmission power is greater than the second transmission power; and the computer program , wherein the computer program is stored on the memory, and when the computer program is executed by the processor, the electronic device is made to execute: reconnect the routing device using the first distribution network parameters of the routing device through the antenna under the first transmit power; the first distribution network The parameters include the first device identifier and the first access password of the routing device; after the reconnection of the routing device fails, the first request message is periodically sent through the antenna under the second transmit power; the first request message includes the session key ; Receive the first response message of the mobile device connected to the routing device; the first response message includes the encrypted second distribution network parameter; in response to the first response message, decrypt the encrypted second distribution network parameter by the session key, and obtain to the second distribution network parameter; the second distribution network parameter includes the second device identification and the second access password of the routing device; and the second distribution network parameter is used to connect to the routing device through the antenna under the first transmit power.
根据第三方面或第四方面,重连路由设备失败包括:重连路由设备失败的次数大于或等于预设的次数;或者,重连路由设备的时长大于或等于预设的时长。According to the third aspect or the fourth aspect, the failure to reconnect to the routing device includes: the number of times that the routing device fails to reconnect is greater than or equal to a preset number of times; or, the duration of reconnecting the routing device is greater than or equal to a preset duration.
根据第三方面或第四方面,或者以上第三方面或第四方面的任意一种实现方式,当计算机程序被一个或多个处理器执行时,还使得电子设备执行:在通过会话秘钥解密加密的第二配网参数之前,对第一响应消息中的签名信息进行验证;签名信息用于指示所述移动设备的身份合法性。如果对第一响应消息中的签名信息进行验证失败, 周期性地发送第一请求消息。According to the third aspect or the fourth aspect, or any one of the implementation manners of the above third aspect or the fourth aspect, when the computer program is executed by one or more processors, the electronic device also causes the electronic device to execute: after decrypting with the session key Before encrypting the second network configuration parameters, verify the signature information in the first response message; the signature information is used to indicate the identity validity of the mobile device. If the verification of the signature information in the first response message fails, the first request message is periodically sent.
根据第三方面或第四方面,或者以上第三方面或第四方面的任意一种实现方式,当所述计算机程序被所述一个或多个处理器执行时,还使得电子设备执行:如果未获取到第二配网参数,使用路由设备的第一配网参数重连路由设备。According to the third or fourth aspect, or any implementation manner of the above third or fourth aspect, when the computer program is executed by the one or more processors, the computer program further causes the electronic device to execute: if not The second network configuration parameter is obtained, and the first configuration network parameter of the routing device is used to reconnect the routing device.
根据第三方面或第四方面,或者以上第三方面或第四方面的任意一种实现方式,如果电子设备周期性广播第一请求消息的次数大于设定次数;或者,电子设备周期性广播第一请求消息的时长大于设定时长;则切换至使用强天线与其他设备通信。这样,IoT设备发送第一请求消息之后,后续步骤中,可以使用强天线与移动设备交互信息,不需要用户长时间携带移动设备靠近IoT设备。According to the third aspect or the fourth aspect, or any implementation manner of the above third aspect or the fourth aspect, if the number of times the electronic device periodically broadcasts the first request message is greater than the set number of times; or, the electronic device periodically broadcasts the first request message. If the duration of a request message is greater than the set duration; then switch to using a strong antenna to communicate with other devices. In this way, after the IoT device sends the first request message, in subsequent steps, a strong antenna can be used to exchange information with the mobile device, and the user does not need to carry the mobile device close to the IoT device for a long time.
根据第三方面或第四方面,或者以上第三方面或第四方面的任意一种实现方式,电子设备接收到路由设备的第二配网参数;则切换至使用强天线与其他设备通信。这样,IoT设备和移动设备之间的数据都使用弱天线进行交互,保证数据安全性。According to the third aspect or the fourth aspect, or any implementation manner of the above third aspect or the fourth aspect, the electronic device receives the second network distribution parameter of the routing device; then switches to using a strong antenna to communicate with other devices. In this way, data between IoT devices and mobile devices all use weak antennas for interaction, ensuring data security.
第三方面及第三方面的任意一种实现方式分别与第一方面及第一方面的任意一种实现方式相对应。第三方面及第三方面中任意一种实现方式所对应的技术效果可参见上述第一方面以及第一方面中任意一种实现方式所对应的技术效果,此处不再赘述。The third aspect and any implementation manner of the third aspect correspond to the first aspect and any implementation manner of the first aspect, respectively. For the technical effects corresponding to the third aspect and any implementation manner of the third aspect, reference may be made to the technical effects corresponding to the first aspect and any implementation manner of the first aspect, which will not be repeated here.
第四方面及第四方面的任意一种实现方式分别与第二方面及第二方面的任意一种实现方式相对应。第四方面以及第四方面中任意一种实现方式所对应的技术效果可参见上述第二方面以及第二方面中任意一种实现方式所对应的技术效果,此处不再赘述。The fourth aspect and any implementation manner of the fourth aspect correspond to the second aspect and any implementation manner of the second aspect, respectively. For the technical effects corresponding to the fourth aspect and any implementation manner of the fourth aspect, reference may be made to the technical effects corresponding to the second aspect and any implementation manner of the second aspect, which will not be repeated here.
第五方面,提供一种网络修复方法,应用于网络修复系统,该系统包括移动设备、电子设备和路由设备;移动设备使用第二配网参数连接至路由设备,移动设备与电子设备断开通过路由设备建立的连接;电子设备包括:第一天线,第一天线的发射距离为第一距离,第一距离大于预设的安全距离;第二天线,第二天线的发射距离为第二距离,第二距离小于或等于预设的安全距离;其中,第一天线和第二天线为不同的天线;该方法包括:电子设备通过第一天线,使用路由设备的第一配网参数重连路由设备;第一配网参数包括路由设备的第一设备标识和第一接入密码;在重连路由设备失败后,电子设备通过第二天线,周期性地发送第一请求消息;第一请求消息包括会话秘钥;在距离电子设备的第二距离内,移动设备接收到电子设备的第一请求消息;响应于第一请求消息,移动设备向电子设备发送第一响应消息;第一响应消息包括经过会话秘钥加密的第二配网参数,第二配网参数包括路由设备的第二设备标识和第二接入密码;电子设备接收到连接至路由设备的移动设备的第一响应消息;响应于第一响应消息,电子设备通过会话秘钥解密加密的第二配网参数,获取到第二配网参数;电子设备通过第一天线,使用第二配网参数连接至路由设备。A fifth aspect provides a network repair method, which is applied to a network repair system, the system includes a mobile device, an electronic device and a routing device; the mobile device is connected to the routing device using the second distribution network parameter, and the mobile device is disconnected from the electronic device through the The connection established by the routing device; the electronic device includes: a first antenna, the transmission distance of the first antenna is the first distance, and the first distance is greater than the preset safety distance; the second antenna, the transmission distance of the second antenna is the second distance, The second distance is less than or equal to a preset safety distance; wherein the first antenna and the second antenna are different antennas; the method includes: the electronic device reconnects the routing device through the first antenna and using the first distribution network parameter of the routing device ; The first distribution network parameter includes the first device identification and the first access password of the routing device; after the reconnection of the routing device fails, the electronic device periodically sends the first request message through the second antenna; the first request message includes a session key; within a second distance from the electronic device, the mobile device receives a first request message from the electronic device; in response to the first request message, the mobile device sends a first response message to the electronic device; the first response message includes the the second network configuration parameter encrypted by the session key, where the second network configuration parameter includes the second device identification and the second access password of the routing device; the electronic device receives the first response message of the mobile device connected to the routing device; in response to In the first response message, the electronic device decrypts the encrypted second distribution network parameters through the session key to obtain the second distribution network parameters; the electronic device uses the second distribution network parameters to connect to the routing device through the first antenna.
第五方面与第一方面相对应。第五方面的技术效果可参见上述第一方面的技术效果,此处不再赘述。The fifth aspect corresponds to the first aspect. For the technical effect of the fifth aspect, reference may be made to the technical effect of the above-mentioned first aspect, which will not be repeated here.
第六方面,提供一种网络修复方法,应用于网络修复系统,该系统包括移动设备、电子设备和路由设备;移动设备使用第二配网参数连接至路由设备,移动设备与电子设备断开通过路由设备建立的连接;电子设备包括:天线,天线在第一发射功率下的发射距离为第一距离,第一距离大于预设的安全距离;天线在第二发射功率下的发射距离为第二距离,第二距离小于或等于预设的安全距离;第一发射功率大于第二发射 功率;该方法包括:电子设备通过第一发射功率下的天线,使用路由设备的第一配网参数重连路由设备;第一配网参数包括路由设备的第一设备标识和第一接入密码;在重连路由设备失败后,电子设备通过第二发射功率下的天线,周期性地发送第一请求消息;第一请求消息包括会话秘钥;在距离电子设备的第二距离内,移动设备接收到电子设备的第一请求消息;响应于第一请求消息,移动设备向电子设备发送第一响应消息;第一响应消息包括经过会话秘钥加密的第二配网参数,第二配网参数包括路由设备的第二设备标识和第二接入密码;电子设备接收到连接至路由设备的移动设备的第一响应消息;响应于第一响应消息,电子设备通过会话秘钥解密加密的第二配网参数,获取到第二配网参数;电子设备通过第一发射功率下的天线,使用第二配网参数连接至路由设备。In a sixth aspect, a network repair method is provided, applied to a network repair system, the system includes a mobile device, an electronic device and a routing device; the mobile device is connected to the routing device using the second distribution network parameter, and the mobile device is disconnected from the electronic device through the The connection established by the routing device; the electronic device includes: an antenna, the transmission distance of the antenna under the first transmission power is the first distance, and the first distance is greater than the preset safety distance; the transmission distance of the antenna under the second transmission power is the second distance distance, the second distance is less than or equal to the preset safety distance; the first transmit power is greater than the second transmit power; the method includes: the electronic device reconnects by using the first distribution network parameters of the routing device through the antenna under the first transmit power a routing device; the first network distribution parameter includes a first device identifier and a first access password of the routing device; after the reconnection to the routing device fails, the electronic device periodically sends a first request message through the antenna under the second transmit power The first request message includes a session key; within a second distance from the electronic device, the mobile device receives the first request message of the electronic device; in response to the first request message, the mobile device sends a first response message to the electronic device; The first response message includes the second network configuration parameter encrypted by the session key, and the second network configuration parameter includes the second device identification and the second access password of the routing device; the electronic device receives the first parameter of the mobile device connected to the routing device. A response message; in response to the first response message, the electronic device decrypts the encrypted second distribution network parameters through the session key, and obtains the second distribution network parameters; the electronic device uses the second distribution network through the antenna under the first transmit power The parameter is connected to the routing device.
第六方面与第二方面相对应。第六方面的技术效果可参见上述第二方面的技术效果,此处不再赘述。The sixth aspect corresponds to the second aspect. For the technical effect of the sixth aspect, reference may be made to the technical effect of the second aspect, which will not be repeated here.
第七方面,提供一种网络修复系统,包括移动设备、电子设备和路由设备;移动设备使用第二配网参数连接至路由设备,移动设备与电子设备断开通过路由设备建立的连接,移动设备包括:第一处理器;第一存储器;以及第一计算机程序,其中第一计算机程序存储在第一存储器上,当第一计算机程序被所述第一处理器执行时,使得移动设备执行以下步骤:在距离电子设备的第二距离内,接收到电子设备的第一请求消息;第一请求消息包括会话秘钥;第二距离小于或等于预设的安全距离;响应于第一请求消息,向电子设备发送第一响应消息;第一响应消息包括经过会话秘钥加密的第二配网参数,第二配网参数包括路由设备的第二设备标识和第二接入密码;电子设备包括:第二处理器;第二存储器;第一天线,第一天线的发射距离为第一距离,第一距离大于预设的安全距离;第二天线,第二天线的发射距离为第二距离,第二距离小于或等于预设的安全距离;其中,第一天线和第二天线为不同的天线;以及第二计算机程序,其中第二计算机程序存储在第二存储器上,当第二计算机程序被第二处理器执行时,使得电子设备执行:通过第一天线,使用路由设备的第一配网参数重连路由设备;第一配网参数包括路由设备的第一设备标识和第一接入密码;在重连路由设备失败后,通过第二天线,周期性地发送第一请求消息;第一请求消息包括会话秘钥;接收到连接至路由设备的移动设备的第一响应消息;响应于第一响应消息,通过会话秘钥解密加密的第二配网参数,获取到第二配网参数;通过第一天线,使用第二配网参数连接至路由设备。In a seventh aspect, a network repair system is provided, including a mobile device, an electronic device, and a routing device; the mobile device is connected to the routing device using the second network distribution parameter, the mobile device and the electronic device are disconnected from the connection established by the routing device, and the mobile device comprising: a first processor; a first memory; and a first computer program, wherein the first computer program is stored on the first memory, and when the first computer program is executed by the first processor, causes the mobile device to perform the following steps : within the second distance from the electronic device, the first request message of the electronic device is received; the first request message includes the session key; the second distance is less than or equal to the preset safe distance; in response to the first request message, the The electronic device sends a first response message; the first response message includes the second network configuration parameter encrypted by the session key, and the second network configuration parameter includes the second device identification and the second access password of the routing device; the electronic device includes: two processors; a second memory; a first antenna, the transmission distance of the first antenna is the first distance, and the first distance is greater than the preset safety distance; the second antenna, the transmission distance of the second antenna is the second distance, the second distance The distance is less than or equal to a preset safety distance; wherein, the first antenna and the second antenna are different antennas; and a second computer program, wherein the second computer program is stored on the second memory, when the second computer program is stored by the second When the processor executes, the electronic device executes: reconnecting the routing device using the first network configuration parameter of the routing device through the first antenna; the first network configuration parameter includes the first device identifier and the first access password of the routing device; After the reconnection to the routing device fails, periodically send a first request message through the second antenna; the first request message includes a session key; a first response message from a mobile device connected to the routing device is received; in response to the first response message, decrypt the encrypted second distribution network parameters through the session key, and obtain the second distribution network parameters; through the first antenna, use the second distribution network parameters to connect to the routing device.
第七方面与第一方面相对应。第七方面的技术效果可参见上述第一方面的技术效果,此处不再赘述。The seventh aspect corresponds to the first aspect. For the technical effect of the seventh aspect, reference may be made to the technical effect of the above-mentioned first aspect, which will not be repeated here.
第八方面,提供一种网络修复系统,包括移动设备、电子设备和路由设备;移动设备使用第二配网参数连接至路由设备,移动设备与电子设备断开通过路由设备建立的连接,移动设备包括:第一处理器;第一存储器;以及第一计算机程序,其中第一计算机程序存储在第一存储器上,当第一计算机程序被第一处理器执行时,使得移动设备执行以下步骤:在距离电子设备的第二距离内,接收到电子设备的第一请求消息;第一请求消息包括会话秘钥;第二距离小于或等于预设的安全距离;响应于第一请求消息,向电子设备发送第一响应消息;第一响应消息包括经过会话秘钥加密的第二配 网参数,第二配网参数包括路由设备的第二设备标识和第二接入密码;电子设备包括:第二处理器;第二存储器;天线,天线在第一发射功率下的发射距离为第一距离,第一距离大于预设的安全距离;天线在第二发射功率下的发射距离为第二距离,第二距离小于或等于预设的安全距离;第一发射功率大于第二发射功率;以及第二计算机程序,其中第二计算机程序存储在第二存储器上,当第二计算机程序被第二处理器执行时,使得电子设备执行:通过第一发射功率下的天线,使用路由设备的第一配网参数重连路由设备;第一配网参数包括路由设备的第一设备标识和第一接入密码;在重连路由设备失败后,通过第二发射功率下的天线,周期性地发送第一请求消息;第一请求消息包括会话秘钥;接收到连接至路由设备的移动设备的第一响应消息;响应于第一响应消息,通过会话秘钥解密加密的第二配网参数,获取到第二配网参数;通过第一发射功率下的天线,使用第二配网参数连接至路由设备。In an eighth aspect, a network repair system is provided, including a mobile device, an electronic device, and a routing device; the mobile device is connected to the routing device using the second network distribution parameter, the mobile device and the electronic device are disconnected from the connection established by the routing device, and the mobile device comprising: a first processor; a first memory; and a first computer program, wherein the first computer program is stored on the first memory, and when the first computer program is executed by the first processor, causes the mobile device to perform the following steps: Within a second distance from the electronic device, the first request message of the electronic device is received; the first request message includes the session key; the second distance is less than or equal to the preset safe distance; in response to the first request message, the electronic device is sent to the electronic device. Send a first response message; the first response message includes the second network configuration parameter encrypted by the session key, and the second network configuration parameter includes the second device identifier and the second access password of the routing device; the electronic device includes: a second process a second memory; an antenna, the transmission distance of the antenna under the first transmission power is the first distance, and the first distance is greater than the preset safety distance; the transmission distance of the antenna under the second transmission power is the second distance, the second distance The distance is less than or equal to a preset safety distance; the first transmit power is greater than the second transmit power; and a second computer program, wherein the second computer program is stored on the second memory, when the second computer program is executed by the second processor , so that the electronic device executes: reconnecting the routing device using the first distribution network parameter of the routing device through the antenna under the first transmit power; the first distribution network parameter includes the first device identification and the first access password of the routing device; After the reconnection of the routing device fails, the first request message is periodically sent through the antenna under the second transmit power; the first request message includes the session key; the first response message of the mobile device connected to the routing device is received; the response In the first response message, the encrypted second distribution network parameters are decrypted by the session key to obtain the second distribution network parameters; and the second distribution network parameters are used to connect to the routing device through the antenna under the first transmit power.
第八方面与第二方面相对应。第八方面的技术效果可参见上述第二方面的技术效果,此处不再赘述。The eighth aspect corresponds to the second aspect. For the technical effect of the eighth aspect, reference may be made to the technical effect of the second aspect, which will not be repeated here.
第九方面,提供一种计算机可读存储介质。该计算机可读存储介质包括计算机程序,当计算机程序在电子设备上运行时,使得电子设备执行如第一方面或第二方面,或者以上第一方面或第二方面的任意一种实现方式的方法。In a ninth aspect, a computer-readable storage medium is provided. The computer-readable storage medium includes a computer program that, when executed on an electronic device, causes the electronic device to perform a method such as the first aspect or the second aspect, or any one of the above first or second aspects. .
第九方面及第九方面的任意一种实现方式分别与第一方面或第二方面,或者以上第一方面或第二方面的任意一种实现方式相对应。第九方面以及第九方面中任意一种实现方式所对应的技术效果可参见上述第一方面或第二方面,或者以上第一方面或第二方面的任意一种实现方式所对应的技术效果,此处不再赘述。The ninth aspect and any implementation manner of the ninth aspect respectively correspond to the first aspect or the second aspect, or any implementation manner of the above first aspect or the second aspect. For the technical effects corresponding to the ninth aspect and any one of the implementations of the ninth aspect, refer to the above-mentioned first aspect or the second aspect, or the technical effects corresponding to any one of the above-mentioned first or second aspects. It will not be repeated here.
第十方面,提供一种计算机程序产品。当其在计算机上运行时,使得计算机执行如第一方面或第二方面,或者以上第一方面或第二方面的任意一种实现方式的方法。In a tenth aspect, a computer program product is provided. When run on a computer, it causes the computer to perform the method of the first aspect or the second aspect, or any one of the implementations of the above first or second aspect.
第十方面及第十方面的任意一种实现方式分别与第一方面或第二方面,或者以上第一方面或第二方面的任意一种实现方式相对应。第十方面以及第十方面中任意一种实现方式所对应的技术效果可参见上述第一方面或第二方面,或者以上第一方面或第二方面的任意一种实现方式所对应的技术效果,此处不再赘述。The tenth aspect and any implementation manner of the tenth aspect respectively correspond to the first aspect or the second aspect, or any implementation manner of the above first aspect or the second aspect. For the technical effects corresponding to the tenth aspect and any one of the implementations of the tenth aspect, refer to the above-mentioned first aspect or the second aspect, or the technical effects corresponding to any one of the above-mentioned first or second aspects. It will not be repeated here.
附图说明Description of drawings
图1为本申请实施例提供的IoT设备网络修复方法的场景示意图;1 is a schematic diagram of a scenario of a method for repairing an IoT device network provided by an embodiment of the present application;
图2A-图2C为本申请实施例提供的IoT设备初始配网过程的示意图;2A-2C are schematic diagrams of an initial network distribution process of IoT devices provided by an embodiment of the present application;
图3A-图3B为本申请实施例提供的IoT设备与路由设备的断开过程的示意图;3A-3B are schematic diagrams of a disconnection process between an IoT device and a routing device according to an embodiment of the present application;
图4为本申请实施例提供的IoT设备的硬件结构示意图;4 is a schematic diagram of a hardware structure of an IoT device provided by an embodiment of the present application;
图5A为本申请实施例提供的IoT设备中的一种无线通信模块及天线的结构示意图;5A is a schematic structural diagram of a wireless communication module and an antenna in an IoT device provided by an embodiment of the present application;
图5B为本申请实施例提供的IoT设备中的另一种无线通信模块及天线的结构示意图;5B is a schematic structural diagram of another wireless communication module and an antenna in an IoT device provided by an embodiment of the present application;
图6A-图6C为本申请实施例提供的无线通信模块及天线中的具体结构示意图;6A-6C are schematic diagrams of specific structures in a wireless communication module and an antenna provided by an embodiment of the present application;
图7为本申请实施例提供的IoT设备网络修复方法中两种发射距离的示意图;7 is a schematic diagram of two transmission distances in a method for repairing an IoT device network provided by an embodiment of the present application;
图8A-图10为本申请实施例提供的IoT设备网络修复方法的流程示意图;8A-FIG. 10 are schematic flowcharts of a method for repairing an IoT device network according to an embodiment of the present application;
图11为本申请实施例提供的IoT设备网络修复方法中IoT APP的图形用户界面的 示意图;Fig. 11 is the schematic diagram of the graphical user interface of IoT APP in the IoT device network repair method provided by the embodiment of this application;
图12为本申请实施例提供的IoT设备网络修复方法的流程示意图;12 is a schematic flowchart of a method for repairing an IoT device network provided by an embodiment of the present application;
图13为本申请实施例提供的IoT设备网络修复方法中IoT APP的图形用户界面的示意图;13 is a schematic diagram of a graphical user interface of an IoT APP in a method for repairing an IoT device network provided by an embodiment of the present application;
图14和图15为本申请实施例提供的IoT设备网络修复方法的流程示意图;14 and 15 are schematic flowcharts of a method for repairing an IoT device network according to an embodiment of the present application;
图16为本申请实施例提供的IoT设备网络修复方法的场景实例示意图;16 is a schematic diagram of a scenario example of a method for repairing an IoT device network provided by an embodiment of the present application;
图17为本申请实施例提供的IoT设备网络修复方法的流程示意图;17 is a schematic flowchart of a method for repairing a network of an IoT device provided by an embodiment of the present application;
图18为本申请实施例提供的一种IoT设备的结构组成示意图。FIG. 18 is a schematic structural composition diagram of an IoT device according to an embodiment of the present application.
具体实施方式Detailed ways
以下实施例中所使用的术语只是为了描述特定实施例的目的,而并非旨在作为对本申请的限制。如在本申请的说明书和所附权利要求书中所使用的那样,单数表达形式“一个”、“一种”、“所述”、“上述”、“该”和“这一”旨在也包括例如“一个或多个”这种表达形式,除非其上下文中明确地有相反指示。还应当理解,在本申请以下各实施例中,“至少一个”、“一个或多个”是指一个或两个以上(包含两个)。术语“和/或”,用于描述关联对象的关联关系,表示可以存在三种关系;例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A、B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。The terms used in the following embodiments are for the purpose of describing particular embodiments only, and are not intended to be limitations of the present application. As used in the specification of this application and the appended claims, the singular expressions "a," "an," "the," "above," "the," and "the" are intended to also Expressions such as "one or more" are included unless the context clearly dictates otherwise. It should also be understood that, in the following embodiments of the present application, "at least one" and "one or more" refer to one or more than two (including two). The term "and/or", used to describe the association relationship of related objects, indicates that there can be three kinds of relationships; for example, A and/or B, can indicate: A alone exists, A and B exist at the same time, and B exists alone, A and B can be singular or plural. The character "/" generally indicates that the associated objects are an "or" relationship.
在本说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。术语“连接”包括直接连接和间接连接,除非另外说明。References in this specification to "one embodiment" or "some embodiments" and the like mean that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in other embodiments," etc. in various places in this specification are not necessarily All refer to the same embodiment, but mean "one or more but not all embodiments" unless specifically emphasized otherwise. The terms "including", "including", "having" and their variants mean "including but not limited to" unless specifically emphasized otherwise. The term "connected" includes both direct and indirect connections unless otherwise specified.
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。Hereinafter, the terms "first" and "second" are only used for descriptive purposes, and should not be construed as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may expressly or implicitly include one or more of that feature.
在本申请实施例中,“示例性地”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性地”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性地”或者“例如”等词旨在以具体方式呈现相关概念。In the embodiments of the present application, words such as "exemplarily" or "for example" are used to represent examples, illustrations or illustrations. Any embodiment or design described in the embodiments of the present application as "exemplarily" or "such as" should not be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplarily" or "such as" is intended to present the related concepts in a specific manner.
物联网是指通过各种信息传感器、射频识别技术、全球定位系统、红外感应器、激光扫描器等各种装置与技术,实时采集声、光、热、电、力学、化学、生物、位置等各种需要的信息,通过各类可能的网络接入,实现物与物、物与人的泛在连接,实现对物品和过程的智能化感知、识别和管理。物联网是一个基于互联网、传统电信网等的信息承载体,它让所有能够被独立寻址的普通物理对象形成互联互通的网络。The Internet of Things refers to the real-time acquisition of sound, light, heat, electricity, mechanics, chemistry, biology, location, etc. All kinds of needed information, through various possible network access, realize the ubiquitous connection between things and things, things and people, and realize the intelligent perception, identification and management of objects and processes. The Internet of Things is an information carrier based on the Internet, traditional telecommunication networks, etc. It enables all common physical objects that can be independently addressed to form an interconnected network.
物联网技术的发展,使得越来越多的IoT设备(如IoT灯、IoT音箱、IoT冰箱等)被接入到网络中。IoT设备是指通过IoT对其进行远程或近程地控制和/或监测的电子设备。典型地,智能家电就属于典型的IoT设备。The development of IoT technology has enabled more and more IoT devices (such as IoT lights, IoT speakers, IoT refrigerators, etc.) to be connected to the network. IoT devices are electronic devices that are remotely or remotely controlled and/or monitored via IoT. Typically, smart home appliances are typical IoT devices.
图1为本申请实施例提供的IoT设备网络修复方法的场景示意图。如图1所示,网络系统100可以包括移动设备110、路由设备120和IoT设备130。在有些情形下,网络系统100还包括IoT服务器140。IoT服务器140可以为本地服务器,也可以为云服务器。FIG. 1 is a schematic diagram of a scenario of a method for repairing a network of an IoT device provided by an embodiment of the present application. As shown in FIG. 1 , network system 100 may include mobile device 110 , routing device 120 and IoT device 130 . In some cases, the network system 100 also includes an IoT server 140 . The IoT server 140 may be a local server or a cloud server.
其中,移动设备110用于配置和控制IoT设备130。移动设备110可以将IoT设备130的控制权分享给其他设备控制。移动设备110可以是安装了IoT应用程序(application,APP)的移动设备。示例性地,移动设备110包括但不限于搭载
Figure PCTCN2021118805-appb-000001
Figure PCTCN2021118805-appb-000002
Windows、Linux或者其它操作系统的便携式设备。还应当理解的是,在其他一些实施例中,移动设备110也可以不是便携式设备,而是台式计算机。
Among them, the mobile device 110 is used to configure and control the IoT device 130 . The mobile device 110 may share control of the IoT device 130 to other devices for control. The mobile device 110 may be a mobile device with an IoT application (application, APP) installed. Illustratively, mobile device 110 includes, but is not limited to, onboard
Figure PCTCN2021118805-appb-000001
Figure PCTCN2021118805-appb-000002
Portable devices for Windows, Linux or other operating systems. It should also be understood that in some other embodiments, the mobile device 110 may not be a portable device, but a desktop computer.
路由设备120用于为IoT设备130提供网络接入服务。比如,IoT设备130可以接入路由设备120提供的无线局域网。路由设备120对应一个路由设备标识,IoT设备130可以通过所述路由设备标识接入路由设备120。示例性的,路由设备标识为服务集标识(service set identifier,SSID)。移动设备110可以通过路由设备120对IoT设备130进行控制。The routing device 120 is used to provide a network access service for the IoT device 130 . For example, the IoT device 130 may access the wireless local area network provided by the routing device 120 . The routing device 120 corresponds to a routing device identifier, and the IoT device 130 can access the routing device 120 through the routing device identifier. Exemplarily, the routing device identifier is a service set identifier (SSID). The mobile device 110 may control the IoT device 130 through the routing device 120 .
IoT设备130可以为智能家居设备(比如,智能电视、智能冰箱、智能空调、智能洗衣机、智能音箱、智能电饭煲、智能吊灯、智能台灯、智能摄像头、智能循环扇、智能门锁、智能插座、智能接线板、智能加湿器、智能扫地机器人、智能抽油烟机等)、便携式计算机(比如,智能手机、平板电脑、膝上型电脑等)、可穿戴设备(比如,智能手表、智能眼镜、智能耳机、智能手环、智能戒指、智能头盔等)、增强现实(augmented reality,AR)\虚拟现实(virtual reality,VR)设备、车载电脑等。本申请实施例对IoT设备130的具体形式不做特殊限制。The IoT device 130 may be a smart home device (eg, smart TV, smart refrigerator, smart air conditioner, smart washing machine, smart speaker, smart rice cooker, smart chandelier, smart desk lamp, smart camera, smart circulation fan, smart door lock, smart socket, smart Power strips, smart humidifiers, smart robot vacuums, smart range hoods, etc.), portable computers (eg, smartphones, tablets, laptops, etc.), wearable devices (eg, smart watches, smart glasses, smart headphones, etc.) , smart bracelet, smart ring, smart helmet, etc.), augmented reality (AR) \ virtual reality (virtual reality, VR) equipment, car computer, etc. The specific form of the IoT device 130 is not particularly limited in this embodiment of the present application.
在一些实施例中,网络系统100还可以包括IoT服务器140。IoT服务器140可以用于存储移动设备110的设备信息、移动设备110上IoT APP的账号信息、IoT设备130的设备信息、移动设备110与IoT设备130的对应关系、以及IoT设备130的设备共享信息等中的至少一项。IoT服务器140还可用于移动设备110在远程控制下,移动设备110与IoT设备130的消息转发、消息推送等。IoT服务器140可以为移动设备110提供状态查询等服务。IoT服务器140可以为本地服务器(如企业本地服务器),也可以为云服务器(如家居云服务器)等,还可以为多个服务器组成的服务器集群。In some embodiments, the network system 100 may also include an IoT server 140 . The IoT server 140 may be used to store the device information of the mobile device 110 , the account information of the IoT APP on the mobile device 110 , the device information of the IoT device 130 , the correspondence between the mobile device 110 and the IoT device 130 , and the device sharing information of the IoT device 130 at least one of etc. The IoT server 140 can also be used for message forwarding, message push, etc. between the mobile device 110 and the IoT device 130 under the remote control of the mobile device 110 . The IoT server 140 may provide services such as status query for the mobile device 110 . The IoT server 140 may be a local server (such as an enterprise local server), a cloud server (such as a home cloud server), etc., or a server cluster composed of multiple servers.
下面结合图2A-图2C介绍IoT设备130与路由设备120的初始配网过程。移动设备110之前已经接入路由设备120,并保存路由设备120的SSID和接入密码。如图2A所示,IoT设备130与路由设备120初始配网时,IoT设备130进入配网模式。IoT设备130将自身的Wi-Fi模块切换至接入点(access point,AP)状态。移动设备110可以通过IoT APP搜索到IoT设备130的SSID,移动设备110接入IoT设备130的SSID,与IoT设备130建立通信。之后,在移动设备110的IoT APP上,用户需要点击相关按钮,输入路由设备120的SSID和接入密码。移动设备110将路由设备120的SSID和接入密码发送给IoT设备130。上述有关路由设备120的SSID和接入密码的发送,可以在加密后发送。在一些实施例中,移动设备110(移动设备110上的IoT  APP)和IoT设备130向对方交换各自的身份凭证。示例性的,移动设备110和IoT设备130分别生成自己的公私钥对,移动设备110(移动设备110上的IoT APP)和IoT设备130向对方发送自己的公钥,并保存对方的公钥。IoT设备130在接收到移动设备110发送的路由设备120的SSID和接入密码后,将自身的Wi-Fi模块切换至工作站(station)状态,并使用路由设备120的SSID和接入密码接入路由设备120。此时就如图2B所示,IoT设备130接入路由设备120,移动设备110断开与IoT设备130之间的Wi-Fi连接。接下来,移动设备110自动搜索到路由设备120的Wi-Fi的SSID,并利用之前保存的接入密码接入路由设备120,从而如图2C所示。The following describes the initial network configuration process of the IoT device 130 and the routing device 120 with reference to FIGS. 2A-2C . The mobile device 110 has previously accessed the routing device 120 and stores the SSID and access password of the routing device 120 . As shown in FIG. 2A , when the IoT device 130 and the routing device 120 initially configure the network, the IoT device 130 enters the network configuration mode. The IoT device 130 switches its Wi-Fi module to an access point (access point, AP) state. The mobile device 110 can search for the SSID of the IoT device 130 through the IoT APP, and the mobile device 110 accesses the SSID of the IoT device 130 to establish communication with the IoT device 130. After that, on the IoT APP of the mobile device 110, the user needs to click the relevant button and input the SSID and access password of the routing device 120. Mobile device 110 sends the SSID and access password of routing device 120 to IoT device 130 . The above-mentioned sending of the SSID and the access password of the routing device 120 may be sent after encryption. In some embodiments, mobile device 110 (IoT APP on mobile device 110) and IoT device 130 exchange respective identity credentials with each other. Exemplarily, the mobile device 110 and the IoT device 130 respectively generate their own public and private key pairs, and the mobile device 110 (the IoT APP on the mobile device 110) and the IoT device 130 send their own public keys to the other party, and save the other party's public key. After receiving the SSID and access password of the routing device 120 sent by the mobile device 110, the IoT device 130 switches its Wi-Fi module to the station state, and uses the SSID and access password of the routing device 120 to access Routing device 120. At this time, as shown in FIG. 2B , the IoT device 130 is connected to the routing device 120 , and the mobile device 110 disconnects the Wi-Fi connection with the IoT device 130 . Next, the mobile device 110 automatically searches for the SSID of the Wi-Fi of the routing device 120, and uses the previously saved access password to access the routing device 120, as shown in FIG. 2C .
其中,该IoT设备130可以为用户新购买的,也可以为用户从别的地方移来用于连接路由设备120的。比如,用户住在有二层楼的别墅。楼上和楼下各有一个路由设备。用户将楼上的IoT设备130移至楼下,用于连接楼下的路由设备120。The IoT device 130 may be newly purchased by the user, or may be moved by the user from another place to connect to the routing device 120 . For example, the user lives in a villa with two floors. There is one routing device upstairs and one downstairs. The user moves the IoT device 130 upstairs to the downstairs for connecting the routing device 120 downstairs.
可替换地,在图2A中,IoT设备130与移动设备110也可通过蓝牙建立通信。也就是说,移动设备110通过蓝牙将之前保存的路由设备120的SSID和接入密码发送给IoT设备130。Alternatively, in FIG. 2A, the IoT device 130 and the mobile device 110 may also establish communication via Bluetooth. That is, the mobile device 110 sends the previously saved SSID and access password of the routing device 120 to the IoT device 130 through Bluetooth.
可替换地,上述的蓝牙通信也可替换为其他的短距离通信方式。此处不再一一展开。Alternatively, the above-mentioned Bluetooth communication can also be replaced by other short-range communication methods. It will not be expanded here.
可替换地,上述的SSID也可替换为其他的标识。只要各设备能够通过该标识定位到相应的设备即可。Alternatively, the above-mentioned SSID can also be replaced with other identifiers. As long as each device can locate the corresponding device through the identifier.
如图3A所示,在IoT设备130接入路由设备120后,IoT设备130与路由设备120正常通信。比如,IoT设备130通过路由设备120接收移动设备110发来的控制消息,并执行对应的功能。之后,若路由设备120的设备标识(比如SSID)和接入密码中的至少一项被修改,则IoT设备130就会从路由设备120断开,如图3B所示。IoT设备130在经过多次尝试后,仍无法重新接入路由设备120。此时,通常需要手动重置IoT设备130,使其重新进入配网模式,再次进行上述图2A-图2B的配网过程。比如,IoT设备130上有一个物理按键,可以通过按压该物理按键使IoT设备130进入配网模式。这样,用户还需在IoT APP上再次输入相关信息(比如路由设备120的SSID和接入密码),并再次点击相关按钮,操作繁琐,用户体验不佳。另外,有些厂家的IoT设备,在按压上述物理按键后,进入配网模式前,会自动恢复出厂设置。即对于有些厂家的IoT设备,在按压上述物理按键后,先自动恢复出厂设置,之后进入配网模式。这样,会使得IoT设备之前保存的数据(比如一些与用户密切相关的记忆数据)丢失,给用户带来不便。比如,IoT锁之前设置有在男主人的移动设备由外向内靠近时,自动开锁,并发出声音“爸爸回来了”;该IoT锁之前还设置有女主人的移动设备由外向内靠近时,自动开锁,并发出声音“妈妈回来了”。在上述情形下,由于IoT锁恢复出厂设置,就需要用户再次设置相关参数,给用户带来不便。As shown in FIG. 3A , after the IoT device 130 is connected to the routing device 120 , the IoT device 130 communicates with the routing device 120 normally. For example, the IoT device 130 receives the control message sent by the mobile device 110 through the routing device 120, and executes the corresponding function. After that, if at least one of the device identification (eg, SSID) and the access password of the routing device 120 is modified, the IoT device 130 will be disconnected from the routing device 120, as shown in FIG. 3B . The IoT device 130 is still unable to re-connect to the routing device 120 after many attempts. At this time, it is usually necessary to manually reset the IoT device 130 to make it re-enter the network distribution mode, and perform the network distribution process of FIG. 2A-FIG. 2B again. For example, there is a physical button on the IoT device 130, and the IoT device 130 can enter the network configuration mode by pressing the physical button. In this way, the user also needs to re-enter the relevant information (such as the SSID and access password of the routing device 120) on the IoT APP, and click the relevant button again, which is cumbersome to operate and has a poor user experience. In addition, some manufacturers' IoT devices will automatically restore the factory settings after pressing the above physical buttons and before entering the network configuration mode. That is, for IoT devices of some manufacturers, after pressing the above physical buttons, the factory settings are automatically restored, and then the network configuration mode is entered. In this way, the data previously saved by the IoT device (such as some memory data closely related to the user) will be lost, causing inconvenience to the user. For example, the IoT lock was previously set to automatically unlock when the mobile device of the male owner approaches from the outside to the inside, and make a sound of "Dad is back"; the IoT lock was also set to automatically unlock when the mobile device of the female owner approaches from the outside to the inside. Open the lock and make a sound of "Mom is back". In the above situation, since the IoT lock is restored to factory settings, the user needs to set the relevant parameters again, which brings inconvenience to the user.
本申请实施例提供一种IoT设备网络修复方法,在路由设备的标识和接入密码中的至少一项被修改,导致IoT设备断开与路由设备的连接后,自动将IoT设备接入路由设备。该方法无需用户操作,也不需要将IoT设备恢复成出厂设置,就可以实现IoT设备自动快捷地接入路由设备。An embodiment of the present application provides a network repair method for an IoT device. After at least one of an identifier of a routing device and an access password is modified, causing the IoT device to disconnect from the routing device, the IoT device is automatically connected to the routing device. . The method does not require user operation, nor does it need to restore the IoT device to factory settings, so that the IoT device can be automatically and quickly connected to the routing device.
图4示出了IoT设备130的结构示意图。该IoT设备130可以是移动设备,也可 以是固定设备(比如,壁挂式智能空调)。IoT设备130可包括处理器131,内部存储器132,外部存储器接口133,通用串行总线(universal serial bus,USB)接口134,充电管理模块136,电源管理模块137,电池138,天线1,天线2,无线通信模块135,传感器模块139等。FIG. 4 shows a schematic structural diagram of the IoT device 130 . The IoT device 130 may be a mobile device or a fixed device (such as a wall-mounted smart air conditioner). The IoT device 130 may include a processor 131, an internal memory 132, an external memory interface 133, a universal serial bus (USB) interface 134, a charge management module 136, a power management module 137, a battery 138, an antenna 1, an antenna 2 , the wireless communication module 135, the sensor module 139, etc.
可以理解的是,本申请实施例示意的结构并不构成对IoT设备130的具体限定。在本申请另一些实施例中,IoT设备130可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the IoT device 130 . In other embodiments of the present application, the IoT device 130 may include more or less components than shown, or combine some components, or separate some components, or arrange different components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
处理器131可以包括一个或多个处理单元。例如:处理器131可以包括应用处理器,调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的部件,也可以集成在一个或多个处理器中。在一些实施例中,IoT设备130也可以包括一个或多个处理器131。其中,控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The processor 131 may include one or more processing units. For example, the processor 131 may include an application processor, a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal A digital signal processor (DSP), a baseband processor, and/or a neural-network processing unit (NPU), etc. Wherein, different processing units may be independent components, or may be integrated in one or more processors. In some embodiments, IoT device 130 may also include one or more processors 131 . The controller can generate an operation control signal according to the instruction operation code and the timing signal, and complete the control of fetching and executing instructions.
在一些实施例中,处理器131可以包括一个或多个接口。接口可以包括集成电路间(inter-integrated circuit,I2C)接口,集成电路间音频(integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,SIM卡接口,和/或USB接口等。其中,USB接口230是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口230可以用于连接充电器为IoT设备130充电,也可以用于IoT设备130与外围设备之间传输数据。In some embodiments, the processor 131 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver (universal asynchronous receiver) /transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, SIM card interface, and/or USB interface, etc. Among them, the USB interface 230 is an interface that conforms to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like. The USB interface 230 can be used to connect a charger to charge the IoT device 130, and can also be used to transmit data between the IoT device 130 and peripheral devices.
可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对IoT设备130的结构限定。在本申请另一些实施例中,IoT设备130也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。It can be understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is only a schematic illustration, and does not constitute a structural limitation of the IoT device 130 . In other embodiments of the present application, the IoT device 130 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
充电管理模块136用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块136可以通过USB接口134接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块136可以通过IoT设备130的无线充电线圈接收无线充电输入。充电管理模块136为电池138充电的同时,还可以通过电源管理模块137为IoT设备130供电。The charging management module 136 is used to receive charging input from the charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 136 may receive charging input from the wired charger through the USB interface 134 . In some wireless charging embodiments, the charging management module 136 may receive wireless charging input through the wireless charging coil of the IoT device 130 . While the charging management module 136 charges the battery 138, the IoT device 130 can also be powered by the power management module 137.
电源管理模块137用于连接电池138、充电管理模块136和处理器131。电源管理模块137接收电池138和/或充电管理模块136的输入,为处理器131,内部存储器132,外部存储器接口133和无线通信模块135等供电。电源管理模块137还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块137也可以设置于处理器131中。在另一些实施例中,电源管理模块137和充电管理模块136也可以设置于同一个器件中。The power management module 137 is used to connect the battery 138 , the charge management module 136 and the processor 131 . The power management module 137 receives input from the battery 138 and/or the charge management module 136, and supplies power to the processor 131, the internal memory 132, the external memory interface 133, the wireless communication module 135, and the like. The power management module 137 can also be used to monitor parameters such as battery capacity, battery cycle times, battery health status (leakage, impedance). In some other embodiments, the power management module 137 may also be provided in the processor 131 . In other embodiments, the power management module 137 and the charging management module 136 may also be provided in the same device.
IoT设备130的无线通信功能可以通过天线1,天线2以及无线通信模块135等实现。The wireless communication function of the IoT device 130 may be implemented by the antenna 1, the antenna 2, the wireless communication module 135, and the like.
无线通信模块135可以提供应用在IoT设备130上的包括Wi-Fi,蓝牙(bluetooth,BT),无线数传模块(例如,433MHz,868MHz,915MHz)等无线通信的解决方案。无线通信模块135可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块135经由天线1或者天线2接收电磁波,将电磁波信号滤波以及调频处理,将处理后的信号发送到处理器131。无线通信模块135还可以从处理器131接收待发送的信号,对其进行调频,放大,经天线1或者天线2转为电磁波辐射出去。The wireless communication module 135 may provide wireless communication solutions including Wi-Fi, Bluetooth (BT), and wireless data transmission modules (eg, 433MHz, 868MHz, 915MHz) applied to the IoT device 130 . The wireless communication module 135 may be one or more devices integrating at least one communication processing module. The wireless communication module 135 receives electromagnetic waves via the antenna 1 or the antenna 2 , filters and frequency modulates the electromagnetic wave signals, and sends the processed signals to the processor 131 . The wireless communication module 135 can also receive the signal to be sent from the processor 131 , perform frequency modulation on it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 1 or the antenna 2 .
本申请实施例中,IoT设备130可以通过无线通信模块发送广播消息,广播消息中可以携带IoT设备130的设备标识或者产品标识,用于周围的第二设备发现该IoT设备。IoT设备130还可以通过无线通信模块接收第二设备发送的消息。In this embodiment of the present application, the IoT device 130 may send a broadcast message through the wireless communication module, and the broadcast message may carry the device identifier or product identifier of the IoT device 130, which is used by a second device around to discover the IoT device. The IoT device 130 may also receive a message sent by the second device through the wireless communication module.
外部存储器接口133可以用于连接外部存储卡,例如Micro SD卡,实现扩展IoT设备130的存储能力。外部存储卡通过外部存储器接口133与处理器131通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。The external memory interface 133 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the IoT device 130 . The external memory card communicates with the processor 131 through the external memory interface 133 to realize the data storage function. For example to save files like music, video etc in external memory card.
内部存储器132可以用于存储一个或多个计算机程序,该一个或多个计算机程序包括指令。处理器131可以通过运行存储在内部存储器132的上述指令,从而使得IoT设备130执行本申请一些实施例中所提供的IoT设备网络修复方法,以及各种应用以及数据处理等。内部存储器132可以包括代码存储区和数据存储区。其中,代码存储区可存储操作系统。数据存储区可存储IoT设备130使用过程中所创建的数据等。此外,内部存储器132可以包括高速随机存取存储器,还可以包括非易失性存储器,例如一个或多个磁盘存储部件,闪存部件,通用闪存存储器(universal flash storage,UFS)等。在一些实施例中,处理器131可以通过运行存储在内部存储器132的指令,和/或存储在设置于处理器131中的存储器的指令,来使得IoT设备130执行本申请实施例中所提供的IoT设备网络修复方法,以及其他应用及数据处理。 Internal memory 132 may be used to store one or more computer programs including instructions. The processor 131 may execute the above-mentioned instructions stored in the internal memory 132, thereby causing the IoT device 130 to execute the IoT device network repair method, various applications and data processing provided in some embodiments of the present application. Internal memory 132 may include code storage areas and data storage areas. Among them, the code storage area can store the operating system. The data storage area may store data and the like created during use of the IoT device 130 . In addition, the internal memory 132 may include high-speed random access memory, and may also include non-volatile memory, such as one or more disk storage components, flash memory components, universal flash storage (UFS), and the like. In some embodiments, the processor 131 may execute the instructions stored in the internal memory 132 and/or the instructions stored in the memory provided in the processor 131 to cause the IoT device 130 to execute the instructions provided in the embodiments of the present application IoT device network repair methods, and other applications and data processing.
在一种示例中,图5A示出了上述IoT设备的一种结构。如图5A所示,IoT设备130可以包括处理器131,无线通信模块135,天线1和天线2。In one example, FIG. 5A shows a structure of the above IoT device. As shown in FIG. 5A , the IoT device 130 may include a processor 131 , a wireless communication module 135 , an antenna 1 and an antenna 2 .
其中,天线1(比如强天线)和天线2(比如弱天线)用于发射和接收电磁波。进一步的,无线通信模块135将从天线1或天线2接收的电磁波转换为信号,并将信号发送至处理器131进行处理;或者无线通信模块135从处理器131接收待发送的信号,经由强天线或弱天线转为电磁波辐射出去。本申请实施例中,强天线发射信号的第一发射距离(比如10米、50米等,具体可由用户设定)大于弱天线发射信号的第二发射距离(比如0.2米、0.3米等,具体可由用户设定)。弱天线发射信号的第二发射距离小于或等于预设的安全发射距离;其中,安全发射距离为IoT设备130的拥有者通过移动设备与IoT设备130交互秘密信息的安全距离,比如安全发射距离可预设为100cm、50cm、30cm、20cm等,这样IoT设备130的拥有者在距离最多100cm远的距离,能够接收到IoT设备130发送的秘密信息,避免不安全行为(如盗取路由设备接入密码),保证网络安全和其他方面的安全。在一些实施例中,处理器131可控制强天线与弱天线的切换。当IoT设备130采用强天线时,只有在移动设备与IoT设备130之间的距离小于第一发射距离,移动设备才接收到IoT设备130发送的信号;当 IoT设备130采用弱天线时,只有在移动设备与IoT设备130之间的距离小于第二发射距离,移动设备才接收到IoT设备130发送的信号。第一发射距离和第二发射距离可分别称为第一距离和第二距离。Among them, antenna 1 (such as a strong antenna) and antenna 2 (such as a weak antenna) are used for transmitting and receiving electromagnetic waves. Further, the wireless communication module 135 converts the electromagnetic wave received from the antenna 1 or the antenna 2 into a signal, and sends the signal to the processor 131 for processing; or the wireless communication module 135 receives the signal to be sent from the processor 131, via a strong antenna Or weak antennas turn into electromagnetic waves and radiate out. In the embodiment of the present application, the first transmission distance (such as 10 meters, 50 meters, etc., which can be set by the user) of the signal transmitted by the strong antenna is greater than the second transmission distance of the signal transmitted by the weak antenna (such as 0.2 meters, 0.3 meters, etc., specifically can be set by the user). The second transmission distance of the weak antenna transmission signal is less than or equal to the preset safe transmission distance; wherein, the safe transmission distance is the safe distance for the owner of the IoT device 130 to exchange secret information with the IoT device 130 through the mobile device. For example, the safe transmission distance can be The default settings are 100cm, 50cm, 30cm, 20cm, etc., so that the owner of the IoT device 130 can receive the secret information sent by the IoT device 130 at a distance of up to 100cm, so as to avoid unsafe behaviors (such as stealing routing device access) password), to ensure network security and other aspects of security. In some embodiments, the processor 131 may control the switching of strong antennas and weak antennas. When the IoT device 130 adopts a strong antenna, the mobile device receives the signal sent by the IoT device 130 only when the distance between the mobile device and the IoT device 130 is less than the first transmission distance; when the IoT device 130 adopts a weak antenna, The mobile device receives the signal sent by the IoT device 130 only when the distance between the mobile device and the IoT device 130 is smaller than the second transmission distance. The first transmission distance and the second transmission distance may be referred to as a first distance and a second distance, respectively.
在另一种示例中,图5B示出了上述IoT设备的另一种结构。如图5B所示,IoT设备130可以包括处理器131,无线通信模块135和天线1。其中,无线通信模块135包括无线模块1351和可变阻抗电路模块1352。天线1用于发射和接收无线信号。可变阻抗电路模块1352可为由可变阻抗组成的电路或者集成线路等。处理器131通过控制调整可变阻抗电路模块1352的阻值,调节加载于天线1的功率,从而控制天线1发射无线信号时的发射距离。示例性的,可变阻抗电路模块1352的阻值为第一阻值时,天线1的发射功率为第二发射功率,发射无线信号的距离为第一发射距离(实现强天线的功能);可变阻抗电路模块1352的阻值为第二阻值时,天线1的发射功率为第一发射功率,发射无线信号的距离为第二发射距离(实现弱天线的功能)。其中,第一发射功率小于第二发射功率;第一发射距离大于第二发射距离,第二发射距离小于或等于预设的安全发射距离。第一发射距离和第二发射距离可分别称为第一距离和第二距离。In another example, FIG. 5B shows another structure of the above IoT device. As shown in FIG. 5B , the IoT device 130 may include a processor 131 , a wireless communication module 135 and an antenna 1 . The wireless communication module 135 includes a wireless module 1351 and a variable impedance circuit module 1352 . Antenna 1 is used to transmit and receive wireless signals. The variable impedance circuit module 1352 may be a circuit composed of variable impedance, an integrated circuit, or the like. The processor 131 controls and adjusts the resistance value of the variable impedance circuit module 1352 to adjust the power loaded on the antenna 1, thereby controlling the transmission distance of the antenna 1 when transmitting wireless signals. Exemplarily, when the resistance value of the variable impedance circuit module 1352 is the first resistance value, the transmission power of the antenna 1 is the second transmission power, and the distance for transmitting the wireless signal is the first transmission distance (to realize the function of a strong antenna); When the resistance value of the variable impedance circuit module 1352 is the second resistance value, the transmission power of the antenna 1 is the first transmission power, and the distance for transmitting wireless signals is the second transmission distance (to realize the function of a weak antenna). Wherein, the first transmission power is less than the second transmission power; the first transmission distance is greater than the second transmission distance, and the second transmission distance is less than or equal to the preset safe transmission distance. The first transmission distance and the second transmission distance may be referred to as a first distance and a second distance, respectively.
可以理解的是,本申请实施例示意的结构并不构成对IoT设备的具体限定。在本申请另一些实施例中,IoT设备可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on IoT devices. In other embodiments of the present application, the IoT device may include more or less components than shown, or some components may be combined, or some components may be split, or different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
在一些实施例中,上述强天线和弱天线可以共用一部分走线,例如图6A-图6C所示实施例中的描述。In some embodiments, the above-mentioned strong antenna and weak antenna may share a part of the wiring, for example, as described in the embodiments shown in FIGS. 6A-6C .
示例性地,图6A-图6C示出了图5A中弱天线的三种实现方式。如图6A-图6C所示,强天线和弱天线可以共用一部分走线。Illustratively, Figures 6A-6C illustrate three implementations of the weak antenna in Figure 5A. As shown in FIG. 6A-FIG. 6C, the strong antenna and the weak antenna may share a part of the wiring.
本申请实施例中IoT设备中的强天线和弱天线可以通过射频开关进行切换。物理上可以将弱天线与射频开关(如图6A-图6C中虚线框中所示为弱天线)都置于屏蔽罩内或者将弱天线置于芯片内。The strong antenna and the weak antenna in the IoT device in the embodiment of the present application can be switched by a radio frequency switch. Physically, both the weak antenna and the radio frequency switch (the weak antenna shown in the dashed box in FIG. 6A-FIG. 6C ) can be placed in the shielding case or the weak antenna can be placed in the chip.
本申请实施例中的弱天线的目的就是要尽可能减小发射距离。构造弱天线的原理可以是:The purpose of the weak antenna in the embodiment of the present application is to reduce the transmission distance as much as possible. The principle of constructing a weak antenna can be:
(1)减小天线长度,从而减小辐射到空气中的电磁波;(1) Reduce the length of the antenna, thereby reducing the electromagnetic waves radiated into the air;
(2)减小辐射效率,通过电阻将一部分的电磁波辐射转化为热能消耗掉;(2) Reduce the radiation efficiency, and convert a part of the electromagnetic wave radiation into heat energy and consume it through the resistance;
(3)降低回波损耗,将部分射频能量反射回芯片内部等。(3) Reduce the return loss, reflect part of the radio frequency energy back into the chip, etc.
弱天线具体的实现可以采用:The specific implementation of weak antenna can be used:
(i)将天线变短;(i) shorten the antenna;
(ii)将真天线路径中某点断开,或者在该点通过电阻、电感或者电容接地;(ii) disconnect a point in the true antenna path, or at that point through a resistor, inductor, or capacitor to ground;
(iii)使用屏蔽罩等。(iii) Use a shielding case or the like.
应理解,上述弱天线具体的实现(i)和(ii)可以在PCB板上或者芯片内部实现。It should be understood that the specific implementation (i) and (ii) of the above weak antenna may be implemented on a PCB board or inside a chip.
还应理解,上述屏蔽罩的作用是隔断天线辐射电磁波到接收器的路径,以达到削弱辐射的目的。It should also be understood that the function of the above-mentioned shielding cover is to cut off the path from the electromagnetic wave radiated by the antenna to the receiver, so as to achieve the purpose of weakening the radiation.
还应理解,上述将天线变短是指弱天线相比于强天线来说,弱天线更短。图6A 至图6C所示的三种弱天线的结构,弱天线如图6A至图6C的虚线框中的结构所示。图6A至图6C中强天线的结构都是通过射频输入输出(radio frequency input/output,RFIO)引脚连接滤波电路(例如,π型电路)、匹配电路(例如,π型电路)以及匹配电路外的天线体(例如,该天线体可以是一段金属走线)。图6A中虚线框所示的弱天线a、图6B中虚线框所示的弱天线b以及图6C中虚线框所示的弱天线c的长度不同,但是相比于强天线都更短。滤波电路的作用是防止干扰,匹配电路是用来与强天线匹配。It should also be understood that the above-mentioned shortening of the antenna means that the weak antenna is shorter than the strong antenna. The structures of the three weak antennas are shown in FIGS. 6A to 6C , and the weak antennas are shown as the structures in the dotted boxes in FIGS. 6A to 6C . The structures of the strong antennas shown in FIGS. 6A to 6C are connected to a filter circuit (eg, a π-type circuit), a matching circuit (eg, a π-type circuit) and a matching circuit through radio frequency input/output (RFIO) pins. External antenna body (eg, the antenna body may be a length of metal trace). The weak antenna a shown in the dashed box in FIG. 6A , the weak antenna b shown in the dashed box in FIG. 6B , and the weak antenna c shown in the dashed box in FIG. 6C have different lengths, but are shorter than the strong antennas. The function of the filter circuit is to prevent interference, and the matching circuit is used to match the strong antenna.
示例性的,如图6A所示,弱天线a可以位于屏蔽罩内。其中,弱天线a可以包括屏蔽罩内Wi-Fi芯片的RFIO引脚和2路开关中的第一路开关(第一路开关不连接任何器件)。有时,弱天线a还可包括在RFIO引脚和第一路开关之间的走线。其中,2路开关指的是走线或RFIO引脚与滤波电路之间的开关。通过该2路开关可以将走线或RFIO引脚,与滤波电路连通或者断开。所述第一路开关为图6A所示的与RFIO引脚或走线相连、且与滤波电路之间断开的开关。应理解,本申请实施例中的2路开关可以是单刀双掷开关。Exemplarily, as shown in FIG. 6A , the weak antenna a may be located in the shield. Wherein, the weak antenna a may include the RFIO pin of the Wi-Fi chip in the shield and the first switch of the 2 switches (the first switch is not connected to any device). Sometimes, the weak antenna a may also include a trace between the RFIO pin and the first switch. Among them, the 2-way switch refers to the switch between the trace or RFIO pin and the filter circuit. Through the 2-way switch, the trace or RFIO pin can be connected or disconnected from the filter circuit. The first switch is the switch shown in FIG. 6A that is connected to the RFIO pin or trace and disconnected from the filter circuit. It should be understood that the 2-way switch in the embodiment of the present application may be a single-pole double-throw switch.
示例性的,如图6B所示,弱天线b可以位于屏蔽罩内。其中,弱天线b可以包括屏蔽罩内Wi-Fi芯片的RFIO引脚、2路开关的第一路开关(第一路开关连接电阻)和匹配器件。有时,弱天线b还可包括在RFIO引脚和第一路开关之间的第一走线。有时,弱天线b还可包括匹配器件与地之间的第二走线。匹配器件可以为电阻。通过电阻接地可以将一部分的电磁波辐射转化为热能消耗掉,从而减小了弱天线b的辐射效率。其中,所述2路开关指的是RFIO引脚或第一走线与电阻、滤波电路之间的开关,通过该开关,可以将RFIO引脚或第一走线与电阻相连、与滤波电路断开,或者可以将RFIO引脚或第一走线与电阻断开、而与滤波电路相连通。所述的第一路开关为所述2路开关中与匹配器件相连、且与滤波电路断开的开关。Exemplarily, as shown in FIG. 6B , the weak antenna b may be located in the shielding case. Wherein, the weak antenna b may include the RFIO pin of the Wi-Fi chip in the shield, the first switch of the 2-way switch (the first switch is connected to a resistor), and a matching device. Sometimes, the weak antenna b may also include a first trace between the RFIO pin and the first switch. Sometimes, the weak antenna b may also include a second trace between the matching device and the ground. The matching device can be a resistor. Part of the electromagnetic wave radiation can be converted into heat energy and consumed by grounding the resistance, thereby reducing the radiation efficiency of the weak antenna b. The 2-way switch refers to the switch between the RFIO pin or the first trace and the resistor and filter circuit. Through this switch, the RFIO pin or the first trace can be connected to the resistor and disconnected from the filter circuit. On, or the RFIO pin or the first trace can be disconnected from the resistor and connected to the filter circuit. The first switch is a switch connected to the matching device and disconnected from the filter circuit among the two switches.
示例性的,如图6C所示,弱天线c可以位于屏蔽罩内。其中,经由芯片匹配的滤波电路后接匹配器件(例如,电阻)到地。弱天线c可以包括屏蔽罩内Wi-Fi芯片的RFIO引脚、滤波电路、2路开关的第一路开关(第一路开关连接电阻)和匹配器件(比如,电阻)。有时,弱天线c还可以包括RFIO引脚与滤波电路之间的第一走线。有时,弱天线c还可以包括滤波电路与匹配器件之间的第二走线。通过匹配器件(比如,电阻)接地可以将一部分的电磁波辐射转化为热能消耗掉,从而减小了弱天线c的辐射效率。其中,所述2路开关指的是屏蔽罩内的滤波电路与匹配器件、屏蔽罩外的匹配电路之间的开关。通过该2路开关,可以将屏蔽罩内的滤波电路与匹配器件相连、与屏蔽罩外的匹配电路断开;或者,可以将屏蔽罩内的滤波电路与匹配器件断开、而与屏蔽罩外的匹配电路相连通。所述的第一路开关为用于连接屏蔽罩内的滤波电路与匹配器件的开关。Exemplarily, as shown in FIG. 6C , the weak antenna c may be located in the shield. Wherein, the filter circuit matched by the chip is followed by a matching device (for example, a resistor) to the ground. The weak antenna c may include the RFIO pin of the Wi-Fi chip in the shield, the filter circuit, the first switch of the 2-way switch (the first switch is connected to a resistor), and a matching device (eg, a resistor). Sometimes, the weak antenna c may also include a first trace between the RFIO pin and the filter circuit. Sometimes, the weak antenna c may further include a second trace between the filter circuit and the matching device. Part of the electromagnetic wave radiation can be converted into heat energy and consumed by grounding a matching device (for example, a resistor), thereby reducing the radiation efficiency of the weak antenna c. Wherein, the 2-way switch refers to the switch between the filter circuit inside the shield, the matching device, and the matching circuit outside the shield. Through the 2-way switch, the filter circuit in the shield can be connected to the matching device and disconnected from the matching circuit outside the shield; connected to the matching circuit. The first switch is a switch used to connect the filter circuit and the matching device in the shield.
应理解,上述图6A至图6B中的强天线可以包括RFIO引脚、2路开关中的第二路开关,滤波电路、匹配电路以及匹配电路外连接的天线体。有时,图6A至图6B中的强天线还可以包括RFIO引脚与所述2路开关中的第二路开关之间的走线。所述第二路开关为用于连接RFIO引脚与滤波电路的开关。It should be understood that the above-mentioned strong antennas in FIGS. 6A to 6B may include RFIO pins, the second switch among the 2-way switches, a filter circuit, a matching circuit, and an antenna body externally connected to the matching circuit. Sometimes, the strong antenna in FIGS. 6A to 6B may also include a trace between the RFIO pin and the second switch of the 2-way switches. The second switch is a switch used to connect the RFIO pin and the filter circuit.
上述图6C中的强天线可以包括RFIO引脚、滤波电路、2路开关中的第二路开关、匹 配电路以及匹配电路外连接的天线体。有时,图6C中的强天线还可以包括RFIO引脚与滤波电路之间的走线。所述第二路开关为用于连接屏蔽罩内的滤波电路与屏蔽罩外的匹配电路的开关。The above-mentioned strong antenna in FIG. 6C may include an RFIO pin, a filter circuit, a second switch in the 2-way switch, a matching circuit, and an antenna body connected outside the matching circuit. Sometimes, the strong antenna in Figure 6C can also include traces between the RFIO pins and the filter circuit. The second switch is a switch used to connect the filter circuit inside the shield and the matching circuit outside the shield.
应理解,图5A所示的无线通信模块135可以是Wi-Fi芯片,也可以是Wi-Fi芯片及与其匹配的电路。图5B所示的无线模块1351可以是Wi-Fi芯片,图5B所示的无线通信模块135可以是Wi-Fi芯片及与其匹配的电路。It should be understood that the wireless communication module 135 shown in FIG. 5A may be a Wi-Fi chip, or may be a Wi-Fi chip and its matching circuit. The wireless module 1351 shown in FIG. 5B may be a Wi-Fi chip, and the wireless communication module 135 shown in FIG. 5B may be a Wi-Fi chip and its matching circuit.
以上不同的弱天线结构配合Wi-Fi芯片的不同发射功率(Tx power)的设置,可以达到不同的超短距通讯的要求(例如,从10cm到2m)。The above different weak antenna structures, together with the different transmit power (Tx power) settings of the Wi-Fi chip, can meet different ultra-short-range communication requirements (for example, from 10cm to 2m).
示例性的,表1示出了几种不同的弱天线结构配合不同发射功率的通讯距离。Exemplarily, Table 1 shows the communication distances of several different weak antenna structures with different transmit powers.
表1Table 1
Figure PCTCN2021118805-appb-000003
Figure PCTCN2021118805-appb-000003
由于芯片内物理器件的特性,天线最大发射功率和最小发射功率之差是相关联的。如果把电子设备的最小发射功率降得很低,则最大发射功率也会被降低,这样就不满足正常工作时的距离要求。由于不同的电子设备的结构不同以及对电子设备的安全性能要求不同,所以电子设备的生产厂商可以采用不同的弱天线结构以及发射功率来保证电子设备的通讯距离。示例性的,对于不同的智能空调生产厂商,其智能空调外壳的厚度可能不同,那么在弱天线结构相同以及发射功率相同的情况下,智能空调能够被发现的通讯距离也可能不同。不同的电子设备生产厂商可以根据其电子设备本身的结构,配合弱天线的结构以及一定的发射功率,从而结合测试,得出电子设备被发现的安全距离。用户可根据表1,对三种弱天线(弱天线a、弱天线b和弱天线c)设置发射功率,并结合测试结果,调整发射功率,使得弱天线在发射时达到对应的距离。Due to the characteristics of the physical device on the chip, the difference between the maximum transmit power and the minimum transmit power of the antenna is correlated. If the minimum transmit power of the electronic equipment is reduced very low, the maximum transmit power will also be reduced, so that the distance requirement during normal operation cannot be met. Since different electronic devices have different structures and different safety performance requirements for electronic devices, manufacturers of electronic devices can use different weak antenna structures and transmit powers to ensure the communication distance of electronic devices. Exemplarily, for different smart air conditioner manufacturers, the thickness of the smart air conditioner housing may be different, so under the condition of the same weak antenna structure and the same transmit power, the communication distance at which the smart air conditioner can be discovered may also be different. Different electronic equipment manufacturers can obtain the safe distance for electronic equipment to be discovered according to the structure of their electronic equipment, the structure of weak antennas and a certain transmission power, and combined with testing. The user can set the transmit power for the three weak antennas (weak antenna a, weak antenna b and weak antenna c) according to Table 1, and adjust the transmit power according to the test results, so that the weak antenna can reach the corresponding distance when transmitting.
结合上述示例,以第一距离是5米,第二距离是0.3米为例。当IoT设备采用强天线时,如果IoT设备与其他设备(如移动设备)之间的距离小于第一距离(如移动设备位于图7所示的位置1),IoT设备可与其他设备(如移动设备)通信;当IoT设备采用弱天线时,如果IoT设备与其他设备(如移动设备)之间的距离小于第二距离(如其他设备位于图7所示的位置2),IoT设备可与其他设备(如移动设备)通信。Combining the above examples, take the first distance as 5 meters and the second distance as 0.3 meters as an example. When the IoT device adopts a strong antenna, if the distance between the IoT device and other devices (such as mobile devices) is less than the first distance (such as the mobile device is at position 1 as shown in Figure 7), the IoT device can communicate with other devices (such as mobile devices) device) communication; when the IoT device adopts a weak antenna, if the distance between the IoT device and other devices (such as mobile devices) is less than the second distance (such as other devices located at position 2 shown in Figure 7), the IoT device can communicate with other devices device (eg mobile device) communication.
本申请实施例提供的IoT设备网络修复方法,可以应用于图1-图2C中任意一个所示的系统。如图8A所示,该方法可包括:The IoT device network repair method provided in this embodiment of the present application may be applied to the system shown in any one of FIG. 1 to FIG. 2C . As shown in Figure 8A, the method may include:
S801、IoT设备连接路由设备。S801, the IoT device is connected to the routing device.
在一种示例中,请参考图8B,IoT设备连接路由设备的方法可以包括:In an example, please refer to FIG. 8B , the method for the IoT device to connect to the routing device may include:
S8011、移动设备对IoT设备进行配网。S8011, the mobile device configures the IoT device to a network.
在一种实现方式中,IoT设备与移动设备通过蓝牙互相发现,并建立蓝牙连接。用户可以在移动设备上输入第一配网参数(比如第一配网参数包括路由设备的第一设备标识和第一接入密码)。移动设备通过蓝牙将第一配网参数发送给IoT设备。In an implementation manner, the IoT device and the mobile device discover each other through Bluetooth, and establish a Bluetooth connection. The user may input the first network configuration parameter on the mobile device (for example, the first configuration network parameter includes the first device identifier and the first access password of the routing device). The mobile device sends the first network configuration parameter to the IoT device through Bluetooth.
在另一种实现方式中,IoT设备启动后,将自身的Wi-Fi模块切换至AP状态;用 户在移动设备上输入IoT设备的设备标识和AP密码,移动设备与IoT设备建立通信。用户在移动设备上输入第一配网参数(比如第一配网参数包括路由设备的第一设备标识和第一接入密码)。移动设备将第一配网参数发送给IoT设备。In another implementation, after the IoT device is started, it switches its own Wi-Fi module to the AP state; the user enters the device ID and AP password of the IoT device on the mobile device, and the mobile device establishes communication with the IoT device. The user inputs the first network configuration parameter on the mobile device (for example, the first network configuration parameter includes the first device identifier and the first access password of the routing device). The mobile device sends the first network configuration parameter to the IoT device.
S8012、IoT设备根据接收的第一配网参数连接路由设备。S8012. The IoT device connects to the routing device according to the received first distribution network parameter.
在一些实施例中,IoT设备配网后,注册到IoT服务器,这样就可以接收IoT服务器的服务。该方法还可以包括:In some embodiments, after the IoT device is configured with the network, it registers with the IoT server, so that it can receive services from the IoT server. The method may also include:
S8013、IoT设备注册到IoT服务器。S8013. The IoT device registers with the IoT server.
S8014、IoT服务器将本地认证控制码发送给IoT设备。S8014, the IoT server sends the local authentication control code to the IoT device.
S8015、IoT服务器将本地认证控制码发送给移动设备。S8015, the IoT server sends the local authentication control code to the mobile device.
在一种示例中,请参考图8C,IoT设备连接路由设备的方法可以包括:In an example, referring to FIG. 8C , a method for connecting an IoT device to a routing device may include:
S801a、移动设备对IoT设备进行配网;并且移动设备和IoT设备交换身份凭证。S801a, the mobile device configures the IoT device; and the mobile device and the IoT device exchange identity credentials.
在一种实现方式中,IoT设备与移动设备通过蓝牙互相发现,并建立蓝牙连接。用户可以在移动设备上输入第一配网参数(比如第一配网参数包括路由设备的第一设备标识和第一接入密码)。移动设备通过蓝牙将第一配网参数发送给IoT设备。In an implementation manner, the IoT device and the mobile device discover each other through Bluetooth, and establish a Bluetooth connection. The user may input the first network configuration parameter on the mobile device (for example, the first configuration network parameter includes the first device identifier and the first access password of the routing device). The mobile device sends the first network configuration parameter to the IoT device through Bluetooth.
在另一种实现方式中,IoT设备启动后,将自身的Wi-Fi模块切换至AP状态;用户在移动设备上输入IoT设备的设备标识和AP密码,移动设备与IoT设备建立通信。用户在移动设备上输入第一配网参数(比如第一配网参数包括路由设备的第一设备标识和第一接入密码)。移动设备将第一配网参数发送给IoT设备。In another implementation manner, after the IoT device is started, it switches its own Wi-Fi module to the AP state; the user enters the device ID and AP password of the IoT device on the mobile device, and the mobile device establishes communication with the IoT device. The user inputs the first network configuration parameter on the mobile device (for example, the first network configuration parameter includes the first device identifier and the first access password of the routing device). The mobile device sends the first network configuration parameter to the IoT device.
移动设备和IoT设备将自己的身份凭证发送给对方。示例性的,移动设备(移动设备上的IoT APP)和IoT设备分别生成自己的公私钥对,移动设备和IoT设备分别向对方发送自己的公钥,并保存对方的公钥。移动设备的身份凭证为移动设备的公钥;IoT设备的身份凭证为IoT设备的公钥。Mobile and IoT devices send their own credentials to each other. Exemplarily, the mobile device (IoT APP on the mobile device) and the IoT device respectively generate their own public and private key pairs, and the mobile device and the IoT device respectively send their own public keys to each other, and save the other party's public key. The identity certificate of the mobile device is the public key of the mobile device; the identity certificate of the IoT device is the public key of the IoT device.
S801b、IoT设备根据接收的第一配网参数连接路由设备。S801b, the IoT device connects to the routing device according to the received first distribution network parameter.
S801c、IoT设备注册到IoT服务器。S801c, IoT devices are registered to the IoT server.
在该示例中,基于不信任IoT服务器方案。在初始配网时,移动设备和IoT设备交换身份凭证;后续的流程中,移动设备和IoT设备即使通过IoT服务器中转消息,也进行身份凭证的认证。In this example, it is based on the untrusted IoT server scheme. During the initial network configuration, the mobile device and the IoT device exchange identity credentials; in the subsequent process, even if the mobile device and the IoT device relay messages through the IoT server, the identity credentials are authenticated.
S802、IoT设备与路由设备断开连接。S802, the IoT device is disconnected from the routing device.
在IoT设备使用过程中,可能与路由设备断开连接。比如,路由设备故障,路由设备的设备标识被修改,路由设备的接入密码被修改等情况发生,会导致IoT设备从路由设备断开连接。During the use of the IoT device, it may be disconnected from the routing device. For example, if the routing device fails, the device ID of the routing device is modified, or the access password of the routing device is modified, the IoT device will be disconnected from the routing device.
S803、IoT设备自动重连路由设备失败。S803. The IoT device fails to automatically reconnect to the routing device.
IoT设备检测到与路由设备断开连接,使用保存的路由设备的设备标识和接入密码发起自动重连路由设备过程。如果是路由设备短暂故障造成的IoT设备与路由设备断开连接,IoT设备可以通过自动重连路由设备修复网络连接。如果是路由设备的设备标识被修改,路由设备的接入密码被修改等情况,由于在自动重连路由设备时,IoT设备使用的配网参数不变,所以无法通过自动重连路由设备修复网络连接。IoT设备自动重连路由设备m次都失败。The IoT device detects that it is disconnected from the routing device, and initiates the process of automatically reconnecting the routing device using the saved device ID and access password of the routing device. If the IoT device is disconnected from the routing device due to a short-term failure of the routing device, the IoT device can repair the network connection by automatically reconnecting the routing device. If the device ID of the routing device is modified, the access password of the routing device is modified, etc., because the network configuration parameters used by the IoT device remain unchanged when the routing device is automatically reconnected, the network cannot be repaired by automatically reconnecting the routing device. connect. The IoT device fails to automatically reconnect to the routing device m times.
S804、IoT设备从移动设备获取路由设备的设备标识和接入密码。S804, the IoT device obtains the device identification and access password of the routing device from the mobile device.
IoT设备触发重新配网,向移动设备发送网络修复请求,请求移动设备发送配网参数。移动设备接收用户输入的路由设备的设备标识和接入密码,或者获取保存在本地的路由设备的设备标识和接入密码,将IoT设备配网参数发送给IoT设备。The IoT device triggers network reconfiguration, sends a network repair request to the mobile device, and requests the mobile device to send network configuration parameters. The mobile device receives the device ID and access password of the routing device entered by the user, or obtains the device ID and access password of the routing device stored locally, and sends the IoT device network configuration parameters to the IoT device.
S805、IoT设备根据获取的路由设备的设备标识和接入密码重新连接路由设备。S805, the IoT device reconnects the routing device according to the obtained device identification and access password of the routing device.
IoT设备接收到配网参数,根据该配网参数重新连接路由设备。The IoT device receives the network configuration parameters and reconnects the routing device according to the network configuration parameters.
本申请实施例提供的IoT设备网络修复方法,IoT设备检测到从路由设备断开连接后,从移动设备获取新的配网参数,重新接入路由设备;不需要重启IoT设备。可以更快捷方便的实现IoT设备网络修复,并且避免重启IoT设备带来的数据丢失。In the IoT device network repair method provided by the embodiments of the present application, after the IoT device detects that it is disconnected from the routing device, it obtains new network configuration parameters from the mobile device, and reconnects to the routing device; the IoT device does not need to be restarted. The IoT device network can be repaired more quickly and conveniently, and data loss caused by restarting the IoT device can be avoided.
下面将结合附图,对IoT设备从路由设备断开连接后,自动修复网络的方法进行详细介绍。The method for automatically repairing the network after the IoT device is disconnected from the routing device will be described in detail below with reference to the accompanying drawings.
本申请实施例提供一种IoT设备网络修复方法,如图9所示,该方法可以包括:An embodiment of the present application provides a method for repairing an IoT device network. As shown in FIG. 9 , the method may include:
S901、IoT设备检测到从路由设备断开连接,自动重连路由设备m次都失败,进入网络修复模式。IoT设备进入第一工作状态。S901. The IoT device detects that it is disconnected from the routing device, and fails to automatically reconnect to the routing device m times, and enters the network repair mode. The IoT device enters the first working state.
比如,用户修改了路由设备的接入密码。IoT设备重连路由设备时,路由设备的设备标识存在,但是接入密码错误,自动重连路由设备m次都失败。再比如,用户修改了路由设备的设备标识。IoT设备重连路由设备时,未发现修改前的设备标识,自动重连路由设备m次都失败。IoT设备进入网络修复模式。其中,m>1,具体数值可以由用户设定。For example, the user modifies the access password of the routing device. When the IoT device reconnects to the routing device, the device ID of the routing device exists, but the access password is incorrect, and the automatic reconnection to the routing device fails m times. For another example, the user modifies the device identification of the routing device. When the IoT device reconnects to the routing device, the device ID before modification is not found, and it fails to automatically reconnect to the routing device m times. The IoT device enters network repair mode. Among them, m>1, the specific value can be set by the user.
IoT设备进入第一工作状态。The IoT device enters the first working state.
在一种实现方式中,IoT设备通过Wi-Fi与移动设备通信。IoT设备进入第一工作状态,即将自身的Wi-Fi模块切换至AP状态。In one implementation, IoT devices communicate with mobile devices over Wi-Fi. The IoT device enters the first working state, that is, switches its Wi-Fi module to the AP state.
在一种实现方式中,IoT设备通过蓝牙与移动设备通信。IoT设备进入第一工作状态,即打开蓝牙。In one implementation, the IoT device communicates with the mobile device via Bluetooth. The IoT device enters the first working state, that is, turns on Bluetooth.
可以理解的,IoT设备还可以通过其他无线通信方式与移动设备通信。本申请实施例不再一一列举。Understandably, IoT devices can also communicate with mobile devices through other wireless communication methods. The embodiments of the present application are not listed one by one.
在一种示例中,IoT设备包括指示灯,IoT设备可以通过指示灯闪烁,提示IoT设备进入网络修复模式。在另一种示例中,IoT设备可以语音播放提示信息,提示IoT设备进入网络修复模式。In one example, the IoT device includes an indicator light, and the IoT device can flash the indicator light to prompt the IoT device to enter a network repair mode. In another example, the IoT device may play a prompt message by voice to prompt the IoT device to enter the network repair mode.
S901’、移动设备显示第一提示信息。S901', the mobile device displays the first prompt information.
IoT设备与路由设备断开连接后,移动设备不能通过路由设备与IoT设备通信。移动设备确定IoT设备离线。After the IoT device is disconnected from the routing device, the mobile device cannot communicate with the IoT device through the routing device. The mobile device determines that the IoT device is offline.
在一种示例中,如图10所示,移动设备按照第一周期(比如1s)向IoT设备发送第一保活请求。IoT设备接收到第一保活请求后,向移动设备发送第一保活响应。移动设备在预设时长(比如10ms)内接收到第一保活响应,则确定IoT设备正常连接路由设备(未离线)。可以理解的,移动设备通过路由设备向IoT设备发送第一保活请求,并通过路由设备接收第一保活响应。如果移动设备在预设时长(比如10ms)内未接收到第一保活响应,则确定IoT设备离线。可选的,移动设备向IoT设备发送第一保活请求后,若在预设时长(比如10ms)内未接收到第一保活响应,可以再次向IoT设备发送第一保活请求。如果移动设备向IoT设备发送第一保活请求的次数超过预设 次数,且未接收到第一保活响应,则确定IoT设备离线。In an example, as shown in FIG. 10 , the mobile device sends a first keep-alive request to the IoT device according to a first period (for example, 1s). After receiving the first keep-alive request, the IoT device sends a first keep-alive response to the mobile device. If the mobile device receives the first keep-alive response within a preset time period (for example, 10ms), it is determined that the IoT device is normally connected to the routing device (not offline). It can be understood that the mobile device sends the first keep-alive request to the IoT device through the routing device, and receives the first keep-alive response through the routing device. If the mobile device does not receive the first keep-alive response within a preset time period (for example, 10ms), it is determined that the IoT device is offline. Optionally, after the mobile device sends the first keep-alive request to the IoT device, if the first keep-alive response is not received within a preset time period (for example, 10 ms), the mobile device may send the first keep-alive request to the IoT device again. If the number of times the mobile device sends the first keep-alive request to the IoT device exceeds the preset number of times, and the first keep-alive response is not received, it is determined that the IoT device is offline.
在一种实现方式中,移动设备显示第一提示信息。第一提示信息用于提示用户将移动设备靠近IoT设备。示例性的,以手机作为移动设备为例,如图11所示,移动设备110显示设备管理界面1110,设备管理界面1110包括IoT设备“智能台灯”的运行信息。移动设备检测到智能台灯未连接路由设备,显示提示信息1111“设备已离线”。在一种示例中,移动设备接收用户对提示信息1111的点击操作,显示帮助界面1120。帮助界面1120包括提示信息1121“是否修改了工作Wi-Fi的名称或密码,您可以尝试将手机靠近设备来重新设置设备的工作Wi-Fi。”In an implementation manner, the mobile device displays the first prompt information. The first prompt information is used to prompt the user to bring the mobile device close to the IoT device. Illustratively, taking a mobile phone as a mobile device as an example, as shown in FIG. 11 , the mobile device 110 displays a device management interface 1110 , and the device management interface 1110 includes operation information of the IoT device “smart desk lamp”. The mobile device detects that the smart desk lamp is not connected to the routing device, and displays the prompt message 1111 "Device is offline". In one example, the mobile device receives the user's click operation on the prompt information 1111 and displays the help interface 1120 . The help interface 1120 includes prompt information 1121 "Whether the name or password of the working Wi-Fi has been modified, you can try to reset the working Wi-Fi of the device by bringing the mobile phone close to the device."
在一些实施例中,移动设备也可以不显示该第一提示信息。In some embodiments, the mobile device may not display the first prompt information.
S902、IoT设备使用第二天线周期性广播第一请求消息。S902, the IoT device periodically broadcasts the first request message by using the second antenna.
IoT设备包括第一天线和第二天线。示例性的,第一天线为前述强天线,第二天线为前述弱天线。在一种实现方式中,强天线和弱天线可以同时工作,IoT设备打开弱天线。在另一种实现方式中,强天线和弱天线可以互相切换,IoT设备切换至使用弱天线通信。The IoT device includes a first antenna and a second antenna. Exemplarily, the first antenna is the aforementioned strong antenna, and the second antenna is the aforementioned weak antenna. In one implementation, the strong antenna and the weak antenna can work at the same time, and the IoT device turns on the weak antenna. In another implementation, the strong antenna and the weak antenna can be switched to each other, and the IoT device switches to use the weak antenna to communicate.
IoT设备使用弱天线以设定的周期(比如1s、500ms等,具体可由用户设定)周期性广播第一请求消息。弱天线的发射距离为第二距离(比如0.3米、0.2米等,具体可由用户设定)。如果移动设备移动至距IoT设备第二距离内,就可接收到第一请求消息。示例性的,第一请求消息为网络修复请求。The IoT device uses a weak antenna to periodically broadcast the first request message at a set period (such as 1s, 500ms, etc., which can be specifically set by the user). The transmission distance of the weak antenna is the second distance (for example, 0.3 meters, 0.2 meters, etc., which can be specifically set by the user). The first request message may be received if the mobile device moves within a second distance from the IoT device. Exemplarily, the first request message is a network repair request.
在一种实现方式中,IoT设备周期性广播达到设定次数或者设定时长之后,关闭弱天线或者切换至使用强天线通信(使用第一天线通信)。这样,后续步骤中,IoT设备可以使用强天线与移动设备交互信息,不需要用户长时间携带移动设备靠近IoT设备。在另一种实现方式中,IoT设备也可以在S907,IoT设备接收到第一响应消息后,关闭弱天线或者切换至使用强天线通信(使用第一天线通信)。本申请实施例对此并不进行限定。In an implementation manner, after the IoT device periodically broadcasts for a set number of times or for a set duration, the weak antenna is turned off or switched to use the strong antenna for communication (using the first antenna to communicate). In this way, in the subsequent steps, the IoT device can use a strong antenna to exchange information with the mobile device, and the user does not need to carry the mobile device close to the IoT device for a long time. In another implementation manner, the IoT device may also turn off the weak antenna or switch to use the strong antenna for communication (using the first antenna for communication) after the IoT device receives the first response message in S907. This embodiment of the present application does not limit this.
在一些实施例中,第一请求消息包括IoT设备的设备标识和接入密码,以及会话秘钥。网络修复请求用于请求移动设备发送配网参数;IoT设备的设备标识和接入密码,用于移动设备与IoT设备建立通信;会话秘钥用于移动设备加密配网参数。示例性的,IoT设备的设备标识可以包括MAC地址和Product ID中的至少一项。Product ID可以展示该IoT设备的具体类型(比如该IoT设备是灯、空调、冰箱等)、生产厂家、具体型号、厂家联系方式、客服电话等各种信息。In some embodiments, the first request message includes the device identification and access password of the IoT device, and the session key. The network repair request is used to request the mobile device to send the network configuration parameters; the device ID and access password of the IoT device are used to establish communication between the mobile device and the IoT device; the session key is used for the mobile device to encrypt the network configuration parameters. Exemplarily, the device identifier of the IoT device may include at least one of a MAC address and a Product ID. Product ID can display the specific type of the IoT device (for example, the IoT device is a lamp, air conditioner, refrigerator, etc.), manufacturer, specific model, manufacturer's contact information, customer service number and other information.
在一些实施例中,比如,IoT设备初始配网时,采用图8C所示基于不信任IoT服务器方案;第一请求消息还包括第一签名;该第一签名用于移动设备验证IoT设备的身份。示例性的,可以使用IoT设备的私钥签名会话秘钥生成第一签名。In some embodiments, for example, when the IoT device is initially configured to the network, the untrusted IoT server-based solution shown in FIG. 8C is adopted; the first request message further includes a first signature; the first signature is used by the mobile device to verify the identity of the IoT device . Exemplarily, the first signature may be generated using the private key of the IoT device to sign the session key.
S903、移动设备接收到第一请求消息。S903. The mobile device receives the first request message.
用户携带移动设备靠近IoT设备,如果移动设备距IoT设备的距离小于或等于第二天线发射信号的第二距离,移动设备接收到第一请求消息。The user brings the mobile device close to the IoT device. If the distance between the mobile device and the IoT device is less than or equal to the second distance of the signal transmitted by the second antenna, the mobile device receives the first request message.
在一些实施例中,第一请求消息包括第一签名。移动设备接收到第一签名,使用移动设备保存的IoT设备的公钥验证第一签名(移动设备与IoT设备初始配网时,获取了对方的公钥)。如果移动设备使用IoT设备的公钥验证第一签名是IoT设备的私 钥签名的,则第一请求消息验证通过,执行S904。In some embodiments, the first request message includes the first signature. The mobile device receives the first signature, and uses the public key of the IoT device stored in the mobile device to verify the first signature (when the mobile device and the IoT device are initially connected to the network, the other party's public key is obtained). If the mobile device uses the public key of the IoT device to verify that the first signature is signed by the private key of the IoT device, the first request message is verified and passed, and S904 is performed.
S904、移动设备使用IoT设备的设备标识和接入密码与IoT设备建立通信连接。S904, the mobile device establishes a communication connection with the IoT device by using the device identification and access password of the IoT device.
示例性的,图12为一种移动设备与IoT设备建立通信连接的流程示意图。移动设备向IoT设备发送连接请求消息(S1201)。比如,该连接请求消息可以是关联请求消息。在一种实现方式中,该连接请求消息中包含移动设备的标识、IoT设备的设备标识和接入密码。IoT设备接收到该连接请求消息(S1202)之后,验证是否通过(S1203)。若IoT设备验证通过该连接请求消息(比如,验证IoT设备的设备标识和接入密码),则向移动设备发送连接响应消息(S1204)。其中,该连接响应消息用于确认移动设备与IoT设备之间建立通信连接(比如,建立Wi-Fi连接或蓝牙连接等)。移动设备接收该连接响应消息之后,移动设备与IoT设备之间建立通信连接(S1205和S1206)。Exemplarily, FIG. 12 is a schematic flowchart of establishing a communication connection between a mobile device and an IoT device. The mobile device sends a connection request message to the IoT device (S1201). For example, the connection request message may be an association request message. In an implementation manner, the connection request message includes the identification of the mobile device, the device identification of the IoT device, and the access password. After the IoT device receives the connection request message (S1202), the verification is passed (S1203). If the IoT device is verified through the connection request message (for example, verifying the device identification and access password of the IoT device), a connection response message is sent to the mobile device (S1204). The connection response message is used to confirm that a communication connection is established between the mobile device and the IoT device (for example, establishing a Wi-Fi connection or a Bluetooth connection, etc.). After the mobile device receives the connection response message, a communication connection is established between the mobile device and the IoT device (S1205 and S1206).
S905、移动设备获取路由设备的设备标识和接入密码。S905, the mobile device obtains the device identification and access password of the routing device.
在一种实现方式中,移动设备接收用户输入的路由设备的设备标识和接入密码。In an implementation manner, the mobile device receives the device identification and access password of the routing device input by the user.
示例性的,移动设备与IoT设备之间建立通信连接之后,移动设备显示配网参数配置界面。用户可以在该配网参数配置界面选择IoT设备连接的路由设备,并输入该路由设备的接入密码。示例性的,如图13,以手机作为移动设备为例,移动设备110显示网络设置界面1310,网络设置界面1310包括“路由设备”选项1311和“密码”输入框1312。“路由设备”选项1311可以显示默认的路由设备SSID(比如,该路由设备为手机检测到信号最强的路由设备;再比如,该路由设备为IoT设备上次连接的路由设备);用户可以在“密码”输入框1312输入“路由设备”选项1311显示的路由设备对应的接入密码。网络设置界面1310还包括“确定”按钮1313,用户可以点击“确定”按钮1313,确定对IoT设备进行配网。网络设置界面1310还可以包括“使用其他Wi-Fi”选项1314,用户可以通过选择“使用其他Wi-Fi”选项1314,修改IoT设备连接的路由设备。Exemplarily, after a communication connection is established between the mobile device and the IoT device, the mobile device displays a configuration interface for network configuration parameters. The user can select the routing device connected to the IoT device on the configuration interface of the network configuration parameters, and enter the access password of the routing device. Exemplarily, as shown in FIG. 13 , taking a mobile phone as a mobile device as an example, the mobile device 110 displays a network setting interface 1310 , and the network setting interface 1310 includes a “routing device” option 1311 and a “password” input box 1312 . The "Routing Device" option 1311 can display the default routing device SSID (for example, the routing device is the routing device with the strongest signal detected by the mobile phone; for another example, the routing device is the routing device that the IoT device was connected to last time); The “password” input box 1312 inputs the access password corresponding to the routing device displayed in the “routing device” option 1311 . The network setting interface 1310 further includes an "OK" button 1313, and the user can click the "OK" button 1313 to confirm the configuration of the IoT device. The network setting interface 1310 may also include a "Use other Wi-Fi" option 1314, and the user may modify the routing device connected by the IoT device by selecting the "Use other Wi-Fi" option 1314.
在另一种实现方式中,移动设备保存了路由设备的设备标识和接入密码。移动设备获取保存的路由设备的设备标识和接入密码。In another implementation manner, the mobile device stores the device identification and access password of the routing device. The mobile device obtains the saved device identification and access password of the routing device.
在一种示例中,移动设备和IoT设备都接入一个路由设备。用户修改了路由设备的设备标识或接入密码,移动设备使用路由设备新的设备标识和接入密码重新接入路由设备,并且保存了新的设备标识和接入密码。IoT设备重新配网时,移动设备获取保存的路由设备的设备标识和接入密码。在另一种示例中,移动设备和多个IoT设备接入一个路由设备。用户修改了路由设备的设备标识或接入密码。用户使用移动设备对多个IoT设备中的一个重新配网,移动设备接收用户输入的设备标识和接入密码后保存该设备标识和接入密码。对多个IoT设备中剩余IoT设备重新配网时,移动设备获取保存的路由设备的设备标识和接入密码。In one example, both the mobile device and the IoT device access one routing device. The user modifies the device ID or access password of the routing device, and the mobile device uses the new device ID and access password of the routing device to access the routing device again, and saves the new device ID and access password. When the IoT device is reconfigured, the mobile device obtains the saved device ID and access password of the routing device. In another example, a mobile device and multiple IoT devices are connected to a routing device. The user has modified the device ID or access password of the routing device. The user uses the mobile device to reconfigure one of the multiple IoT devices. The mobile device receives the device ID and access password entered by the user and saves the device ID and access password. When reconfiguring the remaining IoT devices among multiple IoT devices, the mobile device obtains the device ID and access password of the saved routing device.
S906、移动设备向IoT设备发送第一响应消息。S906, the mobile device sends a first response message to the IoT device.
第一响应消息可以包括配网参数(包括路由设备的设备标识和接入密码)。在一种实现方式中,该配网参数使用会话秘钥进行加密。The first response message may include network configuration parameters (including the device identification and access password of the routing device). In one implementation, the network configuration parameter is encrypted using a session key.
在一些实施例中,第一响应消息包括第二签名;该第二签名用于IoT设备验证移动设备的身份。示例性的,使用用户账号的私钥签名会话秘钥生成第二签名。In some embodiments, the first response message includes a second signature; the second signature is used by the IoT device to verify the identity of the mobile device. Exemplarily, the second signature is generated using the private key of the user account to sign the session key.
在一些实施例中,第一响应消息包括认证凭证(IoT设备首次配网,接入IoT服 务器时,IoT服务器为移动设备和IoT设备分别下发认证凭证)。在一种实现方式中,该认证凭证采用会话秘钥加密。In some embodiments, the first response message includes an authentication credential (when the IoT device is connected to the IoT server for the first time, the IoT server issues an authentication credential for the mobile device and the IoT device respectively). In one implementation, the authentication credential is encrypted with a session key.
S907、IoT设备接收到第一响应消息。S907, the IoT device receives the first response message.
IoT设备接收到第一响应消息,对第一响应消息中的身份信息(包括第二签名或认证凭证)进行验证,如果验证通过,IoT设备根据第一响应消息获取配网参数,执行S908,IoT设备进入第二工作状态;如果验证不通过,执行S902,IoT设备使用第二天线周期性广播第一请求消息。The IoT device receives the first response message, and verifies the identity information (including the second signature or authentication certificate) in the first response message. If the verification is passed, the IoT device obtains the network configuration parameters according to the first response message, and executes S908, IoT The device enters the second working state; if the verification fails, perform S902, and the IoT device periodically broadcasts the first request message by using the second antenna.
在一些实施例中,比如,IoT设备初始配网时,采用图8C所示基于不信任IoT服务器方案;第一响应消息包括第二签名。IoT设备对第二签名进行验证。在一种实现方式中,IoT设备使用用户账号的公钥验证第二签名。如果IoT设备使用用户账号的公钥验证第二签名是用户账号的私钥签名的,则验证通过,执行S908,IoT设备进入第二工作状态;如果验证不通过,执行S902,IoT设备使用第二天线周期性广播第一请求消息。In some embodiments, for example, when the IoT device is initially configured to the network, the solution based on the untrusted IoT server shown in FIG. 8C is adopted; the first response message includes the second signature. The IoT device verifies the second signature. In one implementation, the IoT device verifies the second signature using the public key of the user account. If the IoT device uses the public key of the user account to verify that the second signature is signed by the private key of the user account, the verification is passed, and S908 is executed, and the IoT device enters the second working state; if the verification fails, S902 is executed, and the IoT device uses the second working state. The antenna periodically broadcasts the first request message.
在一些实施例中,比如,IoT设备初始配网时,采用图8B所示方案;第一响应消息包括认证凭证。IoT设备对认证凭证进行验证;如果验证通过,执行S908,IoT设备进入第二工作状态;如果验证不通过,执行S902,IoT设备使用第一天线周期性广播第一请求消息。In some embodiments, for example, when the IoT device is initially configured to the network, the solution shown in FIG. 8B is adopted; the first response message includes an authentication credential. The IoT device verifies the authentication credential; if the verification passes, execute S908, the IoT device enters the second working state; if the verification fails, execute S902, and the IoT device periodically broadcasts the first request message using the first antenna.
IoT设备对移动设备的身份进行验证,保证安全性,防止不合法的用户控制IoT设备。IoT devices verify the identity of mobile devices to ensure security and prevent illegal users from controlling IoT devices.
IoT设备根据第一响应消息获取配网参数。比如,IoT设备获取第一响应消息中加密的配网参数,使用会话秘钥解密加密的第二配网参数,获取到配网参数。The IoT device obtains network configuration parameters according to the first response message. For example, the IoT device obtains the encrypted configuration parameters in the first response message, decrypts the encrypted second configuration parameters with the session key, and obtains the configuration parameters.
S908、IoT设备进入第二工作状态。S908, the IoT device enters the second working state.
在一种实现方式中,IoT设备通过Wi-Fi与移动设备通信。IoT设备进入第二工作状态,即将自身的Wi-Fi模块切换至工作站状态。In one implementation, IoT devices communicate with mobile devices over Wi-Fi. The IoT device enters the second working state, that is, switches its own Wi-Fi module to the workstation state.
在一种实现方式中,IoT设备通过蓝牙与移动设备通信。IoT设备进入第二工作状态,即关闭蓝牙。需要说明的是,IoT设备也可以不关闭蓝牙。本申请实施例对此并不进行限定。In one implementation, the IoT device communicates with the mobile device via Bluetooth. The IoT device enters the second working state, that is, turning off the Bluetooth. It should be noted that the IoT device can also not turn off the Bluetooth. This embodiment of the present application does not limit this.
可以理解的,IoT设备还可以通过其他无线通信方式与移动设备通信。本申请实施例不再一一列举。Understandably, IoT devices can also communicate with mobile devices through other wireless communication methods. The embodiments of the present application are not listed one by one.
S909、IoT设备根据配网参数与路由设备建立通信。S909, the IoT device establishes communication with the routing device according to the distribution network parameters.
IoT设备根据接收到的配网参数重新与路由设备建立通信。示例性的,图14为一种IoT设备与路由设备建立通信连接的流程示意图。IoT设备向路由设备发送连接请求消息(S1401)。比如,该连接请求消息可以是关联请求消息。在一种实现方式中,该连接请求消息包含IoT设备的标识、路由设备的设备标识和接入密码。路由设备接收到该连接请求消息(S1402)之后,验证是否通过(S1403)。若路由设备验证通过该连接请求消息(比如,验证路由设备的设备标识和接入密码),则向IoT设备发送连接响应消息(S1404)。其中,该连接响应消息用于确认IoT设备与路由设备之间建立Wi-Fi连接。IoT设备接收该连接响应消息之后,IoT设备与路由设备之间建立Wi-Fi连接(S1405和S1406)。The IoT device re-establishes communication with the routing device according to the received distribution network parameters. Exemplarily, FIG. 14 is a schematic flowchart of establishing a communication connection between an IoT device and a routing device. The IoT device sends a connection request message to the routing device (S1401). For example, the connection request message may be an association request message. In an implementation manner, the connection request message includes the identifier of the IoT device, the device identifier of the routing device, and the access password. After the routing device receives the connection request message (S1402), the verification is passed (S1403). If the routing device verifies that the connection request message is passed (for example, verifying the device identification and access password of the routing device), a connection response message is sent to the IoT device (S1404). The connection response message is used to confirm the establishment of a Wi-Fi connection between the IoT device and the routing device. After the IoT device receives the connection response message, a Wi-Fi connection is established between the IoT device and the routing device (S1405 and S1406).
本申请实施例提供的IoT设备网络修复方法,IoT设备检测到从路由设备断开连接后,自动进入网络修复模式。IoT设备进入第一工作状态,使得移动设备可以接入IoT设备。In the method for repairing a network of an IoT device provided by the embodiment of the present application, the IoT device automatically enters a network repair mode after detecting that it is disconnected from the routing device. The IoT device enters the first working state, so that the mobile device can access the IoT device.
移动设备根据用户输入获取到配网参数,并发送给IoT设备。IoT设备根据接收到的配网参数重新与路由设备建立通信。不需要用户手动重置IoT设备,就可以恢复网络连接,方便快捷且可以避免数据丢失。或者,移动设备将保存的配网参数发送给IoT设备。IoT设备根据接收到的配网参数重新与路由设备建立通信。IoT设备从路由设备断开连接后,用户将移动设备靠近IoT设备,就可以对IoT设备重新配网,恢复网络连接。网络修复过程不需要用户操作,方便快捷;也不需要用户手动重置IoT设备,可以避免数据丢失。并且IoT设备使用第二天线(弱天线)与移动设备通信,只有靠近IoT设备的移动设备可以获取到IoT设备的设备标识和接入密码,以及会话秘钥,保证数据安全。The mobile device obtains the network configuration parameters according to the user input and sends them to the IoT device. The IoT device re-establishes communication with the routing device according to the received distribution network parameters. The network connection can be restored without requiring the user to manually reset the IoT device, which is convenient and quick and avoids data loss. Alternatively, the mobile device sends the saved configuration parameters to the IoT device. The IoT device re-establishes communication with the routing device according to the received distribution network parameters. After the IoT device is disconnected from the routing device, the user can reconfigure the IoT device and restore the network connection by bringing the mobile device close to the IoT device. The network repair process does not require user operations, which is convenient and fast; it also does not require users to manually reset IoT devices, which can avoid data loss. And the IoT device uses the second antenna (weak antenna) to communicate with the mobile device. Only the mobile device close to the IoT device can obtain the device ID, access password and session key of the IoT device to ensure data security.
本申请实施例还提供一种IoT设备网络修复方法,如图15所示,该方法可以包括:This embodiment of the present application also provides a method for repairing an IoT device network. As shown in FIG. 15 , the method may include:
S1501、IoT设备检测到从路由设备断开连接,自动重连路由设备m次都失败,进入网络修复模式。IoT设备进入第一工作状态。S1501. The IoT device detects that it is disconnected from the routing device, and fails to automatically reconnect to the routing device m times, and enters the network repair mode. The IoT device enters the first working state.
S1501’、移动设备显示第一提示信息。S1501', the mobile device displays the first prompt information.
S1501和S1501’的具体步骤可以参考S901和S901’,此处不再赘述。For the specific steps of S1501 and S1501', reference may be made to S901 and S901', which will not be repeated here.
S1502、IoT设备使用天线的第二发射功率周期性广播第一请求消息。S1502. The IoT device periodically broadcasts the first request message by using the second transmit power of the antenna.
IoT设备的天线的发射功率可以调整。比如,天线的发射功率为第二发射功率时,发射信号的距离为第二距离;天线的发射功率为第一发射功率时,发射信号的距离为第一距离。其中,第二发射功率小于第一发射功率,第二距离小于第一距离。示例性的,天线的发射功率为第二发射功率时,实现上述弱天线功能;天线的发射功率为第一发射功率时,实现上述强天线功能。The transmit power of the antenna of the IoT device can be adjusted. For example, when the transmit power of the antenna is the second transmit power, the distance at which the signal is transmitted is the second distance; when the transmit power of the antenna is the first transmit power, the distance at which the signal is transmitted is the first distance. Wherein, the second transmission power is smaller than the first transmission power, and the second distance is smaller than the first distance. Exemplarily, when the transmit power of the antenna is the second transmit power, the above-mentioned weak antenna function is implemented; when the transmit power of the antenna is the first transmit power, the above-mentioned strong antenna function is implemented.
IoT设备使用天线的第二发射功率以设定的周期(比如1s、500ms等,具体可由用户设定)周期性广播第一请求消息。天线的发射功率为第二发射功率时,发射信号的距离为第二距离(比如0.3米、0.2米等,具体可由用户设定)。如果移动设备移动至距IoT设备第二距离内,就可接收到第一请求消息。The IoT device uses the second transmit power of the antenna to periodically broadcast the first request message at a set period (eg, 1s, 500ms, etc., which can be specifically set by the user). When the transmit power of the antenna is the second transmit power, the distance of the transmit signal is the second distance (for example, 0.3 meters, 0.2 meters, etc., which can be set by the user). The first request message may be received if the mobile device moves within a second distance from the IoT device.
在一种实现方式中,IoT设备周期性广播达到设定次数或者设定时长之后,调整天线的发射功率为第一发射功率,使用天线的第一发射功率通信。这样,后续步骤中,IoT设备可以使用强天线与移动设备交互信息,不需要用户长时间携带移动设备靠近IoT设备。在另一种实现方式中,IoT设备也可以在S1507,IoT设备接收到第一响应消息后,使用天线的第一发射功率通信。本申请实施例对此并不进行限定。In an implementation manner, after the IoT device periodically broadcasts for a set number of times or a set duration, the transmit power of the antenna is adjusted to be the first transmit power, and the first transmit power of the antenna is used for communication. In this way, in the subsequent steps, the IoT device can use a strong antenna to exchange information with the mobile device, and the user does not need to carry the mobile device close to the IoT device for a long time. In another implementation manner, the IoT device may also use the first transmit power of the antenna to communicate in S1507, after the IoT device receives the first response message. This embodiment of the present application does not limit this.
在一些实施例中,第一请求消息包括网络修复请求,IoT设备的设备标识和接入密码,以及会话秘钥。网络修复请求用于请求移动设备发送配网参数;IoT设备的设备标识和接入密码,用于移动设备与IoT设备建立通信;会话秘钥用于移动设备加密配网参数。示例性的,IoT设备的设备标识包括MAC地址和Product ID中的至少一项。Product ID可以展示该IoT设备的具体类型(比如该IoT设备是灯、空调、冰箱等)、生产厂家、具体型号、厂家联系方式、客服电话等各种信息。In some embodiments, the first request message includes a network repair request, a device identification and access password of the IoT device, and a session key. The network repair request is used to request the mobile device to send the network configuration parameters; the device ID and access password of the IoT device are used to establish communication between the mobile device and the IoT device; the session key is used for the mobile device to encrypt the network configuration parameters. Exemplarily, the device identifier of the IoT device includes at least one of a MAC address and a Product ID. Product ID can display the specific type of the IoT device (for example, the IoT device is a lamp, air conditioner, refrigerator, etc.), manufacturer, specific model, manufacturer's contact information, customer service number and other information.
在一些实施例中,比如,IoT设备初始配网时,采用图8C所示基于不信任IoT服 务器方案;第一请求消息还包括第一签名;该第一签名用于移动设备验证IoT设备的身份。示例性的,可以使用IoT设备的私钥签名会话秘钥生成第一签名。In some embodiments, for example, when the IoT device is initially configured to the network, the untrusted IoT server-based solution shown in FIG. 8C is adopted; the first request message further includes a first signature; the first signature is used by the mobile device to verify the identity of the IoT device . Exemplarily, the first signature may be generated using the private key of the IoT device to sign the session key.
S1503、移动设备接收到第一请求消息。S1503. The mobile device receives the first request message.
S1504、移动设备使用IoT设备的设备标识和接入密码与IoT设备建立通信连接。S1504, the mobile device establishes a communication connection with the IoT device by using the device identification and access password of the IoT device.
S1505、移动设备获取路由设备的设备标识和接入密码。S1505, the mobile device acquires the device identification and access password of the routing device.
S1506、移动设备向IoT设备发送第一响应消息。S1506. The mobile device sends a first response message to the IoT device.
S1507、IoT设备接收到第一响应消息。S1507. The IoT device receives the first response message.
S1508、IoT设备进入第二工作状态。S1508, the IoT device enters the second working state.
S1509、IoT设备根据配网参数与路由设备建立通信。S1509, the IoT device establishes communication with the routing device according to the distribution network parameters.
S1503-S1509的具体步骤可以参考S903-S909,此处不再赘述。For the specific steps of S1503-S1509, reference may be made to S903-S909, which will not be repeated here.
本申请实施例提供的IoT设备网络修复方法,IoT设备检测到从路由设备断开连接后,自动进入网络修复模式。IoT设备进入第一工作状态,使得移动设备可以接入IoT设备。In the method for repairing a network of an IoT device provided by the embodiment of the present application, the IoT device automatically enters a network repair mode after detecting that it is disconnected from the routing device. The IoT device enters the first working state, so that the mobile device can access the IoT device.
移动设备将配网参数发送给IoT设备。IoT设备根据接收到的配网参数重新与路由设备建立通信。该方法中,不需要用户手动重置IoT设备,就可以恢复网络连接,方便快捷且可以避免数据丢失。并且IoT设备使用天线的第二发射功率(弱天线)与移动设备通信,只有靠近IoT设备的移动设备可以获取到IoT设备的设备标识和接入密码以及会话秘钥,保证数据安全。请参考图16,其示出了本申请实施例提供的IoT设备网络修复方法的一种场景。在一种示例中,IoT设备130包括强天线和弱天线,弱天线的发射距离为0.2米。IoT设备130经过配网连接路由设备120。用户修改了路由设备120的接入密码,IoT设备130从路由设备120断开连接。IoT设备130进入网络修复模式。用户将移动设备110移动至距IoT设备130小于0.2米位置处。可选的,用户在移动设备110的IoT APP输入路由设备120新的接入密码。IoT设备130重新连接路由设备120。The mobile device sends the network configuration parameters to the IoT device. The IoT device re-establishes communication with the routing device according to the received distribution network parameters. In this method, the network connection can be restored without requiring the user to manually reset the IoT device, which is convenient and quick and can avoid data loss. And the IoT device uses the second transmit power of the antenna (weak antenna) to communicate with the mobile device. Only the mobile device close to the IoT device can obtain the device ID, access password and session key of the IoT device to ensure data security. Please refer to FIG. 16 , which shows a scenario of the IoT device network repair method provided by the embodiment of the present application. In one example, the IoT device 130 includes a strong antenna and a weak antenna, and the transmission distance of the weak antenna is 0.2 meters. The IoT device 130 is connected to the routing device 120 through the distribution network. The user modifies the access password of the routing device 120 , and the IoT device 130 is disconnected from the routing device 120 . IoT device 130 enters network repair mode. The user moves the mobile device 110 to a location less than 0.2 meters from the IoT device 130 . Optionally, the user inputs a new access password of the routing device 120 in the IoT APP of the mobile device 110. IoT device 130 reconnects routing device 120 .
本申请实施例还提供一种IoT设备网络修复方法,如图17所示,该方法可以包括:The embodiment of the present application also provides a method for repairing an IoT device network, as shown in FIG. 17 , the method may include:
S1701、IoT设备检测到从路由设备断开连接。S1701. The IoT device detects that it is disconnected from the routing device.
IoT设备经过配网接入路由设备后,在IoT设备使用过程中,可能与路由设备断开连接。比如,路由设备故障,路由设备的设备标识被修改,路由设备的接入密码被修改等情况发生,会导致IoT设备从路由设备断开连接。After the IoT device is connected to the routing device through the distribution network, it may be disconnected from the routing device during the use of the IoT device. For example, if the routing device fails, the device ID of the routing device is modified, or the access password of the routing device is modified, the IoT device will be disconnected from the routing device.
S1702、IoT设备自动重连路由设备。S1702. The IoT device automatically reconnects to the routing device.
在一些实施例中,IoT设备检测到从路由设备断开连接,自动重连路由设备。如果路由设备路障没有恢复,路由设备的设备标识被修改,或者路由设备的接入密码被修改等情况,IoT设备自动重连路由设备失败。在一种实现方式中,如果IoT设备自动重连路由设备m次(m>1,具体数值可以由用户设定)都失败,则执行S1703,IoT设备进入网络修复模式。在另一种实现方式中,IoT设备自动重连路由设备,如果在设定时长T 1之后未成功连接路由设备,则执行S1703,IoT设备进入网络修复模式。 In some embodiments, the IoT device detects a disconnection from the routing device and automatically reconnects the routing device. If the routing device roadblock is not recovered, the device ID of the routing device is modified, or the access password of the routing device is modified, the IoT device fails to automatically reconnect to the routing device. In an implementation manner, if the IoT device fails to automatically reconnect to the routing device m times (m>1, the specific value can be set by the user), S1703 is executed, and the IoT device enters the network repair mode. In another implementation manner, the IoT device automatically reconnects to the routing device. If the routing device is not successfully connected after the set duration T1, S1703 is executed, and the IoT device enters the network repair mode.
S1703、IoT设备进入网络修复模式。S1703. The IoT device enters the network repair mode.
IoT设备进入第一工作状态。The IoT device enters the first working state.
在一种实现方式中,IoT设备通过Wi-Fi与移动设备通信。IoT设备进入第一工作 状态,即将自身的Wi-Fi模块切换至AP状态。在另一种实现方式中,IoT设备通过蓝牙与移动设备通信。IoT设备进入第一工作状态,即打开蓝牙。可以理解的,IoT设备还可以通过其他无线通信方式与移动设备通信。本申请实施例不再一一列举。In one implementation, IoT devices communicate with mobile devices over Wi-Fi. The IoT device enters the first working state, that is, switches its Wi-Fi module to the AP state. In another implementation, the IoT device communicates with the mobile device via Bluetooth. The IoT device enters the first working state, that is, turns on Bluetooth. Understandably, IoT devices can also communicate with mobile devices through other wireless communication methods. The embodiments of the present application are not listed one by one.
在一种示例中,IoT设备包括指示灯,IoT设备可以通过指示灯闪烁,提示IoT设备进入网络修复模式。在另一种示例中,IoT设备可以语音播放提示信息,提示IoT设备进入网络修复模式。In one example, the IoT device includes an indicator light, and the IoT device can flash the indicator light to prompt the IoT device to enter a network repair mode. In another example, the IoT device may play a prompt message by voice to prompt the IoT device to enter the network repair mode.
S1704、如果在第一时长内未接收到配网参数,IoT设备退出网络修复模式。S1704. If the network configuration parameters are not received within the first time period, the IoT device exits the network repair mode.
在一种实现方式中,IoT设备进入网络修复模式后,启动一个定时器,该定时器的时长为第一时长。In an implementation manner, after the IoT device enters the network repair mode, a timer is started, and the duration of the timer is the first duration.
在一些实施例中,IoT设备接收不到配网参数。比如,IoT设备使用弱天线周期性广播第一请求消息,而移动设备距IoT设备的距离大于弱天线发射信号的第二距离,移动设备未接收到第一请求消息,从而不会发送配网参数。再比如,移动设备未获取到路由设备的设备标识和接入密码,从而不会发送配网参数。In some embodiments, the IoT device cannot receive the configuration parameters. For example, the IoT device periodically broadcasts the first request message using a weak antenna, and the distance between the mobile device and the IoT device is greater than the second distance of the signal transmitted by the weak antenna, and the mobile device does not receive the first request message, so the network configuration parameters will not be sent. . For another example, the mobile device does not obtain the device identification and access password of the routing device, and thus does not send network configuration parameters.
如果定时器超时,IoT设备未接收到移动设备发送的配网参数,退出网络修复模式。IoT设备进入第二工作状态。在一种实现方式中,IoT设备通过Wi-Fi与移动设备通信。IoT设备进入第二工作状态,即将自身的Wi-Fi模块切换至工作站状态。在另一种实现方式中,IoT设备通过蓝牙与移动设备通信。IoT设备进入第二工作状态,即关闭蓝牙。需要说明的是,IoT设备也可以不关闭蓝牙。本申请实施例对此并不进行限定。可以理解的,IoT设备还可以通过其他无线通信方式与移动设备通信。本申请实施例不再一一列举。If the timer expires, the IoT device does not receive the network configuration parameters sent by the mobile device and exits the network repair mode. The IoT device enters the second working state. In one implementation, IoT devices communicate with mobile devices over Wi-Fi. The IoT device enters the second working state, that is, switches its own Wi-Fi module to the workstation state. In another implementation, the IoT device communicates with the mobile device via Bluetooth. The IoT device enters the second working state, that is, turning off the Bluetooth. It should be noted that the IoT device can also not turn off the Bluetooth. This embodiment of the present application does not limit this. Understandably, IoT devices can also communicate with mobile devices through other wireless communication methods. The embodiments of the present application are not listed one by one.
IoT设备退出网络修复模式后,执行S1702,IoT设备自动重连路由设备。After the IoT device exits the network repair mode, execute S1702, and the IoT device automatically reconnects to the routing device.
本申请实施例提供的IoT设备网络修复方法,IoT设备从路由设备断开后,循环进入自动重连路由设备和网络修复模式;如此往复,直到IoT设备自动连接路由设备成功或者重新配网成功。不需要用户手动重置IoT设备就恢复网络连接,方便快捷且网络恢复成功率高。在一些实施例中,在循环过程中,每次执行自动重连路由设备时,自动重连的次数m逐渐减小(或T 1的值逐渐减小);和/或每次进入网络修复模式时,第一时长的值逐渐增大;以使得在长时间无法连接到路由设备的情况下,处于网络修复模式的时间越来越长,提高网络修复成功几率。 In the IoT device network repair method provided by the embodiment of the present application, after the IoT device is disconnected from the routing device, it cyclically enters the automatic reconnection to the routing device and the network repair mode; and so on, until the IoT device automatically connects to the routing device successfully or reconfigures the network successfully. It is convenient and quick to restore the network connection without requiring the user to manually reset the IoT device, and the success rate of network recovery is high. In some embodiments, in the loop process, each time the routing device is automatically reconnected, the number of automatic reconnections m is gradually decreased (or the value of T1 is gradually decreased); and/or each time the network repair mode is entered When , the value of the first duration increases gradually; so that in the case of being unable to connect to the routing device for a long time, the time in the network repair mode becomes longer and longer, and the probability of successful network repair is improved.
需要说明的是,本申请的各个实施例的各个步骤的全部或部分的技术特征,均可以任意、自由地组合。上述任意、自由地组合后的技术方案,也在本申请的保护范围内。It should be noted that, all or part of the technical features of each step of each embodiment of the present application can be combined arbitrarily and freely. The above technical solutions that are arbitrarily and freely combined are also within the protection scope of the present application.
可以理解的是,上述IoT设备为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本申请实施例能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。本领域技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请实施例的范围。It can be understood that, in order to realize the above functions, the above IoT device includes corresponding hardware structures and/or software modules for executing each function. Those skilled in the art should easily realize that, in conjunction with the units and algorithm steps of the examples described in the embodiments disclosed herein, the embodiments of the present application can be implemented in hardware or a combination of hardware and computer software. Whether a function is performed by hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of the embodiments of the present application.
本申请实施例可以根据上述方法示例对上述IoT设备进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处 理模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。需要说明的是,本申请实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In this embodiment of the present application, the above-mentioned IoT device may be divided into functional modules according to the above-mentioned method examples. For example, each functional module may be divided into each function, or two or more functions may be integrated into one processing module. The above-mentioned integrated modules can be implemented in the form of hardware, and can also be implemented in the form of software function modules. It should be noted that, the division of modules in the embodiments of the present application is schematic, and is only a logical function division, and there may be other division manners in actual implementation.
在一种示例中,请参考图18,其示出了上述实施例中所涉及的IoT设备的一种可能的结构示意图。该IoT设备1800包括:处理单元1810,存储单元1820和通信单元1830。In an example, please refer to FIG. 18 , which shows a possible schematic structural diagram of the IoT device involved in the above embodiment. The IoT device 1800 includes: a processing unit 1810 , a storage unit 1820 and a communication unit 1830 .
其中,处理单元1810,用于对IoT设备1800的动作进行控制管理。例如,可以用于执行图8A中各个步骤;或者可以用于执行图9中,S901、S902、S904和S907-S909的处理步骤;或者可以用于执行图15中,S1501、S1502、S1504和S1507-S1509的处理步骤;或者,可以用于执行图17中各个步骤;和/或用于本文所描述的技术的其它过程。Among them, the processing unit 1810 is used to control and manage the actions of the IoT device 1800 . For example, it can be used to perform each step in FIG. 8A; or it can be used to perform the processing steps of S901, S902, S904 and S907-S909 in FIG. 9; or it can be used to perform the processing steps of S1501, S1502, S1504 and S1507 in FIG. 15 . - The processing steps of S1509; alternatively, may be used to perform various steps in Figure 17; and/or other processes for the techniques described herein.
存储单元1820用于保存IoT设备1800的程序代码和数据。The storage unit 1820 is used to save program codes and data of the IoT device 1800 .
通信单元1830用于支持IoT设备1800与其他装置的通信。例如,可以用于执行图9中,S904和S909的处理步骤;或者可以用于执行图15中,S1504和S1509的处理步骤;和/或用于本文所描述的技术的其它过程。The communication unit 1830 is used to support communication between the IoT device 1800 and other devices. For example, may be used to perform the processing steps of S904 and S909 in FIG. 9; or may be used to perform the processing steps of S1504 and S1509 of FIG. 15; and/or other processes for the techniques described herein.
当然,上述IoT设备1800中的单元模块包括但不限于上述处理单元1810,存储单元1820和通信单元1830。例如,IoT设备1800中还可以包括电源单元等。电源单元用于对IoT设备1800供电。Of course, the unit modules in the above-mentioned IoT device 1800 include but are not limited to the above-mentioned processing unit 1810 , storage unit 1820 and communication unit 1830 . For example, the IoT device 1800 may further include a power supply unit and the like. The power supply unit is used to power the IoT device 1800 .
其中,处理单元1810可以是处理器或控制器,例如可以是中央处理器(central processing unit,CPU),数字信号处理器(digital signal processor,DSP),专用集成电路(application-specific integrated circuit,ASIC),现场可编程门阵列(field programmable gate array,FPGA)或者其他可编程逻辑器件、晶体管逻辑器件、硬件部件或者其任意组合。存储单元1820可以是存储器。通信单元1830可以是收发器、收发电路等。The processing unit 1810 may be a processor or a controller, for example, a central processing unit (CPU), a digital signal processor (DSP), an application-specific integrated circuit (ASIC) ), field programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. The storage unit 1820 may be a memory. The communication unit 1830 may be a transceiver, a transceiver circuit, or the like.
例如,处理单元1810为处理器(如图4所示的处理器131),存储单元1820可以为存储器(如图4所示的内部存储器132),通信单元1830可以称为通信接口,包括无线通信模块(如图4所示的无线通信模块135)。本申请实施例所提供的IoT设备1800可以为图4所示的IoT设备130。其中,上述处理器、存储器、通信接口等可以连接在一起,例如通过总线连接。For example, the processing unit 1810 may be a processor (such as the processor 131 shown in FIG. 4 ), the storage unit 1820 may be a memory (such as the internal memory 132 shown in FIG. 4 ), and the communication unit 1830 may be referred to as a communication interface, including wireless communication module (the wireless communication module 135 shown in FIG. 4 ). The IoT device 1800 provided in this embodiment of the present application may be the IoT device 130 shown in FIG. 4 . Wherein, the above-mentioned processors, memories, communication interfaces, etc. can be connected together, for example, connected by a bus.
本申请实施例还提供一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序代码,当处理器执行该计算机程序代码时,IoT设备执行上述实施例中的方法。Embodiments of the present application further provide a computer-readable storage medium, where computer program codes are stored in the computer-readable storage medium. When the processor executes the computer program codes, the IoT device executes the methods in the foregoing embodiments.
本申请实施例还提供了一种计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述实施例中的方法。Embodiments of the present application also provide a computer program product, which when the computer program product runs on a computer, causes the computer to execute the method in the above-mentioned embodiments.
其中,本申请实施例提供的IoT设备1800、计算机可读存储介质或者计算机程序产品均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。The IoT device 1800, the computer-readable storage medium, or the computer program product provided by the embodiments of the present application are all used to execute the corresponding methods provided above. Therefore, for the beneficial effects that can be achieved, reference may be made to the provided above. The beneficial effects in the corresponding method will not be repeated here.
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要 而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。From the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and brevity of the description, only the division of the above functional modules is used as an example for illustration. In practical applications, the above functions can be allocated as required. It is completed by different functional modules, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be Incorporation may either be integrated into another device, or some features may be omitted, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以使用硬件的形式实现,也可以使用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware, and can also be implemented in the form of software functional units.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、ROM、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, which are stored in a storage medium , including several instructions to make a device (may be a single chip microcomputer, a chip, etc.) or a processor (processor) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a removable hard disk, a ROM, a magnetic disk or an optical disk and other media that can store program codes.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above are only specific embodiments of the present application, but the protection scope of the present application is not limited thereto, and any changes or substitutions within the technical scope disclosed in the present application shall be covered within the protection scope of the present application. . Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (18)

  1. 一种电子设备,所述电子设备与路由设备的连接断开,其特征在于,所述电子设备包括:An electronic device, the electronic device is disconnected from a routing device, characterized in that the electronic device comprises:
    处理器;processor;
    存储器;memory;
    第一天线,所述第一天线的发射距离为第一距离,所述第一距离大于预设的安全距离;a first antenna, the transmission distance of the first antenna is a first distance, and the first distance is greater than a preset safety distance;
    第二天线,所述第二天线的发射距离为第二距离,所述第二距离小于或等于预设的安全距离;其中,所述第一天线和所述第二天线为不同的天线;a second antenna, the transmission distance of the second antenna is a second distance, and the second distance is less than or equal to a preset safety distance; wherein, the first antenna and the second antenna are different antennas;
    以及计算机程序,其中所述计算机程序存储在所述存储器上,当所述计算机程序被所述处理器执行时,使得所述电子设备执行:and a computer program, wherein the computer program is stored on the memory and, when executed by the processor, causes the electronic device to execute:
    通过所述第一天线,使用所述路由设备的第一配网参数重连所述路由设备;所述第一配网参数包括所述路由设备的第一设备标识和第一接入密码;Reconnecting the routing device by using the first network configuration parameter of the routing device through the first antenna; the first network configuration parameter includes the first device identifier and the first access password of the routing device;
    在重连所述路由设备失败后,通过所述第二天线,周期性地发送第一请求消息;所述第一请求消息包括会话秘钥;After the reconnection to the routing device fails, periodically send a first request message through the second antenna; the first request message includes a session key;
    接收到连接至所述路由设备的移动设备的第一响应消息;所述第一响应消息包括加密的第二配网参数;receiving a first response message from a mobile device connected to the routing device; the first response message includes an encrypted second network configuration parameter;
    响应于所述第一响应消息,通过所述会话秘钥解密所述加密的第二配网参数,获取到第二配网参数;所述第二配网参数包括所述路由设备的第二设备标识和第二接入密码;In response to the first response message, decrypt the encrypted second network configuration parameter through the session key, and obtain the second network configuration parameter; the second network configuration parameter includes the second device of the routing device identification and second access code;
    通过所述第一天线,使用所述第二配网参数连接至所述路由设备。Through the first antenna, the routing device is connected using the second distribution network parameters.
  2. 一种电子设备,所述电子设备与路由设备的连接断开,其特征在于,所述电子设备包括:An electronic device, the electronic device is disconnected from a routing device, characterized in that the electronic device comprises:
    处理器;processor;
    存储器;memory;
    天线,所述天线在第一发射功率下的发射距离为第一距离,所述第一距离大于预设的安全距离;所述天线在第二发射功率下的发射距离为第二距离,所述第二距离小于或等于预设的安全距离;所述第一发射功率大于所述第二发射功率;Antenna, the transmission distance of the antenna under the first transmission power is the first distance, and the first distance is greater than the preset safety distance; the transmission distance of the antenna under the second transmission power is the second distance, the The second distance is less than or equal to a preset safety distance; the first transmit power is greater than the second transmit power;
    以及计算机程序,其中所述计算机程序存储在所述存储器上,当所述计算机程序被所述处理器执行时,使得所述电子设备执行:and a computer program, wherein the computer program is stored on the memory and, when executed by the processor, causes the electronic device to execute:
    通过所述第一发射功率下的所述天线,使用所述路由设备的第一配网参数重连所述路由设备;所述第一配网参数包括所述路由设备的第一设备标识和第一接入密码;Using the antenna under the first transmit power, the routing device is reconnected using the first network configuration parameter of the routing device; the first network configuration parameter includes the first device identifier of the routing device and the first network configuration parameter an access code;
    在重连所述路由设备失败后,通过所述第二发射功率下的所述天线,周期性地发送第一请求消息;所述第一请求消息包括会话秘钥;After the reconnection to the routing device fails, periodically send a first request message through the antenna under the second transmit power; the first request message includes a session key;
    接收到连接至所述路由设备的移动设备的第一响应消息;所述第一响应消息包括加密的第二配网参数;receiving a first response message from a mobile device connected to the routing device; the first response message includes an encrypted second network configuration parameter;
    响应于所述第一响应消息,通过所述会话秘钥解密所述加密的第二配网参数,获取到第二配网参数;所述第二配网参数包括所述路由设备的第二设备标识和第二接入密码;In response to the first response message, decrypt the encrypted second network configuration parameter through the session key, and obtain the second network configuration parameter; the second network configuration parameter includes the second device of the routing device identification and second access code;
    通过所述第一发射功率下的所述天线,使用所述第二配网参数连接至所述路由设备。Connect to the routing device using the second distribution network parameters through the antenna at the first transmit power.
  3. 根据权利要求1或2所述的电子设备,其特征在于,所述重连所述路由设备失败包括:The electronic device according to claim 1 or 2, wherein the failure to reconnect the routing device comprises:
    重连所述路由设备失败的次数大于或等于预设的次数;或者,The number of times of failure to reconnect to the routing device is greater than or equal to a preset number of times; or,
    重连所述路由设备的时长大于或等于预设的时长。The duration of reconnecting the routing device is greater than or equal to the preset duration.
  4. 根据权利要求1-3中任意一项所述的电子设备,其特征在于,当所述计算机程序被所述处理器执行时,还使得所述电子设备执行:The electronic device according to any one of claims 1-3, wherein when the computer program is executed by the processor, the electronic device is further caused to execute:
    在通过所述会话秘钥解密所述加密的第二配网参数之前,对所述第一响应消息中的签名信息进行验证;所述签名信息用于指示所述移动设备的身份合法性。Before decrypting the encrypted second network configuration parameter by using the session key, verify the signature information in the first response message; the signature information is used to indicate the identity validity of the mobile device.
  5. 根据权利要求4所述的电子设备,其特征在于,当所述计算机程序被所述处理器执行时,还使得所述电子设备执行:The electronic device according to claim 4, wherein when the computer program is executed by the processor, the electronic device further causes the electronic device to execute:
    如果对所述第一响应消息中的签名信息进行验证失败,周期性地发送第一请求消息。If the verification of the signature information in the first response message fails, the first request message is periodically sent.
  6. 根据权利要求1-5中任意一项所述的电子设备,其特征在于,当所述计算机程序被所述处理器执行时,还使得所述电子设备执行:The electronic device according to any one of claims 1-5, wherein when the computer program is executed by the processor, the electronic device is further caused to execute:
    如果未获取到所述第二配网参数,使用所述路由设备的第一配网参数重连所述路由设备。If the second network configuration parameter is not obtained, the routing device is reconnected using the first configuration network parameter of the routing device.
  7. 一种网络修复方法,应用于电子设备,所述电子设备与路由设备的连接断开,所述电子设备包括:处理器;存储器;第一天线,所述第一天线的发射距离为第一距离,所述第一距离大于预设的安全距离;第二天线,所述第二天线的发射距离为第二距离,所述第二距离小于或等于预设的安全距离;其中,所述第一天线和所述第二天线为不同的天线;其特征在于,所述方法包括:A network repair method is applied to an electronic device, where the connection between the electronic device and the routing device is disconnected, the electronic device comprises: a processor; a memory; , the first distance is greater than the preset safety distance; the second antenna, the transmission distance of the second antenna is the second distance, and the second distance is less than or equal to the preset safety distance; wherein, the first The antenna and the second antenna are different antennas; it is characterized in that, the method includes:
    通过所述第一天线,使用所述路由设备的第一配网参数重连所述路由设备;所述第一配网参数包括所述路由设备的第一设备标识和第一接入密码;Reconnecting the routing device by using the first network configuration parameter of the routing device through the first antenna; the first network configuration parameter includes the first device identifier and the first access password of the routing device;
    在重连所述路由设备失败后,通过所述第二天线,周期性地发送第一请求消息;所述第一请求消息包括会话秘钥;After the reconnection to the routing device fails, periodically send a first request message through the second antenna; the first request message includes a session key;
    接收到连接至所述路由设备的移动设备的第一响应消息;所述第一响应消息包括加密的第二配网参数;receiving a first response message from a mobile device connected to the routing device; the first response message includes an encrypted second network configuration parameter;
    响应于所述第一响应消息,通过所述会话秘钥解密所述加密的第二配网参数,获取到第二配网参数;所述第二配网参数包括所述路由设备的第二设备标识和第二接入密码;In response to the first response message, decrypt the encrypted second network configuration parameter through the session key, and obtain the second network configuration parameter; the second network configuration parameter includes the second device of the routing device identification and second access code;
    通过所述第一天线,使用所述第二配网参数连接至所述路由设备。Through the first antenna, the routing device is connected using the second distribution network parameters.
  8. 一种网络修复方法,应用于电子设备,所述电子设备与路由设备的连接断开,所述电子设备包括:处理器;存储器;天线,所述天线在第一发射功率下的发射距离为第一距离,所述第一距离大于预设的安全距离;所述天线在第二发射功率下的发射距离为第二距离,所述第二距离小于或等于预设的安全距离;所述第一发射功率大于所述第二发射功率;其特征在于,所述方法包括:A network repair method is applied to an electronic device, wherein the connection between the electronic device and the routing device is disconnected, the electronic device comprises: a processor; a memory; a distance, the first distance is greater than the preset safety distance; the transmission distance of the antenna under the second transmission power is the second distance, and the second distance is less than or equal to the preset safety distance; the first distance The transmit power is greater than the second transmit power; it is characterized in that the method includes:
    通过所述第一发射功率下的所述天线,使用所述路由设备的第一配网参数重连所 述路由设备;所述第一配网参数包括所述路由设备的第一设备标识和第一接入密码;Using the antenna under the first transmit power, the routing device is reconnected using the first network configuration parameter of the routing device; the first network configuration parameter includes the first device identifier of the routing device and the first network configuration parameter an access code;
    在重连所述路由设备失败后,通过所述第二发射功率下的所述天线,周期性地发送第一请求消息;所述第一请求消息包括会话秘钥;After the reconnection to the routing device fails, periodically send a first request message through the antenna under the second transmit power; the first request message includes a session key;
    接收到连接至所述路由设备的移动设备的第一响应消息;所述第一响应消息包括加密的第二配网参数;receiving a first response message from a mobile device connected to the routing device; the first response message includes an encrypted second network configuration parameter;
    响应于所述第一响应消息,通过所述会话秘钥解密所述加密的第二配网参数,获取到第二配网参数;所述第二配网参数包括所述路由设备的第二设备标识和第二接入密码;In response to the first response message, decrypt the encrypted second network configuration parameter through the session key, and obtain the second network configuration parameter; the second network configuration parameter includes the second device of the routing device identification and second access code;
    通过所述第一发射功率下的所述天线,使用所述第二配网参数连接至所述路由设备。Connect to the routing device using the second distribution network parameters through the antenna at the first transmit power.
  9. 根据权利要求7或8所述的方法,其特征在于,所述重连所述路由设备失败包括:The method according to claim 7 or 8, wherein the failure to reconnect the routing device comprises:
    重连所述路由设备失败的次数大于或等于预设的次数;或者,The number of times of failure to reconnect to the routing device is greater than or equal to a preset number of times; or,
    重连所述路由设备的时长大于或等于预设的时长。The duration of reconnecting the routing device is greater than or equal to the preset duration.
  10. 根据权利要求7-9中任意一项所述的方法,其特征在于,在通过所述会话秘钥解密所述加密的第二配网参数之前,所述方法还包括:The method according to any one of claims 7-9, wherein before decrypting the encrypted second network configuration parameter by using the session key, the method further comprises:
    对所述第一响应消息中的签名信息进行验证;所述签名信息用于指示所述移动设备的身份合法性。Verifying the signature information in the first response message; the signature information is used to indicate the identity validity of the mobile device.
  11. 根据权利要求10所述的方法,其特征在于,所述方法还包括:The method of claim 10, wherein the method further comprises:
    如果对所述第一响应消息中的签名信息进行验证失败,周期性地发送第一请求消息。If the verification of the signature information in the first response message fails, the first request message is periodically sent.
  12. 根据权利要求7-11中任意一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 7-11, wherein the method further comprises:
    如果未获取到所述第二配网参数,使用所述路由设备的第一配网参数重连所述路由设备。If the second network configuration parameter is not obtained, the routing device is reconnected using the first configuration network parameter of the routing device.
  13. 一种网络修复系统,所述系统包括移动设备、电子设备和路由设备;其特征在于,A network repair system, the system includes a mobile device, an electronic device and a routing device; it is characterized in that:
    所述移动设备使用第二配网参数连接至所述路由设备,所述移动设备与电子设备断开通过所述路由设备建立的连接,所述移动设备包括:The mobile device is connected to the routing device using the second network configuration parameter, the mobile device and the electronic device are disconnected from the connection established through the routing device, and the mobile device includes:
    第一处理器;the first processor;
    第一存储器;the first memory;
    以及第一计算机程序,其中所述第一计算机程序存储在所述第一存储器上,当所述第一计算机程序被所述第一处理器执行时,使得所述移动设备执行以下步骤:and a first computer program, wherein the first computer program is stored on the first memory and, when executed by the first processor, causes the mobile device to perform the following steps:
    在距离电子设备的第二距离内,接收到所述电子设备的第一请求消息;所述第一请求消息包括会话秘钥;所述第二距离小于或等于预设的安全距离;Within a second distance from the electronic device, a first request message of the electronic device is received; the first request message includes a session key; the second distance is less than or equal to a preset security distance;
    响应于所述第一请求消息,向所述电子设备发送第一响应消息;所述第一响应消息包括经过所述会话秘钥加密的第二配网参数,所述第二配网参数包括所述路由设备的第二设备标识和第二接入密码;In response to the first request message, a first response message is sent to the electronic device; the first response message includes a second network configuration parameter encrypted by the session key, and the second network configuration parameter includes all network configuration parameters. the second device identification and the second access password of the routing device;
    所述电子设备包括:The electronic device includes:
    第二处理器;the second processor;
    第二存储器;the second memory;
    第一天线,所述第一天线的发射距离为第一距离,所述第一距离大于预设的安全距离;a first antenna, the transmission distance of the first antenna is a first distance, and the first distance is greater than a preset safety distance;
    第二天线,所述第二天线的发射距离为第二距离,所述第二距离小于或等于预设的安全距离;其中,所述第一天线和所述第二天线为不同的天线;a second antenna, the transmission distance of the second antenna is a second distance, and the second distance is less than or equal to a preset safety distance; wherein, the first antenna and the second antenna are different antennas;
    以及第二计算机程序,其中所述第二计算机程序存储在所述第二存储器上,当所述第二计算机程序被所述第二处理器执行时,使得所述电子设备执行:and a second computer program, wherein the second computer program is stored on the second memory and, when executed by the second processor, causes the electronic device to execute:
    通过所述第一天线,使用所述路由设备的第一配网参数重连所述路由设备;所述第一配网参数包括所述路由设备的第一设备标识和第一接入密码;Reconnecting the routing device by using the first network configuration parameter of the routing device through the first antenna; the first network configuration parameter includes the first device identifier and the first access password of the routing device;
    在重连所述路由设备失败后,通过所述第二天线,周期性地发送第一请求消息;After the reconnection to the routing device fails, periodically send a first request message through the second antenna;
    接收到连接至所述路由设备的移动设备的第一响应消息;receiving a first response message from a mobile device connected to the routing device;
    响应于所述第一响应消息,通过所述会话秘钥解密所述加密的第二配网参数,获取到第二配网参数;In response to the first response message, decrypt the encrypted second network configuration parameter by using the session key, and obtain the second configuration network parameter;
    通过所述第一天线,使用所述第二配网参数连接至所述路由设备。Through the first antenna, the routing device is connected using the second distribution network parameters.
  14. 一种网络修复系统,所述系统包括移动设备、电子设备和路由设备;其特征在于,A network repair system, the system includes a mobile device, an electronic device and a routing device; it is characterized in that:
    所述移动设备使用第二配网参数连接至所述路由设备,所述移动设备与电子设备断开通过所述路由设备建立的连接,所述移动设备包括:The mobile device is connected to the routing device using the second network configuration parameter, the mobile device and the electronic device are disconnected from the connection established through the routing device, and the mobile device includes:
    第一处理器;the first processor;
    第一存储器;the first memory;
    以及第一计算机程序,其中所述第一计算机程序存储在所述第一存储器上,当所述第一计算机程序被所述第一处理器执行时,使得所述移动设备执行以下步骤:and a first computer program, wherein the first computer program is stored on the first memory and, when executed by the first processor, causes the mobile device to perform the following steps:
    在距离电子设备的第二距离内,接收到所述电子设备的第一请求消息;所述第一请求消息包括会话秘钥;所述第二距离小于或等于预设的安全距离;Within a second distance from the electronic device, a first request message of the electronic device is received; the first request message includes a session key; the second distance is less than or equal to a preset security distance;
    响应于所述第一请求消息,向所述电子设备发送第一响应消息;所述第一响应消息包括经过所述会话秘钥加密的第二配网参数,所述第二配网参数包括所述路由设备的第二设备标识和第二接入密码;In response to the first request message, a first response message is sent to the electronic device; the first response message includes a second network configuration parameter encrypted by the session key, and the second network configuration parameter includes all network configuration parameters. the second device identification and the second access password of the routing device;
    所述电子设备包括:The electronic device includes:
    第二处理器;the second processor;
    第二存储器;the second memory;
    天线,所述天线在第一发射功率下的发射距离为第一距离,所述第一距离大于预设的安全距离;所述天线在第二发射功率下的发射距离为第二距离,所述第二距离小于或等于预设的安全距离;所述第一发射功率大于所述第二发射功率;Antenna, the transmission distance of the antenna under the first transmission power is the first distance, and the first distance is greater than the preset safety distance; the transmission distance of the antenna under the second transmission power is the second distance, the The second distance is less than or equal to a preset safety distance; the first transmit power is greater than the second transmit power;
    以及第二计算机程序,其中所述第二计算机程序存储在所述第二存储器上,当所述第二计算机程序被所述第二处理器执行时,使得所述电子设备执行:and a second computer program, wherein the second computer program is stored on the second memory and, when executed by the second processor, causes the electronic device to execute:
    通过所述第一发射功率下的所述天线,使用所述路由设备的第一配网参数重连所述路由设备;所述第一配网参数包括所述路由设备的第一设备标识和第一接入密码;Using the antenna under the first transmit power, the routing device is reconnected using the first network configuration parameter of the routing device; the first network configuration parameter includes the first device identifier of the routing device and the first network configuration parameter an access code;
    在重连所述路由设备失败后,通过所述第二发射功率下的所述天线,周期性地发送第一请求消息;After the reconnection to the routing device fails, periodically send a first request message through the antenna under the second transmit power;
    接收到连接至所述路由设备的移动设备的第一响应消息;receiving a first response message from a mobile device connected to the routing device;
    响应于所述第一响应消息,通过所述会话秘钥解密所述加密的第二配网参数,获取到第二配网参数;In response to the first response message, decrypt the encrypted second network configuration parameter by using the session key, and obtain the second configuration network parameter;
    通过所述第一发射功率下的所述天线,使用所述第二配网参数连接至所述路由设备。Connect to the routing device using the second distribution network parameters through the antenna at the first transmit power.
  15. 一种网络修复方法,应用于网络修复系统,所述系统包括移动设备、电子设备和路由设备;所述移动设备使用第二配网参数连接至所述路由设备,所述移动设备与电子设备断开通过所述路由设备建立的连接;所述电子设备包括:第一天线,所述第一天线的发射距离为第一距离,所述第一距离大于预设的安全距离;第二天线,所述第二天线的发射距离为第二距离,所述第二距离小于或等于预设的安全距离;其中,所述第一天线和所述第二天线为不同的天线;其特征在于,所述方法包括:A network repair method is applied to a network repair system, the system includes a mobile device, an electronic device and a routing device; the mobile device is connected to the routing device using a second distribution network parameter, and the mobile device is disconnected from the electronic device. open the connection established by the routing device; the electronic device includes: a first antenna, the transmission distance of the first antenna is a first distance, and the first distance is greater than a preset safety distance; a second antenna, the The transmission distance of the second antenna is a second distance, and the second distance is less than or equal to a preset safety distance; wherein, the first antenna and the second antenna are different antennas; it is characterized in that the Methods include:
    所述电子设备通过所述第一天线,使用所述路由设备的第一配网参数重连所述路由设备;所述第一配网参数包括所述路由设备的第一设备标识和第一接入密码;The electronic device reconnects the routing device through the first antenna using the first distribution network parameter of the routing device; the first distribution network parameter includes the first device identifier of the routing device and the first connection parameter. enter password;
    在重连所述路由设备失败后,所述电子设备通过所述第二天线,周期性地发送第一请求消息;所述第一请求消息包括会话秘钥;After the reconnection to the routing device fails, the electronic device periodically sends a first request message through the second antenna; the first request message includes a session key;
    在距离电子设备的第二距离内,所述移动设备接收到所述电子设备的第一请求消息;Within a second distance from the electronic device, the mobile device receives the first request message of the electronic device;
    响应于所述第一请求消息,所述移动设备向所述电子设备发送第一响应消息;所述第一响应消息包括经过所述会话秘钥加密的第二配网参数,所述第二配网参数包括所述路由设备的第二设备标识和第二接入密码;In response to the first request message, the mobile device sends a first response message to the electronic device; the first response message includes a second network configuration parameter encrypted by the session key, and the second configuration The network parameters include the second device identifier and the second access password of the routing device;
    所述电子设备接收到连接至所述路由设备的移动设备的第一响应消息;the electronic device receives a first response message from a mobile device connected to the routing device;
    响应于所述第一响应消息,所述电子设备通过所述会话秘钥解密所述加密的第二配网参数,获取到第二配网参数;In response to the first response message, the electronic device decrypts the encrypted second network configuration parameter through the session key, and obtains the second network configuration parameter;
    所述电子设备通过所述第一天线,使用所述第二配网参数连接至所述路由设备。The electronic device is connected to the routing device through the first antenna and using the second distribution network parameters.
  16. 一种网络修复方法,应用于网络修复系统,所述系统包括移动设备、电子设备和路由设备;所述移动设备使用第二配网参数连接至所述路由设备,所述移动设备与电子设备断开通过所述路由设备建立的连接;所述电子设备包括:天线,所述天线在第一发射功率下的发射距离为第一距离,所述第一距离大于预设的安全距离;所述天线在第二发射功率下的发射距离为第二距离,所述第二距离小于或等于预设的安全距离;所述第一发射功率大于所述第二发射功率;其特征在于,所述方法包括:A network repair method is applied to a network repair system, the system includes a mobile device, an electronic device and a routing device; the mobile device is connected to the routing device using a second distribution network parameter, and the mobile device is disconnected from the electronic device. Open the connection established by the routing device; the electronic device includes: an antenna, the transmission distance of the antenna under the first transmission power is a first distance, and the first distance is greater than a preset safety distance; the antenna The transmission distance under the second transmission power is a second distance, and the second distance is less than or equal to a preset safety distance; the first transmission power is greater than the second transmission power; characterized in that, the method includes :
    所述电子设备通过所述第一发射功率下的所述天线,使用所述路由设备的第一配网参数重连所述路由设备;所述第一配网参数包括所述路由设备的第一设备标识和第一接入密码;The electronic device reconnects the routing device using the first distribution network parameter of the routing device through the antenna under the first transmit power; the first distribution network parameter includes the first distribution network parameter of the routing device. Device identification and first access password;
    在重连所述路由设备失败后,所述电子设备通过所述第二发射功率下的所述天线,周期性地发送第一请求消息;所述第一请求消息包括会话秘钥;After the reconnection to the routing device fails, the electronic device periodically sends a first request message through the antenna under the second transmit power; the first request message includes a session key;
    在距离电子设备的第二距离内,所述移动设备接收到所述电子设备的第一请求消息;Within a second distance from the electronic device, the mobile device receives the first request message of the electronic device;
    响应于所述第一请求消息,所述移动设备向所述电子设备发送第一响应消息;所述第一响应消息包括经过所述会话秘钥加密的第二配网参数,所述第二配网参数包括 所述路由设备的第二设备标识和第二接入密码;In response to the first request message, the mobile device sends a first response message to the electronic device; the first response message includes a second network configuration parameter encrypted by the session key, and the second configuration The network parameters include the second device identifier and the second access password of the routing device;
    所述电子设备接收到连接至所述路由设备的移动设备的第一响应消息;the electronic device receives a first response message from a mobile device connected to the routing device;
    响应于所述第一响应消息,所述电子设备通过所述会话秘钥解密所述加密的第二配网参数,获取到第二配网参数;In response to the first response message, the electronic device decrypts the encrypted second network configuration parameter through the session key, and obtains the second network configuration parameter;
    所述电子设备通过所述第一发射功率下的所述天线,使用所述第二配网参数连接至所述路由设备。The electronic device is connected to the routing device using the second distribution network parameters through the antenna at the first transmit power.
  17. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质包括计算机程序,当所述计算机程序在电子设备上运行时,使得所述电子设备执行如权利要求7-12中任意一项所述的方法。A computer-readable storage medium, characterized in that the computer-readable storage medium comprises a computer program, which, when the computer program runs on an electronic device, causes the electronic device to execute any one of claims 7-12 method described in item.
  18. 一种计算机程序产品,其特征在于,当所述计算机程序产品在电子设备上运行时,使得所述电子设备执行如权利要求7-12中任意一项所述的方法。A computer program product, characterized in that, when the computer program product runs on an electronic device, the electronic device is caused to execute the method according to any one of claims 7-12.
PCT/CN2021/118805 2020-09-29 2021-09-16 Network repairing method, electronic device, and mobile terminal WO2022068601A1 (en)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN202011052568.X 2020-09-29
CN202011052568 2020-09-29
CN202011539963.0 2020-12-23
CN202011539963.0A CN114338356B (en) 2020-09-29 2020-12-23 Network repairing method, electronic equipment and mobile equipment

Publications (1)

Publication Number Publication Date
WO2022068601A1 true WO2022068601A1 (en) 2022-04-07

Family

ID=80949704

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/118805 WO2022068601A1 (en) 2020-09-29 2021-09-16 Network repairing method, electronic device, and mobile terminal

Country Status (1)

Country Link
WO (1) WO2022068601A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115002771A (en) * 2022-05-24 2022-09-02 杭州萤石软件有限公司 Method, device and system for connecting intelligent household terminal and wireless network equipment
WO2023231883A1 (en) * 2022-05-31 2023-12-07 华为技术有限公司 Method for repairing wlan information, main configurator, and internet of things device and system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018157512A1 (en) * 2017-03-03 2018-09-07 华为技术有限公司 Method for connecting to network, mobile terminal, electronic device, and graphical user interface
US20180316658A1 (en) * 2017-04-27 2018-11-01 Afero, Inc. Securely providing a password using an using an internet of things (iot) system
CN110099427A (en) * 2018-01-31 2019-08-06 阿里巴巴集团控股有限公司 A kind of method and system to distribution net equipment access network hotspot equipment
CN110891299A (en) * 2019-11-15 2020-03-17 北京小米移动软件有限公司 Network distribution method and device, electronic equipment and storage medium
CN111629423A (en) * 2020-06-03 2020-09-04 美的集团武汉制冷设备有限公司 Network distribution method and terminal of household appliance, storage medium and household appliance
CN113163379A (en) * 2020-02-21 2021-07-23 华为技术有限公司 Method for discovering and distributing network and electronic equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018157512A1 (en) * 2017-03-03 2018-09-07 华为技术有限公司 Method for connecting to network, mobile terminal, electronic device, and graphical user interface
US20180316658A1 (en) * 2017-04-27 2018-11-01 Afero, Inc. Securely providing a password using an using an internet of things (iot) system
CN110099427A (en) * 2018-01-31 2019-08-06 阿里巴巴集团控股有限公司 A kind of method and system to distribution net equipment access network hotspot equipment
CN110891299A (en) * 2019-11-15 2020-03-17 北京小米移动软件有限公司 Network distribution method and device, electronic equipment and storage medium
CN113163379A (en) * 2020-02-21 2021-07-23 华为技术有限公司 Method for discovering and distributing network and electronic equipment
CN111629423A (en) * 2020-06-03 2020-09-04 美的集团武汉制冷设备有限公司 Network distribution method and terminal of household appliance, storage medium and household appliance

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115002771A (en) * 2022-05-24 2022-09-02 杭州萤石软件有限公司 Method, device and system for connecting intelligent household terminal and wireless network equipment
CN115002771B (en) * 2022-05-24 2023-11-21 杭州萤石软件有限公司 Connection method, device and system between intelligent home terminal and wireless network equipment
WO2023231883A1 (en) * 2022-05-31 2023-12-07 华为技术有限公司 Method for repairing wlan information, main configurator, and internet of things device and system

Similar Documents

Publication Publication Date Title
CN113163379B (en) Method for discovering and distributing network and electronic equipment
EP3989484A1 (en) Device distribution network registration method, device, and system
EP3468068B1 (en) Method for establishing classic bluetooth connection between dual-mode bluetooth devices, and dual-mode bluetooth device
US9843360B2 (en) Method and system for use in configuring multiple near field antenna systems
KR102657527B1 (en) Method for setting of a device based on information associated with account and electronic device thereof
WO2022068601A1 (en) Network repairing method, electronic device, and mobile terminal
WO2016058367A1 (en) Smart home control system
KR102632299B1 (en) Electronic device for transmitting response message in bluetooth network environment and method thereof
CN103221962A (en) Peripheral authentication
US20080248835A1 (en) Accessory communication method and system for mobile services
US20150065053A1 (en) Method of controlling short-range wireless communication and apparatus supporting the same
JP2017518652A (en) Wireless communication system
EP3531669B1 (en) Electronic device and method for connecting short range communication
WO2022057558A1 (en) Method and device for batch configuring home appliances
KR102442063B1 (en) Method and electronic device for controlling data communication
KR20200052673A (en) Apparatus and mehtod for communication between devices in close proximity in a wireless network
CN114338356B (en) Network repairing method, electronic equipment and mobile equipment
WO2022042170A1 (en) Iot device and authorization method therefor
WO2022028333A1 (en) Automatic control method, and electronic device and computer-readable storage medium
WO2023179137A1 (en) Device communication method and related product
WO2022161143A1 (en) Method for sharing contacts, mobile device, electronic device, and communication system
CN114268896B (en) Configuration method of combined sound box, sound box and electronic equipment
KR20230039136A (en) An electronic apparatus, a control device and a method of operating the electronic apparatus and the control device
CN117413492A (en) Household appliance, method for controlling a household appliance, and method for controlling a mobile device in communication with a household appliance
CN116743413A (en) Internet of things equipment authentication method and electronic equipment

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21874262

Country of ref document: EP

Kind code of ref document: A1