A login state keep-alive system, method, device, medium and equipment

CN123020131APending Publication Date: 2026-10-30ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611080847.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-20
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

但是,这种大型Web应用的账号的登录状态会受到多方面的影响,如登录超时、触发某些安全机制、长时间无操作等,都会导致账号强制登出,这都会直接影响客服服务的连续性和响应效率

Benefits of technology

本说明书实施例公开了一种登录状态保活系统,客户端在触发检测目标账号的登录状态时,向服务端发送该目标账号对应的登录令牌,服务端查询该登录令牌的当前状态,若当前状态为无效,则向客户端返回登录状态失效的通知消息,客户端则向服务端发送该目标状态对应的刷新令牌,使服务端重新生成该目标账号对应的登录令牌和刷新令牌,并将重新生成的登录令牌的当前状态设置为有效,将重新生成的登录令牌和刷新令牌返回客户端。通过上述系统,登录目标账号的客户端可自动通过服务端检查目标账号的登录状态,当未处于登录状态时可通过刷新目标账号的登录令牌重新使目标账号处于登录状态,达到目标状态保活的目的,从而可有效提高客服服务的质量。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123020131A_ABST
    Figure CN123020131A_ABST
Patent Text Reader

Abstract

The embodiment of the present specification discloses a login state keep-alive system. When a client triggers detection of the login state of a target account, the client sends a login token corresponding to the target account to a server. The server queries the current state of the login token. If the current state is invalid, the server returns a notification message of login state invalidity to the client. The client sends a refresh token corresponding to the target state to the server, so that the server re-generates the login token and the refresh token corresponding to the target account, sets the current state of the re-generated login token as valid, and returns the re-generated login token and the refresh token to the client. Through the above system, the client logged in the target account can automatically check the login state of the target account through the server. When the target account is not in the login state, the target account can be re-logged in by refreshing the login token of the target account, so as to achieve the purpose of target state keep-alive, thereby effectively improving the quality of customer service.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of computer technology, and in particular to a login status keeping system, method, apparatus, medium and device. Background Technology

[0002] Currently, e-commerce platforms are able to reliably provide online retail services for merchants, enabling them to sell their goods or services online. In addition, e-commerce platforms can also provide merchants with large-scale web applications for managing their retail operations, allowing them to easily manage their businesses.

[0003] This large web application includes several sub-applications, one of which is the customer service application. After logging into the server of this large web application with their own accounts, merchants can provide users with various customer service services online, such as pre-sales and after-sales services, through the various functions provided by the customer service application, such as instant messaging.

[0004] To ensure the quality of customer service, merchants' accounts need to be online stably for extended periods to guarantee timely responses to user messages. However, the login status of accounts on such large web applications is affected by various factors, such as login timeouts, triggering certain security mechanisms, and prolonged inactivity, all of which can lead to forced account logouts. This directly impacts the continuity and responsiveness of customer service.

[0005] Therefore, how to keep an account logged in is an urgent problem to be solved. Summary of the Invention

[0006] This specification provides a login status keeping system, method, apparatus, storage medium, and electronic device to partially solve the problems existing in the prior art.

[0007] The embodiments in this specification adopt the following technical solutions: This specification provides a login status keep-alive system, which includes: a client and a server; wherein: The client is used to send a login token corresponding to the target account to the server when the login status of the target account is detected. The server is used to receive the login token and query the current status of the login token. If the current status of the login token is invalid, it returns a notification message to the client that the login status of the target account has failed. In response to the notification message, the client sends a pre-saved refresh token corresponding to the target account to the server. In response to the refresh token, the server regenerates the login token and refresh token corresponding to the target account, sets the current status of the regenerated login token to valid, and returns the regenerated login token and refresh token to the client.

[0008] This specification provides a method for maintaining login status, the method comprising: When the client triggers the detection of the login status of the target account, it sends the login token corresponding to the target account to the server. When the server receives a notification message indicating that the login status of the target account has expired, the server sends a pre-saved refresh token corresponding to the target account to the server. The server then responds to the refresh token by regenerating the login token and refresh token corresponding to the target account and sets the current status of the regenerated login token to valid. The notification message indicating that the login status of the target account has expired is returned to the client by the server when it finds that the current status of the login token is invalid. Receive the login token and refresh token regenerated by the server.

