Client login management method, device, server and storage medium

Through the client coding management method, the server generates and manages login tickets, realizing mutual exclusion and compatibility of multi-terminal logins, solving the problem of insufficient singleness of client login management methods in the existing technology, and meeting the flexible needs of multi-terminal logins.

CN112948783BActive Publication Date: 2024-09-06PING AN CONSUMER FINANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110215661.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-26
Publication Date
2024-09-06
Estimated Expiration
2041-02-26

AI Technical Summary

Technical Problem

The existing client login management method is relatively single and cannot meet the flexible requirements for mutual exclusion and compatibility of multi-terminal logins.

Method used

Mutual exclusion and compatibility of multi-terminal logins are achieved through client coding. The server obtains the identification information and coding information of the target user, generates a login ticket, queries the database based on the coding information, replaces or saves the ticket relationship, and ensures the login status of different clients.

Benefits of technology

Mutual exclusion and compatibility of multi-terminal logins are realized, which avoids the confusion in the processing process caused by users logging in to multiple terminals at the same time, and meets the login needs in more scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112948783B
    Figure CN112948783B
Patent Text Reader

Abstract

The embodiment of the present application provides a client login management method, device, server and storage medium, the method includes: after the first login request sent by the target user through the first client is verified, a first login ticket is generated for the first client; according to the target identification information of the target user in the application system and the coding information of the first client, it is queried whether there is a second login ticket; the second login ticket is generated according to the target identification information and the second login request sent by the target user through the second client, and the coding information of the second client is the same as the coding information of the first client; if included, the second login ticket is replaced with the first login ticket, otherwise, the target identification information, the coding information of the first client and the first login ticket are saved. By adopting this application, multi-terminal login mutual exclusion and multi-terminal login compatibility can be achieved, which is more flexible. The present application relates to blockchain technology, such as encrypting data in a database and writing it into a blockchain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of process optimization technology, and in particular to a client login management method, device, server and storage medium. Background Art

[0002] At present, there are many solutions for generating and maintaining login status in the industry. The mainstream solutions are mainly Cookie authentication mechanism and Token authentication mechanism, and each solution has different applicable scenarios. Among them, based on the Cookie authentication mechanism, Cookie information can be stored on the client, and the client can access the server through Cookie information. Based on the Token authentication mechanism, the Token can be stored on the server, and the client can access the server through the obtained Token. When a user uses multiple clients to log in to the server, the server can log in to the server through one client, and when another client requests to log in to the server, it queries whether the user ID exists locally, and when it is found that it exists, it controls the client that logged in first to log out. However, this client login management method is relatively simple and not flexible enough. Summary of the invention

[0003] The embodiments of the present application provide a client login management method, device, server and storage medium, which can achieve multi-terminal login mutual exclusion and multi-terminal login compatibility through client coding, which is more flexible.

[0004] In a first aspect, an embodiment of the present application provides a client login management method, including:

[0005] After the first login request sent by the target user through the first client is verified, the target identification information of the target user in the application system is obtained;

[0006] Acquire encoding information of the first client according to the first login request, and generate a first login ticket for the first client according to the target identification information and the first login request;

[0007] According to the target identification information and the coding information of the first client, query the database whether it includes a second login ticket; the second login ticket is generated according to the target identification information and the second login request sent by the target user through the second client, and the coding information of the second client is the same as the coding information of the first client; the database stores the identification information of each user in the application system, the coding information of the client used by each user to log in to the server, and the login ticket generated by the client used by each user to log in to the server;

[0008] When the database includes the second login ticket, replacing the second login ticket in the database with the first login ticket;

[0009] When the database does not include the second login ticket, the database stores a correspondence between the target identification information, the encoding information of the first client, and the first login ticket.

[0010] Optionally, the second client logs in to the server before the first client, and after the first login ticket is used to replace the second login ticket in the database, the method further includes:

[0011] After receiving the first access request sent by the target user through the second client, obtaining the encoding information of the second client according to the first access request, and obtaining the third login ticket carried in the first access request;

[0012] Obtaining the target identification information according to the third login ticket analysis;

[0013] querying the first login ticket from the database according to the target identification information and the encoding information of the second client;

[0014] When it is determined that the third login ticket is inconsistent with the first login ticket, it is determined that the third login ticket verification fails, the first access request is rejected, and a logout prompt message is sent to the second client.

[0015] Optionally, the method further includes:

[0016] After receiving a second access request sent by the target user through the first client, obtaining the encoding information of the first client according to the second access request, and obtaining a fourth login ticket carried in the second access request;

[0017] Obtaining the target identification information by parsing the fourth login ticket;

[0018] querying the first login ticket from the database according to the target identification information and the encoding information of the first client;

[0019] When it is determined that the fourth login ticket is consistent with the first login ticket, it is determined that the fourth login ticket is verified, request data is obtained in response to the second access request, and the request data is sent to the first client.

[0020] Optionally, the method further includes:

[0021] When the fourth login ticket verification passes, the ticket expiration time of the first client is obtained; the ticket expiration time of the first client is the initial ticket expiration time of the first client, or the ticket expiration time adjusted by the first client obtained by the configuration center based on the ticket expiration time management page returned by the server;

[0022] Determining whether the fourth login ticket is expired according to the request creation time included in the fourth login ticket and the ticket expiration time of the first client;

[0023] When the fourth login ticket has not expired, the step of obtaining request data in response to the second access request and sending the request data to the second client is triggered.

