Unified login method and device, equipment and medium

Through the unified login method, the unified login token is used to realize automatic login of multiple clients, which solves the problems of high development and maintenance costs caused by independent client login modules in the existing technology and the frequent login of users, improving user experience and efficiency.

CN119945746APending Publication Date: 2025-05-06上海瑞家信息技术有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411987374.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

In the prior art, each client needs to independently implement the login and exit modules and API interfaces, resulting in high development and maintenance costs. Users need to log in frequently when using multiple associated clients, which is cumbersome to operate, which affects user experience and efficiency.

Method used

Provide a unified login method. By detecting the start operation of the client, it determines whether a unified login token exists on the electronic device. If it exists, it automatically obtains the token and generates a login request to realize automatic login of multiple clients; if it does not exist, it jumps to the login interface, the user enters information and generates and sends a login request, and stores the unified login token after success.

Benefits of technology

It realizes unified login between multiple clients, reduces the frequency and operation steps of user login, improves user access efficiency and convenience, and reduces development and maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119945746A_ABST
    Figure CN119945746A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a unified login method and device, equipment and a medium, and relates to the technical field of computers. The method comprises the steps of determining whether a unified login token exists in a specified storage position on the electronic equipment in response to a detected starting operation of a first client; the unified login token is used for indicating a plurality of specified clients installed on the electronic equipment to share the unified login token to automatically log in the server; the first client is any client in the specified clients; and under the condition that the unified login token exists in the specified storage position, automatically obtaining the unified login token, generating a first login request based on the unified login token, and automatically sending the first login request to the server side, so that the first client side automatically logs in the server side. According to the method, any one of the plurality of specified clients installed on the electronic equipment can automatically log in the server through the unified login token, and a user does not need to input login information, so that the user access efficiency and convenience are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a unified login method, device, equipment and medium. Background Art

[0002] At present, each client (Application, APP for short) has independent login and exit modules and client programming interface (ApplicationProgramming Interface, API for short). Each additional client needs to develop a corresponding set of login and exit modules and API interfaces. However, the differences in these contents are small. If each client implements these functions, it will cost a lot of manpower and time, and the subsequent maintenance costs will increase accordingly. On the other hand, for multiple related clients, users need to log in before using each client, and need to log in multiple times when switching between different clients. Users are required to enter account information multiple times, which is cumbersome and seriously affects the user's access experience and access efficiency. Summary of the invention

[0003] In order to solve the above technical problems or at least partially solve the above technical problems, the embodiments of the present invention provide a unified login method, apparatus, device and medium.

[0004] In a first aspect, an embodiment of the present invention provides a unified login method, including:

[0005] In response to detecting a startup operation of a first client installed on the electronic device, determining whether a unified login token exists in a designated storage location on the electronic device; the unified login token is used to indicate that multiple designated clients installed on the electronic device share the unified login token and automatically log in to the server based on the unified login token; the first client is any one of the multiple designated clients;

[0006] When it is determined that the unified login token exists in the designated storage location, automatically obtaining the unified login token from the designated storage location, and generating a first login request based on the unified login token;

[0007] Automatically send a first login request to the server, so that the first client automatically logs in to the server.

[0008] Optionally, the method also includes: when it is determined that the unified login token does not exist in the designated storage location, jumping to the login interface of the first client; obtaining login information entered by the user in the login interface, and generating a second login request based on the login information; sending the second login request to the server to log in to the server; receiving the unified login token sent by the server, and storing the unified login token in the designated storage location on the electronic device, the unified login token being sent by the server when the second login request is verified successfully.

[0009] Optionally, the method also includes: when it is determined that the unified login token does not exist in the designated storage location, obtaining the device identification of the electronic device; based on the device identification, generating a device registration request, and sending the device registration request to the server; the device registration request is used to enable the server to record the electronic device and set the status identification of the electronic device to an online state; receiving a first token sent by the server; generating a second login request based on the login information includes: generating a second login request based on the login information and the first token.

[0010] In a second aspect, an embodiment of the present invention provides a unified login method, which is applied to a server, including:

[0011] Receiving a first login request sent by a first client;

[0012] In response to the first login request including a unified login token, a communication link is established with the first client so that the first client successfully logs in to the server. The unified login token is used to indicate that multiple designated clients installed on the same electronic device share the unified login token and automatically log in to the server based on the unified login token. The first client is any one of the multiple designated clients.

[0013] Optionally, the method also includes: in response to the first login request including login information corresponding to the first client, verifying the login information; the login information is input by the first client when the unified login token is not obtained at a designated storage location on the corresponding electronic device; if the login information verification passes, sending a unified login token to the first client so that the first client stores the unified login token at the designated storage location on the electronic device, and establishing a communication link with the first client so that the first client can successfully log in to the server.

[0014] Optionally, in response to the first login request including login information corresponding to the first client, verifying the login information includes:

[0015] In response to the first login request including login information and a first token corresponding to the first client, the login information and the first token are verified respectively; the first token is sent by the server to the first client when receiving a device registration request from the first client; the device registration request is sent by the first client when the first client fails to obtain the unified login token at a designated storage location on the corresponding electronic device;

[0016] When the login information is verified, sending a unified login token to the first client and establishing a communication link with the first client include:

[0017] When both the login information and the first token are verified, a unified login token is sent to the first client, and a communication link is established with the first client.

[0018] Optionally, the method further includes: in response to receiving a device registration request sent by the first client, recording the electronic device corresponding to the first client according to the device identifier in the device registration request and setting the status identifier of the electronic device to an online state.

[0019] Optionally, the method further includes: when establishing a communication link with the first client, determining, based on the identification information of the first client and the login information in the unified login token, whether there is at least one other electronic device on which the first client is installed and which is bound to the login information; if there is at least one such other electronic device, selecting at least one such other electronic device as a to-be-selected device; determining, based on a preset online control strategy, a to-be-selected device among at least one of the to-be-selected devices; and disconnecting the communication link with the to-be-selected device to make the to-be-selected device offline.

[0020] Optionally, the unified login token includes a status identifier of an electronic device corresponding to the first client, and the status identifier is an online status;

[0021] The disconnecting the communication link with the device to be offline includes: setting the status identifier corresponding to the device to be offline to an offline state, disconnecting the communication link of the device to be offline whose status identifier is an offline state, so as to make the first client in the device to be offline offline.

[0022] In a third aspect, an embodiment of the present invention provides a unified login device, which is applied to an electronic device, including:

[0023] A determination module, configured to determine whether a unified login token exists in a designated storage location on the electronic device in response to detecting a startup operation of a first client installed on the electronic device; the unified login token is used to indicate that multiple designated clients installed on the electronic device share the unified login token and automatically log in to the server based on the unified login token; the first client is any one of the multiple designated clients;

[0024] an acquisition module, configured to automatically acquire the unified login token from the designated storage location when determining that the unified login token exists in the designated storage location, and generate a login request based on the unified login token;

[0025] The automatic login module is used to automatically send a login request to the server so that the first client automatically logs in to the server.

[0026] Optionally, the device also includes a request module, which is used to: jump to the login interface of the first client when it is determined that the unified login token does not exist in the designated storage location; obtain login information entered by the user in the login interface, and generate a second login request based on the login information; send the second login request to the server to log in to the server; receive the unified login token sent by the server, and store the unified login token in the designated storage location on the electronic device, the unified login token being sent by the server when the second login request is verified successfully.

[0027] Optionally, the request module is also used to: obtain the device identification of the electronic device when it is determined that the unified login token does not exist in the designated storage location; generate a device registration request based on the device identification, and send the device registration request to the server; the device registration request is used to enable the server to record the electronic device and set the status identification of the electronic device to an online state; receive a first token sent by the server; and generate a second login request based on the login information and the first token.

[0028] In a fourth aspect, an embodiment of the present invention provides a unified login device, which is applied to a server, and includes:

[0029] A receiving module, used to receive a login request sent by a first client;

[0030] A communication establishment module is used to establish a communication link with the first client in response to the first login request including a unified login token, so that the first client can successfully log in to the server, the unified login token is used to indicate that multiple designated clients installed on the same electronic device share the unified login token and automatically log in to the server based on the unified login token; the first client is any one of the multiple designated clients.

[0031] Optionally, the communication establishment module is also used to: in response to the first login request including login information corresponding to the first client, verify the login information; the login information is input by the first client when the unified login token is not obtained at the designated storage location on the corresponding electronic device; if the login information verification passes, send the unified login token to the first client so that the first client stores the unified login token at the designated storage location on the electronic device, and establish a communication link with the first client so that the first client can successfully log in to the server.

[0032] Optionally, the communication establishment module is also used to: in response to the first login request including login information and a first token corresponding to the first client, verify the login information and the first token respectively; the first token is sent by the server to the first client when it receives a device registration request from the first client; the device registration request is sent by the first client when the first client fails to obtain the unified login token at a designated storage location on the corresponding electronic device; when both the login information and the first token are verified, send the unified login token to the first client and establish a communication link with the first client.

[0033] Optionally, the communication establishment module is further used to: in response to receiving a device registration request sent by the first client, record the electronic device corresponding to the first client according to the device identifier in the device registration request and set the status identifier of the electronic device to an online state.

[0034] Optionally, the device also includes an online control module, which is used to: when a communication link is established with the first client, determine whether there is at least one other electronic device on which the first client is installed and which is bound to the login information, based on the identification information of the first client and the login information in the unified login token; if there is at least one such other electronic device, select at least one such other electronic device as a to-be-selected device; determine, according to a preset online control strategy, a to-be-selected device among at least one of the to-be-selected devices; and disconnect the communication link with the to-be-selected device to make the to-be-selected device offline.

