Distributed application system transaction state consistency method and system based on rule engine
Through the rule engine-based method, the problem of increasing coupling degree and maintenance difficulty when the transaction state consistency of distributed application systems is solved, the final consistency of business and transaction continuity are achieved, and the impact on existing business systems is reduced.
Patent Information
- Application Number
- CN202111495551.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-08
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2041-12-08
AI Technical Summary
When the prior art deals with the consistency of transaction status of distributed application systems, the coupling between subsystems increases significantly, and the difficulty of adding, changing, expanding and subsequent maintenance of services increases significantly.
Using a rule engine-based method, the transaction status is consistent through steps such as error management, flow processing and interface management. Specifically, it includes determining the transaction status based on preset rules, adjusting the status consistency by compensating the transaction, registering transaction information asynchronously and generating intermediate tables through flow calculations, and managing real-time transaction interfaces and flow mappings.
It achieves the ultimate consistency of the business, ensures the continuity of transactions, reduces code intrusion and transformation of existing business systems, and reduces business impact.
Smart Images

Figure CN114140247B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data synchronization, and in particular to a method and system for consistent transaction status of a distributed application system based on a rule engine. Background Art
[0002] In the existing platform, each decentralized peripheral business system can only obtain information such as the transaction status related to the system. When an exception occurs and causes a transaction interruption, it is also processed according to the situation of the system and the definition of the transaction to ensure the final consistency of the system. As the business gradually develops, the number of business systems gradually increases, and the business process becomes more complex, there are scenarios where a single business system cannot perform subsequent processing based solely on the information of the system, and needs to obtain additional information from other systems. Moreover, when an exception occurs in the account of an account shared by multiple systems, it is difficult to ensure that the problem flow can be discovered and handled in a timely manner.
[0003] Patent document CN109271443A (application number: CN201810870706.1) discloses a distributed data consistency processing method, system, device and storage medium, the method comprising: recording transaction steps and saving on-site data during transaction execution; when a transaction fails, performing reverse operations through the on-site data to restore the initial state of the transaction; and recovering the on-site data in a synchronous and asynchronous manner. However, the patent still uses the existing technical ideas, and each system handles it on its own, which will inevitably lead to an increase in the coupling between subsystems, and a significant increase in the difficulty of adding, changing, expanding and subsequently maintaining services. Summary of the invention
[0004] In view of the defects in the prior art, the object of the present invention is to provide a method and system for consistent transaction status of a distributed application system based on a rule engine.
[0005] The method for consistent transaction status of a distributed application system based on a rule engine provided by the present invention comprises:
[0006] Error management steps: Determine the transaction status according to the preset rules. When the transaction status is inconsistent, adjust it to be consistent through compensation transactions;
[0007] Transaction processing steps: Asynchronously register transaction information according to preset unified rules, process transaction information through stream computing, and generate a unified intermediate table for extracting and saving transaction information.
[0008] Interface management steps: manage real-time transaction interfaces and transaction flow mapping methods, and map different transactions into unified standards and dictionaries through mapping.
[0009] Preferably, when the transaction status is updated, it is synchronized to the intermediate table, and other transactions are processed according to the updated transaction status;
[0010] When distributed application systems use different development frameworks, file synchronization is performed.
[0011] Preferably, the interface management step includes configuration of flow status mapping, configuration of flow field mapping, configuration of compensation transaction interface and configuration of flow file batch synchronization interface;
[0012] The pipeline status mapping configuration includes the configuration of success, failure, and pending status mapping rules between pipeline tables and intermediate tables of each distributed application system;
[0013] The flow field mapping configuration includes the configuration of the status field name corresponding to each distributed system flow table;
[0014] The compensation transaction interface configuration includes the configuration of transactions and input and output parameters for forward account adjustment, reverse account adjustment, and status query of each distributed system;
[0015] The batch synchronization interface configuration of the journal file includes the configuration of mapping rules between the journal table and the intermediate table fields.
[0016] Preferably, it also includes a reconciliation management step: displaying the real-time transaction status of each distributed application system according to preset reconciliation rules, and comparing the account inflow and outflow.
[0017] Preferably, it also includes an early warning monitoring step: when a situation occurs that cannot be automatically handled by configuration, or when a monitoring parameter exceeds a preset threshold, an alarm is performed.
[0018] The distributed application system transaction state consistency system based on rule engine provided by the present invention includes:
[0019] Error management module: Determine the transaction status according to preset rules. When the transaction status is inconsistent, adjust it to be consistent through compensation transactions;
[0020] Transaction processing module: Asynchronously registers transaction information according to preset unified rules, processes transaction information through stream computing, and generates a unified intermediate table for extracting and saving transaction information.
[0021] Interface management module: manages real-time transaction interfaces and transaction flow mapping methods, and maps different transaction flows into unified standards and dictionaries through mapping.
[0022] Preferably, when the transaction status is updated, it is synchronized to the intermediate table, and other transactions are processed according to the updated transaction status;
[0023] When distributed application systems use different development frameworks, file synchronization is performed.
[0024] Preferably, the interface management module includes flow status mapping configuration, flow field mapping configuration, compensation transaction interface configuration and flow file batch synchronization interface configuration;
[0025] The pipeline status mapping configuration includes the configuration of success, failure, and pending status mapping rules between pipeline tables and intermediate tables of each distributed application system;
[0026] The flow field mapping configuration includes the configuration of the status field name corresponding to each distributed system flow table;
[0027] The compensation transaction interface configuration includes the configuration of transactions and input and output parameters for forward account adjustment, reverse account adjustment, and status query of each distributed system;
[0028] The batch synchronization interface configuration of the journal file includes the configuration of mapping rules between the journal table and the intermediate table fields.
[0029] Preferably, it also includes a reconciliation management module: displaying the real-time transaction status of each distributed application system according to preset reconciliation rules, and comparing the account inflow and outflow.
[0030] Preferably, it also includes an early warning monitoring module: when a situation occurs that cannot be automatically handled by configuration, or when a monitoring parameter exceeds a preset threshold, an alarm is processed.
[0031] Compared with the prior art, the present invention has the following beneficial effects:
[0032] (1) The present invention extracts and synchronizes necessary information such as relevant transaction status, business, and the system to which it belongs from the existing system. Through the rule engine, the corresponding transactions are connected in series according to the corresponding fields to generate intermediate transactions, and operations such as transaction reconciliation, arbitration, and exception handling are performed to achieve final consistency of the business, thereby ensuring the continuity of transactions;
[0033] (2) The present invention concentrates the changes in the present system and decouples them through mapping, asynchrony, etc., thereby reducing the code intrusion and modification of the existing business system and reducing the impact on the existing business. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:
[0035] Figure 1 Schematic diagram of the system structure of the present invention. DETAILED DESCRIPTION
[0036] The present invention is described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those of ordinary skill in the art, several changes and improvements can also be made without departing from the concept of the present invention. These all belong to the protection scope of the present invention.
[0037] Example:
[0038] The present invention provides a distributed application system transaction status synchronization system based on a rule engine, such as Figure 1 , including the following modules:
[0039] 1. Error management module: mainly includes a) error handling submodule, which provides basic error handling functions and the entry for manual error handling; b) error arbitration rule configuration, which provides status confirmation rule configuration when the status is unclear in the transaction; c) error compensation submodule: when the transaction status is inconsistent, the system adjusts to the final consistent rule configuration through compensation transactions.
[0040] 2. Pipeline processing module: In an asynchronous way, the transaction information is registered into the system according to unified rules, and the information is processed according to the pipeline rules through stream computing to generate a unified intermediate table. Provide a state synchronization interface. When the transaction-related status is updated, it is synchronized to the intermediate table, and other related information is processed according to the updated status. Provide a file synchronization interface. When some subsystems use different development frameworks and cannot be synchronized in a quasi-real-time manner (such as MQ), the file interface can be used, but the timeliness of related processing will also be affected accordingly. This solution needs to design an intermediate table containing key elements according to the business situation, which is used to extract and save important pipeline information, and can support pipeline analysis for subsequent arbitration and error processing.
[0041] 3. Interface management module: manages the real-time transaction interface and transaction mapping methods of related systems, including transaction status mapping configuration (including the mapping rules of success, failure, and pending status of each system transaction table and the intermediate table), transaction field mapping configuration (including the corresponding status field name of each system transaction table, etc.), compensation transaction interface configuration (including various forward account adjustments, reverse account adjustments, status query transactions and input and output parameters of each system, etc.), transaction file batch synchronization interface configuration (including the mapping rules of file transaction and intermediate table fields, etc.). Different transactions are mapped to a unified standard and dictionary through mapping to reduce the intrusion and transformation of the original system.
[0042] 4. Account reconciliation management module: After processing the collected transaction information, according to the account reconciliation rule configuration (mainly including transaction association, affected accounts, affected directions, etc.), it can provide quasi-real-time display of transaction status of each system, and can provide comparison of inflow and outflow of related accounts according to the configuration, which is convenient for daily operation and maintenance to check the status of important accounts.
[0043] 5. Early warning monitoring module: When an abnormal situation occurs that cannot be automatically handled by configuration, or when the specified monitoring parameters (such as the number of imbalances between specified systems, the amount of imbalances in specified accounts) exceed the set threshold, an alarm will be sent to the designated personnel in a specified manner to remind relevant personnel to handle it in a timely manner.
[0044] The method for consistent transaction status of a distributed application system based on a rule engine provided by the present invention includes: an error management step: determining the transaction status according to preset rules, and when the transaction status is inconsistent, adjusting it to be consistent through compensating transactions; a pipeline processing step: registering transaction information according to preset unified rules in an asynchronous manner, and processing the transaction information through stream computing to generate a unified intermediate table for extracting and storing pipeline information; an interface management step: managing real-time transaction interfaces and pipeline mapping methods, and mapping different pipelines to a unified standard and dictionary through mapping forms.
[0045] When the transaction status is updated, it is synchronized to the intermediate table, and other transactions are processed according to the updated transaction status; when the development framework used by the distributed application system is different, file synchronization is performed. The interface management steps include flow state mapping configuration, flow field mapping configuration, compensation transaction interface configuration and flow file batch synchronization interface configuration; the flow state mapping configuration includes the configuration of the success, failure, and pending status mapping rules of each distributed application system flow table and the intermediate table; the flow field mapping configuration includes the configuration of the corresponding status field name of each distributed system flow table; the compensation transaction interface configuration includes the configuration of the transactions and input and output parameters of each distributed system forward adjustment, reverse adjustment, and status query; the flow file batch synchronization interface configuration includes the configuration of the mapping rules between the flow table and the intermediate table fields.
[0046] It also includes the reconciliation management step: display the real-time transaction status of each distributed application system according to the preset reconciliation rules, and compare the account inflow and outflow. It also includes the early warning monitoring step: when there is a situation that cannot be automatically processed by configuration, or the monitoring parameters exceed the preset threshold, an alarm is processed.
[0047] Those skilled in the art know that, in addition to implementing the system, device and its various modules provided by the present invention in a purely computer-readable program code, it is entirely possible to implement the same program in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers and embedded microcontrollers by logically programming the method steps. Therefore, the system, device and its various modules provided by the present invention can be considered as a hardware component, and the modules included therein for implementing various programs can also be considered as structures within the hardware component; the modules for implementing various functions can also be considered as both software programs for implementing the method and structures within the hardware component.
[0048] The above describes the specific embodiments of the present invention. It should be understood that the present invention is not limited to the above specific embodiments, and those skilled in the art can make various changes or modifications within the scope of the claims, which does not affect the essence of the present invention. In the absence of conflict, the embodiments of the present application and the features in the embodiments can be combined with each other arbitrarily.
Claims
1. A method for consistent transaction status of a distributed application system based on a rule engine, characterized in that: include: Error management steps: Determine the transaction status according to the preset rules. When the transaction status is inconsistent, adjust it to be consistent through compensation transactions; Transaction processing steps: Asynchronously register transaction information according to preset unified rules, process transaction information through stream computing, and generate a unified intermediate table for extracting and saving transaction information. Interface management steps: manage real-time transaction interfaces and transaction mapping methods, and map different transactions into unified standards and dictionaries through mapping forms; When the transaction status is updated, it is synchronized to the intermediate table, and other transactions are processed according to the updated transaction status; Perform file synchronization when distributed application systems use different development frameworks; The interface management step includes configuration of flow status mapping, flow field mapping, compensation transaction interface configuration and flow file batch synchronization interface configuration; The pipeline status mapping configuration includes the configuration of success, failure, and pending status mapping rules between pipeline tables and intermediate tables of each distributed application system; The flow field mapping configuration includes the configuration of the status field name corresponding to each distributed system flow table; The compensation transaction interface configuration includes the configuration of transactions and input and output parameters for forward account adjustment, reverse account adjustment, and status query of each distributed system; The batch synchronization interface configuration of the flow file includes the configuration of mapping rules between the flow table and the intermediate table fields; It also includes the reconciliation management step: displaying the real-time transaction status of each distributed application system according to the preset reconciliation rules, and comparing the account inflow and outflow; It also includes an early warning monitoring step: when a situation occurs that cannot be automatically handled by configuration, or when a monitoring parameter exceeds a preset threshold, an alarm is processed.
2. A distributed application system transaction status consistency system based on rule engine, characterized in that: include: Error management module: Determine the transaction status according to preset rules. When the transaction status is inconsistent, adjust it to be consistent through compensation transactions; Transaction processing module: Asynchronously registers transaction information according to preset unified rules, processes transaction information through stream computing, and generates a unified intermediate table for extracting and saving transaction information. Interface management module: manages real-time transaction interfaces and transaction mapping methods, and maps different transactions into unified standards and dictionaries through mapping forms; When the transaction status is updated, it is synchronized to the intermediate table, and other transactions are processed according to the updated transaction status; Perform file synchronization when distributed application systems use different development frameworks; The interface management module includes flow status mapping configuration, flow field mapping configuration, compensation transaction interface configuration and flow file batch synchronization interface configuration; The pipeline status mapping configuration includes the configuration of success, failure, and pending status mapping rules between pipeline tables and intermediate tables of each distributed application system; The flow field mapping configuration includes the configuration of the status field name corresponding to each distributed system flow table; The compensation transaction interface configuration includes the configuration of transactions and input and output parameters for forward account adjustment, reverse account adjustment, and status query of each distributed system; The batch synchronization interface configuration of the flow file includes the configuration of mapping rules between the flow table and the intermediate table fields; It also includes a reconciliation management module: it displays the real-time transaction status of each distributed application system according to the preset reconciliation rules, and compares the account's inflow and outflow; It also includes an early warning monitoring module: when a situation occurs that cannot be automatically handled by configuration, or when the monitoring parameters exceed the preset threshold, an alarm is processed.
Citation Information
Patent Citations
Distributed data consistency processing method, system, device and storage medium
CN109271443A
Full-link account checking method and system
CN110544164A