[0024] Optionally, acquiring the encoding information of the first client according to the first login request includes:

[0025] Obtaining client information of the first client carried in the first login request;

[0026] Determining the encoding information corresponding to the client information of the first client according to the correspondence between the client information and the encoding information;

[0027] The encoding information corresponding to the client information of the first client is determined as the encoding information of the first client.

[0028] Optionally, generating a first login ticket for the first client according to the target identification information and the first login request includes:

[0029] Obtaining the request creation time carried in the first login request;

[0030] Generating an initial login ticket for the first client according to the target identification information and the request creation time;

[0031] The initial login ticket generated for the first client is encrypted using an asymmetric encryption method to obtain a first login ticket.

[0032] Optionally, the method further includes:

[0033] In response to the coding information management request sent by the configuration center, return a coding information management page to the configuration center; the coding information management page includes coding information configuration items corresponding to the target client information; the coding information configuration items are used by the configuration center to adjust the initial coding information of the target client information; the target client information is one or more client information among the multiple client information;

[0034] Receive the adjusted encoding information corresponding to the target client information returned by the configuration center, and determine the adjusted encoding information of the target client information as the encoding information of the target client.

[0035] In a second aspect, an embodiment of the present application provides a client login management device, including:

[0036] An acquisition module, configured to acquire target identification information of the target user in the application system after a first login request sent by the target user through the first client is verified;

[0037] a ticket generation module, configured to obtain the encoding information of the first client according to the first login request, and generate a first login ticket for the first client according to the target identification information and the first login request;

[0038] A query module, configured to query a database whether it includes a second login ticket according to the target identification information and the coding information of the first client; the coding information of the second client generated by the second login ticket according to the target identification information and the second login request sent by the target user through the second client is the same as the coding information of the first client; the database stores identification information of each user in the application system, coding information of the client used by each user to log in to the server, and a login ticket generated by the client used by each user to log in to the server;

[0039] A data management module, used to replace the second login ticket in the database with the first login ticket when the database includes the second login ticket; when the database does not include the second login ticket, save the correspondence between the target identification information, the encoding information of the first client and the first login ticket in the database.

[0040] In a third aspect, an embodiment of the present application provides a server comprising a processor and a memory, wherein the processor and the memory are interconnected, wherein the memory is used to store a computer program, the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the method described in the first aspect.

[0041] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method described in the first aspect.

[0042] In summary, after verifying the first login request sent by the target user through the first client, the server can obtain the target identification information of the target user in the application system, and obtain the coding information of the first client according to the first login request, so as to generate a first login ticket for the first client according to the target identification information and the first login request; the server can query the database whether it includes a second login ticket according to the target identification information and the coding information of the first client, and the second login ticket is generated according to the target identification information and the second login request sent by the target user through the second client, and the coding information of the second client is the same as the coding information of the first client; When the database includes the second login ticket, the server can use the first login ticket to replace the second login ticket in the database, and when the database does not include the second login ticket, the server can save the correspondence between the target identification information, the encoding information of the first client and the first login ticket in the database. The present application adopts the above process to realize the process of multi-terminal login mutual exclusion and login compatibility according to the client coding. There is no need to control the first logged-in client to log out when another client requests to log in to the server as in the prior art, as long as the local user ID is queried. The client login management method of the embodiment of the present application is more flexible and can meet the login needs in more scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0044] Figure 1 This is a schematic diagram of a network architecture of a client login management system provided by an embodiment of the present application;

[0045] Figure 2 It is a flowchart of a client login management method provided in an embodiment of the present application;

[0046] Figure 3 It is a flowchart of another client login management method provided in an embodiment of the present application;

[0047] Figure 4 It is a structural diagram of a client login management device provided in an embodiment of the present application;

[0048] Figure 5 It is a structural diagram of a server provided in an embodiment of the present application. DETAILED DESCRIPTION

[0049] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0050] The present application provides a client login management solution, which can achieve mutual exclusion of logins of different clients through the same coding information, and can also achieve login compatibility of different clients through different coding information. Among them, login mutual exclusion means that a user cannot use two or more clients (the coding information of these clients is the same) to log in to the server at the same time, and login compatibility means that a user can use two or more clients (the coding information of these clients is different) to log in to the server at the same time. The client login management solution can be executed by a server, and the server can be a server or a server cluster. Among them, the client described in the embodiment of the present application, such as the first client and the second client, can belong to any of the following types: APP, SDK, PC browser, H5, applet.

[0051] See also Figure 1 , is a schematic diagram of the network structure of a client login management system provided in an embodiment of the present application. Figure 1 The client login management system shown includes multiple clients corresponding to user A, such as Figure 1 The client 10 (corresponding to the first client mentioned in the embodiment of the present application) and the client 20 (corresponding to the second client mentioned in the embodiment of the present application), and the server 30 (corresponding to the server mentioned in the embodiment of the present application). The client 20 here refers to a client with the same coding information as the client 10, that is, a client that logs in mutually exclusive with the client 10. In one embodiment, the multiple clients may also include a client with different coding information from the client 10 (not shown), that is, a client that is compatible with the client 10 login.

[0052] In the embodiment of the present application, user A may send a first login request to the server 30 through the client 10, where the first login request refers to the login request sent by the client 10. After receiving the first login request sent by the client 10, the server 30 may verify the first login request.

[0053] In one embodiment, user A may have logged into server 30 through client 20 before sending the first login request to server 30 through client 10. That is, user A may send a second login request to server 30 through client 20, where the second login request refers to the login request sent by client 20. After receiving the second login request, server 30 may verify the second login request. After the server 30 verifies the second login request, it may obtain the target identification information of user A in the application system. The target identification information is the unique identification information of user A in the application system. Server 30 may also obtain the encoding information of client 20 according to the second login request, and generate a second login ticket for client 20 according to the target identification information and the second login request. Afterwards, server 30 may query the database whether it includes the login tickets of other clients (not shown) with the same encoding information as client 20 according to the target identification information and the encoding information of client 20. Other clients log into the server before the second client. The generation method of the login tickets of other clients refers to the generation method of the second login ticket, which will not be repeated here. When the database includes login tickets of other clients, the server 30 can use the second login ticket to replace the login tickets of other clients in the database, and when the database does not include login tickets of other clients, the server 30 can save the correspondence between the target identification information, the encoding information of the client 20 and the second login ticket in the database.

[0054] In the embodiment of the present application, after the server 30 verifies the first login request, it can obtain the target identification information of user A in the application system. The server 30 can also obtain the coding information of the client 10 according to the first login request, and generate a first login ticket for the client 10 according to the target identification information and the first login request. Afterwards, the server 30 can query whether the database includes the second login ticket according to the target identification information and the coding information of the client 10. When the database includes the second login ticket, the server 30 can use the first login ticket to replace the second login ticket in the database. When the database does not include the second login ticket, the server 30 can save the correspondence between the target identification information, the coding information of the client 10 and the first login ticket in the database.

[0055] In one embodiment, the embodiment of the present application can configure the encoding information corresponding to different client information through the configuration center. The client information may include client source information or client category. By configuring the encoding information corresponding to the client information through the configuration center, the compatibility and mutual exclusion of multi-terminal logins can be dynamically controlled in real time.

[0056] In one embodiment, the embodiment of the present application can make the coding information corresponding to each client information in the multiple client information different through the configuration center. For example, the multiple client information includes client information 1, client information 2...client information N. The coding information 1 corresponding to client information 1, the coding information 2 corresponding to client information 2...the coding information N corresponding to client information N. By setting different coding information for each client information, the effect of compatible client logins corresponding to each client information can be achieved. In one embodiment, the coding information corresponding to some client information in the multiple client information can also be made the same through the configuration center. The embodiment of the present application can achieve the effect of mutual exclusion of client logins corresponding to each client information in this part of the client information (for example, if you log in to the APP, you cannot log in to the mini program) by setting the coding information corresponding to some client information to the same coding information, thereby avoiding the problem of chaotic processing flow caused by users logging in to multiple terminals at the same time. For example, in order to enable the client corresponding to client information 1 to achieve a mutually exclusive login effect with the client corresponding to client information 2, the coding information of client information 1 and the coding information of client information 2 can be set to the same coding information, such as the coding information of client information 1 can be kept unchanged, and the coding information of client information 1 can be adjusted to the coding information of client information 2, or the coding information of client information 2 can be kept unchanged, and the coding information of client information 2 can be adjusted to the coding information of client information 1, or the coding information of client information 1 and the coding information of client information 2 can be uniformly adjusted to other coding information.

[0057] In one embodiment, the server may return a coding information management page to the configuration center in response to a coding information management request sent by the configuration center. The coding information management page includes coding information configuration items corresponding to the target client information. The coding information configuration items are used by the configuration center to adjust the initial coding information of the target client information. The target client information is one or more client information among multiple client information. The initial coding information is the coding information stored by the server. The server receives the adjusted coding information corresponding to the target client information returned by the configuration center, and determines the adjusted coding information of the target client information as the coding information of the target client. In an application scenario, the administrator may send a coding information management request to the server through the configuration center. The server may return a coding information management page to the configuration center in response to the coding information management request sent by the configuration center. The administrator may adjust the coding information of client information 1 from coding information 1 to coding information 2 based on the coding information configuration items corresponding to client information 1 included in the coding information management page. After that, the server can obtain coding information 2 and determine coding information 2 as the coding information of client information 1.

[0058] In one embodiment, the embodiment of the present application can configure the ticket expiration time of the login ticket of different clients (here, the client that has logged in to the server) through the configuration center. For example, taking the login ticket of the first client as an example, the ticket expiration time of the first client is the adjusted ticket expiration time of the first client obtained by the configuration center based on the ticket expiration time management page returned by the server. Specifically, the server can return the ticket expiration time management page to the configuration center in response to the ticket expiration time management request sent by the configuration center. The ticket expiration time management page includes a ticket expiration time configuration item corresponding to the first client, and the ticket expiration time configuration item is used for the configuration center to adjust the initial ticket expiration time of the first client. The server receives the adjusted ticket expiration time of the first client returned by the configuration center, and determines the adjusted ticket expiration time of the first client as the ticket expiration time of the first client. Among them, the ticket expiration time configuration process of the second client and other clients can refer to this method, which is not repeated here.

[0059] See also Figure 2 , is a flow chart of a client login management method provided in an embodiment of the present application. The method can be applied to the aforementioned server. Specifically, the method may include the following steps:

[0060] S201. After a first login request sent by a target user through a first client is verified, target identification information of the target user in an application system is obtained.

[0061] In the embodiment of the present application, the target user can send a first login request to the server through the first client, and the server can receive the first login request and verify the first login request. After the server verifies the first login request, it can obtain the target identification information of the target user in the application system. Among them, the server verifies the first login request, which may include the server verifying the account information carried by the first login request. The embodiment of the present application does not elaborate on the specific process of how to verify the account information.