[0035] Optionally, the unified login token includes a status identifier of an electronic device corresponding to the first client, and the status identifier is an online status;

[0036] The online control module is further used to: set the status identifier corresponding to the offline device to be offline as an offline state, disconnect the communication link of the offline device whose status identifier is the offline state, so as to make the first client in the offline device offline.

[0037] In a fifth aspect, an embodiment of the present invention provides an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; the memory is used to store computer programs; and the processor is used to implement the unified login method provided by any embodiment of the present invention when executing the program stored in the memory.

[0038] In a sixth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the unified login method provided by any embodiment of the present invention.

[0039] The technical solution provided by the embodiments of the present invention brings at least the following beneficial effects:

[0040] The unified login method provided by the embodiment of the present invention determines whether there is a unified login token in a designated storage location on an electronic device in response to detecting a startup operation of a first client; the unified login token is used to indicate that multiple designated clients installed on the electronic device share the unified login token to automatically log in to a server; the first client is any of the designated clients; when there is a unified login token in the designated storage location, the unified login token is automatically obtained, a first login request is generated based on the unified login token and automatically sent to the server, so that the first client automatically logs in to the server. In this method, any designated client installed on the electronic device can access the designated storage location on the electronic device. If there is a unified login token in the designated storage location, the unified login token can be used to automatically log in to the server when the user starts any designated client. This method enables any of the multiple designated clients installed on the electronic device to automatically log in to the server through the unified login token, without the user having to enter login information, thereby improving user access efficiency and convenience. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.

[0042] Figure 1A schematic diagram showing a process flow of a client implementing a unified login method provided by an embodiment of the present invention;

[0043] Figure 2 A schematic diagram of a sub-process of a client implementing a unified login method provided by an embodiment of the present invention is shown;

[0044] Figure 3 A schematic diagram of a sub-process of a client implementing a unified login method provided by an embodiment of the present invention is shown;

[0045] Figure 4 A schematic diagram showing a process flow of a unified login method provided by an embodiment of the present invention implemented by a server;

[0046] Figure 5 A schematic diagram of a sub-process of a unified login method provided by an embodiment of the present invention is shown in the server side;

[0047] Figure 6 A schematic diagram showing a process flow of a unified login method provided by an embodiment of the present invention implemented by a server;

[0048] Figure 7 A schematic diagram of the structure of a unified login device applied to a client provided by an embodiment of the present invention is shown;

[0049] Figure 8 A schematic diagram of the structure of a unified login device applied to a server provided by an embodiment of the present invention is shown;

[0050] Fig. 9 A schematic structural diagram of an electronic device according to an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0051] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0052] The terms "first", "second", etc. in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of the same type, and the number of objects is not limited. For example, the first object can be one or more.

[0053] Figure 1The flowchart of the unified login method provided by the embodiment of the present invention is shown. The method can be applied to any client among multiple designated clients installed on the same electronic device. Optionally, there may be an association relationship between the multiple designated clients, for example, the multiple designated clients correspond to the same server, or the multiple designated clients correspond to multiple servers of the same enterprise, or the multiple designated clients correspond to multiple servers of multiple enterprises, wherein the multiple enterprises may be associated enterprises, such as having equity relations or cooperative relations, etc. For the case where multiple designated clients correspond to the same server, the server can receive access requests from multiple designated clients and feedback response information, for example, the server responds to receiving a unified login token sent by any designated client, and establishes a communication link with it to log in to the server. For the case where multiple designated clients correspond to multiple servers, the multiple designated clients trust each other, and the multiple servers corresponding to the multiple designated clients also trust each other. Multiple designated clients are all capable of obtaining a unified login token stored in a designated storage location on the electronic device, and the multiple servers allow the corresponding designated clients to automatically log in through the unified login token. Optionally, the above-mentioned electronic devices may include, for example, but are not limited to, smart phones, tablet computers, laptops, smart wearable devices and other devices. The server side may be, for example, an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server, etc., and the present invention does not make any limitation thereto.

[0054] like Figure 1 As shown, the method includes:

[0055] Step S101: In response to detecting a startup operation of a first client installed on an electronic device, determining whether a unified login token exists in a designated storage location on the electronic device.

[0056] Among them, multiple designated clients are installed on the electronic device, and the first client is any client among the multiple designated clients. There is an association relationship between the multiple designated clients. For example, the multiple designated clients correspond to the same server. The server can receive access requests from multiple designated clients and feedback response information. For example, in response to receiving a unified login token sent by any designated client, the server establishes a communication link with it to log in to the server. In addition, the multiple designated clients can all obtain the unified login token stored in the designated storage location on the electronic device. Among them, the designated storage location on the electronic device can be pre-set, and each designated client can access the storage location to obtain the unified login token. The unified login token is used to indicate that multiple designated clients installed on the electronic device share the unified login token and automatically log in to the server based on the unified login token. The unified login token is sent by the server to the designated client that successfully logs in to the server when any designated client successfully logs in to the server. In the embodiment provided by the present invention, if a unified login token exists in a designated storage location on an electronic device, it indicates that a designated client on the electronic device has successfully logged into the server and received the unified login token sent by the server; if the unified login token does not exist in the designated storage location on the electronic device, it indicates that any designated client on the electronic device has not successfully logged into the server at present.

