Method and system for networking
A method for networking, including: in response to the terminal entering an effective communication range of a first NFC sensing device in a first router, interacting with the first NFC sensing device, so that the first router or the terminal obtains key information, in which the key information is configured for networking the first router and a second router; and in response to the terminal entering an effective communication range of a second NFC sensing device in the second router, writing the key information into the second NFC sensing device.
1. A method for networking, performed by a terminal, comprising:
in response to the terminal entering an effective communication range of a first Near Field Communication (NFC) sensing device in a first router, interacting with the first NFC sensing device, so that the first router or the terminal obtains key information, wherein the key information is configured for networking the first router and a second router; and
in response to the terminal entering an effective communication range of a second NFC sensing device in the second router, writing the key information into the second NFC sensing device;
wherein the key information is configured for the first router to: encrypt networking information; broadcast the encrypted networking information; in response to receiving a networking request sent by the second router, determine whether key information included in the networking request passes verification; in response to determining the key information included in the networking request passes verification, perform networking connection to the second router, wherein the networking request is triggered in response that the networking information is successfully decrypted by the another router based on the key information.
2. The method of claim 1 , wherein when the key information is generated by the terminal, interacting with the first NFC sensing device comprises:
writing the key information generated by the terminal into the first NFC sensing device, so that the first router obtains the key information.
3. The method of claim 1 , wherein when the key information is written by the first router into the first NFC sensing device, interacting with the first NFC sensing device comprises:
reading the key information written into the first NFC sensing device.
4. The method of claim 1 , wherein the key information is generated by numerical values through a random algorithm.
5. The method of claim 1 , wherein the first NFC sensing device and the second NFC sensing device are NFC tags.
6. A method for networking, performed by a router, comprising:
performing communication detecting by a NFC sensing device in the router; and
in response to detecting that a terminal enters an effective communication range of the NFC sensing device, interacting with the terminal via the NFC sensing device, so that the router or the terminal obtains key information, wherein the key information is configured for networking the router and another router;
wherein the method further comprises:
encrypting networking information based on the key information;
broadcasting the encrypted networking information;
in response to receiving a networking request sent by the another router, determining whether key information included in the networking request passes verification; and
in response to determining the key information included in the networking request passes verification, performing networking connection to the another router, wherein the networking request is triggered in response that the networking information is successfully decrypted by the another router based on the key information.
7. The method of claim 6 , wherein when the key information is written by the router into the NFC sensing device, interacting with the terminal via the NFC sensing device comprises:
transmitting the key information written into the NFC sensing device to the terminal.
8. The method of claim 6 , wherein when the key information is generated by the terminal, interacting with the terminal via the NFC sensing device comprises:
reading the key information written by the terminal into the NFC sensing device.
9. The method of claim 8 , further comprising:
in response to receiving networking information encrypted based on key information, decrypting the networking information based on the key information, wherein the key information is obtained by the terminal performing interactions with the another router, and
in response to successful decryption of the networking information, sending a networking request.
10. The method of claim 6 , wherein broadcasting the encrypted networking information comprises:
setting the encrypted networking information in a management frame, and broadcasting the management frame.
11. A system for networking, comprising:
a first router with a first NFC sensing device, wherein the first NFC sensing device is configured to sense whether a terminal enters a first effective communication range of the first NFC sensing device;
a second router with a second NFC sensing device, wherein the second NFC sensing device is configured to sense whether the terminal enters a second effective communication range of the second NFC sensing device;
the terminal, configured to in response to entering the first effective communication range, interact with the first NFC sensing device, so that the first router or the terminal obtains key information; and in response to entering the second effective communication range, writing the key information into the second NFC sensing device;
wherein the first router and the second router are networked by using the key information;
wherein the first router is configured to:
encrypt networking information based on the key information;
broadcast the encrypted networking information;
in response to receiving a networking request sent by the second router, determine whether key information included in the networking request passes verification; and
in response to determining the key information included in the networking request passes verification, perform networking connection to the second router, wherein the networking request is triggered in response that the networking information is successfully decrypted by the second router based on the key information.
12. The system of claim 11 , wherein when the key information is generated by the terminal, the terminal is further configured to write the key information generated by the terminal into the first NFC sensing device, so that the first router obtains the key information.
13. The system of claim 11 , wherein when the key information is written by the first router into the first NFC sensing device, the terminal is further configured to read the key information written into the first NFC sensing device.
14. The system of claim 11 , wherein the first router is further configured to:
set the encrypted networking information in a management frame, and broadcast the management frame.
15. The system of claim 11 , wherein the second router is configured to:
receive the encrypted networking information, decrypt the networking information based on key information, wherein the key information is obtained by the terminal performing interactions with the first router, and
in response to successful decryption of the networking information, send a networking request to the first router.
16. The system of claim 11 , wherein the key information is generated by numerical values through a random algorithm.
17. The system of claim 11 , wherein the first NFC sensing device and second NFC sensing device are NFC tags.