Data processing method and device, electronic equipment and storage medium

By setting multiple expiration times in the token, the token can be updated to reduce the risk of being hacked and to reduce frequent logins, thus solving the user experience and security problems caused by improper token expiration time settings.

CN119995905BActive Publication Date: 2026-03-27MASHANG CONSUMER FINANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-10
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

In existing technologies, setting the expiration time of tokens too short leads to frequent logins by users, affecting user experience; while setting the expiration time too long results in insufficient data security.

Method used

By setting a first deadline and a subsequent second deadline, authentication tokens are generated and updated, ensuring that each version of the token carries a different deadline. This reduces the probability of the token being cracked and prevents re-login before the second deadline.

Benefits of technology

This effectively improves data security while reducing the frequency of users logging in again, thus enhancing the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119995905B_ABST
    Figure CN119995905B_ABST
Patent Text Reader

Abstract

The method comprises: receiving an operation request sent by a client, the operation request carrying an authentication token of a first version, the authentication token of the first version comprising a first deadline and a second deadline located after the first deadline; determining a processing mode of the authentication token according to the first deadline, the first deadline and the second deadline; in a case where the processing mode of the authentication token is a first processing mode, performing update processing on the first deadline, and generating an authentication token of a second version according to the first deadline after the update processing; and sending first response data of the operation request to the client, the first response data carrying the authentication token of the second version. In this way, the data security and the frequency of re-login can be considered.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing, and particularly relates to a data processing method and device, electronic equipment and storage medium. BACKGROUND

[0002] Token technology can be used in an identity verification scenario. In actual application, after a user successfully logs in a system, a server of the system allocates a token for the user, the token carries an expiration time, and each request sent by the user carries the token, which is used for server authentication.

[0003] In order to reduce the risk of token cracking, the time interval between the expiration time and the time when the user successfully logs in the system is usually short, so that the user may need to frequently log in the system. SUMMARY

[0004] Embodiments of the present application provide a data processing method and device, electronic equipment and storage medium, so as to ensure data security and reduce the frequency of re-login.

[0005] In a first aspect, embodiments of the present application provide a data processing method applied to a server, comprising:

[0006] receiving an operation request sent by a client, the operation request carrying a first version of an authentication token, the first version of the authentication token comprising a first deadline and a second deadline located after the first deadline;

[0007] determining a processing mode of the authentication token according to the first time point, the first deadline and the second deadline;

[0008] in a case where the processing mode of the authentication token is a first processing mode, performing update processing on the first deadline, and generating a second version of the authentication token according to the updated first deadline;

[0009] sending first response data of the operation request to the client, the first response data carrying the second version of the authentication token.

[0010] In a second aspect, embodiments of the present application provide a data processing method applied to a client, comprising:

[0011] sending an operation request to a server, the operation request carrying a first version of an authentication token, the first version of the authentication token comprising a first deadline and a second deadline located after the first deadline;

[0012] receive the first response data returned by the server, the first response data carrying the second version of the authentication token; the second version of the authentication token is generated according to the first expiration time point after the update processing in the case that the processing mode of the authentication token is the first processing mode; and the processing mode of the authentication token is determined by the first time point, the first expiration time point and the second expiration time point.

[0013] In a third aspect, an embodiment of the present application provides a data processing apparatus applied to a server, the apparatus comprising:

[0014] a first receiving unit configured to receive an operation request sent by a client, the operation request carrying a first version of an authentication token, the first version of the authentication token comprising a first expiration time point and a second expiration time point after the first expiration time point;

[0015] a determining unit configured to determine a processing mode of the authentication token according to the first time point, the first expiration time point and the second expiration time point;

[0016] a generating unit configured to, in the case that the processing mode of the authentication token is a first processing mode, update the first expiration time point, and generate a second version of the authentication token according to the first expiration time point after the update processing;

[0017] a first sending unit configured to send first response data of the operation request to the client, the first response data carrying the second version of the authentication token.

[0018] In a fourth aspect, an embodiment of the present application provides a data processing apparatus applied to a client, the apparatus comprising:

[0019] a second sending unit configured to send an operation request to a server, the operation request carrying a first version of an authentication token, the first version of the authentication token comprising a first expiration time point and a second expiration time point after the first expiration time point;

[0020] a second receiving unit configured to receive first response data returned by the server, the first response data carrying the second version of the authentication token; the second version of the authentication token is generated according to the first expiration time point after the update processing in the case that the processing mode of the authentication token is the first processing mode; and the processing mode of the authentication token is determined by the first time point, the first expiration time point and the second expiration time point.

[0021] In a fifth aspect, an electronic device is provided, including: a processor; and a memory configured to store computer-executable instructions that, when executed, cause the processor to perform the data processing method according to the first aspect or the second aspect.

[0022] In a sixth aspect, a computer-readable storage medium is provided, configured to store computer-executable instructions that, when executed by a processor, implement the data processing method according to the first aspect or the second aspect.

[0023] It can be seen that, in the embodiments of the present application, by setting the first expiration time point and the second expiration time point located after the first expiration time point, and the first version of the authentication token carrying the first expiration time point, the newly generated second version of the authentication token carrying the updated first expiration time point, the server can update the authentication token multiple times before the second expiration time point arrives, and each version of the authentication token carries a different expiration time point, reducing the probability of each version of the authentication token being cracked, ensuring data security, and without triggering re-login before the second expiration time point arrives, reducing the frequency of repeated login. BRIEF DESCRIPTION OF DRAWINGS

[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the embodiments or prior art description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments described in the specification, and those skilled in the art can also obtain other drawings according to these drawings without creative labor;

[0025] Figure 1 A schematic diagram of an implementation environment of a data processing method provided by the embodiments of the present application;

[0026] Figure 2 A processing flowchart of a data processing method provided by the embodiments of the present application;

[0027] Figure 3 A processing flowchart of a second data processing method provided by the embodiments of the present application;

[0028] Figure 4 A processing flowchart of a third data processing method provided by the embodiments of the present application;

[0029] Figure 5 A processing flowchart of a fourth data processing method provided by the embodiments of the present application;

[0030] Figure 6 A schematic diagram of a data processing device provided by the embodiments of the present application;

[0031] Figure 7 Another data processing device provided by the embodiment of the present application is shown in the schematic diagram.

[0032] Figure 8 The structure of an electronic device provided by the embodiment of the present application is shown in the schematic diagram. DETAILED DESCRIPTION

[0033] In order to make the person skilled in the art better understand the technical solutions in the embodiments of the present application, the technical solutions in the embodiments of the present application will be described clearly and completely in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present specification, not all the embodiments. Based on the embodiments of the present application, all other embodiments obtained by the person skilled in the art without creative labor should be within the protection scope of the present application.

[0034] The data processing method provided by one or more embodiments of the present specification can be applied to the implementation environment of the data processing method, such as Figure 1 As shown in the figure, the implementation environment at least includes a server 101 for processing data, and a terminal device 102 for sending an operation request and receiving first response data.

[0035] The server 101 can be a server, or a server cluster composed of several servers, or one or more cloud servers in a cloud computing platform, for processing data.

[0036] The terminal device 102 can be a mobile phone, a personal computer, a tablet computer, an electronic book reader, a device for information interaction based on VR (Virtual Reality, virtual reality technology), a vehicle-mounted terminal, an IoT device, a wearable smart device, a laptop computer and a desktop computer, etc. The terminal device 102 can be configured with a client of an application program, and the specific form of the client can be an application program, a subprogram in the application program, a service module in the application program or a web program. The client can send an operation request and receive first response data.

[0037] In the implementation environment, in the process of processing data, the server 101 first receives an operation request sent by the terminal device 102, the operation request carrying a first version of an authentication token, the first version of the authentication token including a first expiration time point and a second expiration time point located after the first expiration time point; then, according to the first time point, the first expiration time point, and the second expiration time point, a processing mode of the authentication token is determined; then, in the case where the processing mode of the authentication token is a first processing mode, the first expiration time point is updated, and a second version of the authentication token is generated according to the updated first expiration time point; and finally, a first response data of the operation request is sent to the terminal device 102, and the first response data carries the second version of the authentication token. In this way, by setting the first expiration time point and the second expiration time point located after the first expiration time point, and by carrying the first expiration time point in the first version of the authentication token and carrying the updated first expiration time point in the newly generated second version of the authentication token, the server can update the authentication token multiple times before the second expiration time point arrives, the authentication token of each version carries a different expiration time point, the probability of cracking the authentication token of each version is reduced, the data security is ensured, and re-login is not triggered before the second expiration time point arrives, and the frequency of repeated login is reduced.

[0038] An embodiment of the data processing method provided in the specification is as follows:

[0039] In actual application, after a user successfully logs in a system, a service end of the system allocates a token for the user, the token carrying an expiration time generated by a backend when the token is allocated, and the expiration time being determined by a time point at which the user successfully logs in the system and a token validity duration configured in advance. The service end responds to a request in a case where it is detected that the token is carried in the request and it is determined that the token is not invalid. After the token is invalid, the user needs to log in the system again.

[0040] When the token validity duration is configured, if the token validity duration is greater than a preset time length threshold, the token validity duration can be regarded as being relatively long, and in this case, the data security of the token is relatively low; if the token validity duration is less than or equal to the preset time length threshold, the token validity duration can be regarded as being relatively short, and in this case, the user may need to frequently log in the system, and the experience is poor. In order to solve the above problems, an embodiment of the present application provides a data processing method.

[0041] Figure 2 A processing flowchart of the data processing method provided in the embodiment of the present application is shown in FIG. 2. Figure 2 The data processing method provided in the embodiment is applied to a service end, and specifically includes steps S202 to S208.

[0042] In step S202, an operation request sent by the client is received, the operation request carrying a first version of an authentication token, the first version of the authentication token including a first expiration time point and a second expiration time point located after the first expiration time point.

[0043] The operation request sent by the client can be a request sent by the client to the server triggered by any operation issued by the user after successfully logging into the system.

[0044] For example, a data query request, a form submission request, a page refresh request, and the like.

[0045] The first version of the authentication token can be the first token allocated to the user by the server when the user successfully logs into the system, or the Nth token allocated to the user after the user successfully logs in, where N can be a natural number greater than 1.

[0046] In the case where the first version of the authentication token is the first token allocated to the user by the server when the user successfully logs into the system, before step S202 is executed, the data processing method can further include the following step: sending the first version of the authentication token to the client upon determining successful login.

[0047] After the server sends the first version of the authentication token to the client, the client can store the first version of the authentication token, and any operation request sent by the client carries the first version of the authentication token.

[0048] The first version of the authentication token can be a token generated by the server based on the jwt (JSON Web Token, JS Object Notation Network Token) specification.

[0049] In actual application, the first version of the authentication token can be a string.

[0050] jwt is an open standard for securely transmitting information between network applications. It adopts a compact, self-contained way to represent information, usually for identity verification and authorization. The design goal of jwt is to ensure the integrity and security of information, while having the characteristics of easy use and transmission.

[0051] The first expiration time point can represent a version expiration time, which is used to trigger the server to update the token version.

[0052] The second expiration time point can represent a jwt expiration time, which is used to trigger the server to notify the client that the token is invalid.

[0053] Exemplarily, the first deadline time point can be denoted by overdueTime, and the second deadline time point can be denoted by expireDate.

[0054] overdueTime represents version expiration. In the case of exceeding this time, the information carried by the first version of the authentication token can still be parsed by the jwt specification. expireDate is a field built in the jwt specification, which represents the jwt expiration time. Once this time is exceeded, the information carried by the first version of the authentication token cannot be completely parsed.

[0055] The first deadline time point can be determined by the time point of successfully logging into the system and the preconfigured version validity duration.

[0056] In the case that the first version of the authentication token is the first token allocated to the user by the server when the user successfully logs into the system, the first deadline time point can be determined by taking the time point of successfully logging into the system as the starting time, and determining the first deadline time point based on the starting time and the version validity duration.

[0057] The second deadline time point can be determined by the time point of successfully logging into the system and the preconfigured jwt validity duration.

[0058] Specifically, the second deadline time point is determined by taking the time point of successfully logging into the system as the starting time, and determining the second deadline time point based on the starting time and the jwt validity duration.

[0059] The jwt validity duration can be much greater than the version validity duration, and specifically, the difference between the jwt validity duration and the version validity duration can be greater than a preset time threshold.

[0060] For example, the version validity duration is 10 minutes, and the jwt validity duration is 24 hours.

[0061] The first deadline time point is located before the second deadline time point.

[0062] It should be noted that the arrangement numbers "first", "second", etc. appearing in the present specification can be used to distinguish two similar features, and do not have actual meanings, which will not be described below.

[0063] In a specific implementation, the data processing method further includes: receiving a token invalidation instruction; the token invalidation instruction carries a first user identifier; according to the first user identifier, querying in the stored correspondence between the user identifier and the version identifier to obtain the latest version identifier of the first user identifier; and replacing the latest version identifier by a preset invalid identifier.

[0064] The service end can store a correspondence between the user identifier and the version identifier, and based on the correspondence, the latest version identifier of the authentication token of each successfully logged-in user can be determined.

[0065] The token invalidation instruction carries the first user identifier, which can be the user identifier of a successfully logged-in user of the system.

[0066] Each user identifier can represent a unique corresponding user in the system.

[0067] According to the first user identifier, a query is performed in the stored correspondence between the user identifier and the version identifier to obtain the version identifier corresponding to the first user identifier, and the version identifier is determined as the latest version identifier of the first user identifier.

[0068] The preset invalidation identifier can represent that the token corresponding to the first user identifier is invalid.

[0069] After the preset invalidation identifier is replaced with the latest version identifier, in the stored correspondence between the user identifier and the version identifier, the first user identifier corresponds to the preset invalidation identifier.

[0070] In a specific implementation, the authentication token of the first version further includes a second user identifier and a first version identifier; after receiving the operation request sent by the client, the data processing method further includes: according to the second user identifier, performing a query in the stored correspondence between the user identifier and the version identifier to obtain the latest version identifier of the second user identifier; and if the first version identifier is inconsistent with the latest version identifier of the second user identifier, sending third response data of the operation request to the client, the third response data carrying a token invalidation identifier.

[0071] Exemplarily, the first version identifier can be represented by a version field.

[0072] According to the second user identifier, a query is performed in the stored correspondence between the user identifier and the version identifier to obtain the version identifier corresponding to the second user identifier, and the version identifier is determined as the latest user identifier of the second user identifier.

[0073] The correspondence between the user identifier and the version identifier can be stored in a database of the service end or in other specified storage areas.

[0074] It is determined whether the latest version identifier of the second user identifier is consistent with the second version identifier: if the latest version identifier of the second user identifier is consistent with the second version identifier, step S204 is continued to be executed; and if the latest version identifier of the second user identifier is inconsistent with the second version identifier, third response data of the operation request is sent to the client, the third response data carrying a token invalidation identifier.

[0075] The token expiration flag is used to notify the client that the token has expired. Upon receiving the token expiration flag, the client will be redirected to the login page so that the user can log in again.

[0076] By maintaining version identifiers stored in the database, the server can disregard the first and second deadlines, thus forcibly invalidating the token carried in the operation request sent by the client.

[0077] Specifically, after receiving each operation request from the client, the server needs to compare the version numbers first. Only if the version numbers match can the token be used for authentication. Thus, the server does not need to change the token stored by the client, nor does it need to modify the token carried in the operation request. It only needs to modify the version identifier stored locally to make the token stored by the client unusable.

[0078] In addition, after a user successfully logs into the system, the server can perform abnormal behavior detection based on the received instructions carrying the user's second user identifier, and obtain the detection results. If the detection results indicate that the user has engaged in abnormal behavior, the server can query the stored mapping between user identifiers and version identifiers based on the second user identifier to obtain the version identifier corresponding to the second user identifier, and determine this version identifier as the latest version identifier of the second user identifier; then, it replaces the latest version identifier with a preset invalidation identifier.

[0079] Subsequently, after the server receives the operation request sent by the client carrying the first version identifier and the second user identifier, the server can perform a query in the stored correspondence between user identifiers and version identifiers based on the second user identifier to obtain the latest version identifier of the second user identifier, i.e., the preset invalidation identifier; if the first version identifier and the preset invalidation identifier are inconsistent, the server sends the third response data of the operation request to the client, and the third response data carries the token invalidation identifier.

[0080] If the detection results indicate that the user has abnormal behavior, the server can also generate abnormal behavior alarm information; the abnormal behavior alarm information is used to alert the system's business side that the user who logged into the system has abnormal behavior.

[0081] Considering the possibility that users may unintentionally leak their passwords in practical applications, someone impersonating a user and successfully logging into the system using the legitimate user's password may engage in abnormal behavior that harms the legitimate user's interests. For example, User A might see User B's commonly used password, successfully log into User B's account using that password, and then intentionally delete user B's completed form data in bulk.

[0082] In this case, by replacing the identifier, the server can force the token of the user to be invalidated when detecting that the user has suspicious behavior, so as to trigger the user to log in again. Considering that in the case of password leakage, the original password login method is no longer secure, the server can also add a login method switching identifier to the third response data when the detection result indicates that the user has abnormal behavior, and send the third response data carrying the token invalidation identifier and the login method switching identifier to the client. The client can jump to the login page in the case of receiving the token invalidation identifier, so as to log in again. The client can switch the original password login method to a higher security login method, such as a face recognition login method, a fingerprint recognition login method, etc. in the case of receiving the login method switching identifier. By triggering the user to log in again after switching the login method, the security of the user's account can be improved.

[0083] In step S204, a processing manner of the authentication token is determined according to the first time point, the first deadline time point, and the second deadline time point.

[0084] The first time point can be a time point at which step S204 is performed, i.e., a current time point.

[0085] Determining the processing manner of the authentication token according to the first time point, the first deadline time point, and the second deadline time point can be determining a target time region in which the first time point is located in a plurality of preset time regions according to the first time point, the first deadline time point, and the second deadline time point; and determining a processing manner corresponding to the target time region as the processing manner of the authentication token.

[0086] Each preset time region in the plurality of preset time regions can be determined by the first deadline time point and the second deadline time point.

[0087] In a specific implementation, determining the processing manner of the authentication token according to the first time point, the first deadline time point, and the second deadline time point includes: if the first time point is the same as the first deadline time point, or the first time point is located after the first deadline time point and before the second deadline time point, determining the processing manner of the authentication token as a first processing manner; the first processing manner is used to update a version of the authentication token; if the first time point is located before the first deadline time point, determining the processing manner of the authentication token as a second processing manner; the second processing manner is used to keep the authentication token unchanged; if the first time point is the same as the second deadline time point, or the first time point is located after the second deadline time point, determining the processing manner of the authentication token as a third processing manner; the third processing manner is used to invalidate the authentication token.

[0088] Exemplarily, T can be used to represent the first time point, overdueTime can be used to represent the first deadline time point, and expireDate can be used to represent the second deadline time point.

[0089] In the case of T = overdueTime, it can be determined that the processing manner of the authentication token is the first processing manner. T = overdueTime means that T is the same as overdueTime.

[0090] In the case of overdueTime < T < expireDate, it can be determined that the processing manner of the authentication token is the first processing manner. overdueTime < T < expireDate means that T is located after overdueTime and before expireDate.

[0091] In the case of T < overdueTime, it can be determined that the processing manner of the authentication token is the second processing manner. T < overdueTime means that T is located before overdueTime.

[0092] In the case of T = expireDate, it can be determined that the processing manner of the authentication token is the third processing manner. T = expireDate means that T is the same as expireDate.

[0093] In the case of T > expireDate, it can be determined that the processing manner of the authentication token is the third processing manner. T > expireDate means that T is located after expireDate.

[0094] In the case that the first time point is the same as the first deadline time point, or the first time point is located after the first deadline time point and before the second deadline time point, it can be determined that the token is valid, and the current version of the token is expired and needs to be updated, and then it is determined that the processing manner of the authentication token is the first processing manner.

[0095] The first processing manner can be a processing manner of updating the current version of the authentication token.

[0096] In the case that the first time point is located before the first deadline time point, it can be determined that the token is valid, and the current version of the token is not expired and does not need to be updated, and then it is determined that the processing manner of the authentication token is the second processing manner.

[0097] The second processing manner can be a processing manner of not performing any operation on the current version of the authentication token.

[0098] The first time point is the same as the second deadline time point, or the first time point is after the second deadline time point, the token is determined to be invalid, and the processing manner of the authentication token is determined to be a third processing manner.

[0099] The third processing manner can be a preset processing manner when the token is invalid.

[0100] In a specific implementation, after determining the processing manner of the authentication token according to the first time point, the first deadline time point, and the second deadline time point, the data processing method further includes: in the case where the processing manner of the authentication token is the third processing manner, sending second response data of the operation request to the client, the second response data carrying a token invalidation identifier.

[0101] The token invalidation identifier is used to inform the client that the token is invalid. It should be noted that the token invalidation is not only the expiration of the first version of the authentication token, but also the token of the user corresponding to the first version of the authentication token is invalid. The client will jump to a login page to log in again when receiving the token invalidation identifier.

[0102] In addition, in the case where the token is invalid, the server fails to parse the first version of the authentication token, and the server can determine that the user who sends the operation request does not have the operation permission of the operation request. Therefore, the second response data can be response data rejecting the operation request.

[0103] In step S206, in the case where the processing manner of the authentication token is the first processing manner, the first deadline time point is updated, and a second version of the authentication token is generated according to the updated first deadline time point.

[0104] The first deadline time point can be updated by extending the starting time of the first deadline time point by a preset time length to obtain the updated first deadline time point.

[0105] For example, the first deadline time point is T1, the preset time length is T2, the updated first deadline time point is T1', and T1' = T1 + T2.

[0106] The second version of the authentication token can be generated by replacing the first deadline time point in the first version of the authentication token with the updated first deadline time point.

[0107] For example, the first version of the authentication token includes a first expiration time point T1 and a second expiration time point T2, and the second version of the authentication token includes an updated first expiration time point T1' and a second expiration time point T2.

[0108] In a specific implementation, the updating of the first expiration time point includes: determining a first time length according to the first time point and the first expiration time point; determining a number of extensions according to the first time length and a preset time length; and updating the first expiration time point according to the number of extensions and the preset time length.

[0109] The preset time length is a time length of each extension defined by the user, and the preset time length can be less than or equal to a time threshold defined by the user for the purpose of data security. For example, the time threshold is 15 minutes, and the preset time length is 10 minutes.

[0110] The first time length can be determined as the difference between the first time point and the first expiration time point.

[0111] The number of extensions can be determined by performing a division calculation according to the first time length and the preset time length to obtain a calculation result, and then determining the number of extensions based on the calculation result.

[0112] In the case where the calculation result is not an integer, the number of extensions can be determined by rounding up the calculation result.

[0113] For example, the first time length is 50 minutes, and the preset time length is 20 minutes. The number of extensions is determined to be 3 by performing a division calculation according to 50 minutes and 20 minutes to obtain a calculation result of 2.5, and then rounding up the calculation result.

[0114] The updating of the first expiration time point according to the number of extensions and the preset time length can include: determining an extension total time length based on the number of extensions and the preset time length, starting from the first expiration time point; and performing an extension process based on the starting time and the extension total time length to obtain an updated first expiration time point.

[0115] In actual application, the server can only discover that the first expiration time point has expired and needs to be updated when receiving an operation request sent by the client. Therefore, the first expiration time point needs to be extended to a time point after the first time point during the version update process. The number of extensions can be one or more, and the number of extensions can be determined by the first time point and the first expiration time point.

[0116] The first deadline point is updated according to the number of postponements and the preset time length, which can be determined according to the number of postponements and the preset time length. The updated first deadline point is compared with the second deadline point. If the updated first deadline point is before the second deadline point, the updated first deadline point is determined as the first deadline point. If the updated first deadline point is equal to the second deadline point, the first deadline point is determined according to the second deadline point. If the updated first deadline point is after the second deadline point, the first deadline point is determined according to the second deadline point.

[0117] The first deadline point is updated according to the number of postponements and the preset time length, which can be determined according to the number of postponements and the preset time length. The updated first deadline point is compared with the second deadline point. If the updated first deadline point is before the second deadline point, the updated first deadline point is determined as the first deadline point. If the updated first deadline point is equal to the second deadline point, the first deadline point is determined according to the second deadline point. If the updated first deadline point is after the second deadline point, the first deadline point is determined according to the second deadline point.

[0118] For example, the first deadline point is T1, the second deadline point is T2, the number of postponements is 3, and the preset time length is 10 minutes. The updated first deadline point T1' can be a time point 30 minutes after T1. If T1' < T2, T1' is determined as the updated first deadline point. If T1' = T2, a time point T2' representing a time point 1 minute before T2 is determined as the updated first deadline point. If T1' > T2, T2' is determined as the updated first deadline point.

[0119] In a specific implementation, the first version of the authentication token further includes a first version identifier. The second version of the authentication token is generated according to the updated first deadline point, including: updating the first version identifier to obtain a second version identifier; replacing the first version identifier in the first version of the authentication token with the second version identifier, and replacing the first deadline point in the first version of the authentication token with the updated first deadline point to obtain the second version of the authentication token.

[0120] The first version identifier is updated to obtain the second version identifier, which can be incremented by one to obtain the second version identifier.

[0121] For example, the first version identifier is 1, and the second version identifier is 2.

[0122] The first version of the authentication token can include a first version identifier, a first deadline point, and a second deadline point. The second version of the authentication token is obtained by replacing the first version identifier in the first version of the authentication token with the second version identifier, and replacing the first deadline point in the first version of the authentication token with the updated first deadline point. The second version of the authentication token can include a second version identifier, an updated first deadline point, and a second deadline point.

[0123] For example, the authentication token of the first version includes a first version identifier "1", a first expiration time point T1 and a second expiration time point T2, and the authentication token of the second version includes a second version identifier "2", an updated first expiration time point T1' and the second expiration time point T2.

[0124] In step S208, a first response data of the operation request is sent to the client, and the first response data carries the authentication token of the second version.

[0125] The first response data can be response data of receiving the operation request.

[0126] Before step S208 is executed, the first response data can be generated by the following method: generating initial response data representing receiving the operation request, and generating the first response data based on the initial response data and the authentication token of the second version.

[0127] Based on the initial response data and the authentication token of the second version, the first response data can be generated by adding an additional field to the parameter json structure of the initial response data based on the authentication token of the second version.

[0128] For example, the initial response data is as follows:

[0129]

[0130] The first response data is as follows:

[0131]

[0132]

[0133] Among them, "extra" represents an additional field, "accessToken" represents a token field, and "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMDAxMCIsIm92ZXJkdWVEYXRlIjoiMjAyMy0wNy0xOSAxNTo1MTowOSIsImlzcyI6InNha1VyYTIwMjAiLCJleHAiOjE2OTIyNTg2NjAsImlhdCI6MTY4OTU4NDY2MSwidmVyc2lvbiI6IjIifQ.vptYPW0Za3Adez1ez6DtF4OaouklV3Q7sJWtohMVefs" is the authentication token of the second version.

[0134] In the case of Figure 2In the illustrated embodiment, first, an operation request sent by a client is received, the operation request carrying a first version of an authentication token, the first version of the authentication token including a first expiration time point and a second expiration time point located after the first expiration time point; then, a processing manner of the authentication token is determined according to the first time point, the first expiration time point, and the second expiration time point; next, in a case where the processing manner of the authentication token is a first processing manner, the first expiration time point is updated, and a second version of the authentication token is generated according to the first expiration time point after the update; finally, a first response data of the operation request is sent to the client, the first response data carrying the second version of the authentication token. In this way, by setting the first expiration time point and the second expiration time point located after the first expiration time point, and by causing the first version of the authentication token to carry the first expiration time point and the newly generated second version of the authentication token to carry the first expiration time point after the update, the server can update the authentication token multiple times before the second expiration time point arrives, the authentication token of each version carries a different expiration time point, the probability of cracking the authentication token of each version is reduced, data security is ensured, and re-login is not triggered before the second expiration time point arrives, thereby reducing the frequency of repeated login.

[0135] For the same technical concept as the data processing method provided by the foregoing method embodiment, the embodiment of the present application also provides another data processing method applied to a client. Figure 3 The processing flowchart of the second data processing method provided by the embodiment of the present application.

[0136] In step S302, an operation request is sent to a server, the operation request carrying a first version of an authentication token, the first version of the authentication token including a first expiration time point and a second expiration time point located after the first expiration time point.

[0137] In step S304, first response data returned by the server is received, the first response data carrying a second version of the authentication token; the second version of the authentication token is generated after the first expiration time point is updated in a case where a processing manner of the authentication token is a first processing manner; and the processing manner of the authentication token is determined according to the first time point, the first expiration time point, and the second expiration time point.

[0138] In a specific implementation manner, after the first response data returned by the server is received, the data processing method further includes: performing field detection processing according to the first response data to obtain a field detection result; in a case where it is determined according to the field detection result that the first response data includes an additional field, extracting the second version of the authentication token from the additional field; and replacing the stored first version of the authentication token with the second version of the authentication token.

[0139] The field detection processing is performed according to the first response data, and a field detection result is obtained. The field detection result can be detection of whether the first response data includes an additional field.

[0140] If it is determined that the first response data includes the additional field, a second version of the authentication token is extracted from the additional field, and the stored first version of the authentication token is replaced by the second version of the authentication token.

[0141] After the stored first version of the authentication token is replaced by the second version of the authentication token, any operation request sent by the client to the server carries the second version of the authentication token, and the second version of the authentication token is used for authentication by the server.

[0142] If it is determined that the first response data does not include the additional field, no operation is performed.

[0143] Since the technical concept is the same, the embodiment is described more simply, and the related part can refer to the corresponding description of the method embodiment provided above.

[0144] Based on the same technical concept as the data processing method provided in the foregoing method embodiment, the embodiment of the present application further provides another data processing method. Figure 4 The processing flowchart of the third data processing method provided in the embodiment of the present application.

[0145] Step S402, the user logs in successfully.

[0146] Step S404, the backend issues a token to the frontend.

[0147] The backend can be a server. The token can refer to the first version of the authentication token in the embodiment. Figure 2 The frontend can be a client.

[0148] Step S406, the frontend carries the token in subsequent requests.

[0149] Each operation request sent by the frontend to the backend carries the token.

[0150] Step S408, when the backend finds that the business expiration time expires, a new token information is automatically appended to the out-parameter structure, and the token version number of the user is incremented by one at the database level.

[0151] The business expiration time can be a first deadline point. The out-parameter structure can refer to the out-parameter json structure of the initial response data in the embodiment. Figure 2 The new token information can be a second version of the authentication token.

[0152] Step S410, the frontend finds that the backend returns a new token, replaces the previous token, and carries the new token in subsequent requests.

[0153] The front end replaces the locally stored first version of the authentication token with the second version of the authentication token.

[0154] Each operation request sent by the front end to the back end carries the second version of the authentication token.

[0155] At step S412, when the service expiration time expires, it is found that the token expiration time also expires, and the front end jumps to a login page.

[0156] At step S414, the user logs in again.

[0157] Since the technical concept is the same, the embodiment is described relatively simply, and the relevant part can be referred to the corresponding description of the method embodiment provided above.

[0158] Based on the same technical concept as the data processing method provided in the foregoing method embodiment, the embodiment of the present application further provides another data processing method. Figure 5 The processing flowchart of the fourth data processing method provided in the embodiment of the present application.

[0159] At step S502, the user logs in successfully.

[0160] At step S504, the back end issues a token to the front end.

[0161] The back end can be a server. The token can refer to the first version of the authentication token in the embodiment. Figure 2 The front end can be a client.

[0162] At step S506, the back end updates the version number of the token of the user to 1.

[0163] At step S508, the user carries the token in subsequent requests.

[0164] Each operation request sent by the front end to the back end carries the token.

[0165] Steps S506 and S508 can be processed in parallel by establishing and executing asynchronous tasks, for example, the back end calls a first thread to execute step S506; and the back end calls a second thread to execute step S508.

[0166] The first thread and the second thread are two different threads.

[0167] For another example, the back end executes step S506 in a first process; and the back end executes step S508 in a second process.

[0168] The first process and the second process are two different processes.

[0169] Step S510, whether the version number of the token of the request body matches the token version number in the database.

[0170] If yes, step S512 is performed; if no, step S520 is performed.

[0171] The version number of the token of the request body can be a first version identifier in a first version of the authentication token carried by the operation request. The token version number in the database can be a latest version identifier of a user identifier based on the user identifier carried by the operation request, which is obtained by querying the correspondence relationship between the user identifier and the version identifier stored locally in the backend.

[0172] Step S512, the backend finds that the service expiration time has expired but the token expiration time has not expired in the first request.

[0173] The first request is the first operation request sent by the front end to the backend after successful login. The service expiration time can be the first deadline point. The token expiration time can be the second deadline point.

[0174] Step S514, the backend adds new token information to the current out parameter at the filter level.

[0175] The current out parameter can refer to the out parameter json structure of the initial response data of the embodiment. The new token information can be a second version of the authentication token. Figure 2

[0176] Step S516, the backend updates the version number of the database token of the user to 2.

[0177] Step S518, the front end finds that the return result of the backend has a new token.

[0178] The new token is a second version of the authentication token.

[0179] Step S516 and step S518 can be processed in parallel by establishing and executing an asynchronous task.

[0180] Step S520, the backend finds that the token expiration time has expired in the first request, and returns a specific identifier to the front end.

[0181] The specific identifier can refer to the token expiration identifier in the embodiment. Figure 2

[0182] Step S522, the front end jumps to the login page according to the specific identifier.

[0183] Since the technical concept is the same, the description in this embodiment is relatively simple, and the relevant parts can refer to the corresponding description of the method embodiment provided above.

[0184] ​​In the above embodiment, a data processing method applied to a server is provided. Correspondingly, based on the same technical concept, the present embodiment also provides a data processing device, which will be described below with reference to the accompanying drawings.

[0185] Figure 6 A schematic diagram of a data processing device provided in the present embodiment.

[0186] The present embodiment provides a data processing device 600 applied to a server, which comprises:

[0187] A first receiving unit 602 is configured to receive an operation request sent by a client, wherein the operation request carries a first version of an authentication token, and the first version of the authentication token comprises a first deadline and a second deadline located after the first deadline.

[0188] A determining unit 604 is configured to determine a processing mode of the authentication token according to the first time point, the first deadline and the second deadline.

[0189] A generating unit 606 is configured to, in a case where the processing mode of the authentication token is a first processing mode, perform update processing on the first deadline, and generate a second version of the authentication token according to the updated first deadline.

[0190] A first sending unit 608 is configured to send first response data of the operation request to the client, wherein the first response data carries the second version of the authentication token.

[0191] Optionally, when determining the processing mode of the authentication token according to the first time point, the first deadline and the second deadline, the determining unit 604 performs the following steps:

[0192] If the first time point is the same as the first deadline, or the first time point is located after the first deadline and before the second deadline, it is determined that the processing mode of the authentication token is the first processing mode; the first processing mode is used to update the version of the authentication token.

[0193] If the first time point is located before the first deadline, it is determined that the processing mode of the authentication token is a second processing mode; the second processing mode is used to keep the authentication token unchanged.

[0194] If the first time point is the same as the second deadline, or the first time point is located after the second deadline, it is determined that the processing mode of the authentication token is a third processing mode; the third processing mode is used to invalidate the authentication token.

[0195] Optionally, the first sending unit 608 is further configured to:

[0196] In a case where the processing manner of the authentication token is the third processing manner, a second response data of the operation request is sent to the client, and the second response data carries a token invalidation identifier.

[0197] Optionally, the authentication token of the first version further comprises a first version identifier; and the generating unit 606 performs the following steps when generating the authentication token of the second version according to the first expiration time after the update processing:

[0198] The first version identifier is updated to obtain a second version identifier;

[0199] The first version identifier in the authentication token of the first version is replaced by the second version identifier, and the first expiration time point in the authentication token of the first version is replaced by the first expiration time point after the update processing to obtain the authentication token of the second version.

[0200] Optionally, the first receiving unit 602 is further configured to:

[0201] receive a token invalidation instruction, wherein the token invalidation instruction carries a first user identifier;

[0202] The data processing apparatus 600 further comprises:

[0203] The querying unit is configured to perform query processing in the stored correspondence between user identifiers and version identifiers according to the first user identifier to obtain a latest version identifier of the first user identifier;

[0204] The replacing unit is configured to replace the latest version identifier by a preset invalidation identifier.

[0205] Optionally, the authentication token of the first version further comprises a second user identifier and a first version identifier; and the querying unit is further configured to:

[0206] perform query processing in the stored correspondence between user identifiers and version identifiers according to the second user identifier to obtain a latest version identifier of the second user identifier;

[0207] The first sending unit 608 is further configured to:

[0208] If the first version identifier is inconsistent with the latest version identifier of the second user identifier, a third response data of the operation request is sent to the client, and the third response data carries the token invalidation identifier.

[0209] Optionally, the generating unit 606 performs the following steps when updating the first deadline time point:

[0210] determining a first time length according to the first time point and the first deadline time point;

[0211] determining a number of postponements according to the first time length and a preset time length;

[0212] updating the first deadline time point according to the number of postponements and the preset time length.

[0213] The data processing apparatus provided in the embodiments of the present application comprises: a first receiving unit configured to receive an operation request sent by a client, the operation request carrying a first version of an authentication token, the first version of the authentication token comprising a first deadline time point and a second deadline time point located after the first deadline time point; a determining unit configured to determine a processing mode of the authentication token according to a first time point, the first deadline time point and the second deadline time point; a generating unit configured to, in a case where the processing mode of the authentication token is a first processing mode, update the first deadline time point, and generate a second version of the authentication token according to the updated first deadline time point; and a first sending unit configured to send a first response data of the operation request to the client, the first response data carrying the second version of the authentication token. In this way, by setting the first deadline time point and the second deadline time point located after the first deadline time point, and by causing the first version of the authentication token to carry the first deadline time point and the newly generated second version of the authentication token to carry the updated first deadline time point, the server can update the authentication token multiple times before the second deadline time point arrives, the authentication token of each version carries a different deadline time point, the probability of the authentication token of each version being cracked is reduced, the data security is ensured, and the frequency of repeated login is reduced without triggering re-login before the second deadline time point arrives.

[0214] In the above embodiments, a data processing method applied to a client is provided, and based on the same technical concept, the embodiments of the present application also provide a data processing apparatus, which will be described below with reference to the accompanying drawings.

[0215] Figure 7 Another data processing apparatus provided in the embodiments of the present application is shown in a schematic diagram.

[0216] The embodiments of the present application provide a data processing apparatus 700 applied to a client, which comprises:

[0217] The second sending unit 702 is configured to send an operation request to a server, the operation request carrying a first version of an authentication token, the first version of the authentication token including a first deadline and a second deadline located after the first deadline.

[0218] The second receiving unit 704 is configured to receive first response data returned by the server, the first response data carrying a second version of the authentication token; the second version of the authentication token is generated by updating the first deadline in a case where a processing manner of the authentication token is a first processing manner, and is generated according to the updated first deadline; and the processing manner of the authentication token is determined by a first time point, the first deadline and the second deadline.

[0219] Optionally, the data processing apparatus 700 further includes:

[0220] The detecting unit is configured to perform field detection processing according to the first response data to obtain a field detection result.

[0221] The extracting unit is configured to extract the second version of the authentication token from an additional field in a case where it is determined according to the field detection result that the first response data includes the additional field.

[0222] The replacing unit is configured to replace the stored first version of the authentication token with the second version of the authentication token.

[0223] The data processing apparatus provided in this application includes: a second sending unit, configured to send an operation request to a server, the operation request carrying a first version of an authentication token, the first version of the authentication token including a first deadline and a second deadline after the first deadline; and a second receiving unit, configured to receive first response data returned by the server, the first response data carrying a second version of the authentication token; the second version of the authentication token is generated by updating the first deadline when the authentication token processing method is the first processing method, and based on the updated first deadline; the authentication token processing method is determined by the first deadline, the first deadline, and the second deadline. Thus, by setting a first deadline and a second deadline after the first deadline, and with the first version of the authentication token carrying the first deadline and the newly generated second version of the authentication token carrying the updated first deadline, the server can perform multiple version updates to the authentication token before the second deadline arrives. Each version of the authentication token carries a different deadline, reducing the probability of each version of the authentication token being cracked, ensuring data security, and eliminating the need to trigger re-login before the second deadline arrives, thus reducing the frequency of repeated logins.

[0224] Corresponding to the data processing method described above, and based on the same technical concept, this application also provides an electronic device for executing the data processing method described above. Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0225] like Figure 8 As shown, electronic devices can vary considerably due to differences in configuration or performance. They may include one or more processors 801 and memories 802, with the memory 802 storing one or more application programs or data. The memory 802 can be temporary or persistent storage. The application programs stored in the memory 802 may include one or more modules (not shown), each module including a series of computer-executable instructions within the electronic device. Furthermore, the processor 801 may be configured to communicate with the memory 802, executing the series of computer-executable instructions stored in the memory 802 on the electronic device. The electronic device may also include one or more power supplies 803, one or more wired or wireless network interfaces 804, one or more input / output interfaces 805, one or more keyboards 806, etc.

[0226] In one specific embodiment, an electronic device includes a memory, and one or more programs, wherein one or more programs are stored in the memory and can include one or more modules, and each module can include a series of computer-executable instructions in the electronic device and is configured to be executed by one or more processors to perform the following computer-executable instructions:

[0227] receive an operation request sent by a client, the operation request carrying a first version of an authentication token, the first version of the authentication token including a first expiration time point and a second expiration time point located after the first expiration time point;

[0228] determine a processing manner of the authentication token according to the first time point, the first expiration time point, and the second expiration time point;

[0229] in a case where the processing manner of the authentication token is a first processing manner, perform update processing on the first expiration time point, and generate a second version of the authentication token according to the first expiration time point after the update processing;

[0230] send first response data of the operation request to the client, the first response data carrying the second version of the authentication token.

[0231] The specification provides a computer-readable storage medium to implement, for example, the following:

[0232] According to the same technical concept, the embodiments of the present application also provide a computer-readable storage medium based on the data processing method described above.

[0233] The computer-readable storage medium provided by the embodiments of the present application is used to store computer-executable instructions, and the computer-executable instructions can implement the following processes when executed by a processor:

[0234] receive an operation request sent by a client, the operation request carrying a first version of an authentication token, the first version of the authentication token including a first expiration time point and a second expiration time point located after the first expiration time point;

[0235] determine a processing manner of the authentication token according to the first time point, the first expiration time point, and the second expiration time point;

[0236] in a case where the processing manner of the authentication token is a first processing manner, perform update processing on the first expiration time point, and generate a second version of the authentication token according to the first expiration time point after the update processing;

[0237] sending the operation request to the client, the first response data carrying the second version of the authentication token.

[0238] It should be noted that the embodiment of the present specification about the computer-readable storage medium and the embodiment of the present specification about the data processing method applied to the server are based on the same inventive concept, and therefore the specific implementation of the embodiment can be referred to the implementation of the corresponding method described above, and the repeated parts will not be described herein.

[0239] The above describes specific embodiments of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the acts or steps recited in the claims can be performed in a different order than the order in which they are recited and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve the desired results. In certain implementations, multitasking and parallel processing can be advantageous.

[0240] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system or a computer program product. Therefore, the embodiments of the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the specification can take the form of a computer program product implemented on one or more computer-readable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage devices, etc.) containing computer usable program code.

[0241] The specification is described with reference to flowcharts and / or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the specification. It should be understood that each flow and / or block in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor or other programmable device to produce a machine, so that the instructions executed by the processor of the computer or other programmable device produce a device that implements the functions specified in the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 means for performing the functions specified in one or more flows and / or blocks.

