Token life cycle collaborative management and session synchronization control method and system

By establishing a mapping data structure and a unified communication interface in the main control module, the problem of inconsistent token life cycles in distributed systems is solved, cross-system secure synchronization control is achieved, and the system security and execution efficiency are improved.

CN120768689AActive Publication Date: 2025-10-10NANJING HUADUN ELECTRIC POWER INFORMATION SAFETY EVALUATION CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202511278655.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-09
Publication Date
2025-10-10
Estimated Expiration
2045-09-09

AI Technical Summary

Technical Problem

In distributed application systems, the lifecycle management of tokens is inconsistent, and there is a lack of unified security mechanisms and efficient batch operation mechanisms, which leads to access failures, permission anomalies and security risks.

Method used

The main control module is used to establish a mapping data structure to record the correspondence between user identity tokens and local authority tokens, and synchronize updates and logouts through a unified communication interface. In combination with identity authentication, security verification and abnormal retry mechanism, update and logout strategies are dynamically calculated.

Benefits of technology

It achieves unified token management across multiple subsystems, improves the security, consistency and execution efficiency of the system, and ensures the stability and security of session synchronization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120768689A_ABST
    Figure CN120768689A_ABST
Patent Text Reader

Abstract

The invention discloses a token life cycle collaborative management and session synchronization control method and system, and relates to the technical field of session token management. According to the method, an encryption mapping data structure is established in a main control module, the corresponding relation between a user identity token and two or more subsystem local authority tokens is recorded, and index retrieval based on user identification is supported. The main control module cooperatively completes synchronous updating of the identity token and the local token based on parameters such as token expiration time, network delay, processing delay and operation state; and when a global logout request is received, controlling the plurality of subsystems to complete local token logout and delete the mapping information according to the dynamically calculated batch number and priority sequence. All updating and logout operations are completed through a unified communication interface with identity authentication, security verification and exception retry mechanisms, an original authority control mechanism of the subsystem does not need to be modified, and the security, consistency and expansibility of cross-system session management are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of session token management, and in particular to a method and system for collaborative token lifecycle management and session synchronization control. Background Art

[0002] In distributed applications or scenarios where multiple subsystems operate collaboratively, user identity tokens and each subsystem's local permission tokens are the core credentials for implementing access control and session management. In existing technologies, token lifecycle management is typically performed independently by each subsystem, resulting in different token generation, update, and cancellation policies across different subsystems. This leads to the following issues: Inconsistent expiration times, update cycles, and expiration policies for local permission tokens across subsystems can easily cause mismatches between the user identity token and the token status of some subsystems, leading to access failures or permission anomalies. In scenarios where user identity tokens are updated or globalized, there is a lack of a central control mechanism to coordinate token operations across multiple subsystems. Batch token updates or cancellations often require invoking subsystem interfaces one by one, which is inefficient and susceptible to network latency. In existing systems, integrity verification of token update or cancellation requests is insufficient, and there is a lack of unified identity authentication, security verification, and exception retry mechanisms, posing security and reliability risks. During global cancellation, there is a lack of a strategy to dynamically adjust batch size and priority based on operational indicators such as network status and system load. This can lead to response timeouts in some subsystems and increased overall latency, impacting the user experience.

[0003] Therefore, there is an urgent need for a technical solution that can uniformly, coordinately, securely and efficiently manage the lifecycle and control session synchronization of user identity tokens and local authority tokens in a distributed multi-subsystem environment, so as to solve the above-mentioned problems such as lifecycle asynchrony, lack of a unified security mechanism and inefficient batch operations, thereby improving the security, consistency and execution efficiency of the system. Summary of the Invention

[0004] The present invention aims to address the problems of lifecycle asynchrony, lack of a unified security mechanism, and low efficiency of batch operations in the above-mentioned background technologies, and provide a token lifecycle collaborative management and session synchronization control method and system to achieve unified management and secure synchronization control of tokens across multiple subsystems, thereby improving the security, consistency and execution efficiency of the system.

[0005] To achieve the above object, the present invention adopts the following technical solutions:

[0006] In one aspect, the present invention provides a method for collaborative token lifecycle management and session synchronization control, comprising:

[0007] Step 1: Establish a mapping data structure in the main control module that includes user identification, subsystem identification, local authority token information, and status fields. The mapping data structure is used to record the correspondence between the user identity token and the local authority tokens in two or more subsystems, and supports encrypted storage and index retrieval based on user identification;

[0008] Step 2: When the main control module detects that the user identity token needs to be updated based on the update trigger time calculated by multiple parameters such as token expiration time, network delay, processing delay and operating status, it executes the user identity token update operation and coordinates each target subsystem to complete the synchronous update operation of the corresponding local authority token, and updates the corresponding relationship in the mapping data structure at the same time;

[0009] Step 3: When the main control module receives the user's global logout request, it controls two or more subsystems to complete the logout operation of the local authority token based on the corresponding relationship recorded in the mapping data structure and the dynamically calculated batch number and the target priority order within the batch. After all the logout operations are completed, the associated information in the mapping data structure is deleted;

[0010] Step 4: The user identity token update operation, local authority token update operation and logout operation are all completed through the unified communication interface. The unified communication interface has identity authentication, security verification and exception retry mechanisms and does not require modifications to the subsystem's original authority control mechanism.

[0011] Preferably, the method of mapping the data structure includes:

[0012] Receive user identity token generation or update events;

[0013] Parse the user ID and target subsystem information contained in the event;

[0014] In response to the user identification and target subsystem information obtained by parsing, dynamically generating a mapping data structure for establishing a mapping relationship between the user identity token and the target subsystem local authority token;

[0015] The mapping data structure includes the following fields: user identification field, subsystem identification field, local authority token field, creation time field, valid status field, synchronization status field;

[0016] The local authority token field is stored in encrypted form, and a secondary index structure with the user identifier as the key is established in the cache to support index retrieval based on the user identifier.

[0017] Preferably, the update trigger time of the user identity token is Calculated by the following formula:

[0018] ;

[0019] wherein: is the current time, is the local authority token expiration time of the i-th subsystem, is the network delay of the i-th subsystem, is the processing delay of the i-th subsystem, is the running load of the i-th subsystem, is the connection quality of the i-th subsystem, is a delay correction function based on the running load and the connection quality of the i-th subsystem; after calculating the update trigger time of the user identity token, the master module sends a user identity token update request to the identity authentication system and all target subsystems, and updates the corresponding relationship in the mapping data structure after receiving the returned new token. Preferably, at the time of the update trigger time of the user identity token , the security verification operation is performed simultaneously with the sending of the update request, and the security verification operation comprises: calculating a verification value based on the update request parameters

[0020] , the user identity token and the target subsystem identifier , and the verification value calculation formula is:

[0021] ;

[0022] wherein: is an irreversible encryption hash function, denotes the parameter concatenation operation in order; the master module compares the verification value with the expected value, and only when the comparison is consistent, sends a local authority token update request to the corresponding target subsystem in the mapping data structure, and updates the corresponding relationship in the mapping data structure after receiving the new token returned by the target subsystem.

[0023] Preferably, when the master module controls two or more target subsystems to perform local authority token revocation, the number of target subsystems in each batch is dynamically determined based on the following formula :

[0024] ;

[0025] wherein: denotes the number of target subsystems included in each batch; denotes the maximum allowed batch number; denotes the total time window currently available for revocation operation; ​​​Indicates the average logout time of each target subsystem; Indicates the adjustment coefficient set based on historical execution efficiency data; the main control module follows The value of divides all target subsystems into batches and executes the deregistration calls sequentially in the batches.

[0026] Preferably, the main control module calculates the processing priority value in each batch of target subsystems based on the following formula: And execute the cancellation in order of merit priority:

[0027] ;

[0028] in: Indicates the The processing priority value of each target subsystem; Indicates the Real-time operation load indicators of target subsystems; Indicates the Network link status indicators of each target subsystem; and Represents the first and second performance impact coefficients set based on historical performance data; the main control module is based on The deregistration calls are initiated in order from high to low values ​​until the deregistration of all target subsystems in the batch is completed.

[0029] Preferably, when executing batch local authority token cancellation, the main control module calculates the execution deviation value based on the actual execution time, execution success rate, network delay and link quality operation index of the previous round of batch execution, and when the execution deviation value exceeds the preset threshold, the batch quantity calculation parameter is increased. And the performance impact coefficient in the priority calculation formula and Dynamic correction is performed, and the corrected parameters are used for batch quantity calculation and intra-batch priority sorting calculation of the next batch.