[0057] Optionally, the unified login token may include a unified login identifier. The unified login identifier is used to indicate that any client among multiple specified clients can automatically log in to the server according to the unified login token. Optionally, the unified login token may include a unified login identifier and an identity identifier used to indicate the identity of the user. For example, when the user first registers with the server, the server generates an identity identifier for the user. Optionally, the server may record the correspondence between the device identifier, identity identifier and unified login identifier of the device used by the user when registering. Optionally, the unified login token may include login information (such as user account and password) and a unified login identifier. Optionally, the unified login token may include login information (such as user account and password), a unified login identifier and a device identifier (the device identifier is used to identify the electronic device), so that the server can determine the current electronic device according to the device identifier. Optionally, the server may record the correspondence between the login information, the unified login identifier and the device identifier.

[0058] Step S102: when it is determined that the unified login token exists in the designated storage location, the unified login token is automatically obtained from the designated storage location, and a first login request is generated based on the unified login token. The first login request includes the unified login token.

[0059] Step S103: automatically sending a first login request to the server, so that the first client automatically logs in to the server.

[0060] The unified login method of the embodiment of the present invention, in response to detecting the startup operation of the first client, determines whether there is a unified login token in the designated storage location on the electronic device; the unified login token is used to indicate that multiple designated clients installed on the electronic device share the unified login token to automatically log in to the server; the first client is any client among the designated clients; when the unified login token exists in the designated storage location, the unified login token is automatically obtained, and a first login request is generated based on the unified login token and automatically sent to the server, so that the first client automatically logs in to the server. In this method, any designated client installed on the electronic device can access the designated storage location on the electronic device. If the unified login token exists in the designated storage location, the unified login token can be used to automatically log in to the server when the user starts any designated client. This method enables any of the multiple designated clients installed on the electronic device to automatically log in to the server through the unified login token, without the user having to enter login information, thereby improving user access efficiency and convenience.

[0061] Figure 2 FIG. 1 is a schematic diagram showing a sub-process of a unified login method according to an embodiment of the present invention. Figure 2 As shown, in the case where it is determined that the unified login token does not exist in the designated storage location on the electronic device, the method includes:

[0062] Step S201: Jump to the login interface of the first client.

[0063] Step S202: Obtain the login information entered by the user on the login interface, and generate a second login request based on the login information. The second login request includes the user account and password entered by the user on the login interface. Optionally, the second login request also includes verification code information entered by the user on the login interface.

[0064] Step S203: Send a second login request to the server so that the first client automatically logs in to the server. When the server receives the second login request, it verifies the second login request, for example, verifies the user account, password and verification code information in the second login request. Under the request in which the user account, password and verification code information are all verified, the server allows the first client to log in, establishes a communication link with the first client, and responds to the second login request of the first client. At the same time, when the second login request is successfully verified, the server also sends a unified login token to the first client through the communication link with the first client.

[0065] Step S204: Receive the unified login token sent by the server, and store the unified login token in a designated storage location on the electronic device.

[0066] In the unified login method provided by the embodiment of the present invention, if the unified login token exists in the designated storage location on the electronic device, it indicates that a designated client on the electronic device has successfully logged in to the server and received the unified login token sent by the server; if the unified login token does not exist in the designated storage location on the electronic device, it indicates that any designated client on the electronic device has not successfully logged in to the server, and the user needs to operate, such as inputting login information in the login interface, to log in to the server. Therefore, in this embodiment, when it is determined that the unified login token does not exist in the designated storage location on the electronic device, the first client can log in to the server through user operation.

[0067] Figure 3 FIG. 1 is a schematic diagram showing a sub-process of unified login in an embodiment of the present invention. Figure 3 As shown, in the case where it is determined that the unified login token does not exist in the designated storage location on the electronic device, the method includes:

[0068] Step S301: Obtain the device identification of the electronic device.

[0069] As an optional example, for an electronic device with an Android system installed, the device identifier may be, for example, IMEI (International Mobile Equipment Identity), OAID (Open Anonymous Identification), etc. Optionally, the first client first obtains the device IMEI, and if the IMEI is successfully obtained and not empty, the IMEI is used as the device identifier; if the IMEI is empty, the device OAID is obtained, and if the OAID is successfully obtained and not empty, it is used as the device identifier; if the OAID is empty, the first client randomly generates a 16-bit string as the device identifier. For an electronic device with an IOS system installed, the device identifier may be, for example, IDFA (Identifier for Advertising, a unique identifier for identifying a user device), IDFV (Identifier for Vendor, a unique identifier for identifying an application developer), etc. Optionally, the first client first obtains the device IDFA, and if the IDFA is successfully obtained and not empty, the IDFA is used as the device unique identifier; if the IDFA is empty, the device IDFV is obtained as the device identifier.

