A token refreshing method, device, equipment and medium
By dynamically adjusting the refresh mode in the external system of the user device, the problem of the single refresh token method is solved, and efficient and flexible refresh of access tokens is achieved, improving the real-time performance and efficiency of the business system.
Patent Information
- Application Number
- CN202211199689.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-29
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2042-09-29
AI Technical Summary
The existing refresh token method is too simplistic in refreshing access tokens and cannot meet the business data needs that require high real-time performance and flexibility.
After the access token expires, the external system on the user device dynamically determines the refresh mode, adopting either an active or passive refresh mode, and flexibly adjusts the token refresh strategy based on factors such as preset time periods, transaction volume, or password information.
It improves the efficiency and flexibility of token refresh, ensuring proactive refresh during periods of high business load and passive refresh during periods of low load, reducing business delays caused by expired access tokens.
Smart Images

Figure CN115603914B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of security service technology, specifically to a token refresh method, apparatus, device, and medium. Background Technology
[0002] The OAuth protocol requires user devices to use the access token to log in to the server within its validity period. The OAuth protocol specifies a fixed validity period for the access token. If the access token's validity period is too long, it can compromise security; if the validity period is too short, the user device needs to frequently request updates from the server.
[0003] To address the aforementioned issues, the OAuth 2.0 protocol introduced a refresh token. When a user device obtains an access token and its expiration date from the server, it also receives a refresh token. The refresh token is used to refresh the access token, automatically renewing it before it expires.
[0004] Because the current method of refreshing access tokens is too simplistic, it is not suitable for business data with high real-time and flexibility requirements. Summary of the Invention
[0005] This application provides a token refresh method, apparatus, device, and medium to address the problem that current token refresh methods for access token refresh are too simplistic and unsuitable for business data with high real-time and flexibility requirements.
[0006] In a first aspect, embodiments of this application provide a token refresh method, the method comprising:
[0007] After the currently used access token expires, the refresh mode corresponding to the current moment is determined through the user device's external system;
[0008] If the determined refresh mode is active refresh mode, then the server is notified through the external connection system to refresh the access token used by the user equipment.
[0009] If the determined refresh mode is passive refresh mode, then after receiving a service request initiated by the user equipment's business system through the external connection system, the external connection system notifies the server to refresh the access token used by the user equipment. The service request is initiated by the business system after the currently used access token expires.
[0010] In one possible embodiment, determining the refresh mode corresponding to the current moment through the user equipment's external system includes:
[0011] The refresh mode corresponding to the current time period is determined by the user equipment's external system based on a preset correspondence between time periods and refresh modes; or
[0012] The refresh mode for the current moment is determined by the user's external system based on transaction volume over at least one previous time period; or
[0013] The refresh mode at the current moment is determined by monitoring the password information of the user device on the server through the user device's external connection system.
[0014] In one possible embodiment, determining the refresh mode corresponding to the current time period through the user equipment's external connection system based on a preset correspondence between time periods and refresh modes includes:
[0015] If the current time period is a working period, then the refresh mode corresponding to the time period to which the current moment belongs is determined to be the active refresh mode;
[0016] If the current time period is outside of working hours, then the refresh mode corresponding to the current time period is determined to be passive refresh mode.
[0017] In one possible embodiment, determining the refresh mode corresponding to the current time period through the user equipment's external connection system based on a preset correspondence between time periods and refresh modes includes:
[0018] If the current time period is a processing time period, then the refresh mode corresponding to the time period to which the current moment belongs is determined to be the active refresh mode, wherein the processing time period is the time period in which the business data to be processed is greater than or equal to the processing data threshold.
[0019] If the current time period is a non-processing time period, then the refresh mode corresponding to the time period to which the current moment belongs is determined to be the passive refresh mode, wherein the non-processing time period is the time period in which the business data to be processed is less than the processing data threshold.
[0020] In one possible embodiment, determining the refresh mode corresponding to the current moment based on the transaction volume over at least one previous time period via the external system connected to the user equipment includes:
[0021] If the difference between the transaction volume in the first time period and the transaction volume in the second time period is determined to exceed a threshold through the external system of the user device, then the refresh mode of the time period to which the current moment belongs is determined to be the active refresh mode, wherein the first time period is the time period preceding the current time period, and the second time period is the time period preceding the first time period.
[0022] In one possible embodiment, determining the refresh mode at the current moment based on the password information of the user equipment monitored by the user equipment's external connection system on the server includes:
[0023] The system monitors the user device's external connection system and detects a change in the password corresponding to the user device on the server, determining that the current refresh mode is active refresh mode.
[0024] Secondly, this application provides a token refresh device, the device comprising:
[0025] The refresh mode determination module is used to determine the refresh mode corresponding to the current moment through the user device's external system after the currently used access token expires.
[0026] The refresh module is used to notify the server to refresh the access token used by the user equipment through the external system if the determined refresh mode is active refresh mode; and to notify the server to refresh the access token used by the user equipment through the external system after receiving a service request initiated by the user equipment's service system, wherein the service request is initiated by the service system after the currently used access token expires.
[0027] In one possible embodiment, the module for determining the refresh mode is specifically used for:
[0028] The refresh mode corresponding to the current time period is determined by the user equipment's external system based on a preset correspondence between time periods and refresh modes; or
[0029] The refresh mode for the current moment is determined by the user's external system based on transaction volume over at least one previous time period; or
[0030] The refresh mode at the current moment is determined by monitoring the password information of the user device on the server through the user device's external connection system.
[0031] In one possible embodiment, the refresh mode determination module is specifically used for: determining the refresh mode corresponding to the current time period based on a preset correspondence between time periods and refresh modes through the user equipment's external system, including:
[0032] If the current time period is a working period, then the refresh mode corresponding to the time period to which the current moment belongs is determined to be the active refresh mode;
[0033] If the current time period is outside of working hours, then the refresh mode corresponding to the current time period is determined to be passive refresh mode.
[0034] In one possible embodiment, the refresh mode determination module is specifically used for: determining the refresh mode corresponding to the current time period based on a preset correspondence between time periods and refresh modes through the user equipment's external system, including:
[0035] If the current time period is a processing time period, then the refresh mode corresponding to the time period to which the current moment belongs is determined to be the active refresh mode, wherein the processing time period is the time period in which the business data to be processed is greater than or equal to the processing data threshold.
[0036] If the current time period is a non-processing time period, then the refresh mode corresponding to the time period to which the current moment belongs is determined to be the passive refresh mode, wherein the non-processing time period is the time period in which the business data to be processed is less than the processing data threshold.
[0037] In one possible embodiment, the refresh mode determination module is specifically used for: determining the refresh mode corresponding to the current moment based on the transaction volume within at least one previous time period through the user equipment's external connection system, including:
[0038] If the difference between the transaction volume in the first time period and the transaction volume in the second time period is determined to exceed a threshold through the external system of the user device, then the refresh mode of the time period to which the current moment belongs is determined to be the active refresh mode, wherein the first time period is the time period preceding the current time period, and the second time period is the time period preceding the first time period.
[0039] In one possible embodiment, the refresh mode determination module is specifically used to: determine the refresh mode corresponding to the current moment based on the password information of the user equipment in the server, which is monitored through the user equipment's external connection system, including:
[0040] The system monitors the user device's external connection system and detects a change in the password corresponding to the user device on the server, determining that the current refresh mode is active refresh mode.
[0041] Thirdly, this application provides an electronic device, comprising:
[0042] Memory, used to store program instructions;
[0043] A processor is configured to invoke program instructions stored in the memory and execute the steps of the method described in any one of the first aspects according to the obtained program instructions.
[0044] Fourthly, this application provides a computer-readable storage medium storing a computer program, the computer program including program instructions, which, when executed by a computer, cause the computer to perform the method described in any one of the first aspects.
[0045] Fifthly, this application provides a computer program product comprising: computer program code, which, when run on a computer, causes the computer to perform the method described in any one of the first aspects. Attached Figure Description
[0046] Figure 1 This application provides a schematic diagram illustrating the interaction between a user device and a server during token refresh.
[0047] Figure 2 A flowchart illustrating a token refresh method provided in an embodiment of this application;
[0048] Figure 3 A structural diagram of a token refresh device provided in an embodiment of this application;
[0049] Figure 4 This is a structural diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0050] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. Unless otherwise specified, the embodiments and features in the embodiments of this application can be arbitrarily combined with each other. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than that shown here.
[0051] The terms "first" and "second" in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the term "comprising" and any variations thereof are intended to cover non-exclusive protection. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices. The term "multiple" in this application can mean at least two, for example, two, three, or more, and the embodiments of this application do not impose limitations.
[0052] The data collection, dissemination, and use in this application all comply with relevant national laws and regulations.
[0053] Before introducing the token refresh method provided in this application embodiment, for ease of understanding, the technical background of this application embodiment will be described in detail first. The refresh token introduced by OAuth2.0 solves the problem that if the validity period of the access token is too long, it will affect security; if the validity period of the access token is too short, the user device needs to frequently request the server to update the access token. There are two common ways to use refresh tokens: (I) Active refresh mode: When the user device receives the access token, it will also receive the validity period of the access token. The validity period is saved and checked periodically. If the external system in the user device finds that the access token is about to expire, it does not need to wait for the business system in the user device to initiate a business request, but actively uses the refresh token to request authorization service from the server again in order to obtain a new and valid access token. (II) Passive refresh mode: When the business system in the user device sends a business request to the external system, the business system suddenly receives a response that the access token has expired. At this time, the business system triggers the external system, and the external system passively uses the refresh token to request a new and valid access token from the server. In summary, the current method of refreshing access tokens is too simplistic and is not suitable for business data with high real-time and flexibility requirements.
[0054] See Figure 1This diagram illustrates the interaction between a user device and a server. Upon initial login, the external system on the user device sends a login request to the server and requests an access token and a refresh token. Upon receiving the request, the server returns the access token, refresh token, and the access token's expiration date to the external system on the user device. The external system on the user device monitors the access token for expiration in real time. When an access token expires, regardless of whether the current refresh mode is active or passive, the external system must request a refresh token from the server. Upon receiving the refresh token request, the server returns a new access token, a new refresh token, and the new access token's expiration date to the user device. When the external system stores an unexpired access token, when the business system on the user device sends a business request to the server through the external system, the external system combines the unexpired access token with the business request sent by the business system and sends it to the server. The server returns the business data from the business request to the user device based on the received business request.
[0055] The data processing methods in the embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0056] Figure 2 This illustration shows a schematic flowchart of a token refresh method provided in an embodiment of this application, applied to a user equipment, including:
[0057] Step 201: After the currently used access token expires, determine the refresh mode corresponding to the current moment through the user device's external system;
[0058] User equipment includes an external system for interacting with the server and a business system for initiating business requests. When a business system has a business data requirement, it sends a data request to the external system. That is, the business system obtains business data from the server through the external system. It should be noted that the business system only needs to send a business request to the external system. After receiving the business request from the business system, the external system combines the business request with a token and then sends the combined business request and token to the server to complete the business data request.
[0059] Access tokens assigned by the server to external systems have an expiration date. Once expired, the access token becomes invalid and cannot be used to request business data. When an access token expires, the external system determines the refresh mode for that moment. This application includes two refresh modes: active refresh mode and passive refresh mode.
[0060] Step 202: If the determined refresh mode is active refresh mode, then notify the server through the external system to refresh the access token used by the user equipment;
[0061] If the current refresh mode is active refresh mode, meaning the external system does not need to wait for the business system to send a business request before refreshing, the external system will notify the server to refresh the access token used by the user device regardless of whether the business system sends a business request. In active refresh mode, as soon as the external system detects that the current access token has expired, it refreshes the access token and stores the latest refreshed access token. Whenever the business system makes a business request, the external system will store the latest and unexpired access token. The external system can then directly combine the stored access token with the business request sent by the business system and send it to the server to request business data.
[0062] Step 203: If the determined refresh mode is passive refresh mode, then after receiving the service request initiated by the service system of the user equipment through the external connection system, the server is notified through the external connection system to refresh the access token used by the user equipment. The service request is initiated by the service system after the currently used access token expires.
[0063] If the current refresh mode is passive refresh mode, meaning that after the access token expires, the external system needs to wait for the business system to send a business request before refreshing, and if the business system does not send a business request at this time, the external system will not actively notify the server to refresh the access token used by the user device. In other words, in passive refresh mode, if the current access token expires, the external system needs to wait for the business system to send a business request before refreshing the access token and combining the newly refreshed access token with the business request sent by the business system, and then sending it to the server to request business data. The external system will not store the latest and unexpired access token indefinitely.
[0064] In this application, the external system determines the refresh mode in three ways:
[0065] Method 1: The refresh mode corresponding to the current time period is determined by the user device's external system based on the preset correspondence between time periods and refresh modes.
[0066] Specifically, the preset time period can be, but is not limited to, working hours and non-working hours. The preset time period can also be a processing time period and a non-processing time period.
[0067] As an optional implementation, if the current time period is a working period, the refresh mode corresponding to the time period to which the current moment belongs is determined to be the active refresh mode; if the current time period is a non-working period, the refresh mode corresponding to the time period to which the current moment belongs is determined to be the passive refresh mode.
[0068] Specifically, based on the characteristics of the business, if a day is divided into 24 time periods by hour, with 8 hours being working hours and the remaining 16 hours being non-working hours, the working hours on weekdays are the time periods with intensive business requests. Therefore, the working hours on weekdays are set to active refresh mode in advance. The external system always stores the latest access tokens that can be used directly after the refresh, which can improve the efficiency of overall business requests. In addition, the non-working hours or non-working days on weekdays are the time periods with sparse or no business requests. Therefore, the non-working hours or non-working days on weekdays are set to passive refresh mode in advance.
[0069] As an optional implementation, if the current time period is a processing time period, then the refresh mode corresponding to the time period to which the current moment belongs is determined to be an active refresh mode, wherein the processing time period is the time period in which the business data to be processed is greater than or equal to the processing data threshold; if the current time period is a non-processing time period, then the refresh mode corresponding to the time period to which the current moment belongs is determined to be a passive refresh mode, wherein the non-processing time period is the time period in which the business data to be processed is less than the processing data threshold.
[0070] Specifically, based on the characteristics of the business, the pending business data for the day can be statistically analyzed at the beginning of the day. The time period in which the pending business data is greater than or equal to the processing data threshold represents the time period in which the pending business data is densely distributed, and this time period is defined as the processing time period. The time period in which the pending business data is less than the processing data threshold represents the time period in which the pending business data is sparsely distributed or there is no pending business data, and this time period is defined as the non-processing time period.
[0071] It should be noted that the definition and division of the time period preset in this application can be adjusted according to actual business needs, and are not limited to the two definition and division methods mentioned above.
[0072] Method 2: Determine the refresh mode corresponding to the current moment based on the transaction volume of at least one time period in the past through the external system of the user device.
[0073] The time periods are predefined, including but not limited to, dividing any given day into 24 time periods by hour. It should be noted that the division of time periods is not limited to the examples above; time periods can be defined according to actual needs.
[0074] As an optional implementation, if the difference between the transaction volume of the first time period and the transaction volume of the second time period is determined to exceed a threshold through the external connection system of the user equipment, then the refresh mode of the time period to which the current moment belongs is determined to be the active refresh mode, wherein the first time period is the time period preceding the current time period, and the second time period is the time period preceding the first time period.
[0075] Specifically, the threshold is a preset value. In this application, the threshold is 10%. The difference between the transaction volume in the first time period and the transaction volume in the second time period exceeds the threshold, that is, the transaction volume in the first time period increased by 10% compared with the transaction volume in the second time period. This proves that the amount of business data to be processed has a surge trend in the recent time period. Therefore, the refresh mode of the time period to which the current moment belongs is set to the active refresh mode.
[0076] Method 3: Determine the refresh mode at the current moment by monitoring the password status of the user device on the server through the user device's external connection system.
[0077] Password situations may include, but are not limited to, password resets or changes occurring on the server side.
[0078] As an optional implementation, if the user equipment's external connection system detects a change in the password corresponding to the user equipment on the server, it is determined that the refresh mode at the current moment is the active refresh mode.
[0079] Specifically, when the external system detects a change in the password of a user device on the server side, if the access token expires at this time, the external system will proactively notify the server to refresh the access token used by the user device without waiting for the business system to initiate a business request.
[0080] This application divides the data into preset time intervals and defines refresh modes based on the characteristics of the specific business data to be processed in each time interval. This enables dynamic adjustment of the token refresh mode. When the real-time requirement for requesting business data using tokens is high and the differences in business data to be processed in different time intervals are significant, the dynamic token refresh mode is adopted. When the business data to be processed is at a low level, the external system of the user device does not need to repeatedly request refresh tokens. When the business data to be processed is at a high level, the external system of the user device will actively request refresh tokens from the server after detecting that the access token has expired. When the business system issues a business request, there will be no delay in requesting business data due to the need to refresh the access token due to its expiration, thus improving the efficiency of token refresh.
[0081] Based on the same inventive concept, this application provides a token refresh device, please refer to... Figure 3 The device includes:
[0082] The refresh mode determination module 301 is used to determine the refresh mode corresponding to the current moment through the external system of the user equipment after the currently used access token expires.
[0083] The refresh module 302 is used to notify the server through the external system to refresh the access token used by the user equipment if the determined refresh mode is an active refresh mode; and to notify the server through the external system to refresh the access token used by the user equipment after receiving a service request initiated by the service system of the user equipment, wherein the service request is initiated by the service system after the currently used access token expires.
[0084] Optionally, the refresh mode determination module 301 is specifically used for:
[0085] The refresh mode corresponding to the current time period is determined by the user equipment's external system based on a preset correspondence between time periods and refresh modes; or
[0086] The refresh mode for the current moment is determined by the user's external system based on transaction volume over at least one previous time period; or
[0087] The refresh mode at the current moment is determined by monitoring the password information of the user device on the server through the user device's external connection system.
[0088] Optionally, the refresh mode determination module 301 is specifically used for: determining the refresh mode corresponding to the current time period based on a preset correspondence between time periods and refresh modes through the user equipment's external system, including:
[0089] If the current time period is a working period, then the refresh mode corresponding to the time period to which the current moment belongs is determined to be the active refresh mode;
[0090] If the current time period is outside of working hours, then the refresh mode corresponding to the current time period is determined to be passive refresh mode.
[0091] Optionally, the refresh mode determination module 301 is specifically used for: determining the refresh mode corresponding to the current time period based on a preset correspondence between time periods and refresh modes through the user equipment's external system, including:
[0092] If the current time period is a processing time period, then the refresh mode corresponding to the time period to which the current moment belongs is determined to be the active refresh mode, wherein the processing time period is the time period in which the business data to be processed is greater than or equal to the processing data threshold.
[0093] If the current time period is a non-processing time period, then the refresh mode corresponding to the time period to which the current moment belongs is determined to be the passive refresh mode, wherein the non-processing time period is the time period in which the business data to be processed is less than the processing data threshold.
[0094] Optionally, the refresh mode determination module 301 is specifically used for: determining the refresh mode corresponding to the current moment based on the transaction volume within at least one previous time period through the user equipment's external connection system, including:
[0095] If the difference between the transaction volume in the first time period and the transaction volume in the second time period is determined to exceed a threshold through the external system of the user device, then the refresh mode of the time period to which the current moment belongs is determined to be the active refresh mode, wherein the first time period is the time period preceding the current time period, and the second time period is the time period preceding the first time period.
[0096] Optionally, the refresh mode determination module 301 is specifically used to: determine the refresh mode corresponding to the current moment based on the password information of the user equipment in the server, which is monitored through the user equipment's external connection system, including:
[0097] The system monitors the user device's external connection system and detects a change in the password corresponding to the user device on the server, determining that the current refresh mode is active refresh mode.
[0098] Based on the same inventive concept, this application provides an electronic device that can realize the page switching device function described above. Please refer to... Figure 4 The device includes a processor 401 and a memory 402;
[0099] Memory 402 is used to store instructions;
[0100] The processor 401 is used to execute instructions stored in the memory 402. When the processor 401 executes the instructions stored in the memory, it causes the device to perform the token refresh method described in any of the preceding claims.
[0101] Based on the same inventive concept, embodiments of this application provide a computer-readable storage medium. The computer program product includes computer program code, which, when executed on a computer, causes the computer to perform any of the token refresh methods discussed above. Since the principle by which the above-described computer-readable storage medium solves the problem is similar to that of the token refresh method, the implementation of the above-described computer-readable storage medium can be found in the implementation of the method; repeated details will not be elaborated further.
[0102] Based on the same inventive concept, this application also provides a computer program product, which includes computer program code. When the computer program code is run on a computer, it causes the computer to execute any of the token refresh methods discussed above. Since the principle by which the above computer program product solves the problem is similar to that of the token refresh method, the implementation of the above computer program product can be referred to the implementation of the method, and repeated details will not be repeated.
[0103] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0104] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0105] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0106] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of user-operated steps to be executed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0107] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A token refreshing method, characterized by, The method is applied to a user equipment, and comprises: When the real-time of a service data request using an access token is high, and the difference of the to-be-processed service data in different time periods is large, a dynamic token refresh mode is adopted, and the dynamic token refresh mode comprises the following steps: After the currently used access token expires, a refresh mode corresponding to the current time is determined through an external system of the user equipment, wherein the external system of the user equipment determines the refresh mode corresponding to the time period to which the current time belongs based on a preset correspondence between time periods and refresh modes; or the external system of the user equipment determines the refresh mode corresponding to the current time based on the transaction volume in at least one previous time period; or the external system of the user equipment determines the refresh mode corresponding to the current time based on the corresponding password situation of the user equipment in the server listened to by the external system. If the determined refresh mode is the active refresh mode, the server is notified by the external system to refresh the access token used by the user equipment. If the determined refresh mode is the passive refresh mode, the server is notified by the external system to refresh the access token used by the user equipment after a service request initiated by the service system of the user equipment is received by the external system, wherein the service request is initiated by the service system after the currently used access token expires.
2. The method of claim 1, wherein, The external system of the user equipment determines the refresh mode corresponding to the time period to which the current time belongs based on the preset correspondence between time periods and refresh modes, comprising: If the current time period is a working time period, the refresh mode corresponding to the time period to which the current time belongs is determined to be the active refresh mode. If the current time period is a non-working time period, the refresh mode corresponding to the time period to which the current time belongs is determined to be the passive refresh mode.
3. The method of claim 1, wherein, The external system of the user equipment determines the refresh mode corresponding to the time period to which the current time belongs based on the preset correspondence between time periods and refresh modes, comprising: If the current time period is a processing time period, the refresh mode corresponding to the time period to which the current time belongs is determined to be the active refresh mode, wherein the processing time period is a time period in which the to-be-processed service data is greater than or equal to a processing data threshold. If the current time period is a non-processing time period, the refresh mode corresponding to the time period to which the current time belongs is determined to be the passive refresh mode, wherein the non-processing time period is a time period in which the to-be-processed service data is less than the processing data threshold.
4. The method of claim 1, wherein, The external system of the user equipment determines the refresh mode corresponding to the current time based on the transaction volume in at least one previous time period, comprising: If the difference between the transaction volume of a first time period and the transaction volume of a second time period exceeds a threshold value, the refresh mode of the time period to which the current time belongs is determined to be the active refresh mode, wherein the first time period is a previous time period of the current time period, and the second time period is a previous time period of the first time period.
5. The method of claim 1, wherein, The external system of the user equipment determines the refresh mode corresponding to the current time based on the corresponding password situation of the user equipment in the server listened to by the external system, comprising: The user equipment is monitored by the external system of the user equipment, and it is determined that the corresponding password of the user equipment in the server changes, and the refresh mode corresponding to the current time is determined as the active refresh mode.
6. A token refreshing apparatus characterized by comprising: When the real-time performance of the business data request using the access token is high, and the difference between the business data to be processed in different time periods is large, a dynamic token refresh mode is adopted, the dynamic token refresh mode is applied to the device, and the device includes: A refresh mode determination module is configured to determine the refresh mode corresponding to the current time after the expiration of the currently used access token through the external system of the user equipment, wherein the external system of the user equipment determines the refresh mode corresponding to the time period to which the current time belongs based on the preset correspondence between the time period and the refresh mode; or the external system of the user equipment determines the refresh mode corresponding to the current time based on the transaction volume in the previous at least one time period; or the external system of the user equipment determines the refresh mode corresponding to the current time based on the corresponding password of the user equipment in the server monitored by the external system of the user equipment. A refresh module is configured to notify the server to refresh the access token used by the user equipment through the external system if the determined refresh mode is the active refresh mode; and notify the server to refresh the access token used by the user equipment through the external system after receiving the business request initiated by the business system of the user equipment if the determined refresh mode is the passive refresh mode, wherein the business request is initiated by the business system after the expiration of the currently used access token.
7. An electronic device, comprising: It includes: A memory is configured to store program instructions; A processor is configured to call the program instructions stored in the memory, and execute the steps included in the method according to the obtained program instructions.
8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program includes program instructions, and the program instructions make the computer execute the method when the computer executes the program instructions.
9. A computer program product, characterised in that, The computer program product includes computer program code, and the computer program code makes the computer execute the method when the computer program code runs on the computer.
Citation Information
Patent Citations
Resource access implementation method and device, electronic equipment and storage medium
CN114764507A