CN114254921A - Transaction processing rule matching method and device - Google Patents

Transaction processing rule matching method and device Download PDF

Info

Publication number
CN114254921A
CN114254921A CN202111572249.6A CN202111572249A CN114254921A CN 114254921 A CN114254921 A CN 114254921A CN 202111572249 A CN202111572249 A CN 202111572249A CN 114254921 A CN114254921 A CN 114254921A
Authority
CN
China
Prior art keywords
transaction
node
processing rule
transfer
task
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111572249.6A
Other languages
Chinese (zh)
Inventor
江旻
杨杨
吴磊
汪成
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
WeBank Co Ltd
Original Assignee
WeBank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN202111572249.6A priority Critical patent/CN114254921A/en
Publication of CN114254921A publication Critical patent/CN114254921A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0631Resource planning, allocation, distributing or scheduling for enterprises or organisations
    • G06Q10/06311Scheduling, planning or task assignment for a person or group
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0633Workflow analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Landscapes

  • Business, Economics & Management (AREA)
  • Human Resources & Organizations (AREA)
  • Engineering & Computer Science (AREA)
  • Economics (AREA)
  • Strategic Management (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Physics & Mathematics (AREA)
  • Development Economics (AREA)
  • Theoretical Computer Science (AREA)
  • Marketing (AREA)
  • General Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • Educational Administration (AREA)
  • Tourism & Hospitality (AREA)
  • Quality & Reliability (AREA)
  • Operations Research (AREA)
  • Game Theory and Decision Science (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Technology Law (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The embodiment of the invention provides a transaction processing rule matching method and a transaction processing rule matching device, wherein the method comprises the steps of determining key transaction information corresponding to a transfer transaction request from the transfer transaction request when the transfer transaction request initiated by a service system is detected, sequentially matching each key element in the key transaction information with each first node in a transaction processing rule network tree, determining a plurality of first matching nodes, determining a second node pointed by the first matching nodes in common, determining a transaction processing rule corresponding to the second node according to the second node pointed in common, and processing the transfer transaction through the transaction processing rule. Therefore, the scheme can uniformly process the transactions of a plurality of service systems with the same transaction processing logic through the transaction processing rule matching component, effectively reduces the development cost and the labor cost, and can quickly match the corresponding transaction processing rules through the transaction processing rule network tree, thereby effectively improving the processing efficiency of the transfer transaction.

Description

Transaction processing rule matching method and device
Technical Field
The embodiment of the invention relates to the field of financial technology (Fintech), in particular to a transaction processing rule matching method and device.
Background
With the development of computer technology, more and more technologies are applied in the financial field, and the traditional financial industry is gradually changing to financial technology, but due to the requirements of the financial industry on safety and real-time performance, higher requirements are also put forward on the technologies. In the field of financial transfer services and the like, fund processing requirements (such as fund clearing requirements) generally exist, and how to implement the fund transfer transaction processing becomes an urgent problem to be solved in order to ensure that the fund transfer transaction can be normally carried out.
At this stage, if a plurality of different business systems owned by a financial institution (or financial enterprise) are all involved in the fund processing business operation, a fund processing function is usually developed for each business system, so that each business system can process the fund transfer transaction through its own fund processing function when performing fund processing. However, since the same fund processing function may exist in each of the fund processing functions of the plurality of different business systems, there may be a case where the same fund processing function is repeatedly developed, which may result in high development cost and low reuse rate for the fund processing function.
In summary, there is a need for a transaction processing rule matching method to effectively reduce development cost and labor cost and effectively improve the processing efficiency of the transfer transaction.
Disclosure of Invention
The embodiment of the invention provides a transaction processing rule matching method and device, which are used for effectively reducing development cost and labor cost and effectively improving the processing efficiency of transfer transaction.
In a first aspect, an embodiment of the present invention provides a transaction processing rule matching method, which is applied to a transaction processing rule matching component, and the method includes:
for any service system, when a transfer transaction request initiated by the service system is detected, determining key transaction information in the transfer transaction corresponding to the transfer transaction request from the transfer transaction request;
sequentially matching each key element in the key transaction information with each first node in a transaction processing rule network tree to determine a plurality of first matching nodes, determining a second node pointed by the first matching nodes in common, and determining a transaction processing rule corresponding to the second node according to the second node pointed in common; 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 rules network tree includes a first node characterizing each key element and a second node characterizing a plurality of key elements;
and processing the transfer transaction according to the transaction processing rule.
In the above technical solution, since a fund processing function is configured for each different business system in the prior art, there may be a case of performing repeated development for the same fund processing function, so that the development cost for the fund processing function is high and the reuse rate is low. Based on this, the technical scheme of the invention uniformly processes the fund processing service of a plurality of service systems with the same fund processing function by introducing the transaction processing rule matching component, so that the fund processing function can be prevented from being respectively developed for the plurality of service systems, thereby effectively reducing the development cost and the labor cost and improving the reuse rate aiming at the fund processing function. Specifically, for any service system, when a transfer transaction request initiated by the service system is detected, key transaction information in a 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 sequentially matched with each first node in a transaction processing rule network tree, a plurality of first matching nodes are determined, a second node to which the plurality of first matching nodes point together is determined, and a transaction processing rule corresponding to the second node (namely, a transaction processing rule corresponding to the transfer transaction) can be quickly and accurately determined according to the commonly-pointed second node. The transfer transaction may then be automatically and efficiently processed by the transaction processing rules. Therefore, the scheme can uniformly process the fund processing services of a plurality of service systems with the fund processing function of the same transaction processing logic through the transaction processing rule matching component, can effectively reduce the development cost and the labor cost, and can improve the reuse rate aiming at the fund processing function (namely improve the node reuse rate) because the transaction processing rule network tree constructed by the scheme comprises shared nodes (namely, multiplexing nodes, namely, shared nodes of the transaction processing rules with the same key elements). In addition, because the transaction processing rule network tree has the shared node, the matching path can be shortened when the transaction processing rules are matched, so that the transaction processing rules corresponding to the transfer transaction can be matched more quickly and accurately, and the processing efficiency of the transfer transaction can be effectively improved.
Optionally, the transaction processing rules network tree is determined by:
acquiring each transaction processing rule from the transaction processing rule database;
for each transaction processing rule, determining a plurality of key elements from the transaction processing rule, and for each key element, when determining that a first node corresponding to the key element does not exist in the transaction processing rule network tree, creating a first node corresponding to the key element in the transaction processing rule network tree;
and aiming at each transaction processing rule, establishing a directional relation between each first node and each second node of the transaction processing rule, and establishing an association relation between each second node and the transaction processing rule, thereby generating the transaction processing rule network tree.
In the above technical solution, when a transaction processing rule network tree is constructed, for each transaction processing rule in the transaction processing rule database, a plurality of key elements in the transaction processing rule are determined, and for each key element, when it is determined that a first node corresponding to the key element does not exist in the transaction processing rule network tree, a first node corresponding to the key element is created in the transaction processing rule network tree, and at the same time, a directional relationship between each first node and a second node corresponding to the plurality of key elements is created, and an association relationship between the second node and the transaction processing rule is created. Therefore, the scheme can avoid repeatedly establishing the same node, thereby improving the reuse rate of the shared node (namely the shared same node), and effectively shortening the matching path required when the transaction processing rules with the same shared node are matched.
Optionally, the method further comprises:
when determining that a first node corresponding to the key element exists in the transaction processing rule network tree, establishing a child node of the first node according to the similarity node information; the similarity node information comprises transaction processing rules with the same first node;
aiming at each transaction processing rule, establishing a directional relation between each first node and each second node of the transaction processing rule, wherein the directional relation comprises the following steps:
for each first node, determining a 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 directional relation between each first node and the second node in the first transaction processing rule; and if the first node has child nodes, determining a second transaction processing rule according to the similarity node information, and establishing a directional relation between each first node and the corresponding second node in the second transaction processing rule until all the child nodes of the first node are traversed.
In the above technical solution, when it is determined that the first node corresponding to the key element exists in the transaction processing rule network tree, a child node of the first node needs to be established, so that it is clearly and intuitively known that the plurality of transaction processing rules share the first node. And establishing a second node pointed by the first nodes based on the first nodes corresponding to the same transaction processing rule. Meanwhile, other transaction processing rules corresponding to the first node can be clearly and accurately determined based on the child nodes of the first node, and the directional relation between each first node in the other transaction processing rules and the second node pointed by the first node is conveniently established. Therefore, according to each transaction processing rule, the established direction relationship between each first node corresponding to the transaction processing rule and the second node pointed in the same direction can be used for conveniently and accurately matching the transaction processing rule corresponding to the transfer transaction from the plurality of direction relationships when the transaction processing rule of any transfer transaction is determined.
Optionally, the processing the transfer transaction through the transaction processing rule includes:
determining a transaction initiator, a transaction receiver and a transaction executor from the transaction processing rules;
constructing an execution request of the transfer transaction based on the transaction initiator and the transaction receiver, and sending the execution request to the transaction executor;
determining whether the transfer transaction is normally executed or not through response information for the execution request fed back by the transaction executing party;
if not, acquiring an exception handling scheme corresponding to the transaction handling rule, and carrying out corresponding processing on the transfer transaction through the exception handling scheme.
In the technical scheme, in order to automatically complete the transaction closed loop and avoid manual intervention processing, the labor cost is effectively reduced, and therefore the abnormal processing scheme corresponding to the transfer transaction can be adopted to automatically perform corresponding processing on the transfer transaction when the transfer transaction is determined not to be normally executed, and the abnormal processing efficiency of the transfer transaction can be improved.
Optionally, the processing the transfer transaction by the exception handling scheme includes:
if the abnormal processing scheme is to carry out reversal on the transfer transaction, generating a reverse transaction task when the interface pointer information of a service interface of the transaction executing party for processing the transfer transaction is determined to have reversal interface pointer information, and storing the reverse transaction task into a task database; the reverse transaction task is used for indicating to execute the transfer transaction sent by the transaction receiver to the transaction initiator;
if the exception handling scheme is that only the transfer transaction is inquired, generating an inquiry transaction task when the inquiry interface pointer information exists in the interface pointer information of a business interface of the transaction executing party for processing the transfer transaction, and storing the inquiry transaction task into the task database; the inquiry transaction task is used for indicating to inquire the account address of the transaction initiator and the account address of the transaction receiver;
if the abnormal processing scheme is to cancel the transfer transaction, generating a cancel transaction task when determining that cancel interface pointer information exists in interface pointer information of a business interface of the transaction executing party for processing the transfer transaction, and storing the cancel transaction task into the task database; the transaction cancellation task is used for indicating that the transfer transaction sent by the transaction initiator to the transaction receiver is cancelled.
In the technical scheme, the abnormal conditions of the transfer transaction corresponding to the transaction processing rules are automatically processed according to the corresponding abnormal processing scheme set by each transaction processing rule, so that the transaction closed loop can be automatically completed, manual intervention processing is avoided, and the labor cost is effectively reduced.
Optionally, the method further comprises:
acquiring a trigger of a task to be executed from a trigger database through a trigger scheduling thread; the task to be executed is any one of the reverse transaction task, the inquiry transaction task or the cancel transaction task;
and acquiring the task to be executed from the task database through a task scheduler and executing the task to be executed when the execution time of the task to be executed is determined to be met through the trigger of the task to be executed.
In the above technical solution, each task is configured with a corresponding trigger, so that when the timed task processing component polls the task, the execution of the task can be timely triggered through the trigger. That is, the trigger scheduling thread periodically obtains the trigger of the task to be executed from the trigger database, and when the execution time of the task to be executed is determined to be satisfied, the task to be executed can be timely obtained from the task database through the task scheduler and executed by the trigger of the task to be executed.
Optionally, the determining key transaction information in the transfer transaction corresponding to the transfer transaction request from the transfer transaction request includes:
analyzing and processing the transfer transaction request to obtain a plurality of transaction information in the transfer transaction corresponding to the transfer transaction request;
determining key transaction information characterizing transaction characteristics of the transfer transaction from the plurality of transaction information.
According to the technical scheme, the transfer transaction request is analyzed, so that the multiple transaction information in the corresponding transfer transaction can be obtained, the key transaction information capable of representing the transaction characteristics of the transfer transaction can be selected from the multiple transaction information, and therefore powerful guarantee is provided for timely and accurately matching the corresponding transaction processing rule from the transaction processing rule network tree through the key transaction information.
In a second aspect, an embodiment of the present invention further provides a transaction processing rule matching apparatus, which is applied to a transaction processing rule matching component, and the apparatus includes:
the detection unit is used for determining key transaction information in the transfer transaction corresponding to the transfer transaction request from the transfer transaction request when the transfer transaction request initiated by the service system is detected for any service system;
the processing unit is used for sequentially matching each key element in the key transaction information with each first node in the transaction processing rule network tree, determining a plurality of first matching nodes, determining a second node pointed by the first matching nodes in common, and determining a transaction processing rule corresponding to the second node according to the second node pointed in common; 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 rules network tree includes a first node characterizing each key element and a second node characterizing a plurality of key elements; and processing the transfer transaction according to the transaction processing rule.
Optionally, the processing unit is specifically configured to:
acquiring each transaction processing rule from the transaction processing rule database;
for each transaction processing rule, determining a plurality of key elements from the transaction processing rule, and for each key element, when determining that a first node corresponding to the key element does not exist in the transaction processing rule network tree, creating a first node corresponding to the key element in the transaction processing rule network tree;
and aiming at each transaction processing rule, establishing a directional relation between each first node and each second node of the transaction processing rule, and establishing an association relation between each second node and the transaction processing rule, thereby generating the transaction processing rule network tree.
Optionally, the processing unit is further configured to:
when determining that a first node corresponding to the key element exists in the transaction processing rule network tree, establishing a child node of the first node according to the similarity node information; the similarity node information comprises transaction processing rules with the same first node;
the processing unit is specifically configured to:
for each first node, determining a 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 directional relation between each first node and the second node in the first transaction processing rule; and if the first node has child nodes, determining a second transaction processing rule according to the similarity node information, and establishing a directional relation between each first node and the corresponding second node in the second transaction processing rule until all the child nodes of the first node are traversed.
Optionally, the processing unit is specifically configured to:
determining a transaction initiator, a transaction receiver and a transaction executor from the transaction processing rules;
constructing an execution request of the transfer transaction based on the transaction initiator and the transaction receiver, and sending the execution request to the transaction executor;
determining whether the transfer transaction is normally executed or not through response information for the execution request fed back by the transaction executing party;
if not, acquiring an exception handling scheme corresponding to the transaction handling rule, and carrying out corresponding processing on the transfer transaction through the exception handling scheme.
Optionally, the processing unit is specifically configured to:
if the abnormal processing scheme is to carry out reversal on the transfer transaction, generating a reverse transaction task when the interface pointer information of a service interface of the transaction executing party for processing the transfer transaction is determined to have reversal interface pointer information, and storing the reverse transaction task into a task database; the reverse transaction task is used for indicating to execute the transfer transaction sent by the transaction receiver to the transaction initiator;
if the exception handling scheme is that only the transfer transaction is inquired, generating an inquiry transaction task when the inquiry interface pointer information exists in the interface pointer information of a business interface of the transaction executing party for processing the transfer transaction, and storing the inquiry transaction task into the task database; the inquiry transaction task is used for indicating to inquire the account address of the transaction initiator and the account address of the transaction receiver;
if the abnormal processing scheme is to cancel the transfer transaction, generating a cancel transaction task when determining that cancel interface pointer information exists in interface pointer information of a business interface of the transaction executing party for processing the transfer transaction, and storing the cancel transaction task into the task database; the transaction cancellation task is used for indicating that the transfer transaction sent by the transaction initiator to the transaction receiver is cancelled.
Optionally, the processing unit is specifically configured to:
acquiring a trigger of a task to be executed from a trigger database through a trigger scheduling thread; the task to be executed is any one of the reverse transaction task, the inquiry transaction task or the cancel transaction task;
and acquiring the task to be executed from the task database through a task scheduler and executing the task to be executed when the execution time of the task to be executed is determined to be met through the trigger of the task to be executed.
Optionally, the detection unit is specifically configured to:
analyzing and processing the transfer transaction request to obtain a plurality of transaction information in the transfer transaction corresponding to the transfer transaction request;
determining key transaction information characterizing transaction characteristics of the transfer transaction from the plurality of transaction information.
In a third aspect, an embodiment of the present invention provides a computing device, including at least one processor and at least one memory, where the memory stores a computer program, and when the program is executed by the processor, the processor is caused to execute the transaction processing rule matching method according to any of the first aspect.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium storing a computer program executable by a computing device, the program, when executed on the computing device, causing the computing device to execute the transaction processing rule matching method according to any of the first aspects.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flow chart illustrating a transaction processing rule matching method according to an embodiment of the present invention;
fig. 2 is a constructed rete network diagram according to an embodiment of the present invention;
fig. 3a is a schematic diagram of an Alpha network constructed according to a conventional rete algorithm according to an embodiment of the present invention;
FIG. 3b is a schematic diagram of an Alpha network constructed according to the modified rete algorithm according to an embodiment of the present invention;
fig. 4a is a schematic diagram of a Beta network constructed according to a conventional rete algorithm according to an embodiment of the present invention;
FIG. 4b is a schematic diagram of a Beta network constructed according to the modified rete algorithm according to an embodiment of the present invention;
FIG. 5 is a schematic flow chart illustrating the handling of abnormal conditions of a transfer transaction according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a transaction processing rule matching apparatus according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a computing device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the following, some terms related to the embodiments of the present invention are first explained to facilitate understanding by those skilled in the art.
(1) AlphaNetWork: filtering the learning memory, finding out a set which accords with each mode in the rule, and generating the Alpha memory (the set which meets the mode), wherein the set comprises two types of nodes, a type filtering node and other condition filtering nodes.
(2) BetaNetWork: there are two types of nodes, Beta Memory and Join Node. The former mainly stores the collection after Join is completed. The latter comprises two input ports, two sets which need to be matched are respectively input, and joint nodes do merging work and transmit the merged work to the next node.
(3) The fact that: refers to the relationship between objects and between object attributes.
(4) Object: refers to the fact or data that matches the rule in the rete algorithm.
As described above, some terms related to the embodiments of the present invention are described, and the technical features related to the embodiments of the present invention are described below.
Fig. 1 schematically shows a flow of a transaction processing rule matching method provided by an embodiment of the present invention, where the flow may be executed by a transaction processing rule matching apparatus. The transaction processing rule matching method in the embodiment of the invention is applied to the transaction processing rule matching component.
As shown in fig. 1, the process specifically includes:
step 101, aiming at any business system, when a transfer transaction request initiated by the business system is detected, key transaction information in a transfer transaction corresponding to the transfer transaction request is determined from the transfer transaction request.
In the embodiment of the present invention, for a financial enterprise or a financial institution, the financial enterprise or the financial institution may be deployed with a plurality of different business systems, and the plurality of different business systems may all need to configure a fund processing function, but the fund processing functions used by the plurality of different business systems have the same fund processing function or have a part of the same fund processing logic, and if a fund processing function is developed for each business system, a situation of repeatedly developing the same fund processing function may occur, that is, a large amount of time and energy of a developer are consumed to develop the fund processing function, so that development resources are wasted, and development cost is high. Aiming at the problem, the technical scheme of the invention realizes the fund processing function in different business systems by designing a uniform and normalized transaction processing rule matching component. Then, aiming at any business system, when the transaction processing rule matching component detects a transfer transaction request of the business system, the transfer transaction request contains the transfer transaction, namely, the multiple transaction information in the transfer transaction is analyzed from the transfer transaction request, and the key transaction information used for representing the transaction characteristics of the transfer transaction can be extracted from the multiple transaction information, for example, the transaction information contained in the transfer transaction can not be used for embodying the transaction characteristics of the transfer transaction (for example, the special attribute of each transfer transaction is provided, the transaction information presented by the special attribute can be used for distinguishing the transfer transaction), for example, some transaction information may be additional information required by each transaction, the transfer transaction itself has no effect, and certainly, the transaction characteristics of the transfer exchange cannot be reflected. However, some transaction information with special characteristics in the plurality of transaction information included in the transfer transaction can be used as key transaction information for distinguishing the transfer transaction, and then the corresponding transaction processing rules can be matched from the transaction processing rule network tree timely and accurately through the key transaction information.
And step 102, sequentially matching each key element in the key transaction information with each first node in a transaction processing rule network tree, determining a plurality of first matching nodes, determining a second node pointed by the plurality of first matching nodes, and determining a transaction processing rule corresponding to the second node according to the commonly pointed second node.
In the embodiment of the invention, 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 rules network tree includes a first node characterizing each key element and a second node characterizing a plurality of key elements; wherein, a pointing relationship exists between a first node and a second node which have the same key elements; the first nodes are different, and the second nodes correspond to a transaction processing rule respectively. 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 in sequence, so that a plurality of first matching nodes can be accurately determined, a second node commonly pointed by the plurality of first matching nodes can be accurately matched from the transaction processing rule network tree through the plurality of first matching nodes, and the transaction processing rule corresponding to the transfer transaction can be accurately acquired through the second node.
Wherein the transaction processing rules network tree is determined by: when the transaction processing rule matching component is started, each transaction processing rule is obtained from the transaction processing rule database, a plurality of key elements are determined from the transaction processing rules according to each transaction processing rule, and for any key element, when the fact that the first node corresponding to the key element does not exist in the transaction processing rule network tree is determined, the first node corresponding to the key element can be created in the transaction processing rule network tree. Meanwhile, aiming at each transaction processing rule, establishing a direction relation between each first node corresponding to a plurality of key elements in the transaction processing rule and a second node pointed by each first node together, and establishing an association relation between each second node and the corresponding transaction processing rule, thereby generating a transaction processing rule network tree containing each transaction processing rule. When determining that a first node corresponding to the key element exists in the transaction processing rule network tree, establishing a child node of the first node according to the similarity node information; the similarity node information may include transaction processing rules with the same first node. In addition, when establishing a direction relationship between first nodes corresponding to a plurality of key elements in the transaction processing rule and second nodes commonly pointed by the first nodes, the transaction processing rule matching component determines, for each first node, a first transaction processing rule to which the first node belongs, creates a second node based on the first nodes corresponding to the first transaction processing rule, wherein the second node includes the key elements corresponding to the first nodes, and then establishes the direction relationship between the first nodes and the second node. Meanwhile, the transaction processing rule matching component needs to judge whether the first node has a child node, if the first node is determined to have the child node, a second transaction processing rule which commonly comprises key elements corresponding to the first node is determined according to the similarity node information, and the direction relation between each first node and the corresponding second node in the second transaction processing rule is established until all the child nodes of the first node are traversed, so that a transaction processing rule network tree can be generated. The second node corresponding to the second transaction processing rule is created based on each first node in the second transaction processing rule (each first node includes a first node shared with the first transaction processing rule). Therefore, the scheme can avoid repeatedly establishing the same node, thereby improving the reuse rate of the shared node (namely the shared same node), effectively shortening the matching path required when the transaction processing rules with the same shared node are matched, and being convenient for timely and accurately matching the transaction processing rules corresponding to the transfer transaction from a plurality of directional relations when the transaction processing rules of any transfer transaction are determined.
For example, when the transaction processing rule matching component (such as a fund processing engine) is started, the transaction processing rule information can be obtained from the transaction processing rule database to create the transaction processing rule network tree (such as building a rete network graph by using an improved rete algorithm). For the improved rete algorithm, firstly, the similarity between the transaction processing rule information needs to be calculated, that is, the similarity between any two transaction processing rule information is determined by the following method:
S[]=Index(Rulei,Rulei+1)
for example, the implementation of the above-described calculation of the similarity between any two transaction processing rule information is described by taking each transaction processing rule information in table 1 below as an example.
TABLE 1
Transaction processing rule identification number Transaction processing rule content
R1 WB01→D01,UPP
R2 WB02→D02,DEP
R3 WB02→D02,CRH
R4 WB02→D02,ICB
R5 WB05,WB
R6 WB03→T02,ALI
Wherein Rx (e.g. R)1) For transaction processing rule serial numbers, WBXX (e.g., WB01) for WB organization internal user number, DXX (e.g., WB01)D01) For representing a security deposit, TXX (such as T02) for representing a station account, UPP, DEP, CRH, ICB, WB, ALI, etc. for representing payment authority information.
The similarity between the transaction processing rules shown in table 1 may be determined by the similarity calculation formula, such as determining that there is no similarity between R1 and R2, determining that there is a similarity between R2 and R3, i.e., S [ ] [ WB02 → D02], determining that there is a similarity between R2 and R4, i.e., S [ ] [ WB02 → D02], and determining that there is a similarity between R3 and R4, i.e., S [ ] [ WB02 → D02 ].
Then, a rete network graph can be constructed based on the transaction processing rules and the similarity information between the transaction processing rules. The rete network graph mainly includes two parts, namely an Alpha network part (namely, AlphaNetWork) and a Beta network part (BetaNetWork). Alpha networks include Root and Alpha memory. Root is the entry of all fact objects (such as any key element) into the Rete network graph; the Alpha Memory is used for storing WME (matching node element) filtered by an Alpha network; and carrying out node multiplexing according to the sharing node. The Beta network is connected with Alpha nodes, and when the Beta network is constructed, the Alpha nodes are traversed to construct the Beta network, so that a rete network graph as shown in fig. 2 can be constructed by aiming at each transaction processing rule shown in table 1. Wherein, Alpha network algorithm: 1. aiming at any transaction processing rule, acquiring a fact corresponding to the transaction processing rule and similarity information of the transaction processing rule; 2. judging whether a node corresponding to the fact exists in the current Alpha network or not, if not, creating a new Alpha node corresponding to the fact; if the fact exists, whether the similarity information of the transaction processing rule contains the fact needs to be judged, and if the fact exists, a child node is created at the position where the current Alpha node corresponding to the fact is located; 3. and repeating the step 1 and the step 2 until all transaction processing rules are processed. Beta network algorithm: 1. acquiring an Alpha network constructed by an Alpha network algorithm, and taking out any node in the Alpha network; 2. judging whether the node exists in the current Beta network or not, if not, creating a new Beta node; if the existing node exists, adding the current node into the existing Beta network, wherein the father node of the current node is the existing node and the current Alpha node; 3. and (5) repeating the step (1) and the step (2) until all nodes in the Alpha network are traversed.
Specifically, the fund processing engine firstly creates a Root node Root, constructs an Alpha network according to an Alpha network algorithm, and takes each transaction processing rule shown in table 1 as an example, and the specific implementation process of constructing the Alpha network is as follows:
step a, taking out the fact WB01- > D01 corresponding to the transaction processing rule R1, and creating a WB01- > D01 node and a UPP node when no WB01- > D01 node exists in the Alpha network.
And b, taking out the fact WB02- > D02 corresponding to the transaction processing rule R2, and creating a WB02- > D02 node and a DEP node when the WB02- > D02 node does not exist in the Alpha network.
And c, taking out the fact WB02- > D02 corresponding to the transaction processing rule R3, judging that WB02- > D02 nodes exist in the Alpha network, judging that the similarity information between the transaction processing rule R2 and the transaction processing rule R3 comprises the fact WB02- > D02, creating a child node 1 at the position of the original WB02-D02, and creating an Alpha node CRH.
And D, taking out the fact WB02- > D02 corresponding to the transaction processing rule R4, judging that WB02- > D02 nodes exist in the Alpha network, judging that the similarity information between the transaction processing rule R3 and the transaction processing rule R4 comprises the fact WB02- > D02, creating a child node 2 in the original WB02-D02, and creating an Alpha node ICB.
And e, taking out the fact WB05 corresponding to the transaction processing rule R5, and creating a WB05 node and a WB node if a WB05 node does not exist in the Alpha network.
And f, taking out the fact WB03- > T02 corresponding to the transaction processing rule R6, and creating a WB03- > T02 node and an ALI node when no WB03- > T02 node exists in the Alpha network.
The fund processing engine constructs a Beta network according to a Beta network algorithm, and takes each transaction processing rule shown in table 1 as an example, the concrete implementation process for constructing the Beta network is as follows:
step a, taking out Alpha nodes (WB01- > D01 nodes) in an Alpha network, and creating Beta nodes (WB01- > D01, UPP) according to left input nodes (WB01- > D01 nodes) and right input nodes (UPP nodes) serving as construction Beta nodes.
And b, taking out Alpha nodes (WB02- > D02 nodes) in the Alpha network, and creating Beta nodes (WB02- > D02, DEP) according to the left input nodes (WB02- > D02 nodes) and the right input nodes (DEP nodes) serving as construction Beta nodes.
And c, judging that Alpha child nodes exist in the current Alpha node (WB02- > D02), determining that a shared node (WB02- > D02) exists, determining a certain transaction processing rule corresponding to the shared node, creating a Beta node (WB02- > D02, CRH) according to a left input node (WB02- > D02) serving as a construction Beta node and a CRH node (WB02- > D02) serving as a right input node) corresponding to the transaction processing rule, and circulating the process until all child nodes are completely traversed.
And d, taking out Alpha nodes (WB05 nodes) in the Alpha network, and creating Beta nodes (WB05 and WB) according to the left input nodes (WB05 nodes) and the right input nodes (WB nodes) which are used as construction Beta nodes.
And e, taking out Alpha nodes (WB03- > T02 nodes) in the Alpha network, and creating Beta nodes (WB03- > T02 and ALI) according to the left input nodes (WB03- > T02 nodes) and the right input nodes (ALI nodes) serving as construction Beta nodes.
As can be seen from the rete network graph shown in fig. 2, there are three WB02- > D02 patterns in each transaction processing rule included in the rete network graph, but there is only one Alpha node in the rete network graph, which corresponds to the three WB02- > D02 patterns, and by multiplexing the Alpha node (i.e., WB02- > D02 node), 3 transaction processing rules can be matched, so that the problem that the system node is also increased proportionally with the increase of rules in the existing rete algorithm can be solved. Particularly, when the similarity of the transaction processing rules is high, the shared nodes (i.e., common same nodes) are effectively multiplexed, and the problems of excessive nodes and long matching paths can be effectively solved.
After the fund processing engine constructs the rete network graph, the transaction processing rules corresponding to any transfer transaction request can be matched through the rete network graph. Illustratively, when a certain transfer transaction request initiated by a certain business system reaches a fund processing engine, the fund processing engine firstly analyzes the transfer transaction request, extracts a transfer transaction in the transfer transaction request, extracts a fact (such as key transaction information in the transfer transaction) in the transfer transaction, and matches the fact with a transaction processing rule corresponding to the transfer transaction request through a rete network diagram. When a fact enters from a Root node, the Alpha network part firstly performs rule matching to obtain a plurality of matching nodes, and stores the matching nodes into an Alpha Memory (namely, an area for storing the nodes matched by the Alpha network). And then, matching the Beta network part according to the plurality of matching nodes, thereby finally matching the transaction processing rule corresponding to the transfer transaction request. That is, the Beta network mainly uses the join node to perform the variable binding test between the conditions, and stores the matching result in the Beta storage area. After the Beta node is matched, the terminal node is entered for output, and the corresponding transaction processing rule can be obtained. For example, assuming that the fact analyzed by a certain transfer transaction request is WB02 → D02, CRH, channeld ═ 2, merchaneld ═ 1, the fact is entered from Root node Root of rete network graph corresponding to the fact, and WB02 → D02, CRH, channeld ═ 2, merchaneld ═ 1 are matched in AlphaNetWork, and WB02 → D02, CRH, channeld ═ 2, merchaneld ═ 1 is stored in Alpha Memory. The transaction processing rules corresponding to the fact participate in building a rete network graph, and the Alpha network of the rete network graph includes all Alpha nodes of the transaction processing rules corresponding to the fact, that is, WB02 → D02 nodes, CRH nodes, where channeld is 2 nodes and merchaneld is 1 node. Then, the flow is transferred to the BetaNetWork for matching, and after a certain Beta node pointed by the WB02 → D02 node, the CRH node, the channeld 2 node, and the merchaneld 1 node is matched, the transaction processing rule (such as the transaction processing rule R2) associated with the Beta node, that is, the transaction processing rule corresponding to the transfer transaction request, can be obtained.
For another example, in the conventional Rete algorithm, the Alpha network and the Beta network in the Rete network do not perform effective node multiplexing. First, looking at the existence of Alpha nodes in an Alpha network, it is assumed that there are two transaction processing rules whose patterns are (W1, W2, … Wn, Wm1, Wm2, … Wmn) and (W1, W2, … Wn, Wx1, Wx2, … Wxn), where the same W subscripts indicate the same type judgment condition. It can be seen from the pattern distribution that n identical judgment conditions exist in the two patterns, and the corresponding Alpha network is shown in fig. 3a, and as can be seen from fig. 3a, the repetition rate between nodes is high, and effective multiplexing is not performed for common nodes. However, if the Alpha network of the two transaction processing rules is constructed according to the technical solution in the embodiment of the present invention, the Alpha network with shared nodes as shown in fig. 3b can be constructed, as can be seen from fig. 3b, the node reuse rate is higher, and the matching path is also shorter, so that the same node can process more transaction processing rule matches. Turning to the existence of Beta nodes in the Beta network, it is assumed that there are two transaction processing rules whose patterns are (N1, N2, N3) and (N1, N2, N3, N4), where the same N-subscripts denote the same type judgment condition. The corresponding Beta network model is shown in fig. 4a, and as can be seen from fig. 4a, the repetition rate between nodes is high, and effective multiplexing is not performed for common nodes. However, if the Alpha network of the two transaction processing rules is constructed according to the technical solution in the embodiment of the present invention, a Beta network with shared nodes can be constructed as shown in fig. 4b, as can be seen from fig. 4b, the node reuse rate is higher, and the matching path is also shorter, so that the same node can process more transaction processing rule matches.
In order to test the performance of the improved rete algorithm, the embodiment of the present invention performs a performance comparison between the conventional rete algorithm and the improved rete algorithm in a centros (Community Enterprise Operating System) environment, and the results are shown in tables 2 and 3. Wherein, table 2 is for system centros 7, memory 4G, CPU (Central Processing Unit) 8 cores, transaction Processing rule number 1000; table 3 shows the number of 2000 transaction processing rules for the system CentOS7, memory 4G, CPU8 core, and transaction processing rules.
TABLE 2
Figure BDA0003424133390000181
Figure BDA0003424133390000191
TABLE 3
Figure BDA0003424133390000192
As can be seen from the above tables 2 and 3, the improved rete algorithm has a significant advantage in execution time compared to the conventional rete algorithm, and the advantage is greater as the transaction processing rules increase. Obviously, the improved rete algorithm has a huge improvement in performance. Moreover, with the rapid increase of the number of events, the execution efficiency of the improved rete algorithm will be higher and higher, the real-time requirement of the financial transaction system can be better met, and better experience is provided for users.
And 103, processing the transfer transaction through the transaction processing rule.
In the embodiment of the invention, after the transaction processing rule corresponding to the transfer transaction request is obtained, the transaction initiator, the transaction receiver and the transaction executing party are determined from the transaction processing rule through the transaction processing rule, the execution request of the transfer transaction is constructed based on the transaction initiator and the transaction receiver, and the execution request is sent to the transaction executing party, so that the transfer transaction in the execution request is processed after the transaction executing party receives the execution request, and the execution result of the transfer transaction is fed back to the transaction processing rule matching component. And the transaction processing rule matching component judges whether the transfer transaction is normally executed according to the execution result of the transfer transaction fed back by the transaction executing party. If the transfer transaction execution is abnormal, the transaction processing rule matching component judges that the transfer transaction execution is abnormal (for example, the transfer transaction execution is overtime, the transfer transaction execution is interrupted due to reasons such as network abnormality and the like, or the account deduction of the transaction initiator fails and the like), and simultaneously, an abnormal processing scheme matched with the transaction processing rule corresponding to the transfer transaction is adopted to correspondingly process the transfer transaction. If the transaction executing party feeds back that the transfer transaction is successfully executed, the transaction processing rule matching component confirms that the transfer transaction is completed.
When an abnormal processing scheme matched with a transaction processing rule corresponding to the transfer transaction is adopted to carry out corresponding processing on the transfer transaction, if the abnormal processing scheme is to carry out reversal on the transfer transaction, namely, reversal of transfer transaction support is also defined in the transaction processing rule corresponding to the transfer transaction, when it is determined that reversal interface pointer information exists in interface pointer information of a business interface used for processing the transfer transaction of a transaction executing party, a reverse transaction task is generated, and the reverse transaction task is stored in a task database; wherein the reverse transaction task is used for instructing to execute the transfer transaction sent by the transaction receiver to the transaction initiator, namely the transaction receiver returns the received funds to the transaction initiator. If the exception handling scheme is that only the transfer transaction is inquired, namely the transfer transaction support inquiry is also defined in the transaction processing rule corresponding to the transfer transaction but the transfer transaction support inquiry does not support the reversal, when the inquiry interface pointer information exists in the interface pointer information of the business interface of the transaction executing party for processing the transfer transaction, an inquiry transaction task is generated, and the inquiry transaction task is stored in a task database; the inquiry transaction task is used for indicating an account address of an inquiry transaction initiator and an account address of a transaction receiver. If the abnormal processing scheme is to cancel the transfer transaction, namely the transfer transaction support cancellation is also defined in the transaction processing rule corresponding to the transfer transaction, generating a cancellation transaction task when the interface pointer information of a service interface of a transaction executing party for processing the transfer transaction is determined to have the cancellation interface pointer information, and storing the cancellation transaction task into a task database; wherein the transaction cancellation task is used to instruct the cancellation of the transfer transaction sent by the transaction initiator to the transaction receiver. Therefore, the abnormal conditions of the transfer transaction corresponding to the transaction processing rules are automatically processed by the corresponding abnormal processing scheme set by each transaction processing rule, so that the transaction closed loop can be automatically completed, manual intervention processing is avoided, and the labor cost is effectively reduced.
After the transaction processing rule matching component stores the generated tasks into the task database, the system is provided with a timed task processing component for periodically polling the tasks and executing the polled tasks. That is, in the technical solution in the embodiment of the present invention, each task is configured with a corresponding trigger, so that when the timed task processing component polls the task, the execution of the task can be timely triggered through the trigger. Specifically, the trigger of the task to be executed is periodically acquired from the trigger database through the trigger scheduling thread, and when the execution time of the task to be executed is determined to be met through the trigger of the task to be executed, the task to be executed is timely acquired from the task database through the task scheduler and executed. The task to be executed may be any one of a reverse transaction task, a query transaction task, or a cancel transaction task.
For example, after matching the transaction processing rule corresponding to the transfer transaction request, the fund processing engine may initiate a real transfer transaction, that is, execute the transfer transaction, through the transaction initiator, the transaction receiver, and the system to be invoked (that is, the transfer payment system, that is, the payment institution) in the transaction processing rule. However, in an actual production environment, various abnormal situations often occur, such as when a user card a is successfully deducted in a step deduction process, but the deduction time of a deduction user card B is overtime. According to the traditional scheme, manual intervention is often needed for processing, and the system cannot automatically complete compensation measures. In order to solve the problem that the system can automatically complete transaction closed loop under an abnormal condition so as to avoid manual intervention processing, thereby effectively reducing the labor cost, the fund processing engine is provided with a transaction interface pointer and a timed redo task function, so that the system can automatically complete subsequent transaction processing under the function. Referring to fig. 5, fig. 5 is a schematic flow chart of processing an abnormal transfer transaction condition according to an embodiment of the present invention, and based on fig. 5, a specific implementation process of the fund processing engine for processing the abnormal transfer transaction condition is as follows:
step a, the fund processing engine carries out transaction processing rule matching on any transfer transaction request and determines a transaction processing rule corresponding to the transfer transaction request.
And b, analyzing the matched transaction processing rule by the fund processing engine to determine transaction information such as a transaction initiator, a transaction receiver, a payment system to be called, transaction amount and the like.
And c, the fund processing engine constructs an execution request of the transfer transaction through transaction information such as a transaction initiator, a transaction receiver, transaction amount and the like, and sends the execution request to the payment system needing to be called. The payment system to be called is used for executing the transfer transaction, namely transferring the transaction amount transferred by the transaction initiator to the transaction receiver, and feeding back the execution result aiming at the transfer transaction to the fund processing engine.
And d, judging whether the transfer transaction is normally executed or not by the fund processing engine according to the transfer transaction execution result fed back by the payment system needing to be called. I.e., whether the transfer transaction was successfully executed.
And e, if the fund processing engine determines that the transfer transaction is abnormal in the execution process, acquiring the current transaction pointer information and acquiring an abnormal processing scheme corresponding to the transaction processing rule.
For example, the original transfer transaction is to transfer the transaction funds from account a to account B by paying the postal line through ALI, but an exception occurs in the transfer process.
1. If the transfer transaction support reversal is defined in the current transaction processing rule, the reversal interface information is found according to the current transaction pointer information, a reversal transaction task is generated according to the transaction information such as a transaction initiator, a transaction receiver and transaction amount, and the reversal transaction task is stored in a task database. That is, a reverse transaction request is created to transfer the transaction funds from account B to account a via the ALI payment mailway.
2. If the transfer transaction support inquiry is defined in the current transaction processing rule and the transfer transaction support inquiry does not support correction, the inquiry interface information is found according to the current transaction pointer information, an inquiry transaction task is generated according to transaction information such as a transaction initiator, a transaction receiver, transaction amount and the like, and the inquiry transaction task is stored in a task database. That is, a query transaction request is created that queries the ALI payment mailway, account a, and account B.
3. If the transfer transaction support cancellation is defined in the current transaction processing rule, the cancellation interface information is found according to the current transaction pointer information, a cancellation transaction task is generated according to transaction information such as a transaction initiator, a transaction receiver and transaction amount, and the cancellation transaction task is stored in a task database. That is, a payment route is created through the ALI, and a transaction request is created that transfers an undo from account a to account B.
And f, the fund processing engine polls the task database at regular time through the regular task processing component, pulls up a task to be processed when polling a certain task to be processed (such as a reverse transaction task, a query transaction task or a cancel transaction task and the like), calls a transaction processing rule matching logic and continues to execute the task to be processed.
Wherein, the interface transaction pointer adopts enumeration type characteristics in Java, and defines the following interface attribute values:
(1) interface name (name);
(2) interface meaning (description);
(3) call address (url);
(4) query interface pointer (queryIndex);
(5) rushing forward interface pointer (revokeIndex);
(6) the interface pointer (cancel) is revoked.
The interface attribute comprises a query interface pointer, a forward interface pointer and a cancel interface pointer, and the pointers point to the addresses of the query interface, the forward interface and the cancel interface corresponding to the interface. For example, if interface a is a cross-bank transfer interface, the query interface is queryA, the hedge interface is revokeA, and the cancel interface is cancel a, the definitions of these interfaces are as follows:
a (A transfer across rows, http://192.168.3.133, queryA, revokeA, cancel A);
queryA (queryA, cross-line transfer query, http://192.168.3.133, null, null, null);
RevokeA (RevokeA, Cross-Row transfers are positive, http://192.168.3.133, queryA, null, null);
CancelA (CancelA, Cross-Row transfer undo, http://192.168.3.133, queryA, null, null).
Through the interface pointer, the types and definitions of the alignment interface, the query interface and the cancellation interface corresponding to the interface can be quickly acquired. In addition, whether the transfer transaction supports inquiry, whether the transfer transaction supports withdrawal and whether the transfer transaction supports correction is also defined in the transaction processing rule, and when the transfer transaction is abnormal, the next processing mode of the current transaction can be acquired in the transaction processing rule.
The timed redo task function is a cluster task processing framework realized by a Quartz component, and can solve the problem that tasks are repeatedly pulled under a cluster environment. The specific implementation is that an interface for realizing a timing function is defined firstly, which is called as a Task, and the Task has four implementation classes, including a timing query Task, a timing correcting Task, a timing cancelling Task and a self-defined Task. The Task execution also needs a Trigger capable of triggering the Task to execute, and the most basic function of the Trigger is to specify whether the execution time, the execution interval, the execution times of the Task are executed immediately, and the like. And finally, defining a Scheduler which is responsible for integrating the Task and the Trigger. The execution flow of the timing task is as follows:
a. the client first needs to generate a scheduler factory, and in the fund processing engine, the following way is adopted to realize the customization of the client.
Properties properties=new Properties();
properties.put("org.quartz.threadPool.class","cn.webank.cnc.clrengine.core.utils.ThreadPoolExecutorUtil.");
properties.put("org.quartz.threadPool.threadCount","25");
SchedulerFactory sf=new StdSchedulerFactory(properties);
b. The scheduler instance is obtained from the scheduler factory by the getScheduler () method, and in the funds handling engine, the component default scheduler is used.
c. The Scheduler has a quartzscheduler Thread (subclass of Thread) attribute, and when the Scheduler instantiates, an object is instantiated, and the Thread object is started with threadexecutive. The thread is a scheduling thread, and the main task is to continuously acquire a trigger to be triggered from the JobStore and execute the corresponding task through the acquired trigger.
Through the processing mode, the system can automatically complete the follow-up check and compensation transaction under the condition of abnormal transfer transaction. In a financial system, transaction abnormal conditions are inevitably generated, manual intervention processing is required on a traditional transaction closed loop, risks exist in timeliness and safety, the abnormal transfer transaction conditions are processed according to the technical scheme provided by the embodiment of the invention, the system can be automatically completed, the labor cost and the time cost are greatly reduced, and the risks of manual processing are also reduced in safety.
The above embodiments show that, in the prior art, since one fund processing function is configured for each different business system, there may be a case where the same fund processing function is repeatedly developed, so that the development cost for the fund processing function is high and the reuse rate is low. Based on this, the technical scheme of the invention uniformly processes the fund processing service of a plurality of service systems with the same fund processing function by introducing the transaction processing rule matching component, so that the fund processing function can be prevented from being respectively developed for the plurality of service systems, thereby effectively reducing the development cost and the labor cost and improving the reuse rate aiming at the fund processing function. Specifically, for any service system, when a transfer transaction request initiated by the service system is detected, key transaction information in a 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 sequentially matched with each first node in a transaction processing rule network tree, a plurality of first matching nodes are determined, a second node to which the plurality of first matching nodes point together is determined, and a transaction processing rule corresponding to the second node (namely, a transaction processing rule corresponding to the transfer transaction) can be quickly and accurately determined according to the commonly-pointed second node. The transfer transaction may then be automatically and efficiently processed by the transaction processing rules. Therefore, the scheme can uniformly process the fund processing services of a plurality of service systems with the fund processing function of the same transaction processing logic through the transaction processing rule matching component, can effectively reduce the development cost and the labor cost, and can improve the reuse rate aiming at the fund processing function (namely improve the node reuse rate) because the transaction processing rule network tree constructed by the scheme comprises shared nodes (namely, multiplexing nodes, namely, shared nodes of the transaction processing rules with the same key elements). In addition, because the transaction processing rule network tree has the shared node, the matching path can be shortened when the transaction processing rules are matched, so that the transaction processing rules corresponding to the transfer transaction can be matched more quickly and accurately, and the processing efficiency of the transfer transaction can be effectively improved.
Based on the same technical concept, fig. 6 exemplarily shows a transaction processing rule matching device provided by an embodiment of the present invention, and the device can execute a flow of a transaction processing rule matching method. The transaction processing rule matching device in the embodiment of the invention is applied to the transaction processing rule matching component.
As shown in fig. 6, the apparatus includes:
the detection unit 601 is used for determining key transaction information in the transfer transaction corresponding to the transfer transaction request from the transfer transaction request when the transfer transaction request initiated by any business system is detected;
a processing unit 602, configured to match each key element in the key transaction information with each first node in a transaction processing rule network tree in sequence, determine a plurality of first matching nodes, determine a second node to which the plurality of first matching nodes point commonly, and determine a transaction processing rule corresponding to the second node according to the second node to which the plurality of first matching nodes point commonly; 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 rules network tree includes a first node characterizing each key element and a second node characterizing a plurality of key elements; and processing the transfer transaction according to the transaction processing rule.
Optionally, the processing unit 602 is specifically configured to:
acquiring each transaction processing rule from the transaction processing rule database;
for each transaction processing rule, determining a plurality of key elements from the transaction processing rule, and for each key element, when determining that a first node corresponding to the key element does not exist in the transaction processing rule network tree, creating a first node corresponding to the key element in the transaction processing rule network tree;
and aiming at each transaction processing rule, establishing a directional relation between each first node and each second node of the transaction processing rule, and establishing an association relation between each second node and the transaction processing rule, thereby generating the transaction processing rule network tree.
Optionally, the processing unit 602 is further configured to:
when determining that a first node corresponding to the key element exists in the transaction processing rule network tree, establishing a child node of the first node according to the similarity node information; the similarity node information comprises transaction processing rules with the same first node;
the processing unit 602 is specifically configured to:
for each first node, determining a 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 directional relation between each first node and the second node in the first transaction processing rule; and if the first node has child nodes, determining a second transaction processing rule according to the similarity node information, and establishing a directional relation between each first node and the corresponding second node in the second transaction processing rule until all the child nodes of the first node are traversed.
Optionally, the processing unit 602 is specifically configured to:
determining a transaction initiator, a transaction receiver and a transaction executor from the transaction processing rules;
constructing an execution request of the transfer transaction based on the transaction initiator and the transaction receiver, and sending the execution request to the transaction executor;
determining whether the transfer transaction is normally executed or not through response information for the execution request fed back by the transaction executing party;
if not, acquiring an exception handling scheme corresponding to the transaction handling rule, and carrying out corresponding processing on the transfer transaction through the exception handling scheme.
Optionally, the processing unit 602 is specifically configured to:
if the abnormal processing scheme is to carry out reversal on the transfer transaction, generating a reverse transaction task when the interface pointer information of a service interface of the transaction executing party for processing the transfer transaction is determined to have reversal interface pointer information, and storing the reverse transaction task into a task database; the reverse transaction task is used for indicating to execute the transfer transaction sent by the transaction receiver to the transaction initiator;
if the exception handling scheme is that only the transfer transaction is inquired, generating an inquiry transaction task when the inquiry interface pointer information exists in the interface pointer information of a business interface of the transaction executing party for processing the transfer transaction, and storing the inquiry transaction task into the task database; the inquiry transaction task is used for indicating to inquire the account address of the transaction initiator and the account address of the transaction receiver;
if the abnormal processing scheme is to cancel the transfer transaction, generating a cancel transaction task when determining that cancel interface pointer information exists in interface pointer information of a business interface of the transaction executing party for processing the transfer transaction, and storing the cancel transaction task into the task database; the transaction cancellation task is used for indicating that the transfer transaction sent by the transaction initiator to the transaction receiver is cancelled.
Optionally, the processing unit 602 is specifically configured to:
acquiring a trigger of a task to be executed from a trigger database through a trigger scheduling thread; the task to be executed is any one of the reverse transaction task, the inquiry transaction task or the cancel transaction task;
and acquiring the task to be executed from the task database through a task scheduler and executing the task to be executed when the execution time of the task to be executed is determined to be met through the trigger of the task to be executed.
Optionally, the detecting unit 601 is specifically configured to:
analyzing and processing the transfer transaction request to obtain a plurality of transaction information in the transfer transaction corresponding to the transfer transaction request;
determining key transaction information characterizing transaction characteristics of the transfer transaction from the plurality of transaction information.
Based on the same technical concept, an embodiment of the present invention further provides a computing device, as shown in fig. 7, including at least one processor 701 and a memory 702 connected to the at least one processor, where a specific connection medium between the processor 701 and the memory 702 is not limited in the embodiment of the present invention, and the processor 701 and the memory 702 in fig. 7 are connected through a bus as an example. The bus may be divided into an address bus, a data bus, a control bus, etc.
In the embodiment of the present invention, the memory 702 stores instructions executable by the at least one processor 701, and the at least one processor 701 may execute the steps included in the aforementioned transaction processing rule matching method by executing the instructions stored in the memory 702.
The processor 701 is a control center of the computing device, and may be connected to various parts of the computing device by using various interfaces and lines, and implement data processing by executing or executing instructions stored in the memory 702 and calling data stored in the memory 702. Optionally, the processor 701 may include one or more processing units, and the processor 701 may integrate an application processor and a modem processor, where the application processor mainly processes an operating system, a user interface, an application program, and the like, and the modem processor mainly processes an issued instruction. It will be appreciated that the modem processor described above may not be integrated into the processor 701. In some embodiments, processor 701 and memory 702 may be implemented on the same chip, or in some embodiments, they may be implemented separately on separate chips.
The processor 701 may be a general-purpose processor, such as a Central Processing Unit (CPU), a digital signal processor, an Application Specific Integrated Circuit (ASIC), a field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof, configured to implement or perform the methods, steps, and logic blocks disclosed in embodiments of the present invention. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the disclosed method in connection with the transaction processing rule matching method embodiments may be embodied directly in a hardware processor, or in a combination of hardware and software modules within the processor.
Memory 702, which is a non-volatile computer-readable storage medium, may be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. The Memory 702 may include at least one type of storage medium, and may include, for example, a flash Memory, a hard disk, a multimedia card, a card-type Memory, a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Programmable Read Only Memory (PROM), a Read Only Memory (ROM), a charge Erasable Programmable Read Only Memory (EEPROM), a magnetic Memory, a magnetic disk, an optical disk, and so on. The memory 702 is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to such. The memory 702 of embodiments of the present invention may also be circuitry or any other device capable of performing a storage function to store program instructions and/or data.
Based on the same technical concept, the embodiment of the present invention also provides a computer-readable storage medium storing a computer program executable by a computing device, wherein when the program runs on the computing device, the computer program causes the computing device to execute the steps of the transaction processing rule matching method.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may 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, and the like) having computer-usable program code embodied therein.
The present 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 flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present application and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (10)

1. A transaction processing rule matching method applied to a transaction processing rule matching component, the method comprising:
for any service system, when a transfer transaction request initiated by the service system is detected, determining key transaction information in the transfer transaction corresponding to the transfer transaction request from the transfer transaction request;
sequentially matching each key element in the key transaction information with each first node in a transaction processing rule network tree to determine a plurality of first matching nodes, determining a second node pointed by the first matching nodes in common, and determining a transaction processing rule corresponding to the second node according to the second node pointed in common; 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 rules network tree includes a first node characterizing each key element and a second node characterizing a plurality of key elements;
and processing the transfer transaction according to the transaction processing rule.
2. The method of claim 1, wherein the transaction processing rules network tree is determined by:
acquiring each transaction processing rule from the transaction processing rule database;
for each transaction processing rule, determining a plurality of key elements from the transaction processing rule, and for each key element, when determining that a first node corresponding to the key element does not exist in the transaction processing rule network tree, creating a first node corresponding to the key element in the transaction processing rule network tree;
and aiming at each transaction processing rule, establishing a directional relation between each first node and each second node of the transaction processing rule, and establishing an association relation between each second node and the transaction processing rule, thereby generating the transaction processing rule network tree.
3. The method of claim 2, further comprising:
when determining that a first node corresponding to the key element exists in the transaction processing rule network tree, establishing a child node of the first node according to the similarity node information; the similarity node information comprises transaction processing rules with the same first node;
aiming at each transaction processing rule, establishing a directional relation between each first node and each second node of the transaction processing rule, wherein the directional relation comprises the following steps:
for each first node, determining a 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 directional relation between each first node and the second node in the first transaction processing rule; and if the first node has child nodes, determining a second transaction processing rule according to the similarity node information, and establishing a directional relation between each first node and the corresponding second node in the second transaction processing rule until all the child nodes of the first node are traversed.
4. The method of claim 1 wherein the processing of the transfer transaction via the transaction processing rules comprises:
determining a transaction initiator, a transaction receiver and a transaction executor from the transaction processing rules;
constructing an execution request of the transfer transaction based on the transaction initiator and the transaction receiver, and sending the execution request to the transaction executor;
determining whether the transfer transaction is normally executed or not through response information for the execution request fed back by the transaction executing party;
if not, acquiring an exception handling scheme corresponding to the transaction handling rule, and carrying out corresponding processing on the transfer transaction through the exception handling scheme.
5. The method as recited in claim 4 wherein said processing the transfer transaction accordingly through the exception handling scheme comprises:
if the abnormal processing scheme is to carry out reversal on the transfer transaction, generating a reverse transaction task when the interface pointer information of a service interface of the transaction executing party for processing the transfer transaction is determined to have reversal interface pointer information, and storing the reverse transaction task into a task database; the reverse transaction task is used for indicating to execute the transfer transaction sent by the transaction receiver to the transaction initiator;
if the exception handling scheme is that only the transfer transaction is inquired, generating an inquiry transaction task when the inquiry interface pointer information exists in the interface pointer information of a business interface of the transaction executing party for processing the transfer transaction, and storing the inquiry transaction task into the task database; the inquiry transaction task is used for indicating to inquire the account address of the transaction initiator and the account address of the transaction receiver;
if the abnormal processing scheme is to cancel the transfer transaction, generating a cancel transaction task when determining that cancel interface pointer information exists in interface pointer information of a business interface of the transaction executing party for processing the transfer transaction, and storing the cancel transaction task into the task database; the transaction cancellation task is used for indicating that the transfer transaction sent by the transaction initiator to the transaction receiver is cancelled.
6. The method of claim 5, further comprising:
acquiring a trigger of a task to be executed from a trigger database through a trigger scheduling thread; the task to be executed is any one of the reverse transaction task, the inquiry transaction task or the cancel transaction task;
and acquiring the task to be executed from the task database through a task scheduler and executing the task to be executed when the execution time of the task to be executed is determined to be met through the trigger of the task to be executed.
7. The method as recited in claim 1 wherein determining key transaction information in the transfer transaction corresponding to the transfer transaction request from the transfer transaction request comprises:
analyzing and processing the transfer transaction request to obtain a plurality of transaction information in the transfer transaction corresponding to the transfer transaction request;
determining key transaction information characterizing transaction characteristics of the transfer transaction from the plurality of transaction information.
8. A transaction processing rule matching apparatus applied to a transaction processing rule matching component, the apparatus comprising:
the detection unit is used for determining key transaction information in the transfer transaction corresponding to the transfer transaction request from the transfer transaction request when the transfer transaction request initiated by the service system is detected for any service system;
the processing unit is used for sequentially matching each key element in the key transaction information with each first node in the transaction processing rule network tree, determining a plurality of first matching nodes, determining a second node pointed by the first matching nodes in common, and determining a transaction processing rule corresponding to the second node according to the second node pointed in common; 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 rules network tree includes a first node characterizing each key element and a second node characterizing a plurality of key elements; and processing the transfer transaction according to the transaction processing rule.
9. A computing device comprising 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 of any of claims 1 to 7.
10. A computer-readable storage medium, storing a computer program executable by a computing device, the program, when run on the computing device, causing the computing device to perform the method of any of claims 1 to 7.
CN202111572249.6A 2021-12-21 2021-12-21 Transaction processing rule matching method and device Pending CN114254921A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111572249.6A CN114254921A (en) 2021-12-21 2021-12-21 Transaction processing rule matching method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111572249.6A CN114254921A (en) 2021-12-21 2021-12-21 Transaction processing rule matching method and device

Publications (1)

Publication Number Publication Date
CN114254921A true CN114254921A (en) 2022-03-29

Family

ID=80796329

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111572249.6A Pending CN114254921A (en) 2021-12-21 2021-12-21 Transaction processing rule matching method and device

Country Status (1)

Country Link
CN (1) CN114254921A (en)

Similar Documents

Publication Publication Date Title
CN108846659B (en) Block chain-based transfer method and device and storage medium
CN104216912A (en) Method and device for achieving non-intrusive service form workflow
CN109684057A (en) Task processing method, device and storage medium
CN110163572B (en) Chain code function processing method, device and equipment
WO2019149032A1 (en) Distributed transaction processing method and device
CN112150262B (en) Account checking data processing method and device
CN111553656A (en) Capital settlement method and device based on big data, electronic equipment and medium
CN111754200A (en) Service processing method and device
CN111399851B (en) Batch processing execution method based on distributed system
CN111400283B (en) Data processing method, system, electronic equipment and storage medium
US20200242702A1 (en) Capital chain information traceability method, system, server and readable storage medium
CN114254921A (en) Transaction processing rule matching method and device
CN112465628A (en) Data verification method and device, electronic equipment and storage medium
CN111124631A (en) Task processing method and device based on block chain network
CN109918414A (en) Data processing method, device, storage medium and computer equipment based on building quantity inventory
CN112801616B (en) Abnormal account book processing method and device
CN111506784B (en) Asset creditor matching method, device, computer equipment and storage medium
CN112418720A (en) Management method and device for mapping of business and process engine, electronic equipment and medium
CN114116181B (en) Distributed data analysis task scheduling system and method
CN116700938B (en) Flow processing method of transaction approval business, electronic equipment and storage medium
CN109727144A (en) Insure Incidence calculus method, apparatus, equipment and computer readable storage medium
CN102331926B (en) Process model converting and structure-verifying method based on control flow mode
CN111736927A (en) Transaction workflow scheduling method and scheduling device based on CICS
CN111738814A (en) Account splitting processing method and device
CN116991547A (en) Transaction execution method, device, terminal equipment and storage medium based on sub-transaction

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination