WO2022042170A1 - 一种IoT设备及其授权方法 - Google Patents

一种IoT设备及其授权方法 Download PDF

Info

Publication number
WO2022042170A1
WO2022042170A1 PCT/CN2021/108486 CN2021108486W WO2022042170A1 WO 2022042170 A1 WO2022042170 A1 WO 2022042170A1 CN 2021108486 W CN2021108486 W CN 2021108486W WO 2022042170 A1 WO2022042170 A1 WO 2022042170A1
Authority
WO
WIPO (PCT)
Prior art keywords
electronic device
message
iot
iot device
antenna
Prior art date
Application number
PCT/CN2021/108486
Other languages
English (en)
French (fr)
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
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to US18/043,463 priority Critical patent/US20230336994A1/en
Priority to EP21860010.4A priority patent/EP4199473A4/en
Publication of WO2022042170A1 publication Critical patent/WO2022042170A1/zh

Links

Images

Classifications

    • 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
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/08Access security
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0876Network architectures or network communication protocols for network security for authentication of entities based on the identity of the terminal or configuration, e.g. MAC address, hardware or software configuration or device fingerprint
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/18Network architectures or network communication protocols for network security using different networks or channels, e.g. using out of band channels
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/14Multichannel or multilink protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/009Security arrangements; Authentication; Protecting privacy or anonymity specially adapted for networks, e.g. wireless sensor networks, ad-hoc networks, RFID networks or cloud networks
    • 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/041Key generation or derivation
    • 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/40Security arrangements using identity modules
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/60Context-dependent security
    • H04W12/69Identity-dependent
    • H04W12/71Hardware identity