[0070] Step S302: Generate a device registration request based on the device identification, and send the device registration request to the server. The device registration request is used to enable the server to record the electronic device and set the status identification of the electronic device to an online state. Upon receiving the device registration request, the server generates a first token based on the device identification carried in the device registration request, and sends the first token to the first client. The first token indicates that the first client is not logged in. Steps S301 and S302 are spontaneously executed by the first client and are not perceived by the user.

[0071] Step S303: Receive a first token sent by the server.

[0072] Step S304: Jump to the login interface of the first client.

[0073] Step S305: Obtain the login information entered by the user on the login interface.

[0074] Step S306: Based on the login information and the first token, a second login request is generated, and the second login request is sent to the server to log in to the server. The second login request includes the login information and the first token. When the server receives the second login request, it verifies the first token and the login information respectively. When both the first token and the login information are verified successfully, a unified login token is generated, and the unified login token is sent to the first client.

[0075] Step S307: Receive the unified login token sent by the server, and store the unified login token in a designated storage location on the electronic device.

[0076] In an embodiment of the present invention, if a unified login token does not exist in a designated storage location on an electronic device, it indicates that any designated client on the electronic device has not successfully logged into the server. At this time, it is necessary to register the electronic device to the server through a device registration request, so that the server records the electronic device, and then allows any designated client on the electronic device to automatically log in to the server using the unified login token in the future. In addition, user operations are required, such as entering login information in the login interface to log in to the server. Therefore, in this embodiment, when it is determined that a unified login token does not exist in a designated storage location on the electronic device, the first client can log in to the server through a device registration request and user operations.

[0077] Figure 4 A flow chart of a unified login method provided by another embodiment of the present invention is shown. The method is applied to a server. The server may be, for example, an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server, etc., and the present invention does not limit this.

[0078] like Figure 4 As shown, the unified login method includes:

[0079] Step S401: Receive a first login request sent by a first client. The first login request is sent by the first client when it detects that a user starts the first client. Figure 1 , Figure 2 or Figure 3 For example, the first client detects the user's startup operation, obtains the unified login token from the storage location specified on the electronic device, and generates a first login request based on the unified login token. Alternatively, the first client detects the user's startup operation, fails to obtain the unified login token from the storage location specified on the electronic device, and generates a first login request based on the login information entered by the user on the login interface. Alternatively, the first client detects the user's startup operation, fails to obtain the unified login token from the storage location specified on the electronic device, and generates a first login request based on the login information entered by the user on the login interface and the first token received from the server.

[0080] Step S402: In response to the first login request including the unified login token, a communication link is established with the first client to enable the first client to successfully log in to the server. The unified login token is obtained by the first client at a designated storage location on the corresponding electronic device. The unified login token is used to indicate that multiple designated clients installed on the same electronic device share the unified login token and automatically log in to the server based on the unified login token. The first client is any client among the multiple designated clients.

[0081] Step S403: In response to the first login request including the login information corresponding to the first client, the login information is verified. The login information is input by the first client when the unified login token is not obtained at the designated storage location on the corresponding electronic device. The login information includes, for example, a user account and a password, and the server verifies the user account and password respectively. The first login request may also include a verification code, and the server verifies the verification code and the user account and password in the login information respectively.

[0082] Step S404: When the login information verification is passed, a unified login token is sent to the first client so that the first client stores the unified login token in the designated storage location on the electronic device, and a communication link is established with the first client so that the first client successfully logs in to the server.

[0083] In the unified login method provided in the embodiment of the present application, the server includes a unified login token in response to the first login request, and establishes a communication link with the first client based on the unified login request, or, in response to the first login request not including the unified login token but including login information, establishes a communication link with the first client when the login information is verified. The first client is any one of multiple designated clients on the electronic device. The server can use the unified login token to not distinguish between clients requesting login, and once the server receives the unified login token, it can allow the client that sent the unified login token to log in. Therefore, the server of the embodiment of the present application can provide a unified interface to realize the login of multiple designated clients. The interface can provide services for all designated clients without the need to develop a corresponding interface for each designated client, and it also avoids duplication of work when adding a new designated client, thereby reducing the development cost and maintenance cost of the server.

[0084] Figure 5 FIG. 1 is a schematic diagram showing a sub-process of a unified login method provided by an embodiment of the present invention. Figure 5 As shown, including:

[0085] Step S501: in response to receiving a device registration request sent by a first client, according to the device identifier in the device registration request, recording the electronic device corresponding to the first client and setting the status identifier of the electronic device to an online state.

[0086] Step S502: Send a first token to the first client.

[0087] refer to Figure 3, the device registration request is sent by the first client when the unified login token is not obtained at the designated storage location on the corresponding electronic device. When it is determined that the unified login token does not exist at the designated storage location on the electronic device, the first client sends a device registration request to the server to register the electronic device to the server through the device registration request, so that the server records the electronic device, and then allows any designated client on the electronic device to automatically log in to the server using the unified login token in the future. And, the first login request is generated by the first token fed back by the server and the login information entered by the user in the login interface to log in to the server. Therefore, when receiving the device registration request, this embodiment records the corresponding electronic device and feeds back the first token. In addition, when receiving the device registration request sent by the first client, the server can also generate the first device registration information. The first device registration information is used to indicate the state of the current electronic device, such as online state or offline state. For example, the first device registration information includes a state identifier, and when the value of the state identifier is a first preset value (for example, 0), it indicates an offline state, and when the value of the state identifier is a second preset value (for example, 1), it indicates an offline state. When generating the first device registration information, the server sets the value of the state identifier in the first device registration information to the second preset value, that is, sets the current electronic device to be in an online state.

[0088] Step S503: receiving a first login request sent by a first client, where the first login request includes login information corresponding to the first client and a first token.

[0089] Step S504: verify the login information and the first token respectively.

[0090] Optionally, the server may first determine whether the first token is valid, and if the first token is valid, determine whether the login information is correct. If the login information is correct, it is determined that both the first token and the login information have passed the verification. If the first token is invalid, the server feeds back token error information to the first client to notify the first client that the first token verification has failed. Among them, the server may record the generation time of the first token when generating the first token, and determine whether the received first token is valid based on the generation time. For example, the server may first determine whether it has a token identical to the received first token. If it does, it determines whether it is within the validity period based on the recorded generation time of the first token. If the first token is within the validity period, it determines that the first token is valid. If the server itself does not have a token identical to the received first token, or the first token is not within the validity period, it feeds back token error information to the first client to notify the first client that the first token verification has failed. If the first token verification passes, the server verifies the correctness of the login information.

[0091] Step S505: When both the login information and the first token are verified, a unified login token is sent to the first client, and a communication link is established with the first client.

[0092] In an optional application scenario, a user may have the same designated client installed on multiple electronic devices. The unified login method of the embodiment of the present invention can control the client A on one or more other electronic devices to go offline according to a preset online control strategy when a designated client (referred to as client A) on a certain electronic device logs in to the server.

[0093] Figure 6 FIG. 2 shows a flow chart of a unified login method provided by another embodiment of the present invention. Figure 6 As shown, the method includes:

[0094] Step S601: When a communication link is established with a first client, determine whether there is at least one other electronic device with the first client installed that is bound to the login information based on the identification information of the first client and the login information in the unified login token. The identification information of the first client may be, for example, the name of the first client or other identification.

[0095] Optionally, as shown in Table 1 below, the server can record the identification information corresponding to each designated client, the login information used to log in to each client, and the device identification of the device where each client is located. As shown in Table 1, it can be determined from the first row of Table 1 that user 1 has logged in to the same client using the same login information on 3 different devices. If the user currently logs in to the first client through an electronic device with a device identification of X1, the server, when establishing a communication link with the first client on the electronic device with a device identification of X1, determines that there are two electronic devices with the first client installed that are bound to the login information (an electronic device with a device identification of X2 and an electronic device with a device identification of X3) based on the identification information of the first client (the identification information of the first client is identification 1, and the server can determine the identification information of the first client based on the login request sent by the first client) and the login information in the unified login token (the login information in the unified login token is account 1-password 1).

[0096] Table 1:

[0097]

[0098] Step S602: if there is at least one other electronic device, use the at least one other electronic device as a to-be-selected device.

[0099] Step S603: Determine the device to be offline in at least one of the selected devices according to the preset online control strategy. The preset online control strategy is used to control the number and type of devices that are online at the same time. As an optional example, the preset online control strategy may include any of the following: allowing only one device to be online at the same time, allowing the number of devices that are online at the same time to be less than or equal to a specified value, and specifying the types of devices that are online at the same time, such as smart phones, personal computers, smart speakers, etc.

[0100] Step S604: disconnect the communication link with the device to be offline to make the device to be offline offline. Optionally, the status identifier corresponding to the device to be offline can be set to an offline state, and then disconnect the communication link of the device to be offline with the status identifier as the offline state to make the first client in the device to be offline offline.

[0101] Figure 7 FIG. 7 is a schematic diagram showing the structure of a unified login device according to an embodiment of the present invention. The unified login device 700 is applied to an electronic device. Figure 7 As shown, the unified login device 700 includes:

[0102] The determination module 701 is used to determine whether there is a unified login token in a designated storage location on the electronic device in response to detecting a startup operation of a first client installed on the electronic device; the unified login token is used to indicate that multiple designated clients installed on the electronic device share the unified login token and automatically log in to the server based on the unified login token; the first client is any one of the multiple designated clients;

