Tourism card dynamic authorization management system and method based on multistage agent distribution
By constructing a hierarchical network of agent nodes and a dynamic state machine, real-time authorization verification, and the adoption of a state fusion algorithm, the problems of access control and data consistency in multi-level agent distribution are solved, achieving efficient, secure, and reliable dynamic authorization management for the tourism card management system.
Patent Information
- Application Number
- CN202511406939.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-29
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2045-09-29
AI Technical Summary
Existing tourism card management systems struggle to achieve sophisticated access control and data consistency management in multi-level agent distribution scenarios, and lack effective fault tolerance and recovery mechanisms, resulting in low operational efficiency and security risks.
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, instruction logs are transmitted through a dual-channel transmission mechanism, and a state fusion algorithm based on operation sequence is used to achieve state consistency synchronization among distributed nodes.
It enables sophisticated security control and high-precision status management in a multi-level agent distribution environment, ensuring data consistency and system reliability, and improving operational efficiency and resistance to network anomalies.
Smart Images

Figure CN120915841A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of tourism information service, in particular to a tourism card dynamic authorization management system and method based on multi-level agent distribution. BACKGROUND
[0002] With the rapid development of the tourism industry and the continuous improvement of the information level, tourism card as a convenient tourism service mode is gradually popularized and applied in various places. The traditional tourism card management system usually adopts a centralized architecture, and card issuance, authorization and cancellation management are carried out through a single platform. However, with the expansion of business scale and the diversification of market demand, this centralized management mode gradually exposes many limitations: on the one hand, the system is difficult to support the flexible expansion of multi-level distribution agent system, and the permission boundary of different level agents is fuzzy, which easily leads to overstepping operation and management confusion; on the other hand, the existing system lacks effective coordination mechanism for concurrent operation in distributed environment, and when there is network instability or data conflict between nodes, manual intervention is often needed to restore data consistency, resulting in low operation efficiency and high error rate.
[0003] In addition, the existing tourism card management system usually adopts static permission allocation mode, which cannot adjust the dynamic permission according to the card state and operation context. In the complex multi-level agent distribution scene, this coarse-grained permission control method cannot meet the fine management demand, which not only has security risks, but also limits the business flexibility. At the same time, the traditional system lacks effective fault tolerance and recovery mechanism when facing network anomalies, device offline and other sudden conditions, which easily leads to data inconsistency and business interruption.
[0004] In the field of distributed systems, although the existing technology provides basic solutions such as data synchronization and conflict resolution, these solutions often lack deep adaptation to specific business scenarios in the tourism industry. Especially in the complex business logic involving multi-level agents, dynamic authorization and state management, the existing technology is difficult to realize fine-grained permission 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 mode, support dynamic permission management and have distributed collaboration capability, to solve the problems of insufficient scalability, lack of security and poor reliability in the existing technology. SUMMARY
[0005] The purpose of the present application is to provide a tourism card dynamic authorization management system and method based on multi-level agent distribution to solve the problems in the above background.
[0006] The purpose of the present application can be realized by the following technical solutions: The tourism card dynamic authorization management method based on multi-level agent distribution comprises the following steps: S1, a proxy node network with hierarchical association relationship is constructed, and a dynamic state machine including a current state, a proxy node identifier and an operation permission set is created for each travel card; S2, based on the current state and the operation permission set of the dynamic state machine, the operation permission is verified in real time, and a state conversion instruction is generated, the operation request including card opening, transfer, cancellation or card return operation; S3, the state conversion instruction is executed, the state of the dynamic state machine is updated, and an instruction log with time sequence mark and operation context information is generated, and the instruction log is transmitted to the center server asynchronously; S4, based on the time sequence mark of the instruction log of each proxy node, conflict detection is performed, and a state fusion algorithm based on operation sequence is used to realize the state consistency synchronization between distributed nodes.
[0007] As a further scheme of the application: the construction of the proxy node network with hierarchical association relationship specifically comprises: A unique identifier is generated for each proxy node; A bidirectional association relationship between the proxy nodes is established, and the identifier set of the direct superior proxy node and all subordinate proxy nodes is maintained for each proxy node, forming a tree topology structure with permission inheritance characteristics; Each proxy node is configured with an operation permission template corresponding to its hierarchical position, wherein the high-level proxy node automatically inherits all operation permissions of the low-level proxy node, and additionally enjoys high-level permissions of resource allocation and permission granting.
[0008] As a further scheme of the application: the creation process of the dynamic state machine comprises: A dynamic state machine instance is established when the travel card is initialized, the dynamic state machine is bound to a specific node in the proxy node network, and the corresponding operation permission set of the corresponding node is loaded; A state conversion rule library is constructed, wherein a state conversion matrix is defined, the state conversion matrix including a multi-dimensional correspondence relationship of starting state, target state, trigger operation type and required permission level; Real-time state monitoring is implemented, the operation request is listened to through an event-driven architecture, and the state conversion rule is dynamically matched based on the current state identifier and the permission level of the request node; A transactional log recording method is used, and the complete context information of each state conversion including the state values before and after operation, operation node identifier and timestamp information is persistently stored.
[0009] As a further scheme of the application: the real-time verification of operation permission and the generation of state conversion instruction specifically comprises: After receiving the operation request, the current state value and the operation permission set stored in the dynamic state machine are inquired immediately, and the permission level of the agent node initiating the request in its network level is acquired; The operation request type, the current state value, and the request node permission level are taken as input parameters, and a multi-dimensional matching verification is performed on a predefined state transition rule library, which defines the legal operation sequence executable by nodes of different permission levels in different states; When the matching is successful, a state transition instruction containing the target state value, the permission verification result, and the timestamp is generated, and the state transition instruction carries operation context information for subsequent tracing; When the matching fails, an operation rejection instruction is generated, and the detailed failure reason is recorded.
[0010] As a further scheme of the application, the execution state transition instruction updates the state of the dynamic state machine, specifically including: The state transition instruction is executed, and the synchronous update of the current state value in the dynamic state machine and the identifier of the agent node is completed within a single transaction, ensuring the indivisibility of state transition; A structured instruction log is generated, which contains the state comparison before and after operation, complete time sequence marking, operation context information, and a digital digest value, wherein the time sequence marking is generated by using a hierarchical cascading time coding mechanism; A log buffer queue is established, and the generated instruction log is temporarily stored in the local persistent storage area after being sorted by priority; When the log persistence fails, a state recovery process is automatically triggered, and the dynamic state machine is rolled back to the stable state before the transition.
[0011] As a further scheme of the application, the instruction log is transmitted asynchronously to the center server, specifically including: A dual-channel transmission link is created, the main channel uses an incremental synchronization method to transmit the instruction log generated in real time, and the standby channel uses a batch compression method to transmit the accumulated log data; The network connection quality is continuously monitored, and the complete log transmission mode is enabled in a high-bandwidth environment, and the differential amount transmission mode is switched to in a weak network environment; A multi-level log receiving and checking is established at the center server end, which first verifies the integrity of the log, then checks the continuity of the time sequence marking, and finally checks the correctness of the digital digest value; When the log transmission is interrupted, the breakpoint resume mechanism is automatically enabled, and the resume starting position is located based on the last confirmed log time sequence marking.
[0012] As a further scheme of the application, the time sequence marking of the instruction log of each agent node is used for conflict detection, specifically including: By comparing the time markers, operation types and state transition paths in the instruction logs from different agent nodes, it is identified whether there is an operation sequence conflict; The business context information of the conflict operation is analyzed, and preliminary conflict classification is performed according to the operation type weight and agent node level priority rule; The instruction logs with conflicts are sent to the relevant agent nodes for cross verification to obtain the operation confirmation state of each node; A conflict report is generated and the conflict operation sequence is marked, which provides a decision basis for state coordination, while retaining the original log records of all conflict operations.
[0013] As a further scheme of the application: the state fusion algorithm based on operation sequence realizes state consistency synchronization between distributed nodes, specifically including: The conflicting operation logs are reordered according to the time markers to generate a global operation sequence that conforms to the business logic; Based on the operation type priority, agent node permission level and business rule constraints, the reorganized operation sequence is reasonably checked; The state transition operation is gradually executed according to the sequence of the reorganized operation sequence, and the state consistency is verified after each step of conversion; When all node states reach consistency, a synchronization completion confirmation is sent to the relevant agent nodes, and the global state version number is updated.
[0014] The tourism card dynamic authorization management system based on multi-level agent distribution includes: The agent node network and state machine management module is used to build an agent node network with hierarchical association relationship, and a dynamic state machine containing the current state, the identification of the agent node to which the tourism card belongs and the operation permission set is created for each tourism card; The permission verification and instruction generation module is used to verify the operation permission in real time and generate state transition instructions based on the current state and operation permission set of the dynamic state machine, and the operation request includes opening a card, transferring, canceling or returning a card operation; The state transition execution and log management module is used to execute the state transition instruction, update the state of the dynamic state machine, and generate an instruction log with a time marker and operation context information, and the instruction log is transmitted to the center server asynchronously; The distributed state synchronization and conflict processing module is used for conflict detection based on the time markers of the instruction logs of each agent node, and a state fusion algorithm based on operation sequence is used to realize state consistency synchronization between distributed nodes.
[0015] The application has the following advantages: (1) The application creates a dynamic state machine for each tourism card by constructing an agent node network with strict hierarchical correlation, which integrates state identification, node ownership and operation authority, and realizes three-dimensional accurate mapping of authority management; the system uses a real-time rule engine for multi-dimensional authority verification, and strictly defines the executable operation sequence of each level node under different card states through a state transition rule library, ensuring that each operation request needs to pass through multi-matching verification of node authority level, card state and operation type. This dynamic authorization mechanism based on rule-driven not only effectively prevents unauthorized access and illegal operations, but also realizes the paradigm shift from static permission allocation to dynamic permission verification, enabling the system to maintain fine security control and high-precision state management in a complex multi-level distribution environment.
[0016] (2) The application constructs a structured instruction log system with time sequence markers and operation context, uses a dual-channel asynchronous transmission mechanism to ensure reliable delivery of log data, and realizes intelligent distributed coordination based on a multi-dimensional conflict detection model and operation sequence state fusion algorithm. Specifically, the system generates globally sortable time sequence markers through a hierarchical cascading time encoding mechanism, establishes conflict classification rules based on operation type weight and node level priority; when detecting operation sequence conflicts, it generates a global operation sequence that meets business logic through business context analysis, node cross-validation and sequence reorganization technology; finally, it uses a gradual state synchronization strategy to gradually achieve consistency among distributed nodes under the premise of ensuring operation atomicity. This synchronization mechanism based on log-driven and rule fusion ensures the eventual consistency of data under network partitioning and node abnormality, realizing a technical leap from passive conflict handling to active state coordination. BRIEF DESCRIPTION OF DRAWINGS
[0017] The application will be further described below with reference to the accompanying drawings.
[0018] Figure 1 is a flowchart of the method of the application; Figure 2 is a flowchart of the system in the application. DETAILED DESCRIPTION
[0019] The technical solutions in the embodiments of the application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the application, not all embodiments. Based on the embodiments in the application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of the application.
[0020] Please refer to Figure 1 The application is a dynamic authorization management method for tourism cards based on multi-level agent distribution, which includes the following steps: S1, a proxy node network with hierarchical association relationship is constructed, and a dynamic state machine including a current state, a belonging proxy node identifier and an operation permission set is created for each tourism card; S2, based on the current state and the operation permission set of the dynamic state machine, the operation permission is verified in real time and a state transition instruction is generated, the operation request including card opening, transfer, cancellation or card return operation; S3, the state transition instruction is executed, the state of the dynamic state machine is updated, and an instruction log with a time sequence mark and operation context information is generated, and the instruction log is transmitted to the center server asynchronously; S4, based on the time sequence mark of the instruction log of each proxy node, conflict detection is performed, and a state fusion algorithm based on operation sequence is used to realize state consistency synchronization between distributed nodes.
[0021] In S1, a proxy node network with hierarchical association relationship is constructed, and a dynamic state machine including a current state, a belonging proxy node identifier and an operation permission set is created for each tourism card, specifically including: The construction process of the proxy node network starts from node identifier generation. Each proxy node is assigned a unique identifier, which is generated by a variable-length digital sequence encoding mechanism. The length of the sequence represents the depth of the node in the hierarchical structure, and the numerical content of the sequence represents the unique number of the node in its own level. This encoding method can intuitively reflect the position relationship of the node in the network topology, and provide basic support for subsequent permission inheritance and path tracing.
[0022] After completing the node identifier configuration, the association relationship between nodes needs to be established. A recursive traversal algorithm is used to construct the bidirectional link relationship between proxy nodes, and the identifier set of the direct superior node and all subordinate nodes of each node is maintained. This process forms a tree topology structure with clear parent-child relationship, in which the root node represents the highest level of proxy agency and the leaf node represents the last level of sales terminal. The topology structure has the natural permission inheritance feature, and the subordinate node can automatically obtain part or all of the operation permissions of the superior node.
[0023] Node permission configuration is a key link in network construction. According to the hierarchical position of each proxy node in the tree topology, the corresponding operation permission template is configured for it. The permission template adopts a hierarchical design principle, and the high-level node automatically inherits the operation permissions of all low-level child nodes, and additionally enjoys the high-level management permission of resource allocation and permission granting. This design ensures the standardization and consistency of permission management, while maintaining the flexibility of expansion.
[0024] The creation of the dynamic state machine begins with 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 proxy node network and loaded with the set of operation permissions corresponding to that node. The state machine instance contains the current state value of the travel card, the identification of the proxy node it belongs to, and the list of executable operation permissions, which together form the core data of the state machine.
[0025] The construction of the state transition rule library is the foundation for ensuring the correct operation of the state machine. The rule library defines the state transition matrix, which stores the correspondence between the starting state, target state, trigger operation type, and required permission level in a multi-dimensional table structure. Each state transition rule explicitly specifies that in a specific state, which operations can be executed by proxy nodes with what permission level, and how the state will transition. This design makes the state transition process predictable and verifiable.
[0026] Real-time state monitoring is achieved through an event-driven architecture. The system continuously listens to various operation requests and, when an operation request is received, immediately obtains the current state value of the state machine and the permission level of the requesting node. By querying the state transition rule library, it verifies whether the node has the permission to execute the requested operation in the current state. This process ensures that all operations are within the predefined rules, effectively preventing unauthorized operations.
[0027] The recording of the state transition process uses a transactional log method. Each time a state transition occurs, the system generates detailed log records containing the state value changes before and after the operation, the node identifier that executed the operation, the timestamp of the operation, and related context information. These logs are stored in a structured format to ensure data integrity and traceability. The log recording process is completed within the same transaction as the state transition operation, ensuring the consistency of the log and the state.
[0028] The log persistent storage uses a reliable storage mechanism. All operation logs are written to persistent storage devices and use an append-write method to ensure data integrity. The log records contain a digital digest value for subsequent data verification and integrity verification. The system regularly archives and cleans up logs to ensure storage efficiency while maintaining necessary historical records.
[0029] The state machine recovery mechanism ensures the reliability of the system. When the system encounters an exception or needs to be restored, the history state of the state machine can be reconstructed by replaying the operation logs. The operation context information recorded in the logs provides sufficient basis for state reconstruction, allowing the state machine to recover to the exact state at any historical time point.
[0030] The permission verification process is integrated into the state monitoring link. When an operation request arrives, the system not only verifies whether the current state allows the operation, but also verifies whether the requesting node has the required permission level to perform the operation. This dual verification mechanism ensures system security and data consistency.
[0031] The execution of state transitions adopts an atomic operation approach. Each state transition operation is an indivisible unit that either completely executes successfully or completely rolls back to the pre-operation state. This design prevents the state machine from appearing in an intermediate or inconsistent state, ensuring the data integrity of the system.
[0032] The maintenance of network topology includes regular consistency checks. The system monitors the online status of each node through a heartbeat detection mechanism and updates the topology information in a timely manner. When a node relationship change is detected, the permission recalculation and distribution process is automatically triggered to ensure that the permission management is consistent with the actual network topology.
[0033] The version management mechanism of the state machine supports the evolution of the system. When business rules change, system upgrades can be achieved by updating the state transition rule library without modifying the core state machine logic. This design improves the maintainability and scalability of the system.
[0034] Finally, the system provides complete monitoring and auditing functions. All state transition operations and permission changes are recorded in detail for subsequent queries and analysis. These records provide reliable data support for system operation status monitoring, fault troubleshooting, and business auditing.
[0035] In S2, based on the current state of the dynamic state machine and the set of operation permissions, the operation permissions are verified in real time and state transition instructions are generated, the operation request including card opening, transfer, cancellation, or card cancellation operations, specifically including: The implementation of the operation permission verification process first starts from the request receiving link. When the system receives an operation request initiated by a proxy node, it will immediately start the request parsing process. This process first extracts the key parameters contained in the request, including the operation type identifier, the target tourism card identifier, and the identity authentication information of the requesting node. The system records the exact timestamp of request reception, providing a time basis for subsequent audit tracking. After request parsing is complete, the system will enter the permission verification stage.
[0036] In the permission verification stage, the system queries the corresponding dynamic state machine instance based on the tourism card identifier in the request. The current state value and the set of operation permissions associated with the state machine are obtained from the state machine. At the same time, the system queries the hierarchical position and corresponding permission level of the requesting node in the proxy node network based on its identity information. This step ensures that the system can make a comprehensive judgment based on the current state of the tourism card and the permission characteristics of the requesting node.
[0037] Multi-dimensional 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 request node permission level as input parameters, and performs matching query with the predefined state transition rule library. The state transition rule library is stored in table structure, where each row record defines the operation type that can be performed by the node with a certain permission level in a specific state and the corresponding target state. The matching process adopts the complete matching principle. Only when all input parameters are completely consistent with a record in the rule library, is the matching considered successful.
[0038] When the matching verification is successful, the system generates a formal state transition instruction. The instruction contains the target state value, permission verification result, instruction generation timestamp, and other core information. At the same time, the instruction also carries complete operation context information, including the detailed identification of the request node, the original operation request content, and the rule record identification used in matching, etc. These context information provides sufficient data support for subsequent operation traceability and fault troubleshooting. After the instruction is generated, it will be placed in the pending instruction queue for processing.
[0039] In the case of matching verification failure, the system generates an operation rejection instruction. The rejection instruction records the specific reasons for failure in detail, which are classified and coded. Common failure reasons include insufficient permissions, state conflicts, and rule verification failure. Each failure type corresponds to a specific error code and description information, which helps the request node understand the specific reasons for operation rejection and take appropriate corrective measures.
[0040] The system also implements a perfect exception handling mechanism. When a system-level exception occurs during permission verification, such as rule library access failure or data consistency error, the system will automatically trigger the exception handling process. This process records the detailed stack information of the exception and sends an alarm notification to the monitoring system. For business-level exceptions, such as parameter format errors or identifier nonexistence, the system generates corresponding error responses to ensure the integrity of request processing.
[0041] The permission verification process also includes performance optimization measures. The system uses a cache mechanism for the state transition rule library, caching frequently used rule records in memory to improve matching query efficiency. At the same time, connection pool management is implemented for the permission verification process to avoid frequent database connection operations. These optimization measures ensure that the permission verification process can maintain stable response performance in a high-concurrency environment.
[0042] Audit logging is an important part of the permission verification process. The system generates detailed audit logs for each operation request, including request content, verification parameters, matching results, instruction generation, and other key information. These logs are stored in a structured format for subsequent queries and analysis. The logging process is synchronized with business operations to ensure real-time and accurate audit data.
[0043] Finally, the system provides management and maintenance functions for verification rules. Authorized administrators can update and maintain the state transition rule library through the management interface, including adding new rule records, modifying existing rules, and disabling expired rules. All rule change operations are strictly controlled by permissions, and complete change history is recorded to ensure the standardization and traceability of rule management. The version management mechanism of the rule library supports gradual updating and rollback operations of rules to ensure system stability.
[0044] In S3, the state transition instruction is executed to update the state of the dynamic state machine, and an instruction log with a time sequence marker and operation context information is generated. The instruction log is transmitted asynchronously to the central server, which includes: The execution process of the state transition instruction adopts a transactional processing mechanism. When the system receives the state transition instruction, it first starts a database transaction and updates the relevant data of the dynamic state machine within the transaction. The update operation includes modifying the current state value field and the corresponding agent node identifier field of the state machine. The update of these two fields is completed in the same atomic operation to ensure that either all updates are successful or all remain unchanged. During the transaction execution process, exclusive locks are added to the relevant data records to prevent data inconsistency caused by other concurrent operations. After the transaction is submitted, the new state value takes effect immediately, and the state transition operation is considered complete.
[0045] The generation of structured instruction logs is synchronized with the state update operation. Before the state update transaction is submitted, the system creates a structured log record. This record contains the state value comparison information before and after the operation, and records the state change process. The time sequence marker is generated using a hierarchical cascading encoding method, consisting of server node identifier, date and time stamp, and sequence number, to ensure the global uniqueness and sortability of the time sequence marker in a distributed environment. The operation context information includes request source, operation type, execution node, and other metadata. The digital digest value is calculated using a hash algorithm to generate the log content for subsequent integrity verification.
[0046] The management of the log buffer queue adopts a priority sorting strategy. The generated instruction logs are first written into the memory buffer, and different priority weights are assigned according to the operation type and urgency. The system background process periodically writes the logs in the buffer to the local persistent storage in priority order. The persistent storage adopts an append write mode to avoid the performance overhead caused by random write. The log files are stored by time slicing, and each file contains all log records generated within a fixed time window, facilitating subsequent query and archiving processing.
[0047] The state recovery mechanism is automatically triggered when log persistence failure is detected. When the system finds that the log write operation returns an error or times out, it will immediately roll back the current ongoing state update transaction and restore the relevant data of the dynamic state machine to the state before the operation. At the same time, the system generates an error report to record the specific reason and time point of the persistence failure. After the recovery process is completed, the system will attempt to re-execute the failed operation, and if the number of retries exceeds the set threshold, the operation will be marked as failed and relevant personnel will be notified to intervene.
[0048] The log transmission adopts a dual-channel link design. The main transmission channel is responsible for real-time transmission of newly generated instruction logs, using an incremental synchronization method to only transmit changed log content. The backup channel is used to transmit accumulated historical log data, using batch compression to package multiple log records into a transmission unit, improving transmission efficiency. The two channels run independently and do not affect each other, and when the main channel fails, the system will automatically switch to the backup channel to continue transmission.
[0049] The network quality perception mechanism continuously monitors the connection state of the transmission link. The system periodically sends probe packets to the central server and evaluates network quality based on response time and packet loss rate. In a high-bandwidth environment, the system enables full transmission mode, and log records are transmitted in raw format, retaining all detailed information. When a decrease in network bandwidth or an increase in delay is detected, the system automatically switches to differential transmission mode, transmitting only necessary summary information and changes, reducing data transmission volume.
[0050] The log reception on the central server side adopts a multi-level verification mechanism. The first level of verification verifies the integrity of the log record, checking whether the log has been damaged or lost during transmission. The second level of verification focuses on the continuity of the time sequence marker, ensuring that the received log record maintains the correct time order without missing or duplication. The third level of verification checks the correctness of the digital digest value, verifying whether the log content has been tampered with by recalculating the digest value and comparing it with the transmission value. Any failure in any level of verification will trigger the retransmission mechanism.
[0051] The breakpoint resume function is automatically enabled when the transmission is interrupted. When the network connection is unexpectedly disconnected, the system records the last successful transmission log time marker. After the connection is restored, the transmission process locates the starting position of the retransmission according to the recorded time marker, and continues to transmit the subsequent log records from this point. The transmission process will periodically save the transmission progress to avoid repeated transmission of successful records. The resume mechanism supports continuity across network sessions, and even after system restart, it can maintain the continuity of transmission.
[0052] The flow control in the transmission process uses an adaptive adjustment strategy. The system dynamically adjusts the transmission rate according to the network conditions, reduces the sending frequency when the network is congested, and improves the transmission efficiency when the network is smooth. The transmission process monitors the size of the sending buffer in real time, and when the buffer backlog exceeds the threshold, it automatically enables the flow shaping function to smooth the sending rate and avoid impacting the network.
[0053] The security of log transmission is guaranteed by encryption and authentication mechanisms. All transmitted log records are encrypted to prevent data from being stolen or tampered with during transmission. Both parties use a two-way authentication mechanism to ensure that only authorized nodes can participate in the log transmission process. Handshake authentication is required when establishing a transmission connection, and only after authentication is successful can data transmission begin.
[0054] Transmission status monitoring and statistics function records detailed transmission indicators. The system records performance indicators such as transmission rate, success rate, and retransmission times in real time and generates statistical reports. These data are used to assess the running status of the transmission system and provide a basis for capacity planning and performance optimization. The monitoring system will set alarm thresholds, and when the transmission indicators are abnormal, it will promptly issue an alarm.
[0055] The reliability of log transmission is guaranteed by the confirmation mechanism. After each batch of log transmission is completed, the sender will wait for the receiver's confirmation response. If no confirmation is received within the specified time, the sender will retransmit the batch of logs. The confirmation mechanism uses cumulative confirmation, and the receiver confirms the latest continuous time marker to indicate that all logs before this marker have been successfully received. This mechanism reduces the number of confirmation messages and improves transmission efficiency.
[0056] In S4, conflict detection is performed based on the time 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 between distributed nodes, which includes: The implementation of the conflict detection process starts with log collection. The system periodically collects instruction logs from various distributed agent nodes, which contain complete time stamps, operation types, and state transition path information. The collected logs are stored in temporary buffers, waiting for subsequent processing. The log collection process uses incremental pulling, only obtaining new log records generated since the last processing each time, reducing network transmission load and data processing volume.
[0057] The multi-dimensional conflict detection model analyzes the collected logs comprehensively. The model first uses time stamps to time-sort all operation logs, establishing a time axis of global operation sequences. Then, the system compares the operation types and state transition paths in each node log to detect whether there are operations that concurrently modify the state of the same tourist card. The detection process uses a rule engine to drive, identifying potential operation conflicts through a predefined conflict rule set, including state update conflicts, permission change conflicts, and data inconsistency.
[0058] The classification of conflicting operations is based on business context analysis. The system extracts business context information related to conflicting operations, including the business scenario in which the operation occurred, the business objects involved, and the operation intent. According to the importance degree of operation type, different weight values are assigned, and key operations such as state freezing and permission change are given higher weights. At the same time, combined with the location of the agent node in the network level, the conflict operations are preliminarily classified according to the hierarchical priority rule, to distinguish between major conflicts and minor conflicts, providing a basis for subsequent processing.
[0059] The cross-validation process ensures the accuracy of conflict determination. The system sends the identified conflict operation logs to the relevant agent nodes for confirmation. After receiving the verification request, each node checks the local recorded operation state and context information, and returns the operation confirmation state. The confirmation state includes operation validity confirmation, operation revocation confirmation, or operation correction suggestion. The system collects all relevant node feedback information as a decision reference for conflict resolution.
[0060] The conflict report generation stage summarizes the analysis results. The system generates detailed conflict reports based on conflict detection and verification results, clearly identifying the operation sequences that exist conflicts, explaining the conflict types and causes. The report also records the original log information of all conflict operations, including operation content, execution node, time of occurrence, and complete context. These reports provide complete decision-making basis for state coordination and serve as important materials for system audit.
[0061] The state fusion algorithm first performs operation sequence reorganization. The system reorders conflicting operation logs based on time stamps and business rules. The reorganization process considers dependencies between operations and business logic constraints to ensure that the generated operation sequence is both chronologically ordered and business reasonable. The reordered sequence forms a globally agreed operation execution order, serving as the basis for state synchronization.
[0062] Reasonableness verification ensures the effectiveness of the reorganized sequence. The system checks the arrangement order of operations in the sequence based on operation type priority rules, ensuring that high-priority operations are processed first. At the same time, it verifies the matching degree of agent node authority level and operation to prevent unauthorized operations. Finally, it performs integrity checks on the entire sequence based on business rule constraints to ensure that all operations comply with predefined business specifications.
[0063] State transition execution adopts a gradual synchronization strategy. The system executes each state transition operation in the order of the reorganized operation sequence. After each operation is executed, it immediately verifies the consistency of the states of all related nodes to ensure that the operation is correctly applied on all nodes. If an operation fails to execute, the system suspends the synchronization process, records the failure information, and waits for intervention processing.
[0064] The synchronization confirmation mechanism is triggered after the states are consistent. When the states of all nodes reach consistency, the system sends a synchronization completion confirmation notification to the relevant agent nodes. The confirmation information includes the state version number after synchronization and the synchronization timestamp. After receiving the confirmation, each node updates the globally stored state version number, indicating the successful completion of this state synchronization process. The version number management adopts a monotonic increasing method, ensuring the global uniqueness and comparability of the version identifier.
[0065] An exception handling mechanism is implemented during synchronization. When a synchronization failure or state inconsistency is detected, the system automatically records the exception details and triggers a retry mechanism. The retry process uses an exponential backoff strategy, gradually increasing the retry interval time. If the number of retries exceeds the threshold, the system reports the exception to the monitoring system for administrator intervention.
[0066] Performance optimization of state synchronization is achieved through batch processing. The system combines multiple operations into batches for processing, reducing network communication overhead and database operation frequency. The batch size is dynamically adjusted based on network conditions and system load, ensuring real-time performance while improving processing efficiency. Batch processing also uses a pipeline approach, allowing different batches of operations to be executed in parallel, further improving throughput.
[0067] The verification of synchronization results adopts a sampling inspection method. The system periodically randomly selects part of the nodes for state consistency inspection, and verifies the synchronization effect by comparing key state fields. Sampling inspection not only ensures the reliability of the verification, but also avoids the performance overhead caused by full inspection of all nodes. The inspection results are recorded in the monitoring log for evaluating the running status of the synchronization system.
[0068] Finally, the system provides visual monitoring of the synchronization process. The administrator can view the real-time synchronization status, conflict processing progress, and system performance indicators through the monitoring interface. The monitoring data includes synchronization delay, conflict occurrence rate, processing success rate, and other key indicators, which help the administrator understand the system running status and discover potential problems in a timely manner. The monitoring interface also provides historical data query and analysis functions to support system performance optimization and capacity planning.
[0069] Referring to Figure 2 The dynamic authorization management system for tourism cards based on multi-level agent distribution includes: An agent node network and state machine management module is used to build an agent node network with hierarchical association and create a dynamic state machine for each tourism card, including the current state, the identification of the agent node, and the operation permission set. A permission verification and instruction generation module is used to verify the operation permission in real time and generate state transition instructions based on the current state and operation permission set of the dynamic state machine. The operation request includes card opening, transfer, cancellation, or card cancellation operations. A state transition execution and log management module is used to execute state transition instructions, update the state of the dynamic state machine, and generate instruction logs with time sequence markers and operation context information. The instruction logs are asynchronously transmitted to the center server. A distributed state synchronization and conflict processing module is used to detect conflicts based on the time sequence markers of the instruction logs of each agent node, and to realize state consistency synchronization between distributed nodes using a state fusion algorithm based on operation sequences.
[0070] The working principle of the present application is as follows: a proxy node network with hierarchical correlation is constructed, and a dynamic state machine containing the current state, the identification of the proxy node to which the state machine belongs, and the operation authority set of each travel card is created; then the operation authority is verified in real time based on the current state and the operation authority set of the dynamic state machine, and a state transition instruction is generated; then the state transition instruction is executed to update the state of the dynamic state machine, and an instruction log with a time sequence mark and operation context information is generated for asynchronous transmission; finally, conflict detection is performed based on the time sequence mark of the instruction log of each proxy node, and a state fusion algorithm based on the operation sequence is used to realize the state consistency synchronization among the distributed nodes. The corresponding system includes a proxy node network and a state machine management module, an authority verification and instruction generation module, a state transition execution and log management module, and a distributed state synchronization and conflict processing module, and each module works cooperatively to complete the dynamic authorization management and state synchronization of the travel card.
[0071] The above describes one embodiment of the present application in detail, but the content described is only the preferred embodiment of the present application and cannot be considered as limiting the scope of the present application. Any equivalent changes and improvements made within the scope of the present application should still belong to the patent coverage of the present application.
Claims
1. A dynamic authorization management method for a travel card based on multi-level agent distribution, characterized in that, The method comprises the following steps: S1, constructing a proxy node network with hierarchical association relationship, and creating a dynamic state machine for each travel card, which contains the current state, the identification of the proxy node to which the travel card belongs, and the operation permission set; S2, based on the current state and the operation permission set of the dynamic state machine, verifying the operation permission in real time and generating a state transition instruction, the operation request including card opening, transfer, cancellation or card cancellation operation; S3, executing the state transition instruction, updating the state of the dynamic state machine, and generating an instruction log with time sequence mark and operation context information, and transmitting the instruction log to the center server asynchronously; S4, based on the time sequence mark of the instruction log of each proxy node, detecting the conflict, and realizing the state consistency synchronization between the distributed nodes by using the state fusion algorithm based on the operation sequence.
2. The dynamic authorization management method for a travel card based on a multi-level agent distribution according to claim 1, characterized in that, The construction of the proxy node network with hierarchical association relationship specifically comprises: generating a unique identification for each proxy node; establishing a bidirectional association relationship between the proxy nodes, maintaining the identification set of the direct superior proxy node and all subordinate proxy nodes for each proxy node, and forming a tree topology structure with permission inheritance characteristics; configuring the operation permission template corresponding to the hierarchical position of each proxy node, wherein the high-level proxy node automatically inherits all operation permissions of the low-level proxy node and additionally enjoys the high-level permission of resource allocation and permission granting.
3. The dynamic authorization management method for a travel card based on a multi-level agent distribution according to claim 1, characterized in that, The creation process of the dynamic state machine comprises: establishing a dynamic state machine instance when initializing the travel card, binding the dynamic state machine with a specific node in the proxy node network, and loading the operation permission set corresponding to the node; constructing a state transition rule library, wherein the state transition matrix is defined, and the state transition matrix contains the multi-dimensional correspondence relationship of the starting state, the target state, the trigger operation type and the required permission level; implementing real-time state monitoring, listening to operation requests through an event-driven architecture, and dynamically matching state transition rules based on the current state identification and the permission level of the request node; using transactional log recording method, persistently storing the complete context information of each state transition including the state value before and after operation, operation node identification and timestamp information.
4. The dynamic authorization management method for a travel card based on a multi-level agent distribution according to claim 1, characterized in that, The real-time verification of operation permission and the generation of state transition instruction specifically comprise: after receiving the operation request, immediately querying the current state value and the operation permission set stored in the dynamic state machine, and obtaining the permission level of the proxy node initiating the request in its network hierarchy; matching and verifying the operation request type, the current state value and the permission level of the request node as input parameters with the pre-defined state transition rule library, which defines the legal operation sequence executable by nodes with different permission levels in different states; when the matching is successful, generating a state transition instruction containing the target state value, the permission verification result and the timestamp, and the state transition instruction also carries the operation context information for subsequent tracing; when the matching fails, generating an operation rejection instruction and recording the detailed failure reason.
5. The method for dynamic authorization management of a travel card based on multi-level agent distribution according to claim 1, characterized in that, The execution of the state transition instruction and the updating of the state of the dynamic state machine specifically comprise: The execution state conversion instruction is used to complete the synchronous update of the current state value in the dynamic state machine and the identification of the corresponding agent node in a single transaction, thereby ensuring the indivisibility of the state conversion; A structured instruction log is generated, which includes state comparison before and after operation, complete timing marker, operation context information and digital digest value, wherein the timing marker is generated by using a hierarchical cascading time coding mechanism; A log buffer queue is established, and the generated instruction log is temporarily stored in the local persistent storage area after being sorted according to the priority; When the log fails to be persisted, a state recovery process is automatically triggered to return the dynamic state machine to the stable state before the conversion.
6. The dynamic authorization management method for a travel card based on a multi-level agent distribution according to claim 1, characterized in that, The instruction log is transmitted to the central server asynchronously, specifically including: A double-channel transmission link is created, the main channel is used to transmit the instruction log generated in real time in real time by using the incremental synchronization method, and the standby channel is used to transmit the accumulated log data by using the batch compression method; The network connection quality is continuously monitored, and the complete log transmission mode is enabled in the high-bandwidth environment, and the differential amount transmission mode is switched to in the weak network environment; A multi-level log receiving and checking is established at the central server end, which firstly verifies the integrity of the log, secondly checks the continuity of the timing marker, and finally checks the correctness of the digital digest value; When the log transmission is interrupted, the breakpoint resume mechanism is automatically enabled, and the starting position of the resume is located based on the last confirmed received log timing marker.
7. The dynamic authorization management method for a travel card based on a multi-level agent distribution according to claim 1, characterized in that, The timing marker of the instruction log of each agent node is used for conflict detection, specifically including: By comparing the timing marker, operation type and state conversion path in the instruction log from different agent nodes, whether there is an operation sequence conflict is identified; The business context information of the conflict operation is analyzed, and the operation type weight and agent node level priority rule are used for preliminary conflict classification; The instruction log with conflict is sent to the related agent node for cross verification to obtain the operation confirmation state of each node; A conflict report is generated and the conflict operation sequence is marked, which provides decision basis for state coordination, and the original log record of all conflict operations is reserved.
8. The dynamic authorization management method for a travel card based on a multi-level agent distribution according to claim 1, characterized in that, The state fusion algorithm based on the operation sequence is used to realize the state consistency synchronization among the distributed nodes, specifically including: The conflicting operation log is reordered according to the timing marker to generate a global operation sequence consistent with the business logic; The reordered operation sequence is reasonably checked based on the operation type priority, agent node permission level and business rule constraint; The state conversion operation is executed step by step according to the reordered operation sequence, and the state consistency is verified after each conversion; When all node states reach consistency, a synchronization completion confirmation is sent to the related agent node, and the global state version number is updated.
9. A dynamic authorization management system for a travel card based on multi-level agent distribution, characterized in that, The method is used for executing the dynamic authorization management method of the tourism card based on the multi-level agent distribution as claimed in any one of claims 1-8, including: The agent node network and the state machine management module are used to build an agent node network with hierarchical association relationship, and create a dynamic state machine including the current state, the identification of the corresponding agent node and the operation permission set for each tourism card; The agent node network and the state machine management module are used to build an agent node network with hierarchical association relationship, and create a dynamic state machine including the current state, the identification of the corresponding agent node and the operation permission set for each tourism card; The permission verification and instruction generation module verifies the operation permission and generates a state transition instruction in real time based on the current state of the dynamic state machine and the operation permission set, and the operation request includes card opening, transfer, cancellation or card cancellation operation; The state transition execution and log management module is used for executing the state transition instruction, updating the state of the dynamic state machine, and generating an instruction log with a time sequence mark and operation context information, and transmitting the instruction log to the center server asynchronously. The distributed state synchronization and conflict processing module detects conflicts based on the time sequence mark of the instruction log of each agent node, and realizes the state consistency synchronization between the distributed nodes by using a state fusion algorithm based on the operation sequence.
Citation Information
Patent Citations
Complex multi-token dynamic queuing method
CN103473846A
Integration system and method of network application nodes
CN108111334A
Multi-account safety management method and system based on mobile energy storage charging pile
CN120658462A
Policy language and state machine model for dynamic authorization in physical access control
US20080086643A1
State transition controlled attributes
US20080201333A1
Cited By
Building sale distributed house resource real-time synchronous management method and system based on cloud edge fusion computing
CN122019670A