[0009] This specification provides a method for maintaining login status, the method comprising: The server receives the login token for the target account; Query the current status of the login token; If the current status of the login token is invalid, return a notification message that the login status of the target account has failed; In response to the refresh token corresponding to the target account sent by the client, a new login token and refresh token corresponding to the target account are generated; Set the current status of the regenerated login token to valid, and return the regenerated login token and refresh token to the client.

[0010] This specification provides a login status keep-alive device, the device comprising: The detection module is used to send the login token corresponding to the target account to the server when the login status of the target account is triggered. The token refresh module is used to send a pre-saved refresh token corresponding to the target account to the server when it receives a notification message from the server that the login status of the target account has expired. The server responds to the refresh token by regenerating the login token and refresh token corresponding to the target account and setting the current status of the regenerated login token to be valid. The notification message that the login status of the target account has expired is returned by the server when it finds that the current status of the login token is invalid. The receiving module is used to receive the login token and refresh token regenerated by the server.

[0011] This specification provides a login status keep-alive device, the device comprising: The receiving module is used to receive the login token of the target account; The status query module is used to query the current status of the login token; The notification module is used to return a notification message indicating that the login status of the target account has failed if the current status of the login token is invalid. The generation module is used to regenerate the login token and refresh token corresponding to the target account in response to the refresh token sent by the client. The sending module is used to set the current state of the regenerated login token to valid and return the regenerated login token and refresh token to the client.

[0012] This specification provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described login status keep-alive method.

[0013] This specification provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the above-described login state keep-alive method.

[0014] This specification provides a computer program product that, when executed by a processor, can be used to perform the above-described login state keep-alive method.

[0015] The above-described at least one technical solution used in the embodiments of this specification can achieve the following beneficial effects: This specification discloses a login status keep-alive system. When a client triggers a check on the login status of a target account, it sends a login token corresponding to that target account to the server. The server queries the current status of the login token. If the current status is invalid, the server returns a login status invalidation notification message to the client. The client then sends a refresh token corresponding to the target status to the server, causing the server to regenerate the login token and refresh token for the target account, set the current status of the regenerated login token to valid, and return the regenerated login token and refresh token to the client. Through this system, clients logging into a target account can automatically check the login status of the target account through the server. When not logged in, refreshing the target account's login token will re-establish the target account's login status, achieving the goal of keeping the target status active and effectively improving the quality of customer service. Attached Figure Description

[0016] The accompanying drawings, which are included to provide a further understanding of this specification and form part of this specification, illustrate exemplary embodiments and are used to explain this specification, but do not constitute an undue limitation thereof. In the drawings: Figure 1 A schematic diagram of a login status keep-alive system provided in the embodiments of this specification; Figure 2 This is a schematic diagram of the login status protection method provided in the embodiments of this specification; Figure 3 A schematic diagram of the first login status keep-alive device provided in the embodiments of this specification; Figure 4 This is a schematic diagram of a second login status keep-alive device provided in the embodiments of this specification; Figure 5 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this specification. Detailed Implementation

[0017] To make the objectives, technical solutions, and advantages of this specification clearer, the technical solutions of this specification will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, and not all of them. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this specification.

[0018] The technical solutions provided in the various embodiments of this specification are described in detail below with reference to the accompanying drawings.

[0019] Figure 1 This is a schematic diagram of a login status keep-alive system provided in an embodiment of this specification. The system specifically includes: a client and a server. Wherein: The server-side, located in the backend, is used to provide users with large-scale web applications. When this server-side is used by an e-commerce platform to provide merchants with large-scale web applications for managing their own retail businesses, the users mentioned in the embodiments of this specification can specifically be merchant users. The web application may include multiple sub-applications. The login status keep-alive method described in the embodiments of this specification can be applied to keep the target account used by the user alive when the user logs into the server and uses the functions of the customer service application.

[0020] The client, located at the front end, is the client used by users to log in to the aforementioned server.

[0021] For ease of explanation, the following description uses only the example of a user acting as a merchant, logging into the server and using the corresponding functions of the customer service application. Those skilled in the art should understand that the application scenarios of the login status keeping-alive method provided in the embodiments of this specification are not limited to this. The method provided in the embodiments of this specification can be used to keep the account alive in any scenario where an account is logged in.

[0022] In the embodiments described in this specification, users (i.e., merchants) can log in to the server through a client and use the customer service provided by the server. Through this customer service, the server can receive messages sent to users by consumers or potential consumers, and then forward the messages to the target account used by the user to log in to the server. Specifically, when the client logs in to the server for the first time using the target account, it can establish a long connection with the server and create a session corresponding to the target account based on this long connection. At the network and transport layer, after receiving the message, the server can determine the session corresponding to the message and send the message to the client based on the long connection on which the session was created. At the application layer, if the user has already logged in to the server using the target account through the client, i.e., the current state of the target account is logged in, the client can display the message; if the user has not logged in to the server using the target account, i.e., the current state of the target account is logged out, the client will not display the message.

[0023] Therefore, to ensure the quality of customer service, it is necessary to keep the target accounts of the aforementioned users logged in for extended periods, i.e., to maintain their activity, so that consumers' messages can be seen and responded to promptly. Based on the above... Figure 1 The system shown in this specification provides the following methods for keeping the login state active, such as... Figure 2 As shown.

[0024] Figure 2 This is a schematic flowchart of the login status protection method provided in the embodiments of this specification, which specifically includes the following steps: S200: When the client triggers the detection of the login status of the target account, it sends the login token corresponding to the target account to the server.

[0025] In customer service scenarios, there are three situations where it is necessary to keep the login status of the target account logged into the server to ensure that the messages of consumers and users can be seen by each other in a timely manner: 1. Consumers send messages to users; II. Users send messages to consumers; Third, neither the consumer nor the user sent a message to the other.

[0026] Therefore, the scenarios that trigger the detection of the login status of the target account in the embodiments of this specification also include the following three corresponding scenarios: 1. When the client receives a message from the server corresponding to the target account based on a long connection pre-established with the server, the client is triggered to check the login status of the target account.

[0027] This is because after the client logs into the server using the target account and establishes a persistent connection with the server, the target account may log out due to various mechanisms of the large web application, such as login timeout, triggering certain security mechanisms, or prolonged inactivity. The persistent connection is a physical transmission channel at the network or transport layer. Whether the target account is logged in or not is a matter of the target account's login status at the application layer. Therefore, logging out of the target account does not mean that the persistent connection between the client and the server is broken. Although the target account is logged out, as long as the consumer sends the aforementioned pending message to the target account through the server, the pending message will still hit the corresponding persistent connection at the server. At the network or transport layer, the server does not pay attention to the target account's login status at this time; as long as a pending message hits the persistent connection, it will send the pending message to the client through that persistent connection. Therefore, at the network or transport level, even if the target account is currently logged out, the client can still receive the message to be received based on the aforementioned long connection. However, at the application level, if the target account is logged out at this time, the client will not display the message to be received. Therefore, once the client receives the message to be received corresponding to the target account sent by the server based on the aforementioned long connection, it will trigger the detection of the login status of the target account.

[0028] Of course, in practical applications, in order to prevent the detection of the login status of the target account from being too frequent, when the client receives the message to be received corresponding to the target account from the server based on the above-mentioned long connection, it can first determine the time elapsed since the last time the detection of the login status of the target account was triggered, and determine whether the time elapsed is not less than the set time elapsed threshold. If it is not less than the set time elapsed threshold, the detection of the login status of the target account is triggered; otherwise, the detection of the login status of the target account is not performed for the time being.

[0029] 2. When the client receives a request to send a message based on the target account, it can trigger a check on the login status of the target account.

[0030] When a user wants to send a message to a consumer, they first input the message to be sent into the client, and then trigger the entity or virtual control on the client to send the message to the consumer, which then inputs a send request to the client. Once the client receives the send request, since the client itself cannot know the login status of the target account at this time, the client will not directly send the message to the server mentioned above, but will instead send the login token corresponding to the target account (the login token will be explained later) to the interceptor located in the background. Figure 1 (The system shown does not have an interceptor), which triggers the interceptor to check the login status of the target account.

[0031] 3. If the client neither receives the message to be received corresponding to the target account based on the long connection with the server, nor receives the user's request to send the message to be sent, the client can trigger a check on the login status of the target account at the end of each preset period after the target account logs in. For example, after the target account logs in, the client can trigger a check on the login status of the target account every 5 minutes.

[0032] The messages to be received and the messages to be sent mentioned above can be of various forms, including but not limited to text, images, videos, voice, emoticons, or kaomojis. This specification does not impose any restrictions on these. Those skilled in the art should understand that any form of message to be received and message to be sent can be applied to the login status keep-alive method provided in this specification.

[0033] Furthermore, for a target account, the login token corresponding to that target account is generated by the server when the client successfully logs in to the server using that target account. For example, when the server receives a login request for the target account from the client, and verifies the target account and the corresponding verification information carried in the login request, it generates a login token for that target account. The server can also set the validity period of the login token and return it to the client. In the embodiments of this specification, the login token is a token used by the server to manage the login status of the target account. If the current state of the login token is valid, the target account is currently logged in; if the current state of the login token is invalid, the target account is currently logged out. The server can change the current state of the login token corresponding to the target account according to the preset mechanisms (such as login timeout) in the large-scale web application it hosts, thereby changing the login status of the target account.

[0034] Therefore, in the first and third scenarios described above, when the client triggers the detection of the login status of the target account, it can send the login token corresponding to the target account to the server, so that the server can detect the login status of the target account based on the login token in the subsequent step S201.

[0035] The login token of the target account is also used by the client to send a message to the consumer using the target account. In the second scenario described above, when the client receives a request to send a message based on the target account, it can send the login token corresponding to the target account and the message to be sent in the sending request to the interceptor. The interceptor then sends the login token in the sending request to the server, so that the server can check the login status of the target account based on the login token in the subsequent step S201. If the login status of the target account is "logged in", the server can return a notification message that the login status is valid to the interceptor, so that the interceptor can send the message to the server, and the server can then send the message to the consumer.

[0036] S201: The server receives the login token and queries the current status of the login token. If the current status of the login token is invalid, it returns a notification message to the client that the login status of the target account has failed.

[0037] In the first and third scenarios described above, after receiving the login token corresponding to the target account, the server can query the current status of the login token. If the current status of the login token is valid, it can return a notification message to the client indicating that the login status of the target account is valid (i.e., the login status of the target account is logged in). In this case, there is no need to continue to execute subsequent steps to keep the login status of the target account active. If the current status of the login token is invalid, it can return a notification message to the client indicating that the login status of the target account is invalid (i.e., the login status of the target account is logged out).

[0038] Similarly, in the second scenario described above, after the server receives the login token corresponding to the target account, it can query the current status of the login token. If the current status of the login token is valid, it can return a notification message to the interceptor that the login status of the target account is valid. In this case, there is no need to continue to execute subsequent steps to keep the login status of the target account alive. If the current status of the login token is invalid, it can return a notification message to the interceptor that the login status of the target account is invalid.

[0039] S202: In response to the notification message, the client sends a pre-saved refresh token corresponding to the target account to the server.

[0040] In the first and third scenarios described above, the client, in response to a notification message indicating that the login status of the target account has expired, may send a refresh token corresponding to the target account to the server.

[0041] The refresh token is a one-time token with a longer validity period than the login token corresponding to the target account. It is used to refresh the login token for the target account. Specifically, when the server receives a login request for the target account from the client and verifies the target account and its corresponding verification information carried in the login request, it can simultaneously generate a login token and a refresh token for the target account, set the validity period of the login token to be longer than that of the login token, and then return the login token and refresh token for the target account to the client for storage.

[0042] In the second scenario described above, the interceptor, in response to the notification message from the server that the login status of the target account has expired, can forward the notification message to the client. The client, in response to the notification message from the interceptor that the login status of the target account has expired, sends a refresh token corresponding to the target account to the server.

[0043] S203: The server responds to the refresh token by regenerating the login token and refresh token corresponding to the target account.

[0044] S204: Set the current state of the regenerated login token to valid, and return the regenerated login token and refresh token to the client.

[0045] Regardless of which of the first to third scenarios mentioned above, once the server receives the refresh token corresponding to the target account sent by the client, it can verify the refresh token. That is, it verifies whether the refresh token corresponding to the target account sent by the client is consistent with the refresh token corresponding to the target account generated by the server itself, and whether the current state of the refresh token is valid.

[0046] If the refresh token sent by the client for the target account matches the refresh token generated by the server itself for the same target account, and the current state is valid, then a new login token for the target account can be generated, and its validity period can be reset to refresh the login token for the target account. This will make the current state of the regenerated login token valid, thus ensuring the login status of the target account is valid. Simultaneously, the current state of the refresh token sent by the client needs to be changed to invalid, and a new refresh token for the target account needs to be generated, with its validity period reset (still longer than the validity period of the new login token). This will make the current state of the new refresh token valid. Both the new login token and the refresh token are then returned to the client, allowing the client to send messages using the new login token and to maintain the login status of the target account in subsequent processes.

[0047] After receiving the newly generated login token from the server, the client can use the newly generated login token to replace the pre-saved login token corresponding to the target account. After receiving the newly generated refresh token from the server, the client can use the newly generated refresh token to replace the pre-saved refresh token corresponding to the target account.

[0048] If the refresh token sent by the client for the target account is inconsistent with the refresh token generated by the server for the same target account, or if the current state of the refresh token is invalid, the server will refuse to regenerate the login token and refresh token for the target account.

[0049] Furthermore, since the invalid login status of the target account may be due to the triggering of a serious security mechanism, such as a user performing a violation using the target account, to prevent users from using the aforementioned login status keep-alive method to restore the target account's login status, the server can determine the reason for the invalidity of the login token sent by the client or interceptor before regenerating the login token and refresh token corresponding to the target account. If the invalidity reason triggers a specified security mechanism, the regeneration of the login token and refresh token corresponding to the target account will be refused. If the invalidity reason does not trigger the aforementioned specified security mechanism, the login token and refresh token corresponding to the target account can be regenerated. The aforementioned specified security mechanism can be configured as needed, and this specification does not impose any restrictions on it.

[0050] Using the above methods, after the client logs into the server with the target account, it can refresh the login token using the refresh token in the above three scenarios to keep the login status of the target account active. These three scenarios can completely cover all situations in customer service scenarios where the target account is used to interact with consumers, thereby effectively improving the quality of customer service.

[0051] The above describes a login status keep-alive system and method provided in the embodiments of this specification. Based on the same idea, this specification also provides corresponding devices, storage media and electronic devices.

[0052] Figure 3 This is a schematic diagram of a first login status keep-alive device provided in the embodiments of this specification. This first payment device can be applied to a client, and the device includes: The detection module 300 is used to send the login token corresponding to the target account to the server when the login status of the target account is triggered. The token refresh module 301 is used to send a pre-saved refresh token corresponding to the target account to the server when it receives a notification message from the server that the login status of the target account has expired. The server responds to the refresh token, regenerates the login token and refresh token corresponding to the target account, and sets the current status of the regenerated login token to be valid. The notification message that the login status of the target account has expired is returned by the server when it finds that the current status of the login token is invalid. The receiving module 302 is used to receive the login token and refresh token regenerated by the server.

[0053] Optionally, the device has pre-established a long connection with the server; The detection module 300 is specifically used to determine, when it receives a message to be received corresponding to the target account sent by the server based on the long connection, to trigger the detection of the login status of the target account.

[0054] Optionally, the detection module 300 is further configured to, before determining whether to trigger the detection of the login status of the target account, determine that the time elapsed since the last time the detection of the login status of the target account was triggered is not less than a set time threshold.

[0055] Optionally, the detection module 300 is specifically used to determine, at the end of each preset period after the target account logs in, the login status of the target account that triggers the detection.

[0056] Optionally, the token refresh module 301 is further configured to, upon receiving a sending request for a message to be sent by a user based on the target account, send the login token corresponding to the target account in the sending request to the interceptor, so that the interceptor sends the login token in the sending request to the server, so that the server can query the current status of the login token sent by the interceptor. If the current status of the login token is invalid, the server returns a notification message that the login status of the target account is invalid to the interceptor; receive the notification message that the login status of the target account is invalid sent by the interceptor; and, in response to the notification message that the login status of the target account is invalid sent by the interceptor, send a pre-saved refresh token corresponding to the target account to the server.

[0057] Optionally, the receiving module 302 is further configured to replace the login token corresponding to the target account with the login token regenerated by the server, and replace the refresh token corresponding to the target account with the refresh token regenerated by the server.

[0058] Figure 4 This is a schematic diagram of a second login status keep-alive device provided in the embodiments of this specification. This second payment device can be applied to the server side, and the device includes: The receiving module 400 is used to receive the login token of the target account; The status query module 401 is used to query the current status of the login token; The notification module 402 is used to return a notification message that the login status of the target account has failed if the current status of the login token is invalid. The generation module 403 is used to regenerate the login token and refresh token corresponding to the target account in response to the refresh token sent by the client. The sending module 404 is used to set the current state of the regenerated login token to valid and return the regenerated login token and refresh token to the client.

[0059] Optionally, the receiving module 400 is specifically used to receive the login token corresponding to the target account sent by the client when the login status of the target account is triggered; The notification module 402 is specifically used to return a notification message to the client indicating that the login status of the target account has expired.

[0060] Optionally, the receiving module 400 is specifically used to receive the login token corresponding to the target account sent by the interceptor; the login token is sent by the client to the interceptor in the sending request when it receives the sending request of the message to be sent by the user based on the target account. The notification module 402 is specifically used to return a notification message that the login status of the target account has failed to the interceptor, so that the interceptor sends the notification message that the login status of the target account has failed to the client.

[0061] Optionally, the generation module 403 is specifically used to verify the current status of the refresh token corresponding to the target account sent by the client; if the current status of the refresh token corresponding to the target account sent by the client is valid, then regenerate the login token and refresh token corresponding to the target account.

[0062] Optionally, the generation module 403 is specifically used to determine the invalid reason of the received login token corresponding to the target account; if the invalid reason is not to trigger a specified security mechanism, then regenerate the login token and refresh token corresponding to the target account.

[0063] This specification also provides a computer-readable storage medium storing a computer program that, when executed by a processor, can be used to perform the login state keep-alive method described above.

[0064] This specification also provides a computer program product that, when executed by a processor, can be used to perform the login state keep-alive method provided above.

[0065] based on Figure 2 The login status keep-alive method shown in this specification is further provided in the embodiments. Figure 5 The diagram shows the structure of the electronic device. Figure 5 At the hardware level, the electronic device includes a processor, internal bus, network interface, memory, and non-volatile storage, and may also include other hardware required for the business. The processor reads the corresponding computer program from the non-volatile storage into memory and then runs it to implement the above-mentioned login state persistence method.

[0066] The above description is merely an embodiment of this specification and is not intended to limit this specification. Various modifications and variations can be made to this specification by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of the claims of this specification.

Claims

1. A login status keep-alive system, the system comprising: Client and server; among which: The client is used to send a login token corresponding to the target account to the server when the login status of the target account is detected. The server is used to receive the login token and query the current status of the login token. If the current status of the login token is invalid, it returns a notification message to the client that the login status of the target account has failed. In response to the notification message, the client sends a pre-saved refresh token corresponding to the target account to the server. In response to the refresh token, the server regenerates the login token and refresh token corresponding to the target account, sets the current status of the regenerated login token to valid, and returns the regenerated login token and refresh token to the client.

2. The system of claim 1, further comprising: Interceptors; The client is also configured to, when receiving a sending request for a message to be sent by a user based on the target account, send the login token corresponding to the target account to the interceptor in the sending request; The interceptor is specifically used to send the login token in the sending request to the server; The server is also used to query the current status of the login token sent by the interceptor. If the current status of the login token is invalid, the server returns a notification message to the interceptor that the login status of the target account has failed. The interceptor is also used to send a notification message that the login status of the target account has expired to the client, so that the client responds to the notification message by sending the refresh token to the server, so that the server can regenerate the login token and refresh token corresponding to the target account.

3. A method for keeping a login status active, the method comprising: When the client triggers the detection of the login status of the target account, it sends the login token corresponding to the target account to the server. When the server receives a notification message indicating that the login status of the target account has expired, the server sends a pre-saved refresh token corresponding to the target account to the server. The server then responds to the refresh token by regenerating the login token and refresh token corresponding to the target account and sets the current status of the regenerated login token to valid. The notification message indicating that the login status of the target account has expired is returned to the client by the server when it finds that the current status of the login token is invalid. Receive the login token and refresh token regenerated by the server.