[0062] In one embodiment, after verifying the first login request sent by the target user through the first client, the server can query whether the target identification information of the target user in the application system exists; if it exists, the server obtains the queried target identification information of the target user in the application system; if it does not exist, the server generates the target identification information of the target user in the application system. In one embodiment, the server can record the correspondence between the account information and the identification information, and then query the target identification information corresponding to the account information carried in the first login request according to the correspondence between the account information and the identification information.

[0063] In one embodiment, the first client may be any of a plurality of clients used by the target user to access the server. In one embodiment, the account information input by the target user in the plurality of clients may be the same. In one embodiment, the coded information described in the embodiment of the present application includes but is not limited to being presented in the form of numbers, letters, and text.

[0064] S202: Obtain encoding information of the first client according to the first login request, and generate a first login ticket for the first client according to the target identification information and the first login request.

[0065] In the embodiment of the present application, after obtaining the first login ticket, the server sends the first login ticket to the first client, and the first client can subsequently access the server through the first login ticket.

[0066] In the embodiment of the present application, the server obtains the coding information of the first client according to the first login request, specifically, the server obtains the client information of the first client carried in the first login request, and obtains the coding information of the first client according to the client information of the first client. Specifically, the server can obtain the client information of the first client carried in the first login request, and determine the coding information corresponding to the client information of the first client according to the correspondence between the client information and the coding information; the server determines the coding information corresponding to the client information of the first client as the coding information of the first client.

[0067] In the embodiment of the present application, the server generates a first login ticket for the first client according to the target identification information and the first login request, can obtain the request creation time carried by the first login request for the server, and generate an initial login ticket for the first client according to the target identification information and the request creation time as the first login ticket. Or, the server generates a first login ticket for the first client according to the target identification information and the first login request, can obtain the request creation time carried by the first login request for the server, and generate an initial login ticket for the first client according to the target identification information and the request creation time; the server encrypts the initial login ticket generated for the first client using an asymmetric encryption method to obtain the first login ticket.

[0068] In one embodiment, according to the target identification information and the request creation time, the method for generating the initial login ticket for the first client can be that the server adopts the JSON Web Token (JWT) generation method to generate the initial login ticket of the first client according to the target identification information and the request creation time. The initial login ticket generated for the first client is encrypted by an asymmetric encryption method to obtain the first login ticket. The server can encrypt the initial login ticket generated for the first client by using the RSA encryption method as the first login ticket. Among them, the RSA encryption method is generally used to encrypt the transmission data between the client and the server. Compared with the method of directly transmitting the login ticket between the client and the server in the prior art, the embodiment of the present application adopts the RSA encryption method to encrypt the login ticket, which can ensure the security of the login ticket during the transmission process. Specifically, the server can obtain a preset key pair, and use the public key in the key pair to encrypt the initial login ticket generated for the first client to obtain the first login ticket.

[0069] S203: querying a database to see whether it includes a second login ticket according to the target identification information and the encoding information of the first client.

[0070] Among them, the second login ticket is generated according to the target identification information and the second login request sent by the target user through the second client. The second client can log in to the server before the first client. The generation method of the second login ticket can refer to the generation method of the first login ticket mentioned above, and the embodiment of the present application will not be repeated here. The second login ticket can correspond to the target identification information and the coding information of the second client, and the coding information of the second client is the same as the coding information of the first client. The coding information of the second client is the same as the coding information of the first client, which means that the logins between the first client and the second client are mutually exclusive. The database stores the identification information of each user in the application system, the coding information of the client used by each user to log in to the server, and the login ticket generated for the client used by each user to log in to the server. The login ticket generated for the client used by each user to log in to the server here can be the initial login ticket generated for the client, or it can also be the login ticket obtained after encrypting the initial login ticket generated for the client.

[0071] In the embodiment of the present application, the server may execute step S204 and step S205 in parallel after executing step S203.

[0072] S204: When the database includes the second login ticket, replace the second login ticket in the database with the first login ticket.

[0073] When the database includes the second login ticket, it means that there is a client that is mutually exclusive with the first client (i.e., there is a second client) among the clients that the user has logged into the server. Therefore, in order to achieve mutual exclusion of login, the server can not only use the first login ticket to replace the second login ticket in the database, but also use the target identification information, the encoding information of the first client, and the first login ticket to replace the target identification information, the encoding information corresponding to the second client, and the second login ticket stored in the database. After that, the first client can access the server through the first login ticket, and the second client will log out.

[0074] S205: When the database does not include the second login ticket, save the corresponding relationship between the target identification information, the encoding information of the first client, and the first login ticket in the database.

[0075] When the database does not include the second login ticket, it means that there is no client that is mutually exclusive with the first client among the clients that the user has logged into the server (i.e., there is no second client) or the user has not logged into the server with any client other than the first client. Therefore, the server can save the corresponding relationship between the target identification information, the encoding information of the first client, and the first login ticket in the database. Afterwards, the first client can access the server through the first login ticket.

[0076] After executing step S204 or step S205, the server can receive the second access request sent by the target user through the first client, and obtain the encoding information of the first client according to the second access request, and obtain the fourth login ticket carried by the second access request; the server parses the target identification information according to the fourth login ticket, and queries the first login ticket from the database according to the target identification information and the encoding information of the first client; when the server determines that the fourth login ticket is consistent with the first login ticket, it determines that the fourth login ticket has been verified, obtains the request data in response to the second access request, and sends the request data to the first client.

