Disclosure of Invention
Aiming at the problems in the prior art, the invention provides a safe, reliable and simple-operation automatic login method and system for a mobile application platform.
The invention adopts the verification that whether the MAC address of the intelligent hardware in the current local area network is consistent with the MAC address of the intelligent hardware stored in the local area network or not to finish the automatic login of the APP. After the user successfully finishes registering and logging in the APP, the APP locally saves the current user account and the password, and after the user successfully binds any intelligent hardware product in the local area network, the APP locally saves the MAC address of the intelligent hardware product. When the APP is opened next time, the APP checks whether the MAC address of the intelligent hardware is stored locally, and if not, a manual login mode is entered; if the MAC address of the intelligent hardware is detected to be locally stored and verified, and if the MAC address is verified to be consistent, the account is automatically logged in; if the verification is inconsistent, the manual login mode is entered, so that the complicated operation of manual login of the user can be saved, and the convenient experience of automatic login can be realized.
An automatic login method for a mobile application program comprises the following steps:
step S1, the mobile application program locally saves the physical address of the bound intelligent hardware;
step S2, when the mobile application program receives the opening request, it broadcasts a broadcast instruction containing the bound intelligent hardware physical address into the LAN;
step S3, after receiving the broadcast instruction, the intelligent hardware in the local area network judges whether the physical address is the same as the received physical address, if so, a piece of determining information is fed back to the mobile application program;
and step S4, if the mobile application program receives the determination information sent by the intelligent hardware, the mobile application program automatically logs in.
Preferably, the step S1 further includes a registration step S11:
the mobile application program receives a registration request of a user, completes registration login and stores user information locally.
Preferably, the step S1 further includes a scanning step S12:
the mobile application scans the local area network for all intelligent hardware that is in the local area network.
Preferably, the step S1 is performed with a binding step S13:
and performing association binding on the physical address of the intelligent hardware and the user information in the mobile application program and storing the physical address and the user information locally.
Preferably, before the step S2 of sending the broadcast to the lan, the method further includes a step S21 of: judging whether the number of the locally stored intelligent hardware is larger than 1, if the judgment variable is true, broadcasting a broadcasting instruction containing the bound intelligent hardware physical address into the local area network in sequence, wherein the number of the broadcasting instructions is consistent with the number of the stored intelligent hardware, and if the judgment variable is false, only broadcasting a broadcasting instruction containing the bound intelligent hardware physical address into the local area network.
A mobile application auto-login system, comprising:
the storage module is used for locally storing the physical address of the bound intelligent hardware in the local area network by the mobile application program;
the broadcasting module is used for sending a broadcasting instruction containing the physical address of the bound intelligent hardware to the bound intelligent hardware in the local area network after the mobile application program receives the opening request;
the matching module is used for judging whether the physical address of the intelligent hardware in the local area network is the same as the received physical address or not after receiving the broadcast instruction, and feeding back a determined information broadcast instruction to the mobile application program if the physical address of the intelligent hardware in the local area network is the same as the received physical address;
and the authentication module is used for automatically logging in when the mobile application program receives the broadcast instruction of the determined information sent by the intelligent hardware, or manually logging in.
Preferably, the storage module further comprises a registration unit, configured to receive a registration request from a user, complete registration login, and locally store user information.
Preferably, the storage module further includes a scanning unit, configured to scan the local area network for all the intelligent hardware in the local area network by the mobile application.
Preferably, the storage module further comprises a binding unit, configured to associate and bind the physical address of the intelligent hardware and the user information in the mobile application, and store the association and binding in a local area.
Preferably, the broadcasting module further includes a determining module, configured to determine whether the number of the locally stored intelligent hardware is greater than 1, if the determination variable is true, sequentially broadcast a broadcast instruction including the bound intelligent hardware physical address into the local area network, and if the determination variable is false, only broadcast a broadcast instruction including the bound intelligent hardware physical address into the local area network.
Has the advantages that:
1. the mobile terminal of the user and the intelligent hardware bound by the mobile terminal are located in the same local area network segment, the APP automatically logs in the account, the operation of the user logging in the account is simplified, the APP automatically logs in the account, the APP automatically logs in the user, the mobile terminal and the user's mobile terminal.
2. The user mobile terminal and the intelligent hardware are not in the same local area network, and then the user needs to manually log in the APP account, so that the user APP is prevented from being opened by other people in an extranet in an stealing mode, personal privacy information in the user APP is checked, and the safety of the personal information of the user is guaranteed.
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.
Under the supporting background of removing APP application field prior art in intelligent hardware class product, when the user is using the APP, generally need to log in the APP and just can use, its login mode generally divide into two kinds: the other is a manual login mode, namely, a user manually inputs an account and a password to login, the manual login mode has the characteristics of safety, the APP does not store the account and the password, a hacker attacker cannot steal the account information of the user by cracking the APP, but the manual login increases the action of manual operation of the user, and the operation is complicated, so that the user product experience is poor. The other is that the APP is after successfully registering and logging in for the first time, the user account and password information are automatically stored, when the APP needs to be logged in for the next time, the system can automatically fill the account and the password to log in after the APP is opened, although the user does not need to input the account and the password, the user operation is simplified, the user product experience is better, the APP is automatically and successfully logged in once the APP is opened, the higher information safety risk is realized, the handling control is not easy, and the possibility that the information is stolen is increased.
Example one
Referring to fig. 1-3, the present invention provides an automatic login method for a mobile application, comprising the following steps:
in step S1, the mobile application locally saves the physical address of the bound intelligent hardware.
Further, with the tidal current of the internet of things, the intelligent community and the intelligent home attacking people surly, all products and service designs strive for intellectualization and automation, so that the purposes of simplifying things and making things convenient for people's lives are achieved, the mobile APP is specifically the mobile APP matched with the intelligent hardware products, the intelligent hardware terminals in the internet of things or the intelligent community or the intelligent home can be bound, and all the bound intelligent hardware is controlled and the terminals are checked.
The step S1 further includes a registration step S11:
the mobile application program receives a registration request of a user, completes registration login and stores user information locally.
When a mobile APP matched with an application intelligent hardware product is used, a user needs to complete a registration step during initial login, manual login of an account password is performed at a mobile APP client after a user account and a password are set, and meanwhile, the mobile APP client establishes a user information database locally to store user information of the user. For example, after a user logs in for the first time, the user account name is set to be 'Zhang III', the password is 'ABC 123', after the user is registered successfully, the user enters a login interface, the mobile APP automatically packages data such as user information 'Zhang III', and 'ABC 123' to produce a user information table, and meanwhile, the user information table is stored in a local database of the mobile APP for later login query.
The step S1 further includes a scanning step S12:
the mobile application scans the local area network for all intelligent hardware that is in the local area network.
When the mobile APP client is in operation, the mobile APP client must be in a network environment (or connected in a wireless network or connected in a mobile network), and after the first registration and login step is completed, the mobile APP starts to scan and search all intelligent hardware in a local area network where the mobile APP client is located (which may be deployed in a micro or small local area network under a small mobile base station, or may be viewed in a wireless routing local area network established by a router). For example, when a user is at home, a mobile terminal for logging in a mobile APP is a mobile phone, a network of the mobile phone is connected to a 4G (fourth generation mobile communication technology) network of telecommunications, a network mode is FDD-LTE (frequency division duplex long term evolution), a signal is sent by a base station, and at this time, a mobile APP client starts scanning and searching a 4G base station where the mobile APP client is located to search for all intelligent hardware in a local area network; or at this time, after the user logs in, the mobile phone is not connected with the mobile network but connected with a home WLAN (wireless local area network) configured by the home router, and the mobile APP client starts to scan and search the WLAN where the mobile APP client is located to find all intelligent hardware in the local area network.
The step S1 further includes a binding step S13:
and performing association binding on the physical address of the intelligent hardware and the user information in the mobile application program and storing the physical address and the user information locally.
After scanning and searching all the intelligent hardware in the local area network, for example, scanning and searching the intelligent hardware A, B, C, D, E, F and G, acquiring the intelligent hardware information of all the intelligent hardware, wherein the intelligent hardware information includes MAC address (physical address) information of all the intelligent hardware, further, the mobile APP client displays all the searched intelligent hardware information on a mobile APP client terminal screen, if a terminal used by Zhang three of the user is a mobile phone, all the searched information of the intelligent hardware A, B, C, D, E, F and G is displayed on the mobile phone screen, the user selects the own intelligent hardware A, B, C, E and F to bind after seeing the information, the mobile APP associates the intelligent hardware information with the own mobile APP account number, and establishes an intelligent hardware information list in a local database, and storing the MAC address information of the intelligent hardware owned by the user. And until the step, the user registers and logs in for the first time and the whole process of binding the intelligent hardware is finished, if the user needs to log in the mobile APP again next time and the user is in the same local area network as that of binding the intelligent hardware, the mobile APP can successfully complete the automatic login after the following steps.
Step S2, when the mobile application receives the open request, it broadcasts a broadcast instruction containing the bound intelligent hardware physical address into the lan.
After the user registers and logs in for the first time and the intelligent hardware is bound successfully, the mobile APP can automatically send broadcast to the local area network where the mobile APP terminal is located when the user needs to log in the mobile APP again to check the management control of the intelligent hardware next time.
Before the step S2 sends the broadcast to the lan, the method further includes a step S21:
judging whether the number of the locally stored intelligent hardware is larger than 1, if the judgment variable is true, broadcasting a broadcasting instruction containing the bound intelligent hardware physical address into the local area network in sequence, wherein the number of the broadcasting instructions is consistent with the number of the stored intelligent hardware, and if the judgment variable is false, only broadcasting a broadcasting instruction containing the bound intelligent hardware physical address into the local area network.
Further, when the user needs to log in the mobile APP again, the mobile APP is started on the terminal, the mobile APP inquires whether the local database user information table contains user information, Zhang III inquires data information containing Zhang III in the user information table when the mobile APP logs in again, the mobile APP accesses the intelligent hardware information list of the query database again, judges whether the physical address of the intelligent hardware is stored locally, if not, the mobile APP enters a manual login mode, because the user Zhang III has bound the intelligent hardware A, B, C, E and F in the first registration login binding process, the mobile APP inquires the intelligent hardware in the intelligent hardware information list that the bound intelligent hardware exists, the next step is continued, if the user Li IV has not bound any intelligent hardware in the first registration login process, the mobile APP does not inquire any intelligent hardware information when accessing the intelligent hardware information list of the database, then lie four needs to perform manual login operation again and bind the own owned intelligent hardware, and the operation of the mobile APP can be performed next time after the binding is successful.
When the mobile APP accesses the intelligent hardware information list of the query database to query that one or more pieces of intelligent hardware information are contained, the mobile APP sends a broadcast instruction containing an MAC address to the bound intelligent hardware in the local area network, if only one piece of intelligent hardware information is contained, only one broadcast instruction containing the MAC address is sent, if a plurality of pieces of intelligent hardware information are queried, the mobile APP sequentially sends a broadcast instruction containing the MAC address, and the number of the sent broadcast instructions is consistent with the number of the bound intelligent hardware.
Step S3, after receiving the broadcast instruction, the intelligent hardware in the local area network determines whether its own physical address is the same as the received physical address, and if so, feeds back a piece of determination information to the mobile application program.
After the intelligent hardware in the current local area network receives the broadcast instruction containing the MAC address, the intelligent hardware decodes and compiles the broadcast instruction containing the MAC address, whether the MAC address of the intelligent hardware is the same as the MAC address contained in the received broadcast instruction or not is judged after decoding and compiling are completed, if the MAC address of the intelligent hardware is the same as the MAC address contained in the broadcast instruction, the user does not need to perform manual login operation again, and the mobile APP can automatically log in; if the MAC address of the intelligent hardware is different from the MAC address contained in the broadcast instruction, the user needs to perform manual login operation. For example, if the user zhang san is currently in the local area network X, 5 pieces of intelligent hardware devices A, B, C, E and F are bound to the user zhang san, the mobile APP sequentially sends a broadcast instruction containing a MAC address to the local area network X, and if the broadcast instruction is sent for 5 times in total, the MAC address of the intelligent hardware is verified to be the same as the MAC address contained in the broadcast instruction, and then the user zhang san can automatically log in the mobile APP without manually logging in. On the contrary, if Zhang Sanjue is in the local area network Y, 5 pieces of intelligent hardware devices A, B, C, E and F are inquired and bound, the mobile APP sequentially sends broadcast instructions containing MAC addresses to the local area network Y, the broadcast instructions are sent for 5 times in total, and it is not verified that the MAC addresses of the intelligent hardware are the same as the MAC addresses contained in the broadcast instructions, then the user Zhang Sane needs to manually log in the mobile APP.
And step S4, if the mobile application program receives the determination information sent by the intelligent hardware, the mobile application program automatically logs in.
Furthermore, if only one piece of intelligent hardware in the current local area network is verified, the MAC address of the intelligent hardware is determined to be the same as the MAC address contained in the broadcast instruction, and then the user can automatically log in the mobile APP.
Example two
Referring to fig. 4-5, the present invention provides an automatic login system for mobile applications, comprising:
storage module for mobile application program locally stored in local area network bound intelligent hardware object
And (4) processing the address.
And the registration unit is used for receiving the registration request of the user by the mobile application program, finishing registration and login and locally storing the user information.
When logging in for the first time, a user needs to complete a registration step, a user account and a password are set, and meanwhile, the mobile APP client establishes an information database of the user locally to store user information of the user for later login query.
And the scanning unit is used for scanning and searching all intelligent hardware in the local area network by the mobile application program.
The mobile APP client is in a network environment under the condition of operation, and after the first registration and login step is completed, the mobile APP starts to scan and search all intelligent hardware in a local area network where the mobile APP client is located.
And the binding unit is used for performing association binding on the physical address of the intelligent hardware and the user information in the mobile application program and storing the physical address and the user information in a local area.
After scanning and searching all intelligent hardware that are in the LAN, for example, the scanning searches intelligent hardware, acquire the intelligent hardware information of all intelligent hardware, wherein include the MAC address information of all intelligent hardware, and is further, remove the APP client and show all intelligent hardware information that search on removing APP client terminal screen, the user binds the intelligent hardware that the selection oneself owns three times, remove the APP and associate these intelligent hardware information with the removal APP account number of oneself, establish intelligent hardware information list in local database, store the MAC address information of the intelligent hardware that the user owns.
And the broadcast module is used for sending a broadcast instruction containing a physical address to the bound intelligent hardware in the local area network after the mobile application program receives the opening request.
After the user registers and logs in for the first time and the intelligent hardware is bound successfully, the mobile APP can automatically send broadcast to the local area network where the mobile APP terminal is located when the user needs to log in the mobile APP again to check the management control of the intelligent hardware next time.
Further, when the user needs to log in the mobile APP again, the mobile APP is opened on the terminal, meanwhile, the mobile APP can inquire whether the user information table of the local database contains the user information, if yes, the mobile APP accesses the intelligent hardware information list of the inquiry database again, whether the physical address of the intelligent hardware is stored locally is judged, and if not, the mobile APP enters a manual login mode.
The broadcasting module also comprises a judging unit used for judging whether the number of the intelligent hardware stored locally is larger than 1, if the judgment variable is true, broadcasting a broadcasting instruction containing the bound intelligent hardware physical address into the local area network in sequence, wherein the number of the broadcasting instructions is consistent with the number of the intelligent hardware stored, and if the judgment variable is false, only broadcasting a broadcasting instruction containing the bound intelligent hardware physical address into the local area network.
When the mobile APP accesses the intelligent hardware information list of the query database to query that one or more pieces of intelligent hardware information are contained, the mobile APP sends a broadcast instruction containing an MAC address to the bound intelligent hardware in the local area network, if only one piece of intelligent hardware information is contained, only one broadcast instruction containing the MAC address is sent, if a plurality of pieces of intelligent hardware information are queried, the mobile APP sequentially sends a broadcast instruction containing the MAC address, and the number of the sent broadcast instructions is consistent with the number of the bound intelligent hardware.
And the matching module is used for judging whether the physical address of the intelligent hardware in the local area network is the same as the received physical address or not after receiving the broadcast instruction, and feeding back a determined information broadcast instruction to the mobile application program if the physical address of the intelligent hardware in the local area network is the same as the received physical address.
And the authentication module is used for automatically logging in when the mobile application program receives the determination information sent by the intelligent hardware.
After the intelligent hardware in the current local area network receives the broadcast instruction containing the MAC address, the intelligent hardware decodes and compiles the broadcast instruction containing the MAC address, judges whether the MAC address of the intelligent hardware is the same as the MAC address contained in the received broadcast instruction after the decoding and compiling are finished, and sends out the broadcast instruction of the determination information if the MAC address of the intelligent hardware is the same as the MAC address contained in the received broadcast instruction; if not, no broadcast command is sent.
Furthermore, if only one piece of intelligent hardware in the current local area network is verified, the MAC address of the intelligent hardware is determined to be the same as the MAC address contained in the broadcast instruction, and then the user can automatically log in the mobile APP.
The mobile application program is used for automatically logging in when receiving the broadcast instruction of the determined information sent by the intelligent hardware, otherwise, manually logging in.
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.