Tourist card dynamic authorization management system and method based on multi-level agent distribution
By constructing a hierarchical network of agent nodes and a dynamic state machine, the tourism card management system achieves dynamic permission management and distributed state consistency in multi-level agent distribution scenarios, solving the security and operational efficiency problems of the existing system and improving the system's reliability and flexibility.
Patent Information
- Application Number
- CN202511406939.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-29
- Publication Date
- 2026-01-13
- Estimated Expiration
- 2045-09-29
AI Technical Summary
Existing tourism card management systems struggle to implement dynamic access control in multi-level agent distribution scenarios, posing security risks and exhibiting low operational efficiency. They also lack effective fault tolerance and recovery mechanisms and are unable to adapt to complex distributed environments.
A hierarchical agent node network is constructed, a dynamic state machine is created for each travel card, operation permissions are verified in real time and state transition instructions are generated, and state consistency synchronization between distributed nodes is achieved through asynchronous transmission and a state fusion algorithm based on operation sequence.
It enables sophisticated security control and efficient status management in multi-level agent distribution environments, ensuring data consistency in the event of network partitions and node anomalies, thereby improving operational efficiency and reliability.
Smart Images

Figure CN120915841B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of tourism information service technology, specifically to a dynamic authorization management system and method for tourism cards based on multi-level agent distribution. Background Technology
[0002] With the rapid development of the tourism industry and the continuous improvement of informatization, tourism all-in-one cards, as a convenient tourism service model, are gradually being promoted and applied in various regions. Traditional tourism card management systems typically adopt a centralized architecture, managing card issuance, authorization, and redemption through a single platform. However, with the expansion of business scale and the diversification of market demands, this centralized management model has gradually exposed many limitations: on the one hand, the system struggles to support the flexible expansion of multi-level distribution agent systems, and the blurred boundaries of permissions for agents at different levels easily lead to unauthorized operations and management chaos; on the other hand, existing systems lack effective coordination mechanisms for concurrent operations in a distributed environment. When the network is unstable or data conflicts exist between nodes, manual intervention is often required to restore data consistency, resulting in low operational efficiency and a high error rate.
[0003] Furthermore, existing travel card management systems typically employ static permission allocation, failing to dynamically adjust permissions based on card status and operational context. In complex multi-level agent distribution scenarios, this coarse-grained permission control method struggles to meet the demands of refined management, posing security risks and limiting business flexibility. Simultaneously, traditional systems lack effective fault tolerance and recovery mechanisms when facing unexpected situations such as network anomalies or device offline, easily leading to data inconsistencies and business interruptions.
[0004] In the field of distributed systems, while existing technologies provide basic solutions such as data synchronization and conflict resolution, these solutions often lack deep adaptation to the specific business scenarios of the tourism industry. Especially when dealing with complex business logic involving multi-level agents, dynamic authorization, and state management, existing technologies struggle to achieve granular access control and reliable data consistency management while ensuring system performance. Therefore, there is an urgent need for a tourism card management system that can adapt to multi-level agent distribution models, support dynamic access management, and possess distributed collaboration capabilities to address the issues of insufficient scalability, inadequate security, and poor reliability in existing technologies. Summary of the Invention
[0005] The purpose of this invention is to provide a dynamic authorization management system and method for travel cards based on multi-level agent distribution, so as to solve the problems mentioned above.
[0006] The objective of this invention can be achieved through the following technical solutions:
[0007] The dynamic authorization management method for travel cards based on multi-level agent distribution includes the following steps:
[0008] S1. Construct a hierarchical agent node network and create a dynamic state machine for each travel card, which includes the current state, the identifier of the agent node to which it belongs, and the set of operation permissions.
[0009] S2, based on the current state and operation permission set of the dynamic state machine, verify the operation permission in real time and generate state transition instructions. The operation request includes card opening, transfer, cancellation or card return operations.
[0010] S3 executes state transition instructions, updates the state of the dynamic state machine, and generates an instruction log with timing markers and operation context information, which is then asynchronously transmitted to the central server.
[0011] S4 performs conflict detection based on the time sequence markings of the instruction logs of each agent node, and uses a state fusion algorithm based on operation sequences to achieve state consistency synchronization among distributed nodes.
[0012] As a further aspect of the present invention: the construction of a proxy node network with hierarchical relationships specifically includes:
[0013] Generate a unique identifier for each agent node;
[0014] Establish bidirectional associations between proxy nodes, maintain a set of identifiers for each proxy node's direct superior proxy node and all subordinate proxy nodes, forming a tree-like topology with permission inheritance characteristics;
[0015] Configure an operation permission template corresponding to its hierarchical position for each agent node. Higher-level agent nodes automatically inherit all operation permissions of lower-level agent nodes and additionally enjoy advanced permissions for resource allocation and permission granting.
[0016] As a further aspect of the present invention: the creation process of the dynamic state machine is as follows:
[0017] When the travel card is initialized, a dynamic state machine instance is created, the dynamic state machine is bound to a specific node in the agent node network, and the corresponding set of operation permissions for the corresponding node is loaded.
[0018] Construct a state transition rule base, which defines a state transition matrix. The state transition matrix contains a multi-dimensional correspondence between the starting state, the target state, the trigger operation type, and the required permission level.
[0019] Implement real-time status monitoring, listen for operation requests through an event-driven architecture, and dynamically match status transition rules based on the current status identifier and the permission level of the requesting node;
[0020] A transactional log recording method is adopted to persistently store the complete context information of each state transition, including the state values before and after the operation, the operation node identifier, and the timestamp information.
[0021] As a further aspect of the present invention: the real-time verification of operation permissions and generation of state transition instructions specifically includes:
[0022] Upon receiving an operation request, immediately query the current state value and operation permission set stored in the dynamic state machine, and simultaneously obtain the permission level of the proxy node that initiated the request in its network layer.
[0023] The operation request type, current status value, and request node permission level are used as input parameters to perform multi-dimensional matching and verification with a predefined state transition rule base. The rule base defines the legal operation sequences that nodes with different permission levels can execute under different states.
[0024] When a match is successful, a state transition instruction containing the target state value, the permission verification result, and a timestamp is generated. The state transition instruction also carries operation context information for subsequent traceability.
[0025] When a match fails, an operation rejection instruction is generated and a detailed reason for the failure is recorded.
[0026] As a further aspect of the present invention: the execution of the state transition instruction to update the state of the dynamic state machine specifically includes:
[0027] Execute state transition instructions to synchronize the current state value and the identifier of the agent node in the dynamic state machine within a single transaction, ensuring the indivisibility of state transitions;
[0028] A structured instruction log is generated, which includes a comparison of the state before and after the operation, a complete time sequence mark, operation context information, and a digital digest value. The time sequence mark is generated using a hierarchical concatenated time encoding mechanism.
[0029] Establish a log buffer queue, sort the generated command logs by priority, and temporarily store them in the local persistent storage area;
[0030] When log persistence fails, the state recovery process is automatically triggered, and the dynamic state machine is rolled back to the stable state before the transition.
[0031] As a further aspect of the present invention: the asynchronous transmission of the instruction log to the central server specifically includes:
[0032] A dual-channel transmission link is created. The main channel uses incremental synchronization to transmit real-time generated command logs, while the backup channel uses batch compression to transmit backlogged log data.
[0033] Continuously monitor network connection quality, enable full log transmission mode in high bandwidth environments, and switch to differential transmission mode in weak network environments;
[0034] Establish a multi-level log reception verification system on the central server side. First, verify the integrity of the logs; second, verify the continuity of the time sequence markers; and finally, verify the correctness of the digital digest values.
[0035] When log transmission is interrupted, the breakpoint resumption mechanism is automatically enabled, and the start position of the resumption is located based on the last confirmed log sequence mark.
[0036] As a further aspect of the present invention: the conflict detection based on the timing markers of the instruction logs of each agent node specifically includes:
[0037] By comparing the timing markers, operation types, and state transition paths in the instruction logs from different agent nodes, it is possible to identify whether there are operation sequence conflicts.
[0038] Analyze the business context information of conflicting operations, and perform preliminary conflict classification based on operation type weight and proxy node hierarchy priority rules;
[0039] Send conflicting instruction logs to the relevant proxy nodes for cross-validation and obtain the operation confirmation status of each node;
[0040] Generate conflict reports and mark conflict operation sequences to provide a basis for state coordination decisions, while retaining the original log records of all conflict operations.
[0041] As a further aspect of the present invention: the state fusion algorithm based on operation sequences achieves state consistency synchronization among distributed nodes, specifically including:
[0042] The conflicting operation logs are reordered according to the time sequence markers to generate a global operation sequence that conforms to the business logic;
[0043] Based on the priority of operation type, the permission level of proxy node, and business rule constraints, the rationality of the reorganized operation sequence is verified;
[0044] The state transition operations are executed step by step according to the reorganized operation sequence, and the state consistency is verified after each transition.
[0045] Once all nodes reach a consistent state, a synchronization completion confirmation is sent to the relevant agent nodes, and the global state version number is updated.
[0046] A dynamic authorization management system for travel cards based on multi-level agent distribution includes:
[0047] The agent node network and state machine management module is used to construct an agent node network with hierarchical relationships and create a dynamic state machine for each travel card, which includes the current state, the identifier of the agent node to which it belongs, and the set of operation permissions.
[0048] The permission verification and instruction generation module verifies operation permissions and generates state transition instructions in real time based on the current state of the dynamic state machine and the set of operation permissions. The operation requests include card opening, transfer, cancellation or card return operations.
[0049] The state transition execution and log management module is used to execute state transition instructions, update the state of the dynamic state machine, generate instruction logs with timing markers and operation context information, and asynchronously transmit the instruction logs to the central server.
[0050] The distributed state synchronization and conflict handling module performs conflict detection based on the time sequence markers of the instruction logs of each agent node, and uses a state fusion algorithm based on operation sequences to achieve state consistency synchronization among distributed nodes.
[0051] The beneficial effects of this invention are:
[0052] (1) This invention constructs a network of agent nodes with strict hierarchical relationships, creating a dynamic state machine that integrates status identifiers, node affiliation, and operation permissions for each travel card, thus achieving a three-dimensional precise mapping of permission management. The system uses a real-time rule engine for multi-dimensional permission verification, strictly defining the executable operation sequences of nodes at each level under different card states through a state transition rule base, ensuring that each operation request must pass multiple matching verifications of node permission level, card state, and operation type. This rule-driven dynamic authorization mechanism not only effectively prevents unauthorized access and illegal operations, but also realizes a paradigm shift from static permission allocation to dynamic permission verification, enabling the system to maintain refined security control and high-precision state management in complex multi-level distribution environments.
[0053] (2) This invention constructs a structured instruction log system with time-series markers and operation contexts, employs a dual-channel asynchronous transmission mechanism to ensure reliable log data transmission, and achieves intelligent distributed coordination based on a multi-dimensional conflict detection model and an operation sequence state fusion algorithm. Specifically, the system generates globally sortable time-series markers through a hierarchical concatenated time coding mechanism, and establishes conflict classification rules by combining operation type weights and node hierarchy priorities. When an operation sequence conflict is detected, a global operation sequence conforming to business logic is generated through business context analysis, node cross-validation, and sequence reassembly techniques. Finally, a progressive state synchronization strategy is adopted to gradually achieve a consistent state among distributed nodes while ensuring the atomicity of operations. This synchronization mechanism based on log-driven and rule fusion ensures the eventual consistency of data in the event of network partitioning and node anomalies, realizing a technological leap from passive conflict handling to proactive state coordination. Attached Figure Description
[0054] The invention will now be further described with reference to the accompanying drawings.
[0055] Figure 1 This is a flowchart of the method of the present invention;
[0056] Figure 2 This is a flowchart of the system in this invention. Detailed Implementation
[0057] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0058] Please see Figure 1 As shown, this invention is a dynamic authorization management method for travel cards based on multi-level agent distribution, including the following steps:
[0059] S1. Construct a hierarchical agent node network and create a dynamic state machine for each travel card, which includes the current state, the identifier of the agent node to which it belongs, and the set of operation permissions.
[0060] S2, based on the current state and operation permission set of the dynamic state machine, verify the operation permission in real time and generate state transition instructions. The operation request includes card opening, transfer, cancellation or card return operations.
[0061] S3 executes state transition instructions, updates the state of the dynamic state machine, and generates an instruction log with timing markers and operation context information, which is then asynchronously transmitted to the central server.
[0062] S4 performs conflict detection based on the time sequence markings of the instruction logs of each agent node, and uses a state fusion algorithm based on operation sequences to achieve state consistency synchronization among distributed nodes.
[0063] In S1, a hierarchical agent node network is constructed, and a dynamic state machine is created for each travel card, containing its current state, the identifier of its agent node, and a set of operation permissions. Specifically, this includes:
[0064] The construction of the proxy node network begins with node identifier generation. Each proxy node is assigned a unique identifier, generated using a variable-length numeric sequence encoding mechanism. The sequence length represents the node's depth in the hierarchical structure, while the numerical content of the sequence represents the node's unique number within its respective hierarchy. This encoding method intuitively reflects the node's positional relationship in the network topology and provides fundamental support for subsequent permission inheritance and path tracing.
[0065] After configuring node identifiers, it is necessary to establish the relationships between nodes. A recursive traversal algorithm is used to construct bidirectional links between agent nodes, maintaining a set of identifiers for each node's direct parent node and all its child nodes. This process forms a tree-like topology with clear parent-child relationships, where the root node represents the highest-level agency and the leaf nodes represent the lowest-level sales terminals. This topology has inherent permission inheritance characteristics, allowing lower-level nodes to automatically acquire some or all of the operational permissions of their parent nodes.
[0066] Node permission configuration is a crucial step in network construction. Based on each agent node's hierarchical position in the tree topology, a corresponding operation permission template is configured for it. The permission template adopts a hierarchical design principle, with higher-level nodes automatically inheriting the operation permissions of all their lower-level child nodes, while also enjoying advanced management permissions for resource allocation and permission granting. This design ensures the standardization and consistency of permission management while maintaining flexibility for expansion.
[0067] The creation of the dynamic state machine begins during the initialization phase of the travel card. When a new travel card enters the system, an independent state machine instance is created for it. This state machine instance is bound to a specific node in the agent node network and loads the set of operation permissions corresponding to that node. The state machine instance contains the travel card's current state value, its agent node identifier, and a list of executable operation permissions; these elements together constitute the core data of the state machine.
[0068] The construction of a state transition rule base is fundamental to ensuring the correct operation of the state machine. The rule base defines a state transition matrix, which stores the correspondence between the initial state, target state, triggering operation type, and required permission level in a multi-dimensional table structure. Each state transition rule explicitly specifies which operations a proxy node with what permission level can perform in a given state, and how this leads to state transitions. This design makes the state transition process predictable and verifiable.
[0069] Real-time status monitoring is implemented using an event-driven architecture. The system continuously listens for various operation requests. When an operation request is received, it immediately obtains the current state value of the state machine and the permission level of the requesting node. By querying the state transition rule base, it verifies whether the node has the permission to execute the requested operation in the current state. This process ensures that all operations are performed within the predefined rules, effectively preventing unauthorized operations.
[0070] The state transition process is recorded using a transactional log. Each time a state transition occurs, the system generates a detailed log entry, including the state value changes before and after the operation, the node identifier that performed the operation, the timestamp of the operation, and relevant context information. These logs are stored in a structured format to ensure data integrity and traceability. The logging process and the state transition operation are completed within the same transaction, guaranteeing consistency between the logs and the state.
[0071] The persistent log storage employs a reliable storage mechanism. All operation logs are written to the persistent storage device, and an append-only write method is used to ensure data integrity. Log records include a digital digest value for subsequent data verification and integrity validation. The system periodically archives and cleans up the logs, ensuring storage efficiency while maintaining necessary historical records.
[0072] The state machine's recovery mechanism ensures system reliability. When a system anomaly occurs or recovery is needed, the state machine's historical state can be reconstructed by replaying the operation logs. The operation context information recorded in the logs provides sufficient evidence for state reconstruction, enabling the state machine to recover to the accurate state at any historical point in time.
[0073] The permission verification process is integrated into the status monitoring stage. When an operation request arrives, the system not only verifies whether the current status allows the operation, but also verifies whether the requesting node has the necessary permission level to execute the operation. This dual verification mechanism ensures system security and data consistency.
[0074] State transitions are executed atomically. Each state transition operation is an indivisible unit that either succeeds completely or completely reverts to the state before the operation. This design prevents the state machine from entering intermediate or inconsistent states, ensuring the data integrity of the system.
[0075] Network topology maintenance includes regular consistency checks. The system monitors the online status of each node through a heartbeat mechanism and updates the topology information in a timely manner. When a change in node relationships is detected, a process of recalculating and reassigning permissions is automatically triggered to ensure that permission management is consistent with the actual network topology.
[0076] The state machine's version management mechanism supports system evolution. When business rules change, the system can be upgraded by updating the state transition rule base without modifying the core state machine logic. This design improves the system's maintainability and scalability.
[0077] Finally, the system provides comprehensive monitoring and auditing capabilities. All state transitions and permission changes are recorded in detail for subsequent querying and analysis. These records provide reliable data support for system operation monitoring, troubleshooting, and business auditing.
[0078] In S2, based on the current state of the dynamic state machine and the set of operation permissions, operation permissions are verified in real time and state transition instructions are generated. The operation requests include card opening, transfer, cancellation, or card return operations, specifically including:
[0079] The operation permission verification process begins with the request reception phase. When the system receives an operation request from a proxy node, it immediately initiates the request parsing process. This process first extracts key parameters from the request, including the operation type identifier, the target travel card identifier, and the authentication information of the requesting node. The system also records the precise timestamp of request reception, providing a time basis for subsequent audit trails. After request parsing is complete, the system proceeds to the permission verification phase.
[0080] During the permission verification phase, the system queries the corresponding dynamic state machine instance based on the travel card identifier in the request. It retrieves the current state value and the set of operation permissions associated with that state machine. Simultaneously, based on the requesting node's identity information, the system queries its hierarchical position and corresponding permission level within the proxy node network. This step ensures that the system can make a comprehensive judgment based on both the current state of the travel card and the permission characteristics of the requesting node.
[0081] Multidimensional matching verification is the core of permission verification. The system takes the operation request type, the current state value of the state machine, and the permission level of the requesting node as input parameters and performs a matching query against a predefined state transition rule base. The state transition rule base is stored in a table structure, where each record defines the operation type that a node with a certain permission level can perform and the corresponding target state under a specific state. The matching process adopts a complete match principle; a match is considered successful only when all input parameters are completely consistent with a record in the rule base.
[0082] When the matching verification is successful, the system generates a formal state transition instruction. This instruction contains core information such as the target state value, the permission verification result, and the instruction generation timestamp. Simultaneously, the instruction also carries complete operation context information, including the detailed identifier of the requesting node, the original operation request content, and the record identifier of the matching rule. This context information provides ample data support for subsequent operation tracing and troubleshooting. After the instruction is generated, it will be placed in the pending instruction queue for processing.
[0083] If the matching verification fails, the system will generate an operation rejection instruction. The rejection instruction details the specific reasons for the failure, which are categorized and coded. Common failure reasons include insufficient permissions, state conflicts, and rule validation failures. Each failure type corresponds to a specific error code and descriptive information, which helps the requesting node understand the specific reason for the operation being rejected and take appropriate corrective measures.
[0084] The system also implements a robust exception handling mechanism. When a system-level exception occurs during the authorization verification process, such as a failure to access the rule base or a data consistency error, the system will automatically trigger the exception handling process. This process will record detailed stack information of the exception and send an alert notification to the monitoring system. For business-level exceptions, such as incorrect parameter formats or missing identifiers, the system will generate corresponding error responses to ensure the integrity of request processing.
[0085] The authorization verification process also includes performance optimization measures. The system employs a caching mechanism for the state transition rule base, storing frequently used rules in memory to improve the efficiency of matching queries. Simultaneously, connection pooling is implemented for the authorization verification process to avoid frequent database connection operations. These optimizations ensure that the authorization verification process maintains stable response performance under high concurrency environments.
[0086] Audit logging is a crucial component of the authorization verification process. The system generates detailed audit logs for each operation request's verification process, including key information such as request content, verification parameters, matching results, and command generation details. These logs are stored in a structured format for easy subsequent querying and analysis. The logging process is synchronized with business operations, ensuring the real-time nature and accuracy of audit data.
[0087] Finally, the system provides management and maintenance functions for verification rules. Authorized administrators can update and maintain the state transition rule base through the management interface, including adding new rule records, modifying existing rules, and deactivating expired rules. All rule change operations are subject to strict access control and a complete change history is recorded to ensure the standardization and traceability of rule management. The rule base's version management mechanism supports gradual rule updates and rollback operations, ensuring the stability of system operation.
[0088] In S3, state transition instructions are executed to update the state of the dynamic state machine and generate an instruction log with timing markers and operation context information. This instruction log is then asynchronously transmitted to the central server. Specifically, this includes:
[0089] The execution of state transition instructions employs a transactional processing mechanism. Upon receiving a state transition instruction, the system first initiates a database transaction, within which relevant data in the dynamic state machine is updated. This update operation includes modifying the current state value field and the identifier field of the associated proxy node. These updates are completed within the same atomic operation, ensuring that either all updates succeed or all data remains unchanged. Exclusive locks are added to relevant data records during transaction execution to prevent data inconsistency caused by other concurrent operations. The new state value takes effect immediately after the transaction is committed, at which point the state transition operation is considered complete.
[0090] The generation of structured instruction logs is synchronized with state update operations. Before a state update transaction is committed, the system creates a structured log record. This record contains a comparison of state values before and after the operation, fully recording the process of state change. The generation of time-series markers uses a hierarchical, concatenated encoding method, consisting of three parts: server node identifier, date and timestamp, and sequence number, ensuring the global uniqueness and sortability of time-series markers in a distributed environment. Operation context information includes metadata such as request source, operation type, and execution node. A digital digest value is generated by calculating the log content using a hash algorithm, used for subsequent integrity verification.
[0091] The log buffer queue is managed using a priority-based sorting strategy. Generated instruction logs are first written to a memory buffer, assigned different priority weights according to operation type and urgency. System background processes periodically write the logs in the buffer to local persistent storage in batches according to priority. Persistent storage uses an append-only write mode to avoid the performance overhead of random writes. Log files are stored in time-segmented chunks, with each file containing all log records generated within a fixed time window, facilitating subsequent querying and archiving.
[0092] The state recovery mechanism is automatically triggered when a log persistence failure is detected. When the system detects that a log write operation returns an error or times out, it immediately rolls back the currently ongoing state update transaction, restoring the relevant data of the dynamic state machine to its state before the operation. Simultaneously, the system generates an error report, recording the specific reason and time of the persistence failure. After the recovery process is complete, the system attempts to re-execute the failed operation. If the number of retries exceeds a set threshold, the operation is marked as failed, and relevant personnel are notified for intervention.
[0093] Log transmission employs a dual-channel link design. The primary transmission channel is responsible for real-time transmission of newly generated instruction logs, using incremental synchronization to transmit only changed log content. The backup channel is used to transmit backlogged historical log data, employing batch compression to package multiple log records into a single transmission unit, improving transmission efficiency. The two channels operate independently and do not affect each other. When the primary channel fails, the system automatically switches to the backup channel to continue transmission.
[0094] The network quality awareness mechanism continuously monitors the connection status of the transmission link. The system periodically sends probe packets to the central server and assesses network quality based on response time and packet loss rate. In high-bandwidth environments, the system enables full transmission mode, transmitting logs in their original format and preserving all detailed information. When a decrease in network bandwidth or an increase in latency is detected, the system automatically switches to differential transmission mode, transmitting only necessary summary information and changes to reduce data transmission volume.
[0095] The central server employs a multi-level verification mechanism for log reception. The first level verifies the integrity of the log records, checking for corruption or loss during transmission. The second level focuses on the continuity of time stamps, ensuring that received log records maintain the correct chronological order without missing or duplicate entries. The third level checks the correctness of the digital digest value, verifying that the log content has not been tampered with by recalculating the digest and comparing it with the transmitted value. Failure at any level triggers a retransmission mechanism.
[0096] The resume function is automatically enabled when transmission is interrupted. When the network connection is unexpectedly lost, the system records the timing marker of the last successful transmission. After the connection is restored, the transmission process locates the starting point for retransmission based on the recorded timing marker and continues transmitting subsequent log records from that point. Transmission progress is periodically saved during the transmission process to avoid duplicate transmissions of successfully transmitted records. The resume mechanism supports continuity across network sessions, maintaining transmission continuity even after a system restart.
[0097] The flow control during transmission employs an adaptive adjustment strategy. The system dynamically adjusts the transmission rate based on network conditions, reducing the sending frequency when the network is congested and increasing transmission efficiency when the network is unobstructed. The size of the sending buffer is monitored in real time during transmission; when the buffer overflows beyond a threshold, flow shaping is automatically activated to smooth the sending rate and prevent network congestion.
[0098] Log transmission security is ensured through encryption and authentication mechanisms. All transmitted log records are encrypted to prevent data theft or tampering during transmission. A two-way authentication mechanism is used between the transmitting parties to ensure that only authorized nodes can participate in the log transmission process. A handshake authentication is required when establishing a transmission connection; data transmission can only begin after successful authentication.
[0099] The transmission status monitoring and statistics functions record detailed transmission metrics. The system records performance indicators such as transmission rate, success rate, and retransmission count in real time and generates statistical reports. This data is used to evaluate the operational status of the transmission system and provides a basis for capacity planning and performance optimization. The monitoring system sets alarm thresholds and issues timely alerts when transmission metrics are abnormal.
[0100] The reliability of log transmission is guaranteed by an acknowledgment mechanism. After each batch of logs is transmitted, the sender waits for an acknowledgment response from the receiver. If no acknowledgment is received within a specified time, the sender will retransmit the batch of logs. The acknowledgment mechanism uses a cumulative acknowledgment method, where the receiver acknowledges the latest consecutive time sequence marker to indicate that all logs prior to that marker have been successfully received. This mechanism reduces the number of acknowledgment messages and improves transmission efficiency.
[0101] In S4, conflict detection is performed based on the time-series markers of the instruction logs of each agent node, and a state fusion algorithm based on operation sequences is used to achieve state consistency synchronization among distributed nodes, specifically including:
[0102] The conflict detection process begins with log collection. The system periodically collects instruction logs from each distributed agent node. These logs contain complete timing markers, operation types, and state transition path information. The collected logs are stored in a temporary buffer, awaiting further processing. The log collection process uses an incremental fetching method, retrieving only newly generated log records since the last processing, reducing network transmission load and data processing volume.
[0103] A multi-dimensional conflict detection model comprehensively analyzes the collected logs. First, the model uses time-series labeling to sort all operation logs by time, establishing a timeline for the global operation sequence. Then, the system compares the operation types and state transition paths in the logs of each node to detect whether there are concurrent operations modifying the state of the same travel card. The detection process is driven by a rule engine, which identifies potential operation conflicts through a predefined set of conflict rules, including state update conflicts, permission change conflicts, and data inconsistencies.
[0104] The classification of conflicting operations is based on business context analysis. The system extracts relevant business context information about conflicting operations, including the business scenario in which the operation occurs, the business objects involved, and the intent of the operation. Different weight values are assigned according to the importance of the operation type, with critical operations such as state freezing and permission changes receiving higher weights. Simultaneously, considering the position of the proxy node in the network hierarchy, conflicting operations are initially classified according to a hierarchy priority rule, distinguishing between primary and secondary conflicts to provide a basis for subsequent processing.
[0105] Cross-validation ensures the accuracy of conflict determination. The system sends the logs of identified conflicting operations to the relevant proxy nodes for confirmation. Upon receiving the verification request, each node checks the locally recorded operation status and context information, and returns an operation confirmation status. The confirmation status includes confirmation of operation validity, confirmation of operation revocation, or suggestion of operation correction. The system collects feedback information from all relevant nodes as a reference for conflict resolution decisions.
[0106] The conflict report generation phase summarizes and analyzes the results. Based on the conflict detection and verification results, the system generates detailed conflict reports. These reports clearly identify the conflicting operation sequences, explaining the conflict type and cause. The reports also record the original log information of all conflicting operations, including the operation content, execution node, and occurrence time, providing complete context. These reports provide comprehensive decision-making support for state coordination and serve as important data for system auditing.
[0107] The state fusion algorithm first reassembles the operation sequence. The system reorders conflicting operation logs based on time sequence markers and business rules. The reassembly process considers dependencies between operations and business logic constraints, ensuring that the generated operation sequence conforms to both temporal order and business rationality. The reassembled sequence forms a globally accepted operation execution order, serving as the basis for state synchronization.
[0108] Reasonableness checks ensure the validity of the recombined sequence. The system checks the order of operations in the sequence based on operation type priority rules to ensure that high-priority operations are processed first. It also verifies the match between the proxy node's permission level and the operation to prevent unauthorized operations. Finally, an integrity check is performed on the entire sequence according to business rule constraints to ensure that all operations comply with predefined business specifications.
[0109] The state transition execution employs a progressive synchronization strategy. The system executes each state transition operation step-by-step according to the reorganized operation sequence. After each operation is completed, the system immediately verifies the state consistency of all relevant nodes to ensure that the operation is correctly applied on all nodes. If an operation fails, the system pauses the synchronization process, records the failure information, and awaits intervention.
[0110] The synchronization confirmation mechanism is triggered after the states are consistent. When the states of all nodes are consistent, the system sends a synchronization completion confirmation notification to the relevant agent nodes. The confirmation information includes the synchronized state version number and the synchronization timestamp. Upon receiving the confirmation, each node updates its locally stored global state version number, signifying the successful completion of the state synchronization process. Version number management uses a monotonically increasing method to ensure the global uniqueness and comparability of version identifiers.
[0111] An exception handling mechanism is implemented during synchronization. When a synchronization failure or inconsistency is detected, the system automatically records the exception details and triggers a retry mechanism. The retry process employs an exponential backoff strategy, gradually increasing the retry interval. If the number of retries exceeds a threshold, the system reports the exception to the monitoring system for administrator intervention.
[0112] Performance optimization for state synchronization is achieved through batch processing. The system merges multiple operations into batches for processing, reducing network communication overhead and the number of database operations. The batch size is dynamically adjusted based on network conditions and system load, improving processing efficiency while ensuring real-time performance. Batch processing also employs a pipelined approach, allowing operations from different batches to be executed concurrently, further increasing throughput.
[0113] The synchronization results are verified using a sampling inspection method. The system periodically and randomly selects a portion of nodes for state consistency checks, verifying the synchronization effect by comparing key state fields. Sampling inspection ensures the reliability of the verification while avoiding the performance overhead of performing a full inspection of all nodes. The inspection results are recorded in the monitoring log to evaluate the operational status of the synchronization system.
[0114] Finally, the system provides visual monitoring of the synchronization process. Administrators can view real-time synchronization status, conflict resolution progress, and system performance metrics through the monitoring interface. Monitoring data includes key indicators such as synchronization latency, conflict occurrence rate, and conflict resolution success rate. This data helps administrators understand the system's operational status and promptly identify potential problems. The monitoring interface also provides historical data query and analysis functions, supporting system performance optimization and capacity planning.
[0115] Please see Figure 2 As shown, the dynamic authorization management system for travel cards based on multi-level agent distribution includes:
[0116] The agent node network and state machine management module is used to construct an agent node network with hierarchical relationships and create a dynamic state machine for each travel card, which includes the current state, the identifier of the agent node to which it belongs, and the set of operation permissions.
[0117] The permission verification and instruction generation module verifies operation permissions and generates state transition instructions in real time based on the current state of the dynamic state machine and the set of operation permissions. The operation requests include card opening, transfer, cancellation or card return operations.
[0118] The state transition execution and log management module is used to execute state transition instructions, update the state of the dynamic state machine, generate instruction logs with timing markers and operation context information, and asynchronously transmit the instruction logs to the central server.
[0119] The distributed state synchronization and conflict handling module performs conflict detection based on the time sequence markers of the instruction logs of each agent node, and uses a state fusion algorithm based on operation sequences to achieve state consistency synchronization among distributed nodes.
[0120] The working principle of this invention is as follows: A hierarchical agent node network is constructed, and a dynamic state machine is created for each travel card, containing its current state, the identifier of its agent node, and a set of operational permissions. Then, based on the current state and operational permission set of the dynamic state machine, operational permissions are verified in real time, and state transition instructions are generated. Next, the state transition instructions are executed to update the dynamic state machine state, and an instruction log with timing markers and operational context information is generated and transmitted asynchronously. Finally, conflict detection is performed based on the timing markers of the instruction logs of each agent node, and a state fusion algorithm based on operational sequences is used to achieve state consistency synchronization among distributed nodes. The corresponding system includes an agent node network and state machine management module, a permission verification and instruction generation module, a state transition execution and log management module, and a distributed state synchronization and conflict handling module. These modules work together to complete the dynamic authorization management and state synchronization of travel cards.
[0121] The foregoing has provided a detailed description of one embodiment of the present invention, but this description is merely a preferred embodiment and should not be construed as limiting the scope of the invention. All equivalent variations and modifications made within the scope of the claims of this invention should still fall within the patent coverage of this invention.
Claims
1. A dynamic authorization management method for travel cards based on multi-level agent distribution, characterized in that, Includes the following steps: S1. Construct a hierarchical agent node network and create a dynamic state machine for each travel card, which includes the current state, the identifier of the agent node to which it belongs, and the set of operation permissions. S2, based on the current state and operation permission set of the dynamic state machine, verifies operation permissions in real time and generates state transition instructions. Specifically, the real-time verification of operation permissions and generation of state transition instructions includes: Upon receiving an operation request, immediately query the current state value and operation permission set stored in the dynamic state machine, and simultaneously obtain the permission level of the proxy node that initiated the request in its network layer. The operation requests include card activation, transfer, cancellation, or card refund operations; The operation request type, current status value, and request node permission level are used as input parameters to perform multi-dimensional matching and verification with a predefined state transition rule base. The state transition rule base defines the legal operation sequences that can be executed by nodes of each permission level under different states. When a match is successful, a state transition instruction containing the target state value, the permission verification result, and a timestamp is generated. The state transition instruction also carries operation context information for subsequent traceability. When a match fails, an operation rejection instruction is generated and a detailed reason for the failure is recorded. S3 executes state transition instructions, updates the state of the dynamic state machine, and generates an instruction log with timing markers and operation context information, which is then asynchronously transmitted to the central server. S4. Conflict detection is performed based on the time sequence markings of the instruction logs of each agent node, and a state fusion algorithm based on operation sequences is used to achieve state consistency synchronization among distributed nodes. The state fusion algorithm based on operation sequences achieves state consistency synchronization among distributed nodes, specifically including: The conflicting operation logs are reordered according to the time sequence markers to generate a global operation sequence that conforms to the business logic; Based on the priority of operation type, the permission level of proxy node, and business rule constraints, the rationality of the reorganized operation sequence is verified; The state transition operations are executed step by step according to the reorganized operation sequence, and the state consistency is verified after each transition. Once all nodes reach a consistent state, a synchronization completion confirmation is sent to the relevant agent nodes, and the global state version number is updated.
2. The dynamic authorization management method for travel cards based on multi-level agent distribution according to claim 1, characterized in that, The construction of a hierarchical proxy node network specifically includes: Generate a unique identifier for each agent node; Establish bidirectional associations between proxy nodes, maintain a set of identifiers for each proxy node's direct superior proxy node and all subordinate proxy nodes, forming a tree-like topology with permission inheritance characteristics; Configure an operation permission template corresponding to its hierarchical position for each agent node. Higher-level agent nodes automatically inherit all operation permissions of lower-level agent nodes and additionally enjoy advanced permissions for resource allocation and permission granting.
3. The dynamic authorization management method for travel cards based on multi-level agent distribution according to claim 1, characterized in that, The creation process of the dynamic state machine is as follows: When the travel card is initialized, a dynamic state machine instance is created, the dynamic state machine is bound to a specific node in the agent node network, and the corresponding set of operation permissions for the corresponding node is loaded. Construct a state transition rule base, which defines a state transition matrix. The state transition matrix contains a multi-dimensional correspondence between the starting state, the target state, the trigger operation type, and the required permission level. Implement real-time status monitoring, listen for operation requests through an event-driven architecture, and dynamically match status transition rules based on the current status identifier and the permission level of the requesting node; A transactional log recording method is adopted to persistently store the complete context information of each state transition, including the state values before and after the operation, the operation node identifier, and the timestamp information.
4. The dynamic authorization management method for travel cards based on multi-level agent distribution according to claim 1, characterized in that, The execution of the state transition instruction, updating the state of the dynamic state machine, specifically includes: Execute state transition instructions to synchronize the current state value and the identifier of the agent node in the dynamic state machine within a single transaction, ensuring the indivisibility of state transitions; A structured instruction log is generated, which includes a comparison of the state before and after the operation, a complete time sequence mark, operation context information, and a digital digest value. The time sequence mark is generated using a hierarchical concatenated time encoding mechanism. Establish a log buffer queue, sort the generated command logs by priority, and temporarily store them in the local persistent storage area; When log persistence fails, the state recovery process is automatically triggered, and the dynamic state machine is rolled back to the stable state before the transition.
5. The dynamic authorization management method for travel cards based on multi-level agent distribution according to claim 1, characterized in that, The asynchronous transmission of instruction logs to the central server specifically includes: A dual-channel transmission link is created. The main channel uses incremental synchronization to transmit real-time generated command logs, while the backup channel uses batch compression to transmit backlogged log data. Continuously monitor network connection quality, enable full log transmission mode in high bandwidth environments, and switch to differential transmission mode in weak network environments; Establish a multi-level log reception verification system on the central server side. First, verify the integrity of the logs; second, verify the continuity of the time sequence markers; and finally, verify the correctness of the digital digest values. When log transmission is interrupted, the breakpoint resumption mechanism is automatically enabled, and the start position of the resumption is located based on the last confirmed log sequence mark.
6. The dynamic authorization management method for travel cards based on multi-level agent distribution according to claim 1, characterized in that, The conflict detection based on the time-series markers of the instruction logs of each agent node specifically includes: By comparing the timing markers, operation types, and state transition paths in the instruction logs from different agent nodes, it is possible to identify whether there are operation sequence conflicts. Analyze the business context information of conflicting operations, and perform preliminary conflict classification based on operation type weight and proxy node hierarchy priority rules; Send conflicting instruction logs to the relevant proxy nodes for cross-validation and obtain the operation confirmation status of each node; Generate conflict reports and mark conflict operation sequences to provide a basis for state coordination decisions, while retaining the original log records of all conflict operations.
7. A dynamic authorization management system for travel cards based on multi-level agent distribution, characterized in that, The method for implementing the dynamic authorization management of travel cards based on multi-level agent distribution as described in any one of claims 1-6 includes: The agent node network and state machine management module is used to construct an agent node network with hierarchical relationships and create a dynamic state machine for each travel card, which includes the current state, the identifier of the agent node to which it belongs, and a set of operation permissions. The permission verification and instruction generation module verifies operation permissions and generates state transition instructions in real time based on the current state of the dynamic state machine and the set of operation permissions. The operation requests include card opening, transfer, cancellation or card return operations. The state transition execution and log management module is used to execute state transition instructions, update the state of the dynamic state machine, generate instruction logs with timing markers and operation context information, and asynchronously transmit the instruction logs to the central server. The distributed state synchronization and conflict handling module performs conflict detection based on the time sequence markers of the instruction logs of each agent node, and uses a state fusion algorithm based on operation sequences to achieve state consistency synchronization among distributed nodes.
Citation Information
Patent Citations
Integration system and method of network application nodes
CN108111334A
Selective point-of-sale terminal for reconciling order state under non-persistent connection conditions
US20190303897A1