[0077] visible, Figure 2In the illustrated embodiment, after verifying the first login request sent by the target user through the first client, the server can obtain the target identification information of the target user in the application system, and obtain the coding information of the first client according to the first login request, so as to generate a first login ticket for the first client according to the target identification information and the first login request; the server can query whether the database includes the second login ticket according to the target identification information and the coding information of the first client; the server can use the first login ticket to replace the second login ticket in the database when the database includes the second login ticket, and can save the correspondence between the target identification information, the coding information of the first client and the first login ticket in the database when the database does not include the second login ticket. The present application adopts the above process to realize the process of multi-terminal login mutual exclusion and login compatibility according to the client coding. The client login management method of the embodiment of the present application is more flexible and can meet the login requirements in more scenarios.

[0078] This application involves blockchain technology, such as encrypting data in a database and writing it into a blockchain.

[0079] See also Figure 3 , is a flow chart of another client login method provided in an embodiment of the present application. The method can be applied to the aforementioned server. The method may include the following steps:

[0080] S301. After a first login request sent by a target user through a first client is verified, target identification information of the target user in an application system is obtained.

[0081] S302: Obtain encoding information of the first client according to the first login request, and generate a first login ticket for the first client according to the target identification information and the first login request.

[0082] S303: query a database to see whether it includes a second login ticket according to the target identification information and the encoding information of the first client.

[0083] Among them, steps S301 to S303 can be found in Figure 2 The steps S201 to S203 in the embodiment are not described in detail in the embodiment of the present application. After executing step S303, the server may execute step S304 and step S309 in parallel.

[0084] S304: When the database includes the second login ticket, replace the second login ticket in the database with the first login ticket.

[0085] Among them, step S304 can be found in Figure 2Step S204 in the embodiment is not described in detail in the embodiment of the present application.

[0086] S305: After receiving the first access request sent by the target user through the second client, obtain the encoding information of the second client according to the first access request, and obtain the third login ticket carried in the first access request.

[0087] The first access request here is the access request sent by the second client. The third login ticket here may be the second login ticket or may not be the second login ticket. For example, the third login ticket is the second login ticket under normal circumstances, but when the second login ticket is tampered with, the third login ticket is not the second login ticket. The third login ticket is the login ticket obtained after the second login ticket is tampered with.

[0088] In an embodiment of the present application, the server obtains the encoding information of the second client according to the first access request. The server can obtain the client information of the second client carried in the first access request, and query the encoding information corresponding to the client information of the second client as the encoding information of the second client.

[0089] S306: Obtain the target identification information according to the third login ticket analysis.

[0090] S307: Query the first login ticket from the database according to the target identification information and the encoding information of the second client.

[0091] In step S306-step S307, the server can parse the third login ticket to obtain the target identification information, and based on the target identification information and the encoding information of the second client, since the second login ticket stored in the database has been replaced by the first login ticket, the login ticket queried from the database at this time is no longer the second login ticket, but the first login ticket.

[0092] In an embodiment of the present application, the server can obtain the target identification information based on the third login ticket by: the server uses the private key of the key pair to decrypt the third login ticket to obtain the initial login ticket of the second client, and parses the initial login ticket of the second client to obtain first parsed data, and the first parsed data includes the target identification information.

[0093] S308: When it is determined that the third login ticket is inconsistent with the first login ticket, determine that the third login ticket verification fails, refuse to process the first access request, and send a logout prompt message to the second client.

[0094] In the embodiment of the present application, regardless of whether the third login ticket is the second login ticket, it is inevitable that the third login ticket is different from the first login ticket. For the server, the server can determine whether the third login ticket is consistent with the first login ticket. Among them, the process of the server judging whether the third login ticket is consistent with the first login ticket can be: the server parses the third login ticket to obtain the initial login ticket of the second client, and parses the initial login ticket of the second client to obtain the second parsed data; the server can determine that the third login ticket is inconsistent with the first login ticket when the second parsed data is inconsistent with the first parsed data mentioned above. When the third login ticket is the second login ticket, the third login ticket is inconsistent with the first login ticket, indicating that the target user uses a client other than the second client among multiple clients that is mutually exclusive with the second client (the first client used in the embodiment of the present application) to log in to the server.

[0095] S309: When the database does not include the second login ticket, save the corresponding relationship between the target identification information, the encoding information of the first client, and the first login ticket in the database.

[0096] Among them, step S309 can refer to step Figure 2 Step S205 of the embodiment is not described in detail in the embodiment of the present application.

[0097] visible, Figure 3 In the embodiment shown, when the second login ticket of the second client is replaced by the first login ticket of the first client, when the second client is used to access the server, the access of the second client will be denied, and the second client will receive a prompt message to log out. This process realizes the mutual exclusion of logins between the first client and the second client through encoded information.

[0098] See also Figure 4 , is a schematic diagram of the structure of a client login management device provided in an embodiment of the present application. The device can be applied to the aforementioned server. Specifically, the login management device may include:

[0099] The acquisition module 401 is used to acquire the target identification information of the target user in the application system after the first login request sent by the target user through the first client is verified.

[0100] The ticket generation module 402 is used to obtain the encoding information of the first client according to the first login request, and generate a first login ticket for the first client according to the target identification information and the first login request.

[0101] The query module 403 is used to query whether the database includes a second login ticket based on the target identification information and the coding information of the first client; the second login ticket is generated based on the target identification information and the second login request sent by the target user through the second client, and the coding information of the second client is the same as the coding information of the first client; the database stores the identification information of each user in the application system, the coding information of the client used by each user to log in to the server, and the login ticket generated for the client used by each user to log in to the server.

[0102] The data management module 404 is used to replace the second login ticket in the database with the first login ticket when the database includes the second login ticket, and to save the correspondence between the target identification information, the encoding information of the first client and the first login ticket in the database when the database does not include the second login ticket.

[0103] In an optional implementation, the second client logs in to the server before the first client.

[0104] In an optional implementation, the client login management device further includes an access processing module 405 .

[0105] In an optional embodiment, the access processing module 405 is also used to, after replacing the second login ticket in the database with the first login ticket, obtain the encoding information of the second client according to the first access request after receiving the first access request sent by the target user through the second client, and obtain the third login ticket carried by the first access request; parse the target identification information according to the third login ticket; query the first login ticket from the database according to the target identification information and the encoding information of the second client; when it is determined that the third login ticket is inconsistent with the first login ticket, determine that the third login ticket verification fails, refuse to process the first access request, and send a logout prompt message to the second client.

[0106] In an optional embodiment, the access processing module 405 is also used to, after receiving a second access request sent by the target user through the first client, obtain the encoding information of the first client according to the second access request, and obtain the fourth login ticket carried by the second access request; parse the target identification information according to the fourth login ticket; query the first login ticket from the database according to the target identification information and the encoding information of the first client; when it is determined that the fourth login ticket is consistent with the first login ticket, determine that the fourth login ticket has been verified, obtain request data in response to the second access request, and send the request data to the first client.

[0107] In an optional embodiment, the access processing module 405 is used to obtain the ticket expiration time of the first client when the fourth login ticket verification is passed; the ticket expiration time of the first client is the initial ticket expiration time of the first client, or the ticket expiration time of the first client adjusted by the configuration center based on the ticket expiration time management page returned by the server; based on the request creation time included in the fourth login ticket and the ticket expiration time of the first client, determine whether the fourth login ticket is expired; when the fourth login ticket is not expired, trigger the step of obtaining request data in response to the second access request and sending the request data to the second client.

[0108] In an optional embodiment, the ticket generation module 402 obtains the coding information of the first client according to the first login request, specifically obtains the client information of the first client carried by the first login request; determines the coding information corresponding to the client information of the first client according to the correspondence between the client information and the coding information; and determines the coding information corresponding to the client information of the first client as the coding information of the first client.

[0109] In an optional embodiment, the ticket generation module 402 generates a first login ticket for the first client based on the target identification information and the first login request, specifically obtaining the request creation time carried by the first login request; generating an initial login ticket for the first client based on the target identification information and the request creation time; and encrypting the initial login ticket generated for the first client using an asymmetric encryption method to obtain a first login ticket.

[0110] In an optional embodiment, the data management module 404 is also used to return a coding information management page to the configuration center in response to a coding information management request sent by the configuration center; the coding information management page includes coding information configuration items corresponding to the target client information; the coding information configuration items are used by the configuration center to adjust the initial coding information of the target client information; the target client information is one or more client information among multiple client information; receiving the adjusted coding information corresponding to the target client information returned by the configuration center, and determining the adjusted coding information of the target client information as the coding information of the target client.

[0111] visible, Figure 4 In the illustrated embodiment, the client login management device can obtain the target identification information of the target user in the application system after verifying the first login request sent by the target user through the first client, and obtain the coding information of the first client according to the first login request, so as to generate a first login ticket for the first client according to the target identification information and the first login request; the client login management device can query whether the database includes the second login ticket according to the target identification information and the coding information of the first client; the client login management device can use the first login ticket to replace the second login ticket in the database when the database includes the second login ticket, and can save the correspondence between the target identification information, the coding information of the first client and the first login ticket in the database when the database does not include the second login ticket. The present application adopts the above process to realize the process of multi-terminal login mutual exclusion and login compatibility according to the client coding. The client login management method of the embodiment of the present application is more flexible and can meet the login requirements in more scenarios.

[0112] See also Figure 5 , is a schematic diagram of a server structure provided in an embodiment of the present application. The server described in this embodiment may include: one or more processors 1000 and a memory 2000. The processor 1000 and the memory 2000 may be connected via a bus.

[0113] The processor 1000 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.

[0114] The memory 2000 may be a high-speed RAM memory or a non-volatile memory, such as a disk memory. The memory 2000 is used to store a set of program codes, and the processor 1000 may call the program codes stored in the memory 2000. Specifically:

[0115] Processor 1000 is used to obtain target identification information of the target user in the application system after a first login request sent by a target user through a first client is verified; obtain the encoding information of the first client according to the first login request, and generate a first login ticket for the first client according to the target identification information and the first login request; query whether a database includes a second login ticket according to the target identification information and the encoding information of the first client; the second login ticket is generated according to the target identification information and the second login request sent by the target user through the second client, and the encoding information of the second client is the same as the encoding information of the first client; the database stores identification information of each user in the application system, encoding information of the client used by each user to log in to the server, and a login ticket generated for the client used by each user to log in to the server; when the database includes the second login ticket, the first login ticket is used to replace the second login ticket in the database; when the database does not include the second login ticket, the correspondence between the target identification information, the encoding information of the first client and the first login ticket is saved in the database.

[0116] In one embodiment, the processor 1000 is also used to, after replacing the second login ticket in the database with the first login ticket, obtain the encoding information of the second client according to the first access request after receiving the first access request sent by the target user through the second client, and obtain the third login ticket carried in the first access request; parse the target identification information according to the third login ticket; query the first login ticket from the database according to the target identification information and the encoding information of the second client; when it is determined that the third login ticket is inconsistent with the first login ticket, determine that the third login ticket verification fails, refuse to process the first access request, and send a logout prompt message to the second client.

[0117] In one embodiment, the server further includes a communication interface ( Figure 5 The processor 1000 can receive the first access request sent by the target user through the second client through the communication interface, and send a logout prompt to the second client through the interface.

[0118] In one embodiment, the second client logs into the server before the first client.

[0119] In one embodiment, the processor 1000 is also used to, after receiving a second access request sent by the target user through the first client, obtain the encoding information of the first client according to the second access request, and obtain the fourth login ticket carried by the second access request; parse the target identification information according to the fourth login ticket; query the first login ticket from the database according to the target identification information and the encoding information of the first client; when it is determined that the fourth login ticket is consistent with the first login ticket, determine that the fourth login ticket has been verified, obtain request data in response to the second access request, and send the request data to the first client.

[0120] In one embodiment, the processor 1000 may receive a second access request sent by a target user through a first client through a communication interface, and may send request data to the first client through the communication interface.

[0121] In one embodiment, the processor 1000 is also used to obtain the ticket expiration time of the first client when the fourth login ticket is verified; the ticket expiration time of the first client is the initial ticket expiration time of the first client, or the ticket expiration time of the first client adjusted by the configuration center based on the ticket expiration time management page returned by the server; determine whether the fourth login ticket is expired according to the request creation time included in the fourth login ticket and the ticket expiration time of the first client; when the fourth login ticket is not expired, trigger the step of obtaining request data in response to the second access request and sending the request data to the second client.

[0122] In one embodiment, the processor 1000 obtains the encoding information of the first client according to the first login request, specifically obtains the client information of the first client carried by the first login request; determines the encoding information corresponding to the client information of the first client according to the correspondence between the client information and the encoding information; and determines the encoding information corresponding to the client information of the first client as the encoding information of the first client.

[0123] In one embodiment, the processor 1000 generates a first login ticket for the first client based on the target identification information and the first login request, specifically obtaining the request creation time carried by the first login request; generating an initial login ticket for the first client based on the target identification information and the request creation time; and encrypting the initial login ticket generated for the first client using an asymmetric encryption method to obtain a first login ticket.

[0124] In one embodiment, the processor 1000 is further used to return a coding information management page to the configuration center in response to a coding information management request sent by the configuration center; the coding information management page includes coding information configuration items corresponding to the target client information; the coding information configuration items are used by the configuration center to adjust the initial coding information of the target client information; the target client information is one or more client information among multiple client information; receiving the adjusted coding information corresponding to the target client information returned by the configuration center, and determining the adjusted coding information of the target client information as the coding information of the target client.

[0125] In one embodiment, the processor 1000 may return the encoding information management page to the configuration center through the communication interface, and receive the adjusted encoding information corresponding to the target client returned by the configuration center through the communication interface.

[0126] In a specific implementation, the processor 1000 described in the embodiment of the present application may execute Figure 2Example Figure 3 The implementation method described in the embodiment can also execute the implementation method described in the embodiment of the present application, which will not be repeated here.

[0127] Each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of sampling hardware or sampling software functional modules.

[0128] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the computer-readable storage medium can be volatile or non-volatile. For example, the computer storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM). The computer-readable storage medium can mainly include a storage program area and a storage data area, wherein the storage program area can store an operating system, at least one application required for a function, etc.; the storage data area can store data created according to the use of the blockchain node, etc.

[0129] Among them, the blockchain referred to in this application is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0130] What is disclosed above is only a preferred embodiment of the present application, and it certainly cannot be used to limit the scope of rights of the present application. Ordinary technicians in this field can understand that all or part of the processes of implementing the above embodiment and equivalent changes made according to the claims of the present application are still within the scope covered by the present application.

Claims

1. A client login management method, characterized in that: include: After the first login request sent by the target user through the first client is verified, the target identification information of the target user in the application system is obtained; Acquire encoding information of the first client according to the first login request, and generate a first login ticket for the first client according to the target identification information and the first login request; According to the target identification information and the encoding information of the first client, querying a database whether it includes a second login ticket corresponding to the target identification information and the encoding information of the first client; The second login ticket is generated according to the target identification information and a second login request sent by the target user through a second client, and the second client logs in to the server before the first client; the database stores the corresponding relationship between the identification information of each user in the application system and the encoding information of the client used by each user to log in to the server, and the login ticket generated for the client used by each user to log in to the server; The encoding information of the first client is different from the first login request, the encoding information of the second client is different from the second login request, and the first login ticket is different from the second login ticket; When the database includes the second login ticket, the first login ticket is used to replace the second login ticket in the database, so as to save the correspondence between the target identification information, the encoding information of the second client and the first login ticket in the database, and the encoding information of the second client is the same as the encoding information of the first client; after receiving the first access request sent by the target user through the second client, the encoding information of the second client is obtained according to the first access request, and the third login ticket carried by the first access request is obtained; The target identification information is obtained by parsing the third login ticket; the first login ticket is retrieved from the database according to the target identification information and the encoding information of the second client; When it is determined that the third login ticket is inconsistent with the first login ticket, determining that the third login ticket verification fails, refusing to process the first access request, and sending a logout prompt message to the second client; When the database does not include the second login ticket, storing in the database a correspondence between the target identification information, the encoding information of the first client, and the first login ticket, wherein the encoding information of the second client is different from the encoding information of the first client; Wherein, client logins with the same coding information are mutually exclusive, and client logins with different coding information are compatible; the method further includes: In response to the coding information management request sent by the configuration center, return a coding information management page to the configuration center; the coding information management page includes coding information configuration items corresponding to the target client information; the coding information configuration items are used by the configuration center to adjust the initial coding information of the target client information; the target client information is one or more client information among the multiple client information; Receive the adjusted encoding information corresponding to the target client information returned by the configuration center, and determine the adjusted encoding information of the target client information as the encoding information of the target client; wherein, if the initial encoding information is the encoding information of the second client, the initial encoding information is the same as the encoding information of the first client, and the adjustment is to adjust the encoding information of the second client to be different from the encoding information of the first client, then respond to the access request sent by the target user through the second client.

