Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail and completely with reference to the following specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Before each application embodiment is described in detail, it should be noted that "first" and "second" of "first client" and "second client" and "first device" and "second device" described in the application embodiment are not ordinal words, but are used for clearly explaining the present solution to distinguish different clients from different devices.
The technical solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.
The embodiment of the application provides a method for establishing a password-free login relationship, which is used for solving the problem that in the prior art, when a client logs in an account, a server needs to verify whether a corresponding relationship exists between the account and a client identifier, so that the burden of the server in processing the user login is increased. The specific flow diagram of the method is shown in fig. 2, and specifically comprises the following steps:
s201: the server receives a common login request carrying an account number, a password and a first client identifier.
The "first client" described in this step refers to software installed in the first device (e.g., APP installed in a mobile phone, application software installed on a computer, etc.); the first client sends a common login request to the server, wherein the common login request comprises an account number, a password, a first client identifier and the like.
The following describes in detail a process in which the first client sends a common login request to the server, taking "the first client" as an APP installed in the mobile phone as an example:
when a user logs in an account in an old mobile phone (second device) before, a server establishes a password-free login relationship between the account and an APP identifier (second client), when the user logs in the account on a new mobile phone after changing to the new mobile phone (first device), as shown in fig. 3, the APP provides a login interface for the user, after the user inputs the account and a password on the login interface, a common login request is sent to the server by clicking or touching a login button, and the common login request carries the account and the password of the user logging in the APP and the first client identifier.
After receiving the common login request sent by the first client, the server obtains the account, the password and the first client identifier carried in the common request.
The "first device" and the "second device" described in the embodiments of the present application may be a desktop computer, a notebook, a tablet computer, or the like, in addition to the mobile phone mentioned in fig. 3, and are not limited specifically herein.
S202: and after the account and the password pass the verification, searching whether a second client identifier having a corresponding relationship with the account exists, if so, executing S203, otherwise, executing S204.
As shown in fig. 3, after the server obtains the account, the password, and the first client identifier carried in the ordinary request, the server verifies the identity of the user according to the account and the password, that is, verifies whether the account and the password are correct. And after the verification is passed, the server side searches whether a second client side identifier which has a corresponding relation with the account already exists.
After the identity of the user is successfully authenticated by the server, the server provides a secret-free login service for the user, and specifically, the server establishes a secret-free login relationship between the account and the first client.
In the background art, in practical applications, software identifiers corresponding to the same software installed in different devices are different, that is, each software identifier has a corresponding relationship with a client, and therefore, a server can establish a secret-free login relationship between an account and a first client identifier by establishing a corresponding relationship between the account and the first client identifier.
However, before the server establishes the correspondence between the account and the first client identifier, it needs to search whether a second client identifier having a correspondence with the account exists, assuming that the second client is software installed in the second device. That is, before establishing the login-free relationship between the account and the first client, the server first needs to find out whether a second client having the login-free relationship with the account exists.
S203: and sending an account clearing instruction to the second client according to the second client identifier, so that the second client clears the account locally recorded by the second client, and the server establishes the corresponding relationship between the account and the first client identifier and eliminates the corresponding relationship between the account and the second client identifier.
As for the above S202, if the server finds, through searching, that there is a second client identifier having a corresponding relationship with the account, the server sends an account clearing instruction to the second client according to the second client identifier, and the server establishes a corresponding relationship between the account and the first client identifier, and meanwhile, rejects the corresponding relationship between the account and the second client identifier.
After receiving the account clearing instruction sent by the server, the second client clears the account recorded in the local, where a specific account clearing process is described in detail in the method for clearing an account provided in the embodiment of the present application below.
In this step, the method for the server to send the account clearing instruction to the second client may be that the server sends the account clearing instruction to the second client in a Push manner, or other manners of sending the instruction, which is not limited specifically herein.
In addition, the server side can send an account clearing instruction to the second client side when the self load is smaller than the preset load. For example, at a certain time, if the number of users accessing the server is huge, the load of the server itself will increase accordingly, and at this time, if the server sends an account clearing instruction to the client, the load of the server will increase again.
In view of the above problems, in the secret-free login method provided by the present application, the server may set a preset load in advance, and when the load of the server is smaller than the preset load, send an account clearing instruction to the client.
The server side can also send an account clearing instruction to the second client side within a preset time period. For example, in practical application, the number of the user login APPs is less than that of the users in other time periods within a time period of 4: 00-6: 00 in the morning every day, the time period can be a preset time period of 4: 00-6: 00 ", and the server sends an account clearing instruction to the second client when the time period is reached every day.
S204: and the server establishes a corresponding relation between the account and the first client identifier.
For the above S202, if the server finds that there is no second client identifier having a corresponding relationship with the account through searching, the server may directly establish a corresponding relationship between the account and the first client identifier.
As known from the background art, the second client sends the secret-free login request to the server side to satisfy three conditions: the method comprises the steps that under the condition one, before a first client sends a common login request to a server, the server already establishes a corresponding relation between an account and a second client identifier; the second client can send a secret-free login request to the server only when the second client is started; and under the third condition, the account number must be locally recorded in the second client, so that the second client can send a secret-free login request carrying the account number and the second client identifier to the server.
As long as any one of the above conditions is not satisfied, the second client cannot send the secret-free login request to the server, so that if the second client wants to avoid sending the secret-free login request to the server, the third condition can be changed. In the method provided by the embodiment of the application, the server sends the account clearing instruction to the second client, so that the second client clears the account recorded on the local, the second client cannot send the password-free login request to the server, and the server does not need to verify whether the account corresponds to the second client identifier, thereby reducing the burden of the server.
The embodiment of the application also provides a method for clearing the account, which is also used for solving the problem that in the prior art, when a client logs in the account, a server needs to verify whether the account and the client identifier have a corresponding relationship, so that the burden of the server in processing the user login is increased. The specific flow diagram of the method is shown in fig. 4, and specifically includes the following steps:
s401: and the second client receives an account clearing instruction sent by the server.
And the clearing instruction is sent by the server according to a second client identifier after the server verifies a common login request carrying an account, a password and the first client identifier and finds the second client identifier corresponding to the account.
In this step, there are three situations in which the second client receives the account clearing instruction sent by the server, which are specifically as follows:
the first case: and when the second client terminal logs in the account, receiving an account clearing instruction sent by the server terminal.
The second case: and when the second client does not log in the account and is in the running state, receiving an account clearing instruction sent by the server.
The third situation: and when the second client side is in an initialization process, receiving an account clearing instruction sent by the server side, wherein the initialization process is carried out before the second client side sends a password-free login request to the server side.
S402: and clearing the account number locally recorded by the second client according to the account number clearing instruction.
As shown in fig. 5, after the second client receives an account clearing instruction sent by the server, the account of the local record is cleared. In practical applications, the account recorded by the second client is the account that the second client logs in last, and besides the account, the second client also records the corresponding relationship between the account and the identifier of the second client. Therefore, according to the account clearing instruction, the second client may clear the account recorded locally, may also clear the correspondence between the account and the second client identifier, may also clear the operation data corresponding to the account recorded locally, and the like.
In the following, in a case that the three second clients described in S401 receive an account clearing instruction sent by the server, the second client will be described in detail in terms of clearing an account recorded in the local according to the account instruction:
for the first case:
after the second client clears the account recorded locally according to the account clearing instruction, the second client may log out the account and display a login interface (as shown in fig. 5), or may not log out the account and maintain the login state of the account.
For the second case:
and after the account number recorded in the local is cleared at the second client according to the account number clearing instruction, displaying a login interface when the second client logs in the account number.
For the situation, before the first client requests the ordinary login, the third client may log in the account, and after the server verifies the ordinary login request, the server may notify the third client to log in the account according to the account and display a login interface; alternatively, the server may not notify the third client to log in the account, so as to allow the third client to maintain the login status of the account.
For the third case:
and in the process of initializing the second client, clearing the account number locally recorded by the second client according to the received account number clearing instruction. Because the second client needs to initialize first when being started, and then initiates the password-free login according to the recorded account number, and the second client can already establish communication connection with the server when being initialized, the second client can receive a clearing instruction sent by the server in the initialization process and needs to clear the account number locally recorded by the second client in the initialization process, so that the second client does not initiate the password-free login to the server because the second client cannot obtain the account number locally recorded after the initialization process is finished.
Correspondingly, the application also provides a device for establishing the password-free login relationship, which is used for solving the problem that in the prior art, when a client logs in an account, a server needs to verify whether the account and the client identifier have a corresponding relationship, so that the burden of the server in processing the user login is increased. The specific structural diagram of the device is shown in fig. 6, and the device comprises the following units:
a receiving unit 601, a searching unit 602, a sending unit 603 and a establishing unit 604; wherein the content of the first and second substances,
the receiving unit 601 receives a common login request carrying an account, a password and a first client identifier;
the searching unit 602, after passing the verification according to the account and the password, searches whether a second client identifier having a corresponding relationship with the account already exists;
the sending unit 603, if a second client identifier having a corresponding relationship with the account exists, sends an account clearing instruction to the second client according to the second client identifier, so that the second client clears the account locally recorded by the second client;
the establishing unit 604 establishes a corresponding relationship between the account and the first client identifier, and eliminates the corresponding relationship between the account and the second client identifier.
The specific working process of the embodiment of the device is as follows: the receiving unit 601 first receives a common login request carrying an account, a password and a first client identifier, after the account and the password pass verification, the searching unit 602 searches whether a second client identifier having a corresponding relationship with the account already exists, if so, the sending unit 603 sends an account clearing instruction to the second client according to the second client identifier, so that the second client clears the account locally recorded by the second client, and the establishing unit 604 establishes a corresponding relationship between the account and the first client identifier and clears the corresponding relationship between the account and the second client identifier.
For example, in an implementation manner, the sending unit 603 sends an account clearing instruction to the second client, and the method specifically includes:
when the self load of the device is smaller than a preset load, the sending unit 603 sends an account clearing instruction to the second client; or
In a preset time period, the sending unit 603 sends an account clearing instruction to the second client.
In another embodiment, the sending unit 603 sends an account clearing instruction to the second client, and specifically includes:
the sending unit 603 sends an account clearing instruction to the second client in a Push manner.
The invention also provides a device for clearing the account, which is also used for solving the problem that in the prior art, when the client logs in the account, the server needs to verify whether the account and the client identifier have a corresponding relationship, so that the burden of the server in processing the user login is increased. The specific structural diagram of the device is shown in fig. 7, and the device comprises the following units:
a receiving unit 701 and a clearing unit 702, wherein:
the receiving unit 701 receives an account clearing instruction sent by a server, where the clearing instruction is sent by the server according to a second client identifier after the server passes verification of a common login request carrying an account, a password and a first client identifier and finds the second client identifier corresponding to the account;
the clearing unit 702 clears the account locally recorded by the device according to the account clearing instruction.
The specific working distance of the embodiment of the device is as follows: the receiving unit 701 receives an account clearing instruction sent by the server, and then the clearing unit 702 clears the locally recorded account according to the account clearing instruction; the clearing instruction is sent by the server according to a second client identifier after the server verifies a common login request carrying an account number, a password and the first client identifier and finds the second client identifier corresponding to the account number.
For example, in an implementation manner, the receiving unit 701 receives an account clearing instruction sent by a server, and specifically includes:
when the device logs in the running state of the account, the receiving unit 701 receives an account clearing instruction sent by a server; or
When the device is in an operating state without logging in the account, the receiving unit 701 receives an account clearing instruction sent by a server; or
In an initialization process of the device, the receiving unit 701 receives an account clearing instruction sent by a server, where the initialization process is performed by the device before sending a password-free login request to the server.
In another embodiment, when the receiving unit receives the account clearing instruction in an operating state where the device logs in the account, the device further includes a display unit 703, and the display unit 703 displays a login interface when the device logs out the account.
In another embodiment, when the apparatus receives the account clearing instruction in an initialization process, the clearing unit 702 clears the account recorded locally by the apparatus, which specifically includes:
in the initialization process, the clearing unit 702 clears the account number recorded locally by the device.
In another embodiment, the clearing unit 702 clears the account number of the local record, which specifically includes:
the clearing unit 702 clears the account number locally recorded by the device and the corresponding relationship between the account number and the device identifier.
The embodiment of the application adopts at least one technical scheme which can achieve the following beneficial effects:
in the embodiment of the application, when a secret-free login relationship is established, after a client side which has a corresponding relationship (secret-free login relationship) with an account sending a login request is determined to exist by a server side, an account clearing instruction is sent to the client side according to the client side identification, so that the client side clears the account recorded in the local part of the client side after receiving the account instruction, when the client side is started, the client side does not send the secret-free login request carrying the account to the server side, and thus, the server side does not need to verify whether the secret-free login relationship exists between the account and the client side identification, and the burden of the server side in processing the login of a user is reduced.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.