[0030] Preferably, the unified communication interface includes:

[0031] Identity authentication step: authenticating update and logout operation requests based on token identification and request parameters;

[0032] The security verification step calculates the verification value for the authenticated operation request and compares it with the expected verification value. Only when the comparison is consistent, it is confirmed that the request has not been tampered with and maintains integrity;

[0033] Abnormal retry step: when a call failure, network interruption or response timeout is detected, the corresponding operation is re-initiated according to the preset retry strategy until the maximum number of retries is reached or the target operation is completed;

[0034] The implementation of the unified communication interface does not require changing the original authority control mechanism of the subsystem.

[0035] On the other hand, the present invention also provides a token lifecycle collaborative management and session synchronization control system, including:

[0036] A main control module is used to establish a mapping data structure, which includes a user identifier, a subsystem identifier, local authority token information and a status field, and supports encrypted storage and index retrieval based on the user identifier;

[0037] An update control module is used to execute a user identity token update operation and coordinate the update of a local authority token when it is detected that the user identity token needs to be updated based on a calculation of multiple parameters such as token expiration time, network delay, processing delay, and running status, and to update the corresponding relationship in the mapping data structure;

[0038] The deregistration control module is used to control multiple subsystems to execute local authority token deregistration based on the corresponding relationship in the mapping data structure and the dynamically calculated batch number and the target priority order within the batch upon receiving a global deregistration request, and delete the associated information in the mapping data structure after all deregistrations are completed;

[0039] The communication interface module is used to complete the user identity token update operation, local authority token update operation and logout operation, and has identity authentication, verification value comparison and abnormal retry mechanism

[0040] On the other hand, the present invention further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the token lifecycle collaborative management and session synchronization control method as described in any one of the above items is implemented.

[0041] The beneficial effects of the present invention are as follows: the present invention realizes the centralized management of the correspondence between the user identity token and the local authority tokens of multiple subsystems by establishing a mapping data structure including user identification, subsystem identification, local authority token information and status fields in the main control module, and ensures data security and access efficiency through encrypted storage and index retrieval based on user identification. The main control module can accurately determine the update time point of the identity token based on comprehensive calculation of multiple parameters such as token expiration time, network delay, processing delay and operating status, so as to actively perform synchronous updates of the identity token and the local authority token before the token expires, avoiding session interruption and access anomalies caused by delays or asynchrony. When the user initiates a global logout request, the system can use the record information of the mapping data structure to coordinate multiple subsystems to complete the logout of local authority tokens in an orderly and efficient manner according to the dynamically calculated batch number and priority order within the batch, and clear the associated information after all logouts are completed, completely eliminating residual access rights, and fundamentally improving the security protection capabilities of the system. The unified communication interface provides identity authentication, security verification and exception retry mechanisms during the token update and cancellation process, without the need to modify the subsystem's original permission control mechanism. It not only ensures the security and reliability of operations, but also has strong compatibility and scalability during the system integration process, thereby effectively improving the stability, consistency and security of session lifecycle management in a multi-heterogeneous system environment. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be derived from these drawings without inventive effort. Among them: Figure 1 is a flow chart of the method of the present invention; Figure 2 This is a timing diagram of the dynamic refresh process of the user identity token and the local authority token in an embodiment of the present invention; Figure 3 This is a timing diagram of the global cancellation collaboration process in an embodiment of the present invention; Figure 4 Schematic diagram of the modular structure of the system according to an embodiment of the present invention. DETAILED DESCRIPTION

[0043] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions of the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the described embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field are within the scope of protection of the present invention.

[0044] Example 1

[0045] like Figure 1 FIG. 1 is an embodiment of the present invention, which provides a method for collaborative token lifecycle management and session synchronization control, including:

[0046] Step 1: Create a mapping data structure

[0047] A mapping data structure including user identification, subsystem identification, local authority token information and status fields is established in the main control module. The mapping data structure is used to record the correspondence between the user identity token and the local authority tokens in two or more subsystems, and supports encrypted storage and index retrieval based on the user identification; the mapping data structure is preferably stored in the form of key-value pairs, and each record uniquely corresponds to a token mapping relationship between a user and a subsystem.

[0048] The mapping data structure includes:

[0049] Receive user identity token generation or update events;

[0050] Parse the user ID and target subsystem information contained in the event;

[0051] In response to the user identification and target subsystem information obtained by parsing, dynamically generating a mapping data structure for establishing a mapping relationship between the user identity token and the target subsystem local authority token;

[0052] The mapping data structure includes the following fields: user identification field, subsystem identification field, local authority token field, creation time field, valid status field, synchronization status field;

[0053] Preferably, the mapping data structure can be expressed in a table or JSON format, for example:

[0054] {

[0055] "userId": "U12345",

[0056] "systemId": "SYS-A",

[0057] "localToken": "enc_xxx",

[0058] "createTime": "2025-08-12T09:00:00Z",

[0059] "validStatus": "active",

[0060] "syncStatus": "in-sync"

[0061] }

[0062] The format facilitates storage and cross-module parsing.

[0063] The local permission token field is stored in an encrypted manner, preferably using the AES-256 symmetric encryption algorithm, and the key is uniformly managed by a security module and periodically rotated to improve data security. A secondary index structure is established in the cache with the user identifier as the key. The secondary index is preferably implemented based on a hash table to complete index retrieval based on the user identifier in O(1) time complexity, supporting high-concurrency access.

[0064] When generating the mapping data structure, the master module can perform integrity checking on the input fields. If necessary fields are missing or parsing fails, an error log is recorded and the mapping is regenerated according to a pre-set retry strategy (e.g., up to three retries). When consecutive failures exceed a threshold, an abnormal alarm mechanism is triggered to ensure system stability.

[0065] Step 2: Calculate token update trigger time and perform update

[0066] When the master module detects that the user identity token needs to be updated based on the update trigger time calculated from the token expiration time, network delay, processing delay, and running state, it performs a user identity token update operation and coordinates each target subsystem to complete the corresponding local permission token synchronization update operation, while updating the corresponding relationship in the mapping data structure;

[0067] The update trigger time of the user identity token is calculated by the following formula:

[0068] ;

[0069] Where: is the current time, is the local permission token expiration time of the th subsystem, is the network delay of the th subsystem, is the processing delay of the th subsystem, Based on the The operating load of each subsystem and connection quality Delay correction function of ;

[0070] Preferably, the delay correction function The coefficient can be dynamically adjusted based on historical monitoring data to improve the accuracy of update trigger time prediction.

[0071] The main control module calculates After that, a token update request is sent to the identity authentication system and all target subsystems. The request can be transmitted through the unified communication interface and carry the necessary identity authentication parameters to ensure the legitimacy of the request source; after receiving the returned new token, the corresponding relationship in the mapping data structure is updated.

[0072] In this embodiment, if the main control module calculates the update trigger time of the user identity token If it is found that the remaining validity time is less than the set threshold (such as 30 minutes), a token update request is immediately sent to the identity authentication system and all target subsystems. The request can be transmitted through the unified communication interface and carry the necessary identity authentication parameters (such as timestamp, user ID, digital signature, etc.) to ensure the legitimacy of the request source; after receiving the returned new token, the corresponding relationship in the mapping data structure is updated.

[0073] Security Verification Operation

[0074] At the update trigger time of the user identity token When sending an update request, a security verification operation is performed, which includes: , the user identity token and the target subsystem identifier Calculate verification value , the verification value calculation formula is:

[0075] ;

[0076] in: It is an irreversible cryptographic hash function, preferably a secure hash algorithm such as SHA-256 or SM3; Indicates that the parameters are connected in sequence. The connection order should be solidified when the system is initialized to avoid parsing ambiguity. Can be a random number (nonce) or a timestamp to prevent replay attacks;

[0077] The main control module compares the verification value with the expected value, and only sends a local authority token update request to the corresponding target subsystem in the mapping data structure when the comparison is consistent, so as to prevent forged or tampered requests from being executed; after receiving the new token returned by the target subsystem, the corresponding relationship in the mapping data structure is updated.

[0078] Preferably, when security verification fails, the system will record the security event log (including failure time, request source IP, failure reason code, etc.), and can trigger an early warning mechanism, and issue an alarm via SMS, email or monitoring platform to support subsequent security audits.

