Detailed Description
In order to better understand the technical solutions provided by the embodiments of the present application, the following detailed description is made with reference to the drawings and specific embodiments.
1. Cloud technology (Cloud technology): the management method is a management technology for unifying series resources such as hardware, software, network and the like in a wide area network or a local area network to realize the calculation, storage, processing and sharing of data. Based on the general names of network technology, information technology, integration technology, management platform technology, application technology and the like applied in the cloud computing business model, a resource pool can be formed and used as required, and the cloud computing business model is flexible and convenient. Cloud computing technology will become an important support. Background services of the technical network system require a large amount of computing and storage resources, such as video websites, picture-like websites and more web portals. With the high development and application of the internet industry, each article may have its own identification mark and needs to be transmitted to a background system for logic processing, data in different levels are processed separately, and various industrial data need strong system background support and can only be realized through cloud computing. The application server, the login process and the storage server mentioned in the embodiment of the application can be realized through a cloud technology.
2. Application clothes: the module is a module capable of realizing the function corresponding to the application, one application server can be realized on an independent server, or a plurality of application servers can be realized on one server, each application server in the plurality of application servers can support the client to complete the corresponding function, the plurality of application servers can be communicated with each other, or not communicated with each other, for example, a game application, two account numbers logged on different servers can not be used for cross-server team-forming games. The first application garment and the second application garment and the like in the embodiment of the application refer to application garments corresponding to applications, and may be the same application garment or two different application garments.
3. And (3) login process: the module is used for realizing login checking function, one login process can be realized on an independent server, or a plurality of login processes can be realized on one server.
4. The target account number is: when a user uses a certain application, the user may need to register an account or log in by using a temporary account to log in an application service. That is, the target account in the embodiment of the present application may be a registered permanent account or a temporary account.
5. And (3) login request: the login request comprises login information, wherein the login information can comprise account information which a user needs to login, the account information comprises account identification of the user and the like, the login information can also comprise application service information which the user wants to login, and the application service information specifically comprises identification of an application service, specifically comprises a first application service A which the user wants to login to.
6. Online Game (Online Game): also known as online games, generally refer to electronic games in which multiple players play interactive entertainment via the internet.
7. Massively Multiplayer Online Role Playing Games (MMORPG): one type of online game is an online game in which electronic role-playing games are classified according to the number of people in the electronic game. In all MMORPGs, players can play one or more virtual characters and control the character's activities and behavior of the virtual world in the game.
8. Client (Client): refers to a program that corresponds to an application service and provides local services to a client. Generally, the terminal is installed on a terminal and needs to be matched with an application garment to operate.
9. Application Server: the system refers to a service software program for providing data calculation, verification, storage and forwarding functions for a client. The developer is required to ensure the stable operation and normal service function.
10. High concurrency: high concurrency means that many users access the same application at the same time. It often occurs in a service scenario where there is a large active user volume, with a high aggregation of users.
11. Pessimistic locks: pessimistic locks have strong exclusive and exclusive properties. It refers to the conservative attitude of data modification by the outside world (including other current transactions of the system and transactions from external systems), and the data is in a locking state in the whole data processing process.
12. An optimistic lock: compared with pessimistic locks, optimistic locks consider that data generally cannot cause conflicts, so that when data is submitted and updated, whether the data conflicts or not can be formally detected.
13. Storage service: the method has the advantages that various application data in the application running process are stored, the method has the characteristics of high availability, backup disaster tolerance, high performance and the like, and the data can be recovered from the data log after downtime.
14. A server: the cloud computing system can be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, and can also be a cloud server for providing basic cloud computing services such as cloud service, a cloud database, cloud computing, cloud functions, cloud storage, network service, cloud communication, middleware service, domain name service, security service, CDN (content delivery network), a big data and artificial intelligence platform and the like.
15. The terminal equipment: the smart phone, the tablet computer, the notebook computer, the desktop computer, the smart speaker, the smart watch, and the like can be used, but not limited thereto. The terminal device and the server may be directly or indirectly connected by wired or wireless communication,
16. a client: the client may be pre-installed in the terminal device, or may be a web client accessed through the terminal device, or may be a client accessed through a third-party application.
17. And (4) processing identification: which may also be referred to as a data version number, may be understood as a data version identification of the account number stored in the storage server. When the storage server has the login information of the target account, the data version number corresponds to the data version number of the login information, and when the login information of the target account does not exist in the storage server, the data version number corresponds to a default data version number, which may also be referred to as a default data version number.
It should be noted that "a plurality" in the embodiments of the present application includes two or more, "at least one" includes one and more than one, "and" a and/or B "includes three cases of" a "," B ", and" a and B ".
The following is a description of the design concept related to the embodiments of the present application.
Referring to fig. 1, a schematic structural diagram of a related art login application system is shown, and the related art is described below with reference to fig. 1.
In the related art, eachhost 110 is responsible for login and logout of an account within a certain account interval. Eachhost 110 may be equipped with astandby 120. Eachhost 110 may communicate with eachapplication server 130, and eachapplication server 130 may periodically report, to the host, application data corresponding to an account within an account interval for which thehost 110 is responsible, such as login information of a user. After thehost 110 regularly obtains the application data, whether one account repeatedly logs in a plurality of application servers is checked.
In the related art, firstly, eachapplication server 130 reports data to thehost 110 periodically, so that when thehost 110 receives corresponding application data, some accounts may have repeatedly logged in, that is, the repeated logging in of one account cannot be avoided fundamentally. Secondly, when acertain host 110 goes down, the account in the account interval for which thehost 110 is responsible cannot be repeatedly logged in and checked, so that thestandby 120 can replace thehost 110 at any time to achieve the repeated login and check of the account, and thestandby 120 needs to synchronously store the data in thehost 110, that is, in addition to the fact that eachapplication server 130 reports data to the host, the host needs to send a large amount of data to thestandby 130, so that the data transmission amount in the whole system is large. Once thestandby machine 120 goes down, the repeated login check of the account cannot be performed. It can be seen from the above that, the related art cannot fundamentally avoid the situation of repeated login of the account, and the deployment cost and the later maintenance cost of the system are high.
In view of the above, the present inventors have devised an application login method, which involves each application server, a login process, and a storage server, where login information of each account currently logged in is stored. After obtaining the login request of the target account, the application server feeds the login request back to the login process, the login process determines whether the target account is logged in according to the information stored in the storage server, if the target account is logged in, the application server forces the previously logged-in target account to be offline according to the login information of the target account in the storage server, then allows the current login request, and updates the login information in the storage server into the latest login information of the account.
In the embodiment of the application, in the process of processing the login request of the target account, whether the target account logs in repeatedly is verified. Once the target account logs in repeatedly, the target account which is logged in before offline is forced, and the problem that the account logs in the application service repeatedly is fundamentally avoided. In addition, in the embodiment of the application, the login process does not need to store a large amount of login information, the login process is convenient to deploy, the expansibility of the system is improved, and the system deployment is simpler. Specifically, for example, a plurality of login processes can be deployed, so that the efficiency of the login application process can be improved. In addition, in the embodiment of the application, the login process is to verify whether the account is logged in repeatedly by using the data in the storage server, so that even if a certain login process is down, the account can be verified repeatedly by using other login processes, the influence on the repeated account verification function after the certain login process is down is avoided, and the cost of system maintenance is reduced. In addition, even if a process fails, a large amount of data does not need to be backed up or transmitted, and the data transmission amount in the processing process is reduced. And the storage server stores the login information of the current online account, so that a large amount of login information does not need to be stored, and the storage space of the storage server is saved.
Further, the inventor of the present application considers that in some cases, for example, when a user uses a plug-in program, the user may initiate multiple login requests for one target account to multiple application servers, and the application servers may forward the login requests to corresponding login processes for processing. Since the processing logic of each login process may be non-blocking execution logic, the non-blocking execution logic may be understood that each login process may be processed in parallel. At this time, if each login process separately searches whether the login information of the target account exists in the storage server, the corresponding login information may not be searched in the storage server, and one account may be mistakenly allowed to log in repeatedly.
Therefore, in this embodiment of the application, after the login process obtains the login request, a data version number is obtained from the storage server first, and the login process further determines whether the data version number is consistent with the data version number stored in the storage server, specifically, for example, the login process sends the obtained data version number and the first application service information in the received login request to the storage server, when it is determined that the obtained data version number is the same as the data version number stored in the storage server, the data version number in the storage server is updated, and when the obtained data version number is different from the data version number stored in the storage server, the login request is rejected. In this way, even if there are multiple login requests for the target account, since a certain login request is already allowed, the data version number of the target account in the storage server is updated, and the data version numbers corresponding to other login requests cannot be matched with the updated data version number in the storage server, other login requests are rejected, that is, in the embodiment of the present application, even in a case of high concurrence, the target account can be prevented from being logged in repeatedly.
Based on the above design concept, an application scenario of the application login method according to the embodiment of the present application is described below.
Referring to fig. 2, a schematic diagram of an application scenario is shown, where the application scenario includes aclient 210 installed in a terminal device, a plurality ofapplication servers 220, a plurality of login processes 230, and astorage server 240. Eachlogin process 230 may communicate with eachapplication server 220, and eachlogin process 230 may communicate with thestorage server 240 in various ways, which are not limited in particular. Any twologin processes 230 may be provided on one server, or may be provided on two servers respectively. Any twoapplication servers 220 may be located on one or two servers, respectively. The server, the terminal device and the client can refer to the content discussed in the foregoing, and are not described in detail here.
The principle of the application login method implemented by each device interaction is described as an example.
Referring to fig. 3, a schematic diagram first of a principle of implementing login application by interaction between devices is shown, which is specifically as follows:
s301, theclient 210 sends a login request to thelogin process 230 through theapplication server 220.
A user may log into an application throughclient 210 when the user is ready to use the application. When logging in the application, the user needs to input an account and a password, or theclient 210 caches the account and the password input by the user before, and the user clicks confirmation, and in addition, the user may also select thecorresponding application server 220 to be logged in, or theclient 210 defaults to select oneapplication server 220 for the user. After the client receives the account and password, or receives the account, password, andapplication 220, a login request may be generated. The login request can refer to the content discussed above, and is not described in detail here. After generating the login request, theclient 210 transmits the login request to thecorresponding application server 220.
After obtaining the login request, theapplication server 220 may obtain the login information in the login request and send the login information to thelogin process 230, theapplication server 220 may send the login information to any login process, or for load balancing, theapplication server 220 may send the login information to thelogin process 230 with a reduced amount of processing.
With continued reference to fig. 3, such as the user preparing to login to thefirst application server 220 in fig. 3 using account a, theclient 210 may send the login request to thefirst application server 220, such as the user preparing to login to thesecond application server 220 in fig. 3 using account B, and theclient 210 may send the login request to thesecond application server 220. Such as the user preparing to log into thethird application server 220 in fig. 3 using account number C, theclient 210 may send the login request to thethird application server 220.
S302, thelogin process 230 queries whether login information with the target account exists in thestorage server 240.
After thelogin process 230 obtains the login information, it is queried in thestorage server 240 whether login information related to the target account exists.
S303, thelogin process 230 notifies the corresponding application to log off the target account.
If the login information of the target account exists, thelogin process 230 notifies the corresponding application server to log off the target account.
S304, thelogin process 230 stores the current login information in thestorage server 240.
Or if no application server logs in the target account before, the current login information is directly stored in thestorage server 240. After the login account has been logged out, thelogin process 230 updates the login information of the target account to the login information in the current login request.
S305, thelogin process 230 notifies the corresponding application server that the target account is allowed to login.
If the account that is logged in repeatedly is offline, or there is no account that is logged in repeatedly before, thelogin process 230 directly notifies the application server associated with the login request to log in to the target account.
For example, with continued reference to fig. 3, account a corresponds to thefirst application server 220, account B corresponds to thesecond application server 220, and account C corresponds to thethird application server 220. The login process determines that thestorage server 240 does not store login information corresponding to the accounts A, B and C, thelogin process 230 directly notifies thefirst application server 220 of the login account a, thelogin process 230 notifies thesecond application server 220 of the login account B, and thelogin process 230 notifies thethird application server 220 of the login account C.
Based on the principles discussed in fig. 3, the following introduces the principle of adding data version number verification.
Referring to fig. 4, a schematic diagram of a second principle for implementing the login application is shown, which is as follows:
s401, theclient 210 sends a login request to thelogin process 230 through theapplication server 220.
The content of the login request, the manner of generating the login request, and the like can refer to the content discussed in the foregoing S301, and are not described herein again. The content of obtaining the login information according to the login request may refer to the content discussed above, and will not be described herein again.
S402, thelogin process 230 obtains the data version number from thestorage server 240.
After the login process obtains the login information, the account currently needing to be logged in is determined, and then the data version number of the target account is obtained from thestorage server 240.
The login information of the target account in thestorage server 240 is acquired while the data version number is acquired, and if the login information of the target account exists in thestorage server 240, the target account which is logged in before the application server is offline is notified. If the login information of the target account does not exist in thestorage server 240, the following steps are directly performed.
S403, when the obtained data version number is the same as the data version number in thestorage server 240, updating the login information of the target account in thestorage server 240, and updating the data version number of the target account.
S404, thelogin process 230 notifies the first application server that the target account is allowed to login.
S405, when the acquired data version number is different from the data version number in thestorage server 240, the first application server is notified to reject the target account login.
For example, referring to fig. 4, the user currently uses account a to send two login requests (specifically, a first login request, a second login request, and a third login request) respectively to the threeclients 210. Thelogin process 230 determines that the data version number of the account a in thestorage server 240 is 23, and for the first login request, thelogin process 230 determines that the data version number is consistent with the data version number stored in thestorage server 240, further updates the data version number of thestorage server 240 to 24, updates the login information of the account a stored in thestorage server 240, and allows the account a to log in thefirst application server 220. For the second login request, thelogin process 230 determines that the data version number 23 of the second login request is different from thedata version number 24 stored in thestorage server 240, and rejects the second login request. For the third login request, thelogin process 230 determines that the data version number 23 of the third login request is different from thedata version number 24 stored in thestorage server 240, and rejects the third login request.
It should be noted that compared to the process discussed in fig. 3, in the implementation of fig. 4, the process of obtaining and verifying the data version number is added, and the problem of account re-registration in case of high concurrency is solved.
Based on the application scenario discussed in fig. 2 and the principle discussed in fig. 3, the following describes an example of an application login method according to an embodiment of the present application.
Referring to fig. 5, a first schematic diagram of the interaction between theclient 210, theapplication server 220, thelogin process 230, and thestorage server 240 is shown.
S501, theclient 210 generates a login request in response to the login operation.
When a user is ready to use an application, an account and a password may be input in a login interface of theclient 210, anapplication server 220 to be logged in may be selected, or theclient 210 caches the account and the password of the user, the user may select theapplication server 220 that needs to be logged in, or theclient 210 allocates thecorresponding application server 220 to the user by default, and when theclient 210 obtains the account, the password, and theapplication server 220, a login request may be generated.
S502, theclient 210 sends the login request to thefirst application server 220.
After generating the login request, theclient 210 may send the login request to thefirst application 220, and the login information in the login request may be referred to as first login information for convenience of distinguishing from other login information. The login information may refer to the content of the login information discussed above, and will not be described herein.
S503, thefirst application 220 sends the login request to thelogin process 230.
After obtaining the login request, thelogin process 230 may parse the login request to obtain the login information in the login request.
S504, thelogin process 230 obtains login information of the target account from thestorage server 240 according to the target account.
After obtaining the login information, thelogin process 230 may determine a target account currently needing to be logged in, and may obtain the login information of the target account from thestorage server 240 according to the target account, for example, an account id of the target account. The login information of the target account may also be referred to as historical login information. There are various specific ways of acquiring the login information, and the following examples are given.
Example one:
thelogin process 230 receives login information of the target account sent by the storage server.
Referring to fig. 6, a schematic diagram illustrating a process of receiving login information of a target account by thelogin process 230 is shown, where the interaction process specifically includes:
s601, thelogin process 230 generates a query request according to the login information.
The query request includes a target account, such as having an account id including the target account.
S602, thelogin process 230 sends the query request to thestorage server 240.
S603, thestorage server 240 may determine whether the login information of the target account exists according to the query request.
Thestorage server 240 stores at least application service information of each currently logged-in account, and when obtaining login information of a target account, thestorage server 240 can determine whether the login information of the target account exists.
S604, if thestorage server 240 determines that the target account login information exists, it sends the login information stored in itself to thelogin process 230.
On the contrary, if the login information of the target account does not exist in thestorage server 240, the login information stored by itself is not fed back to thelogin process 230.
Example two:
thelogin process 230 obtains login information for the target account from thestorage server 240.
Thelogin process 230 may access data in thestorage server 240, in which case thelogin process 230 may call login information for the target account number from thestorage server 240 based on the target account number. If thestorage server 240 stores the login information of the target account, thelogin process 230 can obtain the login information of the target account, and if thestorage server 240 does not store the login information of the target account, the login information of the target account cannot be obtained naturally. In this manner, the interaction between thelogin process 230 and thestorage server 240 may be simplified.
S505, if thelogin process 230 determines that the target account has logged in to the second application service according to the login information, it notifies thesecond application service 220 of the target account being offline.
Since the login information includes information of the application service currently logged in by the target account, after thelogin process 230 obtains the login information, it is able to determine the application service currently logged in by the target account, for example, it is determined that the target account has logged in thesecond application service 220, and send first notification information to thesecond application service 220, where the first notification information is used to indicate that the target account is offline by thesecond application service 220, and the offline target account may be understood as exiting the currently logged-in target account.
S506, thelogin process 230 updates the currently logged-in application service information of the target account to the first application service information in thestorage server 240.
If thestorage server 240 stores the login information (history login information) of the target account, thelogin process 230 may send the login information (i.e., the first login information in the foregoing text) in the login request to thestorage server 240, and thestorage server 240 receives the login information in the login request and updates the previously stored login information of the target account to the login information in the login request. If thestorage server 240 does not store login information for the target account (historical login information), thelogin process 230 may send the login information in the login request to thestorage server 240, and thestorage server 240 stores the login information in the login request. In this manner, thelogin process 230 instructs thestorage server 240 to update, which can relatively reduce the processing amount of the login process.
Alternatively, as discussed above, thelogin process 230 may invoke or alter data in thestorage server 240, in which case thelogin process 230 may store the first login information in thestorage server 240 if thestorage server 240 stores historical login information. If thestorage server 240 does not store historical login information, thelogin process 230 may write the first login information directly to thestorage server 240. In this method, thelogin process 230 actively updates data in thestorage server 240, thereby reducing the processing amount of thestorage server 240.
It should be noted that, since the target account and the like are not changed, and may be only the application server logged in by the target account sends a change, in the case that thestorage server 240 stores the login information of the target account, thestorage server 240 only needs to update the application server information currently logged in by the target account to the first application server information.
S507, thelogin process 230 sends the second notification information to thefirst application server 220.
The second notification information is used to instruct thefirst application server 220 to log in the target account. The second notification message may specifically include an account id of the target account.
S508, if thelogin process 230 does not obtain the login information of the target account from thestorage server 240 according to the target account, the login information of the target account is stored in thestorage server 240, and a third notification message is sent to thefirst application server 220.
As discussed above in S503, thelogin process 230 queries thestorage server 240 for login information of the target account number, and does not receive feedback from thestorage server 240. Or thelogin process 230 calls the login information of the target account from thestorage server 240, and does not call the login information of the target account, which means that thestorage server 240 does not have the login information of the target account, that is, the target account is not logged in before, so thelogin process 230 may feed the login information of the target account back to thestorage server 240, and send a third notification message to thefirst application server 220, where the third notification message is used to indicate that the target account is allowed to log in. After receiving the third notification message, thefirst application server 220 allows the target account to log in, and feeds back a message that the target account login is successful to theclient 210.
S504 to S507 and S508 are two possible cases in the process, and either S504 to S507 or S508 is executed for the process of one login request.
As an example, S501 to S502 and S508 are optional parts.
In the embodiment discussed in fig. 5, after obtaining the login request of the target account from theapplication server 220, thelogin process 230 may further determine whether the target account is already logged in according to the information stored in thestorage server 240, and if the target account is already logged in, forcibly log out the already logged-in target account, update the login information in thestorage server 240 in time, and allow the login request, that is, during the login process, verify whether the account is logged in repeatedly, thereby fundamentally preventing the target account from logging in repeatedly.
S509, theclient 210 generates an exit notification according to the exit operation.
After the user uses the application, the user may actively quit the application, for example, the user clicks a quit button in theclient 210, and theclient 210 generates a quit notification according to a quit operation performed by the user. The logout notification is used to indicate that the target account is logged out of thefirst application server 220.
S510, theclient 210 sends the exit notification to thefirst application server 220.
After generating the exit notification, theclient 210 sends the exit notification to thefirst application server 220, and the first application server may log off the target account. After the target account is offline, information of logging out of the login target account may be fed back to theclient 210.
S511, thefirst application server 220 sends the log-out notification to thelogin process 230.
S512, thelogin process 230 sends a delete request to thestorage server 240.
When thelogin process 230 receives a logout notification that the target account logs out of the first application server, which is sent by thefirst application server 220, the login information of the target account is deleted in thestorage server 240. For example, thelogin process 230 may send a delete request to thestorage server 240, the delete request instructing thestorage server 240 to delete the login information of the target account number. Or, for example, thelogin process 230 may access thestorage server 240 and delete the login information in thestorage server 240.
S513, thestorage server 240 deletes the login information of the target account stored in itself.
After thestorage server 240 receives the login information of the target account, the login information of the target account stored by itself may be deleted.
Based on the application scenario discussed in fig. 2 and the principle discussed in fig. 4, an example of an application login method in a high concurrency situation related to the embodiment of the present application is described below.
Referring to fig. 7, a schematic diagram of an interaction between theclient 210, theapplication server 220, thelogin process 230, and thestorage server 240 is shown, where the interaction process is as follows:
s701, thefirst client 210 generates a first login request in response to the login operation.
When a user logs in a target account through a plurality of clients, each client correspondingly generates a login request. By operating thefirst client 210, thefirst client 210 generates a first login request according to the operation of the user, where the first login request is used to request to login thefirst application 220 using the target account. The first login request may refer to the content of the login request discussed above, and will not be described herein. The content of the login operation, the login request, and the generated login request may refer to the content discussed above, and will not be described herein again.
S702, thefirst client 210 sends a login request to thefirst application 220.
Specifically, thefirst client 210 may send a first login request to thefirst application server 220.
S703, thefirst application server 220 sends the first login request to thelogin process 230.
Thefirst application server 220 sends the first login request to thelogin process 230, and after thelogin process 230 obtains the first login request, the first login request may be parsed to obtain the first login information in the first login request.
S704, thelogin process 230 obtains the data version number and the historical login information of the target account from thestorage server 240 according to the target account in the first login request.
The manner of obtaining the historical login information of the target account may refer to the content of S503, which is not described herein again. In the embodiment of the application, besides obtaining the historical login information of the target account, the data version number of the target account is also obtained.
Specifically, thelogin process 230 may send a first query request to thestorage server 240 after obtaining the first login information, where the first query request is used to query whether thestorage server 240 has the historical login information of the target account.
When thestorage server 240 receives the first query request, if the historical login information of the target account is queried in thestorage server 240, the historical login information of the target account and the data version number corresponding to the historical login information of the target account are fed back to thelogin process 230. If the historical login information of the target account is not queried at thestorage server 240, the default data version number of the target account is fed back to thelogin process 230. The default data version numbers of all the account numbers may be the same or different.
Alternatively, when thelogin process 230 directly obtains the historical login information of the target account from thestorage server 240, the data version number may also be obtained from thestorage server 240. If thestorage server 240 stores the historical login information of the target account, the data version number corresponding to the historical login information of the target account may be obtained. If thestorage server 240 does not have the historical login information of the target account, the default data version number of the target account may be obtained.
For example, thestorage server 240 determines that the historical login information of the account a exists, and sends the historical login information of the account a and the data version number (such as V1) to thelogin process 230. If thestorage server 240 determines that historical login information for account A does not exist itself, a default data version number (such as V0) is sent to thelogin process 230.
S705, thelogin process 230 obtains the data version number from thestorage server 240 according to the target account in the first login request.
As discussed in S704, when the login information of the target account does not exist in thestorage server 240, thelogin process 230 may directly obtain the default data version number from thestorage server 240. The specific manner of obtaining the default data version number may refer to the content discussed in S704, and is not described herein again.
S706, thesecond client 210 generates a second login request in response to the login operation.
By operating thesecond client 210, thesecond client 210 generates a second login request according to the operation of the user. The second login request is for requesting to login to thethird application server 220 using the target account number.
It should be noted that the embodiment in fig. 7 exemplifies two login requests, and illustrates a process of concurrent multiple login requests, and the number of login requests is not limited in practice.
S707, thesecond client 210 sends the second login request to thethird application server 220.
S708, thethird application server 220 sends the second login request to thelogin process 230.
Thethird application server 220 may send a second login request to thelogin process 230. After thelogin process 230 obtains the second login request, the second login request may be parsed to obtain the second login information in the second login request.
S709, thelogin process 230 obtains the data version number and the historical login information of the target account from thestorage server 240 according to the target account in the second login request.
The content of thelogin process 230 obtaining the data version number and the historical login information of the target account from thestorage server 240 may refer to the content discussed in the foregoing S704, and will not be described in detail here. Since the data version number in thestorage server 240 is not updated when thelogin process 230 acquires the data version number from thestorage server 240, the data version number corresponding to the second login request acquired by thelogin process 230 from thestorage server 240 is the same as the data version number corresponding to the first login request acquired in S707, and the historical login information of the target account corresponding to the second login request acquired by thelogin process 230 from thestorage server 240 is the same as the historical login information of the target account corresponding to the second login request acquired in S707.
S710, thelogin process 230 obtains the data version number from thestorage server 240 according to the target account in the second login request.
If thestorage server 240 does not have the historical login information of the target account, thelogin process 230 directly obtains the default data version number from thestorage server 240, and the content of obtaining the default data version number may refer to the content discussed in the foregoing S704, which is not described herein again.
The execution sequence of the two parts S701 to S705 and S706 to S710 may be arbitrary, and the present application is not particularly limited.
S711, thelogin process 230, according to the historical login information of the target account, if it is determined that the target account has logged in thesecond application server 220, notifies thesecond application server 220 of the target account being offline.
In the cases discussed in S707 and S709 above, when thelogin process 230 obtains the historical login information of the target account, it indicates that the target account is logged in, and then thelogin process 230 may further determine which application server the target account is specifically logged in according to the historical login information, and if the target account is logged in thesecond application server 220, thelogin process 230 notifies thesecond application server 220 of the target account being logged off. The contents of thesecond application 220, the offline target account, and the like can refer to the contents discussed above, and are not described herein again.
As an example, thelogin process 230 may instruct to delete or delete the historical login information of the target account in thestorage server 240 when the target account is offline.
As an embodiment, if the history login information of the target account is not stored in thestorage server 240, S711 is not required to be performed.
S712, thelogin process 230 generates a first data update request, and sends the first data update request to thestorage server 240.
After obtaining the data version number corresponding to the first login request, thelogin process 230 may generate a first data update request according to the first login information in the first login request and the obtained data version number, where the data update request includes the target account number to be logged in this time, the first application information, and the obtained data version number. The target account specifically includes an account id of the target account, and the first application service information includes, for example, an application service id of the first application service. After generating the first data update request, thelogin process 230 may send the first data update request to thestorage server 240, the first data update request being used to instruct thestorage server 240 to update the login information of the target account to the first login information.
S713, thelogin process 230 generates a second data update request and sends the second data update request to thestorage server 240.
Since thelogin process 230 further obtains a second login request of the target account, thelogin process 230 may also generate a second data update request according to the second login information in the second login request and the obtained data version number, where the second data update request may refer to the content of the first data update request, and details are not described here again. The second data update request is used to instruct thestorage server 240 to update the login information of the target account to the second login information.
As an example, the execution order of S712 and S713 may be arbitrary.
In one possible embodiment, when the login information of the target account does not exist in thestorage server 240, the data update request may be used to instruct thestorage server 240 to store the corresponding login information in the login request. Specifically, for example, the first data update request is used to instruct thestorage server 240 to store the first login information, and the second data update request is used to instruct thestorage server 240 to store the second login information. In this case, the data update request may include the corresponding login information in the login request, as well as the account identification of the target account number.
S714, thestorage server 240 checks the data version number in the first data update request.
After S712 to S713, thestorage server 240 obtains the first data update request and the second data update request, and at this time, thestorage server 240 may add each data update request to the queue to be processed, and sequentially process each data update request.
In the embodiment of the present application, thestorage server 240 is described as an example of processing the first data update request first. Thestorage server 240 checks whether the data version number in the first data update request is consistent with the data version number stored by itself, and if the data version number in the first data update request is the same as the data version number stored by itself, thestorage server 240 may update the login information of the target account to the first login information and update the data version number in thestorage server 240.
S715, thestorage server 240 sends a legal login notification for the first login request to thelogin process 230.
The legitimate login notification is used to indicate that the first login request is allowed.
S716, thelogin process 230 notifies thefirst application server 220 that the target account is allowed to login.
Thelogin process 230 determines that the first login request is legitimate after obtaining the legitimate login notification, and thus may notify thefirst application server 220 to allow the target account to login.
S717, thestorage server 240 verifies the data version number in the second data update request.
Thestorage server 240 checks whether the data version number in the first data update request is consistent with the data version number stored in itself, as discussed in S714, since the data version number in the first data update request is the same as the data version number stored in the second data update request, but the data version number in thestorage server 240 is updated when the data version number in the first data update request is the same as the data version number stored in itself in S714, the data version number in the second data update request does not correspond to the data version number stored in thestorage server 240, in this case, thestorage server 240 does not update the information stored in itself and the data version number.
It should be noted that the optimistic locking mechanism adopted by the data version number management in thestorage server 240 is that when the data version number is obtained, data collision is not detected, and when data update is submitted, whether data collision exists or not is detected based on the data version number, so that a situation that a target account number is logged in repeatedly when multiple login requests are detected.
S718, thestorage server 240 sends an illegal login notification to thelogin process 230.
When thestorage server 240 determines that the data version number in the second data update request is different from the data version number stored in itself, thestorage server 240 determines that the second login request is illegal, and sends an illegal login notification to thelogin process 230, where the illegal login notification is used to indicate that the second login request is illegal.
The order of execution of S715-S716 and S717 may be arbitrary, as an example.
In one possible embodiment, thelogin process 230 may access thestorage server 240 if the data version number of each login request is obtained from thestorage server 240. After obtaining the data version number for the first login request and the data version number for the second login request, thelogin process 230 may access thestorage server 240, determine whether the data version number of the first login request is the same as the data version number stored by thestorage server 240, and if the data version number of the first login request is the same as the data version number stored by thestorage server 240, notify thefirst application server 220 to allow the target account to login, and update the data version stored in thestorage server 240.
Thelogin process 230 accesses thestorage server 240, determines whether the data version number of the second login request is the same as the data version number stored in thestorage server 240, and since the data version number in thestorage server 240 is updated, the data version number of the second login request does not correspond to the data version number stored in thestorage server 240, thelogin process 230 notifies thethird application server 220 to reject the target account login.
In the process of checking the data version number, each login process may execute the process of checking the data version number in series, that is, after onelogin process 230 finishes checking, anotherlogin process 230 may continue to access thestorage server 240 for checking the data version number.
At S719, thestorage server 240 sends an illegal login notification to thelogin process 230.
Thelogin process 230 determines that the second login request is legitimate after obtaining the illegal login notification, and thus may notify thethird application server 220 to reject the target account login.
S720, theclient 210 generates a quit notification according to the quit operation.
After the user uses the application, the user may actively quit the application, for example, the user clicks a quit button in theclient 210, and theclient 210 generates a quit notification according to a quit operation performed by the user. The logout notification is used to indicate that the target account is logged out of thefirst application server 220.
S721, theclient 210 sends the exit notification to thefirst application server 220.
After generating the exit notification, theclient 210 sends the exit notification to thefirst application server 220, and the first application server may log off the target account.
S722, thefirst application server 220 sends the log-out notification to thelogin process 230.
S723, when thelogin process 230 receives the exit notification that the target account exits from the first application server, which is sent by thefirst application server 220, the login information of the target account is deleted in thestorage server 240.
In addition to the logout destination account, thefirst application server 220 sends a logout notification to thelogin process 230, upon which thelogin process 230 can respond. Such aslogin process 230 sending a delete request tostorage server 240. Thelogin process 230 may send a delete request to thestorage server 240, the delete request instructing thestorage server 240 to delete the login information of the target account number. Thestorage server 240, upon receiving the deletion request, deletes the login information of the target account stored therein. Or, for example, thelogin process 230 may access thestorage server 240 and delete the login information in thestorage server 240.
In the embodiment of the application, besides checking whether the target account number is logged in before, the data version number acquired by the login process is also checked, so that one login request is allowed while other login requests are rejected under the condition of receiving a plurality of login requests, and the problem of repeated login of the target account number under the condition of high concurrency is solved.
It should be noted that, in fig. 7, the ellipses between thefirst client 210 and thesecond client 210 indicate that a plurality ofclients 210 may also exist, and the ellipses between thesecond application server 220 and thethird application server 220 indicate that a plurality of similar application servers may also exist, and the processing procedures of other application servers may refer to the content discussed above and are not described herein again.
In order to make it more clear for those skilled in the art to understand the technical solution in the embodiment of the present application, an application is taken as an example, a user logs in a game is taken as an example, aclient 210 is taken as an example, and an application server is taken as an example, and an example of the application login method related to the embodiment of the present application is described below.
S1.1, the game client responds to the login operation of the user for logging in the game and generates a login request.
For example, a user performs a login operation to login a target account to a first game suit at a first game client, the first game client generates a first login request in response to the login operation, and the user performs a login operation to login the target account to a second game suit to generate a second login request.
S1.2, the game client sends the login request to the corresponding game server.
The first game client sends the first login request to the first game clothes, and the second game client sends the second login request to the second game clothes.
S1.3, the gaming suit sends a login request to thelogin process 230.
The first gaming suit may send a first login request to thelogin process 230 and the second gaming suit may send a second login request to thelogin process 230. Thelogin process 230 parses the first login request for the first login information and parses the second login request for the second login information.
S1.4, thelogin process 230 generates a query request, and sends the query request to thestorage server 240.
After thelogin process 230 obtains the first login request and the second login request, it generates a first query request according to the first login information and a second query request according to the second login information.
S1.5, thestorage server 240 feeds back login information of the target account and the processing identifier to thelogin process 230.
And S1.6, the login process informs the second application to serve the offline target account according to the received login information.
S1.7, thestorage server 240 feeds back the processing identifier to thelogin process 230.
It should be noted that S1.5 to S1.6, and S1.7 are two possible cases in the process, only one of which may occur for the process of one login request.
S1.8, thelogin process 230 sends a first data update request to thestorage server 240 for the first login request, and sends a second data update request to thestorage server 240 for the second login request.
S1.9, thestorage server 240 adds the first data update request and the second data update request to the queue to be processed, and checks whether the processing identifier in the first data update request is the same as the processing identifier stored in thestorage server 240.
S2.0, thestorage server 240 determines that the processing identifier in the first data update request is the same as the processing identifier stored in thestorage server 240, updates the processing identifier of the target account stored in thestorage server 240, stores the first login information, and feeds back a valid login notification to thelogin process 230.
S2.1, thestorage server 240 determines that the processing identifier in the first data update request is different from the processing identifier stored in thestorage server 240, and feeds back an illegal login notification to thelogin process 230.
Therefore, although the user initiates two login requests at the same time, only one login request is allowed finally, the problem of account repeated login is solved, and the condition that the fairness of the game is influenced because the player uses the account to repeatedly login the game is avoided.
Based on the same inventive concept, the embodiment of the present application provides an application login apparatus, which is equivalent to thelogin process 230 discussed above, please refer to fig. 8, in which theapparatus 800 includes:
atransceiver module 801, configured to receive, from a first application server, a login request for a target account to log in to the first application server;
theprocessing module 802 is configured to obtain login information of a target account from a storage server according to the target account, where the login information includes application service information currently logged in by the target account;
thetransceiver module 801 is further configured to notify the second application server of the target account number being offline when determining that the target account number has logged in the second application server according to the login information;
theprocessing module 802 is further configured to update, in the storage server, the application service information currently logged in by the target account into first application service information;
thetransceiver module 801 is further configured to notify the first application server that the target account is allowed to log in.
In a possible embodiment, theprocessing module 802 is specifically configured to:
and sending a data updating request to the storage server, wherein the data updating request comprises the processing identifier and the first application service information acquired from the storage server, so that the storage server updates the application service information currently logged in by the target account into the first application service information when the processing identifier in the data updating request is the same as the stored processing identifier, and updates the processing identifier of the target account.
In a possible embodiment, thetransceiver module 801 is further configured to:
and informing the first application server to reject the login request of the target account according to an illegal login notification sent by the storage server, wherein the illegal login notification is sent when the processing identifier of the target account in the data updating request is different from the stored processing identifier of the target account.
In a possible embodiment, theprocessing module 802 is specifically configured to:
before updating the application server information currently logged in by the target account into first application server information in the storage server, confirming that the processing identifier acquired from the storage server is the same as the processing identifier stored in the storage server; and
and in the storage server, updating the processing identifier of the target account, and updating the application service information currently logged in by the target account into the first application service information.
In a possible embodiment, thetransceiver module 801 is further configured to:
and when the processing identifier acquired from the storage server is confirmed to be different from the processing identifier stored in the storage server, informing the first application server of rejecting the login request of the target account.
In one possible embodiment, theprocessing module 802 is further configured to:
and when the login information of the target account is not found in the storage server, acquiring the default processing identifier stored in the target account from the storage server.
In a possible embodiment, theprocessing module 802 is further configured to store login information corresponding to the login request in the storage server when the login information of the target account is not found in the storage server and the obtained processing identifier is the same as the processing identifier stored in the storage server; the receiving and sending module is also used for informing the first application server that the target account is allowed to log in; and
theprocessing module 802 is further configured to delete the login information of the target account in the storage server when receiving a quit notification that the target account quits the first application server and is sent by the first application server.
Based on the same inventive concept, the embodiment of the present application provides an application login apparatus, which is equivalent to thestorage server 240 discussed above, referring to fig. 9, theapparatus 900 includes:
atransceiver module 901, configured to receive a query request from a login process; the query request comprises a target account;
a searchingmodule 902, configured to send a login exit notification to the login process if the login information of the target account is found according to the query request, so that the login process notifies the second application server of the offline target account;
atransceiver module 901, configured to receive a data update request from a login process; the data updating request comprises a target account number for storing the current preparation login and first application service information;
anupdating module 903, configured to update the currently logged-in application service information of the target account stored in the updating module itself to the first application service information if the login information of the target account is found according to the data updating request;
thetransceiver module 901 is further configured to feed back a legal login notification to the login process, so that the login process notifies the first application server that the target account is allowed to log in.
In a possible embodiment, the data update request further includes the acquired processing identifier, and theupdate module 903 is further configured to:
and when the processing identifier in the data updating request is the same as the stored processing identifier, updating the application service information currently logged in by the target account into the first application service information, and updating the processing identifier of the target account.
In a possible embodiment, the apparatus further comprises agenerating module 904, wherein:
agenerating module 904, configured to generate an illegal login notification when the processing identifier in the data update request is different from the stored processing identifier;
thetransceiver module 901 is further configured to send an illegal login notification to a login process, so that the login process notifies the first application server of rejecting the login request of the target account.
In a possible embodiment, thetransceiver module 901 is further configured to:
and when the login information of the target account is not found, sending the stored default processing identifier stored in the target account to a login process.
In a possible embodiment, the apparatus further comprises adeletion module 905, wherein:
atransceiver module 901, configured to store login information corresponding to a login request in a storage server and notify a first application server that the target account is allowed to login, when the login information of the target account is not found, and it is determined that a processing identifier in the data update request is the same as a processing identifier stored in the storage server; and
a deletingmodule 905, configured to delete login information of the target account when receiving a deletion notification sent by the login process; the deletion notification is sent by the login process when a quit notification that the target account sent by the first application server quits the first application server is obtained.
Based on the same inventive concept, the embodiment of the present application provides an application login system, which includes theapplication login apparatus 800 discussed in fig. 8 and theapplication login apparatus 900 discussed in fig. 9.
Based on the same inventive concept, the embodiment of the application also provides computer equipment.
Referring to fig. 10, a computer apparatus 1000 is shown in the form of a general purpose computer apparatus. The components of the computer device 1000 may include, but are not limited to: at least oneprocessor 1010, at least onememory 1020, and abus 1030 that couples various system components including theprocessor 1010 and thememory 1020.
Bus 1030 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a processor, or a local bus using any of a variety of bus architectures.
Memory 1020 may include readable media in the form of volatile memory, such as Random Access Memory (RAM)1021 and/orcache memory 1022, and may further include Read Only Memory (ROM) 1023.
Memory 1020 may also include a program/utility 1026 having a set (at least one) ofprogram modules 1025,such program modules 1025 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment. Theprocessor 1010 is operative to execute program instructions or the like stored by thememory 1020 to implement the application login methods discussed previously.
The computer device 1000 may also communicate with one or more external devices 1040 (e.g., keyboard, pointing device, etc.), with one or more devices that enable the terminal device to interact with the computer device 1000, and/or with any devices (e.g., router, modem, etc.) that enable the computer device 1000 to communicate with one or more other devices. Such communication may occur through input/output (I/O) interfaces 1050. Moreover, computer device 1000 may also communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the internet) vianetwork adapter 1060. As shown, thenetwork adapter 1060 communicates with other modules for the computer device 1000 over thebus 1030. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the computer device 1000, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Based on the same inventive concept, embodiments of the present application provide a storage medium storing computer instructions that, when executed on a computer, cause the computer to perform the method for controlling social content discussed above. Storage media broadly refers to readable computer storage media.
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.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.