COMMUNICATION SYSTEMS AND METHODS
Systems and methods for establishing communication between a terminal and a device are disclosed. According to certain embodiments, a method used in the device includes receiving a plurality of multicast packets from the terminal. The method also includes determining, according to the multicast packets, wireless connection information of a wireless network. The method further includes connecting to the wireless network according to the wireless connection information. The method further includes generating a notification indicating a password associated with the device.
1 . A method for establishing communication between a device and a terminal, comprising:
receiving a plurality of multicast packets from the terminal;
determining, according to the multicast packets, wireless connection information of a wireless network;
connecting to the wireless network according to the wireless connection information; and
generating a notification indicating a password associated with the device.
2 . The method according to claim 1 , wherein receiving the multicast packets from the terminal comprises:
scanning a plurality of multicast channels;
receiving, on one or more of the multicast channels, one or more first multicast packets from the terminal;
determining, according to the one or more first multicast packets, an identification of the terminal; and
if the identification of the terminal matches a predetermined identification, locking the one or more multicast channels.
3 . The method according to claim 2 , further comprising:
determining, according to the one or more first multicast packets, a length of a wireless password associated with the wireless network.
4 . The method according to claim 3 , further comprising:
receiving, on the one or more locked multicast channels, one or more second multicast packets from the terminal, each second multicast packet, comprising a serial number and at least a part of the wireless password corresponding to the serial number;
determining, according to the length of the wireless password and the serial numbers in the received second multicast packets, whether to receive additional second multicast packets; and
if no additional second multicast packets need to be received, determining the wireless password according to the received second multicast packets.
5 . The method according to claim 2 , wherein scanning the multicast channels further comprises:
if the multicast channels have different usage frequencies, first scanning multicast channels with usage frequencies that are above a predetermined frequency.
6 . A device for communication with a terminal, comprising:
a memory storing instructions; and
a processor configured to execute the instructions to:
receive a plurality of multicast packets from the terminal;
determine, according to the multicast packets, wireless connection information of a wireless network;
connect to the wireless network according to the wireless connection information; and
generate a notification indicating a password associated with the device.
7 . The device according to claim 6 , wherein the processor is further configured to execute the instructions to:
scan a plurality of multicast channels;
receive, on one or more of the multicast channels, one or more first multicast packets from the terminal;
determine, according to the received first multicast packets, an identification of the terminal; and
if the identification of the terminal matches a predetermined identification, lock the one or more multicast channels.
8 . The device according to claim 7 , wherein the processor is further configured to execute the instructions to:
determine, according to the received first multicast packets, a length of a wireless password associated with the wireless network.
9 . The device according to claim 8 , wherein the processor is further configured to execute the instructions to:
receive, on the one or more locked multicast channels, one or more second multicast packets from the terminal, each second multicast packet comprising a serial number and at least a part of the wireless password corresponding to the serial number;
determine, according to the length of the wireless password and the serial numbers in the received second multicast packets, whether to receive additional second multicast packets; and
if no additional second multicast packets need to be received, determine the wireless password according to the second multicast packets.
10 . The device according to claim 7 , wherein the processor is further configured to execute the instructions to:
if the multicast channels have different usage frequencies, first scan multicast channels with usage frequencies that are above a predetermined frequency.
11 . A non-transitory computer-readable storage medium storing instructions for establishing communication between a device and a terminal, the instructions causing a processor to perform operations comprising:
receiving a plurality of multicast packets from the terminal;
determining, according to the multicast packets, wireless connection information of a wireless network;
connecting to the wireless network according to the wireless connection information; and
generating a notification indicating a password associated with the device.
12 . The non-transitory computer-readable storage medium of claim 11 , wherein receiving the multicast packets from the terminal comprises:
scanning a plurality of multicast channels;
receiving, on one or more of the multicast channels, one or more first multicast packets from the terminal;
determining, according to the one or more first multicast packets, an identification of the terminal; and
if the identification of the terminal matches a predetermined identification, locking the one or more multicast channels.
13 . The non-transitory computer-readable storage medium of claim 12 , wherein the operations further comprise:
determining, according to the received first multicast packets, a length of a wireless password associated with the wireless network.
14 . The non-transitory computer-readable storage medium of claim 13 , wherein the operations further comprise:
receiving, on the one or more locked multicast channels, one or more second multicast packets from the terminal, each second multicast packet comprising a serial number and at least a part of the wireless password corresponding to the serial number;
determining, according to the length of the wireless password and the serial numbers in the received second multicast packets, whether to receive additional second multicast packets; and
if no additional second multicast packets need to be received, determining the wireless password according to the received second multicast packets.
15 . The non-transitory computer-readable storage medium of claim 12 , wherein scanning the multicast channels further comprises:
if the multicast channels have different usage frequencies, first scanning multicast channels with usage frequencies that are above a predetermined frequency.
16 . A method for establishing communication between a device and a terminal, comprising:
obtaining wireless connection information of a wireless network;
generating a plurality of multicast packets including wireless connection information of the wireless network;
sending the multicast packets to the device; and
after the device is connected to the wireless network, trigger the device to generate a notification indicating a password associated with the device.
17 . The method according to claim 16 , wherein
the plurality of multicast packets comprise one or more first multicast packets and one or more second multicast packets; and
generating the plurality of multicast packets further comprises:
writing into the one or more first multicast packets an identification of the terminal and a length of a wireless password associated with the wireless network; and
writing into each second multicast packet a serial number and at least a part of the wireless password corresponding to the serial number.
18 . The method according to claim 16 , wherein generating the plurality of multicast packets further comprises:
encrypting the information included in the plurality of multicast packets.
19 . A terminal, comprising:
a memory storing instructions; and
a processor configured to execute the instructions to:
obtain wireless connection information of a wireless network;
generate a plurality of multicast packets including wireless connection information of the wireless network;
send the multicast packets to a device; and
after the device is connected to the wireless network, trigger the device to generate a notification indicating a password associated with the device.
20 . The terminal according to claim 19 , wherein
the plurality of multicast packets comprise one or more first multicast packets and one or more second multicast packets; and
the processor is further configured to execute the instructions to:
write into the one or more first multicast packets an identification of the terminal and a length of a wireless password associated with the wireless network; and
write into each second multicast packet a serial number and at least a part of the wireless password corresponding to the serial number.
21 . The terminal according to claim 19 , wherein the processor is further configured to:
encrypting the information included in the multicast packets.
22 . A non-transitory computer-readable storage medium storing instructions for establishing communication between a device and a terminal, the instructions causing a processor to perform operations comprising:
obtaining wireless connection information of a wireless network;
generating a plurality of multicast packets including wireless connection information of the wireless network;
sending the multicast packets to the device; and
after the device is connected to the wireless network, trigger the device to generate a notification indicating a password associated with the device.
23 . The non-transitory computer-readable storage medium of claim 22 , wherein
the plurality of multicast packets comprise one or more first multicast packets and one or more second multicast packets; and
the operations further comprise:
writing into the one or more first multicast packets an identification of the terminal and a length of a wireless password associated with the wireless network; and
writing into each second multicast packet a serial number and at least a part of the wireless password corresponding to the serial number.
24 . The non-transitory computer-readable storage medium of claim 22 , wherein the operations further comprise:
encrypting the information included in the multicast packets.
25 . A method for establishing communication between a device and a terminal, comprising:
receiving, by the terminal, wireless connection information of a wireless network and a UID, the wireless connection information being associated with a format set;
determining, by the terminal, whether the format set introduces special characters into a graphic code;
converting the wireless connection information into a uniform format when the format set introduces special characters;
generating, by the terminal, the graphic code according to the wireless connection information and the UID;
displaying the code by the terminal;
scanning the code by the device;
decoding, by the device, the code to extract the wireless connection information and the UID; and
connecting, by the device, to the wireless network according to the wireless connection information.
26 . The method according to claim 25 , wherein the code comprises a QR code.
27 . The method according to claim 25 , wherein generating the code further comprises:
encrypting the wireless connection information and UID; and
generating the code, according to the encrypted wireless connection information and UID.
28 . The method according to claim 25 , wherein the UID is a server-generated UID, the method further comprising:
sending, by the device, the UID to the server;
determining, by the server, whether the UID has expired; and
if the UID has not expired, establishing, by the server, a binding relationship between the device and the terminal.
29 . The method according to claim 28 , further comprising:
if the UID has expired, generating, by the device, an error message indicating that the binding between the device and the terminal has failed.
30 . The method according to claim 25 , wherein the device comprises a camera.
31 . The method according to claim 25 , wherein the terminal comprises a display
32 . A device for communication with a terminal, comprising:
a camera configured to scan a QR code displayed by the terminal;
a memory storing instructions; and
a processor configured to execute the instructions to:
decode the QR code to extract the wireless connection information; and
connect to the wireless network according to the wireless connection information,
wherein,
the terminal generates the QR code according to converted wireless connection information of a wireless network,
the converted wireless connection information being wireless connection information converted into a uniform format when the terminal determines a format associated with the wireless connection information introduces special characters into the QR code.
33 . The device according to claim 32 , wherein:
the QR code is further coded according to a UID; and
the processor is further configured to execute the instructions to decode the QR code to extract the UID.
34 . The device according to claim 33 , wherein the processor is further configured to execute the instructions to:
receive, from a server, a notification that the UID has expired; and
if the UID has expired, generate an error message indicating that the binding between the device and the terminal has failed.
35 . A non-transitory computer-readable storage medium storing instructions for establishing communication between a device and a terminal, the instructions causing a processor to perform operations comprising:
receiving a QR code displayed by the terminal, the QR code being coded by the terminal according to converted wireless connection information of a wireless network, the converted wireless connection information being wireless connection information converted into a uniform format when the terminal determines a format associated with the wireless connection information introduces special characters into the QR code;
decode the QR code to extract the wireless connection information; and
connect to the wireless network according to the wireless connection information.
36 . The non-transitory computer-readable storage medium of claim 35 , wherein:
the QR code is further coded according to a UID; and
the operations further comprises decoding the QR code to extract the UID.
37 . The non-transitory computer-readable storage medium of claim 36 , wherein the operations further comprise:
receiving, from a server, a notification that the UID has expired; and
if the UID has expired, generating an error message indicating that the binding between the device and the terminal has failed.
38 . A method for establishing communication between a terminal and a device, comprising:
determining that a condition has occurred;
retrieving, from a memory of the terminal, a user name, and a password of the device;
forming a P2P connection between the terminal and the device;
sending the user name and password to the device for verification; and
if the verification fails, obtaining from a server an updated password of the device.
39 . The method according to claim 38 , further comprising:
saving the updated password in the memory.
40 . The method according to claim 38 , wherein the condition comprises at least one of:
the terminal is turned on;
the terminal is connected to a network; or
the terminal has started an application for managing a device bound to the terminal.
41 . The method according to claim 38 , further comprising:
retrieving, from the memory, a UID of the device;
querying, based on the UID, the server regarding availability status of the device; and
if the device is available for connection, forming the P2P connection.
42 . A terminal, comprising:
a memory storing:
instructions, and
a UID, a user name, and a password for a device; and
a processor configured to execute the instructions to:
determine that a condition has occurred;
retrieve the user name, and the password of the device;
form a P2P connection to the device;
send the user name and password to the device for verification; and
if the verification fails, obtain from a server an updated password of the device.
43 . The terminal according to claim 42 , wherein the processor is further configured to execute the instructions to:
save the updated password in the memory.
44 . The terminal according to claim 42 , wherein the condition comprises at least one of:
the terminal is turned on;
the terminal is connected to a network; or
the terminal has started an application for managing a device bound to the terminal.
45 . The terminal according to claim 42 , wherein the processor is further configured to execute the instructions to:
retrieve the UID of the device;
query, based on the UID, the server regarding availability status of the device; and
if the device is available for connection, form the P2P connection.
46 . A non-transitory computer-readable storage medium storing instructions for establishing communication between a device and a terminal, the instructions causing a processor to perform operations comprising:
determining that a condition has occurred;
retrieving, from a memory of the terminal, a user name and a password of the device;
forming a P2P connection between the terminal and the device;
sending the user name and password to the device for verification; and
if the verification fails, obtaining from a server an updated password of the device.
47 . The non-transitory computer-readable storage medium of claim 46 , wherein the operations further comprise:
saving the updated password in the memory.
48 . The non-transitory computer-readable storage medium of claim 46 , wherein the condition comprises at least one of:
the terminal is turned on;
the terminal is connected to a network; or
the terminal has started an application for managing one or more devices bound to the terminal.
49 . The non-transitory computer-readable storage medium of claim 46 , wherein the operations further comprise:
retrieving, from the memory, a UID of the device;
querying, based on the UID, the server regarding availability status of the device; and
if the device is available for connection, forming the P2P connection.