Definitions

  • the present application relates to the field of Internet of things (IoT), and in particular, to an IoT device and an authorization method thereof.
  • IoT Internet of things
  • Each IoT device in a network with multiple IoT devices may correspond to a bound account, and the electronic device that logs in to the bound account can control the IoT device. If an electronic device logged in to another account wants to control the IoT device, it needs to first obtain authorization from the electronic device logged in to the bound account. In the above authorization, how to further provide convenience while ensuring security has become our demand.
  • the present application provides an IoT device and an authorization method thereof, which can further provide convenience and simplify user operations while ensuring security.
  • an IoT device wirelessly communicates with a first electronic device and a second electronic device, the first electronic device is a control device of the IoT device, and the second electronic device is different from the first electronic device;
  • the IoT device includes: one or more processors; one or more A plurality of memories; a first antenna; a second antenna, the transmission distance of the second antenna is less than or equal to a preset safe transmission distance; wherein, the first antenna and the second antenna are different antennas, and the second antenna transmits wireless signals.
  • the transmission distance is smaller than the transmission distance of the first antenna to transmit the wireless signal; or, the first antenna and the second antenna are the same antenna, and the transmission power of the second antenna configuration is smaller than the transmission power of the first antenna configuration; and one or more computer programs , wherein one or more computer programs are stored on one or more memories, and when the computer programs are executed by one or more processors, cause the IoT device to perform the following steps: receiving a first message from the first electronic device; wherein, The first message is used to instruct adding a shared control device to the IoT device; in response to the first message, the IoT device switches to the second antenna, and sends the second message through the second antenna; wherein the second message includes the device of the IoT device information; receiving a third message sent by the second electronic device; wherein the third message includes device information of the second electronic device; in response to the third message, switching to the first antenna, and sending the message to the first electronic device through the first antenna Sending a fourth message; wherein the fourth message includes device information of the second electronic device
  • the device information of the IoT device includes a transmission parameter including at least one of a connection protocol and a session identifier. In this way, the device information of the IoT device is further refined.
  • the IoT device further performs the following steps: after sending the fourth message to the first electronic device through the first antenna, receiving a successful addition message, where the successful addition message is used to indicate that the second electronic device has been added as an IoT device shared control device.
  • the IoT device can perform further display or processing based on the successful addition message. For example, the text of the successfully added message is displayed, and/or the voice of the successfully added message is played for prompting.
  • the first message further includes the temporary control duration or the number of times of temporary control of the IoT device by the second electronic device; After four messages, a message is received; wherein, the message includes at least one of the key corresponding to the second electronic device and the identity certificate of the second electronic device; the key corresponding to the second electronic device and the second electronic device The identity certificate of the second electronic device is used for the control of the IoT device by the second electronic device; after the temporary control duration or the number of times of temporary control is reached, the IoT device deletes at least one of the key corresponding to the second electronic device and the identity certificate of the second electronic device item. In this way, temporary control authority and judgment process are provided, and the scheme is refined.
  • the IoT device further performs the following steps: after sending the fourth message to the first electronic device through the first antenna, a message is received; the message includes a random The generated control key; in response to the message containing the randomly generated control key, the control key is obtained; the key corresponding to the second electronic device includes the control key. In this way, a specific way to control the key is provided to facilitate subsequent use.
  • the IoT device further performs the following steps: receiving a message containing the first random number; and randomly generating a second random number in response to the message containing the first random number random number; generating a communication key based on the first random number, the second random number and the control key, and sending a message containing the second random number to the second electronic device; receiving a control message from the second electronic device; in response to For the control message, decrypt the control message based on the communication key, obtain the control instruction, and execute the control instruction; the key corresponding to the second electronic device includes the communication key.
  • the communication method is more secure, requires only simple input from the user, and is more convenient.
  • the IoT device further performs the following steps: after receiving the successful addition message, the IoT device obtains the key corresponding to the second electronic device and the key of the second electronic device. At least one of the identity credentials; the key corresponding to the second electronic device and the identity credential of the second electronic device, which are used for the second electronic device to control the IoT device. In this way, a specific method is provided for subsequent identity authentication.
  • the IoT device further performs the following steps: receiving a cancellation message from the first electronic device; wherein the cancellation message is used to indicate cancellation of the cancellation of the second electronic device Authorization; in response to the cancellation message, the IoT device deletes at least one of the key corresponding to the second electronic device and the identity credential of the second electronic device.
  • a means for canceling the authorization is provided, so that the first electronic device can cancel the authorization of the second electronic device, so as to facilitate the authorization control of the second electronic device by the first electronic device.
  • the second message further includes a session key, and the session key is randomly generated by the IoT device;
  • the third message is a response of the second electronic device to the second message message;
  • the key corresponding to the second electronic device includes at least one of a session key, a control key and a communication key;
  • receiving the first message of the first electronic device includes: receiving via one or more servers The first message of the first electronic device; sending the fourth message to the first electronic device through the first antenna includes: sending the fourth message to the first electronic device through the first antenna through one or more servers. In this way, the communication method between the first electronic device and the IoT device is refined.
  • an IoT device wirelessly communicates with a first electronic device and a second electronic device, the first electronic device is a control device of the IoT device, and the second electronic device is different from the first electronic device;
  • the IoT device includes: one or more processing one or more memories; a first antenna; a second antenna, the transmission distance of the second antenna is less than or equal to a preset safe transmission distance; wherein, the first antenna and the second antenna are different antennas, and the second antenna
  • the transmission distance for transmitting wireless signals is smaller than the transmission distance for transmitting wireless signals from the first antenna; or, the first antenna and the second antenna are the same antenna, and the transmission power of the second antenna configuration is smaller than the transmission power of the first antenna configuration; and one or a plurality of computer programs, one or more of which are stored on one or more memories, which when executed by one or more processors cause the IoT device to perform the steps of: receiving a first message; wherein the first message is used to instruct the IoT device
  • the IoT device further performs the following steps: the first message further includes the temporary control duration or the number of times of temporary control of the IoT device by the second electronic device; after the temporary control duration or the number of temporary controls is reached, the IoT device sends the second electronic device to the second electronic device. At least one of the device and the first electronic device sends a message adding an invalidation. In this way, the temporary control authority and judgment process for the localization of IoT devices are provided, and the scheme is refined.
  • receiving the first message of the first electronic device includes: receiving the first message of the first electronic device via one or more servers; the IoT device Sending a message of adding an invalidation to the first electronic device includes: the IoT device sending a message of adding an invalidation to the first electronic device via one or more servers. In this way, the communication method between the first electronic device and the IoT device is refined.
  • a third aspect provides an IoT device authorization method.
  • the method is applied to an IoT device, the IoT device communicates wirelessly with a first electronic device and a second electronic device, the first electronic device is a control device of the IoT device, and the second electronic device is different from the first electronic device; the IoT device includes a first electronic device.
  • Antenna and a second antenna the transmission distance of the second antenna is less than or equal to the preset safe transmission distance; wherein, the first antenna and the second antenna are different antennas, and the transmission distance of the wireless signal transmitted by the second antenna is smaller than that of the first antenna.
  • the device information of the IoT device includes a transmission parameter including at least one of a connection protocol and a session identifier.
  • the method further includes: after sending the fourth message to the first electronic device through the first antenna, the IoT device receives a successful addition message, the successful addition message being used to indicate that the second electronic device has been added Shared control device for IoT devices.
  • the first message further includes the temporary control duration or the number of times of temporary control of the IoT device by the second electronic device; After four messages, the IoT device receives a message; wherein the message includes at least one of the key corresponding to the second electronic device and the identity credential of the second electronic device; the key corresponding to the second electronic device and the second The identity certificate of the electronic device, which is used for the second electronic device to control the IoT device; after the temporary control period or the number of times of temporary control is reached, the IoT device deletes the key corresponding to the second electronic device and the identity certificate of the second electronic device at least one of.
  • the method further includes: after the fourth message is sent to the first electronic device through the first antenna, the IoT device receives a message; the message includes A randomly generated control key; in response to the message containing the randomly generated control key, the IoT device obtains the control key; the key corresponding to the second electronic device includes the control key.
  • the method further includes: the IoT device receives a message including the first random number; in response to the message including the first random number, the IoT device randomly Generate a second random number; based on the first random number, the second random number and the control key, the IoT device generates a communication key, and sends a message containing the second random number to the second electronic device; the IoT device receives the first random number.
  • the control message of the second electronic device in response to the control message, the control message is decrypted based on the communication key, the IoT device obtains the control instruction, and executes the control instruction; the key corresponding to the second electronic device includes the communication key.
  • the method further includes: after receiving the successful addition message, the IoT device obtains the key corresponding to the second electronic device and the identity of the second electronic device At least one of the credentials; the key corresponding to the second electronic device and the identity credential of the second electronic device, which are used for the second electronic device to control the IoT device.
  • the method further includes: the IoT device receives a cancellation message from the first electronic device; wherein the cancellation message is used to indicate cancellation of authorization to the second electronic device ; In response to the cancellation message, the IoT device deletes at least one of the key corresponding to the second electronic device and the identity credential of the second electronic device.
  • the second message further includes a session key, and the session key is randomly generated by the IoT device; the third message is that the second electronic device responds to the second message
  • the key corresponding to the second electronic device includes at least one of a session key, a control key and a communication key; the IoT device receives the first message of the first electronic device, including: via one or more The server, the IoT device receives the first message of the first electronic device; the IoT device sends a fourth message to the first electronic device through the first antenna, including: the IoT device sends the first message to the first electronic device through the first antenna and through one or more servers The electronic device sends a fourth message.
  • 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.
  • an IoT device authorization method is provided. The method is applied to an IoT device, the IoT device communicates wirelessly with a first electronic device and a second electronic device, the first electronic device is a control device of the IoT device, and the second electronic device is different from the first electronic device; the IoT device includes a first electronic device. Antenna and a second antenna, the transmission distance of the second antenna is less than or equal to the preset safe transmission distance; wherein, the first antenna and the second antenna are different antennas, and the transmission distance of the wireless signal transmitted by the second antenna is smaller than that of the first antenna.
  • the method further includes: the first message further includes a temporary control duration or a temporary control number of the IoT device by the second electronic device; after the temporary control duration or the temporary control number is reached, the IoT device sends a message to the second electronic device. and at least one of the first electronic devices, sending a message of adding an invalidation.
  • the IoT device receiving the first message of the first electronic device includes: the IoT device receives the first message of the first electronic device via one or more servers message; the IoT device sends a message for adding an invalidation to the first electronic device, including: the IoT device sends a message for adding an invalidation to the first electronic device via one or more servers.
  • 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 server.
  • the server wirelessly communicates with a first electronic device, one or more second electronic devices and one or more IoT devices, the first electronic device is a control device of the IoT device, and the second electronic device is different from the first electronic device;
  • the server includes: one or more processors; one or more memories; and one or more computer programs, wherein the one or more computer programs are stored on the one or more memories, and when the computer programs are processed by one or more
  • the server is caused to perform the following steps: receiving a first message of the first electronic device; wherein the first message is used to instruct adding a shared control device to the IoT device; in response to the first message, the server sends the IoT device a first message; receiving a fourth message of the IoT device; wherein the fourth message includes device information of the second electronic device; in response to the fourth message, the server sends a fourth message to the first electronic device; receiving the first message a fifth message of the electronic device; wherein the fifth message includes device information of
  • the process is improved from the server side, which simplifies user operations and is more convenient for users; moreover, the embodiment of the present application utilizes the safe distance of ultra-short-range wireless communication of IoT devices to physically ensure that IoT devices and the second electronic device Security of device communication.
  • the server sends a successful addition message to at least one of the IoT device and the second electronic device; wherein the successful addition message is used to indicate that the second electronic device has been added as a shared control device of the IoT device.
  • the IoT device can perform further display or processing based on the successful addition message. For example, the text of the successfully added message is displayed, and/or the voice of the successfully added message is played for prompting.
  • the server further performs the following steps: receiving a cancellation message from the first electronic device; wherein, the cancellation message is used to instruct the cancellation of the second electronic device in response to the cancellation message, the server deletes the device information of the second electronic device from the device information of the shared control device of the IoT device.
  • the process of canceling authorization is specifically executed on the server, so that the first electronic device can cancel the authorization of the second electronic device, which facilitates the authorization control of the second electronic device by the first electronic device.
  • the server further performs the following steps: receiving a cancellation message from the first electronic device; wherein, the cancellation message is used to instruct the cancellation of the second electronic device authorization; in response to the cancellation message, the server sends the cancellation message to the IoT device.
  • the server is used to forward the cancellation message to the IoT device, and the IoT device executes the relevant cancellation process, so that the first electronic device can cancel the authorization of the second electronic device, which is convenient for Authorization control of the second electronic device by the first electronic device.
  • the first message further includes the temporary control duration or the temporary control times of the IoT device by the second electronic device; after the temporary control duration or the temporary control times are reached, the server The device information of the second electronic device is deleted from the device information of the shared control device of the IoT device.
  • the temporary control authority and judgment process are provided, the scheme is refined, and the specific implementation is carried out on the server; at this time, the IoT device does not need to store and delete the device information of the shared control device of the IoT device.
  • an IoT device authorization method is provided.
  • the method is applied to a server, where the server wirelessly communicates with a first electronic device, one or more second electronic devices and one or more IoT devices, where the first electronic device is a control device of the IoT device, and the second electronic devices are different the first electronic device; the method includes: the server receives a first message of the first electronic device; wherein the first message is used to instruct adding a shared control device for the IoT device; in response to the first message, the server sends the IoT device to the IoT device.
  • the device sends a first message; the server receives a fourth message of the IoT device; wherein the fourth message includes device information of the second electronic device; in response to the fourth message, the server sends a fourth message to the first electronic device ; the server receives the fifth message of the first electronic device; wherein, the fifth message includes device information of the second electronic device; in response to the fifth message, the server registers the device information of the second electronic device in the IoT device In the device information of the shared control device; wherein, the authority of the control device to the IoT device is greater than the authority of the shared control device to the IoT device.
  • the server sends a successful addition message to at least one of the IoT device and the second electronic device; wherein the successful addition message is used to indicate that the second electronic device has been added as a shared control device of the IoT device.
  • the method further includes: the server receives a cancellation message from the first electronic device; wherein the cancellation message is used to indicate that the cancellation of the second electronic device is canceled.
  • Authorization in response to the cancellation message, the server deletes the device information of the second electronic device from the device information of the shared control device of the IoT device.
  • the method further includes: the server receives a cancellation message from the first electronic device; wherein the cancellation message is used to indicate that the cancellation of the second electronic device is canceled. Authorization; in response to the cancellation message, the server sends a cancellation message to the IoT device.
  • the first message further includes the temporary control duration or the number of times of temporary control of the IoT device by the second electronic device; after the duration of the temporary control or the number of times of temporary control is reached, all The server deletes the device information of the second electronic device from the device information of the shared control device of the IoT device.
  • the sixth aspect and any one implementation manner of the sixth aspect correspond to any one implementation manner of the fifth aspect and the fifth aspect, respectively.
  • the technical effect corresponding to the sixth aspect and any implementation manner of the sixth aspect reference may be made to the technical effect corresponding to any implementation manner of the fifth aspect and the fifth aspect, which will not be repeated here.
  • a computer-readable storage medium includes a computer program that, when the computer program runs on an IoT device, causes the IoT device to perform the method of the second aspect and any one of the implementations of the second aspect.
  • the seventh aspect and any one implementation manner of the seventh aspect correspond to the second aspect and any one implementation manner of the second aspect, respectively.
  • the technical effects corresponding to the seventh aspect and any implementation manner of the seventh 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 computer-readable storage medium includes a computer program, which, when executed on a server, causes the server to perform the method according to the fourth aspect and any one of the implementations of the fourth aspect.
  • the eighth aspect and any one implementation manner of the eighth aspect correspond to any one implementation manner of the fourth aspect and the fourth aspect, respectively.
  • the technical effects corresponding to the eighth aspect and any implementation manner of the eighth aspect reference may be made to the technical effects corresponding to the fourth aspect and any implementation manner of the fourth aspect, which will not be repeated here.
  • a chip system in a ninth aspect, includes one or more processors, and when the one or more processors execute a computer program, the one or more processors cause the one or more processors to perform any one of the second aspect, the fourth aspect, and the second aspect An implementation manner or the method of any one of the implementation manners of the fourth aspect.
  • the ninth aspect and any implementation manner of the ninth aspect correspond to any implementation manner of the second aspect and the second aspect, and any implementation manner of the fourth aspect and the fourth aspect, respectively.
  • the technical effects corresponding to the ninth aspect and any one of the implementations of the ninth aspect reference may be made to any one of the implementations of the second aspect and the second aspect, and the fourth aspect and the fourth aspect. The technical effect is not repeated here.
  • a computer program product When it runs on a computer, the computer is made to execute the method as in the second aspect and any one of the implementation manners of the second aspect, or as the fourth aspect and any one of the implementation manners of the fourth aspect.
  • the tenth aspect and any one implementation manner of the tenth aspect correspond to any one implementation manner of the second aspect and the second aspect, and any one implementation manner of the fourth aspect and the fourth aspect, respectively.
  • the technical effects corresponding to the tenth aspect and any one of the implementations of the tenth aspect reference may be made to any one of the implementations of the second aspect and the second aspect, and the fourth aspect and the fourth aspect. The technical effect is not repeated here.
  • FIG. 1 is a system architecture diagram of an application scenario provided by an embodiment of the present application.
  • FIG. 2 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • FIG. 3A is a schematic structural diagram of an IoT device provided by an embodiment of the present application.
  • FIG. 3B is a schematic structural diagram of an IoT device according to an embodiment of the present application.
  • 4A is a schematic flowchart of an authorization method for an IoT device provided by an embodiment of the present application.
  • 4B is a schematic flowchart of some steps in a method for authorizing an IoT device according to an embodiment of the present application
  • 4C is a schematic flowchart of a method for controlling an IoT device provided by an embodiment of the present application.
  • 5A is a schematic flowchart of some steps in a method for authorizing an IoT device provided by an embodiment of the present application
  • 5B is a schematic flowchart of some steps in a method for authorizing an IoT device according to an embodiment of the present application
  • 6A-6D are schematic diagrams of user interfaces of some electronic devices provided by the embodiments of the present application.
  • FIG. 7 is a schematic diagram of a user interface of an electronic device provided by an embodiment of the present application.
  • FIG. 8 is a schematic diagram of a user interface of an electronic device according to an embodiment of the present application.
  • FIGS. 9A-9C are schematic diagrams of user interfaces of some electronic devices provided by the embodiments of the present application.
  • 10A is a schematic flowchart of an authorization method for an IoT device provided by an embodiment of the present application.
  • FIG. 10B is a schematic flowchart of an authorization method for an IoT device provided by an embodiment of the present application.
  • FIG. 10C is a schematic flowchart of a method for authorizing an IoT device according to an embodiment of the present application.
  • FIGS. 11A-11B are schematic diagrams of user interfaces of an electronic device provided by an embodiment of the present application.
  • FIG. 12A is a schematic flowchart of an authorization method for an IoT device provided by an embodiment of the present application.
  • FIG. 12B is a schematic flowchart of an authorization method for an IoT device provided by an embodiment of the present application.
  • FIG. 13 is a schematic diagram of a user interface of an electronic device provided by an embodiment of the present application.
  • FIG. 14 is a schematic structural diagram of a chip system according to an embodiment of the present application.
  • 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.
  • plural means two or more.
  • 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 are electronic devices that are remotely or remotely controlled and/or monitored via IoT.
  • smart home appliances are typical IoT devices. Taking a home scenario as an example, if electronic device A is bound to an IoT device, and the IoT device is connected to the home network. At this time, the electronic device A has the operation authority of the IoT device.
  • electronic device B wants to operate the IoT device, electronic device A needs to add electronic device B as a shared user, and then grant electronic device B the permission to operate the IoT device.
  • Electronic device A can share it with electronic device B through the sharing link of the IoT device management application or other applications; or, after the owner of electronic device A logs in to the IoT device management application, scan the QR code to obtain and bind the account information of electronic device B on the IoT device management application; or, after the owner of electronic device A logs in to the IoT device management application, manually enter the owner of electronic device B in the IoT device management application
  • the login account information on the application even the password information corresponding to the login account information, etc., is used to authorize the electronic device B as an authorized user.
  • the above methods may have a problem of high security risk, or a problem of poor user convenience, and do not take both security and convenience into consideration.
  • the present application provides an IoT device authorization method, IoT device and electronic device, which can further provide convenience and simplify user operations while ensuring security.
  • FIG. 1 is a system architecture diagram of an application scenario provided by an embodiment of the present application.
  • the first electronic device 100 , the second electronic device 200 and the IoT device 300 are respectively connected in communication with one or more network servers 400 .
  • the first electronic device 100 is bound with the IoT device 300, and the first electronic device 100 can control the IoT device 300 to perform corresponding operations, and can also authorize other electronic devices to control the IoT device 300 and so on.
  • the first electronic device 100 may be referred to as a control device of the IoT device 300 .
  • the first electronic device 100 may first establish a wired or wireless local connection with the IoT device 300 , and then configure the IoT device 300 to connect the IoT device 300 to the server 400 . Then the first electronic device 100 may send a control instruction to the IoT device 300 through the server 400, so that the IoT device 300 performs a corresponding operation. In other examples, the first electronic device 100 may first establish a wired or wireless local connection with the IoT device 300, and then directly control the IoT device 300 to perform corresponding operations through the local connection.
  • the wired connection between the first electronic device 100 and the IoT device 300 may be, for example, a data cable or optical fiber, and the wireless connection may be, for example, Bluetooth, WiFi, NFC, ZigBee, or the like.
  • the second electronic device 200 is a device to be authorized, that is, the second electronic device 200 cannot control the IoT device 300 to perform corresponding operations before being authorized, and can control the IoT device 300 to perform corresponding operations after being authorized.
  • the second electronic device 200 may be referred to as a shared control device of IoT devices.
  • the IoT device 300 is an IoT light.
  • the second electronic device 200 can receive the user's operation (such as touch input, voice input, etc.), and control it directly or through the server 400 IoT lights (such as turning on, off, adjusting the light intensity, color temperature and other parameters of the light).
  • the first electronic device 100 may first add the second electronic device 200 as a shared member, and then the first electronic device 100 may authorize the second electronic device 200 to operate the IoT device 300 . In other examples, the first electronic device 100 may directly add the second electronic device 200 as a shared control device of the IoT device.
  • the above IoT device 300 may be a smart home device, including a mobile terminal, a household appliance, and the like.
  • the IoT device 300 may be a smart phone, a smart speaker, a smart refrigerator, a smart air conditioner, a smart washing machine, a smart robot, a smart door, a smart window, a smart TV, a smart lamp, a smart socket, a smart air purifier, and a smart humidifier , intelligent range hood, intelligent lock, intelligent curtain, intelligent power strip, intelligent induction cooker, intelligent camera, etc.
  • the above-mentioned server 400 may be a cloud server (such as a home cloud server), etc., or may be a server cluster composed of multiple servers.
  • the server 400 stores the control information of the IoT device 300, including the account of the control device that controls the IoT device 300, the device identifier of the IoT device 300, the account of the shared control device that controls the IoT device 300, and the correspondence between the IoT device 300 and the control device, and at least one of the correspondence between the IoT device 300 and the shared control device.
  • the server 400 can determine whether the device sending the control instruction has the authority to control the IoT device 300 based on the stored control information. If the device sending the control command has the authority to control the IoT device 300 , the control command is issued to the IoT device 300 .
  • Table 1 is an example of the information list of the IoT device 300 stored on the server 400 . It can be seen from Table 1 that the device identifier of the IoT device 300 is device ID1, and the identifier of the control device of the IoT device 300 is “account A”, that is, the electronic device of account A has a binding relationship with the IoT device 300, and the electronic device of account A can Control the IoT device 300, and authorize other electronic devices to control the IoT device 300.
  • the identification of the shared control device of the IoT device 300 is "account B". That is, the electronic device of account B can control the IoT device 300 , but cannot authorize other devices to control the IoT device 300 .
  • the server 400 may also maintain the device identifiers of the bound IoT devices under each account.
  • Device identification for IoT devices Identification of control equipment Identity of shared control device
  • the server 400 may provide cloud services for the IoT device 300 .
  • the server 400 may also communicate with other servers (eg, content providing servers) to provide diversified services for the IoT device 300 .
  • the content providing server may be, for example, a weather server, a music server, an intent recognition server, a speech recognition server, etc., then the server 400 may provide services such as weather forecast, music playback, and speech recognition for the IoT device 300 through the content providing server.
  • both the first electronic device 100 and the first control device 200 may be mobile phones, tablet computers, personal computers (Personal Computers, PCs), personal digital assistants (personal digital assistants, PDAs), netbooks, wearable devices (eg
  • the specific form of the first electronic device 100 and the second electronic device 200 may be the same or different.
  • the embodiments of the present application do not limit the specific forms of the first electronic device 100 and the second electronic device 200 .
  • FIG. 2 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
  • the structure of the first electronic device 100 may refer to FIG. 2 .
  • the first electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, Battery 142, Antenna, Mobile Communication Module 150, Wireless Communication Module 160, Audio Module 170, Speaker 170A, Receiver 170B, Microphone 170C, Headphone Jack 170D, Sensor Module 180, Key 190, Motor 191, Indicator 192, Camera 193, Display screen 194, and a subscriber identification module (subscriber identification module, SIM) card interface 195 and the like.
  • SIM subscriber identification module
  • the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the first electronic device 100 .
  • the first electronic device 100 may include more or less components than shown, or some components are combined, or some components are separated, or different components are arranged.
  • the illustrated components may be implemented in hardware, software, or a combination of software and hardware.
  • the processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (neural-network processing unit, NPU), etc. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
  • the controller can generate an operation control signal according to the instruction operation code and timing signal, and complete the control of fetching and executing instructions.
  • the processor 110 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous transceiver (universal asynchronous transmitter) receiver/transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (SIM) interface, and / or universal serial bus (universal serial bus, USB) interface, etc.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transceiver
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM subscriber identity module
  • USB universal serial bus
  • the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration, and does not constitute a structural limitation of the first electronic device 100 .
  • the first electronic device 100 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
  • the wireless communication function of the first electronic device 100 may be implemented by an antenna, a mobile communication module 150, a wireless communication module 160, a modulation and demodulation processor, a baseband processor, and the like.
  • Antennas are used to transmit and receive electromagnetic wave signals.
  • Each antenna in the first electronic device 100 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
  • the antennas can be multiplexed into the diversity antennas of the wireless local area network.
  • the antenna may be used in conjunction with a tuning switch.
  • the mobile communication module 150 may provide a wireless communication solution including 2G/3G/4G/5G etc. applied on the first electronic device 100 .
  • the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA) and the like.
  • the mobile communication module 150 can receive electromagnetic waves through the antenna, filter, amplify, etc. the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation.
  • the mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and then convert it into electromagnetic waves for radiation through the antenna.
  • at least part of the functional modules of the mobile communication module 150 may be provided in the processor 110 .
  • at least part of the functional modules of the mobile communication module 150 may be provided in the same device as at least part of the modules of the processor 110 .
  • the modem processor may include a modulator and a demodulator.
  • the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing.
  • the low frequency baseband signal is processed by the baseband processor and passed to the application processor.
  • the application processor outputs sound signals through audio devices (not limited to the speaker 170A, the receiver 170B, etc.), or displays images or videos through the display screen 194 .
  • the modem processor may be a stand-alone device.
  • the modem processor may be independent of the processor 110, and may be provided in the same device as the mobile communication module 150 or other functional modules.
  • the wireless communication module 160 can provide applications on the first electronic device 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global Navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions.
  • WLAN wireless local area networks
  • BT wireless fidelity
  • GNSS global Navigation satellite system
  • frequency modulation frequency modulation
  • FM near field communication technology
  • NFC near field communication technology
  • infrared technology infrared, IR
  • the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 160 receives electromagnetic waves via the antenna, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 .
  • the wireless communication module 160 can also receive the signal to be sent from the processor 110, perform frequency modulation on it, amplify it, and convert it
  • the antenna of the first electronic device 100 is coupled with the mobile communication module 150, and the antenna is coupled with the wireless communication module 160, so that the first electronic device 100 can communicate with the network and other devices through wireless communication technology.
  • the wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband Code Division Multiple Access (WCDMA), Time Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC , FM, and/or IR technology, etc.
  • the GNSS may include global positioning system (global positioning system, GPS), global navigation satellite system (global navigation satellite system, GLONASS), Beidou navigation satellite system (beidou navigation satellite system, BDS), quasi-zenith satellite system (quasi -zenith satellite system, QZSS) and/or satellite based augmentation systems (SBAS).
  • global positioning system global positioning system, GPS
  • global navigation satellite system global navigation satellite system, GLONASS
  • Beidou navigation satellite system beidou navigation satellite system, BDS
  • quasi-zenith satellite system quadsi -zenith satellite system, QZSS
  • SBAS satellite based augmentation systems
  • the first electronic device 100 implements a display function through a GPU, a display screen 194, an application processor, and the like.
  • the GPU is a microprocessor for image processing, and connects the display screen 194 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
  • Display screen 194 is used to display images, videos, and the like.
  • Display screen 194 includes a display panel.
  • the display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (active-matrix organic light).
  • LED diode AMOLED
  • flexible light-emitting diode flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (quantum dot light emitting diodes, QLED) and so on.
  • the first electronic device 100 may include 1 or N display screens 194 , where N is a positive integer greater than 1.
  • the external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the first electronic device 100.
  • the external memory card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example to save files like music, video etc in external memory card.
  • Internal memory 121 may be used to store computer executable program code, which includes instructions.
  • the first electronic device 100 may implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
  • the first electronic device 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playback, recording, etc.
  • the second electronic device 200 may have the same structure as the first electronic device 100; the second electronic device 200 may also include more or less components than the first electronic device 100, or combine some components, or Split some parts, or different parts arrangement.
  • FIG. 3A is a schematic structural diagram of an IoT device 300 according to an embodiment of the present application.
  • IoT device 300 may include one or more processors 310, one or more memories 320, a wireless communication module 340, and one or more antennas.
  • the processor 310, the memory 320 and the wireless communication module 340 are connected through a bus.
  • the IoT device 300 may further include one or more communication interfaces 330; wherein the communication interfaces 330 are also connected with the processor 310, the memory 320 and the wireless communication module 340 through a bus.
  • the processor 310 may include a microcontroller (Microcontroller Unit, MCU), an application-specific integrated circuit (Application-Specific Integrated Circuit, ASIC), or an integrated circuit for controlling the execution of the program of the present application, and the like.
  • MCU Microcontroller Unit
  • ASIC Application-Specific Integrated Circuit
  • the processor 310 may also include one or more MCUs.
  • An MCU here may refer to one or more devices, circuits, or processing cores for processing data (eg, computer program instructions).
  • the memory 320 may be used to store computer executable program code including instructions.
  • the internal memory may include a program storage area and a data storage area.
  • the storage program area may store the operating system and the programs or instructions required by the embodiments of the present application, and the like.
  • Communication interface 330 which can be used to communicate with other devices or a communication network. For example, Ethernet, wireless local area networks (WLAN), etc.
  • the IoT device 300 may also not include the communication interface 330, which is not limited in this embodiment of the present application.
  • the wireless communication module 340 can provide a wireless communication solution including WLAN (eg Wi-Fi), Bluetooth, etc. applied on the lighting device 200 .
  • the wireless communication module 340 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 340 receives electromagnetic waves via the antenna, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 310 .
  • the wireless communication module 340 can also receive the signal to be sent from the processor 310, frequency-modulate the signal, amplify the signal, and radiate it into electromagnetic waves through the antenna.
  • IoT device 300 includes at least two antennas, eg, Antenna 1 (a first antenna, also referred to as a strong antenna) and Antenna 2 (a second antenna, also referred to as a weak antenna).
  • the wireless communication module 340 can switch between Antenna 1 and Antenna 2 .
  • the transmit power applied to Antenna 1 or Antenna 2 is the same.
  • the transmission distance of the antenna 1 is the first distance.
  • the transmission distance of the antenna 2 is the second distance.
  • the second distance is smaller than the first distance.
  • the wireless devices within the first distance eg, the first distance is 6m, 8m, 10m
  • the wireless devices within the second distance eg, the second distance is 30 cm
  • the second distance is less than or equal to a preset safety distance.
  • the preset safety distance is smaller than the first distance.
  • the first distance, the second distance, and the preset safety distance can all be adjusted by the user according to their needs.
  • the second distance may be a preset safety distance.
  • the wireless communication module 340 can be controlled to be connected to the antenna 2 to send an ultra-short-range wireless signal.
  • the wireless communication module 340 can be controlled to be connected to the antenna 1 to send normal wireless signals.
  • the IoT device 300 may include a variable resistance circuit module 350 and an antenna.
  • the variable resistance circuit module 350 can change the resistance value under the control of the wireless communication module 340, thereby changing the transmission distance of the same antenna. That is, when the resistance value of the variable resistance circuit module 350 is adjusted to the resistance value 1, the transmission power of the antenna is the first transmission power (higher transmission power), and the transmission distance of the antenna is the first distance.
  • wireless devices located within a first distance of the IoT device 300 eg, the first distance is 6m, 8m, 10m
  • the first distance is 6m, 8m, 10m
  • the transmit power of the antenna is the second transmit power (lower transmit power), and the transmit distance of the antenna is the second distance.
  • the second transmit power is smaller than the first transmit power.
  • the second distance is less than or equal to a preset safety distance.
  • the preset safety distance is smaller than the first distance.
  • the first distance, the second distance, and the preset safety distance can all be adjusted by the user according to their needs.
  • the second distance may be a preset safety distance.
  • the resistance value of the variable resistance circuit module 350 can be controlled to be adjusted to a resistance value of 2, so as to send an ultra-short-range wireless signal.
  • the resistance value of the variable resistance circuit module 350 can be controlled to be adjusted to a resistance value of 1, so as to send normal wireless signals.
  • the resistance value of the variable resistance circuit module 350 is adjusted to a resistance value of 1, the IoT device 300 is connected to the first antenna.
  • the IoT device When the resistance value of the variable resistance circuit module 350 is adjusted to a resistance value of 2, the IoT device is connected to the second antenna; wherein the first antenna and the second antenna are the same, but the transmission distance of the first antenna is greater than the transmission distance of the second antenna; The transmission distance of the second antenna is less than or equal to the preset safety distance, and the transmission distance of the first antenna is greater than the preset safety distance.
  • the transmission distance of the first antenna and the transmission distance of the second antenna are the above-mentioned first distance and second distance, respectively.
  • the wireless communication mode adopted by the above-mentioned wireless communication module 340 may specifically adopt a mode such as Bluetooth low energy (bluetooth low energy, BLE), Wi-Fi awareness (Wi-Fi awareness), and the like. That is to say, in the whole communication process, only one wireless communication method is used, such as Wi-Fi aware or BLE.
  • the wireless communication method is based on the interaction of the computer network media access control (medium access control, MAC) layer, also known as the data link layer protocol extension, and does not need to involve the upper-layer network communication of the MAC layer. Data interaction can be fully realized.
  • MAC computer network media access control
  • Wi-Fi Aware Wi-Fi Neighborhood Aware Network, Wi-Fi Neighborhood Aware Network, also known as Wi-Fi Neighborhood Aware Network, NAN for short
  • Wi-Fi Neighborhood Aware Network Wi-Fi Neighborhood Aware Network
  • NAN Wi-Fi Neighborhood Aware Network
  • This technology can bypass the network infrastructure (such as AP (Access Point, access point) or cellular network), and realize one-to-one, one-to-many or many-to-many connection communication between devices, which can also pass the MAC layer. achieve communication. Understandably, the higher the number of layers of the computer network involved, the harder it is to ensure its security.
  • the wireless-based MAC layer communication used in this embodiment can allow data to interact based on the extension of the data link layer protocol, which can significantly improve the security of the IoT device authorization process, effectively ensure that the IoT device identifier sent by the IoT device, and the connection with the IoT device.
  • Sensitive information such as protocol information and transmission keys related to IoT device communication.
  • the IoT device 300 has a very short distance wireless communication capability. That is, other devices can receive the ultra-short-range wireless signal sent by the IoT device 300 only within an ultra-short distance (eg, 30cm, 20cm, 10cm, etc.). Then, in a real usage scenario, if a device can receive the ultra-short-range wireless signal sent by the IoT device 300, it means that the device is very close to the IoT device 300, and can receive the IoT device 300. The distance of the ultra-short-range wireless signal is called the safe distance. In other words, the embodiments of the present application utilize the safety distance of ultra-short-range wireless communication to physically ensure the safety of the communication between the IoT device 300 and the second electronic device 200 .
  • an ultra-short distance eg, 30cm, 20cm, 10cm, etc.
  • FIG. 4A is a schematic flowchart of a method for authorizing an IoT device according to an embodiment of the present application.
  • the first electronic device is a control device of an IoT device, and the method includes:
  • the first electronic device receives a first input, where the first input is used to instruct adding a shared control device to the IoT device.
  • the first input may be a user input, or may be an input such as an instruction, a command, or the like.
  • the first input is a user input
  • the first input is a first user input.
  • the user performs a network distribution operation on the IoT device in advance through the first application (for example, a "smart life" application, an application of an IoT device, etc.) on the first electronic device.
  • the first electronic device is a control device bound to the IoT device, and has the authority to control the IoT device and the authority to authorize other electronic devices to control the IoT device. That is, the server registers the binding relationship between the IoT device and the first electronic device.
  • a shared control device needs to be added to the IoT device through the first electronic device.
  • the first electronic device detects the first user input, a process of adding a shared control device to the IoT device is started.
  • the embodiments of the present application may adopt a solution based on a trusted server; that is, a solution for controlling IoT devices through server authentication and authentication.
  • a solution based on an untrusted server can also be used, that is, a solution through end-to-end (that is, control device to IoT device) authentication and authentication.
  • the IoT device can directly execute the control without verifying the identity of the sender of the control command (that is, whether it is sent by a control device such as the first electronic device).
  • the server may be a cloud server or a local area network server.
  • the IoT device can verify the identity of the sender of the control command (ie, whether it is sent by a control device such as the first electronic device). After it is determined that the sending end of the control instruction is a specific control device (for example, the first electronic device), the control instruction is executed. Specifically, when adding or binding an IoT device, the first electronic device exchanges a long-term public key with the IoT device at the near end in advance, for example, based on a password-authenticated key agreement (Password-authenticated key agreement, PAKE).
  • PAKE password-authenticated key agreement
  • a long-term public key is a public key that is valid for a long time.
  • the first electronic device stores the long-term public key of the IoT device.
  • the subsequent first electronic device can use the long-term public key of the IoT device to authenticate the received message. If the identity verification is passed using the long-term public key of the IoT device, it can be determined that the message is sent by the IoT device. That is, the long-term public key of the IoT device is a kind of identity credential of the IoT device.
  • the IoT device also stores the long-lived public key of the first electronic device. Similarly, the long-term public key of the first electronic device is a kind of identity credential of the first electronic device.
  • the electronic device initiates an end-to-end (Station to Station, STS) negotiation with the IoT device to negotiate a shared key.
  • the IoT device uses the stored long-term public key (the identity credential of the first electronic device) to authenticate the electronic device. If it is authenticated as the first electronic device, the IoT device decrypts the control command sent by the electronic device using the shared key, and executes the corresponding control command. Otherwise, the IoT device does not execute the control instructions sent by the electronic device.
  • the authority of the control device to the IoT device is greater than the authority of the shared control device to the IoT device.
  • the first electronic device sends a first message of adding a shared control device to the IoT device through the server.
  • the instruction for adding a shared control device (ie, the first message) issued by the first electronic device includes device information of the first electronic device.
  • the device information of the first electronic device may include an identification of the first electronic device.
  • the identifier of the first electronic device includes, but is not limited to, the MAC address, account information, user nickname, etc. of the first electronic device.
  • the first message is sent by the first electronic device to the server; after receiving the first message, the server sends the first message to the IoT device.
  • the IoT device After receiving the first message of adding a shared control device, the IoT device switches to the second antenna.
  • the IoT device verifies the received message to verify whether the message is the first message.
  • the IoT device may be preset with or received from the server with a specific identifier of the first message; the first message is identified by the specific identifier.
  • the IoT device switches to the second antenna. That is, IoT devices switch to a mode that sends ultra-short-range wireless signals.
  • the IoT device randomly generates a session key.
  • the IoT device randomly generates a session key for subsequent encryption and decryption. Because it is randomly generated, the session key is different every time it is generated. After an IoT device randomly generates a session key, it saves it locally.
  • the number of session keys stored locally is less than or equal to a preset number. If the number of randomly generated session keys is greater than the preset number, other saved session keys are overwritten locally.
  • the IoT device sends a second message through the second antenna, where the second message includes the session key and device information of the IoT device.
  • the IoT device sends a second message through the second antenna, where the second message includes the session key and device information of the IoT device.
  • the second message may also be referred to as a request to add a shared control device, and the request includes device information and a session key of the IoT device.
  • the IoT device controls the wireless communication module 340 to connect the antenna 2 .
  • the resistance value of the IoT device control variable resistance circuit module 350 is the resistance value 2 (the larger resistance value), so that the antenna transmission power of the IoT device is the second transmission power (lower transmit power).
  • transmitting includes broadcasting.
  • the device information of the IoT device includes an identifier of the IoT device.
  • the ID of the IoT device may be the unique ID of the IoT device.
  • the device information of the IoT device also includes transmission parameters.
  • the transmission parameters include, but are not limited to, connection protocols (eg, Bluetooth protocols, Wi-Fi protocols, etc.), session identifiers, and the like.
  • the second message may further include the identifier of the first electronic device.
  • the identifier of the first electronic device may be a unique identifier of the first electronic device.
  • the identification of the IoT device includes an identity credential of the IoT device.
  • the IoT device switches to the first antenna. That is, after S405, S409 is executed. After S409 is executed, the IoT device switches back to the mode of sending normal wireless signals (not ultra-short-range wireless signals).
  • the IoT device controls the wireless communication module 340 to connect to the antenna 1 .
  • the resistance value of the IoT device control variable resistance circuit module 350 is the resistance value 1 (the smaller resistance value), so that the antenna transmission power of the IoT device is the first transmission power (higher transmit power).
  • S409 can also be performed after other steps; for example, after S408, that is, after receiving the third message returned by the second electronic device. This embodiment of the present application does not limit this.
  • the embodiments of the present application are only described by taking the IoT device having the capability of sending ultra-short-range wireless signals as an example. That is, only the IoT device has the structure of FIG. 3A or FIG. 3B , and neither the first electronic device nor the second electronic device has the structure of FIG. 3A or FIG. 3B .
  • the second antenna may also be used to send the third message, or the third message may be sent using the same antenna with a smaller transmit power.
  • the embodiments of the present application are not limited.
  • the IoT device may display a signal light (eg, blink, or display a different color, etc. ) or play a voice to prompt the second electronic device to approach the IoT device, so that the second electronic device receives the ultra-short-range wireless signal sent by the IoT device within the transmission distance of the second antenna of the IoT device.
  • the first electronic device may also use other methods (SMS notification, phone notification, instant messaging application notification, etc.) to notify the second electronic device. Proximity to IoT devices.
  • the maximum number of times the IoT device sends the second message may be set. For example, it is assumed that the maximum number of times the IoT device sends the second message is preset to M times (M is a positive integer greater than or equal to 1). Then, after the IoT device switches to the mode of sending ultra-short-range wireless signals, after sending the second message once, the IoT device switches to the mode of sending normal wireless signals, and is ready to receive the response message returned by the second electronic device. If the IoT device has not received the response message returned by the second electronic device within the preset period of time, the IoT device will add 1 to the initial value of 0, and send the second message again to prepare to receive the response message returned by the second electronic device.
  • the IoT device may return a failure response to the first electronic device through the server, that is, if no response from any electronic device is received within a safe distance of the IoT device, the IoT device switches back to the first antenna.
  • the above response messages are all response messages to the second message.
  • the above-mentioned second electronic device is only a schematic example.
  • the above-mentioned preset duration can be set by an authorized user through the IoT device or the first electronic device.
  • the IoT device receives the response message returned by the second electronic device within a preset time period after sending the second message for the Pth time (P is a positive integer greater than or equal to 1 and less than or equal to M), it will no longer Send a second message.
  • the second electronic device receives the second message.
  • the second antenna in S406 is the second antenna of the IoT device. That is, the second electronic device receives the second message while the second electronic device is located within the transmission distance of the second antenna of the IoT device.
  • the transmission distance of the second antenna of the IoT device is less than or equal to the preset safe distance.
  • the preset safety distance may be less than or equal to 30cm. The preset safety distance can be set or adjusted by the user.
  • the second electronic device displays a related prompt message; the prompt message is used to prompt the user of the second electronic device whether to agree to share control of the IoT device, so that the second electronic device becomes the Shared control device for IoT devices.
  • the second electronic device receives a second input, encrypts the device information of the second electronic device using the session key, and generates a third message.
  • the second input may be a user input, or may be an input such as an instruction, a command, or the like.
  • the second input is a user input
  • the second input is a second user input.
  • the second user input is a confirmation input for confirming that the second electronic device is a shared control device of the IoT device.
  • the second electronic device after receiving the second message sent by the IoT device, the second electronic device will use at least one of text prompts, voice prompts, pattern prompts, and animation prompts to prompt or inquire about the second message.
  • the second user input may be an input by the user of the second electronic device confirming that the second electronic device is willing to use the second electronic device as a shared control device for the IoT device. For example, the user of the second electronic device's touch input to a specific control, the user's specific voice input of the second electronic device, and so on.
  • the device information of the second electronic device is used to identify the identity of the second electronic device.
  • the device information of the second electronic device may include an identification of the second electronic device.
  • the identifier of the second electronic device includes at least one of a MAC address of the second electronic device, a cloud account logged in by the user, a mobile phone number, a user name, and the like.
  • the second electronic device obtains the device information and session key of the IoT device from the second message.
  • the second electronic device also obtains the transmission parameter from the second message.
  • the transmission parameters include, but are not limited to, at least one of a session identifier and a transmission protocol.
  • the second electronic device encrypts the identification of the second electronic device using the session key to generate the third message.
  • the identifier of the second electronic device may be a unique identifier of the second electronic device.
  • the device information of the second electronic device further includes an identity credential of the second electronic device.
  • the identifier of the IoT device includes the identity certificate of the IoT device, and the identity certificate of the IoT device is sent to the second electronic device through the second message
  • the second electronic device sends the identity certificate of the second electronic device to the IoT device.
  • the second message contains the identity credentials of the IoT device, which means that when the first electronic device controls the IoT device, it is a solution based on an untrusted server. Therefore, before the second electronic device controls the IoT device, the IoT device and the second electronic device need to interact with each other's identity credentials.
  • the second electronic device may carry its own identity credential in the third message and send it to the IoT device together, or send it to the IoT device separately.
  • the second electronic device sends a third message to the IoT device.
  • the third message includes, but is not limited to, at least one of device information of the second electronic device, a session key, and device information of the IoT device.
  • the IoT device switches to the first antenna.
  • the IoT device controls the wireless communication module 340 to connect to the antenna 1 .
  • the resistance value of the IoT device control variable resistance circuit module 350 is the resistance value 1 (the smaller resistance value), so that the antenna transmission power of the IoT device is the first transmission power (higher transmit power).
  • the emission distance of the IoT device is the first distance, and the first distance is greater than the preset safe distance.
  • the IoT device if the IoT device further receives the identity certificate of the second electronic device, the IoT device saves the identity certificate of the second electronic device. It should be noted that the IoT device also exchanges the identity certificate with the first electronic device during the network distribution process, that is, the IoT device also stores the identity certificate of the first electronic device. Then, when the IoT device receives a control command of another electronic device, the identity certificate of the first electronic device and the identity certificate of the second electronic device can be used to authenticate the electronic device that sends the control command. If the verification is the first electronic device or the second electronic device, the identity verification is passed, and the IoT device executes the control instruction. Otherwise, the authentication fails, and the IoT device does not execute the control command.
  • the IoT device sends a fourth message to the first electronic device through the server, where the fourth message includes device information of the second electronic device.
  • the fourth message may be transmitted in an encrypted manner.
  • the encryption method and the decryption method are preset on the server and the first electronic device.
  • the fourth message is sent by the IoT device to the server; after receiving the fourth message, the server sends the fourth message to the first electronic device.
  • the first electronic device After receiving the fourth message, acquires device information of the second electronic device.
  • the first electronic device can use a preset decryption method to decrypt, so as to obtain the device information of the second electronic device based on the fourth message.
  • the first electronic device may also be preset with an encryption method.
  • the above encryption method and decryption method are the same as or correspond to the encryption method and decryption method preset by the IoT device.
  • the above encryption method and decryption method can come from a cloud server.
  • the first electronic device receives a third input, where the third input is used to confirm adding the second electronic device as a shared control device of the IoT device.
  • the third input may be a user input, or may be an input such as an instruction, a command, or the like.
  • the third input is a user input
  • the third input is a third user input.
  • the first electronic device after receiving the fourth message forwarded by the server, the first electronic device generates prompt information (for example, at least one of voice prompts, text prompts, and pattern prompts), and asks the user of the first electronic device whether Agree or confirm adding the second electronic device as a shared control device for IoT devices. After the first electronic device receives the third user input, S413 is performed.
  • prompt information for example, at least one of voice prompts, text prompts, and pattern prompts
  • the third user input may be an input by the user of the first electronic device confirming that the second electronic device is used as a shared control device for the IoT device.
  • the user of the first electronic device makes a touch input to a specific control, and the user of the first electronic device makes a specific voice input, and so on.
  • the first electronic device sends a fifth message to the server, where the fifth message includes device information of the second electronic device.
  • the fifth message includes, but is not limited to, at least one of device information of the second electronic device, device information of the first electronic device, and information corresponding to the third user input.
  • the server may also determine whether the third user inputs the corresponding information to agree or disagree. If yes, execute S414; otherwise, do not execute S414, and directly send a message of failure to add a shared control device to the IoT device and the second electronic device, respectively.
  • the server registers the information of the second electronic device as the shared control device of the IoT device.
  • the server obtains the device information of the second electronic device, the device information of the IoT device, the device information of the first electronic device, and the like according to the fifth message.
  • the server may add the first electronic device and the second electronic device as shared devices by default, or the server may query the first electronic device Whether the electronic device and the second electronic device are added to each other as shared devices is not limited in this application.
  • the server sends a sixth message to the IoT device that the second electronic device is successfully added as a shared control device.
  • the server sends a sixth message to the second electronic device that the second electronic device is successfully added as a shared control device.
  • the server After the server registers the shared control relationship between the IoT device and the second electronic device, it pushes a sixth message of successful addition to the IoT device and the second electronic device, respectively.
  • S415 and S416 may execute S415 first, and then execute S416; or may execute S416 first, and then execute S415; or may execute simultaneously.
  • This embodiment of the present application does not limit the execution order of S415 and S416.
  • the IoT device After receiving the sixth message, the IoT device prompts the sixth message.
  • the IoT device after the IoT device receives the sixth message, it displays at least one of part or all of the text of the sixth message, playing the voice of the sixth message, and the like.
  • the IoT device may only display at least one of the keywords related to the sixth message, the voice for playing the above keywords, and the like.
  • the second electronic device After receiving the sixth message, the second electronic device prompts the sixth message.
  • the second electronic device after the second electronic device receives the sixth message, at least one of displaying part or all of the text of the sixth message, playing the voice of the sixth message, and the like.
  • the second electronic device may only display at least one of the keywords related to the sixth message, the voice for playing the above keywords, and the like.
  • S415 and S416, and S417 and S418 are not necessarily required in an IoT device authorization method provided in this embodiment of the present application.
  • the method may include only one of S417 and S418. Specifically, the method includes S401-S417, but S418 is not included; or, the method includes S401-S416 and S418, but S417 is not included.
  • the method may include only one of S415 and S416. Specifically, the method includes S401-S415 and S417, but does not include S416 and S418; or, the method includes S401-S414, S416 and S418, and does not include S415 and S417.
  • the method may not include S415-S418, that is, S401-S414.
  • the method may not include S417-S418, that is, S401-S416.
  • the method may not include S416-S418, that is, S401-S415.
  • the method may not include S415, S417-S418, that is, include S401-S414 and S416.
  • both the IoT device and the second electronic device communicate through Wi-Fi perception; or, in the above steps, both the IoT device and the second electronic device communicate through BLE.
  • S415-S418 in FIG. 4A can also be replaced with S415'-S419' in FIG. 4B.
  • S415 ′-S430 ′ in FIG. 4B are continued to be executed, and S415 - S418 in FIG. 4A are no longer executed. details as follows:
  • the server sends a sixth message including the control key to the IoT device.
  • S417' The server sends a sixth message including the control key to the second electronic device.
  • S416' and S417' may be executed first, and then S417' may be executed; or S417' may be executed first, and then S416' may be executed; or they may be executed simultaneously.
  • This embodiment of the present application does not limit the execution order of S416' and S417'.
  • the IoT device after receiving the sixth message, the IoT device obtains the control key.
  • S418' further includes prompting a sixth message.
  • S419' further includes prompting a sixth message.
  • the second electronic device may send a control instruction to the IoT device, so as to control the IoT device to perform a corresponding operation.
  • the second electronic device may control the IoT device based on a solution based on a trusted server, or based on a solution based on a non-trusted server.
  • the solution based on the trusted server and the solution based on the untrusted server respectively include two specific solutions of local control and remote control, and the following describes the different solutions.
  • Scheme 1 A remote control scheme based on a trusted server.
  • the second electronic device sends a control instruction for the IoT device to the server; the control instruction includes the device information of the second electronic device, the identifier of the IoT device, and the specific control operation .
  • the server After receiving the control instruction, the server authenticates the identity of the second electronic device. After passing the authentication, the server forwards the control command to the IoT device or sends a specific control operation to the IoT device, and the IoT device performs the corresponding operation.
  • scheme 1 authentication and control instructions or specific control operations are performed through the server; therefore, scheme 1 is called a remote control scheme based on a trusted server.
  • Scheme 2 a local control scheme based on a trust server.
  • the second electronic device receives a fourth input.
  • the fourth input may be an external input such as a user input; it may also be an internal input such as an instruction, a command, or the like.
  • the fourth input is a user input
  • the fourth input is a third user input.
  • the fourth user input may be a touch input of a certain control, or a voice input of a specific command, so as to cause the second electronic device to execute a corresponding control instruction.
  • the second electronic device generates a first random number.
  • the second electronic device generates a first random number, and generates a seventh message according to the first random number. In one implementation, the second electronic device encrypts the generated seventh message.
  • the second electronic device sends a seventh message including the first random number to the IoT device.
  • the IoT device receives the seventh message, and obtains the first random number.
  • the IoT device generates a second random number; and generates a communication key based on the first random number, the second random number and the control key.
  • the IoT device generates a second random number, and generates a communication key according to the first random number, the second random number, and the control key.
  • the IoT device sends an eighth message including a second random number.
  • the second electronic device obtains the eighth message and obtains the second random number.
  • the second electronic device generates a communication key based on the first random number, the second random number and the control key.
  • the communication key generated by the second electronic device is the same as the communication key generated by the IoT device in S424'.
  • the second electronic device sends the control message encrypted by the communication key to the IoT device after the control instruction.
  • the second electronic device encrypts the control instruction using the communication key to generate a control message; after that, the second electronic device sends the control message to the IoT device.
  • the IoT device receives the control message.
  • the IoT device decrypts the control message by using the communication key, obtains the control instruction, and executes the control instruction.
  • the IoT device uses the communication key generated by the IoT device in S424', decrypts the control message, obtains the control command, and executes it.
  • the eighth message in S425' may be sent through the first antenna or the second antenna of the IoT device.
  • scheme 2 the control keys of the IoT device and the second electronic device are received from the server; therefore, the server is trusted and controlled locally, so scheme 2 is called a local control scheme based on a trusted server.
  • Scheme 3 a remote control scheme based on an untrusted server.
  • the IoT device and the second electronic device have exchanged identity credentials with each other. Subsequently, when the second electronic device generates a control command of the IoT device according to the input, the second electronic device encrypts the control command by using its own identity credential, and sends the encrypted control command to the IoT device through the server.
  • the IoT device decrypts the stored identity credential of the second electronic device, and executes a corresponding control instruction if the decryption succeeds.
  • scheme 3 encryption and decryption are performed on the second electronic device and the IoT device respectively, not on the server; it is only transmitted through the server during control; therefore, scheme 3 is called a remote control scheme based on an untrusted server.
  • Scheme 4 a local control scheme based on an untrusted server.
  • the IoT device and the second electronic device have exchanged identity credentials with each other. Subsequently, when the second electronic device generates the control command of the IoT device according to the input, the second electronic device encrypts the control command by using its own identity credential, and directly sends the encrypted control command to the IoT device. The IoT device decrypts the stored identity credential of the second electronic device, and executes a corresponding control instruction if the decryption succeeds.
  • scheme 4 encryption and decryption are performed on the second electronic device and the IoT device respectively, not on the server; and the transmission does not pass through the server; therefore, scheme 4 is called a local control scheme based on an untrusted server.
  • the first electronic device may also cancel the authorization of the second electronic device. That is, the authorization method for IoT devices also includes the process of de-authorization. 5A and 5B, the flow of canceling authorization is exemplarily explained.
  • the process of canceling authorization specifically includes:
  • the first electronic device receives an input.
  • the input may be an external input such as a user input; it may also be an internal input such as an instruction, a command, or the like.
  • the user input is used to trigger the first electronic device to send a message for canceling the shared control device, where the message is used to instruct the second electronic device to no longer be set as the shared control device of the IoT device.
  • the first electronic device sends a message for canceling the sharing of the control device to the server.
  • the message for canceling the sharing of the control device includes the identifier of the IoT device, the identifier of the second electronic device, and the like.
  • the identifier of the second electronic device is, for example, device information of the second electronic device.
  • the server deletes the information that the second electronic device is the shared control device of the IoT device from the registered information.
  • the server sends to the IoT device a message for canceling the second electronic device as the shared control device of the IoT device.
  • the server sends a message to the second electronic device for canceling the second electronic device as the shared control device of the IoT device.
  • S504a and S504b may execute S504a first, and then execute S504b; or may execute S504b first, and then execute S504a; or may execute simultaneously.
  • This embodiment of the present application does not limit the execution order of S504a and S504b.
  • the IoT device After receiving the message, the IoT device deletes the corresponding key, and/or deletes the identity certificate of the second electronic device.
  • the corresponding key may include, but is not limited to, at least one of a session key, a control key, and a communication key.
  • the second electronic device receives the message, deletes the corresponding key, and/or deletes the identity credential of the IoT device.
  • the corresponding key may include, but is not limited to, at least one of a session key, a control key, and a communication key.
  • S505 corresponds to S504a
  • S506 corresponds to S504b.
  • the dashed box in FIG. 5A indicates that the steps within the dashed box can be replaced.
  • the authorization cancellation process may only include S501-S503, S504a, and S505, but not S504b and S506; or, only include S501-S503, S504b, and S506, but not include S504a and S505.
  • the process of canceling authorization may only include S501-S504a, and not include S504b, S505 and S506.
  • the second electronic device sends the control message to the IoT device through the server. Since the server cannot find the information that the second electronic device is the shared control device of the IoT device from the registered information, it sends the control message to the second electronic device. Control failure response message; after receiving the response message, the second electronic device deletes the corresponding key, and/or deletes the identity credential of the IoT device.
  • the process of canceling authorization does not include S504a, S504b, S505, and S506 in FIG. 5A.
  • the second electronic device wants to control the IoT device, it needs to send a control message to the server, and the server needs to send a control message to the server. If the information about the shared control device that the second electronic device is an IoT device cannot be queried from the registered information, it sends a control failure response message to the second electronic device; after receiving the response message, the second electronic device deletes the corresponding password key, and/or delete the IoT device's credentials.
  • the process of canceling authorization specifically includes:
  • the first electronic device receives an input.
  • the input may be an external input such as user input; it may also be an internal input such as an instruction, command, or the like.
  • the user input is used to trigger the first electronic device to send a message for canceling the shared control device, where the message is used to instruct the second electronic device to no longer be set as the shared control device of the IoT device.
  • the first electronic device sends a message for canceling the sharing of the control device to the server.
  • the message for canceling the sharing of the control device includes the identifier of the IoT device, the identifier of the second electronic device, and the like.
  • the identifier of the second electronic device is, for example, device information of the second electronic device.
  • the server sends a message for canceling the sharing of the control device to the IoT device.
  • the IoT device after receiving the message, deletes the corresponding key, and/or deletes the identity certificate of the second electronic device.
  • the corresponding key may include, but is not limited to, at least one of a session key, a control key, and a communication key.
  • the second electronic device sends a control message to the IoT device.
  • control message is a message encrypted by using the corresponding key and/or the identity certificate of the second electronic device.
  • the IoT device receives the control message sent by the second electronic device.
  • the IoT device fails to decrypt, and sends a decryption failure response message to the second electronic device.
  • the second electronic device after receiving the response message, deletes the corresponding key and/or the identity certificate of the IoT device.
  • the corresponding key may include, but is not limited to, at least one of a session key, a control key, and a communication key.
  • the first electronic device is a mobile phone 1
  • the second electronic device is a mobile phone 2
  • the mobile phone 1 is the control device of the smart speaker
  • the mobile phone 1 authorizes the mobile phone 2 to be the shared control device of the smart speaker as an example.
  • the cell phone 1 displays an interface 602 containing a list of bound devices as shown in FIG. 6B. Further, in response to the user selecting the smart speaker control 603 and clicking the "OK" control 604, the mobile phone 1 sends a message or instruction to the server for adding a shared control device for the smart speaker.
  • mobile phone 1 can display an interface 607 as shown in FIG.
  • the main interface 605 includes a list of IoT devices bound to the mobile phone 1, and displays operation controls corresponding to each IoT device, such as "disconnect", “add shared control device”, etc. (also include “cancel shared control device”) ” control, not shown).
  • the mobile phone 1 sends a message or instruction to the server to add a shared control device for the smart speaker.
  • mobile phone 1 can display an interface 607 as shown in FIG.
  • the mobile phone 1 starts the process of adding a shared control device for the "smart speaker", that is, the process performed by the first electronic device in the above-mentioned IoT device authorization method is executed. For example, taking FIG. 4A as an example, S402-S406 in FIG. 4A are executed.
  • the mobile phone 2 After receiving the second adding message, the mobile phone 2 obtains the device information of the mobile phone 1, the device information of the smart speaker, etc., and generates prompt information. As shown in FIG. 7 , a prompt interface 701 is displayed for the mobile phone 2 . In response to detecting that the "agree" control 702 is touched, the mobile phone 2 returns the device information of the mobile phone 2 to the smart speaker, that is, the process performed by the second electronic device in the above IoT device authorization method is executed. For example, taking FIG. 4A as an example, S408-S411 are executed.
  • the mobile phone 2 In response to detecting that the "disagree" control 703 is touched, the mobile phone 2 does not return the device information of the mobile phone 2 to the smart speaker, or returns to the smart speaker refusing to control the smart speaker, and the process of adding a shared control device ends.
  • the mobile phone 1 can display a prompt interface 801 as shown in FIG. 8 .
  • the mobile phone 1 sends a message or instruction to the server to add the mobile phone 2 as the shared control device of the smart speaker.
  • the mobile phone 1 continues to execute the process corresponding to the first electronic device in the above-mentioned IoT device authorization method. For example, taking FIG. 4A as an example, S413 and subsequent steps are performed.
  • the mobile phone 1 In response to detecting that the "disagree" control 803 is touched, the mobile phone 1 sends a message or instruction to the server refusing to add the mobile phone 2 as a shared control device of the smart speaker, and the process of adding a shared control device ends.
  • the server can add mobile phone 1 and mobile phone 2 as shared devices by default, or the server can ask mobile phone 1 and mobile phone 2 whether to add each other as shared devices.
  • an interface 901 is displayed for the mobile phone 1 .
  • the cell phone 1 displays an interface 903 as shown in Figure 9B.
  • the user can view the mobile phone 2 and the shared IoT device through the interface 903 .
  • newly added shared information 904 is displayed under "Shared by me", and the shared information includes the device information of mobile phone 2 and the number of IoT devices shared by mobile phone 1 and mobile phone 2.
  • the device information of the IoT device shared by mobile phone 1 and mobile phone 2 can be viewed.
  • the device information of the mobile phone 1 and the device information of the shared IoT device, etc. are displayed in "I received" (not shown in the figure).
  • the user can also add new shared members or IoT devices through the "Add Shared Member” control 905 and the "Add Shared Control Device” control 906.
  • the cell phone 1 may display an interface 907 as shown in FIG. 9C.
  • the interface 907 includes device information of the shared device of the mobile phone 1 .
  • the interface 907 also includes a "delete" control 908 for deleting the mobile phone 2 from the shared control device of the smart speaker.
  • phone 1 initiates the process of deleting phone 2 from the shared control device of the smart speaker.
  • step S502 and subsequent steps are performed.
  • the interface 907 may further include an add shared control device control 909 for continuing to add other shared control devices to the smart speaker.
  • the first electronic device may specify the temporary control duration and/or the number of times of temporary control of the shared control device when instructing to add the second electronic device as the shared control device of the IoT device.
  • the second electronic device may confirm or specify the temporary control duration and/or the number of times of temporary control when confirming that it is added as a shared control device of the IoT device.
  • the first electronic device after the first electronic device acquires the device information of the second electronic device, the first electronic device confirms or specifies the temporary control duration and/or when confirming that the second electronic device is added as the shared control device of the IoT device. or temporary control times.
  • the first electronic device may also specify a temporary control duration and/or a temporary control number of times for the second electronic device to control the IoT device. That is, the first electronic device controls the timeliness of the second electronic device to control the IoT device.
  • FIG. 10A is a flowchart of a method for authorizing an IoT device according to an embodiment of the present application. As shown in Figure 10A, the method includes:
  • a first electronic device receives a first input.
  • the first input may be an external input such as a user input; it may also be an internal input such as an instruction, a command or the like.
  • the user input is used to trigger the first electronic device to send a first message including the temporary control duration and/or the number of times of temporary control, where the first message is used to instruct the second electronic device to be temporarily added as an IoT device shared control device.
  • an interface 1101 for adding a shared control device is displayed for the mobile phone 1 .
  • the mobile phone displays an interface 1103 as shown in FIG. 11B , the interface 1103 includes an aging control 1104 for setting the shared control of the shared control.
  • the user can choose the total number of times the shared control device controls the IoT device, such as 1 time, 5 times. Users can choose the duration of the shared control device to control the IoT device, such as 1 month, one week, one day, etc.
  • the first electronic device sends a first message including the temporary control duration and/or the number of times of temporary control to the IoT device through the server, where the first message is used to temporarily add a shared control device.
  • the IoT device After receiving the first message for adding a shared control device, the IoT device switches to the second antenna.
  • the IoT device randomly generates a session key.
  • the IoT device sends a second message through the second antenna, where the second message includes device information of the IoT device, a session key, and the temporary control duration and/or the number of temporary control times.
  • transmitting includes broadcasting.
  • the second electronic device receives the second message.
  • the second electronic device receives a second user input, encrypts the device information of the second electronic device using the session key, and generates a third message.
  • the second electronic device sends a third message to the IoT device.
  • the IoT device switches to the first antenna.
  • the IoT device sends a fourth message to the first electronic device through the server, where the fourth message includes device information of the second electronic device.
  • the first electronic device After receiving the fourth message, acquires device information of the second electronic device.
  • the first electronic device receives a third input.
  • the third input may be an external input such as a user input; it may also be an internal input such as an instruction, a command, or the like.
  • the user input is used to trigger the first electronic device to send a fifth message, where the fifth message is used to instruct the second electronic device to be temporarily added as a shared control device of the IoT device.
  • the first electronic device after receiving the fourth message forwarded by the server, the first electronic device generates and displays prompt information (for example, at least one of voice prompts, text prompts, and pattern prompts), asking the first electronic device for Whether the user agrees or confirms adding the second electronic device as a shared control device with temporary control duration and/or temporary control times of the IoT device.
  • prompt information for example, at least one of voice prompts, text prompts, and pattern prompts
  • the third user input may be a touch input by the user of the first electronic device to a specific control, a specific voice input by the user of the first electronic device, and the like.
  • the first electronic device sends a fifth message to the server, where the fifth message includes device information of the second electronic device and the temporary control duration and/or the number of times of temporary control.
  • the server has saved the temporary control duration and/or the number of times of temporary control in S1002; when S1013 is executed, the fifth message may not carry the duration of temporary control and/or the number of times of temporary control.
  • the server After receiving the fifth message, the server registers the second electronic device as a shared control device of the IoT device, and records the temporary control duration and/or the number of temporary control times.
  • the server determines whether the temporary control duration and/or the number of times of temporary control are reached.
  • the server deletes the device information of the second electronic device from the account information of the shared control device of the IoT device.
  • the server sets the second electronic device to no longer be able to control the IoT device. until the server receives a new fifth message.
  • the server After adding the second electronic device as the shared control device of the IoT device, the server records whether the temporary control duration and/or the number of temporary control times for monitoring the second electronic device expires. For example, after adding the second electronic device as a shared control device with a temporary control duration and/or a number of times of temporary control, the server starts to count the duration or count the number of times the second electronic device controls the IoT device, thereby determining the second electronic device Whether the temporary control duration and/or the number of temporary control times expired. After the temporary control duration and/or the number of times of temporary control of the second electronic device expires, the server deletes the device information of the second electronic device from the account information of the shared control device of the IoT device. Optionally, the server sends cancellation notices to the first electronic device and the second electronic device respectively.
  • the temporary control duration and/or the temporary control times of the second electronic device may also be monitored by the IoT device. Exemplarily, the specific flow is explained below with reference to FIG. 10B and FIG. 10C , respectively.
  • a method for IoT device authorization includes: S1001'-S1022'; wherein, the related content of S1001'-S1013' is the same as that of S1001-S1013; it will not be described here.
  • S1014' The server receives the fifth message, obtains device information of the second electronic device, and generates a control key.
  • the server sends a sixth message including the temporary control duration and/or the temporary control times, and the control key.
  • the server sends a sixth message including the temporary control duration and/or the number of times of temporary control, and the control key to the second electronic device.
  • the IoT device receives the sixth message, and obtains the control key, the temporary control duration and/or the number of temporary controls.
  • the second electronic device receives the sixth message, and obtains the control key, the temporary control duration and/or the number of temporary controls.
  • the IoT device determines whether the temporary control duration and/or the number of times of temporary control is reached.
  • the IoT device deletes the control key.
  • the IoT device sends a seventh message to the second electronic device, which is used to notify that the addition is invalid.
  • the second electronic device after receiving the seventh message, deletes the control key.
  • a method for IoT device authorization includes: S1001"-S1024".
  • the related content of S1001"-S1013" is the same as the related content of S1001-S1013; the related content of S1014"-S1020" is the same as the related content of S1014'-S1020'; it will not be described here.
  • the second electronic device sends the control message encrypted by using the control key to the IoT device.
  • the IoT device receives the control message.
  • the IoT device sends a response message that the control key has expired to the second electronic device.
  • the IoT device sends to the second electronic device a response message that the control key has expired, or a response message that decryption fails, or a response message that refuses to execute the control instruction, or the second electronic device controls the identity Failed response message.
  • the second electronic device receives the response message and deletes the control key.
  • a method for IoT device authorization includes:
  • the first electronic device receives a first input.
  • the first input may be an external input such as a user input; it may also be an internal input such as an instruction, a command or the like.
  • the user input is used to trigger the first electronic device to send a first message, where the first message is used to instruct the second electronic device to be added as a shared control device of the IoT device.
  • the first electronic device sends a first message of adding a shared control device to the IoT device through the server.
  • the first message is sent by the first electronic device to the server; after receiving the first message, the server sends the first message to the IoT device.
  • the IoT device After receiving the first message for adding a shared control device, the IoT device switches to the second antenna.
  • the IoT device randomly generates a session key.
  • the IoT device sends a second message including device information and a session key of the IoT device through the second antenna.
  • transmitting includes broadcasting.
  • the second electronic device receives the second message.
  • the second electronic device receives a second input, encrypts the device information of the second electronic device using the session key, and generates a third message.
  • the second electronic device sends a third message to the IoT device.
  • the IoT device After receiving the third message, the IoT device adds the device information of the second electronic device to the shared control device account information of the IoT device, and switches to the first antenna.
  • the IoT device locally maintains its control device and shares account information of the control device.
  • the IoT device sends a fourth message to the first electronic device through the server, where the fourth message includes device information of the second electronic device, and the fourth message is used to inform the second electronic device that the addition is successful.
  • the IoT device sends a fourth message to the second electronic device, where the fourth message is used to inform the second electronic device that the addition is successful.
  • This embodiment of the present application does not limit the sequence of S1210 and S1211.
  • the first electronic device receives a fourth message, indicating that the second electronic device is successfully added.
  • the second electronic device receives a fourth message, indicating that the second electronic device is successfully added.
  • This embodiment of the present application does not limit the execution order of S1212 and S1213.
  • a method for IoT device authorization includes:
  • the first electronic device receives a first input.
  • the first input may be an external input such as a user input; it may also be an internal input such as an instruction, a command or the like.
  • the user input is used to trigger the first electronic device to send a first message including the temporary control duration and/or the number of times of temporary control, where the first message is used to instruct the second electronic device to be temporarily added as an IoT device shared control device.
  • the first electronic device sends a first message including the temporary control duration and/or the number of times of temporary control to the IoT device through the server, where the first message is used to temporarily add a shared control device of the IoT device.
  • the IoT device switches to the second antenna.
  • the IoT device randomly generates a session key.
  • the IoT device sends a second message including the device information, session key, temporary control duration and/or number of temporary control times of the IoT device through the second antenna.
  • transmitting includes broadcasting.
  • the second electronic device receives the second message.
  • the second electronic device receives a second input, encrypts the device information of the second electronic device using the session key, and generates a third message.
  • the second electronic device sends a third message to the IoT device.
  • the IoT device after receiving the third message, adds the device information of the second electronic device to the shared control device account information of the IoT device, and switches to the first antenna.
  • the IoT device locally maintains the account information of its control device and shared control device.
  • the IoT device sends a fourth message to the first electronic device through the server, where the fourth message includes device information of the second electronic device, and the fourth message is used to inform that the addition is successful.
  • the IoT device sends a fourth message to the second electronic device, where the fourth message is used to notify that the addition is successful.
  • S1212' The first electronic device receives a fourth message, indicating that the second electronic device is successfully added.
  • a message that the second electronic device is successfully added may be displayed, and/or a voice that the second electronic device is successfully added may be played.
  • S1213' The second electronic device receives a fourth message, indicating that the second electronic device is successfully added.
  • a message that the second electronic device is successfully added may be displayed, and/or a voice that the second electronic device is successfully added may be played.
  • the IoT device determines whether the temporary control duration and/or the number of times of temporary control is reached.
  • the IoT device sends a fifth message to the second electronic device to notify that the addition is invalid.
  • the IoT device sends a fifth message to the first electronic device through the server to inform that the addition is invalid.
  • S1201'-S1208' are the same as the specific contents of S1201-S1208, and the specific contents of S1209'-S1213' are respectively the same as those of S1209-S1213, which will not be repeated here.
  • the first electronic device is used as an example to add a shared control device to an IoT device for description.
  • the first electronic device may also add a shared control device for multiple IoT devices. This section explains the difference between adding a shared control device to one IoT device and adding shared control to multiple IoT devices.
  • the first electronic device receives a user input indicating that a shared control device is added for a plurality of IoT devices. For example, as shown in Figure 13, when a user adds a shared control device to an IoT device, he can select R IoT devices (for example, “smart speakers” and “smart lights”), where R is a positive integer greater than or equal to 1.
  • the first electronic device may send a message or an instruction for adding a shared control device to the R IoT devices through the server.
  • the server may also select S IoT devices from the R IoT devices; where S is a positive integer greater than or equal to 1 and less than or equal to R.
  • the server sends a message or an instruction for adding a shared control device to the S IoT devices.
  • the message or instruction for adding a shared control device includes device information of multiple IoT devices.
  • the R or S IoT devices after the R or S IoT devices receive the message or instruction for adding a shared control device, they switch to the second antenna, and send a request for adding a shared control device.
  • transmitting includes broadcasting.
  • the request includes information of R IoT devices or S IoT devices.
  • any IoT device receives the response sent by the second electronic device, it can obtain the identifier of the second electronic device from the response, and the IoT device forwards the identifier of the second electronic device to the first electronic device through the server.
  • the first electronic device receives the input confirming adding the second electronic device as a shared control device, it instructs the server to add the second electronic device as the above-mentioned R IoT devices (for example, "smart speakers” and “smart lights") or S.
  • Shared control device for multiple IoT devices, so that users can add shared control devices for multiple IoT devices in one operation. That is, adding shared control devices for multiple IoT devices in batches.
  • the first electronic device may also first add the second electronic device as a shared control device of any IoT device among the R IoT devices. Then, the server automatically adds the second electronic device as a shared control device of the first electronic device. Then, the first electronic device may designate the second electronic device as the shared control device of other IoT devices, that is, designate the second electronic device as the shared control device of the other R-1 IoT devices.
  • the R IoT devices also need to exchange identity credentials with the second electronic device. For example, after the second electronic device sends its own identity credential to the IoT device that sends the ultra-short-range wireless signal, the IoT device can forward the identity credential of the second electronic device to the first electronic device or other transit devices (for example, R A router to which the IoT devices are connected together). Then, the first electronic device or the transit device may forward the identity credential of the second electronic device to the remaining R-1 IoT devices.
  • the first electronic device or the transit device may forward the identity credential of the second electronic device to the remaining R-1 IoT devices.
  • the first electronic device may send the identity credentials of the R-1 IoT devices to the second electronic device through the server or the transit device.
  • the embodiments of the present application do not limit the method for exchanging the identity credential between the IoT device and the second electronic device.
  • the first electronic device may also add multiple shared control devices to one IoT device. Then, when the IoT device switches to the first antenna, if the device information of at least two second electronic devices is received within a preset time period. Then, all or part of the device information of the at least two second electronic devices may be returned to the first electronic device through the server. After the first electronic device is confirmed, the server may simultaneously add at least two shared control devices to one IoT device.
  • user A's mobile phone is bound to a smart TV at home (an example of an IoT device). That is, the mobile phone of user A is the control device of the smart TV.
  • user B comes to user A's home, and user B wants to control the smart TV.
  • user A can remotely authorize user B's mobile phone to control the smart TV.
  • user A adds user B's mobile phone as a shared control device of the smart TV through the mobile phone.
  • the specific process please refer to the related process in the above-mentioned embodiment, which will not be repeated here.
  • user A's mobile phone can also grant user B's mobile phone the right to temporarily control the smart TV, that is, to set the temporary control duration and/or the number of times of temporary control.
  • user A's mobile phone authorizes user B's mobile phone to control the smart TV for 2 hours.
  • user A's mobile phone is bound to the smart door lock at home. That is, the mobile phone of user A is the control device of the smart door lock.
  • user C needs to open the smart door lock. Then, user A can remotely authorize user C's mobile phone to control the smart door lock. For example, authorize user C's mobile phone to control the smart door lock, and can only control the smart door lock one or more times; or, authorize the user C's mobile phone to control the smart door lock, and can only control the smart door lock for two hours .
  • a control device such as user A's mobile phone
  • can remotely add a shared control device to an IoT device such as a smart TV or a smart door lock
  • the IoT device and the shared control device such as user B's mobile phone or user C mobile phone
  • the user operations on the control device side and the user operations on the shared control device side are relatively simple.
  • each step or each feature of all the embodiments of the present application can be freely combined with each step or each feature of other embodiments.
  • the chip system includes at least one processor 1401 and at least one interface circuit 1402 .
  • the processor 1401 and the interface circuit 1402 may be interconnected by wires.
  • the interface circuit 1402 may be used to receive signals from other devices (eg, the memory of the IoT device 300).
  • the interface circuit 1402 may be used to send signals to other devices (eg, the processor 1401).
  • the interface circuit 1402 may read the instructions stored in the memory and send the instructions to the processor 1401 .
  • the system-on-a-chip can be made to execute various steps executed by the IoT device in the above-mentioned embodiments.
  • the chip system may also include other discrete devices, which are not specifically limited in this embodiment of the present application.
  • An embodiment of the present application further provides an apparatus, the apparatus is included in an electronic device, and the apparatus has a function of implementing the behavior of the electronic device in any of the methods in the foregoing embodiments.
  • This function can be implemented by hardware or by executing corresponding software by hardware.
  • the hardware or software includes at least one module or unit corresponding to the above-mentioned functions. For example, a detection module or unit, a display module or unit, a determination module or unit, and a calculation module or unit, etc.
  • Embodiments of the present application further provide a computer storage medium, including computer instructions, when the computer instructions are executed on the electronic device, the electronic device is made to execute any of the methods in the foregoing embodiments.
  • Embodiments of the present application further provide a computer program product, which, when the computer program product runs on a computer, causes the computer to execute any of the methods in the foregoing embodiments.
  • the embodiments of the present application further provide a graphical user interface on an electronic device, where the electronic device has a display screen, a camera, a memory, and one or more processors, and the one or more processors are configured to execute the storage in the One or more computer programs in memory, the graphical user interface comprising a graphical user interface displayed when the electronic device performs any of the methods in the above-described embodiments.
  • the above-mentioned terminal and the like include 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. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of the embodiments of the present invention.
  • each functional module may be divided corresponding to 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 embodiment of the present invention is schematic, and is only a logical function division, and there may be other division manners in actual implementation.
  • each functional unit of each embodiment 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 may be implemented in the form of hardware, or may be implemented in the form of software functional units.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as an independent product, may be stored in a computer-readable storage medium.
  • a computer-readable storage medium includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a 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: flash memory, removable hard disk, read-only memory, random access memory, magnetic disk or 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)
  • Computing Systems (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Power Engineering (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

一种IoT设备及其授权方法,涉及IoT设备,在保证安全性的同时,提供便利性。IoT设备与第一电子设备和第二电子设备无线通信;IoT设备包括:处理器,存储器,第一天线,和第二天线;第一天线和第二天线为不同的天线,第二天线的发射距离小于第一天线的发射距离;或者,第一天线和第二天线为同一天线,第二天线的发射功率小于第一天线的发射功率;当存储在存储器上的计算机程序被处理器执行时,IoT设备执行:接收到为IoT设备添加共享控制设备的第一消息;通过第二天线发送包括IoT设备的设备信息的第二消息;接收到包括第二电子设备的设备信息的第三消息;通过第一天线向第一电子设备发送包括第二电子设备的设备信息的第四消息。

Description

一种IoT设备及其授权方法
本申请要求于2020年08月31日提交国家知识产权局、申请号为202010901711.1、发明名称为“一种IoT设备及其授权方法”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及物联网(internet of things,IoT)领域,尤其涉及一种IoT设备及其授权方法。
背景技术
诸如家庭网络、办公网络等具有多个IoT设备的网络中的每个IoT设备可对应一个绑定账号,登录绑定账号的电子设备能够控制该IoT设备。若登录其他账号的电子设备欲控制该IoT设备,需要先从登录该绑定账号的电子设备处,获取授权。在上述授权中,如何在保证安全性的同时,进一步提供便利性,成为我们的需求。
发明内容
为了解决上述技术问题,本申请提供了一种IoT设备及其授权方法,能够在保证安全性的同时,进一步提供便利性,简化用户操作。
第一方面,提供一种IoT设备。IoT设备与第一电子设备和第二电子设备无线通信,第一电子设备为IoT设备的控制设备,第二电子设备不同于第一电子设备;IoT设备包括:一个或多个处理器;一个或多个存储器;一个第一天线;一个第二天线,第二天线的发射距离小于等于预设的安全发射距离;其中,第一天线和第二天线为不同的天线,第二天线发射无线信号的发射距离小于第一天线发射无线信号的发射距离;或者,第一天线和第二天线为同一天线,且第二天线配置的发射功率小于第一天线配置的发射功率;以及一个或多个计算机程序,其中一个或多个计算机程序存储在一个或多个存储器上,当计算机程序被一个或多个处理器执行时,使得IoT设备执行以下步骤:接收到第一电子设备的第一消息;其中,第一消息用于指示为所述IoT设备添加共享控制设备;响应于第一消息,IoT设备切换至第二天线,并通过第二天线发送第二消息;其中,第二消息包括IoT设备的设备信息;接收到第二电子设备发送的第三消息;其中,第三消息包括第二电子设备的设备信息;响应于第三消息,切换至第一天线,并通过第一天线向第一电子设备发送第四消息;其中,第四消息包括第二电子设备的设备信息;所述控制设备对所述IoT设备的权限大于所述共享控制设备对所述IoT设备的权限。这样,用户操作得以简化,更加便利用户;并且,本申请实施例利用了超短距无线通信的安全距离,从物理上保证了IoT设备与第二电子设备通信的安全性。
根据第一方面,IoT设备的设备信息包括传输参数,该传输参数包括连接协议和会话标识中的至少一项。这样,就进一步具体细化了IoT设备的设备信息。
根据第一方面,IoT设备还执行以下步骤:在通过第一天线向第一电子设备发送第四 消息之后,接收到成功添加消息,成功添加消息用于指示已将第二电子设备添加为IoT设备的共享控制设备。这样,IoT设备就能够基于该成功添加消息,进行进一步的显示或处理。比如,显示该成功添加消息的文字,和/或播放该成功添加消息的语音等,来进行提示。
根据第一方面,或者以上第一方面的任意一种实现方式,第一消息还包括第二电子设备对IoT设备的临时控制时长或临时控制次数;在通过第一天线向第一电子设备发送第四消息之后,接收到一个消息;其中,所述消息包括第二电子设备对应的密钥和第二电子设备的身份凭证中的至少一项;第二电子设备对应的密钥和第二电子设备的身份凭证,用于第二电子设备对IoT设备的控制;在临时控制时长或临时控制次数达到后,IoT设备删除第二电子设备对应的密钥和第二电子设备的身份凭证中的至少一项。这样,就提供了临时控制权限以及判断过程,并细化了方案。
根据第一方面,或者以上第一方面的任意一种实现方式,IoT设备还执行以下步骤:在通过第一天线向第一电子设备发送第四消息之后,接收到一个消息;所述消息包含随机生成的控制密钥;响应于所述包含随机生成的控制密钥的消息,获取到控制密钥;第二电子设备对应的密钥包括控制密钥。这样,就提供了通过控制密钥的具体方式,以便于后续使用。
根据第一方面,或者以上第一方面的任意一种实现方式,IoT设备还执行以下步骤:接收到包含第一随机数的消息;响应于所述包含第一随机数的消息,随机生成第二随机数;基于第一随机数、第二随机数和控制密钥,生成通信密钥,并向第二电子设备发送包含第二随机数的消息;接收到第二电子设备的控制消息;响应于所述控制消息,基于通信密钥解密控制消息,获取到控制指令,并执行控制指令;第二电子设备对应的密钥包括通信密钥。这样,就提供了第二电子设备与通信设备之间的一种具体通信方式;该通信方式更加安全,且只需用户的简单输入,更为便利。
根据第一方面,或者以上第一方面的任意一种实现方式,IoT设备还执行以下步骤:在接收到成功添加消息后,IoT设备获取到第二电子设备对应的密钥和第二电子设备的身份凭证中的至少一项;第二电子设备对应的密钥和第二电子设备的身份凭证,用于第二电子设备对IoT设备的控制。这样,就为后续的身份鉴权提供了具体的方式。
根据第一方面,或者以上第一方面的任意一种实现方式,IoT设备还执行以下步骤:接收到第一电子设备的取消消息;其中,所述取消消息用于指示取消对第二电子设备的授权;响应于取消消息,IoT设备删除第二电子设备对应的密钥和第二电子设备的身份凭证中的至少一项。这样,就提供了取消授权的手段,使得第一电子设备可以取消对第二电子设备的授权,便于第一电子设备对第二电子设备的授权控制。
根据第一方面,或者以上第一方面的任意一种实现方式,第二消息还包括会话密钥,会话密钥是IoT设备随机生成的;第三消息为第二电子设备针对第二消息的响应消息;第二电子设备对应的密钥包括会话密钥、控制密钥和通信密钥中的至少一项;接收到第一电子设备的第一消息,包括:经一个或多个服务器,接收到第一电子设备的第一消息;通过第一天线向第一电子设备发送第四消息,包括:通过所述第一天线,经一个或多个服务器,向第一电子设备发送第四消息。这样,就细化了第一电子设备与IoT设备之间的通信方式。
第二方面,提供一种IoT设备。IoT设备与第一电子设备和第二电子设备无线通信,第一电子设备为IoT设备的控制设备,第二电子设备不同于所述第一电子设备;所述IoT 设备包括:一个或多个处理器;一个或多个存储器;一个第一天线;一个第二天线,第二天线的发射距离小于等于预设的安全发射距离;其中,第一天线和第二天线为不同的天线,第二天线发射无线信号的发射距离小于第一天线发射无线信号的发射距离;或者,第一天线和第二天线为同一天线,且第二天线配置的发射功率小于第一天线配置的发射功率;以及一个或多个计算机程序,其中一个或多个计算机程序存储在一个或多个存储器上,当计算机程序被一个或多个处理器执行时,使得IoT设备执行以下步骤:接收到第一电子设备的第一消息;其中,第一消息用于指示为IoT设备添加共享控制设备;响应于第一消息,IoT设备切换至第二天线,并通过第二天线发送第二消息;其中,第二消息包括IoT设备的设备信息;接收到第二电子设备发送的第三消息;其中,第三消息包括第二电子设备的设备信息;响应于第三消息,将第二电子设备的设备信息添加至IoT设备的共享控制设备的设备信息中,并切换至第一天线;其中,所述控制设备对所述IoT设备的权限大于所述共享控制设备对所述IoT设备的权限。这样,IoT设备就能本地存储其共享控制设备,而不必将该IoT设备的共享控制设备存储在服务器上,简化了通信流程,执行更为快捷。在保证安全性的同时,简化了用户操作,更加方便用户。
根据第二方面,IoT设备还执行以下步骤:第一消息还包括第二电子设备对IoT设备的临时控制时长或临时控制次数;在临时控制时长或临时控制次数达到后,IoT设备向第二电子设备和第一电子设备中的至少一个,发送添加失效的消息。这样,就提供了IoT设备本地化的临时控制权限以及判断过程,并细化了方案。
根据第二方面,或者以上第二方面的任意一种实现方式,接收到第一电子设备的第一消息,包括:经一个或多个服务器,接收到第一电子设备的第一消息;IoT设备向第一电子设备发送添加失效的消息,包括:IoT设备经一个或多个服务器向第一电子设备发送添加失效的消息。这样,就细化了第一电子设备与IoT设备之间的通信方式。
第三方面,提供一种IoT设备授权方法。该方法应用于IoT设备,IoT设备与第一电子设备和第二电子设备无线通信,第一电子设备为IoT设备的控制设备,第二电子设备不同于第一电子设备;IoT设备包括一个第一天线和一个第二天线,第二天线的发射距离小于等于预设的安全发射距离;其中,第一天线和第二天线为不同的天线,第二天线发射无线信号的发射距离小于第一天线发射无线信号的发射距离;或者,第一天线和第二天线为同一天线,且第二天线配置的发射功率小于第一天线配置的发射功率;所述方法包括:IoT设备接收到第一电子设备的第一消息;其中,第一消息用于指示为IoT设备添加共享控制设备;响应于第一消息,IoT设备切换至第二天线,并通过第二天线发送第二消息;其中,第二消息包括IoT设备的设备信息;IoT设备接收到第二电子设备发送的第三消息;其中,第三消息包括第二电子设备的设备信息;响应于第三消息,IoT设备切换至第一天线,并通过第一天线向第一电子设备发送第四消息;其中,第四消息包括第二电子设备的设备信息;所述控制设备对所述IoT设备的权限大于所述共享控制设备对所述IoT设备的权限。
根据第一方面,IoT设备的设备信息包括传输参数,该传输参数包括连接协议和会话标识中的至少一项。
根据第三方面,所述方法还包括:在通过第一天线向第一电子设备发送第四消息之后,IoT设备接收到成功添加消息,所述成功添加消息用于指示已将第二电子设备添加为IoT设备的共享控制设备。
根据第三方面,或者以上第三方面的任意一种实现方式,第一消息还包括第二电子设备对IoT设备的临时控制时长或临时控制次数;在通过第一天线向第一电子设备发送第四消息之后,IoT设备接收到一个消息;其中,所述消息包括第二电子设备对应的密钥和第二电子设备的身份凭证中的至少一项;第二电子设备对应的密钥和第二电子设备的身份凭证,用于第二电子设备对IoT设备的控制;在临时控制时长或临时控制次数达到后,IoT设备删除所述第二电子设备对应的密钥和第二电子设备的身份凭证中的至少一项。
根据第三方面,或者以上第三方面的任意一种实现方式,所述方法还包括:在通过第一天线向第一电子设备发送第四消息之后,IoT设备接收到一个消息;所述消息包含随机生成的控制密钥;响应于所述包含随机生成的控制密钥的消息,IoT设备获取到控制密钥;第二电子设备对应的密钥包括所述控制密钥。
根据第三方面,或者以上第三方面的任意一种实现方式,所述方法还包括:IoT设备接收到包含第一随机数的消息;响应于所述包含第一随机数的消息,IoT设备随机生成第二随机数;基于第一随机数、第二随机数和所述控制密钥,IoT设备生成通信密钥,并向第二电子设备发送包含第二随机数的消息;IoT设备接收到第二电子设备的控制消息;响应于控制消息,基于通信密钥解密控制消息,IoT设备获取到控制指令,并执行控制指令;第二电子设备对应的密钥包括通信密钥。
根据第三方面,或者以上第三方面的任意一种实现方式,所述方法还包括:在接收到成功添加消息后,IoT设备获取到第二电子设备对应的密钥和第二电子设备的身份凭证中的至少一项;第二电子设备对应的密钥和第二电子设备的身份凭证,用于第二电子设备对IoT设备的控制。
根据第三方面,或者以上第三方面的任意一种实现方式,所述方法还包括:IoT设备接收到第一电子设备的取消消息;其中,取消消息用于指示取消对第二电子设备的授权;响应于取消消息,IoT设备删除第二电子设备对应的密钥和第二电子设备的身份凭证中的至少一项。
根据第三方面,或者以上第三方面的任意一种实现方式,第二消息还包括会话密钥,所述会话密钥是IoT设备随机生成的;第三消息为第二电子设备针对第二消息的响应消息;第二电子设备对应的密钥包括会话密钥、控制密钥和通信密钥中的至少一项;IoT设备接收到第一电子设备的第一消息,包括:经一个或多个服务器,IoT设备接收到第一电子设备的第一消息;IoT设备通过第一天线向第一电子设备发送第四消息,包括:IoT设备通过第一天线,经一个或多个服务器,向第一电子设备发送第四消息。
第三方面及第三方面的任意一种实现方式分别与第一方面及第一方面的任意一种实现方式相对应。第三方面以及第三方面中任意一种实现方式所对应的技术效果可参见上述第一方面以及第一方面中任意一种实现方式所对应的技术效果,此处不再赘述。
第四方面,提供一种IoT设备授权方法。该方法应用于IoT设备,IoT设备与第一电子设备和第二电子设备无线通信,第一电子设备为IoT设备的控制设备,第二电子设备不同于第一电子设备;IoT设备包括一个第一天线和一个第二天线,第二天线的发射距离小于等于预设的安全发射距离;其中,第一天线和第二天线为不同的天线,第二天线发射无线信号的发射距离小于第一天线发射无线信号的发射距离;或者,第一天线和第二天线为同一天线,且第二天线配置的发射功率小于第一天线配置的发射功率;所述方法包括:IoT 设备接收到第一电子设备的第一消息;其中,第一消息用于指示为IoT设备添加共享控制设备;响应于第一消息,IoT设备切换至第二天线,并通过第二天线发送第二消息;其中,第二消息包括IoT设备的设备信息;IoT设备接收到第二电子设备发送的第三消息;其中,第三消息包括第二电子设备的设备信息;响应于第三消息,IoT设备将第二电子设备的设备信息添加至IoT设备的共享控制设备的设备信息中,并切换至第一天线;其中,所述控制设备对所述IoT设备的权限大于所述共享控制设备对所述IoT设备的权限。
根据第四方面,所述方法还包括:第一消息还包括第二电子设备对IoT设备的临时控制时长或临时控制次数;在临时控制时长或临时控制次数达到后,IoT设备向第二电子设备和第一电子设备中的至少一个,发送添加失效的消息。
根据第四方面,或者以上第四方面的任意一种实现方式,IoT设备接收到第一电子设备的第一消息,包括:IoT设备经一个或多个服务器,接收到第一电子设备的第一消息;IoT设备向第一电子设备发送添加失效的消息,包括:IoT设备经一个或多个服务器向第一电子设备发送添加失效的消息。
第四方面及第四方面的任意一种实现方式分别与第二方面及第二方面的任意一种实现方式相对应。第四方面以及第四方面中任意一种实现方式所对应的技术效果可参见上述第二方面以及第二方面中任意一种实现方式所对应的技术效果,此处不再赘述。
第五方面,提供一种服务器。该服务器与一个第一电子设备、一个或多个第二电子设备和一个或多个IoT设备无线通信,第一电子设备为IoT设备的控制设备,第二电子设备不同于第一电子设备;所述服务器包括:一个或多个处理器;一个或多个存储器;以及一个或多个计算机程序,其中一个或多个计算机程序存储在一个或多个存储器上,当计算机程序被一个或多个处理器执行时,使得服务器执行以下步骤:接收到第一电子设备的第一消息;其中,第一消息用于指示为IoT设备添加共享控制设备;响应于第一消息,所述服务器向IoT设备发送第一消息;接收到IoT设备的第四消息;其中,第四消息包括第二电子设备的设备信息;响应于第四消息,所述服务器向第一电子设备发送第四消息;接收到第一电子设备的第五消息;其中,第五消息包括第二电子设备的设备信息;响应于第五消息,所述服务器将第二电子设备的设备信息登记在IoT设备的共享控制设备的设备信息中;其中,所述控制设备对所述IoT设备的权限大于所述共享控制设备对所述IoT设备的权限。这样,就从服务器方面改进流程,使得用户操作得以简化,更加便利用户;并且,本申请实施例利用了IoT设备的超短距无线通信的安全距离,从物理上保证了IoT设备与第二电子设备通信的安全性。
根据第五方面,所述服务器向IoT设备和第二电子设备中的至少一个,发送成功添加消息;其中,成功添加消息用于指示已将第二电子设备添加为IoT设备的共享控制设备。这样,IoT设备就能够基于该成功添加消息,进行进一步的显示或处理。比如,显示该成功添加消息的文字,和/或播放该成功添加消息的语音等,来进行提示。
根据第五方面,或者以上第五方面的任意一种实现方式,所述服务器还执行以下步骤:接收到第一电子设备的取消消息;其中,所述取消消息用于指示取消对第二电子设备的授权;响应于所述取消消息,所述服务器从IoT设备的共享控制设备的设备信息中删除第二电子设备的设备信息。这样,就在服务器上具体执行取消授权的过程,使得第一电子设备可以取消对第二电子设备的授权,便于第一电子设备对第二电子设备的授权控制。
根据第五方面,或者以上第五方面的任意一种实现方式,所述服务器还执行以下步骤:接收到第一电子设备的取消消息;其中,所述取消消息用于指示取消对第二电子设备的授权;响应于所述取消消息,所述服务器向IoT设备发送所述取消消息。这样,就提供了另外一种取消方式;此时,服务器用于向IoT设备转发取消消息,具体由IoT设备执行相关的取消过程,使得第一电子设备可以取消对第二电子设备的授权,便于第一电子设备对第二电子设备的授权控制。
根据第五方面,或者以上第五方面的任意一种实现方式,第一消息还包括第二电子设备对IoT设备的临时控制时长或临时控制次数;在临时控制时长或临时控制次数达到后,服务器从IoT设备的共享控制设备的设备信息中删除第二电子设备的设备信息。这样,就提供了临时控制权限以及判断过程,细化了方案,并在服务器上具体执行;此时,IoT设备就无需存储及删除IoT设备的共享控制设备的设备信息。
第六方面,提供一种IoT设备授权方法。该方法应用于一种服务器,服务器与一个第一电子设备、一个或多个第二电子设备和一个或多个IoT设备无线通信,第一电子设备为IoT设备的控制设备,第二电子设备不同于第一电子设备;所述方法包括:服务器接收到第一电子设备的第一消息;其中,第一消息用于指示为IoT设备添加共享控制设备;响应于第一消息,所述服务器向IoT设备发送第一消息;所述服务器接收到IoT设备的第四消息;其中,第四消息包括第二电子设备的设备信息;响应于第四消息,所述服务器向第一电子设备发送第四消息;所述服务器接收到第一电子设备的第五消息;其中,第五消息包括第二电子设备的设备信息;响应于第五消息,所述服务器将第二电子设备的设备信息登记在IoT设备的共享控制设备的设备信息中;其中,所述控制设备对所述IoT设备的权限大于所述共享控制设备对所述IoT设备的权限。
根据第六方面,所述服务器向IoT设备和第二电子设备中的至少一个,发送成功添加消息;其中,成功添加消息用于指示已将第二电子设备添加为IoT设备的共享控制设备。
根据第六方面,或者以上第六方面的任意一种实现方式,所述方法还包括:所述服务器接收到第一电子设备的取消消息;其中,取消消息用于指示取消对第二电子设备的授权;响应于取消消息,所述服务器从IoT设备的共享控制设备的设备信息中删除第二电子设备的设备信息。
根据第六方面,或者以上第六方面的任意一种实现方式,所述方法还包括:所述服务器接收到第一电子设备的取消消息;其中,取消消息用于指示取消对第二电子设备的授权;响应于所述取消消息,所述服务器向IoT设备发送取消消息。
根据第六方面,或者以上第六方面的任意一种实现方式,第一消息还包括第二电子设备对IoT设备的临时控制时长或临时控制次数;在临时控制时长或临时控制次数达到后,所述服务器从IoT设备的共享控制设备的设备信息中删除第二电子设备的设备信息。
第六方面及第六方面的任意一种实现方式分别与第五方面及第五方面的任意一种实现方式相对应。第六方面以及第六方面中任意一种实现方式所对应的技术效果可参见上述第五方面以及第五方面中任意一种实现方式所对应的技术效果,此处不再赘述。
第七方面,提供一种计算机可读存储介质。该计算机可读存储介质包括计算机程序,当所述计算机程序在IoT设备上运行时,使得所述IoT设备执行如第二方面以及第二方面任意一种实现方式的方法。
第七方面及第七方面的任意一种实现方式分别与第二方面及第二方面的任意一种实现方式相对应。第七方面以及第七方面中任意一种实现方式所对应的技术效果可参见上述第二方面以及第二方面中任意一种实现方式所对应的技术效果,此处不再赘述。
第八方面,提供一种计算机可读存储介质。该计算机可读存储介质包括计算机程序,当所述计算机程序在服务器上运行时,使得所述服务器执行如第四方面以及第四方面任意一种实现方式的方法。
第八方面及第八方面的任意一种实现方式分别与第四方面及第四方面的任意一种实现方式相对应。第八方面以及第八方面中任意一种实现方式所对应的技术效果可参见上述第四方面以及第四方面中任意一种实现方式所对应的技术效果,此处不再赘述。
第九方面,提供一种芯片系统。该芯片系统包括一个或多个处理器,当所述一个或多个处理器执行计算机程序时,使得所述一个或多个处理器执行如第二方面、第四方面、第二方面任意一种实现方式或第四方面任意一种实现方式的方法。
第九方面及第九方面的任意一种实现方式分别与第二方面及第二方面的任意一种实现方式、第四方面及第四方面的任意一种实现方式相对应。第九方面以及第九方面中任意一种实现方式所对应的技术效果可参见上述第二方面及第二方面中任意一种实现方式、第四方面及第四方面的任意一种实现方式所对应的技术效果,此处不再赘述。
第十方面,提供一种计算机程序产品。当其在计算机上运行时,使得计算机执行如第二方面以及第二方面任意一种实现方式的方法,或者如第四方面以及第四方面任意一种实现方式的方法。
第十方面及第十方面的任意一种实现方式分别与第二方面及第二方面的任意一种实现方式、第四方面及第四方面的任意一种实现方式相对应。第十方面以及第十方面中任意一种实现方式所对应的技术效果可参见上述第二方面及第二方面中任意一种实现方式、第四方面及第四方面的任意一种实现方式所对应的技术效果,此处不再赘述。
附图说明
图1为本申请实施例提供的一种应用场景的系统架构图;
图2为本申请实施例提供的一种电子设备的结构示意图;
图3A为本申请实施例提供的一种IoT设备的结构示意图;
图3B为本申请实施例提供的一种IoT设备的结构示意图;
图4A为本申请实施例提供的一种IoT设备的授权方法的流程示意图;
图4B为本申请实施例提供的一种IoT设备的授权方法中部分步骤的流程示意图;
图4C为本申请实施例提供的一种控制IoT设备的方法流程示意图;
图5A为本申请实施例提供的一种IoT设备的授权方法中部分步骤的流程示意图;
图5B为本申请实施例提供的一种IoT设备的授权方法中部分步骤的流程示意图;
图6A-图6D为本申请实施例提供的一些电子设备的用户界面示意图;
图7为本申请实施例提供的一种电子设备的用户界面示意图;
图8为本申请实施例提供的一种电子设备的用户界面示意图;
图9A-图9C为本申请实施例提供的一些电子设备的用户界面示意图;
图10A为本申请实施例提供的一种IoT设备的授权方法的流程示意图;
图10B为本申请实施例提供的一种IoT设备的授权方法的流程示意图;
图10C为本申请实施例提供的一种IoT设备的授权方法的流程示意图;
图11A-图11B为本申请实施例提供的一种电子设备的用户界面示意图;
图12A为本申请实施例提供的一种IoT设备的授权方法的流程示意图;
图12B为本申请实施例提供的一种IoT设备的授权方法的流程示意图;
图13为本申请实施例提供的一种电子设备的用户界面示意图;
图14为本申请实施例提供的一种芯片系统的结构示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。其中,在本申请实施例的描述中,除非另有说明,“/”表示或的意思。例如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系。例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,在本申请实施例的描述中,“多个”是指两个或多于两个。
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。
在本申请实施例中,“示例性地”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性地”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性地”或者“例如”等词旨在以具体方式呈现相关概念。
物联网是指通过各种信息传感器、射频识别技术、全球定位系统、红外感应器、激光扫描器等各种装置与技术,实时采集声、光、热、电、力学、化学、生物、位置等各种需要的信息,通过各类可能的网络接入,实现物与物、物与人的泛在连接,实现对物品和过程的智能化感知、识别和管理。物联网是一个基于互联网、传统电信网等的信息承载体,它让所有能够被独立寻址的普通物理对象形成互联互通的网络。
物联网技术的发展,使得越来越多的IoT设备(如IoT灯、IoT音箱、IoT冰箱等)被接入到网络中。IoT设备是指通过IoT对其进行远程或近程地控制和/或监测的电子设备。典型地,智能家电就属于典型的IoT设备。以家居场景为例,若电子设备A绑定某个IoT设备,并将该IoT设备接入到家庭网络中。此时,电子设备A拥有该IoT设备的操作权限。当电子设备B欲操作该IoT设备时,需要电子设备A先添加电子设备B为共享用户,然后授予电子设备B操作该IoT设备的权限。电子设备A可通过以下方式:电子设备A通过该IoT设备管理应用或其他应用的分享链接分享给电子设备B;或者,在电子设备A的主人登录该IoT设备管理应用后,扫描电子设备B的二维码,获取并绑定电子设备B在该IoT设备管理应用上的账号信息;或者,电子设备A的主人在登录该IoT设备管理应用后,人工输入电子设备B的主人在该IoT设备管理应用上的登录账号信息,甚至该登录账号信息对应的密码信息等,来授权电子设备B为被授权用户。不过,上述方式或存在着安全风险较高的问题,或存在着用户便利性较差的问题,没有兼顾安全性和便利性。为此,本申请提供一种IoT设备的授权方法、IoT设备及电子设备,能够在保证安全性的同时,进一步提供便利性,简化用户操作。
图1为本申请实施例提供的一种应用场景的系统架构图。如图1所示,第一电子设备100、第二电子设备200以及IoT设备300分别与一个或多个网络服务器400通信连接。第一电子设备100,绑定有IoT设备300,第一电子设备100可以控制IoT设备300执行相应操作,还可以授权其他电子设备控制IoT设备300等。第一电子设备100可称为IoT设备300的控制设备。在一些示例中,第一电子设备100可以先与IoT设备300建立有线或无线的本地连接,然后对IoT设备300进行配网,使得IoT设备300连接到服务器400。然后第一电子设备100可以通过服务器400向IoT设备300发送控制指令,以使得IoT设备300执行相应的操作。在另一些示例中,第一电子设备100可以先与IoT设备300建立有线或无线的本地连接,而后直接通过本地连接控制IoT设备300执行相应的操作。其中,第一电子设备100与IoT设备300之间建立的有线连接方式例如可以是通过数据线或光纤等连接,无线连接方式例如可以是蓝牙、WiFi、NFC、紫蜂(ZigBee)等。
第二电子设备200为待授权设备,即第二电子设备200在被授权前不能控制IoT设备300执行相应操作,在被授权后可以控制IoT设备300执行相应操作。第二电子设备200可称为IoT设备的共享控制设备。例如,IoT设备300为IoT灯,第二电子设备200被授权使用IoT设备300后,第二电子设备200可以接收用户的操作(比如触摸输入、语音输入等),并直接控制或通过服务器400控制IoT灯(比如开灯、关灯、调节灯的光强、色温等参数)。在一些示例中,第一电子设备100可以先添加第二电子设备200为共享成员,然后第一电子设备100可以授权第二电子设备200操作IoT设备300。在另一些示例中,第一电子设备100可以直接添加第二电子设备200为IoT设备的共享控制设备。
上述IoT设备300,可以为智能家居设备,包括移动终端、家用电器等。具体来说,IoT设备300可以为智能手机、智能音箱、智能冰箱、智能空调、智能洗衣机、智能机器人、智能门、智能窗、智能电视、智能灯、智能插座、智能空气净化器、智能加湿器、智能油烟机、智能锁、智能窗帘、智能插线板、智能电磁炉、智能摄像头等。
上述服务器400,在一些实施例中,可以为云服务器(如家居云服务器)等,也可以为多个服务器组成的服务器集群。服务器400存储有IoT设备300的控制信息,包括控制IoT设备300的控制设备的账号、IoT设备300的设备标识、控制IoT设备300的共享控制设备的账号、IoT设备300与控制设备的对应关系,以及IoT设备300与共享控制设备之间的对应关系等中的至少一项。这样,当服务器400接收到控制IoT设备300的控制指令后,可以基于存储的上述控制信息,确定发送控制指令的设备是否具备控制IoT设备300的权限。若发送控制指令的设备具备控制IoT设备300的权限,则向IoT设备300下发该控制指令。
表1为服务器400上存储的IoT设备300的信息列表的一种示例。由表1可知,IoT设备300的设备标识为设备ID1,IoT设备300的控制设备的标识为“账号A”,即账号A的电子设备与IoT设备300具有绑定关系,账号A的电子设备能够控制IoT设备300,以及授权其他电子设备控制IoT设备300。IoT设备300的共享控制设备的标识为“账号B”。即账号B的电子设备能够控制IoT设备300,但不能授权其他设备控制IoT设备300。当然,服务器400上还可以维护各个账号下的绑定的IoT设备的设备标识。
表1
IoT设备的设备标识 控制设备的标识 共享控制设备的标识
设备ID1 账号A 账号B
此外,在另一些示例中,服务器400可以为IoT设备300提供云服务。服务器400还可以与其他服务器(例如:内容提供服务器)进行通信,为IoT设备300提供多元化的服务。其中,内容提供服务器例如可以为天气服务器、音乐服务器、意图识别服务器、语音识别服务器等,那么服务器400可以通过内容提供服务器为IoT设备300提供诸如天气预报、音乐播放、语音识别等服务。
示例性的,第一电子设备100和第一控制设备200均可以为手机、平板电脑、个人计算机(Personal Computer,PC)、个人数字助理(personal digital assistant,PDA)、上网本、可穿戴设备(例如智能手表、智能手环)等,第一电子设备100与第二电子设备200的具体形式可以相同,也可以不同。本申请实施例对第一电子设备100和第二电子设备200的具体形式均不做限定。
图2为本申请实施例提供的一种电子设备的结构示意图。第一电子设备100的结构可以参考图2。如图2所示,第一电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。
可以理解的是,本发明实施例示意的结构并不构成对第一电子设备100的具体限定。在本申请另一些实施例中,第一电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。可以理解的是,本发明实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对第一电子设备100的结构限定。在本申请另一些实施例中,第一电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
第一电子设备100的无线通信功能可以通过天线、移动通信模块150,无线通信模块 160,调制解调处理器以及基带处理器等实现。
天线用于发射和接收电磁波信号。第一电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在第一电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。
无线通信模块160可以提供应用在第一电子设备100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线转为电磁波辐射出去。
在一些实施例中,第一电子设备100的天线和移动通信模块150耦合,天线和无线通信模块160耦合,使得第一电子设备100可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code division multiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。
第一电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为 图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,第一电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展第一电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。
第一电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。
第一电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
需要说明的是,第二电子设备200可以与第一电子设备100的结构相同;第二电子设备200也可以包括比第一电子设备100更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。
图3A为本申请实施例提供的一种IoT设备300的结构示意图。IoT设备300可以包括一个或多个处理器310、一个或多个存储器320、无线通信模块340以及一个或多个天线。其中,处理器310、存储器320和无线通信模块340通过总线连接。在一些实施例中,IoT设备300还可以包括一个或多个通信接口330;其中,通信接口330也通过总线与处理器310、存储器320和无线通信模块340连接。
处理器310可以包括微控制器(Microcontroller Unit,MCU)、特定应用集成电路(Application-Specific Integrated Circuit,ASIC),或者用于控制本申请方案程序执行的集成电路等。在一个示例中,处理器310也可以包括一个或多个MCU。这里的MCU可以指一个或多个设备、电路或用于处理数据(例如计算机程序指令)的处理核。
存储器320,可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。内部存储器可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统以及本申请实施例需要使用的程序或指令等。
通信接口330,可用于与其他设备或通信网络通信。例如,以太网,无线局域网(wireless local area networks,WLAN)等。在一些示例中,IoT设备300也可以不包括通信接口330,本申请实施例对此不做限定。
无线通信模块340可以提供应用在照明设备200上的包括WLAN(如Wi-Fi),蓝牙等无线通信的解决方案。无线通信模块340可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块340经由天线接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器310。无线通信模块340还可以从处理器310接收待发送的信号,对其进行调频,放大,经天线转为电磁波辐射出去。
在一些实施例中,如图3A所示,IoT设备300包括至少两个天线,例如天线1(第一天线,也称为强天线)和天线2(第二天线,也称为弱天线)。无线通信模块340可以在天线1和天线2之间进行切换。施加在天线1或天线2上的发射功率相同。其中,天线1的发射距离为第一距离。天线2的发射距离为第二距离。第二距离小于第一距离。例如,当无线通信模块340切换到天线1发送无线信号时,位于IoT设备300的第一距离(例如,第一距离为6m、8m、10m)内的无线设备可接收到该无线信号。当无线通信模块340切换到天线2发送无线信号时,位于IoT设备300的第二距离(例如,第二距离为30cm)范围内的无线设备可接收到该无线信号。第二距离小于等于预设的安全距离。预设的安全距离小于第一距离。第一距离、第二距离、预设的安全距离都可由用户根据需要自行调整设置。在一种实施方式中,第二距离可以为预设的安全距离。换言之,当IoT设备300需要发送超短距的无线信号时,可以控制无线通信模块340连接到天线2,以发送超短距的无线信号。当IoT设备300不需要发送超短距的无线信号时,可以控制无线通信模块340连接到天线1,以发送正常的无线信号。
在另一些实施例中,如图3B所示,IoT设备300可以包括可变电阻电路模块350和一个天线。可变电阻电路模块350可以在无线通信模块340的控制下改变电阻值的大小,从而改变同一天线的发射距离。也就是说,当可变电阻电路模块350的电阻值调整为电阻值1时,该天线的发射功率为第一发射功率(较高的发射功率),该天线的发射距离为第一距离。此时,位于IoT设备300的第一距离(例如,第一距离为6m、8m、10m)内的无线设备可接收到该无线信号。当可变电阻电路模块350的电阻值调整为电阻值2时,该天线的发射功率为第二发射功率(较低的发射功率),该天线的发射距离为第二距离。第二发射功率小于第一发射功率。第二距离小于等于预设的安全距离。预设的安全距离小于第一距离。第一距离、第二距离、预设的安全距离都可由用户根据需要自行调整设置。在一种实施方式中,第二距离可以为预设的安全距离。换言之,当IoT设备300需要发送超短距的无线信号时,可以控制可变电阻电路模块350的电阻值调整为电阻值2,以发送超短距的无线信号。当IoT设备300不需要发送超短距的无线信号时,可以控制可变电阻电路模块350的电阻值调整为电阻值1,以发送正常的无线信号。换句话说,在所述另一些实施例中,当可变电阻电路模块350的电阻值调整为电阻值1时,IoT设备300连接第一天线。当可变电阻电路模块350的电阻值调整为电阻值2时,IoT设备连接第二天线;其中,第一天线和第二天线相同,但第一天线的发射距离大于第二天线的发射距离;第二天线的发射距离小于等于预设的安全距离,第一天线的发射距离大于预设的安全距离。第一天线的发射距离和第二天线的发射距离分别为上述的第一距离和第二距离。
示例性的,上述无线通信模块340采用的无线通信方式具体可以采用如蓝牙低功耗(bluetooth low energy,BLE)、Wi-Fi感知(Wi-Fi aware)等方式。也就是说,在整个通信过程中,只采用一种无线通信方式,诸如Wi-Fi aware或者BLE。其中,该无线通信方式是基于计算机网络媒体访问控制(medium access control,MAC)层,又称为数据链路层协议扩展进行的交互,无需涉及到MAC层的上层网络通信,在数据链路层便可完整的实现数据交互。其中,BLE是由蓝牙特别兴趣小组于2016年推出的一种超低功耗的用于设备B的近距离无线通信方案,可通过MAC层实现通信。Wi-Fi Aware(Wi-Fi Neighborhood Aware Network,Wi-Fi邻居发现网络,又称为Wi-Fi Neighborhood Aware Network,简称NAN)是 一种新型的低功耗点对点互连互通的Wi-Fi Mesh通信技术,该技术能够绕开网络基础设施(如AP(Access Point,接入点)或蜂窝网),实现一对一、一对多或多对多的设备间的连接通信,同样可通过MAC层实现通信。可以理解地,涉及的计算机网络的层数越高,其安全性就越难保证。本实施例采用的基于无线的MAC层通信,能够让数据基于数据链路层协议扩展进行交互,可显著地提高IoT设备授权过程的安全性,有效保证IoT设备发送的IoT设备的标识、以及与IoT设备通信相关的协议信息、传输密钥等敏感信息。
综上,在本申请实施例中,IoT设备300具备超短距(very short distance)无线通信能力。即,其他设备只有在超短距离(例如30cm,20cm,10cm等)以内,才能接收到IoT设备300发送的超短距无线信号。那么,在真实的使用场景中,若某个设备能够接收到IoT设备300发送的超短距的无线信号,则说明该设备距离IoT设备300的位置很近,可以将能够接收到IoT设备300发送的超短距无线信号的距离称为安全距离。换言之,本申请实施例利用了超短距无线通信的安全距离,从物理上保证了IoT设备300与第二电子设备200通信的安全性。
下面结合附图对本申请实施例提供的技术方案进行详细说明。图4A为本申请实施例提供的一种IoT设备的授权方法的流程示意图。如图4A所示,第一电子设备为IoT设备的控制设备,该方法包括:
S401、第一电子设备接收到一个第一输入,第一输入用于指示为IoT设备添加共享控制设备。
可选地,第一输入可以为用户输入,也可以为诸如指令、命令等输入。在第一输入为用户输入时,第一输入为第一用户输入。
用户预先通过第一电子设备上的第一应用(例如“智慧生活”应用、IoT设备的应用等)对IoT设备进行配网操作。那么,第一电子设备是与IoT设备绑定的控制设备,具有控制IoT设备的权限,以及授权其他电子设备控制IoT设备的权限。也就是说,服务器登记了IoT设备与第一电子设备的绑定关系。
而后,如果需要使用其他电子设备控制该IoT设备,则需要通过第一电子设备为IoT设备添加共享的控制设备。换言之,当第一电子设备检测到第一用户输入,启动为IoT设备添加共享控制设备的流程。其中,在第一用户输入之前,可以存在一个或多个的输入,也可以不存在任何输入。
需要说明的是,本申请的实施例可以采用基于信任服务器的解决方案;即通过服务器认证鉴权以实现控制IoT设备的方案。也可以采用基于不信任服务器的解决方案,即通过端到端(即控制设备到IoT设备)认证鉴权的方案。
在服务器认证鉴权的方案中,IoT设备接收到服务器发送的控制指令后,不用验证该控制指令的发送端的身份(即是否为诸如第一电子设备的控制设备发送的),可以直接执行该控制指令。其中,服务器可以为云服务器,也可以为局域网服务器。
在端到端认证鉴权的方案中,IoT设备接收到服务器发送的控制指令后,可以验证该控制指令的发送端的身份(即是否为诸如第一电子设备的控制设备发送的)。在确定该控制指令的发送端为特定的控制设备(例如为第一电子设备)后,才执行该控制指令。具体地,第一电子设备在添加或绑定IoT设备时,预先在近端,例如基于口令认证的认证密钥交换协议(Password-authenticated key agreement,PAKE),与IoT设备交换长效公钥。长 效公钥就是长期有效的公钥。也就是说,第一电子设备保存有IoT设备的长效公钥。这样,后续第一电子设备可使用IoT设备的长效公钥对接收到的消息进行身份验证。若使用IoT设备的长效公钥验证身份通过,则可确定该消息为IoT设备发送的。即,IoT设备的长效公钥是IoT设备的一种身份凭证。IoT设备也保存有第一电子设备的长效公钥。类似的,第一电子设备的长效公钥是第一电子设备的一种身份凭证。这样,后续当某个电子设备控制IoT设备时,该电子设备发起与IoT设备的端到端(Station to Station,STS)协商,协商出共享密钥。IoT设备使用保存的长效公钥(第一电子设备的身份凭证)对该电子设备进行身份认证。若认证为第一电子设备,则IoT设备使用共享密钥对该电子设备发送的控制指令进行解密,并执行相应的控制指令。否则,IoT设备不执行该电子设备发送的控制指令。
其中,所述控制设备对所述IoT设备的权限大于所述共享控制设备对所述IoT设备的权限。
S402、第一电子设备通过服务器向IoT设备发送添加共享控制设备的第一消息。
第一电子设备下发的添加共享控制设备指令(即第一消息)包括第一电子设备的设备信息。第一电子设备的设备信息可以包括第一电子设备的标识。第一电子设备的标识包括但不限于第一电子设备的MAC地址、账号信息、用户昵称等。
在一种实施方式中,第一消息由第一电子设备发送至服务器;服务器在接收到后,再将该第一消息发送至IoT设备。
S403、IoT设备接收到添加共享控制设备的第一消息后,切换至第二天线。
可选地,IoT设备对接收到的消息进行验证,验证该消息是否为第一消息。具体地,IoT设备可预先设置有或预先从服务器接收有第一消息的特定标识;通过该特定标识来识别第一消息。
在S403中,在接收到服务器发送的添加共享控制设备的第一消息后,IoT设备切换到第二天线。即,IoT设备切换到发送超短距无线信号的模式。
S404、IoT设备随机生成会话密钥。
之后,IoT设备随机生成会话密钥,用于后续的加密解密。由于为随机生成,所以会话密钥在每次生成时,都不一样。IoT设备在随机生成会话密钥后,将其保存在本地。
可选地,保存在本地的会话密钥数量小于等于预设数量。若随机生成的会话密钥的数量大于预设数量,则在本地覆盖其他的已保存的会话密钥。
S405、IoT设备通过第二天线发送第二消息,第二消息包含会话密钥和IoT设备的设备信息。
IoT设备通过第二天线发送第二消息,第二消息包含会话密钥和IoT设备的设备信息。该第二消息也可称为添加共享控制设备的请求,该请求包含IoT设备的设备信息和会话密钥。例如,在IoT设备具备图3A所示的结构时,IoT设备控制无线通信模块340连接天线2。又例如,IoT设备具备图3B所示的结构时,IoT设备控制可变电阻电路模块350的电阻值为电阻值2(较大的电阻值),使得IoT设备的天线发射功率为第二发射功率(较低的发射功率)。
可选地,发送包括广播。
可选地,IoT设备的设备信息包括IoT设备的标识。IoT设备的标识可为IoT设备的唯 一标识。
进一步地,IoT设备的设备信息还包括传输参数。其中,传输参数包括但不限于连接协议(例如蓝牙协议、Wi-Fi协议等)、会话标识等。
可选地,第二消息还可以包含第一电子设备的标识。
进一步地,所述第一电子设备的标识可为第一电子设备的唯一标识。
可选地,IoT设备的标识包括IoT设备的身份凭证。
需要说明的是,S403和S404的顺序也可以互换,或者同时执行。本申请实施例对此不做限定。
在一种实施方式中,在IoT设备发送完第二消息后,IoT设备切换至第一天线。即在S405之后,执行S409。执行完S409,IoT设备切换回发送正常无线信号(非超短距无线信号)的模式。例如,IoT设备具备图3A所示的结构时,IoT设备控制无线通信模块340连接天线1。又例如,IoT设备具备图3B所示的结构时,IoT设备控制可变电阻电路模块350的电阻值为电阻值1(较小的电阻值),使得IoT设备的天线发射功率为第一发射功率(较高的发射功率)。
当然,S409也可以在其他步骤之后执行;例如在S408之后,即在接收到第二电子设备返回的第三消息之后执行。本申请实施例对此不做限定。
需要说明的是,本申请实施例是仅以IoT设备具备发送超短距无线信号能力为例进行说明的。即仅IoT设备具有图3A或图3B的结构,第一电子设备、第二电子设备均不具有图3A或图3B的结构。当然,若第二电子设备也具有图3A或图3B的结构,也可以使用第二天线发送第三消息,或者使用同一天线的较小发射功率发送第三消息。本申请实施例不做限定。
在一些示例中,IoT设备在接收到添加共享控制设备的第一消息后,或者在切换到第二天线后,或者在发送即第二消息后,可以显示信号灯(例如闪烁,或显示不同颜色等)或播放语音,以提示第二电子设备靠近IoT设备,从而使得第二电子设备在位于IoT设备的第二天线的发射距离内,接收到IoT设备发送的超短距无线信号。可替换地,或者进一步地,第一电子设备在接收到用户指示为IoT设备添加共享控制设备时,也可以采用其他方式(短信通知、电话通知、即时通信应用通知等)来通知第二电子设备靠近IoT设备。
在一种可替换的实施方式中,可以设置IoT设备发送第二消息的最大次数。例如,假设IoT设备发送第二消息的最大次数被预先设置为M次(M为大于等于1的正整数)。那么,IoT设备切换到发送超短距无线信号模式后,发送一次第二消息后,IoT设备切换到发送正常无线信号模式,准备接收第二电子设备返回的响应消息。若在预设时长内,IoT设备一直未接收到第二电子设备返回的响应消息,则IoT设备将初始值为0的i加1,且再次发送第二消息,准备接收第二电子设备返回的响应消息,并比较i与M的大小。若i小于M,则如此循环,直至在一次发送第二消息之后,接收到第二电子设备返回的响应消息;若i等于M,则IoT设备确定没有电子设备位于该IoT设备的安全距离内,IoT设备可以通过服务器向第一电子设备返回失败响应,即未在IoT设备的安全距离内接收到任何电子设备的响应,则IoT设备切换回第一天线。上述的响应消息,均为针对第二消息的响应消息。上述的第二电子设备仅为示意性举例。上述的预设时长可由具有权限的用户通过IoT设备或第一电子设备进行设置。
进一步地,若IoT设备在第P次(P为大于等于1,且小于等于M的正整数)发送第二消息后,在预设时长内接收到第二电子设备返回的响应消息,则不再发送第二消息。
S406、在第二天线的发射距离内,第二电子设备接收到第二消息。
S406中的第二天线为IoT设备的第二天线。即,在第二电子设备位于IoT设备的第二天线的发射距离内,第二电子设备接收到第二消息。IoT设备的第二天线的发射距离小于等于预设的安全距离。预设的安全距离可小于等于30cm的距离。预设的安全距离可由用户自行设置或调整。
进一步地,第二电子设备接收到第二消息后,显示相关的提示消息;该提示消息用于提示第二电子设备的用户,是否同意对该IoT设备进行共享控制,使得第二电子设备成为该IoT设备的共享控制设备。
S407、第二电子设备接收到一个第二输入,使用会话密钥加密第二电子设备的设备信息,并生成第三消息。
可选地,第二输入可以为用户输入,也可以为诸如指令、命令等输入。在第二输入为用户输入时,第二输入为第二用户输入。
在一种实施方式中,第二用户输入为确认输入,用于确认第二电子设备为IoT设备的共享控制设备。
在一些示例中,第二电子设备在接收到IoT设备发送的第二消息后,会采用例如文字提示、语音提示、图案提示和动画提示等方式中的至少一种方式,来提示或询问第二电子设备的用户是否愿意作为IoT设备的共享控制设备。第二用户输入可为第二电子设备的用户确认愿意将第二电子设备作为IoT设备的共享控制设备的输入。比如,第二电子设备的用户对特定控件的触摸输入,第二电子设备的用户的特定语音输入等。
其中,第二电子设备的设备信息,用于标识第二电子设备的身份。具体地,第二电子设备的设备信息可包括第二电子设备的标识。示例性地,第二电子设备的标识包括第二电子设备的MAC地址、用户登录的云账号、手机号和用户名等中的至少一项。
在一种实施方式中,第二电子设备从第二消息中获取到IoT设备的设备信息和会话密钥。
进一步地,第二电子设备从第二消息中还获取到传输参数。其中所述传输参数包括但不限于会话标识和传输协议等中的至少一项。第二电子设备使用会话密钥加密第二电子设备的标识生成第三消息。可选地,第二电子设备的标识可以为第二电子设备的唯一标识。
在一种实施方式中,第二电子设备的设备信息还包括第二电子设备的身份凭证。在IoT设备的标识包括IoT设备的身份凭证,且IoT设备的身份凭证通过第二消息发送至第二电子设备时,第二电子设备将第二电子设备的身份凭证发送给IoT设备。这是因为,第二消息包含IoT设备的身份凭证,意味着第一电子设备控制IoT设备时,是基于不信任服务器的解决方案。因此,在第二电子设备控制IoT设备之前,IoT设备与第二电子设备需要交互彼此的身份凭证。在这样的场景下,第二电子设备可以将自身的身份凭证携带在第三消息中一起发送给IoT设备,或者单独发送给IoT设备。
S408、第二电子设备向IoT设备发送第三消息。
具体地,第三消息包括但不限于第二电子设备的设备信息、会话密钥和IoT设备的设备信息等中的至少一项。
S409、IoT设备接收到第三消息后,切换至第一天线。
例如,IoT设备具备图3A所示的结构时,IoT设备控制无线通信模块340连接天线1。又例如,IoT设备具备图3B所示的结构时,IoT设备控制可变电阻电路模块350的电阻值为电阻值1(较小的电阻值),使得IoT设备的天线发射功率为第一发射功率(较高的发射功率)。此时,IoT设备的发射距离为第一距离,第一距离大于预设的安全距离。
在一种实施方式中,若IoT设备还接收到了第二电子设备的身份凭证,IoT设备保存第二电子设备的身份凭证。需要说明的是,IoT设备在配网过程中,也与第一电子设备交换了身份凭证,即IoT设备也保存有第一电子设备的身份凭证。那么,当IoT设备接收到的其他电子设备的控制指令时,可以使用第一电子设备的身份凭证和第二电子设备身份凭证对发送控制指令的电子设备进行身份验证。若验证为第一电子设备或者为第二电子设备,则身份验证通过,IoT设备执行该控制指令。否则,身份验证不通过,IoT设备不执行该控制指令。
S410、IoT设备将第四消息通过服务器发送给第一电子设备,第四消息包含第二电子设备的设备信息。
具体地,第四消息可采用加密的方式传输。加密的方式以及解密的方式预先设置在服务器和第一电子设备。
在一种实施方式中,第四消息由IoT设备发送至服务器;服务器在接收到后,再将该第四消息发送至第一电子设备。
S411、第一电子设备接收到第四消息后,获取到第二电子设备的设备信息。
具体地,第一电子设备可采用预先设置的解密方式来解密,从而基于第四消息,获取到第二电子设备的设备信息。
可选地,第一电子设备还可预先设置有加密方式。上述的加密方式、解密方式与IoT设备预先设置的加密方式、解密方式相同或相对应。
进一步地,上述的加密方式、解密方式可来自于云服务器。
S412、第一电子设备接收一个第三输入,第三输入用于确认将第二电子设备添加为IoT设备的共享控制设备。
可选地,第三输入可以为用户输入,也可以为诸如指令、命令等输入。在第三输入为用户输入时,第三输入为第三用户输入。
在一种实施方式中,第一电子设备接收到服务器转发的第四消息后,生成提示信息(例如语音提示、文字提示和图案提示等中的至少一项),询问第一电子设备的用户是否同意或确认将第二电子设备添加为IoT设备的共享控制设备。在第一电子设备接收到第三用户输入后,执行S413。
第三用户输入可为第一电子设备的用户确认同意将第二电子设备作为IoT设备的共享控制设备的输入。比如,第一电子设备的用户对特定控件的触摸输入,第一电子设备的用户的特定语音输入等。
S413、第一电子设备向服务器发送第五消息,第五消息包含第二电子设备的设备信息。
具体地,第五消息包括但不限于第二电子设备的设备信息、第一电子设备的设备信息和第三用户输入对应的信息等中的至少一项。
可选地,在S413之后,S414之前,服务器还可判断第三用户输入对应的信息为同意 还是不同意。若为同意,则执行S414;否则,不执行S414,而直接向IoT设备和第二电子设备分别发送添加共享控制设备失败的消息。
S414、服务器登记第二电子设备为IoT设备的共享控制设备的信息。
具体地,服务器根据第五消息,获取到第二电子设备的设备信息、IoT设备的设备信息、第一电子设备的设备信息等。
在一些实施例中,服务器登记第二电子设备为IoT设备的共享控制设备的信息后,服务器可以默认添加第一电子设备和第二电子设备互为共享设备,或者,服务器可以询问第一电子设备和第二电子设备是否添加彼此为共享设备,本申请对此不做限定。
S415、服务器向IoT设备发送成功将第二电子设备添加为共享控制设备的第六消息。
S416、服务器向第二电子设备发送成功将第二电子设备添加为共享控制设备的第六消息。
在服务器登记IoT设备与第二电子设备的共享控制关系后,分别向IoT设备和第二电子设备推送添加成功的第六消息。
其中,S415和S416可以先执行S415,后执行S416;也可以先执行S416,后执行S415;还可以同时执行。本申请实施例不限定S415和S416的执行顺序。
S417、IoT设备接收到第六消息后,提示第六消息。
在一种实施方式中,在IoT设备接收到第六消息后,显示第六消息的部分或全部文字、播放第六消息的语音等中的至少一项。
在另一种实施方式中,IoT设备可以只显示与第六消息相关的关键词、播放上述关键词的语音等中的至少一项。
S418、第二电子设备接收到第六消息后,提示第六消息。
在一种实施方式中,在第二电子设备接收到第六消息后,显示第六消息的部分或全部文字、播放第六消息的语音等中的至少一项。
在另一种实施方式中,第二电子设备可以只显示与第六消息相关的关键词、播放上述关键词的语音等中的至少一项。
可替换地,S415和S416、S417和S418并非都必需在本申请实施例提供的一种IoT设备的授权方法中。
在一种实施方式中,本方法可以只包含S417和S418中的一项。具体来说,本方法包含S401-S417,不包含S418;或者,本方法包含S401-S416和S418,不包含S417。
在一种实施方式中,本方法可以只包含S415和S416中的一项。具体来说,本方法包含S401-S415和S417,不包含S416和S418;或者,本方法包含S401-S414、S416和S418,不包含S415和S417。
在一种实施方式中,本方法可以不包含S415-S418,即包含S401-S414。
在一种实施方式中,本方法可以不包含S417-S418,即包含S401-S416。
在一种实施方式中,本方法可以不包含S416-S418,即包含S401-S415。
在一种实施方式中,本方法可以不包含S415、S417-S418,即包含S401-S414和S416。
在上述步骤中,IoT设备与第二电子设备之间都通过Wi-Fi感知通信;或者,在上述步骤中,IoT设备与第二电子设备之间都通过BLE通信。
可替换地,图4A中的S415-S418还可被替换为图4B中的S415'-S419'。具体来说,如 图4B所示,在图4A的S414之后,继续执行图4B的S415'-S430',不再执行图4A的S415-S418。具体如下:
S415'、服务器随机生成控制密钥。
S416'、服务器向IoT设备发送包含控制密钥的第六消息。
S417'、服务器向第二电子设备发送包含控制密钥的第六消息。
其中,S416'和S417'可以先执行S416',后执行S417';也可以先执行S417',后执行S416';还可以同时执行。本申请实施例不限定S416'和S417'的执行顺序。
S418'、IoT设备接收到第六消息后,获取到控制密钥。
S419'、第二电子设备接收到第六消息后,获取到控制密钥。
与S416'和S417'的执行顺序类似地,本申请实施例不限定S418'和S419'的执行顺序。
进一步地,S418'还包括提示第六消息。
进一步地,S419'还包括提示第六消息。
下面进一步阐明第二电子设备在被授权后,如何对IoT设备进行控制。具体来说,第二电子设备可以向IoT设备发送控制指令,用于控制IoT设备执行相应的操作。前文已说明,第二电子设备可以基于信任服务器的解决方案,或者基于不信任服务器的解决方案,对IoT设备执行控制。其中,基于信任服务器的解决方案和基于不信任服务器的解决方案均分别包括本地控制和远程控制两个具体方案,下面针对不同解决方案进行说明。
方案1、基于信任服务器的远程控制方案。
在方案1中,还需在S418后,执行以下步骤:第二电子设备向服务器发送针对IoT设备的控制指令;该控制指令包括第二电子设备的设备信息、IoT设备的标识以及具体的控制操作。服务器在接收到该控制指令后,对第二电子设备的身份进行鉴权。服务器鉴权通过后,向IoT设备转发该控制指令或向IoT设备发送具体的控制操作,IoT设备执行相应的操作。
在方案1中,鉴权和控制指令或具体的控制操作,都是通过服务器执行的;故方案1称为基于信任服务器的远程控制方案。
方案2、基于信任服务器的本地控制方案。
在方案2中,如图4C所示,在S419'之后,继续执行S420'-S430'。具体如下:
S420'、第二电子设备接收到一个第四输入。
可选地,第四输入可以为诸如用户输入的外部输入;也可以为诸如指令、命令等输入的内部输入。在第四输入为用户输入时,第四输入为第三用户输入。一种示例中,第四用户输入可以为触摸输入某个控件,或语音输入特定命令,用于使得第二电子设备执行相应的控制指令。
S421'、第二电子设备生成第一随机数。
第二电子设备生成第一随机数,并根据第一随机数生成第七消息。在一种实现方式中,第二电子设备对生成的第七消息进行加密。
S422'、第二电子设备向IoT设备发送包含第一随机数的第七消息。
S423'、IoT设备接收第七消息,获取到第一随机数。
S424'、IoT设备生成第二随机数;基于第一随机数、第二随机数和控制密钥,生成通信密钥。
IoT设备生成第二随机数,并根据第一随机数、第二随机数和控制密钥生成通信密钥。
S425'、IoT设备发送包含第二随机数的第八消息。
S426'、第二电子设备获取到第八消息,获取到第二随机数。
S427'、第二电子设备基于第一随机数、第二随机数和控制密钥,生成通信密钥。
此时,第二电子设备生成的通信密钥,与S424'中IoT设备生成的通信密钥相同。
S428'、第二电子设备向IoT设备发送通信密钥加密控制指令后的控制消息。
第二电子设备使用通信密钥加密控制指令,生成控制消息;之后,第二电子设备将该控制消息发送给IoT设备。
S429'、IoT设备接收到控制消息。
S430'、IoT设备使用通信密钥解密控制消息,获取到控制指令,并执行控制指令。
IoT设备使用S424'中IoT设备生成的通信密钥,解密该控制消息,获取到控制指令,并执行。
在方案2中,S425'中第八消息,可以通过IoT设备的第一天线或第二天线发送。
在方案2中,IoT设备和第二电子设备的控制密钥是从服务器接收到的;因此是信任服务器的,同时又是本地进行控制的,所以方案2称为基于信任服务器的本地控制方案。
方案3、基于不信任服务器的远程控制方案。
上文已说明,在S405和S408中,IoT设备与第二电子设备已交换彼此的身份凭证。后续,当第二电子设备根据输入,生成IoT设备的控制指令时,第二电子设备使用自身的身份凭证对控制指令进行加密,并通过服务器将加密后的控制指令发送给IoT设备。IoT设备利用已保存的第二电子设备的身份凭证进行解密,若解密成功,则执行相应的控制指令。
在方案3中,加密和解密分别在第二电子设备和IoT设备执行,不是在服务器执行的;只是在控制时,经过服务器来进行传输;因此方案3称为基于不信任服务器的远程控制方案。
方案4、基于不信任服务器的本地控制方案。
上文已说明,在S405和S408中,IoT设备与第二电子设备已交换彼此的身份凭证。后续,当第二电子设备根据输入,生成IoT设备的控制指令时,第二电子设备使用自身的身份凭证对控制指令进行加密,并直接将加密后的控制指令发送给IoT设备。IoT设备利用已保存的第二电子设备的身份凭证进行解密,若解密成功,则执行相应的控制指令。
在方案4中,加密和解密分别在第二电子设备和IoT设备执行,不是在服务器执行的;并且传输也不经过服务器;因此方案4称为基于不信任服务器的本地控制方案。
此外,在第二电子设备获得IoT设备的授权后,第一电子设备还可取消对第二电子设备的授权。也就是说,IoT设备的授权方法还包括取消授权的流程。以下结合图5A和图 5B,示例性地阐述取消授权的流程。
如图5A所示,该取消授权的流程具体包括:
S501、第一电子设备接收到一个输入。
可选地,该输入可以为诸如用户输入的外部输入;也可以为诸如指令、命令等输入的内部输入。在一种实施方式中,该用户输入用于触发第一电子设备发送取消共享控制设备的消息,该消息用于指示将第二电子设备不再设为IoT设备的共享控制设备。
S502、第一电子设备向服务器发送取消共享控制设备的消息。
可选地,取消共享控制设备的消息包括IoT设备的标识、第二电子设备的标识等。其中,第二电子设备的标识例如为第二电子设备的设备信息。
S503、服务器从登记的信息中删除第二电子设备为IoT设备的共享控制设备的信息。
S504a、服务器向IoT设备发送取消第二电子设备为IoT设备的共享控制设备的消息。
S504b、服务器向第二电子设备发送取消第二电子设备为IoT设备的共享控制设备的消息。
其中,S504a和S504b可以先执行S504a,后执行S504b;也可以先执行S504b,后执行S504a;还可以同时执行。本申请实施例不限定S504a和S504b的执行顺序。
S505、IoT设备接收到该消息后,删除对应的密钥,和/或删除第二电子设备的身份凭证。
其中,所述对应的密钥,可包括但不限于会话密钥、控制密钥和通信密钥中的至少一项。
S506、第二电子设备接收到该消息,删除对应的密钥,和/或删除IoT设备的身份凭证。
其中,所述对应的密钥,可包括但不限于会话密钥、控制密钥和通信密钥中的至少一项。
其中,S505和S504a对应,S506和S504b对应。图5A中的虚线框,表示该虚线框内的步骤可被替换。
可替换地,该取消授权的流程可以只包含S501-S503、S504a和S505,不包含S504b和S506;或者,只包含S501-S503、S504b和S506,不包含S504a和S505。
可替换地,该取消授权的流程可以只包含S501-S504a,不包含S504b、S505和S506。这种情况下,第二电子设备通过服务器向IoT设备发送控制消息,由于服务器从登记的信息中查询不到第二电子设备为IoT设备的共享控制设备的信息后,则向第二电子设备发送控制失败的响应消息;第二电子设备接收到响应消息后,删除对应的密钥,和/或删除IoT设备的身份凭证。
可替换地,在一种实施方式中,该取消授权的流程不包含图5A中的S504a、S504b、S505和S506,第二电子设备若要控制IoT设备,则需要向通过服务器发送控制消息,服务器从登记的信息中查询不到第二电子设备为IoT设备的共享控制设备的信息后,则向第二电子设备发送控制失败的响应消息;第二电子设备接收到响应消息后,删除对应的密钥,和/或删除IoT设备的身份凭证。
如图5B所示,该取消授权的流程具体包括:
S501'、第一电子设备接收到一个输入。
可选地,该输入可以为诸如用户输入的外部输入;也可以为诸如指令、命令等输入的 内部输入。在一种实施方式中,该用户输入用于触发第一电子设备发送取消共享控制设备的消息,该消息用于指示将第二电子设备不再设为IoT设备的共享控制设备。
S502'、第一电子设备向服务器发送取消共享控制设备的消息。
可选地,取消共享控制设备的消息包括IoT设备的标识、第二电子设备的标识等。其中,第二电子设备的标识例如为第二电子设备的设备信息。
S503'、服务器向IoT设备发送取消共享控制设备的消息。
S504'、IoT设备接收该消息后,删除对应的密钥,和/或删除第二电子设备的身份凭证。
其中,所述对应的密钥,可包括但不限于会话密钥、控制密钥和通信密钥中的至少一项。
S505'、第二电子设备向IoT设备发送控制消息。
具体地,该控制消息是使用对应的密钥,和/或第二电子设备身份凭证加密后的消息。
S506'、IoT设备接收到第二电子设备发送的控制消息。
S507'、IoT设备解密失败,向第二电子设备发送解密失败的响应消息。
S508'、第二电子设备接收到该响应消息后,删除对应的密钥,和/或IoT设备的身份凭证。
其中,所述对应的密钥,可包括但不限于会话密钥、控制密钥和通信密钥中的至少一项。
需要说明的是,上述的图5A对应的实施方式、图5B对应的实施方式以及相应的替换方式仅为示例性说明,并不用于限制本申请的范围。
下面对IoT设备授权中涉及的用户界面进行示例性介绍。
以第一电子设备为手机1、第二电子设备为手机2,手机1为智能音箱的控制设备,手机1授权手机2为该智能音箱的共享控制设备为例阐明。
如果需要使用手机2控制智能音箱,则需要通过手机1将手机2添加为该智能音箱的共享控制设备。例如,如图6A所示,响应于用户选择“共享设备”控件601,手机1显示如图6B所示的包含已绑定设备的列表的界面602。进一步地,响应于用户选中智能音箱控件603以及点击“确定”控件604,手机1向服务器发送为智能音箱添加共享控制设备的消息或指令。可选地,在添加手机2为该智能音箱添加共享控制设备的过程中,手机1可以显示如图6D所示的界面607,其中提示信息608用于提示正在为智能音箱添加共享控制设备。
又例如,如图6C所示,为手机1显示的“智慧生活”的应用的主界面605。该主界面605包含手机1已绑定的IoT设备的列表,并且显示有各个IoT设备对应的操作控件,例如“断开连接”、“添加共享控制设备”等(还可包含“取消共享控制设备”控件,图中未示出)。响应于“添加共享控制设备”控件606被触摸,手机1向服务器发送为智能音箱添加共享控制设备的消息或指令。可选地,在添加手机2为该智能音箱添加共享控制设备的过程中,手机1可以显示如图6D所示的界面607,其中提示信息608用于提示正在为智能音箱添加共享控制设备。
之后,手机1启动为“智能音箱”添加共享控制设备的流程,即执行上述的IoT设备授权方法中第一电子设备执行的流程。比如,以图4A为例,即执行图4A中的S402-S406。
手机2在接收到添加第二消息后,从中获取到手机1的设备信息、智能音箱的设备信息等,并生成提示信息。如图7所示,为手机2显示的提示界面701。响应于检测到“同意”控件702被触摸,手机2向智能音箱返回手机2的设备信息,即执行上述的IoT设备授权方法中第二电子设备执行的流程。比如,以图4A为例,即执行S408-S411。响应于检测到“不同意”控件703被触摸,手机2不向智能音箱返回手机2的设备信息,或者向智能音箱返回拒绝控制该智能音箱,添加共享控制设备的流程结束。
进一步地,手机1接收到手机2的设备信息后,手机1可以显示如图8所示的提示界面801。响应于检测到“同意”控件802被触摸,手机1向服务器发送添加手机2为智能音箱的共享控制设备的消息或指令。之后,手机1继续执行上述的IoT设备授权方法中第一电子设备对应的流程。比如,以图4A为例,执行S413以及之后的步骤。响应于检测到“不同意”控件803被触摸,手机1向服务器发送拒绝添加手机2为智能音箱的共享控制设备的消息或指令,添加共享控制设备的流程结束。
进一步地,服务器登记手机2为智能音箱的共享控制设备后,服务器可以默认添加手机1和手机2互为共享设备,或者,服务器可以询问手机1和手机2是否添加彼此为共享设备。
例如,如图9A所示,为手机1显示的一个界面901。响应于“我的共享”控件902被触摸,手机1显示如图9B所示的界面903。用户可以通过界面903查看手机2以及共享的IoT设备。例如,“我共享的”下显示有新添加的共享信息904,共享信息包括手机2的设备信息,以及手机1与手机2共享的IoT设备的数量。响应于“设备共享1”触摸,可以查看到手机1与手机2共享的IoT设备的设备信息。相应地,在手机2中,“我接收的”中显示有手机1的设备信息,以及共享的IoT设备的设备信息等(图中未示出)。此外,用户还可以通过“添加共享成员”控件905、以及“添加共享控制设备”控件906添加新的共享成员或IoT设备。
响应于共享信息904被触摸,手机1可以显示如图9C所示的界面907。界面907包括有手机1的共享设备的设备信息。例如智能音箱的设备信息以及手机2的设备信息等。界面907还包括“删除”控件908,用于将手机2从该智能音箱的共享控制设备中删除。例如,响应于“删除”控件908被触摸,手机1启动将手机2从该智能音箱的共享控制设备中删除的流程。比如,图5A中,执行步骤S502以及之后的步骤。可选地,界面907还可以包括添加共享控制设备控件909,用于继续为智能音箱添加其他的共享控制设备。
另外,在一些示例中,第一电子设备可以在指示在将第二电子设备添加为IoT设备的共享控制设备时,指定共享控制设备的临时控制时长和/或临时控制次数。在又一些示例中,第二电子设备可以在确认被添加为IoT设备的共享控制设备时,确认或指定临时控制时长和/或临时控制次数。在另一些示例中,在第一电子设备获取到第二电子设备的设备信息后,第一电子设备在确认添加第二电子设备为IoT设备的共享控制设备时,确认或指定临时控制时长和/或临时控制次数。
在本申请的一些实施例中,第一电子设备也可以指定第二电子设备控制IoT设备的临时控制时长和/或临时控制次数。也就是说,第一电子设备控制第二电子设备控制IoT设备的时效性。图10A为本申请实施例提供的一种IoT设备授权的方法流程图。如图10A所示, 该方法包括:
S1001、第一电子设备接收到一个第一输入。
可选地,第一输入可以为诸如用户输入的外部输入;也可以为诸如指令、命令等输入的内部输入。在一种实施方式中,该用户输入用于触发第一电子设备发送包含临时控制时长和/或临时控制次数的第一消息,该第一消息用于指示将第二电子设备临时添加为IoT设备的共享控制设备。
例如,如图11A所示,为手机1显示的添加共享控制设备的界面1101。响应于检测到“添加共享控制设备”控件1102被触摸,手机显示如图11B所示的界面1103,界面1103包括设置共享控制的共享控制的时效控件1104。用户可以选择共享控制设备控制IoT设备的总次数,例如1次、5次。用户可以选择共享控制设备控制IoT设备的时长,例如1个月、一周、一天等。
S1002、第一电子设备通过服务器向IoT设备发送包含临时控制时长和/或临时控制次数的第一消息,第一消息用于临时添加共享控制设备。
S1003、IoT设备接收到添加共享控制设备的第一消息后,切换至第二天线。
S1004、IoT设备随机生成会话密钥。
S1005、IoT设备通过第二天线发送第二消息,第二消息包含IoT设备的设备信息、会话密钥和临时控制时长和/或临时控制次数。
可选地,发送包括广播。
S1006、在第二天线的发射距离内,第二电子设备接收到第二消息。
S1007、第二电子设备接收到一个第二用户输入,使用会话密钥加密第二电子设备的设备信息,生成第三消息。
S1008、第二电子设备向IoT设备发送第三消息。
S1009、IoT设备接收到第三消息后,切换至第一天线。
S1010、IoT设备将第四消息通过服务器发送给第一电子设备,第四消息包含第二电子设备的设备信息。
S1011、第一电子设备接收到第四消息后,获取到第二电子设备的设备信息。
S1012、第一电子设备接收一个第三输入。
可选地,第三输入可以为诸如用户输入的外部输入;也可以为诸如指令、命令等输入的内部输入。在一种实施方式中,该用户输入用于触发第一电子设备发送第五消息,该第五消息用于指示将第二电子设备临时添加为IoT设备的共享控制设备。
在一种实施方式中,第一电子设备接收到服务器转发的第四消息后,生成并显示提示信息(例如语音提示、文字提示和图案提示等中的至少一项),询问第一电子设备的用户是否同意或确认将第二电子设备添加为IoT设备的具有临时控制时长和/或临时控制次数的共享控制设备。在第一电子设备接收到第三用户输入后,执行S1013。第三用户输入可为第一电子设备的用户对特定控件的触摸输入、第一电子设备的用户的特定语音输入等。
S1013、第一电子设备向服务器发送第五消息,第五消息包含第二电子设备的设备信息和临时控制时长和/或临时控制次数。
在一种可替换的示例中,服务器在S1002时已经保存有临时控制时长和/或临时控制次数;在执行S1013时,第五消息中也可以不携带临时控制时长和/或临时控制次数。
S1014、在接收到第五消息后,服务器登记第二电子设备为IoT设备的共享控制设备,并记录临时控制时长和/或临时控制次数。
S1015、服务器确定是否达到临时控制时长和/或临时控制次数。
可选地,在临时控制时长和临时控制次数的前提下,以先到期者为准。以下相同,不再赘述。
S1016、在达到临时控制时长和/或临时控制次数后,服务器从IoT设备的共享控制设备的账号信息中删除第二电子设备的设备信息。
可替换地,在达到临时控制时长和/或临时控制次数后,服务器设置第二电子设备不能再控制IoT设备。直至服务器接收到新的第五消息。
在S1014-S1016中,服务器在添加第二电子设备为IoT设备的共享控制设备后,记录监控第二电子设备的临时控制时长和/或临时控制次数是否到期。例如,服务器在添加第二电子设备为IoT设备的具有临时控制时长和/或临时控制次数的共享控制设备后,开始统计时长或统计第二电子设备控制IoT设备的次数,从而确定第二电子设备的临时控制时长和/或临时控制次数是否到期。在第二电子设备的临时控制时长和/或临时控制次数到期后,服务器从IoT设备的共享控制设备的账号信息中删除第二电子设备的设备信息。可选的,服务器向第一电子设备和第二电子设备分别发送取消通知。
在S1016后,相关内容可参考上述图5A和图5B中对应内容的说明,此处不再赘述。
在没有特别说明的情况下,上述S1001-S1014中的相关内容,与S401-S414中的相关内容相同,此处不再赘述。
在一些实施例中,也可以由IoT设备监控第二电子设备的临时控制时长和/或临时控制次数。示例性的,下面结合图10B和图10C来分别阐明具体流程。
如图10B所示,一种IoT设备授权的方法包括:S1001'-S1022';其中,S1001'-S1013'的相关内容与S1001-S1013的相关内容相同;此处不再描述。
S1014'、服务器接收到第五消息,获取到第二电子设备的设备信息,以及生成控制密钥。
S1015'、服务器发送包含临时控制时长和/或临时控制次数、及控制密钥的第六消息。
S1016'、服务器向第二电子设备发送包含临时控制时长和/或临时控制次数、及控制密钥的第六消息。
需要说明的是,本申请实施例并不限定S1015'和S1016'的执行顺序。
S1017'、IoT设备接收到第六消息,获取到控制密钥、临时控制时长和/或临时控制次数。
S1018'、第二电子设备接收到第六消息,获取到控制密钥、临时控制时长和/或临时控制次数。
需要说明的是,本申请实施例并不限定S1017'和S1018'的执行顺序。
S1019'、IoT设备确定是否达到临时控制时长和/或临时控制次数。
S1020'、若确定达到临时控制时长和/或临时控制次数,IoT设备删除控制密钥。
S1021'、IoT设备向第二电子设备发送第七消息,用于告知添加失效。
S1022'、第二电子设备接收到第七消息后,删除控制密钥。
如图10C所示,一种IoT设备授权的方法包括:S1001”-S1024”。其中,S1001”-S1013”的相关内容与S1001-S1013的相关内容相同;S1014”-S1020”的相关内容与S1014'-S1020'的相关内容相同;此处不再描述。
S1021”、第二电子设备向IoT设备发送使用控制密钥加密后的控制消息。
S1022”、IoT设备接收到控制消息。
S1023”、IoT设备向第二电子设备发送控制密钥已过期的响应消息。
在一种可替换的实施方式中,IoT设备向第二电子设备发送控制密钥已过期的响应消息,或者解密失败的响应消息,或者拒绝执行控制指令的响应消息,或者第二电子设备控制身份失败的响应消息。
S1024”、第二电子设备接收到响应消息,删除控制密钥。
此外,还可提供一种简化的IoT设备授权方法。下面结合图12A和图12B来分别阐明具体流程。如图12A所示,一种IoT设备授权的方法包括:
S1201、第一电子设备接收到一个第一输入。
可选地,第一输入可以为诸如用户输入的外部输入;也可以为诸如指令、命令等输入的内部输入。在一种实施方式中,该用户输入用于触发第一电子设备发送第一消息,该第一消息用于指示将第二电子设备添加为IoT设备的共享控制设备。
S1202、第一电子设备通过服务器向IoT设备发送添加共享控制设备的第一消息。
在一种实施方式中,第一消息由第一电子设备发送至服务器;服务器在接收到后,再将该第一消息发送至IoT设备。
S1203、IoT设备接收到添加共享控制设备的第一消息后,切换至第二天线。
S1204、IoT设备随机生成会话密钥。
S1205、IoT设备通过第二天线,发送包含IoT设备的设备信息和会话密钥的第二消息。
可选地,发送包括广播。
S1206、在第二天线的发射距离内,第二电子设备接收到第二消息。
S1207、第二电子设备接收到一个第二输入,使用会话密钥加密第二电子设备的设备信息,生成第三消息。
S1208、第二电子设备向IoT设备发送第三消息。
其中,上述S1201-S1208的具体内容可参见S401-S408中相关内容的描述;此处不再赘述。
S1209、IoT设备接收到第三消息后,将第二电子设备的设备信息添加至IoT设备的共享控制设备账号信息中,并切换至第一天线。
也就是说,IoT设备在本地维护其控制设备以及共享控制设备的账号信息。
S1210、IoT设备通过服务器向第一电子设备发送第四消息,第四消息包含第二电子设备的设备信息,第四消息用于告知第二电子设备添加成功。
S1211、IoT设备向第二电子设备发送第四消息,第四消息用于告知第二电子设备添加成功。
本申请实施例不限定S1210和S1211的先后顺序。
S1212、第一电子设备接收到第四消息,提示第二电子设备添加成功。
S1213、第二电子设备接收到第四消息,提示第二电子设备添加成功。
本申请实施例不限定S1212和S1213的执行顺序。
在未有特别说明的情况下,S1201-S1208的具体内容与S401-S408的具体内容相同,此处不再赘述。
如图12B所示,一种IoT设备授权的方法包括:
S1201'、第一电子设备接收到一个第一输入。
可选地,第一输入可以为诸如用户输入的外部输入;也可以为诸如指令、命令等输入的内部输入。在一种实施方式中,该用户输入用于触发第一电子设备发送包含临时控制时长和/或临时控制次数的第一消息,该第一消息用于指示将第二电子设备临时添加为IoT设备的共享控制设备。
S1202'、第一电子设备通过服务器向IoT设备发送包含临时控制时长和/或临时控制次数的第一消息,第一消息用于临时添加IoT设备的共享控制设备。
S1203'、IoT设备接收到第一消息后,切换至第二天线。
S1204'、IoT设备随机生成会话密钥。
S1205'、IoT设备通过第二天线,发送包含IoT设备的设备信息、会话密钥、临时控制时长和/或临时控制次数的第二消息。
可选地,发送包括广播。
S1206'、在第二天线的发射距离内,第二电子设备接收到第二消息。
S1207'、第二电子设备接收到一个第二输入,使用会话密钥加密第二电子设备的设备信息,生成第三消息。
S1208'、第二电子设备向IoT设备发送第三消息。
S1209'、IoT设备接收到第三消息后,将第二电子设备的设备信息添加至IoT设备的共享控制设备账号信息,切换到第一天线。
也就是说,IoT设备本地维护有其控制设备以及共享控制设备的账号信息。
S1210'、IoT设备通过服务器向第一电子设备发送第四消息,第四消息包含第二电子设备的设备信息,第四消息用于告知添加成功。
S1211'、IoT设备向第二电子设备发送第四消息,第四消息用于告知添加成功。
S1212'、第一电子设备接收到第四消息,提示第二电子设备添加成功。
具体地,可以显示第二电子设备添加成功的消息,和/或播放第二电子设备添加成功的语音。
S1213'、第二电子设备接收到第四消息,提示第二电子设备添加成功。
具体地,可以显示第二电子设备添加成功的消息,和/或播放第二电子设备添加成功的语音。
S1214'、IoT设备确定是否达到临时控制时长和/或临时控制次数。
S1215'、若达到临时控制时长和/或临时控制次数,IoT设备向第二电子设备发送第五消息,告知添加失效。
S1216'、若达到临时控制时长和/或临时控制次数,IoT设备通过服务器向第一电子设 备发送第五消息,告知添加失效。
在未有特别说明的情况下,S1201'-S1208'的具体内容与S1201-S1208的具体内容相同,S1209'-S1213'的具体内容分别与S1209-S1213的具体内容相同,此处不再赘述。
在上述实施例中,是以第一电子设备为一个IoT设备添加共享控制设备为例说明的。在本申请的又一些实施例中,第一电子设备也可以为多个IoT设备添加共享控制设备。这里对为一个IoT设备添加共享控制设备,与对多个IoT设备添加共享控制的区别进行说明。
首先,第一电子设备接收到用户指示为多个IoT设备添加共享控制设备的用户输入。例如,如图13所示,用户在为IoT设备添加共享控制设备时,可以选择R个IoT设备(例如,“智能音箱”和“智能灯”),R大于等于1的正整数。
在一些示例中,第一电子设备可以通过服务器向该R个IoT设备发送添加共享控制设备的消息或指令。可选地,服务器也可以从R个IoT设备中选择S个IoT设备;其中S为大于等于1,且小于等于R的正整数。服务器向该S个IoT设备发送添加共享控制设备的消息或指令。此时,添加共享控制设备的消息或指令包括多个IoT设备的设备信息。那么,这R个或S个IoT设备接收到添加共享控制设备的消息或指令后,切换到第二天线,并发送添加共享控制设备的请求。可选地,发送包括广播。此时,该请求包括R个IoT设备或S个IoT设备的信息。当任一IoT设备接收到第二电子设备发送的响应后,可以从响应中获取第二电子设备的标识,该IoT设备将第二电子设备的标识通过服务器转发给第一电子设备。第一电子设备接收到确认添加第二电子设备为共享的控制设备的输入后,指示服务器将第二电子设备添加为上述R个IoT设备(例如,“智能音箱”和“智能灯”)或S个IoT设备的共享控制设备,从而实现用户一次操作实现为多个IoT设备添加共享的控制设备。即为多个IoT设备批量添加共享控制设备。
在本申请的又一些实施例中,第一电子设备也可以先将第二电子设备添加为R个IoT设备中的任一个IoT设备的共享控制设备。然后,服务器自动将第二电子设备添加为第一电子设备的共享控制设备。然后,第一电子设备可以将第二电子设备指定为其他IoT设备的共享控制设备,即将第二电子设备指定为其他R-1个IoT设备的共享控制设备。
需要说明的是,若IoT设备采用基于不信任服务器的解决方案时,R个IoT设备还需要与第二电子设备交换身份凭证。例如,第二电子设备将自身的身份凭证发送给发送超短距无线信号的IoT设备后,该IoT设备可以将第二电子设备的身份凭证转发给第一电子设备或者其他中转设备(例如,R个IoT设备共同连接的路由器)。而后,第一电子设备或者该中转设备可以将第二电子设备的身份凭证转发给其余R-1个IoT设备。由于第一电子设备上存储有R个IoT设备的身份凭证,第一电子设备可以通过服务器或者中转设备将R-1个IoT设备的身份凭证发送给第二电子设备。本申请实施例对IoT设备与第二电子设备交换身份凭证的方法不做限定。
在本申请的又一些实施例中,第一电子设备也可以为一个IoT设备添加多个共享控制设备。那么,在IoT设备切换到第一天线时,若在预设的时间段内接收到至少两个第二电子设备的设备信息。则可以将至少两个第二电子设备的设备信息的全部或部分通过服务器返回给第一电子设备。当第一电子设备确认后,服务器可以为一个IoT设备同时添加至少两个的共享控制设备。
以下,给出一些具体的应用场景的举例。
例如,用户A的手机绑定了家里的智能电视(IoT设备的举例)。即用户A的手机为智能电视的控制设备。当用户A不在家时,用户B来到用户A的家中,用户B想要控制智能电视。那么,用户A可以远程授权用户B的手机控制智能电视的权限。具体地,用户A通过手机将用户B的手机添加为智能电视的共享控制设备。具体的流程,请参见上述实施例中的相关流程,此处不再赘述。可选地,用户A的手机也可以授予用户B的手机临时控制智能电视的权限,即设置临时控制时长和/或临时控制次数。例如,用户A的手机授权用户B的手机控制智能电视2个小时。
又例如,用户A的手机绑定了家里的智能门锁。即用户A的手机为智能门锁的控制设备。当用户A不在家时,用户C需要开启智能门锁。那么,用户A可以远程授权用户C的手机控制智能门锁的权限。例如,授权用户C的手机控制智能门锁的权限,且仅能控制智能门锁一次或多次;或者,授权用户C的手机控制智能门锁的权限,且仅能控制智能门锁两个小时。
可见,控制设备(比如,用户A的手机)可以远程地为IoT设备(比如,智能电视或智能门锁)添加共享控制设备,并且IoT设备与共享控制设备(比如,用户B的手机或用户C的手机)通过安全距离保证通信安全。还可以注意到,在授权的过程中,控制设备侧的用户操作,以及共享控制设备侧的用户操作均较为简单。
在没有特别说明的情况下,本申请所有实施例的各个步骤或各个特征均可以与其他实施例的各个步骤或各个特征自由组合。
本申请实施例还提供一种芯片系统,如图14所示,该芯片系统包括至少一个处理器1401和至少一个接口电路1402。处理器1401和接口电路1402可通过线路互联。例如,接口电路1402可用于从其它装置(例如IoT设备300的存储器)接收信号。又例如,接口电路1402可用于向其它装置(例如处理器1401)发送信号。示例性的,接口电路1402可读取存储器中存储的指令,并将该指令发送给处理器1401。当所述指令被处理器1401执行时,可使得芯片系统执行上述实施例中的IoT设备执行的各个步骤。当然,该芯片系统还可以包含其他分立器件,本申请实施例对此不作具体限定。
本申请实施例还提供一种装置,该装置包含在电子设备中,该装置具有实现上述实施例中任一方法中电子设备行为的功能。该功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。硬件或软件包括至少一个与上述功能相对应的模块或单元。例如,检测模块或单元、显示模块或单元、确定模块或单元、以及计算模块或单元等。
本申请实施例还提供一种计算机存储介质,包括计算机指令,当计算机指令在电子设备上运行时,使得电子设备执行如上述实施例中任一方法。
本申请实施例还提供一种计算机程序产品,当计算机程序产品在计算机上运行时,使得计算机执行如上述实施例中任一方法。
本申请实施例还提供一种电子设备上的图形用户界面,所述电子设备具有显示屏、摄像头、存储器、以及一个或多个处理器,所述一个或多个处理器用于执行存储在所述存储器中的一个或多个计算机程序,所述图形用户界面包括所述电子设备执行如上述实施例中任一方法时显示的图形用户界面。
可以理解的是,上述终端等为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本申请实施例能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明实施例的范围。
本申请实施例可以根据上述方法示例对上述终端等进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。需要说明的是,本发明实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请实施例中各个实施例的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:快闪存储器、移动硬盘、只读存储器、随机存取存储器、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (34)

  1. 一种IoT设备,所述IoT设备与第一电子设备和第二电子设备无线通信,所述第一电子设备为所述IoT设备的控制设备,所述第二电子设备不同于所述第一电子设备;其特征在于,所述IoT设备包括:
    一个或多个处理器;
    一个或多个存储器;
    一个第一天线;
    一个第二天线,所述第二天线的发射距离小于等于预设的安全发射距离;其中,所述第一天线和所述第二天线为不同的天线,第二天线发射无线信号的发射距离小于第一天线发射无线信号的发射距离;或者,所述第一天线和所述第二天线为同一天线,且所述第二天线配置的发射功率小于所述第一天线配置的发射功率;
    以及一个或多个计算机程序,其中所述一个或多个计算机程序存储在所述一个或多个存储器上,当所述计算机程序被所述一个或多个处理器执行时,使得所述IoT设备执行以下步骤:
    接收到所述第一电子设备的第一消息;其中,所述第一消息用于指示为所述IoT设备添加共享控制设备;
    响应于所述第一消息,所述IoT设备切换至所述第二天线,并通过所述第二天线发送第二消息;其中,所述第二消息包括所述IoT设备的设备信息;
    接收到第二电子设备发送的第三消息;其中,所述第三消息包括所述第二电子设备的设备信息;
    响应于所述第三消息,切换至所述第一天线,并通过所述第一天线向所述第一电子设备发送第四消息;其中,所述第四消息包括所述第二电子设备的设备信息;所述控制设备对所述IoT设备的权限大于所述共享控制设备对所述IoT设备的权限。
  2. 根据权利要求1所述的IoT设备,其特征在于,所述IoT设备还执行以下步骤:
    在通过所述第一天线向所述第一电子设备发送第四消息之后,接收到成功添加消息,所述成功添加消息用于指示已将所述第二电子设备添加为所述IoT设备的共享控制设备。
  3. 根据权利要求1所述的IoT设备,其特征在于,所述第一消息还包括所述第二电子设备对所述IoT设备的临时控制时长或临时控制次数;
    在通过所述第一天线向所述第一电子设备发送第四消息之后,接收到一个消息;其中,所述消息包括所述第二电子设备对应的密钥和所述第二电子设备的身份凭证中的至少一项;所述第二电子设备对应的密钥和所述第二电子设备的身份凭证,用于所述第二电子设备对所述IoT设备的控制;
    在所述临时控制时长或所述临时控制次数达到后,所述IoT设备删除所述第二电子设备对应的密钥和所述第二电子设备的身份凭证中的至少一项。
  4. 根据权利要求1所述的IoT设备,其特征在于,所述IoT设备还执行以下步骤:
    在通过所述第一天线向所述第一电子设备发送第四消息之后,接收到一个消息;所述消息包含随机生成的控制密钥;
    响应于所述包含随机生成的控制密钥的消息,获取到所述控制密钥;所述第二电子设备对应的密钥包括所述控制密钥。
  5. 根据权利要求4所述的IoT设备,其特征在于,所述IoT设备还执行以下步骤:
    接收到包含第一随机数的消息;
    响应于所述包含第一随机数的消息,随机生成第二随机数;
    基于所述第一随机数、所述第二随机数和所述控制密钥,生成通信密钥,并向所述第二电子设备发送包含所述第二随机数的消息;
    接收到所述第二电子设备的控制消息;
    响应于所述控制消息,基于所述通信密钥解密所述控制消息,获取到控制指令,并执行所述控制指令;所述第二电子设备对应的密钥包括所述通信密钥。
  6. 根据权利要求2所述的IoT设备,其特征在于,所述IoT设备还执行以下步骤:
    在接收到所述成功添加消息后,所述IoT设备获取到所述第二电子设备对应的密钥和所述第二电子设备的身份凭证中的至少一项;所述第二电子设备对应的密钥和所述第二电子设备的身份凭证,用于所述第二电子设备对所述IoT设备的控制。
  7. 根据权利要求6所述的IoT设备,其特征在于,所述IoT设备还执行以下步骤:
    接收到所述第一电子设备的取消消息;其中,所述取消消息用于指示取消对第二电子设备的授权;
    响应于所述取消消息,所述IoT设备删除所述第二电子设备对应的密钥和所述第二电子设备的身份凭证中的至少一项。
  8. 根据权利要求1-7中任意一项所述的IoT设备,其特征在于,所述第二消息还包括会话密钥,所述会话密钥是所述IoT设备随机生成的;所述第三消息为所述第二电子设备针对所述第二消息的响应消息;所述第二电子设备对应的密钥包括所述会话密钥、所述控制密钥和所述通信密钥中的至少一项;
    所述接收到第一电子设备的第一消息,包括:经所述一个或多个服务器,接收到所述第一电子设备的第一消息;
    所述通过所述第一天线向所述第一电子设备发送第四消息,包括:通过所述第一天线,经所述一个或多个服务器,向所述第一电子设备发送第四消息。
  9. 一种IoT设备,所述IoT设备与第一电子设备和第二电子设备无线通信,所述第一电子设备为所述IoT设备的控制设备,所述第二电子设备不同于所述第一电子设备;其特征在于,所述IoT设备包括:
    一个或多个处理器;
    一个或多个存储器;
    一个第一天线;
    一个第二天线,所述第二天线的发射距离小于等于预设的安全发射距离;其中,所述第一天线和所述第二天线为不同的天线,第二天线发射无线信号的发射距离小于第一天线发射无线信号的发射距离;或者,所述第一天线和所述第二天线为同一天线,且所述第二天线配置的发射功率小于所述第一天线配置的发射功率;
    以及一个或多个计算机程序,其中所述一个或多个计算机程序存储在所述一个或多个存储器上,当所述计算机程序被所述一个或多个处理器执行时,使得所述IoT设备执行以下步骤:
    接收到所述第一电子设备的第一消息;其中,所述第一消息用于指示为所述IoT设备 添加共享控制设备;
    响应于所述第一消息,所述IoT设备切换至所述第二天线,并通过所述第二天线发送第二消息;其中,所述第二消息包括所述IoT设备的设备信息;
    接收到第二电子设备发送的第三消息;其中,所述第三消息包括所述第二电子设备的设备信息;
    响应于所述第三消息,将所述第二电子设备的设备信息添加至所述IoT设备的共享控制设备的设备信息中,并切换至所述第一天线;其中,所述控制设备对所述IoT设备的权限大于所述共享控制设备对所述IoT设备的权限。
  10. 根据权利要求9所述的IoT设备,其特征在于,所述IoT设备还执行以下步骤:所述第一消息还包括所述第二电子设备对所述IoT设备的临时控制时长或临时控制次数;
    在所述临时控制时长或所述临时控制次数达到后,所述IoT设备向所述第二电子设备和所述第一电子设备中的至少一个,发送添加失效的消息。
  11. 根据权利要求10所述的IoT设备,其特征在于,
    所述接收到第一电子设备的第一消息,包括:经所述一个或多个服务器,接收到所述第一电子设备的第一消息;
    所述IoT设备向所述第一电子设备发送添加失效的消息,包括:所述IoT设备经一个或多个服务器向所述第一电子设备发送添加失效的消息。
  12. 一种IoT设备授权方法,应用于所述IoT设备,所述IoT设备与第一电子设备和第二电子设备无线通信,所述第一电子设备为所述IoT设备的控制设备,所述第二电子设备不同于所述第一电子设备;其特征在于,所述IoT设备包括一个第一天线和一个第二天线,所述第二天线的发射距离小于等于预设的安全发射距离;其中,所述第一天线和所述第二天线为不同的天线,第二天线发射无线信号的发射距离小于第一天线发射无线信号的发射距离;或者,所述第一天线和所述第二天线为同一天线,且所述第二天线配置的发射功率小于所述第一天线配置的发射功率;
    所述方法包括:
    所述IoT设备接收到所述第一电子设备的第一消息;其中,所述第一消息用于指示为所述IoT设备添加共享控制设备;
    响应于所述第一消息,所述IoT设备切换至所述第二天线,并通过所述第二天线发送第二消息;其中,所述第二消息包括所述IoT设备的设备信息;
    所述IoT设备接收到第二电子设备发送的第三消息;其中,所述第三消息包括所述第二电子设备的设备信息;
    响应于所述第三消息,所述IoT设备切换至所述第一天线,并通过所述第一天线向所述第一电子设备发送第四消息;其中,所述第四消息包括所述第二电子设备的设备信息;其中,所述控制设备对所述IoT设备的权限大于所述共享控制设备对所述IoT设备的权限。
  13. 根据权利要求12所述的方法,其特征在于,所述方法还包括:
    在通过所述第一天线向所述第一电子设备发送第四消息之后,所述IoT设备接收到成功添加消息,所述成功添加消息用于指示已将所述第二电子设备添加为所述IoT设备的共享控制设备。
  14. 根据权利要求12所述的方法,其特征在于,所述第一消息还包括所述第二电子设 备对所述IoT设备的临时控制时长或临时控制次数;
    在通过所述第一天线向所述第一电子设备发送第四消息之后,所述IoT设备接收到一个消息;其中,所述消息包括所述第二电子设备对应的密钥和所述第二电子设备的身份凭证中的至少一项;所述第二电子设备对应的密钥和所述第二电子设备的身份凭证,用于所述第二电子设备对所述IoT设备的控制;
    在所述临时控制时长或所述临时控制次数达到后,所述IoT设备删除所述第二电子设备对应的密钥和所述第二电子设备的身份凭证中的至少一项。
  15. 根据权利要求12所述的方法,其特征在于,所述方法还包括:
    在通过所述第一天线向所述第一电子设备发送第四消息之后,所述IoT设备接收到一个消息;所述消息包含随机生成的控制密钥;
    响应于所述包含随机生成的控制密钥的消息,所述IoT设备获取到所述控制密钥;所述第二电子设备对应的密钥包括所述控制密钥。
  16. 根据权利要求15所述的方法,其特征在于,所述方法还包括:
    所述IoT设备接收到包含第一随机数的消息;
    响应于所述包含第一随机数的消息,所述IoT设备随机生成第二随机数;
    基于所述第一随机数、所述第二随机数和所述控制密钥,所述IoT设备生成通信密钥,并向所述第二电子设备发送包含所述第二随机数的消息;
    所述IoT设备接收到所述第二电子设备的控制消息;
    响应于所述控制消息,基于所述通信密钥解密所述控制消息,所述IoT设备获取到控制指令,并执行所述控制指令;所述第二电子设备对应的密钥包括所述通信密钥。
  17. 根据权利要求16所述的方法,其特征在于,所述方法还包括:
    在接收到所述成功添加消息后,所述IoT设备获取到所述第二电子设备对应的密钥和所述第二电子设备的身份凭证中的至少一项;所述第二电子设备对应的密钥和所述第二电子设备的身份凭证,用于所述第二电子设备对所述IoT设备的控制。
  18. 根据权利要求17所述的方法,其特征在于,所述方法还包括:
    所述IoT设备接收到所述第一电子设备的取消消息;其中,所述取消消息用于指示取消对所述第二电子设备的授权;
    响应于所述取消消息,所述IoT设备删除所述第二电子设备对应的密钥和所述第二电子设备的身份凭证中的至少一项。
  19. 根据权利要求12-18中任意一项所述的方法,其特征在于,所述第二消息还包括会话密钥,所述会话密钥是所述IoT设备随机生成的;所述第三消息为所述第二电子设备针对所述第二消息的响应消息;所述第二电子设备对应的密钥包括所述会话密钥、所述控制密钥和所述通信密钥中的至少一项;
    所述IoT设备接收到第一电子设备的第一消息,包括:经所述一个或多个服务器,所述IoT设备接收到所述第一电子设备的第一消息;
    所述IoT设备通过所述第一天线向所述第一电子设备发送第四消息,包括:所述IoT设备通过所述第一天线,经所述一个或多个服务器,向所述第一电子设备发送第四消息。
  20. 一种IoT设备授权方法,应用于所述IoT设备,所述IoT设备与第一电子设备和第二电子设备无线通信,所述第一电子设备为所述IoT设备的控制设备,所述第二电子设备 不同于所述第一电子设备;其特征在于,所述IoT设备包括一个第一天线和一个第二天线,所述第二天线的发射距离小于等于预设的安全发射距离;其中,所述第一天线和所述第二天线为不同的天线,第二天线发射无线信号的发射距离小于第一天线发射无线信号的发射距离;或者,所述第一天线和所述第二天线为同一天线,且所述第二天线配置的发射功率小于所述第一天线配置的发射功率;所述方法包括:
    所述IoT设备接收到所述第一电子设备的第一消息;其中,所述第一消息用于指示为所述IoT设备添加共享控制设备;
    响应于所述第一消息,所述IoT设备切换至所述第二天线,并通过所述第二天线发送第二消息;其中,所述第二消息包括所述IoT设备的设备信息;
    所述IoT设备接收到第二电子设备发送的第三消息;其中,所述第三消息包括所述第二电子设备的设备信息;
    响应于所述第三消息,所述IoT设备将所述第二电子设备的设备信息添加至所述IoT设备的共享控制设备的设备信息中,并切换至所述第一天线;其中,所述控制设备对所述IoT设备的权限大于所述共享控制设备对所述IoT设备的权限。
  21. 根据权利要求20所述的方法,其特征在于,所述方法还包括:所述第一消息还包括所述第二电子设备对所述IoT设备的临时控制时长或临时控制次数;
    在所述临时控制时长或所述临时控制次数达到后,所述IoT设备向所述第二电子设备和所述第一电子设备中的至少一个,发送添加失效的消息。
  22. 根据权利要求21所述的方法,其特征在于,
    所述IoT设备接收到第一电子设备的第一消息,包括:所述IoT设备经所述一个或多个服务器,接收到所述第一电子设备的第一消息;
    所述IoT设备向所述第一电子设备发送添加失效的消息,包括:所述IoT设备经一个或多个服务器向所述第一电子设备发送添加失效的消息。
  23. 一种服务器,所述服务器与一个第一电子设备、一个或多个第二电子设备和一个或多个IoT设备无线通信,所述第一电子设备为所述IoT设备的控制设备,所述第二电子设备不同于所述第一电子设备;其特征在于,所述服务器包括:
    一个或多个处理器;
    一个或多个存储器;
    以及一个或多个计算机程序,其中所述一个或多个计算机程序存储在所述一个或多个存储器上,当所述计算机程序被所述一个或多个处理器执行时,使得所述服务器执行以下步骤:
    接收到所述第一电子设备的第一消息;其中,所述第一消息用于指示为所述IoT设备添加共享控制设备;
    响应于所述第一消息,所述服务器向所述IoT设备发送所述第一消息;
    接收到所述IoT设备的第四消息;其中,所述第四消息包括所述第二电子设备的设备信息;
    响应于所述第四消息,所述服务器向所述第一电子设备发送所述第四消息;
    接收到所述第一电子设备的第五消息;其中,所述第五消息包括所述第二电子设备的设备信息;
    响应于所述第五消息,所述服务器将所述第二电子设备的设备信息登记在所述IoT设备的共享控制设备的设备信息中;其中,所述控制设备对所述IoT设备的权限大于所述共享控制设备对所述IoT设备的权限。
  24. 根据权利要求23所述的服务器,其特征在于,所述服务器向所述IoT设备和所述第二电子设备中的至少一个,发送成功添加消息;其中,所述成功添加消息用于指示已将所述第二电子设备添加为所述IoT设备的共享控制设备。
  25. 根据权利要求24所述的服务器,其特征在于,所述服务器还执行以下步骤:
    接收到所述第一电子设备的取消消息;其中,所述取消消息用于指示取消对所述第二电子设备的授权;
    响应于所述取消消息,所述服务器从所述IoT设备的共享控制设备的设备信息中删除所述第二电子设备的设备信息。
  26. 根据权利要求24所述的服务器,其特征在于,所述服务器还执行以下步骤:
    接收到所述第一电子设备的取消消息;其中,所述取消消息用于指示取消对所述第二电子设备的授权;
    响应于所述取消消息,所述服务器向所述IoT设备发送所述取消消息。
  27. 根据权利要求23-26中任意一项所述的服务器,其特征在于,所述第一消息还包括所述第二电子设备对所述IoT设备的临时控制时长或临时控制次数;
    在所述临时控制时长或所述临时控制次数达到后,所述服务器从所述IoT设备的共享控制设备的设备信息中删除所述第二电子设备的设备信息。
  28. 一种IoT设备授权方法,应用于一种服务器,所述服务器与一个第一电子设备、一个或多个第二电子设备和一个或多个IoT设备无线通信,所述第一电子设备为所述IoT设备的控制设备,所述第二电子设备不同于所述第一电子设备;其特征在于,所述方法包括:
    所述服务器接收到所述第一电子设备的第一消息;其中,所述第一消息用于指示为所述IoT设备添加共享控制设备;
    响应于所述第一消息,所述服务器向所述IoT设备发送所述第一消息;
    所述服务器接收到所述IoT设备的第四消息;其中,所述第四消息包括所述第二电子设备的设备信息;
    响应于所述第四消息,所述服务器向所述第一电子设备发送所述第四消息;
    所述服务器接收到所述第一电子设备的第五消息;其中,所述第五消息包括所述第二电子设备的设备信息;
    响应于所述第五消息,所述服务器将所述第二电子设备的设备信息登记在所述IoT设备的共享控制设备的设备信息中;其中,所述控制设备对所述IoT设备的权限大于所述共享控制设备对所述IoT设备的权限。
  29. 根据权利要求28所述的方法,其特征在于,所述服务器向所述IoT设备和所述第二电子设备中的至少一个,发送成功添加消息。
  30. 根据权利要求29所述的方法,其特征在于,所述方法还包括:
    所述服务器接收到所述第一电子设备的取消消息;其中,所述取消消息用于指示取消对所述第二电子设备的授权;
    响应于所述取消消息,所述服务器从所述IoT设备的共享控制设备的设备信息中删除 所述第二电子设备的设备信息。
  31. 根据权利要求29所述的方法,其特征在于,所述方法还包括:
    所述服务器接收到所述第一电子设备的取消消息;其中,所述取消消息用于指示取消对所述第二电子设备的授权;
    响应于所述取消消息,所述服务器向所述IoT设备发送所述取消消息。
  32. 根据权利要求28-31中任意一项所述的方法,其特征在于,所述第一消息还包括所述第二电子设备对所述IoT设备的临时控制时长或临时控制次数;
    在所述临时控制时长或所述临时控制次数达到后,所述服务器从所述IoT设备的共享控制设备的设备信息中删除所述第二电子设备的设备信息。
  33. 一种计算机可读存储介质,其特征在于,包括计算机程序,当所述计算机程序在IoT设备上运行时,使得所述IoT设备执行如权利要求12-22中任一项所述的方法。
  34. 一种计算机可读存储介质,其特征在于,包括计算机程序,当所述计算机程序在服务器上运行时,使得所述服务器执行如权利要求28-32中任一项所述的方法。
PCT/CN2021/108486 2020-08-31 2021-07-26 一种IoT设备及其授权方法 WO2022042170A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
US18/043,463 US20230336994A1 (en) 2020-08-31 2021-07-26 IoT Device and IoT Device Authorization Method
EP21860010.4A EP4199473A4 (en) 2020-08-31 2021-07-26 IOT DEVICE AND AUTHORIZATION METHOD THEREOF

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010901711.1 2020-08-31
CN202010901711.1A CN114205822B (zh) 2020-08-31 2020-08-31 一种IoT设备及其授权方法

Publications (1)

Publication Number Publication Date
WO2022042170A1 true WO2022042170A1 (zh) 2022-03-03

Family

ID=80352606

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/108486 WO2022042170A1 (zh) 2020-08-31 2021-07-26 一种IoT设备及其授权方法

Country Status (4)

Country Link
US (1) US20230336994A1 (zh)
EP (1) EP4199473A4 (zh)
CN (1) CN114205822B (zh)
WO (1) WO2022042170A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116956311A (zh) * 2022-04-15 2023-10-27 华为技术有限公司 异步授权方法、系统、电子设备及计算机可读存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105721426A (zh) * 2016-01-05 2016-06-29 左冠高科技术有限公司 终端设备的访问授权方法、服务器、目标终端设备及系统
US20180288209A1 (en) * 2017-03-29 2018-10-04 Samsung Electronics Co., Ltd. Method for managing and controlling external iot device and electronic device supporting the same
CN110300117A (zh) * 2019-07-05 2019-10-01 杭州博联智能科技股份有限公司 Iot设备与用户绑定的认证方法、设备及介质
CN110476448A (zh) * 2017-04-17 2019-11-19 英特尔公司 用于大规模物联网设备的基于组的上下文和安全性

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102456541B1 (ko) * 2016-06-22 2022-10-19 삼성전자 주식회사 Sar 저감을 위한 안테나 스위칭 방법 및 이를 지원하는 전자 장치
CN110336720B (zh) * 2019-06-29 2021-08-20 华为技术有限公司 设备控制方法和设备

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105721426A (zh) * 2016-01-05 2016-06-29 左冠高科技术有限公司 终端设备的访问授权方法、服务器、目标终端设备及系统
US20180288209A1 (en) * 2017-03-29 2018-10-04 Samsung Electronics Co., Ltd. Method for managing and controlling external iot device and electronic device supporting the same
CN110476448A (zh) * 2017-04-17 2019-11-19 英特尔公司 用于大规模物联网设备的基于组的上下文和安全性
CN110300117A (zh) * 2019-07-05 2019-10-01 杭州博联智能科技股份有限公司 Iot设备与用户绑定的认证方法、设备及介质

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4199473A4

Also Published As

Publication number Publication date
EP4199473A4 (en) 2024-02-21
EP4199473A1 (en) 2023-06-21
US20230336994A1 (en) 2023-10-19
CN114205822A (zh) 2022-03-18
CN114205822B (zh) 2023-11-03

Similar Documents

Publication Publication Date Title
US11895494B2 (en) Device network configuration and registration method, device, and system
CN113163379B (zh) 一种发现及配网的方法和电子设备
US11647548B2 (en) Network access method, device, and system
US9357385B2 (en) Configuration of a new enrollee device for use in a communication network
CN110235424A (zh) 用于在通信系统中提供和管理安全信息的设备和方法
WO2021135593A1 (zh) 一种分享设备的方法及电子设备
KR20160039232A (ko) Wifi 설정 포팅
US10420156B2 (en) Wireless communication terminal, wireless communication system, wireless communication method, and non-transitory medium saving program
WO2021104448A1 (zh) 一种密钥信息的同步方法、系统及设备
CN114079862B (zh) 一种自动控制方法、电子设备及计算机可读存储介质
CN116325664A (zh) 一种智能设备配网的方法和装置
WO2022267598A1 (zh) 一种智能家居设备控制方法及系统
CN106105376A (zh) 用于管理无线个人区域通信网络中的节点关联的方法
WO2022042170A1 (zh) 一种IoT设备及其授权方法
WO2022068601A1 (zh) 一种网络修复方法、电子设备及移动设备
EP4120793A1 (en) Bluetooth networking method for electronic device, and related device
WO2022028333A1 (zh) 一种自动控制方法、电子设备及计算机可读存储介质
CN114338356B (zh) 一种网络修复方法、电子设备及移动设备
US20230308305A1 (en) Method and apparatus for setting multiple controllers in wireless lan system in smart home environment
CN114640691A (zh) 设备连接方法、系统及相应的物联网设备
WO2022042740A1 (zh) 一种数据传输方法及电子设备
CN116743413B (zh) 一种物联网设备认证方法及电子设备
WO2023185593A1 (zh) 设备登录方法、电子设备及系统
WO2023273458A1 (zh) 设备控制方法及装置
WO2023231883A1 (zh) 修复wlan信息的方法、主配置器、物联网设备和系统

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 2021860010

Country of ref document: EP

Effective date: 20230314

NENP Non-entry into the national phase

Ref country code: DE