[0242] These computer program instructions can also be stored in a computer-readable memory that can direct the computer or other programmable device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a product including instruction means, which implements the functions specified in the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 means for performing the functions specified in one or more flows and / or blocks.

[0243] These computer program instructions can also be loaded onto a computer or other programmable device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process such that the instructions which execute on the computer or other programmable device provide steps for implementing the functions specified in the flowchart or multiple flows and / or blocks. Figure 1 Figure 1

[0244] In one typical configuration, the computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0245] The memory can include non-persistent memory and / or volatile memory, such as random access memory (RAM) about which the computer stores the information. The memory is an example of computer readable media.

[0246] Computer readable media includes permanent and non-permanent, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital versatile disc (DVD), or other optical storage, magnetic cassettes, magnetic disks storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to computing devices. According to the definition herein, computer readable media does not include transitory media, such as modulated data signals and carrier waves.

[0247] It is also important to note that the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without limitation, an element preceded by "comprises... a" does not, without more constraints, foreclose the existence of additional identical elements in the process, method, article, or apparatus that comprises the identified element.

[0248] ​​Embodiments of the present application can be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, and the like, that perform particular tasks or implement particular abstract data types. One or more embodiments of the present description can also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules can be located in both local and remote computer storage media including memory storage devices.

[0249] Each of the embodiments in the present description is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other. Each of the embodiments focuses on the difference from other embodiments. In particular, for the system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the part of the description of the method embodiments.

[0250] The above only describes the embodiments of the present application, and is not intended to limit the present application. The present application can have various changes and modifications for those skilled in the art. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present application shall be included in the scope of claims of the present application.

Claims

1. A data processing method applied to a server, comprising: The method comprises the following steps: receiving an operation request sent by a client, wherein the operation request carries a first version of an authentication token, and the first version of the authentication token comprises a first expiration time point and a second expiration time point located after the first expiration time point; the first expiration time point represents a version expiration time, and the second expiration time point represents a jwt expiration time; determining a processing mode of the authentication token according to a first time point, the first expiration time point and the second expiration time point, wherein: if the first time point is the same as the first expiration time point, or the first time point is located after the first expiration time point and before the second expiration time point, it is determined that the processing mode of the authentication token is a first processing mode; the first processing mode is used to update the version of the authentication token; if the first time point is located before the first expiration time point, it is determined that the processing mode of the authentication token is a second processing mode; the second processing mode is used to keep the authentication token unchanged; if the first time point is the same as the second expiration time point, or the first time point is located after the second expiration time point, it is determined that the processing mode of the authentication token is a third processing mode; the third processing mode is used to invalidate the authentication token; in the case that the processing mode of the authentication token is the first processing mode, performing update processing on the first expiration time point, and generating a second version of the authentication token according to the first expiration time point after the update processing; sending first response data of the operation request to the client, wherein the first response data carries the second version of the authentication token.

2. The method of claim 1, wherein, After determining the processing mode of the authentication token according to the first time point, the first expiration time point and the second expiration time point, the method further comprises the following steps: in the case that the processing mode of the authentication token is the third processing mode, sending second response data of the operation request to the client, wherein the second response data carries a token invalidation identifier.

3. The method of claim 1, wherein, The first version of the authentication token further comprises a first version identifier; and the step of generating a second version of the authentication token according to the first expiration time after the update processing comprises the following steps: performing update processing on the first version identifier to obtain a second version identifier; replacing the first version identifier in the first version of the authentication token with the second version identifier, and replacing the first expiration time point in the first version of the authentication token with the first expiration time point after the update processing, to obtain the second version of the authentication token.

4. The method of claim 1, wherein, The method further comprises the following steps: receiving a token invalidation instruction; the token invalidation instruction carries a first user identifier; performing query processing on a stored correspondence between user identifiers and version identifiers according to the first user identifier, to obtain a latest version identifier of the first user identifier; performing replacement processing on the latest version identifier by using a preset invalidation identifier.

5. The method of claim 1, wherein, The first version of the authentication token further comprises a second user identifier and a first version identifier; and after receiving the operation request sent by the client, the method further comprises the following steps: According to the second user identifier, a query is performed in a stored correspondence between user identifiers and version identifiers, to obtain a latest version identifier of the second user identifier; If the first version identifier is inconsistent with the latest version identifier of the second user identifier, a third response data of the operation request is sent to the client, and the third response data carries the token invalidation identifier.

6. The method of claim 1, wherein, The updating processing on the first deadline point comprises: According to the first time point and the first deadline point, a first time length is determined; According to the first time length and a preset time length, a number of postponements is determined; According to the number of postponements and the preset time length, the first deadline point is updated.

7. A data processing apparatus, applied to a server, characterized in that, Comprise: A first receiving unit is configured to receive an operation request sent by a client, wherein the operation request carries a first version of an authentication token, and the first version of the authentication token comprises a first deadline point and a second deadline point located after the first deadline point; The first deadline point represents a version expiration time, and the second deadline point represents a jwt expiration time; A determination unit is configured to determine a processing mode of the authentication token according to a first time point, the first deadline point, and the second deadline point; A generation unit is configured to, in a case where the processing mode of the authentication token is a first processing mode, update the first deadline point, and generate a second version of the authentication token according to the updated first deadline point; A first sending unit is configured to send a first response data of the operation request to the client, wherein the first response data carries the second version of the authentication token; The determination unit is specifically configured to: If the first time point is the same as the first deadline point, or the first time point is located after the first deadline point and before the second deadline point, it is determined that the processing mode of the authentication token is the first processing mode; the first processing mode is used to update the version of the authentication token; If the first time point is located before the first deadline point, it is determined that the processing mode of the authentication token is a second processing mode; the second processing mode is used to keep the authentication token unchanged; If the first time point is the same as the second deadline point, or the first time point is located after the second deadline point, it is determined that the processing mode of the authentication token is a third processing mode; the third processing mode is used to invalidate the authentication token.

8. An electronic device, comprising: The device comprises: A processor; and a memory configured to store computer executable instructions, which, when executed, cause the processor to perform the data processing method of any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The computer readable storage medium is configured to store computer executable instructions, which, when executed by a processor, implement the data processing method of any one of claims 1-6.

Citation Information

Patent Citations

  • Login verification processing method, system and device

    CN109379192A

  • Token-based authentication method and device

    CN111294337A