2. The method according to claim 1, characterized in that The method further comprises: After receiving a second access request sent by the target user through the first client, obtaining the encoding information of the first client according to the second access request, and obtaining a fourth login ticket carried in the second access request; Obtaining the target identification information by parsing the fourth login ticket; querying the first login ticket from the database according to the target identification information and the encoding information of the first client; When it is determined that the fourth login ticket is consistent with the first login ticket, it is determined that the fourth login ticket is verified, request data is obtained in response to the second access request, and the request data is sent to the first client.

3. The method according to claim 2, characterized in that The method further comprises: When the fourth login ticket verification passes, the ticket expiration time of the first client is obtained; the ticket expiration time of the first client is the initial ticket expiration time of the first client, or the ticket expiration time adjusted by the first client obtained by the configuration center based on the ticket expiration time management page returned by the server; Determining whether the fourth login ticket is expired according to the request creation time included in the fourth login ticket and the ticket expiration time of the first client; When the fourth login ticket has not expired, the step of obtaining request data in response to the second access request and sending the request data to the second client is triggered.

4. The method according to any one of claims 1 to 3, characterized in that: The acquiring the encoding information of the first client according to the first login request includes: Obtaining client information of the first client carried in the first login request; Determining the encoding information corresponding to the client information of the first client according to the correspondence between the client information and the encoding information; The encoding information corresponding to the client information of the first client is determined as the encoding information of the first client.

5. The method according to claim 4, characterized in that The step of generating a first login ticket for the first client according to the target identification information and the first login request includes: Obtaining the request creation time carried in the first login request; Generating an initial login ticket for the first client according to the target identification information and the request creation time; The initial login ticket generated for the first client is encrypted using an asymmetric encryption method to obtain a first login ticket.

6. A client login management device, characterized in that: include: An acquisition module, configured to acquire target identification information of the target user in the application system after a first login request sent by the target user through the first client is verified; a ticket generation module, configured to obtain the encoding information of the first client according to the first login request, and generate a first login ticket for the first client according to the target identification information and the first login request; A query module, configured to query a database, based on the target identification information and the encoding information of the first client, whether the database includes a second login ticket corresponding to the target identification information and the encoding information of the first client; The second login ticket is generated according to the target identification information and a second login request sent by the target user through a second client, and the second client logs in to the server before the first client; the database stores the corresponding relationship between the identification information of each user in the application system and the encoding information of the client used by each user to log in to the server, and the login ticket generated for the client used by each user to log in to the server; The encoding information of the first client is different from the first login request, the encoding information of the second client is different from the second login request, and the first login ticket is different from the second login ticket; a data management module, configured to replace the second login ticket in the database with the first login ticket when the database includes the second login ticket, so as to save the correspondence between the target identification information, the encoding information of the second client and the first login ticket in the database, wherein the encoding information of the second client is the same as the encoding information of the first client; after receiving a first access request sent by the target user through the second client, obtain the encoding information of the second client according to the first access request, and obtain a third login ticket carried by the first access request; The target identification information is obtained by parsing the third login ticket; the first login ticket is retrieved from the database according to the target identification information and the encoding information of the second client; When it is determined that the third login ticket is inconsistent with the first login ticket, determining that the third login ticket verification fails, refusing to process the first access request, and sending a logout prompt message to the second client; The data management module is further configured to store, in the database, a correspondence between the target identification information, the encoding information of the first client, and the first login ticket when the database does not include the second login ticket, the encoding information of the second client being different from the encoding information of the first client; The data management module is further used to respond to the coding information management request sent by the configuration center and return the coding information management page to the configuration center; the coding information management page includes the coding information configuration items corresponding to the target client information; The encoding information configuration item is used by the configuration center to adjust the initial encoding information of the target client information; the target client information is one or more client information among multiple client information; the adjusted encoding information corresponding to the target client information returned by the configuration center is received, and the adjusted encoding information of the target client information is determined as the encoding information of the target client; wherein, client logins with the same encoding information are mutually exclusive, and client logins with different encoding information are compatible; if the initial encoding information is the encoding information of the second client, the initial encoding information is the same as the encoding information of the first client, and the adjustment is to adjust the encoding information of the second client to be different from the encoding information of the first client, then respond to the access request sent by the target user through the second client.

7. A server, characterized in that: The method comprises a processor and a memory, wherein the processor and the memory are connected to each other, wherein the memory is used to store a computer program, the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method according to any one of claims 1 to 5.