4. The method as described in claim 3, wherein the client and the server have pre-established a long connection; Triggering detection of the target account's login status, specifically including: When the client receives a pending message for the target account from the server via the long connection, it determines to trigger a check of the login status of the target account.

5. The method of claim 4, before determining whether to trigger the detection of the login status of the target account, the method further includes: The time elapsed since the last time the target account's login status was detected is determined to be no less than a set time threshold.

6. The method as described in claim 3, triggering the detection of the login status of the target account, specifically includes: At the end of each preset period after the target account logs in, the client determines to trigger a check on the login status of the target account.

7. The method of claim 3, further comprising: When the client receives a sending request for a message to be sent based on the target account input by the user, it sends the login token corresponding to the target account to the interceptor in the sending request. The interceptor then sends the login token in the sending request to the server so that the server can query the current status of the login token sent by the interceptor. If the current status of the login token is invalid, the server returns a notification message to the interceptor that the login status of the target account has failed. Receive a notification message from the interceptor indicating that the login status of the target account has expired; In response to the notification message sent by the interceptor that the login status of the target account has expired, a refresh token corresponding to the pre-saved target account is sent to the server.

8. The method according to any one of claims 3 to 7, wherein the method further comprises: The client replaces the login token corresponding to the target account with the login token regenerated by the server, and replaces the refresh token corresponding to the target account with the refresh token regenerated by the server.

9. A method for keeping a login status active, the method comprising: The server receives the login token for the target account; Query the current status of the login token; If the current status of the login token is invalid, return a notification message that the login status of the target account has failed; In response to the refresh token corresponding to the target account sent by the client, a new login token and refresh token corresponding to the target account are generated; Set the current status of the regenerated login token to valid, and return the regenerated login token and refresh token to the client.

10. The method as described in claim 9, wherein the server receives the login token of the target account, specifically including: The server receives the login token corresponding to the target account sent by the client when the login status of the target account is detected. The system returns a notification message indicating that the login status of the target account has expired, specifically including: Return a notification message to the client indicating that the login status of the target account has expired.

11. The method as described in claim 9, wherein the server receives the login token of the target account, specifically including: The server receives the login token corresponding to the target account sent by the interceptor; The login token is sent by the client to the interceptor when it receives a send request for a message to be sent based on the target account input by the user. The system returns a notification message indicating that the login status of the target account has expired, specifically including: The interceptor returns a notification message indicating that the login status of the target account has expired, causing the interceptor to send the notification message to the client.

12. The method as described in claim 9, wherein regenerating the login token and refresh token corresponding to the target account specifically includes: Verify the current status of the refresh token corresponding to the target account sent by the client; If the refresh token corresponding to the target account sent by the client is currently valid, then the login token and refresh token corresponding to the target account are regenerated.

13. The method as described in claim 9, regenerating the login token and refresh token corresponding to the target account, specifically includes: Determine the reason why the login token corresponding to the target account is invalid; If the invalidation reason is not to trigger the specified security mechanism, then the login token and refresh token corresponding to the target account will be regenerated.

14. A login status keep-alive device, the device comprising: The detection module is used to send the login token corresponding to the target account to the server when the login status of the target account is triggered. The token refresh module is used to send a pre-saved refresh token corresponding to the target account to the server when it receives a notification message from the server that the login status of the target account has expired. The server responds to the refresh token by regenerating the login token and refresh token corresponding to the target account and setting the current status of the regenerated login token to be valid. The notification message that the login status of the target account has expired is returned by the server when it finds that the current status of the login token is invalid. The receiving module is used to receive the login token and refresh token regenerated by the server.

15. A login status keep-alive device, the device comprising: The receiving module is used to receive the login token of the target account; The status query module is used to query the current status of the login token; The notification module is used to return a notification message indicating that the login status of the target account has failed if the current status of the login token is invalid. The generation module is used to regenerate the login token and refresh token corresponding to the target account in response to the refresh token sent by the client. The sending module is used to set the current state of the regenerated login token to valid and return the regenerated login token and refresh token to the client.

16. A computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in any one of claims 3-13.

17. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the method described in any one of claims 3-13.

18. A computer program product, which, when executed by a processor, can be used to perform the method described in any one of claims 3-13.