A transaction processing rule matching method and apparatus
By constructing a transaction processing rule network tree, the fund processing business of multiple business systems is processed in a unified manner, solving the problem of redundant development and achieving the transaction processing effect of cost reduction and efficiency improvement.
Patent Information
- Application Number
- CN202111572249.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-21
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2041-12-21
AI Technical Summary
In financial transfer transactions, the duplication of fund processing functions across multiple business systems leads to high development costs and low reuse rates, which cannot be effectively addressed by existing technologies.
By introducing a transaction processing rule matching component, a transaction processing rule network tree is constructed to uniformly process the fund processing business of multiple business systems with the same fund processing function. Shared nodes are used to improve the reuse rate, and automated transaction closed-loop processing reduces labor costs.
It effectively reduces development and manpower costs, improves the reusability of fund processing functions and the processing efficiency of transfer transactions, and achieves fast and accurate matching of transaction processing rules.
Smart Images

Figure CN114254921B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of financial technology (Fintech), and in particular to a method and apparatus for matching transaction processing rules. Background Technology
[0002] With the development of computer technology, more and more technologies are being applied in the financial sector, and the traditional financial industry is gradually transforming into fintech. However, due to the security and real-time requirements of the financial industry, higher demands are being placed on technology. In areas such as financial transfer transactions, there are often fund processing needs (such as fund clearing needs). Therefore, in order to ensure that fund transfer transactions can be processed normally, how to process fund transfer transactions has become an urgent problem to be solved.
[0003] Currently, if a financial institution (or financial enterprise) has multiple different business systems that all involve fund processing operations, it typically develops a fund processing function for each business system. This allows each system to process fund transfer transactions using its own dedicated fund processing function. However, these different business systems may have identical fund processing functions, leading to redundant development of these functions. This results in high development costs and low reusability for fund processing functions.
[0004] In summary, there is an urgent need for a transaction processing rule matching method to effectively reduce development and labor costs and improve the processing efficiency of transfer transactions. Summary of the Invention
[0005] This invention provides a transaction processing rule matching method and apparatus to effectively reduce development costs and labor costs, and to effectively improve the processing efficiency of transfer transactions.
[0006] In a first aspect, embodiments of the present invention provide a transaction processing rule matching method, applied to a transaction processing rule matching component, the method comprising:
[0007] For any business system, when a transfer transaction request initiated by the business system is detected, the key transaction information in the transfer transaction corresponding to the transfer transaction request is determined from the transfer transaction request;
[0008] Each key element in the key transaction information is sequentially matched with each first node in the transaction processing rule network tree to determine multiple first matching nodes, and a second node that the multiple first matching nodes commonly point to is determined. The transaction processing rule corresponding to the second node is determined based on the commonly pointed-to second node. The transaction processing rule network tree is constructed based on each key element in each transaction processing rule stored in the transaction processing rule database. The transaction processing rule network tree includes a first node representing each key element and a second node representing multiple key elements.
[0009] The transfer transaction is processed according to the aforementioned transaction processing rules.
[0010] In the aforementioned technical solutions, existing solutions configure a fund processing function for each different business system, which may lead to redundant development for systems with the same fund processing function. This results in high development costs and low reusability for fund processing functions. Therefore, the technical solution of this invention introduces a transaction processing rule matching component to uniformly handle fund processing business of multiple business systems with the same fund processing function. This avoids developing separate fund processing functions for each business system, effectively reducing development and labor costs, and improving the reusability of fund processing functions. Specifically, for any business system, when a transfer transaction request initiated by that business system is detected, the key transaction information of the transfer transaction corresponding to the transfer transaction request can be determined from the request. Each key element in the key transaction information is matched sequentially with the first nodes in the transaction processing rule network tree to determine multiple first matching nodes. A second node that these multiple first matching nodes commonly point to is then determined. By identifying the common second node, the transaction processing rule corresponding to that second node (i.e., the transaction processing rule corresponding to the transfer transaction) can be quickly and accurately determined. Then, the transaction processing rule can be used to automatically and effectively process the transfer transaction. In this way, the solution can uniformly handle the fund processing business of multiple business systems with the same transaction processing logic through a transaction processing rule matching component. This effectively reduces development and labor costs. Furthermore, because the transaction processing rule network tree constructed by this solution contains shared nodes (i.e., reused nodes, meaning transaction processing rules with the same key elements share common nodes), the reuse rate of fund processing functions can be improved (i.e., node reuse rate is increased). In addition, because there are shared nodes in the transaction processing rule network tree, the matching path can be shortened when matching transaction processing rules, thus enabling faster and more accurate matching of the transaction processing rule corresponding to the transfer transaction, thereby effectively improving the processing efficiency of transfer transactions.
[0011] Optionally, the transaction processing rule network tree is determined in the following manner:
[0012] Retrieve each transaction processing rule from the transaction processing rule database;
[0013] For each transaction processing rule, multiple key elements are identified from the transaction processing rule, and for each key element, if it is determined that there is no first node corresponding to the key element in the transaction processing rule network tree, a first node corresponding to the key element is created in the transaction processing rule network tree.
[0014] For each transaction processing rule, establish the pointing relationship between each first node and second node of the transaction processing rule, and establish the association relationship between the second node and the transaction processing rule, thereby generating the transaction processing rule network tree.
[0015] In the above technical solution, when constructing the transaction processing rule network tree, for each transaction processing rule in the transaction processing rule database, multiple key elements are identified within that rule. For each key element, if it is determined that a first node corresponding to that key element does not exist in the transaction processing rule network tree, a first node corresponding to that key element is created within the network tree. Simultaneously, the pointing relationships between the first and second nodes corresponding to these multiple key elements are established, as well as the association relationships between the second nodes and the transaction processing rules. In this way, the solution avoids repeatedly creating the same nodes, thereby improving the reuse rate of shared nodes (i.e., shared identical nodes) and effectively shortening the matching path required when matching transaction processing rules with the same shared nodes.
[0016] Optionally, it also includes:
[0017] When it is determined that a first node corresponding to the key element exists in the transaction processing rule network tree, a child node of the first node is established based on the similarity node information; the similarity node information includes each transaction processing rule that has the same first node.
[0018] For each transaction processing rule, establish the pointing relationship between each first node and second node of the transaction processing rule, including:
[0019] For each first node, determine the first transaction processing rule to which the first node belongs;
[0020] Based on each first node in the first transaction processing rule, a second node is created and a pointing relationship is established between each first node and the second node in the first transaction processing rule; if the first node has child nodes, a second transaction processing rule is determined according to the similarity node information, and a pointing relationship is established between each first node and the corresponding second node in the second transaction processing rule, until all child nodes of the first node have been traversed.
[0021] In the above technical solution, when it is determined that a first node corresponding to the key element exists in the transaction processing rule network tree, it is necessary to establish child nodes of this first node so that it is clear and intuitive to know that multiple transaction processing rules share this first node. Furthermore, based on the multiple first nodes corresponding to the same transaction processing rule, a second node that all these first nodes point to is established. Simultaneously, it is also possible to clearly and accurately determine other transaction processing rules corresponding to this first node based on its child nodes, and to facilitate establishing the pointing relationships between each first node in other transaction processing rules and the second node pointed to by that first node. Thus, this solution, for each transaction processing rule, establishes pointing relationships between each first node corresponding to that transaction processing rule and the commonly pointed-to second node, which facilitates timely and accurate matching of the transaction processing rule corresponding to any transfer transaction from multiple pointing relationships when determining the transaction processing rule for that transfer transaction.
[0022] Optionally, processing the transfer transaction according to the transaction processing rules includes:
[0023] The transaction initiator, transaction recipient, and transaction executor are determined from the aforementioned transaction processing rules;
[0024] Based on the transaction initiator and the transaction recipient, an execution request for the transfer transaction is constructed and sent to the transaction executor;
[0025] The system determines whether the transfer transaction was executed normally by analyzing the response information provided by the transaction executor to the execution request.
[0026] If not, obtain the exception handling scheme corresponding to the transaction processing rule, and process the transfer transaction accordingly using the exception handling scheme.
[0027] In the above technical solution, in order to achieve automatic completion of the transaction loop and avoid manual intervention, thereby effectively reducing labor costs, the solution automatically processes the transfer transaction according to the corresponding exception handling scheme when it is determined that the transfer transaction cannot be executed normally, thereby improving the efficiency of exception handling for transfer transactions.
[0028] Optionally, the step of processing the transfer transaction according to the exception handling scheme includes:
[0029] If the exception handling scheme is to reverse the transfer transaction, then when it is determined that there is reversal interface pointer information in the interface pointer information of the business interface used to process the transfer transaction of the transaction executor, a reverse transaction task is generated and the reverse transaction task is stored in the task database; the reverse transaction task is used to instruct the execution of the transfer transaction sent by the transaction receiver to the transaction initiator.
[0030] If the exception handling scheme is to query only the transfer transaction, then when it is determined that there is query interface pointer information in the interface pointer information of the business interface used to process the transfer transaction of the transaction executor, a query transaction task is generated and the query transaction task is stored in the task database; the query transaction task is used to instruct the query of the account address of the transaction initiator and the account address of the transaction recipient.
[0031] If the exception handling scheme is to cancel the transfer transaction, then when it is determined that there is cancellation interface pointer information in the interface pointer information of the business interface used to process the transfer transaction of the transaction executor, a cancellation transaction task is generated and the cancellation transaction task is stored in the task database; the cancellation transaction task is used to indicate the cancellation of the transfer transaction sent by the transaction initiator to the transaction recipient.
[0032] In the above technical solution, the corresponding exception handling scheme set for each transaction processing rule is used to automatically handle the abnormal situation of the transfer transaction corresponding to that transaction processing rule, thereby realizing the automatic completion of the transaction loop, avoiding manual intervention, and thus effectively reducing labor costs.
[0033] Optionally, it also includes:
[0034] The trigger scheduling thread retrieves triggers for tasks to be executed from the trigger database; the task to be executed is any one of the reverse transaction task, the query transaction task, or the undo transaction task.
[0035] When the execution time of the task to be executed is determined by the trigger of the task to be executed, the task scheduler retrieves the task to be executed from the task database and executes the task to be executed.
[0036] In the above technical solution, a corresponding trigger is configured for each task so that when the scheduled task processing component polls for the task, it can promptly trigger the execution of the task through the trigger. That is, the trigger scheduling thread periodically retrieves the triggers for the tasks to be executed from the trigger database, and when the execution time of the task to be executed is determined to be met, the task scheduler can promptly retrieve the task to be executed from the task database and execute the task.
[0037] Optionally, determining the key transaction information in the transfer transaction corresponding to the transfer transaction request from the transfer transaction request includes:
[0038] The transfer transaction request is parsed and processed to obtain multiple transaction information in the transfer transaction corresponding to the transfer transaction request;
[0039] From the multiple transaction information, key transaction information is determined to characterize the transaction characteristics of the transfer transaction.
[0040] In the above technical solution, by parsing and processing the transfer transaction request, multiple transaction information in the corresponding transfer transaction can be obtained, and key transaction information that can characterize the transaction characteristics of the transfer transaction can be selected from these multiple transaction information. This provides a strong guarantee for timely and accurate matching of the corresponding transaction processing rules from the transaction processing rule network tree using the key transaction information.
[0041] Secondly, embodiments of the present invention also provide a transaction processing rule matching device, applied to a transaction processing rule matching component, the device comprising:
[0042] The detection unit is used to, for any business system, when a transfer transaction request initiated by the business system is detected, determine the key transaction information in the transfer transaction corresponding to the transfer transaction request from the transfer transaction request;
[0043] The processing unit is configured to sequentially match each key element in the key transaction information with each first node in the transaction processing rule network tree to determine multiple first matching nodes, and to determine a second node that the multiple first matching nodes commonly point to. The transaction processing rule corresponding to the second node is then determined based on the commonly pointed-to second node. The transaction processing rule network tree is constructed based on each key element in each transaction processing rule stored in the transaction processing rule database. The transaction processing rule network tree includes a first node representing each key element and second nodes representing multiple key elements. The transfer transaction is processed using the transaction processing rules.
[0044] Optionally, the processing unit is specifically used for:
[0045] Retrieve each transaction processing rule from the transaction processing rule database;
[0046] For each transaction processing rule, multiple key elements are identified from the transaction processing rule, and for each key element, if it is determined that there is no first node corresponding to the key element in the transaction processing rule network tree, a first node corresponding to the key element is created in the transaction processing rule network tree.
[0047] For each transaction processing rule, establish the pointing relationship between each first node and second node of the transaction processing rule, and establish the association relationship between the second node and the transaction processing rule, thereby generating the transaction processing rule network tree.
[0048] Optionally, the processing unit is further configured to:
[0049] When it is determined that a first node corresponding to the key element exists in the transaction processing rule network tree, a child node of the first node is established based on the similarity node information; the similarity node information includes each transaction processing rule that has the same first node.
[0050] The processing unit is specifically used for:
[0051] For each first node, determine the first transaction processing rule to which the first node belongs;
[0052] Based on each first node in the first transaction processing rule, a second node is created and a pointing relationship is established between each first node and the second node in the first transaction processing rule; if the first node has child nodes, a second transaction processing rule is determined according to the similarity node information, and a pointing relationship is established between each first node and the corresponding second node in the second transaction processing rule, until all child nodes of the first node have been traversed.
[0053] Optionally, the processing unit is specifically used for:
[0054] The transaction initiator, transaction recipient, and transaction executor are determined from the aforementioned transaction processing rules;
[0055] Based on the transaction initiator and the transaction recipient, an execution request for the transfer transaction is constructed and sent to the transaction executor;
[0056] The system determines whether the transfer transaction was executed normally by analyzing the response information provided by the transaction executor to the execution request.
[0057] If not, obtain the exception handling scheme corresponding to the transaction processing rule, and process the transfer transaction accordingly using the exception handling scheme.
[0058] Optionally, the processing unit is specifically used for:
[0059] If the exception handling scheme is to reverse the transfer transaction, then when it is determined that there is reversal interface pointer information in the interface pointer information of the business interface used to process the transfer transaction of the transaction executor, a reverse transaction task is generated and the reverse transaction task is stored in the task database; the reverse transaction task is used to instruct the execution of the transfer transaction sent by the transaction receiver to the transaction initiator.
[0060] If the exception handling scheme is to query only the transfer transaction, then when it is determined that there is query interface pointer information in the interface pointer information of the business interface used to process the transfer transaction of the transaction executor, a query transaction task is generated and the query transaction task is stored in the task database; the query transaction task is used to instruct the query of the account address of the transaction initiator and the account address of the transaction recipient.
[0061] If the exception handling scheme is to cancel the transfer transaction, then when it is determined that there is cancellation interface pointer information in the interface pointer information of the business interface used to process the transfer transaction of the transaction executor, a cancellation transaction task is generated and the cancellation transaction task is stored in the task database; the cancellation transaction task is used to indicate the cancellation of the transfer transaction sent by the transaction initiator to the transaction recipient.
[0062] Optionally, the processing unit is specifically used for:
[0063] The trigger scheduling thread retrieves triggers for tasks to be executed from the trigger database; the task to be executed is any one of the reverse transaction task, the query transaction task, or the undo transaction task.
[0064] When the execution time of the task to be executed is determined by the trigger of the task to be executed, the task scheduler retrieves the task to be executed from the task database and executes the task to be executed.
[0065] Optionally, the detection unit is specifically used for:
[0066] The transfer transaction request is parsed and processed to obtain multiple transaction information in the transfer transaction corresponding to the transfer transaction request;
[0067] From the multiple transaction information, key transaction information is determined to characterize the transaction characteristics of the transfer transaction.
[0068] Thirdly, embodiments of the present invention provide a computing device, including at least one processor and at least one memory, wherein the memory stores a computer program, and when the program is executed by the processor, the processor executes any of the transaction processing rule matching methods described in the first aspect.
[0069] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program executable by a computing device, wherein when the program is run on the computing device, the computing device performs any of the transaction processing rule matching methods described in the first aspect. Attached Figure Description
[0070] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0071] Figure 1 A flowchart illustrating a transaction processing rule matching method provided in an embodiment of the present invention;
[0072] Figure 2 A constructed Rete network diagram provided in an embodiment of the present invention;
[0073] Figure 3a A schematic diagram of an Alpha network constructed according to the traditional Rete algorithm is provided in an embodiment of the present invention;
[0074] Figure 3b A schematic diagram of an Alpha network constructed according to an improved Rete algorithm, provided for an embodiment of the present invention;
[0075] Figure 4a A schematic diagram of a Beta network constructed according to the traditional Rete algorithm is provided in an embodiment of the present invention;
[0076] Figure 4b A schematic diagram of a Beta network constructed according to an improved rete algorithm, provided for an embodiment of the present invention;
[0077] Figure 5 This is a flowchart illustrating a process for handling abnormal situations in fund transfer transactions, provided as an embodiment of the present invention.
[0078] Figure 6 This is a schematic diagram of the structure of a transaction processing rule matching device provided in an embodiment of the present invention;
[0079] Figure 7This is a schematic diagram of the structure of a computing device provided in an embodiment of the present invention. Detailed Implementation
[0080] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0081] The following explanations will first clarify some of the terms used in the embodiments of the present invention to facilitate understanding by those skilled in the art.
[0082] (1) AlphaNetWork: Filters working memory, finds the set that meets each pattern in the rules, and generates Alpha memory (the set that meets the pattern). There are two types of nodes: nodes that are filtered by type and nodes that are filtered by other conditions.
[0083] (2) BetaNetWork: There are two types of nodes: Beta Memory and Join Node. The former mainly stores the set after the Join is completed. The latter contains two input ports, which take in the two sets that need to be matched. The Join Node performs the merging work and transmits the data to the next node.
[0084] (3) Facts: refers to the relationships between objects and the attributes of objects.
[0085] (4) Object: refers to the facts or data that match the rules in the rete algorithm.
[0086] The above describes some of the terms used in the embodiments of the present invention. The technical features involved in the embodiments of the present invention will be described below.
[0087] Figure 1 An exemplary embodiment of the present invention illustrates the flow of a transaction processing rule matching method, which can be executed by a transaction processing rule matching device. Specifically, the transaction processing rule matching method in this embodiment is applied to a transaction processing rule matching component.
[0088] like Figure 1 As shown, the process specifically includes:
[0089] Step 101: For any business system, when a transfer transaction request initiated by the business system is detected, the key transaction information in the transfer transaction corresponding to the transfer transaction request is determined from the transfer transaction request.
[0090] In this embodiment of the invention, a financial enterprise or institution may deploy multiple different business systems, each requiring a fund processing function. However, these fund processing functions may share common or partially identical logic. Developing a separate fund processing function for each system would lead to redundant development, wasting development resources and increasing costs. To address this, the technical solution of this invention designs a unified and standardized transaction processing rule matching component to implement fund processing functions across different business systems. Therefore, for any business system, when the transaction processing rule matching component detects a transfer transaction request from that system, the request will parse out multiple transaction information entries from the request. It can then extract key transaction information that characterizes the transaction's features. For example, not all transaction information included in a transfer transaction can fully represent its characteristics (e.g., unique attributes of each transfer transaction that can be used to identify it). Some transaction information might be additional information required for every transaction and has no impact on the transaction itself, thus failing to reflect its specific characteristics. However, some transaction information with unique features can serve as key information for distinguishing the transfer. This key information allows for timely and accurate matching of the corresponding transaction processing rule from the transaction processing rule network tree.
[0091] Step 102: Match each key element in the key transaction information with each first node in the transaction processing rule network tree in sequence to determine multiple first matching nodes, and determine the second node that the multiple first matching nodes point to in common, and determine the transaction processing rule corresponding to the second node based on the second node that points to in common.
[0092] In this embodiment of the invention, the transaction processing rule network tree is constructed based on the key elements of each transaction processing rule stored in the transaction processing rule database. The transaction processing rule network tree includes a first node representing each key element and second nodes representing multiple key elements. A pointing relationship exists between the first and second nodes that share the same key element. Each first node is unique, and each second node corresponds to a specific transaction processing rule. Specifically, the transaction processing rule matching component matches each key element in the transaction key information with each first node in the transaction processing rule network tree sequentially. This accurately identifies multiple first matching nodes. Through these multiple first matching nodes, the second node that all the multiple first matching nodes point to can be accurately matched from the transaction processing rule network tree. Finally, the transaction processing rule corresponding to the transfer transaction can be accurately obtained through this second node.
[0093] The transaction processing rule network tree is determined as follows: When the transaction processing rule matching component starts, each transaction processing rule is retrieved from the transaction processing rule database. For each transaction processing rule, multiple key elements are identified. For any key element, if it is determined that there is no corresponding first node in the transaction processing rule network tree, a first node corresponding to that key element can be created in the transaction processing rule network tree. Simultaneously, for each transaction processing rule, a pointing relationship is established between each first node corresponding to the multiple key elements in that transaction processing rule and a second node that all the first nodes commonly point to. An association relationship is also established between the second node and its corresponding transaction processing rule, thereby generating a transaction processing rule network tree containing all transaction processing rules. When it is determined that there is a first node corresponding to a key element in the transaction processing rule network tree, child nodes of that first node can be created based on similarity node information; the similarity node information can include transaction processing rules with the same first node. Furthermore, when establishing the pointing relationships between the first nodes corresponding to multiple key elements in a transaction processing rule and the second nodes that these first nodes commonly point to, the transaction processing rule matching component determines the first transaction processing rule to which each first node belongs. Based on the first nodes corresponding to the first transaction processing rule, it creates second nodes, each containing the key elements corresponding to the first nodes. Then, it establishes the pointing relationships between the first nodes and the second nodes. Simultaneously, the transaction processing rule matching component needs to determine whether the first node has child nodes. If it is determined that the first node has child nodes, it determines the second transaction processing rule that commonly contains the key elements corresponding to the first node based on similarity node information, and establishes the pointing relationships between the first nodes and the corresponding second nodes in the second transaction processing rule. This process continues until all child nodes of the first node have been traversed, thereby generating a transaction processing rule network tree. The second nodes corresponding to the second transaction processing rule are created based on the first nodes in the second transaction processing rule (each first node contains a first node shared with the first transaction processing rule). In this way, the scheme can avoid repeatedly creating the same nodes, thereby improving the reuse rate of shared nodes (i.e., shared identical nodes), effectively shortening the matching path required when matching transaction processing rules with the same shared nodes, and facilitating timely and accurate matching of the transaction processing rules corresponding to any transfer transaction from multiple pointing relationships when determining the transaction processing rules for any transfer transaction.
[0094] For example, when the transaction processing rule matching component (such as the funds processing engine) starts, it can retrieve information on each transaction processing rule from the transaction processing rule database to create a transaction processing rule network tree (e.g., using an improved Rete algorithm to construct a Rete network graph). For the improved Rete algorithm, firstly, it is necessary to calculate the similarity between each transaction processing rule piece of information, that is, to determine the similarity between any two transaction processing rule pieces of information in the following way:
[0095] S[] = Index(Rule) i Rule i+1 )
[0096] For example, the implementation process of calculating the similarity between any two transaction processing rule information is described using the transaction processing rule information in Table 1 below as an example.
[0097] Table 1
[0098] Transaction processing rule identifier Transaction processing rules <![CDATA[R1]]> WB01→D01, UPP <![CDATA[R2]]> WB02→D02, DEP <![CDATA[R3]]> WB02→D02, CRH <![CDATA[R4]]> WB02→D02, ICB <![CDATA[R5]]> WB05, WB <![CDATA[R6]]> WB03→T02, ALI
[0099] Among them, Rx (e.g., R1) is used to represent the transaction processing rule sequence number, WBXX (e.g., WB01) is used to represent the internal account code of WB institution, DXX (e.g., D01) is used to represent the margin account, TXX (e.g., T02) is used to represent the platform account, and UPP, DEP, CRH, ICB, WB, ALI, etc. are used to represent payment institution information.
[0100] The similarity calculation formula above can be used to determine the similarity between the transaction processing rules shown in Table 1. For example, it can be determined that there is no similarity between R1 and R2, and that there is similarity between R2 and R3, i.e., S[] = [WB02→D02]. There is similarity between R2 and R4, i.e., S[] = [WB02→D02]. There is similarity between R3 and R4, i.e., S[] = [WB02→D02].
[0101] Then, based on the transaction processing rules and the similarity information between them, a Rete network graph can be constructed. The Rete network graph mainly consists of two parts: the Alpha network (AlphaNetWork) and the Beta network (BetaNetWork). The Alpha network includes the Root and Alpha memory. The Root is the entry point for all fact objects (such as any key element) into the Rete network graph; Alpha Memory stores the WMEs (Working Memory elements, matching node elements) filtered by the Alpha network and performs node reuse based on shared nodes. The Beta network connects the Alpha nodes. During the construction of the Beta network, the Alpha nodes are traversed to construct the Beta network. Thus, for each transaction processing rule shown in Table 1, a network graph can be constructed as follows: Figure 2 The diagram shows the Rete network. The Alpha network algorithm works as follows: 1. For any transaction processing rule, obtain the corresponding fact and similarity information of that rule; 2. Determine if a node corresponding to that fact exists in the current Alpha network. If not, create a new Alpha node; if it already exists, determine if the similarity information of the transaction rule contains that fact. If so, create a child node at the current Alpha node's position; 3. Repeat steps 1 and 2 until all transaction processing rules are processed. The Beta network algorithm works as follows: 1. Obtain the Alpha network constructed using the Alpha network algorithm and extract any node from it; 2. Determine if the node exists in the current Beta network. If not, create a new Beta node; if it already exists, add the current node to the existing Beta network, with its parent nodes being the existing node and the current Alpha node; 3. Repeat steps 1 and 2 until all nodes in the Alpha network have been traversed.
[0102] Specifically, the funds processing engine first creates a root node (Root), and then constructs an Alpha network based on the Alpha network algorithm. Taking the transaction processing rules shown in Table 1 as an example, the specific implementation process of constructing the Alpha network is as follows:
[0103] Step a: Retrieve the fact WB01->D01 corresponding to transaction processing rule R1. At this time, there is no WB01->D01 node in the Alpha network, so create the WB01->D01 node and the UPP node.
[0104] Step b: Extract the fact WB02->D02 corresponding to transaction processing rule R2. At this time, there is no WB02->D02 node in the Alpha network, so create the WB02->D02 node and the DEP node.
[0105] Step c: Extract the fact WB02->D02 corresponding to transaction processing rule R3. At this time, the node WB02->D02 already exists in the Alpha network. It is determined that the similarity information between transaction processing rule R2 and transaction processing rule R3 contains the fact WB02->D02. Then, a child node 1 is created at the original location of WB02-D02, and an Alpha node CRH is created.
[0106] Step d: Extract the fact WB02->D02 corresponding to transaction processing rule R4. At this time, the node WB02->D02 already exists in the Alpha network. It is determined that the similarity information between transaction processing rule R3 and transaction processing rule R4 contains the fact WB02->D02. Then, a child node 2 is created in the original WB02-D02, and an Alpha node ICB is created.
[0107] Step e: Retrieve the fact WB05 corresponding to transaction processing rule R5. At this time, there is no WB05 node in the Alpha network, so create the WB05 node and the WB node.
[0108] Step f: Extract the fact WB03->T02 corresponding to transaction processing rule R6. At this time, there is no WB03->T02 node in the Alpha network, so create the WB03->T02 node and the ALI node.
[0109] The funds processing engine constructs a Beta network based on the Beta network algorithm. Taking the transaction processing rules shown in Table 1 as an example, the specific implementation process for constructing the Beta network is as follows:
[0110] Step a: Take out the Alpha node (WB01->D01 node) in the Alpha network, and create the Beta node (WB01->D01, UPP) based on the left input node (WB01->D01 node) and the right input node (UPP node) used to build the Beta node.
[0111] Step b: Take out the Alpha node (WB02->D02 node) from the Alpha network, and create the Beta node (WB02->D02, DEP) based on the left input node (WB02->D02 node) and the right input node (DEP node) used to construct the Beta node.
[0112] Step c: If the current Alpha node (WB02->D02 node) has an Alpha child node, then a shared node (WB02->D02 node) exists. A transaction processing rule corresponding to this shared node can be determined. Based on the left input node (WB02->D02 node) used to construct the Beta node and the CRH node corresponding to this transaction processing rule used as the right input node, a Beta node (WB02->D02, CRH) is created. This process is repeated until all child nodes have been traversed.
[0113] Step d: Take out the Alpha node (WB05 node) from the Alpha network, and create the Beta node (WB05, WB) based on the left input node (WB05 node) and right input node (WB node) used to construct the Beta node.
[0114] Step e: Take out the Alpha node (WB03->T02 node) in the Alpha network, and create the Beta node (WB03->T02, ALI) based on the left input node (WB03->T02 node) and the right input node (ALI node) used to construct the Beta node.
[0115] pass Figure 2 As shown in the Rete network diagram, there are three WB02->D02 patterns among the transaction processing rules contained in the Rete network diagram. However, there is only one Alpha node in the Rete network diagram, corresponding to these three WB02->D02 patterns. By reusing this Alpha node (i.e., the WB02->D02 node), three transaction processing rules can be matched. This solves the problem in the existing Rete algorithm where the number of system nodes increases proportionally with the number of rules. In particular, when the transaction processing rules are highly similar, effectively reusing shared nodes (i.e., common identical nodes) can effectively solve the problems of excessive number of nodes and long matching paths.
[0116] After the funds processing engine constructs the rete network graph, it can match the transaction processing rules corresponding to any transfer transaction request using the rete network graph. For example, when a transfer transaction request initiated by a business system arrives at the funds processing engine, the engine first parses the request, extracts the transfer transaction itself, and extracts the facts within the transaction (such as key transaction information). These facts are then matched against the rete network graph to determine the corresponding transaction processing rules. The matching process of the rete network graph is scheduled by a central thread. When a fact enters from the Root node, the Alpha network part first performs rule matching, obtaining multiple matching nodes, which are then stored in Alpha Memory (the area used to store the nodes matched by the Alpha network). Then, based on these multiple matching nodes, the Beta network part performs matching, ultimately determining the transaction processing rules corresponding to the transfer transaction request. In other words, the Beta network primarily uses join nodes to test variable binding between conditions and stores the matching results in the Beta memory. Once the Beta node completes the matching, it proceeds to the terminal node for output, thus obtaining the corresponding transaction processing rules. For example, suppose the facts parsed from a transfer transaction request are WB02→D02, CRH, channelID=2, merchantID=1. This fact is first entered from the root node of the corresponding rete network graph, and WB02→D02, CRH, channelID=2, merchantID=1 is matched in AlphaNetwork. Simultaneously, this WB02→D02, CRH, channelID=2, merchantID=1 is stored in AlphaMemory. The transaction processing rule corresponding to this fact participates in the construction of a certain rete network graph. The Alpha network of this rete network graph contains the Alpha nodes of the transaction processing rule corresponding to this fact, namely the WB02→D02 node, the CRH node, the channelID=2 node, and the merchantID=1 node. Then, it flows to the BetaNetwork for matching. After matching a certain Beta node that the WB02→D02 node, the CRH node, the channelID=2 node, and the merchantID=1 node all point to, the transaction processing rule associated with that Beta node (such as transaction processing rule R2) can be obtained, which is the transaction processing rule corresponding to this transfer transaction request.
[0117] For example, in the traditional Rete algorithm, the Alpha and Beta networks in the Rete network do not effectively reuse nodes. First, let's examine the presence of Alpha nodes in the Alpha network. Suppose there are two transaction processing rules with patterns (W1, W2, ..., Wn, Wm1, Wm2, ..., Wmn) and (W1, W2, ..., Wn, Wx1, Wx2, ..., Wxn), where the same W index indicates the same type of judgment condition. We can see from the pattern distribution that these two patterns have n identical judgment conditions. The corresponding Alpha network is as follows: Figure 3a As shown, by Figure 3a It can be seen that the overlap between nodes is high, and effective reuse is not achieved for shared nodes. However, by constructing the Alpha network for these two transaction processing rules according to the technical solution in this embodiment of the invention, a network such as... can be constructed. Figure 3b The Alpha network shown has shared nodes, consisting of... Figure 3b It can be seen that the node reuse rate is high, and the matching path is also shorter, so the same node can handle more transaction processing rule matching. Now let's look at the situation where Beta nodes exist in the Beta network. Suppose there are two transaction processing rules with patterns (N1, N2, N3) and (N1, N2, N3, N4), where the same N subscript indicates the same type of judgment condition. The corresponding Beta network model is as follows. Figure 4a As shown, by Figure 4a It can be seen that the overlap between nodes is high, and effective reuse is not achieved for shared nodes. However, by constructing the Alpha network for these two transaction processing rules according to the technical solution in this embodiment of the invention, a network such as... can be constructed. Figure 4b The Beta network shown has shared nodes, and is composed of... Figure 4b As can be seen, the node reuse rate is high and the matching path is shorter, so the same node can handle more transaction processing rule matching.
[0118] To test the performance of the improved rete algorithm, this embodiment of the invention compares the performance of the traditional and improved rete algorithms in a CentOS (Community Enterprise Operating System) environment. The results are shown in Tables 2 and 3. Table 2 shows the results for a CentOS 7 system with 4GB of memory, an 8-core CPU, and 1000 transaction processing rules; Table 3 shows the results for a CentOS 7 system with 4GB of memory, an 8-core CPU, and 2000 transaction processing rules.
[0119] Table 2
[0120]
[0121]
[0122] Table 3
[0123]
[0124] As shown in Tables 2 and 3 above, the improved Rete algorithm has a significant advantage in execution time compared to the traditional Rete algorithm, and this advantage increases with the number of transaction processing rules. Clearly, the improved Rete algorithm offers a substantial performance improvement. Moreover, as the number of events increases dramatically, the execution efficiency of the improved Rete algorithm will become increasingly higher, better meeting the real-time requirements of financial trading systems and providing users with a better experience.
[0125] Step 103: Process the transfer transaction according to the transaction processing rules.
[0126] In this embodiment of the invention, after obtaining the transaction processing rules corresponding to the transfer transaction request, the transaction initiator, transaction recipient, and transaction executor can be determined from these rules. Based on the transaction initiator and recipient, an execution request for the transfer transaction is constructed and sent to the transaction executor. Upon receiving the execution request, the executor processes the transfer transaction within it and feeds back the execution result to the transaction processing rule matching component. The transaction processing rule matching component determines whether the transfer transaction was executed normally based on the execution result reported by the transaction executor. If the transaction executor reports an execution error, the transaction processing rule matching component will determine if the transaction execution is abnormal (e.g., timeout, interruption due to network issues, or failure to deduct funds from the initiator's account). It will then implement an error handling scheme matching the transaction processing rules corresponding to the transfer transaction to process it accordingly. If the transaction executor reports successful execution, the transaction processing rule matching component will confirm the completion of the transfer transaction.
[0127] Specifically, when processing a transfer transaction using an exception handling scheme that matches the transaction processing rules corresponding to that transaction, if the exception handling scheme is to reverse the transfer transaction (meaning the transaction processing rules also define reversal support), then if the interface pointer information of the business interface used by the transaction executor to process the transfer transaction contains reversal interface pointer information, a reverse transaction task is generated and stored in the task database. This reverse transaction task instructs the execution of a transfer transaction sent by the transaction recipient to the transaction initiator, meaning the transaction recipient returns the received funds to the transaction initiator. If the exception handling scheme is to only query the transfer transaction (meaning the transaction processing rules also define query support but not reversal support), then if the interface pointer information of the business interface used by the transaction executor to process the transfer transaction contains query interface pointer information, a query transaction task is generated and stored in the task database. This query transaction task instructs the query of the account address of the transaction initiator and the account address of the transaction recipient. If the exception handling scheme is to cancel the transfer transaction, meaning the transaction processing rule corresponding to the transfer transaction also defines that the transfer transaction supports cancellation, then when it is determined that the interface pointer information of the business interface used to process the transfer transaction of the transaction executor contains cancellation interface pointer information, a cancellation transaction task is generated and stored in the task database. This cancellation transaction task is used to instruct the cancellation of the transfer transaction sent by the transaction initiator to the transaction recipient. In this way, by using the corresponding exception handling scheme set for each transaction processing rule, appropriate handling is automatically performed for exceptions in the transfer transactions corresponding to that rule, thereby achieving automatic completion of the transaction loop, avoiding manual intervention, and effectively reducing labor costs.
[0128] After the transaction processing rule matching component stores the generated tasks into the task database, the system sets up a scheduled task processing component to periodically poll the tasks and execute the polled tasks. That is, the technical solution in this embodiment of the invention configures a corresponding trigger for each task so that when the scheduled task processing component polls for that task, it can promptly trigger the execution of that task through the trigger. Specifically, the trigger scheduling thread periodically retrieves the triggers for the tasks to be executed from the trigger database. Based on the triggers of the tasks to be executed, when the execution time of the task to be executed is determined, the task scheduler can promptly retrieve the task to be executed from the task database and execute it. The task to be executed can be any one of a reverse transaction task, a query transaction task, or a reversal transaction task.
[0129] For example, after matching the transaction processing rules corresponding to the transfer request, the funds processing engine can initiate the actual transfer transaction—that is, execute the transfer transaction—through the transaction initiator, transaction recipient, and the system to be called (i.e., the transfer payment system, or payment institution) in the transaction processing rules. However, in actual production environments, various anomalies often occur. For example, when performing step-by-step deductions, user A's card has been successfully deducted, but deduction from user B's card times out. Traditionally, manual intervention is required, as the system cannot automatically perform compensation measures. Therefore, to solve the problem of the system automatically completing the transaction loop in abnormal situations, thereby avoiding manual intervention and effectively reducing labor costs, the funds processing engine has designed a transaction interface pointer and a timed rework task function. Under this function, the system can automatically complete subsequent transaction processing. (Refer to...) Figure 5 , Figure 5 This is a flowchart illustrating a process for handling abnormal situations in fund transfer transactions, provided by an embodiment of the present invention. Figure 5 The specific implementation process of the funds processing engine in handling abnormal situations in transfer transactions is as follows:
[0130] Step a: The funds processing engine matches the transaction processing rules for any transfer transaction request to determine the corresponding transaction processing rules.
[0131] Step b: The funds processing engine parses the matched transaction processing rules to determine the transaction initiator, transaction recipient, the payment system to be called, and transaction amount, among other transaction information.
[0132] Step c: The funds processing engine constructs an execution request for the transfer transaction using transaction information such as the transaction initiator, the transaction recipient, and the transaction amount, and sends the execution request to the payment system that needs to be invoked. The payment system that needs to be invoked executes the transfer transaction, that is, it transfers the transaction amount required by the transaction initiator to the transaction recipient, and feeds back the execution result of the transfer transaction to the funds processing engine.
[0133] Step d: The funds processing engine determines whether the transfer transaction was executed normally based on the execution result returned by the payment system that needs to be called. In other words, it determines whether the transfer transaction was successfully executed.
[0134] Step e: If the funds processing engine determines that an anomaly has occurred during the execution of the transfer transaction, it needs to obtain the current transaction pointer information and the anomaly handling solution corresponding to the transaction processing rule.
[0135] For example, the original transfer transaction was conducted via ALI payment postal route, transferring transaction funds from account A to account B, but an anomaly occurred during the transfer process.
[0136] 1. If the current transaction processing rules define that transfer transactions support reversal, then the reversal interface information is found based on the current transaction pointer information. Based on transaction information such as the transaction initiator, transaction recipient, and transaction amount, a reverse transaction task is generated and stored in the task database. In other words, a reverse transaction request is created to transfer transaction funds from account B to account A via the ALI payment route.
[0137] 2. If the current transaction processing rules define that transfer transactions support queries but not reversals, then the query interface information is found based on the current transaction pointer information. A query transaction task is generated based on transaction information such as the transaction initiator, transaction recipient, and transaction amount, and this task is stored in the task database. In other words, a query transaction request is created to query the ALI payment route, account A, and account B.
[0138] 3. If the current transaction processing rules define that transfer transactions support cancellation, then the cancellation interface information is found based on the current transaction pointer information. A cancellation transaction task is generated based on transaction information such as the transaction initiator, transaction recipient, and transaction amount, and this cancellation transaction task is stored in the task database. In other words, a transaction request to cancel the transfer from account A to account B is created via the ALI payment mail route.
[0139] Step f: The funds processing engine periodically polls the task database through the scheduled task processing component. When a pending task (such as a reverse transaction task, a query transaction task, or a cancel transaction task) is polled, the pending task is started, and the transaction processing rule matching logic is called to continue executing the pending task.
[0140] The interface transaction pointer utilizes Java's enumeration type feature and defines the following interface attribute values:
[0141] (1) Interface name;
[0142] (2) Interface description;
[0143] (3) Call address (url);
[0144] (4) Query interface pointer (queryIndex);
[0145] (5) Revoke the interface pointer (revokeIndex);
[0146] (6) Cancel the interface pointer (cancelIndx).
[0147] The interface attributes include pointers to the query interface, reversal interface, and cancellation interface. These pointers point to the addresses of the corresponding query interface, reversal interface, and cancellation interface. For example, if interface A is an interbank transfer interface, queryA is the query interface, revokeA is the reversal interface, and cancelA is the cancellation interface, then the definitions of these interfaces are as follows:
[0148] A(A interbank transfer, http: / / 192.168.3.133, queryA, revokeA, cancelA);
[0149] queryA(queryA, cross-bank transfer query, http: / / 192.168.3.133, null, null, null);
[0150] revokeA(revokeA, cross-bank transfer reversal, http: / / 192.168.3.133, queryA, null, null);
[0151] cancelA(cancelA, cross-bank transfer cancellation, http: / / 192.168.3.133, queryA, null, null).
[0152] The interface pointers above allow you to quickly obtain the types and definitions of the corresponding reversal, query, and cancellation interfaces. Furthermore, the transaction processing rules define whether the transfer transaction supports querying, cancellation, and reversal. When an anomaly occurs in the transfer transaction, the next processing step can be obtained from these rules.
[0153] The scheduled redo task function utilizes a Quartz component to implement a cluster task processing framework, resolving the issue of tasks being repeatedly pulled in a cluster environment. The implementation first defines an interface for a scheduled function, called a Task. Task has four implementation classes: a scheduled query task, a scheduled reversal task, a scheduled cancellation task, and a custom task. Task execution also requires a trigger to initiate task execution. The trigger's basic functions include specifying the Task's execution time, interval, number of runs, and whether to execute immediately. Finally, a Scheduler is defined to integrate the Task and the Trigger. The execution flow of the scheduled task is as follows:
[0154] a. The client first needs to generate a SchedulerFactory, and then implement its own customization in the fund processing engine using the following method.
[0155] Properties properties=new Properties();
[0156] properties.put("org.quartz.threadPool.class","cn.webank.cnc.clrengine.core.utils.ThreadPoolExecutorUtil.");
[0157] properties.put("org.quartz.threadPool.threadCount","25");
[0158] SchedulerFactory sf=new StdSchedulerFactory(properties);
[0159] b. Obtain a scheduler instance from the scheduler factory using the getScheduler() method. In this fund processing engine, the component's default scheduler is used.
[0160] c. The Scheduler has a QuartzSchedulerThread (a subclass of Thread) property. When the scheduler is instantiated, an object is instantiated and a thread object is started using ThreadExecutor. This thread is the scheduling thread, and its main task is to continuously retrieve triggers that are about to be triggered from the JobStore and execute the corresponding tasks using the retrieved triggers.
[0161] Through the above processing method, the system can automatically complete subsequent investigation and correction transactions in the event of abnormal transfer transactions. In financial systems, abnormal transaction situations are inevitable. Traditional transaction loops require manual intervention, which poses risks to timeliness and security. However, the technical solution provided by the embodiments of this invention can automatically handle abnormal transfer transactions, greatly reducing labor and time costs, and also reducing the risks of manual processing in terms of security.
[0162] The above embodiments show that, since existing technical solutions configure a fund processing function for each different business system, there may be redundant development for systems with the same fund processing function, resulting in high development costs and low reusability. Therefore, the technical solution of this invention introduces a transaction processing rule matching component to uniformly handle fund processing business of multiple business systems with the same fund processing function. This avoids developing separate fund processing functions for each business system, effectively reducing development and labor costs, and improving the reusability of the fund processing function. Specifically, for any business system, when a transfer transaction request initiated by that business system is detected, the key transaction information of the transfer transaction corresponding to the transfer transaction request can be determined from the transfer transaction request. Each key element in the key transaction information is matched sequentially with each first node in the transaction processing rule network tree to determine multiple first matching nodes, and a second node that these multiple first matching nodes commonly point to can be determined. By using the commonly pointed-to second node, the transaction processing rule corresponding to the second node (i.e., the transaction processing rule corresponding to the transfer transaction) can be quickly and accurately determined. Then, the transaction processing rule can be used to automatically and effectively process the transfer transaction. In this way, the solution can uniformly handle the fund processing business of multiple business systems with the same transaction processing logic through a transaction processing rule matching component. This effectively reduces development and labor costs. Furthermore, because the transaction processing rule network tree constructed by this solution contains shared nodes (i.e., reused nodes, meaning transaction processing rules with the same key elements share common nodes), the reuse rate of fund processing functions can be improved (i.e., node reuse rate is increased). In addition, because there are shared nodes in the transaction processing rule network tree, the matching path can be shortened when matching transaction processing rules, thus enabling faster and more accurate matching of the transaction processing rule corresponding to the transfer transaction, thereby effectively improving the processing efficiency of transfer transactions.
[0163] Based on the same technological concept Figure 6 An exemplary embodiment of the present invention provides a transaction processing rule matching apparatus, which can execute the flow of a transaction processing rule matching method. Specifically, the transaction processing rule matching apparatus in this embodiment is applied to a transaction processing rule matching component.
[0164] like Figure 6 As shown, the device includes:
[0165] The detection unit 601 is used to determine key transaction information in the transfer transaction corresponding to the transfer transaction request from the transfer transaction request when a transfer transaction request initiated by the business system is detected for any business system.
[0166] The processing unit 602 is configured to sequentially match each key element in the key transaction information with each first node in the transaction processing rule network tree to determine multiple first matching nodes, and determine a second node that the multiple first matching nodes commonly point to. The transaction processing rule corresponding to the second node is then determined based on the commonly pointed-to second node. The transaction processing rule network tree is constructed based on each key element in each transaction processing rule stored in the transaction processing rule database. The transaction processing rule network tree includes a first node representing each key element and second nodes representing multiple key elements. The transfer transaction is processed using the transaction processing rules.
[0167] Optionally, the processing unit 602 is specifically used for:
[0168] Retrieve each transaction processing rule from the transaction processing rule database;
[0169] For each transaction processing rule, multiple key elements are identified from the transaction processing rule, and for each key element, if it is determined that there is no first node corresponding to the key element in the transaction processing rule network tree, a first node corresponding to the key element is created in the transaction processing rule network tree.
[0170] For each transaction processing rule, establish the pointing relationship between each first node and second node of the transaction processing rule, and establish the association relationship between the second node and the transaction processing rule, thereby generating the transaction processing rule network tree.
[0171] Optionally, the processing unit 602 is further configured to:
[0172] When it is determined that a first node corresponding to the key element exists in the transaction processing rule network tree, a child node of the first node is established based on the similarity node information; the similarity node information includes each transaction processing rule that has the same first node.
[0173] The processing unit 602 is specifically used for:
[0174] For each first node, determine the first transaction processing rule to which the first node belongs;
[0175] Based on each first node in the first transaction processing rule, a second node is created and a pointing relationship is established between each first node and the second node in the first transaction processing rule; if the first node has child nodes, a second transaction processing rule is determined according to the similarity node information, and a pointing relationship is established between each first node and the corresponding second node in the second transaction processing rule, until all child nodes of the first node have been traversed.
[0176] Optionally, the processing unit 602 is specifically used for:
[0177] The transaction initiator, transaction recipient, and transaction executor are determined from the aforementioned transaction processing rules;
[0178] Based on the transaction initiator and the transaction recipient, an execution request for the transfer transaction is constructed and sent to the transaction executor;
[0179] The system determines whether the transfer transaction was executed normally by analyzing the response information provided by the transaction executor to the execution request.
[0180] If not, obtain the exception handling scheme corresponding to the transaction processing rule, and process the transfer transaction accordingly using the exception handling scheme.
[0181] Optionally, the processing unit 602 is specifically used for:
[0182] If the exception handling scheme is to reverse the transfer transaction, then when it is determined that there is reversal interface pointer information in the interface pointer information of the business interface used to process the transfer transaction of the transaction executor, a reverse transaction task is generated and the reverse transaction task is stored in the task database; the reverse transaction task is used to instruct the execution of the transfer transaction sent by the transaction receiver to the transaction initiator.
[0183] If the exception handling scheme is to query only the transfer transaction, then when it is determined that there is query interface pointer information in the interface pointer information of the business interface used to process the transfer transaction of the transaction executor, a query transaction task is generated and the query transaction task is stored in the task database; the query transaction task is used to instruct the query of the account address of the transaction initiator and the account address of the transaction recipient.
[0184] If the exception handling scheme is to cancel the transfer transaction, then when it is determined that there is cancellation interface pointer information in the interface pointer information of the business interface used to process the transfer transaction of the transaction executor, a cancellation transaction task is generated and the cancellation transaction task is stored in the task database; the cancellation transaction task is used to indicate the cancellation of the transfer transaction sent by the transaction initiator to the transaction recipient.
[0185] Optionally, the processing unit 602 is specifically used for:
[0186] The trigger scheduling thread retrieves triggers for tasks to be executed from the trigger database; the task to be executed is any one of the reverse transaction task, the query transaction task, or the undo transaction task.
[0187] When the execution time of the task to be executed is determined by the trigger of the task to be executed, the task scheduler retrieves the task to be executed from the task database and executes the task to be executed.
[0188] Optionally, the detection unit 601 is specifically used for:
[0189] The transfer transaction request is parsed and processed to obtain multiple transaction information in the transfer transaction corresponding to the transfer transaction request;
[0190] From the multiple transaction information, key transaction information is determined to characterize the transaction characteristics of the transfer transaction.
[0191] Based on the same technical concept, embodiments of the present invention also provide a computing device, such as... Figure 7 As shown, it includes at least one processor 701 and a memory 702 connected to at least one processor. In this embodiment of the invention, the specific connection medium between the processor 701 and the memory 702 is not limited. Figure 7 Taking the connection between the processor 701 and the memory 702 via a bus as an example, the bus can be divided into address bus, data bus, control bus, etc.
[0192] In this embodiment of the invention, the memory 702 stores instructions that can be executed by at least one processor 701. By executing the instructions stored in the memory 702, at least one processor 701 can perform the steps included in the aforementioned transaction processing rule matching method.
[0193] The processor 701 is the control center of the computing device, connecting various parts of the device via various interfaces and lines. It performs data processing by running or executing instructions stored in the memory 702 and accessing data stored in the memory 702. Optionally, the processor 701 may include one or more processing units. The processor 701 may integrate an application processor and a modem processor. The application processor primarily handles the operating system, user interface, and applications, while the modem processor primarily handles issuing instructions. It is understood that the modem processor may not be integrated into the processor 701. In some embodiments, the processor 701 and the memory 702 may be implemented on the same chip; in other embodiments, they may be implemented on separate chips.
[0194] Processor 701 can be a general-purpose processor, such as a central processing unit (CPU), digital signal processor, application-specific integrated circuit (ASIC), field-programmable gate array or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of the transaction processing rule matching method can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.
[0195] Memory 702, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. Memory 702 may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (RAM), static random access memory (SRAM), programmable read-only memory (PROM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), magnetic storage, magnetic disk, optical disk, etc. Memory 702 can be any other medium capable of carrying or storing desired program code in the form of instructions or data structures that can be accessed by a computer, but is not limited thereto. In embodiments of the present invention, memory 702 can also be a circuit or any other device capable of implementing storage functions for storing program instructions and / or data.
[0196] Based on the same technical concept, embodiments of the present invention also provide a computer-readable storage medium storing a computer program executable by a computing device, which, when run on the computing device, causes the computing device to perform the steps of the transaction processing rule matching method described above.
[0197] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0198] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing device, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0199] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0200] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0201] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the invention.
[0202] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this application and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A transaction processing rule matching method, characterized in that, The method, applied to a transaction processing rule matching component, includes: For any business system, when a transfer transaction request initiated by the business system is detected, the key transaction information in the transfer transaction corresponding to the transfer transaction request is determined from the transfer transaction request; Each key element in the key transaction information is sequentially matched with each first node in the transaction processing rule network tree to determine multiple first matching nodes, and a second node that the multiple first matching nodes commonly point to is determined. The transaction processing rule corresponding to the second node is determined based on the commonly pointed-to second node. The transaction processing rule network tree is constructed based on each key element in each transaction processing rule stored in the transaction processing rule database. The transaction processing rule network tree includes a first node representing each key element and a second node representing multiple key elements. There is a pointing relationship between the first node and the second node. The transaction processing rule network tree is a Rete network graph, which includes an Alpha network and a Beta network. The Alpha network includes a first node, and the Beta network includes a second node. The transfer transaction is processed according to the aforementioned transaction processing rules; The transaction processing rule network tree is determined in the following manner: Retrieve each transaction processing rule from the transaction processing rule database; For each transaction processing rule, multiple key elements are identified from the transaction processing rule, and for each key element, if it is determined that there is no first node corresponding to the key element in the transaction processing rule network tree, a first node corresponding to the key element is created in the transaction processing rule network tree. When it is determined that a first node corresponding to the key element exists in the transaction processing rule network tree, a child node of the first node is established based on the similarity node information; the similarity node information includes each transaction processing rule that has the same first node. For each transaction processing rule, establish the pointing relationship between each first node and second node of the transaction processing rule, and establish the association relationship between the second node and the transaction processing rule, thereby generating the transaction processing rule network tree; For each transaction processing rule, establish the pointing relationship between each first node and second node of the transaction processing rule, including: For each first node, determine the first transaction processing rule to which the first node belongs; Based on each first node in the first transaction processing rule, a second node is created and a pointing relationship is established between each first node and the second node in the first transaction processing rule; if the first node has child nodes, a second transaction processing rule is determined according to the similarity node information, and a pointing relationship is established between each first node and the corresponding second node in the second transaction processing rule, until all child nodes of the first node have been traversed.
2. The method as described in claim 1, characterized in that, The process of processing the transfer transaction according to the transaction processing rules includes: The transaction initiator, transaction recipient, and transaction executor are determined from the aforementioned transaction processing rules; Based on the transaction initiator and the transaction recipient, an execution request for the transfer transaction is constructed and sent to the transaction executor; The system determines whether the transfer transaction was executed normally by analyzing the response information provided by the transaction executor to the execution request. If not, obtain the exception handling scheme corresponding to the transaction processing rule, and process the transfer transaction accordingly using the exception handling scheme.
3. The method as described in claim 2, characterized in that, The process of handling the transfer transaction according to the aforementioned exception handling scheme includes: If the exception handling scheme is to reverse the transfer transaction, then when it is determined that there is reversal interface pointer information in the interface pointer information of the business interface used to process the transfer transaction of the transaction executor, a reverse transaction task is generated and the reverse transaction task is stored in the task database; the reverse transaction task is used to instruct the execution of the transfer transaction sent by the transaction receiver to the transaction initiator. If the exception handling scheme is to query only the transfer transaction, then when it is determined that there is query interface pointer information in the interface pointer information of the business interface used to process the transfer transaction of the transaction executor, a query transaction task is generated and the query transaction task is stored in the task database; the query transaction task is used to instruct the query of the account address of the transaction initiator and the account address of the transaction recipient. If the exception handling scheme is to cancel the transfer transaction, then when it is determined that there is cancellation interface pointer information in the interface pointer information of the business interface used to process the transfer transaction of the transaction executor, a cancellation transaction task is generated and the cancellation transaction task is stored in the task database; the cancellation transaction task is used to indicate the cancellation of the transfer transaction sent by the transaction initiator to the transaction recipient.
4. The method as described in claim 3, characterized in that, Also includes: The trigger scheduling thread retrieves triggers for tasks to be executed from the trigger database; The task to be executed is any one of the reverse transaction task, the query transaction task, or the cancel transaction task; When the execution time of the task to be executed is determined by the trigger of the task to be executed, the task scheduler retrieves the task to be executed from the task database and executes the task to be executed.
5. The method as described in claim 1, characterized in that, The step of determining the key transaction information in the transfer transaction corresponding to the transfer transaction request from the transfer transaction request includes: The transfer transaction request is parsed and processed to obtain multiple transaction information in the transfer transaction corresponding to the transfer transaction request; From the multiple transaction information, key transaction information is determined to characterize the transaction characteristics of the transfer transaction.
6. A transaction processing rule matching device, characterized in that, The apparatus is applied to a transaction processing rule matching component and includes: The detection unit is used to, for any business system, when a transfer transaction request initiated by the business system is detected, determine the key transaction information in the transfer transaction corresponding to the transfer transaction request from the transfer transaction request; The processing unit is configured to sequentially match each key element in the key transaction information with each first node in the transaction processing rule network tree to determine multiple first matching nodes, and to determine a second node that the multiple first matching nodes commonly point to. The transaction processing rule corresponding to the second node is then determined based on the commonly pointed-to second node. The transaction processing rule network tree is constructed based on each key element in each transaction processing rule stored in the transaction processing rule database. The transaction processing rule network tree includes a first node representing each key element and a second node representing multiple key elements. There is a pointing relationship between the first node and the second node. The transaction processing rule network tree is a Rete network graph, which includes an Alpha network and a Beta network. The Alpha network includes a first node, and the Beta network includes a second node. The transfer transaction is processed using the transaction processing rules. The transaction processing rule network tree is determined in the following manner: Retrieve each transaction processing rule from the transaction processing rule database; For each transaction processing rule, multiple key elements are identified from the transaction processing rule, and for each key element, if it is determined that there is no first node corresponding to the key element in the transaction processing rule network tree, a first node corresponding to the key element is created in the transaction processing rule network tree. When it is determined that a first node corresponding to the key element exists in the transaction processing rule network tree, a child node of the first node is established based on the similarity node information; the similarity node information includes each transaction processing rule that has the same first node. For each transaction processing rule, establish the pointing relationship between each first node and second node of the transaction processing rule, and establish the association relationship between the second node and the transaction processing rule, thereby generating the transaction processing rule network tree; The processing unit is specifically used for: for each first node, determining the first transaction processing rule to which the first node belongs; based on each first node in the first transaction processing rule, creating a second node and establishing a pointing relationship between each first node and the second node in the first transaction processing rule; if the first node has child nodes, determining a second transaction processing rule according to the similarity node information, and establishing a pointing relationship between each first node and the corresponding second node in the second transaction processing rule, until all child nodes of the first node have been traversed.
7. A computing device, characterized in that, The method includes at least one processor and at least one memory, wherein the memory stores a computer program that, when executed by the processor, causes the processor to perform the method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, It stores a computer program executable by a computing device, which, when run on the computing device, causes the computing device to perform the method described in any one of claims 1 to 5.
Citation Information
Patent Citations
Transaction processing method and device
CN110264358A
Flow guarantee method and device for distributed transactions
CN110288255A
Data processing method, system and device, computer equipment and storage medium
CN113610520A