[0103] An acquisition module 702 is configured to automatically acquire the unified login token from the designated storage location when it is determined that the unified login token exists in the designated storage location, and generate a login request based on the unified login token;

[0104] The communication establishing module 703 is used to automatically send a login request to the server so that the first client automatically logs in to the server.

[0105] Optionally, the device also includes a request module, which is used to: jump to the login interface of the first client when it is determined that the unified login token does not exist in the designated storage location; obtain login information entered by the user in the login interface, and generate a second login request based on the login information; send the second login request to the server to log in to the server; receive the unified login token sent by the server, and store the unified login token in the designated storage location on the electronic device, the unified login token being sent by the server when the second login request is verified successfully.

[0106] Optionally, the request module is also used to: obtain the device identification of the electronic device when it is determined that the unified login token does not exist in the designated storage location; generate a device registration request based on the device identification, and send the device registration request to the server; the device registration request is used to enable the server to record the electronic device and set the status identification of the electronic device to an online state; receive a first token sent by the server; and generate a second login request based on the login information and the first token.

[0107] Figure 8 FIG. 8 is a schematic diagram showing the structure of a unified login device according to an embodiment of the present invention. The unified login device 800 is applied to a server. Figure 8 As shown, the unified login device 800 includes:

[0108] The receiving module 801 is used to receive a login request sent by a first client;

[0109] The communication establishment module 802 is used to establish a communication link with the first client in response to the first login request including a unified login token, so that the first client can successfully log in to the server. The unified login token is used to indicate that multiple designated clients installed on the same electronic device share the unified login token and automatically log in to the server based on the unified login token; the first client is any one of the multiple designated clients.

[0110] Optionally, the communication establishment module 802 is also used to: in response to the first login request including login information corresponding to the first client, verify the login information; the login information is input by the first client when the unified login token is not obtained at the designated storage location on the corresponding electronic device; if the login information verification passes, send the unified login token to the first client so that the first client stores the unified login token at the designated storage location on the electronic device, and establish a communication link with the first client so that the first client can successfully log in to the server.

[0111] Optionally, the communication establishment module 802 is also used to: in response to the first login request including login information and a first token corresponding to the first client, verify the login information and the first token respectively; the first token is sent by the server to the first client when it receives a device registration request from the first client; the device registration request is sent by the first client when the first client fails to obtain the unified login token at a designated storage location on the corresponding electronic device; when both the login information and the first token are verified, send the unified login token to the first client and establish a communication link with the first client.

[0112] Optionally, the communication establishment module 802 is also used to: in response to receiving a device registration request sent by the first client, record the electronic device corresponding to the first client and set the status identifier of the electronic device to an online state according to the device identifier in the device registration request.

[0113] Optionally, the device also includes an online control module, which is used to: when a communication link is established with the first client, determine whether there is at least one other electronic device on which the first client is installed and which is bound to the login information, based on the identification information of the first client and the login information in the unified login token; if there is at least one such other electronic device, select at least one such other electronic device as a to-be-selected device; determine, according to a preset online control strategy, a to-be-selected device among at least one of the to-be-selected devices; and disconnect the communication link with the to-be-selected device to make the to-be-selected device offline.

[0114] Optionally, the unified login token includes a status identifier of an electronic device corresponding to the first client, and the status identifier is an online status;

[0115] The online control module is further used to: set the status identifier corresponding to the offline device to be offline as an offline state, disconnect the communication link of the offline device whose status identifier is the offline state, so as to make the first client in the offline device offline.

[0116] Fig. 9 FIG. 1 is a schematic diagram showing the structure of an electronic device according to an embodiment of the present invention. Fig. 9 As shown, the electronic device includes:

[0117] Processor 901, communication interface 902, memory 903 and communication bus 904, wherein processor 901, communication interface 902, memory 903 communicate with each other via communication bus 904.

[0118] Memory 903, used for storing computer programs;

[0119] The processor 901 is used to execute the program stored in the memory 903 to implement the following steps:

[0120] In response to detecting a startup operation of a first client installed on the electronic device, determining whether a unified login token exists in a designated storage location on the electronic device; the unified login token is used to indicate that multiple designated clients installed on the electronic device share the unified login token and automatically log in to the server based on the unified login token; the first client is any one of the multiple designated clients;

[0121] When it is determined that the unified login token exists in the designated storage location, automatically obtaining the unified login token from the designated storage location, and generating a first login request based on the unified login token;

[0122] Automatically send a first login request to the server, so that the first client automatically logs in to the server.

[0123] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0124] The communication interface is used for communication between the above terminal and other devices.

[0125] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0126] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0127] In another embodiment provided by the present invention, a computer-readable storage medium is also provided, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer executes the unified login method described in any one of the above embodiments.

[0128] In another embodiment provided by the present invention, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute any unified login method described in the above embodiments.

[0129] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.

[0130] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0131] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0132] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims

1. A unified login method, characterized in that: Used in electronic equipment, including: In response to detecting a startup operation of a first client installed on the electronic device, determining whether a unified login token exists in a designated storage location on the electronic device; the unified login token is used to indicate that multiple designated clients installed on the electronic device share the unified login token and automatically log in to the server based on the unified login token; the first client is any one of the multiple designated clients; When it is determined that the unified login token exists in the designated storage location, automatically obtaining the unified login token from the designated storage location, and generating a first login request based on the unified login token; Automatically send a first login request to the server, so that the first client automatically logs in to the server.

2. The method according to claim 1, characterized in that The method further comprises: If it is determined that the unified login token does not exist in the designated storage location, jumping to the login interface of the first client; Acquire login information entered by the user on the login interface, and generate a second login request based on the login information; Sending the second login request to the server to log in to the server; Receive the unified login token sent by the server, and store the unified login token in the designated storage location on the electronic device, wherein the unified login token is sent by the server when the second login request is successfully verified.

3. The method according to claim 2, characterized in that The method further comprises: If it is determined that the unified login token does not exist in the designated storage location, obtaining a device identification of the electronic device; Based on the device identification, a device registration request is generated, and the device registration request is sent to the server; the device registration request is used to enable the server to record the electronic device and set the status identification of the electronic device to an online state; Receiving a first token sent by the server; The generating a second login request based on the login information includes: generating a second login request based on the login information and the first token.

4. A unified login method, characterized in that: Applied to the server, including: Receiving a first login request sent by a first client; In response to the first login request including a unified login token, a communication link is established with the first client so that the first client successfully logs in to the server. The unified login token is used to indicate that multiple designated clients installed on the same electronic device share the unified login token and automatically log in to the server based on the unified login token. The first client is any one of the multiple designated clients.

5. The method according to claim 4, characterized in that The method further comprises: In response to the first login request including login information corresponding to the first client, verifying the login information; the login information is input by the first client when the unified login token is not obtained at a designated storage location on the corresponding electronic device; When the login information is verified, a unified login token is sent to the first client so that the first client stores the unified login token in the designated storage location on the electronic device, and a communication link is established with the first client so that the first client successfully logs in to the server.

6. The method according to claim 5, characterized in that The step of verifying the login information corresponding to the first client in response to the first login request includes: In response to the first login request including login information and a first token corresponding to the first client, the login information and the first token are verified respectively; the first token is sent by the server to the first client when receiving a device registration request from the first client; the device registration request is sent by the first client when the first client fails to obtain the unified login token at a designated storage location on the corresponding electronic device; When the login information is verified, sending a unified login token to the first client and establishing a communication link with the first client include: When both the login information and the first token are verified, a unified login token is sent to the first client, and a communication link is established with the first client.

7. The method according to claim 6, characterized in that The method further comprises: In response to receiving a device registration request sent by a first client, according to a device identifier in the device registration request, an electronic device corresponding to the first client is recorded and a status identifier of the electronic device is set to an online status.

8. The method according to any one of claims 4 to 7, characterized in that: The method further comprises: In the case of establishing a communication link with the first client, determining whether there is at least one other electronic device with the first client installed and bound to the login information according to the identification information of the first client and the login information in the unified login token; In the case that there is at least one of the other electronic devices, taking the at least one of the other electronic devices as a to-be-selected device; Determine, according to a preset online control strategy, a device to be offline among at least one of the to-be-selected devices; The communication link with the device to be offline is disconnected to make the device to be offline offline.

9. The method according to claim 8, characterized in that The unified login token includes a status identifier of the electronic device corresponding to the first client, and the status identifier is an online status; The disconnecting the communication link with the device to be offline includes: setting the status identifier corresponding to the device to be offline to an offline state, disconnecting the communication link of the device to be offline whose status identifier is an offline state, so as to make the first client in the device to be offline offline.

10. A unified login device, characterized in that: Used in electronic equipment, including: A determination module, configured to determine whether a unified login token exists in a designated storage location on the electronic device in response to detecting a startup operation of a first client installed on the electronic device; the unified login token is used to indicate that multiple designated clients installed on the electronic device share the unified login token and automatically log in to the server based on the unified login token; the first client is any one of the multiple designated clients; an acquisition module, configured to automatically acquire the unified login token from the designated storage location when determining that the unified login token exists in the designated storage location, and generate a login request based on the unified login token; The automatic login module is used to automatically send a login request to the server so that the first client automatically logs in to the server.

11. A unified login device, characterized in that: Applied to the server, including: A receiving module, used to receive a login request sent by a first client; A communication establishment module is used to establish a communication link with the first client in response to the first login request including a unified login token, so that the first client can successfully log in to the server, the unified login token is used to indicate that multiple designated clients installed on the same electronic device share the unified login token and automatically log in to the server based on the unified login token; the first client is any one of the multiple designated clients.

12. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, configured to implement the method according to any one of claims 1 to 9 when executing a program stored in a memory.

13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.