Disclosure of Invention
In view of this, embodiments of the present application provide a login method, device, and system to achieve the purpose of logging in an application server on the basis of reducing the update maintenance time of the application server.
In order to achieve the above purpose, the technical solutions provided in the embodiments of the present application are as follows:
a login method, comprising:
receiving a login request indicating that an account exists under the condition that the application server is started;
determining whether the basic data of the account number is stored in a flash memory server;
if the basic data are stored in the flash memory server, loading the basic data from the flash memory server, and logging in the account on the application server based on the basic data;
if the basic data is not stored in the flash memory server, loading the basic data from a database associated with the application server, and logging in the account on the application server based on the basic data;
the basic data is data which is stored in the application server and is only corresponding to the account when the account logs out of the application server last time; the account logging out of the application server comprises the step of logging out the account from the application server in response to account logging-out operation, or the application server logged in with the account stops running.
Preferably, when the account logs out of the application server and the application server logged in with the account stops running,
updating the data which is stored in the application server and is uniquely corresponding to the account number to the flash memory server so that the flash memory server can update the data to the database, and deleting the data in the flash memory server after determining that the data is updated to the database.
Preferably, when the login of the account to the application server includes login of the account from the application server in response to an account login operation,
and updating the data which is stored in the application server and is uniquely corresponding to the account number to the database.
Preferably, the determining whether the flash memory server stores the basic data of the account includes:
judging whether the login request is a login request indicating the account number and received for the first time under the condition that the application server is started;
and if the login request is the login request indicating the account number and received for the first time under the condition that the application server is started, determining whether the flash memory server stores the basic data of the account number.
Preferably, if the login request is not a login request indicating that the account is received for the first time when the application server is started, the method further includes:
the steps of loading the base data from a database associated with the application server and logging the account number on the application server based on the base data are performed.
A login apparatus, comprising:
a request receiving unit, configured to receive a login request indicating that an account exists, when the application server is started;
a basic data determining unit, configured to determine whether the flash memory server stores the basic data of the account;
a first login unit, configured to load the basic data from the flash memory server if the basic data is stored in the flash memory server, and login the account on the application server based on the basic data;
a second login unit, configured to load the basic data from a database associated with the application server if the basic data is not stored in the flash memory server, and log in the account on the application server based on the basic data;
the basic data is data which is stored in the application server and is only corresponding to the account when the account logs out of the application server last time; the account logging out of the application server comprises the step of logging out the account from the application server in response to account logging-out operation, or the application server logged in with the account stops running.
Preferably, the apparatus further comprises a first updating unit, configured to:
when the account logs out of the application server and the application server logged with the account stops running, updating data stored in the application server and uniquely corresponding to the account to the flash memory server so that the flash memory server can update the data to the database, and deleting the data in the flash memory server after determining that the data is updated to the database.
Preferably, the apparatus further comprises a second updating unit, configured to:
when the account logs out of the application server includes that the account logs out of the application server in response to an account logging-out operation, updating data which is stored in the application server and uniquely corresponds to the account to the database.
A login system comprising an application server, a flash memory server and a database, wherein the application server is configured to:
receiving a login request indicating that an account exists under the condition that the application server is started;
determining whether the basic data of the account is stored in the flash memory server;
if the basic data are stored in the flash memory server, loading the basic data from the flash memory server, and logging in the account on the application server based on the basic data;
if the basic data is not stored in the flash memory server, loading the basic data from the database associated with the application server, and logging in the account on the application server based on the basic data;
the basic data is data which is stored in the application server and is only corresponding to the account when the account logs out of the application server last time; the account logging out of the application server comprises the step of logging out the account from the application server in response to account logging-out operation, or the application server logged in with the account stops running.
Preferably, the application server is further configured to update data stored in the application server and uniquely corresponding to the account to the flash memory server when the account logs out of the application server and the application server logged in with the account stops running;
the flash memory server is used for updating the data to the database, and deleting the data in the flash memory server after determining that the data is updated to the database.
The embodiment of the application provides a login method, which comprises the steps of receiving a login request indicating an account under the condition that an application server is started; determining whether basic data of an account number is stored in a flash memory server; if yes, loading basic data from the flash memory server, and logging in an account on the application server based on the basic data; if not, basic data is loaded from a database associated with the application server, and an account is logged in the application server based on the basic data (when the basic data is the latest account logged out of the application server, the data stored in the application server uniquely corresponds to the account), so that the latest basic data of the account can be loaded from the flash memory server/database to realize account logging, further, the situation that only the basic data of the online account is stored in the database when the application server is updated and maintained is avoided, and the purpose of logging in the application server is realized on the basis of reducing the updating and maintaining time of the application server.
Example (b):
fig. 1 is a flowchart of a login method according to an embodiment of the present application.
As shown in fig. 1, the method includes:
s101, receiving a login request indicating that an account exists under the condition that the application server is started;
optionally, when the application server corresponding to the application is already started, the application server may receive a login request, where the login request indicates an account to be logged in.
Optionally, the login request may be sent by the user through an application client of the application.
S102, determining whether basic data of the account are stored in a flash memory server; if the flash memory server stores the basic data, executing step S103; if the basic data is not stored in the flash memory server, executing step S104;
optionally, the basic data is data uniquely corresponding to the account and stored in the application server when the account logs out of the application server last time.
The account logging out of the application server comprises the step of logging out the account from the application server in response to account logging-out operation, or the application server logged in with the account stops running.
Wherein logging out the account from the application server in response to an account logging out operation comprises: and responding to an account login operation input by a user, and logging out the account from the application server. Optionally, the user may input an account logout operation through the application client of the application (for example, the user clicks an account logout button on the application client of the application to input an account logout operation, and logs out an account currently logged in on the application client).
Optionally, when the basic data is that the account logs out of the application server last time, the data stored in the application server and uniquely corresponding to the account is: and the data which is stored in the memory of the application server and uniquely corresponds to the account number.
S103, loading the basic data from the flash memory server, and logging in the account on the application server based on the basic data;
optionally, if the flash memory server stores the basic data, the basic data is loaded from the flash memory server, and the account is logged in the application server based on the basic data.
Further, the basic data is loaded from the flash memory server, and the basic data in the flash memory server is deleted after the account is logged in the application server based on the basic data.
S104, loading the basic data from a database associated with the application server, and logging in the account on the application server based on the basic data.
Optionally, if the flash memory server does not store the basic data, loading the basic data from a database associated with the application server, and logging in the account on the application server based on the basic data.
Optionally, when the account logs out of the application server and the application server logged in with the account stops operating, the data stored in the application server and uniquely corresponding to the account is updated to the flash memory server, so that the flash memory server updates the data to the database, and after the data is determined to be updated to the database, the data in the flash memory server is deleted.
In this embodiment of the application, preferably, after updating the data stored in the application server and uniquely corresponding to the account to the flash memory server, the flash memory server will automatically update the data received by the flash memory server to a database associated with the application server (i.e., the database appearing in step S104), and will delete the data in the flash memory server after updating the update to the database associated with the application server.
Correspondingly, after the application server logged with the account stops operating, the application server can be continuously updated and maintained and then restarted as long as the data which is stored in the application server and uniquely corresponds to the account is updated to the flash memory server, and the application server can be continuously updated and maintained and then restarted without waiting for the data which is uniquely corresponding to the account to be updated to the database. The time for updating the data to the flash memory server is far shorter than the time for storing the data into the database, so that the aim of logging in the application server can be fulfilled on the basis of reducing the updating and maintaining time of the application server.
Optionally, when the login of the account from the application server includes a login of the account from the application server in response to an account login operation, the data uniquely corresponding to the account stored in the application server is updated to the database.
In this embodiment of the application, it is preferable that, if the account is logged out from the application server in response to an account log-out operation, the data uniquely corresponding to the account stored in the application server is updated to the database without stopping running the application server.
Fig. 2 is a flowchart of another login method according to an embodiment of the present application.
As shown in fig. 2, the method includes:
s201, receiving a login request indicating an account under the condition that the application server is started;
s202, judging whether the login request is the login request indicating the account number received for the first time under the condition that the application server is started; if yes, go to step S203; if not, go to step S205;
optionally, under the condition that the application server is started, receiving a login request indicating that an account exists, and determining whether the login request is the login request indicating that the account exists, which is received for the first time after the application server is started this time; if yes, go to step S203; if not, go to step S205.
S203, determining whether the basic data of the account is stored in the flash memory server; if the flash memory server stores the basic data, executing step S204; if the basic data is not stored in the flash memory server, executing step S205;
s204, loading the basic data from the flash memory server, and logging in the account on the application server based on the basic data;
s205, loading the basic data from a database associated with the application server, and logging in the account on the application server based on the basic data.
Optionally, the execution process of steps S203 to S205 provided in this embodiment is the same as the execution process of steps S102 to S104 provided in the above embodiment, and for the execution process of steps S203 to S205, refer to the execution process of steps S102 to S104 provided in the above embodiment, which is not limited herein.
The embodiment of the application provides a login method, which comprises the steps of receiving a login request indicating an account under the condition that an application server is started; determining whether basic data of an account number is stored in a flash memory server; if yes, loading basic data from the flash memory server, and logging in an account on the application server based on the basic data; if not, basic data is loaded from a database associated with the application server, and an account is logged in the application server based on the basic data (when the basic data is the latest account logged out of the application server, the data stored in the application server uniquely corresponds to the account), so that the latest basic data of the account can be loaded from the flash memory server/database to realize account logging, further, the situation that only the basic data of the online account is stored in the database when the application server is updated and maintained is avoided, and the purpose of logging in the application server is realized on the basis of reducing the updating and maintaining time of the application server.
Fig. 3 is a schematic structural diagram of a login device according to an embodiment of the present application.
As shown in fig. 3, the apparatus includes:
a request receiving unit 31, configured to receive, when the application server is started, a login request indicating that an account exists;
a basic data determining unit 32, configured to determine whether the flash server stores the basic data of the account;
a first login unit 33, configured to, if the flash server stores the basic data, load the basic data from the flash server, and log in the account on the application server based on the basic data;
a second login unit 34, configured to, if the basic data is not stored in the flash server, load the basic data from a database associated with the application server, and log in the account on the application server based on the basic data;
the basic data is data which is stored in the application server and is only corresponding to the account when the account logs out of the application server last time; the account logging out of the application server comprises the step of logging out the account from the application server in response to account logging-out operation, or the application server logged in with the account stops running.
Further, an embodiment of the present application provides a login apparatus, further including a first updating unit, configured to: when the account logs out of the application server and the application server logged with the account stops running, updating data stored in the application server and uniquely corresponding to the account to the flash memory server so that the flash memory server can update the data to the database, and deleting the data in the flash memory server after determining that the data is updated to the database.
Further, an embodiment of the present application provides a login apparatus, further including a second updating unit, configured to: when the account logs out of the application server includes that the account logs out of the application server in response to an account logging-out operation, updating data which is stored in the application server and uniquely corresponds to the account to the database.
Optionally, the basic data determining unit is specifically configured to: judging whether the login request is a login request indicating the account number and received for the first time under the condition that the application server is started; and if the login request is the login request indicating the account number and received for the first time under the condition that the application server is started, determining whether the flash memory server stores the basic data of the account number.
Further, if the login request is not the login request indicating the account number received for the first time under the condition that the application server is started, the step of "loading the basic data from the database associated with the application server and logging in the account number on the application server based on the basic data" provided by the second login unit in the embodiment of the present application is executed.
Fig. 4 is a schematic structural diagram of a login system according to an embodiment of the present application.
As shown in fig. 4, the system includes: an application server 41, a flash server 42, and a database 43, wherein the application server is configured to:
receiving a login request indicating that an account exists under the condition that the application server is started;
determining whether the basic data of the account is stored in the flash memory server;
if the basic data are stored in the flash memory server, loading the basic data from the flash memory server, and logging in the account on the application server based on the basic data;
if the basic data is not stored in the flash memory server, loading the basic data from the database associated with the application server, and logging in the account on the application server based on the basic data;
the basic data is data which is stored in the application server and is only corresponding to the account when the account logs out of the application server last time; the account logging out of the application server comprises the step of logging out the account from the application server in response to account logging-out operation, or the application server logged in with the account stops running.
Further, the application server in the login system provided by the embodiment of the present application is further configured to: when the account logs out of the application server and the application server logged in with the account stops running, updating data stored in the application server and uniquely corresponding to the account to the flash memory server; the flash memory server is used for updating the data to the database, and deleting the data in the flash memory server after determining that the data is updated to the database.
Further, the application server in the login system provided by the embodiment of the present application is further configured to: when the account logs out of the application server includes that the account logs out of the application server in response to an account logging-out operation, updating data which is stored in the application server and uniquely corresponds to the account to the database.
The embodiment of the application provides a login device and a login system, which receive a login request indicating an account under the condition that an application server is started; determining whether basic data of an account number is stored in a flash memory server; if yes, loading basic data from the flash memory server, and logging in an account on the application server based on the basic data; if not, basic data is loaded from a database associated with the application server, and an account is logged in the application server based on the basic data (when the basic data is the latest account logged out of the application server, the data stored in the application server uniquely corresponds to the account), so that the latest basic data of the account can be loaded from the flash memory server/database to realize account logging, further, the situation that only the basic data of the online account is stored in the database when the application server is updated and maintained is avoided, and the purpose of logging in the application server is realized on the basis of reducing the updating and maintaining time of the application server.
In order to facilitate understanding of the login method provided in the embodiments of the present application, the login method, the apparatus and the system provided in the embodiments of the present application are described in detail by an example:
if the application server needs to be updated and maintained in the operation process, stopping operating the application server, and updating the basic data of the current online account in the application server to a flash memory server associated with the application server; and after receiving the basic data, the flash memory server updates the basic data to a database associated with the application server.
Optionally, there are various ways for the flash server to update the basic data to the database (for example, after receiving the basic data, the flash server automatically updates the basic data to the database until all updates are completed, or after receiving the basic data, the flash server updates the basic data to the database according to a preset update frequency), which is not limited herein.
After the basic data of the current online account in the application server is updated to the flash memory server associated with the application server, no matter whether the flash memory server updates the basic data received by the flash memory server to the database or not, the process of performing subsequent update maintenance on the application server (the update maintenance does not involve the process of updating the basic data to the database) and starting the application server after the update maintenance is completed can be performed.
And if the application server logs out the account from the application server in response to an account login operation in the running process, updating the data which is stored in the application server and is uniquely corresponding to the account to the database.
When the application server needs to be updated and maintained, the subsequent update and maintenance are carried out on the application server instead of waiting for updating the basic data of the current online account in the application server to the database, so that the application server is started after the update and maintenance are completed; after the basic data of the current online account in the application server is updated to the flash memory server, subsequent updating and maintenance can be directly performed on the application server, so that the application server is started after the updating and maintenance are completed, and the account login is realized based on the login method, the login device and the login system provided by the embodiment of the application. Because the time length for updating the basic data to the flash memory server is much shorter than the time length for updating the basic data to the database, compared with the prior art, the method can realize the aim of logging in the application server on the basis of reducing the updating and maintaining time length of the application server.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
The above are merely preferred embodiments of the present application to enable those skilled in the art to understand or implement the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.