[0079] In the test environment of this embodiment, when A random number with a length of 16 bytes. The length is 32 bytes. When the length is 8 bytes, the total input length is 56 bytes. SHA-256 is used to generate a 256-bit hash value, which is stored as a 64-bit hexadecimal string.

[0080] Step 3: Global Logout and Batch Control

[0081] When the main control module receives a global logout request from the user, it controls two or more subsystems to complete the logout operation of the local authority token according to the dynamically calculated batch number and the target priority order within the batch based on the correspondence between the user identity token and the local authority token of the target subsystem recorded in the mapping data structure, and deletes the associated information in the mapping data structure after all logout operations are completed;

[0082] When the main control module controls two or more target subsystems to execute local authority token cancellation, the number of target subsystems in each batch is dynamically determined based on the following formula: :

[0083] ;

[0084] in: Indicates the number of target subsystems included in each batch, and the calculation result is an integer value after rounding down; Indicates the maximum batch size allowed; Indicates the total time window currently available for logout operations; Indicates the average logout time of each target subsystem; Indicates the adjustment coefficient set based on historical execution efficiency data; the main control module follows The value of divides all target subsystems into batches and executes the deregistration calls sequentially in the batches.

[0085] In actual implementation, Can be set by business scenario, for example, global logout is required to be completed within 5 seconds, ; It can be obtained through statistics over a recent period of time (such as the average of the last 100 calls); It can be adjusted dynamically based on network congestion and system load, and the value range is usually 0.5~1.5.

[0086] For example: When When , we calculate:

[0087]

[0088] That is, each batch can process the deregistration of 7 subsystems at the same time.

[0089] The main control module calculates the processing priority value in each batch of target subsystems based on the following formula And execute logouts sorted by priority value:

[0090] ;

[0091] in: Indicates the The processing priority value of each target subsystem; Indicates the Real-time operation load indicators of target subsystems; Indicates the Network link status indicators of each target subsystem; and represent the first and second performance impact coefficients set based on historical performance data respectively; The larger the value, the higher the processing priority of the target subsystem. The deregistration calls are initiated in order from high to low values ​​until the deregistration of all target subsystems in the batch is completed.

[0092] In practical applications, Can be a floating point value between 0 and 1 (such as CPU usage or average queue waiting rate) It can take a floating point value between 0 and 1 (such as the inverse of the Ping packet loss rate or the delay quality score). Weights can be set based on business policies, e.g. Indicates that the operating load is slightly more important than the network status.

[0093] Example: Assume that the operating indicators of the three target subsystems in a batch are:

[0094] System A:

[0095] System B:

[0096] System C:

[0097] Take Then:

[0098] ;

[0099] The sorting result is: System C> System B> System A, that is, the local privilege token of system C is preferentially logged out.

[0100] When the master module executes the batched local privilege token logout, the actual time consumption, execution success rate, network delay and link quality running indicators of the last batch execution are used to calculate the execution deviation value, and when the execution deviation value exceeds the preset threshold, the performance influence coefficient in the batch quantity calculation parameter and the priority calculation formula and are dynamically corrected, and the corrected parameters are used for batch quantity calculation and priority sorting calculation in the next batch.

[0101] Step 4: The unified communication interface executes the operation

[0102] The user identity token update operation, the local privilege token update operation and the logout operation are all completed through the unified communication interface, and the unified communication interface has identity authentication, security verification and exception retry mechanism and does not need to modify the original permission control mechanism of the subsystem.

[0103] The unified communication interface includes:

[0104] Identity authentication step, identity authentication based on token identification and request parameters is performed on the update operation request and the logout operation request;

[0105] Security verification step, the verification value of the operation request that has passed the identity authentication is calculated and compared with the expected verification value, and only when the comparison is consistent, it is confirmed that the request has not been tampered with and remains intact;

[0106] Exception retry step, when it is detected that the call fails, the network is interrupted or the response is timed out, the corresponding operation is reinitiated according to the preset retry strategy until the maximum number of retries is reached or the target operation is completed;

[0107] The implementation of the unified communication interface does not need to change the original permission control mechanism of the subsystem.

[0108] In a preferred embodiment, when the maximum number of retries is reached and the target operation is still not completed, the system will trigger the subsequent coping mechanism, for example:

[0109] Log the failure log for subsequent troubleshooting;

[0110] Triggering an alarm notification to prompt the operation and maintenance personnel or security administrator to intervene and handle;

[0111] Entering the manual intervention mode, and manually initiating the recovery or logout operation by the administrator.

[0112] Through the above measures, it is ensured that there is still a controllable remedial approach in extreme cases, thereby further improving the reliability and security of the system.

[0113] As shown in Figure 4 The application also provides a token life cycle cooperative management and session synchronization control system, comprising:

[0114] A master module is configured to establish a mapping data structure, wherein the mapping data structure comprises a user identifier, a subsystem identifier, local permission token information, and a state field, supports encrypted storage, and index retrieval based on the user identifier;

[0115] An update control module is configured to perform a user identity token update operation and coordinate the update of the local permission token when it is detected that the user identity token needs to be updated based on the token expiration time, network delay, processing delay, and running state, and update the corresponding relationship in the mapping data structure;

[0116] A logout control module is configured to, based on the corresponding relationship in the mapping data structure, control a plurality of subsystems to perform local permission token logout according to the dynamically calculated batch quantity and target priority order within the batch when a global logout request is received, and delete the associated information in the mapping data structure after all the logout is completed;

[0117] A communication interface module is configured to complete the user identity token update operation, the local permission token update operation, and the logout operation, and has an identity authentication, verification value comparison, and abnormal retry mechanism

[0118] The application also provides a computer readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements all the steps as described above, including establishing a mapping data structure, calculating an update trigger time, performing token update and security verification, performing global logout in batches and according to priority, and performing the above operations through a unified communication interface.

[0119] Embodiment 2

[0120] The technical solutions of the application will be further described in detail below with reference to the accompanying drawings. It should be understood that the following embodiments are only used to illustrate the application and do not limit the scope of protection of the application.

[0121] I. Dynamic refresh process of user identity token and local permission token (as shown in Figure 2 )

[0122] When the main control module detects that a user identity token needs to be updated, it dynamically determines the triggering time based on the multi-parameter calculation formula described in the claims (including token expiration time, network latency, processing latency, and a function to correct for operational delays). In this embodiment, when the client monitors in real time that the remaining validity time of the user identity token is less than or equal to 30 minutes, it sends a refresh request to the identity authentication system (IAM) using a refresh token.

[0123] After successful authentication, the authentication system returns a new user identity token and pushes a token update event to the token mapping service in the master control module via the messaging middleware (Kafka). The token mapping service parses the event, including the user ID and subsystem ID, and performs a "key update" operation in the cache implementation (Redis) of the mapping data structure, replacing the old identity token hash value with the new one. It also sets a 5-minute expiration time for the old mapping record.

[0124] On the subsystem side, when the service gateway detects that the remaining validity time of the local authorization token is less than or equal to 10 minutes when forwarding the request, it triggers the call to the unified communication interface to initiate a local authorization token refresh request to the main control module. The unified communication interface performs a security verification operation when forwarding the request, calculating the verification value based on the refresh request parameters, the current user identity token, and the target subsystem identifier. It compares the verification value with the expected value and only initiates a refresh call to the corresponding subsystem authorization engine if the verification is consistent.

[0125] After the subsystem permission engine generates a new local permission token, the token mapping service encrypts the new token using the subsystem's independent key (managed by the key management system (KMS)) and updates the local permission token field of the corresponding entry in the mapping data structure, thereby keeping the correspondence between the user identity token and the local permission token synchronized. Finally, the new identity token is returned to the client.

[0126] 2. Global cancellation collaborative process (such as Figure 3 shown)

[0127] When a user submits a global logout request on the Identity and Authentication System (IAM) interface, IAM immediately invalidates the user's refresh token and all active user identity tokens. IAM then broadcasts the global logout event to all target subsystems via the messaging middleware (Kafka). The token mapping service in the master module receives this event as a consumer and, based on the user ID contained in the event, quickly retrieves the user's local permission token records across all subsystems from a secondary index (keyed by the user ID) in the cache implementation of the mapping data structure (Redis).

[0128] In order to ensure efficient and controllable deregistration of multiple subsystems, the main control module can calculate the number of target subsystems in each batch based on the dynamic calculation formula for batch quantity described in the claims, combined with the currently available deregistration time window, the average deregistration time of each target subsystem and the historical execution efficiency adjustment coefficient, and determine the execution order within the batch based on the priority calculation formula (taking into account factors such as operating load and network link status).

[0129] The token mapping service calls the token deregistration interface of each target subsystem according to the aforementioned batching and priority order. Upon receiving the call, the subsystem permission engine destroys the corresponding local session and confirms the deregistration result. Once all target subsystems within a batch have completed deregistration, the main control module calculates the execution deviation based on the actual execution time, success rate, and link status. If it exceeds the preset threshold, the performance impact coefficient in the batch size and priority calculation is dynamically adjusted to schedule the next round of deregistration batches.

[0130] When all batches are executed, the token mapping service deletes all token mapping records of the user in Redis in batches, that is, deletes the associated information in the mapping data structure to ensure that there is no residual access permission in the system.

[0131] In summary, the present invention, through the unified scheduling and secure communication mechanism of the master control module in a multi-heterogeneous distributed system environment, achieves the coordinated execution of dynamic token refresh and global logout across systems, ensuring the uniformity and security of session lifecycle management. The present invention has a clear structure and strong adaptability, enabling smooth integration without changing the existing system authority architecture. It is suitable for business scenarios involving power, finance, government affairs, and other multi-system integration, and has important significance and broad application prospects for improving cross-system security management and industry digital collaboration capabilities.

[0132] In the description of this specification, the reference terms "one embodiment," "some embodiments," "example," "specific example," or "some examples" mean that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. Moreover, the specific features, structures, materials, or characteristics described may be combined in any appropriate manner in any one or more embodiments or examples. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification, as well as features of different embodiments or examples, unless they are mutually inconsistent.

[0133] Any process or method description in the flowchart or otherwise described herein can be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process. The scope of the preferred embodiments of the present application includes additional implementations in which the functions may be performed in a different order than shown or discussed, including in a substantially simultaneous manner or in a reverse order depending on the functions involved.

[0134] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any person skilled in the art can easily conceive of various modifications or substitutions within the technical scope disclosed in this application, and such modifications or substitutions should be included within the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

Claims

1. A token lifecycle collaborative management and session synchronization control method, characterized in that: The method comprises: Establishing a mapping data structure in the main control module that includes user identification, subsystem identification, local authority token information, and status fields. The mapping data structure is used to record the correspondence between the user identity token and the local authority tokens in two or more subsystems, and supports encrypted storage and index retrieval based on the user identification; When the main control module detects that the user identity token needs to be updated based on the update trigger time calculated by multiple parameters such as token expiration time, network delay, processing delay and operating status, it executes the user identity token update operation and coordinates each target subsystem to complete the synchronous update operation of the corresponding local authority token, and at the same time updates the corresponding relationship in the mapping data structure; When the main control module receives a global logout request from the user, it controls two or more subsystems to complete the logout operation of the local authority token according to the dynamically calculated batch number and the target priority order within the batch based on the corresponding relationship recorded in the mapping data structure, and deletes the associated information in the mapping data structure after all logout operations are completed; User identity token update operations, local authority token update operations and logout operations are all completed through the unified communication interface. The unified communication interface has identity authentication, security verification and exception retry mechanisms and does not require modifications to the subsystem's original authority control mechanism.

2. A token lifecycle collaborative management and session synchronization control method according to claim 1, characterized in that: The mapping data structure includes: Receive user identity token generation or update events; Parse the user ID and target subsystem information contained in the event; In response to the user identification and target subsystem information obtained by parsing, dynamically generating a mapping data structure for establishing a mapping relationship between the user identity token and the target subsystem local authority token; The mapping data structure includes the following fields: a user identification field, a subsystem identification field, a local authority token field, a creation time field, a valid status field, and a synchronization status field; The local authority token field is stored in encrypted form, and a secondary index structure with the user identifier as the key is established in the cache to support index retrieval based on the user identifier.

3. A token lifecycle collaborative management and session synchronization control method according to claim 2, characterized in that: The update trigger time of the user identity token Calculated by the following formula: ; in: is the current time, For the The local permission token expiration time of each subsystem, For the Network latency of each subsystem, For the The processing delay of each subsystem, Based on the The operating load of each subsystem and connection quality The delay correction function of the main control module calculates the update trigger time of the user identity token After that, a user identity token update request is sent to the identity authentication system and all target subsystems, and after receiving the returned new token, the corresponding relationship in the mapping data structure is updated.

4. A token lifecycle collaborative management and session synchronization control method according to claim 3, characterized in that: At the update trigger time of the user identity token When sending an update request, a security verification operation is performed, which includes: , the user identity token and the target subsystem identifier Calculate verification value , the verification value calculation formula is: ; in: is an irreversible cryptographic hash function, Indicates that the parameters are connected in sequence; the main control module compares the verification value with the expected value, and only sends a local authority token update request to the corresponding target subsystem in the mapping data structure when the comparison is consistent, and updates the corresponding relationship in the mapping data structure after receiving the new token returned by the target subsystem.

5. A token lifecycle collaborative management and session synchronization control method according to claim 1, characterized in that: When the main control module controls two or more target subsystems to execute local authority token cancellation, the number of target subsystems in each batch is dynamically determined based on the following formula: , the expression is: ; in: Indicates the number of target subsystems included in each batch; Indicates the maximum batch size allowed; Indicates the total time window currently available for logout operations; Indicates the average logout time of each target subsystem; Indicates the adjustment coefficient set based on historical execution efficiency data; the main control module follows The value of divides all target subsystems into batches and executes the deregistration calls sequentially in the batches.

6. A token lifecycle collaborative management and session synchronization control method according to claim 5, characterized in that: The main control module calculates the processing priority value in each batch of target subsystems based on the following formula And execute logouts sorted by priority value: ; in: Indicates the The processing priority value of each target subsystem; Indicates the Real-time operation load indicators of target subsystems; Indicates the Network link status indicators of each target subsystem; and Represents the first and second performance impact coefficients set based on historical performance data; the main control module is based on The deregistration calls are initiated in order from high to low values ​​until the deregistration of all target subsystems in the batch is completed.

7. A token lifecycle collaborative management and session synchronization control method according to claim 6, characterized in that: When executing batch local authority token cancellation, the main control module calculates the execution deviation value based on the actual execution time, execution success rate, network delay and link quality operation index of the previous round of batch execution, and calculates the batch quantity parameter when the execution deviation value exceeds the preset threshold. And the performance impact coefficient in the priority calculation formula and Dynamic correction is performed, and the corrected parameters are used for batch quantity calculation and intra-batch priority sorting calculation of the next batch.

8. The method for collaborative token lifecycle management and session synchronization control according to claim 1, characterized in that: The operation process of the unified communication interface includes: Identity authentication step: authenticating update and logout operation requests based on token identification and request parameters; The security verification step calculates the verification value for the authenticated operation request and compares it with the expected verification value. Only when the comparison is consistent, it is confirmed that the request has not been tampered with and maintains integrity; Abnormal retry step: when a call failure, network interruption or response timeout is detected, the corresponding operation is re-initiated according to the preset retry strategy until the maximum number of retries is reached or the target operation is completed; The implementation of the unified communication interface does not require changing the original authority control mechanism of the subsystem.

9. A token lifecycle collaborative management and session synchronization control system, characterized in that: The system comprises: A main control module is used to establish a mapping data structure, which includes a user identifier, a subsystem identifier, local authority token information and a status field, and supports encrypted storage and index retrieval based on the user identifier; An update control module is used to execute a user identity token update operation and coordinate the update of a local authority token when it is detected that the user identity token needs to be updated based on a calculation of multiple parameters such as token expiration time, network delay, processing delay, and running status, and to update the corresponding relationship in the mapping data structure; The deregistration control module is used to control multiple subsystems to execute local authority token deregistration based on the corresponding relationship in the mapping data structure and the dynamically calculated batch number and the target priority order within the batch upon receiving a global deregistration request, and delete the associated information in the mapping data structure after all deregistrations are completed; The communication interface module is used to complete user identity token update operations, local authority token update operations and logout operations, and has identity authentication, verification value comparison and exception retry mechanisms.

10. A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method for collaborative token lifecycle management and session synchronization control according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Identity management and authentication system and method based on block chain and zero knowledge proof

    CN111447073A

  • Business collaboration method and device, electronic equipment and computer readable medium

    CN118229230A

  • Multi-device cooperative control method and device, computer device and storage medium

    CN120378470A

  • Multi-user access control method and device of equipment, equipment and medium

    CN120493234A

  • Information access control method and system based on digital signature

    CN120528613A