Router connection method and system
Technical Field
The present invention relates to the field of router technologies, and in particular, to a method and a system for connecting a router.
Background
The router is used as a network connection device and widely applied to life and work of people. In recent years, with the popularization of intelligent mobile terminals, wireless routers are more and more widely applied. Whether at home or at work, we can conveniently connect to the internet through a wireless router.
In the prior art, authentication login connection is mainly performed through an SSID and a password of a router, and in addition, personal information is bound through modes such as remote mobile phone verification code authentication or WeChat and the like and then the router is logged in. These connection authentication methods are not secure and convenient.
When the terminal is connected with the router, the router authenticates the terminal. At present, the verification is mainly carried out by adopting a password verification mode.
Password authentication is inconvenient to use, for example, when visitors come to home, the visitors need to help the visitors input passwords one by one and connect WiFi. The use is very inconvenient, especially when the visiting capacity is large.
In addition, the password authentication mode is not secure. Currently, many users use software such as "master WiFi key" to log in a router without password, and patent publication No. CN106162818A discloses a method for unlocking a WiFi hotspot, the method includes the following steps: and when the mobile terminal device scans peripheral WIFI hotspot signals, the WIFI shared database of the cloud server end can be searched according to the MAC address (or BSSID) and the WIFI name (or SSID) double indexes of the WIFI hotspot, a corresponding WIFI password is found, and WIFI connection login of the mobile terminal is realized. After logging in the home router in this way, although a more convenient router logging method can be provided, this poses a significant risk to the security of the home router. The way is that the password of the router is stored in a remote server in a certain encryption way, and the password is shared by users. But if the password is leaked, a wide range of security risks can be caused.
In the prior art, some connection methods which are not widely applied exist, for example, the router is connected in a mode of short message verification of a mobile phone and the like, and the use is inconvenient.
Generally, the router connection mainly ensures security and convenience, and the connection method used in the prior art has certain limitations in these aspects, which affect user experience.
Disclosure of Invention
The invention is used for solving the problems of insecurity and inconvenience when the router is connected. In view of the above-mentioned deficiencies of the prior art, a method and system for connecting a router are provided.
The router connection method includes the steps of:
acquiring first serial number information of an NFC chip of a terminal through NFC connection;
authorizing the terminal to connect to a router through WiFi;
acquiring second serial number information of an NFC chip of the terminal through WiFi connection;
judging whether the first number information is the same as the second number information; and if not, disconnecting the WiFi connection with the terminal.
Further, the acquiring the first number information of the NFC chip of the terminal through the NFC connection includes:
setting the working mode of NFC into a card reader mode;
acquiring first serial number information of an NFC chip of a terminal with an NFC working mode being a card mode.
Further, the acquiring the second number information of the NFC chip of the terminal through the WiFi connection includes:
sending a request for acquiring the number information of the NFC chip to the terminal through WiFi connection;
and receiving second serial number information of the NFC chip sent by the terminal through WiFi connection.
Further, when the WiFi connection with the terminal exceeds the preset time, the WiFi connection with the terminal is disconnected.
Further, when the first number information and the second number information do not match for more than a preset number of times, the WiFi connection of the terminal is forbidden in a preset time.
Accordingly, the present invention also provides a router connection system, comprising:
the first serial number information acquisition module is used for acquiring first serial number information of an NFC chip of the terminal through NFC connection;
the connection module is used for authorizing the terminal to connect the router through WiFi;
the second serial number information acquisition module is used for acquiring second serial number information of the NFC chip of the terminal through WiFi connection;
the judging module is used for judging whether the first number information is the same as the second number information; and if not, disconnecting the WiFi connection with the terminal.
Further, the first number information obtaining module includes:
the mode setting submodule is used for setting the working mode of the NFC into a card reader mode;
and the number information acquisition submodule is used for acquiring first number information of an NFC chip of the terminal of which the NFC working mode is the card mode.
Further, the second number information obtaining module includes:
the request sending submodule is used for sending a request for acquiring the number information of the NFC chip to the terminal through WiFi connection;
and the number information receiving submodule is used for receiving second number information of the NFC chip sent by the terminal through WiFi connection.
Further, the router connection system further includes:
and the connection disconnection module is used for disconnecting the WiFi connection with the terminal when the WiFi connection with the terminal exceeds the preset time.
Further, the router connection system further includes:
and the connection forbidding module is used for forbidding the WiFi connection of the terminal within preset time when the first number information is not matched with the second number information for more than preset times.
NFC is near field communication, also known as near field wireless communication, and is a short-range high-frequency wireless communication technology that allows contactless point-to-point data transmission (within ten centimeters) between electronic devices to exchange data.
The number information, including the first number information and the second number information, is inherent information attached to the NFC chip, is related to hardware, and can be used to distinguish different NFC chips.
The router connection method and the system provided by the invention have the following advantages:
the invention adopts NFC technology to realize the connection verification of the mobile phone and the router, is more convenient compared with the prior methods of password input, short message verification of the mobile phone and the like, and the user can be conveniently connected to the router only by starting the NFC function of the terminal and approaching the router.
In addition, the NFC near field communication technology is adopted, the farthest transmission distance is about 10 cm, and terminals with longer distances cannot be connected to the router through the method, so that the safety during connection is improved.
In addition, the method provided by the invention does not need to input the password, avoids the risk of password loss and cracking, and further improves the connection safety.
Drawings
Fig. 1 is a flowchart of a router connection method according to an embodiment of the present invention;
fig. 2 is a flowchart of a router connection method according to a second embodiment of the present invention;
fig. 3 is a block diagram of a router connection system according to a third embodiment of the present invention.
Detailed Description
The following are specific embodiments of the present invention and are further described with reference to the drawings, but the present invention is not limited to these embodiments.
It should also be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention.
The method and the system provided by the invention are applied to the router, and the router and the terminal related to the invention both comprise NFC chips.
Example one
The present embodiment provides a router connection method, a flowchart of which is shown in fig. 1, and the following is detailed with reference to the accompanying drawings:
the router connection method comprises the following steps:
in step S101, first number information of an NFC chip of the terminal is acquired through the NFC connection.
The terminal can be a mobile intelligent terminal such as a mobile phone and a tablet; other devices requiring a WiFi connection to the router are also possible. The terminal is provided with an NFC chip.
The number information is inherent information attached to the NFC chip, and is related to hardware and can be used to distinguish different NFC chips.
Specifically, the user starts the NFC function of the terminal, and when the terminal approaches the router, the NFC chip on the router reads the first serial number information of the NFC chip of the mobile phone.
In step S102, the terminal is authorized to connect to the router via WiFi.
Specifically, after the first serial number information of the NFC chip of the terminal is read, the WiFi connection of the terminal is temporarily authorized by the router NFC chip.
Further, when the WiFi connection with the terminal exceeds the preset time, the WiFi connection with the terminal is disconnected.
Alternatively, the terminal may acquire connection information of the router, such as a Service Set Identifier (SSID) of the router, through NFC connection, and connect to the router directly according to the Service Set Identifier (SSID).
In step S103, second serial number information of the NFC chip of the terminal is acquired through WiFi connection.
Specifically, in step S102, WiFi temporarily connected to the router acquires the second number information in the terminal NFC chip through WiFi.
In step S104, it is determined whether the first number information is the same as the second number information.
The first number information and the second number information are both inherent information of the NFC chip in the terminal, are related to hardware, and can be used to distinguish different NFC chips.
Further, if the second number information acquired through WiFi is the same as the first number information directly read from the NFC chip, it may be considered that the terminal currently applying for WiFi connection is a user terminal with a certain degree of reliability.
In step S105, if not the same, the WiFi connection with the terminal is disconnected.
If the second number information acquired through WiFi is different from the first number information directly read from the NFC chip, the terminal applying WiFi connection at present can be considered to be not authentic, and therefore WiFi connection with the terminal is disconnected.
Optionally, when the WiFi connection with the terminal exceeds a predetermined time, the WiFi connection with the terminal is disconnected.
Further, when the first number information and the second number information do not match for more than a preset number of times, the WiFi connection of the terminal is forbidden in a preset time.
It should be understood that the steps described above are not in the exact order of execution and that all changes that can be envisioned and do not affect the implementation of the functions are intended to be within the scope of the invention.
Example two
The present embodiment provides a router connection method, a flowchart of which is shown in fig. 2, and the following is detailed with reference to the accompanying drawings:
in step S201, the operation mode of NFC is set to the card reader mode.
The operating modes of NFC include a Card mode (Card emulation), a peer-to-peer mode (P2P mode), and a Reader mode (Reader/writer mode). The card reader mode is that the router is used as a non-contact card reader to read the number information of the NFC chip in the terminal.
In step S202, first number information of an NFC chip of a terminal whose NFC operating mode is a card mode is acquired.
And the work mode of the NFC of the terminal is set to be a card mode so that the router can read the first number information of the NFC chip of the terminal.
In step S203, the terminal is authorized to connect to the router via WiFi.
In step S202, after the router reads the first number information of the NFC chip of the terminal, the router authorizes the terminal to connect to the router WiFi.
Further, when the WiFi connection with the terminal exceeds the preset time, the WiFi connection with the terminal is disconnected.
In step S204, a request for acquiring NFC chip number information is sent to the terminal through WiFi connection.
After the terminal and the router establish WiFi connection, the router sends a request for acquiring the number information of the NFC chip to the terminal.
In step S205, the second number information of the NFC chip sent by the terminal is received through WiFi connection.
Specifically, the router receives second serial number information of the NFC chip sent by the terminal through WiFi connection.
In step S206, it is determined whether the first number information is the same as the second number information.
The first number information is inherent information of the NFC chip directly read from the terminal NFC chip through the NFC connection.
The second number information is inherent information of the NFC chip acquired from the terminal through WiFi connection.
The first number information and the second number information are both inherent information which refers to the same NFC chip under normal conditions, are related to NFC hardware, and can be used to distinguish different NFC chips. But the access to the same is different.
When the first number information is the same as the second number information, the terminal may be considered to have a certain degree of confidence, so the terminal is allowed to connect to the router WiFi.
In step S207, if not the same, the WiFi connection with the terminal is disconnected.
In step S206, if the first number information is different from the second number information, the WiFi connection with the terminal is disconnected.
Optionally, when the WiFi connection with the terminal exceeds a predetermined time, the WiFi connection with the terminal is disconnected.
Since the information reading speed is fast, the connection time allowed here can be set short as long as it is guaranteed that the second number information of the NFC is read through the WiFi connection. The specific predetermined time is not a limitation of the present invention.
Further, when the first number information and the second number information do not match for more than a preset number of times, the WiFi connection of the terminal is forbidden in a preset time.
In order to prevent malicious cracking, if the first number information is not matched with the second number information for more than a preset number of times, the WiFi connection of the terminal is forbidden within a preset time.
Alternatively, the predetermined number of times should be set as appropriate, for example, 3 times. The specific times are not limiting of the invention.
It should be understood that the steps described above are not in the exact order of execution and that all changes that can be envisioned and do not affect the implementation of the functions are intended to be within the scope of the invention.
EXAMPLE III
The present embodiment provides a router connection system, a block diagram of which is shown in fig. 3, and detailed below with reference to the accompanying drawings:
the router connection system includes:
a first serial number information obtaining module 310, configured to obtain first serial number information of an NFC chip of a terminal through NFC connection;
a connection module 320, configured to authorize the terminal to connect to a router through WiFi;
a second serial number information obtaining module 330, configured to obtain second serial number information of an NFC chip of the terminal through WiFi connection;
a determining module 340, configured to determine whether the first number information is the same as the second number information; and if not, disconnecting the WiFi connection with the terminal.
Further, the first number information obtaining module 310 includes:
a mode setting submodule 311 configured to set an NFC operating mode to a card reader mode;
the number information obtaining sub-module 312 is configured to obtain first number information of an NFC chip of a terminal whose NFC operating mode is a card mode.
Further, the second number information obtaining module 330 includes:
the request sending submodule 331 is configured to send a request for acquiring NFC chip serial number information to the terminal through WiFi connection;
the number information receiving submodule 332 is configured to receive, through WiFi connection, second number information of the NFC chip sent by the terminal.
Further, the router connection system further includes:
and the connection disconnection module is used for disconnecting the WiFi connection with the terminal when the WiFi connection with the terminal exceeds the preset time.
Further, the router connection system further includes:
and the connection forbidding module is used for forbidding the WiFi connection of the terminal within preset time when the first number information is not matched with the second number information for more than preset times.
The router connection system provided in this embodiment is applied to the router connection methods provided in the first and second embodiments, and the detailed contents have been described in detail in the first and second embodiments, and are not described again here.
Further, the router connection system is applied to a wireless router which comprises an NFC chip.
In the invention, the terminal comprises an NFC chip, and the first number information and the second number information refer to inherent information of the NFC chip on the terminal, are related to hardware and can be used for distinguishing different NFC chips.
It should be understood that the methods and systems described are illustrative and that variations may be made in the actual implementation by adaptation.
In the embodiments provided in this application, it should be understood that the methods and systems described are illustrative and that variations may be made in the actual implementation by adaptation.
In addition, specific names of the functional units or modules are only used for distinguishing one functional unit from another, and are not used for the protection scope of the present invention.
The specific embodiments described herein are merely illustrative of the spirit of the invention. Various modifications or additions may be made to the described embodiments or alternatives may be employed by those skilled in the art without departing from the spirit or ambit of the invention as defined in the appended claims.