IoT device management method and terminal
An internet of things (IoT) device management method includes, after receiving a first input, an IoT device that sends, by short-range communication, a first message including an identifier of the IoT device and a registration status of the IoT device. When the registration status of the IoT device indicates that the IoT device is registered, the mobile terminal displays a control interface of the IoT device. When the registration status of the IoT device indicates that the IoT device is not registered, the mobile terminal automatically starts networking for the IoT device.
1 . A mobile terminal comprising:
a memory configured to store instructions; and
a processor coupled to the memory and configured to execute the instructions to cause the mobile terminal to:
receive, from an internet of things (IoT) device via short-range communication, a first message comprising an identifier of the IoT device and a registration status of the IoT device;
when the registration status indicates that the IoT device is not registered:
request, from a server, a registration code of the IoT device;
receive, from the server, the registration code of the IoT device; and
send, to the IoT device, the registration code and locally-stored networking information, wherein the registration code and the locally-stored networking information enable the IoT device to apply to the server for registration;
display a first control interface comprising a control for controlling the IoT device when the registration status indicates that the IoT device is registered; and
play a voice prompt to indicate that the IoT device may be controlled through voice commands when the registration status indicates that the IoT device is registered.
2 . The mobile terminal of claim 1 , wherein the identifier comprises one or more of a device model, a personal identification number (PIN), or a media access control (MAC) address.
3 . The mobile terminal of claim 1 , wherein after sending the registration code and the locally-stored networking information, the processor is further configured to execute the instructions to cause the mobile terminal to:
receive, from the server, a second message indicating that the IoT device is registered successfully;
update, in response to receiving the second message, the registration status to “registered”; and
further display the registration status “registered”.
4 . The mobile terminal of claim 1 , wherein the processor is further configured to execute the instructions to cause the mobile terminal to automatically enable a first application and display a second control interface of the first application.
5 . The mobile terminal of claim 1 , wherein the processor is further configured to execute the instructions to cause the mobile terminal to further play the voice prompt when the registration status indicates that the IoT device is registered and after receiving the first message.
6 . The mobile terminal of claim 3 , wherein after receiving the second message, the processor is further configured to execute the instructions to cause the mobile terminal to play, in response to updating the registration status to “registered”, a voice prompt.
7 . An internet of things (IoT) device comprising:
a memory configured to store instructions; and
a processor coupled to the memory and configured to execute the instructions to cause the IoT device to:
receive an input;
send, in response to the input, to a mobile terminal and via short-range communication, a first message comprising an identifier of the IoT device and a registration status of the IoT device;
receive, from the mobile terminal and in response to the first message, a registration code of the IoT device and networking information, wherein a server is the source of the registration code sent to the mobile terminal; and
apply to the server for registration after receiving the registration code and the networking information.
8 . The IoT device of claim 7 , wherein the processor is further configured to execute the instructions to cause the IoT device to prompt, using a prompting manner, a user to decrease a distance between the mobile terminal and the IoT device after receiving the input or before sending the first message, wherein a prompting manner comprises one or more of playing a voice prompt, blinking an indicator light, or displaying a prompt interface.
9 . The IoT device of claim 7 , wherein the identifier comprises one or more of a device model, a personal identification number (PIN), or a media access control (MAC) address.
10 . A computer program product comprising computer-executable instructions that are stored on a non-transitory computer-readable storage medium and that, when executed by a processor, cause a mobile terminal to:
receive, from an internet of things (IoT) device via short-range communication, a first message comprising an identifier of the IoT device and a registration status of the IoT device;
when the registration status indicates that the IoT device is not registered:
request, from a server, a registration code of the IoT device;
receive, from the server, the registration code of the IoT device; and
send, to the IoT device, the registration code and locally-stored networking information, wherein the registration code and the locally-stored networking information enable the IoT device to apply to the server for registration;
display a first control interface comprising a control for controlling the IoT device when the registration status indicates that the IoT device is registered; and
play a voice prompt to indicate that the IoT device may be controlled through voice commands when the registration status indicates that the IoT device is registered.
11 . The computer program product of claim 10 , wherein the identifier comprises one or more of a device model, a personal identification number (PIN), or a media access control (MAC) address.
12 . The computer program product of claim 10 , wherein after sending the registration code and the locally-stored networking information, the computer-executable instructions further cause the mobile terminal to:
receive, from the server, a second message indicating that the IoT device is registered successfully;
update, in response to the second message, the registration status to “registered”; and
further display the registration status “registered”.
13 . The computer program product of claim 10 , wherein the computer-executable instructions further cause the mobile terminal to invoke a system service and display a pop-up window comprising the first control interface.
14 . The computer program product of claim 10 , wherein the computer-executable instructions further cause the mobile terminal to further play the voice prompt when the registration status indicates that the IoT device is registered and after receiving the first message.
15 . The computer program product of claim 12 , wherein after receiving the second message, the computer-executable instructions further cause the mobile terminal to play, in response to updating the registration status to “registered”, a voice prompt.
16 . A computer program product comprising computer-executable instructions that are stored on a non-transitory computer-readable storage medium and that, when executed by a processor, cause an internet of things (IoT) device to:
receive a first input;
send, via short-range communication, a first message comprising an identifier of the IoT device and a registration status of the IoT device, wherein the identifier and the registration status enable a mobile terminal to apply for a registration code of the IoT device and return, to the IoT device, the registration code and networking information stored in the mobile terminal, and wherein a server is the source of the registration code; and
apply to the server for registration after receiving the registration code and the networking information.
17 . The computer program product of claim 16 , wherein after receiving the first input or before sending the first message, the computer-executable instructions further cause the IoT device to prompt a user to decrease distance between the mobile terminal and the IoT device, wherein a prompting manner comprises one or more of playing a voice prompt, blinking an indicator light, or displaying a prompt interface.
18 . The computer program product of claim 16 , wherein the identifier comprises one or more of a device model, a personal identification number (PIN), or a media access control (MAC) address.
19 . The mobile terminal of claim 1 , wherein the request to the server comprises the identifier of the IoT device, and wherein the registration code received from the server is uniquely associated with the identifier of the IoT device and enables the server to bind the IoT device to an account associated with the mobile terminal upon receiving the registration code from the IoT device.
20 . The mobile terminal of claim 1 , wherein the registration code enables the IoT device to establish an initial registration with the server for a first time.