A method and apparatus for transaction tracking based on transaction relationship graphs
By dynamically splitting directed edges in the transaction relationship graph and matching funds in real time, the problem of long dependencies in the calculation of the transaction relationship graph is solved, improving computational efficiency and resource utilization, and expanding the scope of application.
Patent Information
- Application Number
- CN202411444183.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-15
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2044-10-15
AI Technical Summary
Existing technologies suffer from low computational efficiency due to long dependencies when performing transaction relationship graph traversal calculations, making them unsuitable for efficient application in large-scale fund transaction calculations.
By dynamically splitting directed edges during graph computation, upstream and downstream funds are matched in real time, reducing long dependencies, improving the utilization of computing resources, and reducing waiting time.
It significantly reduces the time required to calculate the transaction relationship graph, improves computational efficiency, and expands its application scope.
Smart Images

Figure CN119444224B_ABST
Abstract
Description
Technical Field
[0001] This specification relates to one or more embodiments in the field of graph computing, and more particularly to a method and apparatus for transaction tracking based on a transaction relationship graph. Background Technology
[0002] With the development of computer technology and the rapid popularization of e-commerce, online transactions have become an indispensable part of people's daily lives. As the foundational system supporting online transactions, payment systems handle massive amounts of financial transactions every day. These transactions link users, merchants, financial institutions, and other trading partners, reflecting the complex transaction relationships among these numerous participants.
[0003] By abstracting and modeling massive amounts of financial transactions, a transaction relationship graph can be constructed. Iterative calculations and analysis of this graph, tracing the financial transaction chain, can serve as an important reference for mitigating business risks, combating illicit activities, analyzing the intentions of trading partners, and managing financial risks, demonstrating immense value for data mining and analysis.
[0004] Therefore, there is a need for a solution that can efficiently analyze transaction relationship diagrams and track transactions through technical means. Summary of the Invention
[0005] One or more embodiments of this specification describe a method and apparatus for transaction tracking based on a transaction relationship graph. In a transaction relationship graph containing massive amounts of fund transaction information, fund transactions with upstream fund dependencies are dynamically split, eliminating long dependencies in the fund transaction tracking calculation process, thereby improving the analysis efficiency of the transaction relationship graph.
[0006] According to the first aspect, a method for transaction tracking based on a transaction relationship graph is provided, wherein the transaction relationship graph contains nodes representing transaction objects and directed edges between the representative nodes, and the method includes multi-round graph iteration calculation, wherein any round of iteration other than the first round includes:
[0007] The node pointed to by the first directed edge in the previous iteration is determined as the target node. The target processing includes transmitting the transaction information on the edge to the target node along the edge.
[0008] For the several first outgoing edges on the target node that have not yet undergone the target processing, first outgoing edge processing is performed. The first outgoing edge processing includes determining at least one outgoing edge such that the sum of its transaction amount corresponds to the first transaction amount of the first directed edge, and performing target processing on the at least one outgoing edge; wherein the at least one outgoing edge includes at least one of the several first outgoing edges, and / or a sub-edge obtained by splitting the target outgoing edge among the several first outgoing edges; wherein the remaining outgoing edges generated by splitting the target outgoing edge, excluding the sub-edge, remain in a state where no target processing has been performed.
[0009] According to one implementation, the arbitrary round iteration further includes:
[0010] After the first outgoing edge processing, the target node is first judged. If it does not have an incoming edge that has not yet been processed, and there is a second outgoing edge that has not yet been processed, then the target processing is directly performed on the second outgoing edge.
[0011] According to one implementation, the arbitrary round iteration further includes:
[0012] If the target node has a third outgoing edge, and the transaction time corresponding to the third outgoing edge is earlier than all incoming edges on the target node that have not yet undergone target processing, then the target processing is performed directly on the third outgoing edge.
[0013] According to one implementation, the first iteration includes:
[0014] In the transaction relationship graph, several starting nodes are determined, and each starting node does not contain incoming edges. The target processing is then performed on the outgoing edges of any starting node.
[0015] According to one implementation, the target processing further includes: recording the source of the transaction information.
[0016] According to one implementation, the first outgoing edge satisfies a first condition, which includes: the first transaction time corresponding to the first outgoing edge is later than the second transaction time corresponding to the first directed edge.
[0017] In one scenario of the above implementation, the first condition further includes: the time difference between the first transaction time and the second transaction time is less than the first time threshold.
[0018] According to one implementation, the plurality of first outgoing edges are single outgoing edges; determining at least one outgoing edge includes:
[0019] If the second transaction amount corresponding to the single outgoing edge is greater than the first transaction amount, then the single outgoing edge is taken as the target outgoing edge and split into a sub-edge and a remaining outgoing edge. The transaction amount of the sub-edge is the first transaction amount, and the transaction amount corresponding to the remaining outgoing edge is the difference between the second transaction amount and the first transaction amount.
[0020] According to one implementation, the plurality of first outgoing edges are multiple first outgoing edges; determining at least one outgoing edge includes:
[0021] Several selected outgoing edges and the target outgoing edge are determined from the plurality of first outgoing edges. The target outgoing edge is split into sub-edges and remaining outgoing edges. The sum of the transaction amounts of the several selected outgoing edges is the third transaction amount, the transaction amount of the sub-edge is the fourth transaction amount, the sum of the third transaction amount and the fourth transaction amount is the first transaction amount, and the transaction amount corresponding to the remaining outgoing edge is the difference between the original transaction amount of the target outgoing edge and the fourth transaction amount.
[0022] According to one implementation, determining at least one outgoing edge includes: determining at least one outgoing edge from the plurality of first outgoing edges based on a first sorting; the first sorting is based on the transaction time corresponding to each first outgoing edge.
[0023] According to one implementation, determining at least one outgoing edge includes: determining at least one outgoing edge from the plurality of first outgoing edges based on a second sorting; the second sorting is based on the transaction amount corresponding to each first outgoing edge.
[0024] According to the second aspect, an apparatus for transaction tracking based on a transaction relationship graph is provided, wherein the transaction relationship graph contains nodes representing transaction objects and directed edges between the representative nodes, the apparatus being used to perform any round of iteration in a multi-round graph iterative computation (excluding the first round), the apparatus comprising:
[0025] The determination module is configured to determine the node pointed to by the first directed edge in the previous iteration as the target node. The target processing includes transmitting the transaction information on the edge to the pointed node along the edge.
[0026] The processing module is configured to perform first outgoing edge processing on a plurality of first outgoing edges on the target node that have not yet undergone the target processing. The first outgoing edge processing includes determining at least one outgoing edge such that the sum of its transaction amounts corresponds to the first transaction amount of the first directed edge, and performing target processing on the at least one outgoing edge. The at least one outgoing edge includes at least one of the plurality of first outgoing edges, and / or a sub-edge obtained by splitting the target outgoing edge among the plurality of first outgoing edges. The remaining outgoing edges other than the sub-edges generated by splitting the target outgoing edge remain in a state of not undergoing target processing.
[0027] According to a third aspect, a computer program product is provided, including a computer program / instructions that, when executed by a processor, implement the steps of the method described in the first aspect.
[0028] According to a fourth aspect, a computing device is provided, including a memory and a processor, characterized in that the memory stores executable code, and when the processor executes the executable code, it implements the method described in the first aspect.
[0029] By implementing the methods and apparatus provided in the embodiments of this specification, upstream and downstream funds can be matched in real time during the traversal calculation of the transaction relationship graph. Based on the matching results, fund transactions can be dynamically split when necessary. Applying real-time fund transaction matching and dynamic fund transaction splitting technologies can effectively solve the problem of long-tail dependencies in the transaction relationship graph traversal calculation process, improve the utilization rate of computing resources, reduce long-tail dependency calculations, thereby significantly shortening the time consumed in full graph calculation, improving the efficiency of transaction relationship graph calculation, and expanding its application scope. Attached Figure Description
[0030] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.
[0031] Figure 1 This is an example of a transaction relationship diagram structure disclosed in the embodiments of this specification;
[0032] Figure 2 This specification provides an example of a transaction relationship diagram for embodiments;
[0033] Figure 3A A sample transaction object and its associated fund transaction sub-graph are provided;
[0034] Figure 3B A sample transaction object and its associated fund transaction sub-graph are provided;
[0035] Figure 4 This is a flowchart illustrating a method for transaction tracking based on a transaction relationship graph, according to an embodiment of this specification.
[0036] Figure 5 Several examples of starting node determination are provided;
[0037] Figure 6A This is a schematic diagram of the scenario for determining the outgoing edge in the first outgoing edge processing according to the embodiments of this specification;
[0038] Figure 6B This is a schematic diagram of the scenario for determining the outgoing edge in the first outgoing edge processing according to the embodiments of this specification;
[0039] Figure 6C This is a schematic diagram of the rule scenario for determining outgoing edges in the first outgoing edge processing according to the embodiments of this specification;
[0040] Figure 6D This is a schematic diagram illustrating the scenario of determining the first outgoing edge according to the embodiments of this specification;
[0041] Figure 7 This is a schematic diagram of a device for transaction tracking based on a transaction relationship graph, according to an embodiment of this specification. Detailed Implementation
[0042] The solutions provided in the embodiments of this specification will now be described with reference to the accompanying drawings.
[0043] As mentioned earlier, a transaction relationship graph is a directed graph obtained by abstracting and modeling massive amounts of financial transactions. In this graph, nodes represent transaction objects, such as users, merchants, and financial institutions. These objects can be identified using some form of account (e.g., ID in an electronic payment system, bank card number, etc.), and directed edges represent financial transactions between nodes. In other words, transaction objects can be abstracted as nodes in a directed graph, and financial transactions can be abstracted as directed edges. Corresponding transaction information (e.g., transaction amount, transaction time, transaction scenario, etc.) is loaded as edge attribute information onto the corresponding directed edges, thus constructing the transaction relationship graph.
[0044] In real-world business scenarios, as funds are generated through transactions, funds flow between multiple trading partners. In order to identify business risks amidst massive amounts of financial transactions, iterative graph calculations can be performed on the transaction relationship graph to track financial transactions.
[0045] Figure 1A sample transaction relationship graph architecture is provided, where nodes A, B, C, and D represent transaction objects in a transaction. Directed edges represent fund transactions, with the source node being the initiator and the pointing node being the counterparty or receiver. Each directed edge carries transaction information, such as: Transaction scenario: transfer; Transaction amount: ¥100; Transaction time: 2024.01.01 15:00. Alternatively, the transaction relationship graph can be interpreted from the perspective of fund relationships. Taking transaction object B as an example, B's downstream fund transactions include "spending ¥50 to transaction object C" and "sending a ¥50 red envelope to transaction object D," with the corresponding upstream fund being "transferring ¥100 from A to B." Based on the transaction relationship graph, traversing along the directed edges yields fund turnover records, completing transaction tracking. The extracted fund flow paths, fund dwell time, and fund sources, among other transaction characteristics, can assist in downstream task analysis, providing important references for mitigating business risks, combating black market activities, analyzing the intentions of transaction objects, and managing fund risks.
[0046] In one scenario, graph partitioning techniques (e.g., vertex partitioning, edge partitioning, etc.) can be used to distribute the transaction graph across different computing devices. See also... Figure 1 The dashed lines exemplify the devices where nodes reside. Nodes A and B in the graph are stored on device DA, while nodes C and D are stored on device DB. During graph iterative computation, device DA and device DB can communicate with each other, utilizing distributed graph computing technologies (e.g., the BSP model, the Pregel framework, etc.) to complete the traversal computation of the transaction relationship graph. In practice, depending on specific business needs and the characteristics of the transaction relationship graph, different nodes / directed edges can be stored on one computing device or multiple storage devices. Figure 1 This is just one example.
[0047] It is important to understand that, for the sake of brevity, in the following description and the embodiments in the specification, transaction time in the transaction relationship diagram is represented in calendar days, using the form D+n, where D represents the base transaction day of the transaction relationship diagram, and n represents the nth calendar day after the base transaction day. For example, assuming D is January 1, 2024, then D+1 represents January 2, 2024, D+2 represents January 3, 2024, and so on. Transaction amounts are simplified to integers. This simplified description does not imply a limitation on the embodiments. In practical applications, depending on business needs and computing power, transaction time in a payment system can typically be accurate to milliseconds or even microseconds; transaction amounts can usually be processed using a rounding algorithm to retain two decimal places.
[0048] Because payment systems involve massive amounts of financial transactions, the transaction relationship graphs built upon these transactions often contain a huge number of directed edges and nodes. Clearly, tracking transactions on such a large-scale graph would lead to unfocused graph traversal computations, wasted computational resources, and reduced efficiency. Therefore, transaction tracking can be performed using a transaction relationship graph encompassing financial transactions over a specific time period. This graph can be a subgraph extracted from the overall transaction relationship graph containing all financial transactions; for example, it could be an incremental transaction relationship graph composed of financial transactions occurring within the last six months, based on transaction time. Alternatively, it could be a transaction relationship graph centered on a specific node or certain financial transactions to be analyzed. (See also...) Figure 2 The attached diagram provides an example transaction relationship diagram extracted from the overall transaction relationship diagram, which includes fund transactions between 14 trading entities that occurred within the last 5 calendar days (D+0 to D+4).
[0049] To achieve transaction tracking, one related technique involves graph traversal calculation along directed edges based on the upstream and downstream funding dependencies of fund transactions. This includes multiple rounds of graph iteration calculation, each iteration being a superstep. In each superstep, several directed edges that meet the calculation conditions trigger edge calculation. The calculation condition is that the upstream funds dependent on the directed edge have all been calculated and transmitted to the source node of the directed edge. Edge calculation processes the transactions on the directed edge and transmits the corresponding transaction information to the pointing node. In the transaction relationship graph, there are also some nodes without incoming edges, i.e., without upstream funding dependencies. These directed edges can be used as starting directed edges for direct calculation. The following example illustrates the calculation conditions involved in this related technique. In the following examples and embodiments, <source node, pointing node> represents a directed edge between two nodes, with the direction from the source node to the pointing node; in some special cases, <source node, pointing node, amount> is used to distinguish and represent multiple directed edges between two nodes. This representation concisely and clearly describes the fund transactions between nodes, which helps to better understand and apply the methods and apparatus disclosed in the embodiments of this specification.
[0050] Figure 3A This example provides a subgraph showing transaction objects and related financial transactions. Node A makes a financial transaction of ¥150 to node B, and node B makes a financial transaction of ¥150 to node C. In this example, the two financial transactions are equal in amount. Therefore, the upstream funding dependency of the fund B spends on C is the ¥150 spent by A on B. Thus, the edge...<B,C> The calculation condition is the edge<A,B> Edge calculation has been completed, and ¥150 has been passed to node B.
[0051] Figure 3B Another example is provided, showing the transaction objects and related fund transactions in a subgraph. Node A makes a fund transaction of ¥50 to node B, node D makes a fund transaction of ¥100 to node B, and node B makes a fund transaction of ¥150 to node C. In this example, the amount of money B spends on C is equal to the sum of the amounts B receives from A and D. Therefore, the upstream funding dependency of B's expenditure on C is the ¥50 expenditure from A to B and the ¥100 expenditure from D to B. Thus, the edge...<B,C> The calculation condition is the edge<A,B> With edge<D,B> Edge calculations have been completed for all edges.
[0052] Next, with Figure 2 Taking the transaction relationship diagram shown as an example, by applying the computational ideas of the above-mentioned related technologies and performing transaction tracking based on the transaction relationship diagram in the attached figure, the overstep shown in Table 1 below will be generated.
[0053] Table 1 Example of Transaction Relationship Diagram Calculation
[0054]
[0055]
[0056] This calculation method allows for the completion of full graph computation of the transaction relationship graph after 7 iterations. Nodes S and O have no outgoing edges (i.e., fund expenditure transactions), thus S is the final node, having received a total of ¥950. The directed edges calculated during the graph computation process completely record the transaction chain of these funds. The inventors discovered that in this computation process, each iteration is based on a strong dependence on and strong waiting for upstream funds, strictly propagating the calculation of directed edges according to the transaction sequence. Therefore, some inefficient waiting occurs. For example, node C receives ¥500 from nodes D and E in superstep 1. However, because node C's expenditure transaction amount is ¥950, it must wait for the remaining upstream funds of ¥450 to be calculated before processing this expenditure transaction. This results in node C's expenditure transaction directed edge not being calculated until superstep 4. Clearly, this inefficient waiting becomes increasingly severe as the transaction chain lengthens, significantly reducing graph computation efficiency and making transaction tracing based on the transaction relationship graph unsuitable for large-scale fund transaction calculations.
[0057] To address the aforementioned issues, this specification proposes a method and apparatus for transaction tracking based on a transaction relationship graph in its embodiments. During graph computation, directed edges can be dynamically split, transforming strong global dependencies that trigger directed edge computation into local dependencies. Furthermore, the split directed edges are used for real-time fund matching calculations, thereby reducing local dependencies, minimizing waiting time, and improving graph computation efficiency.
[0058] Following the above technical concept. In Figure 4 The diagram illustrates a method for transaction tracking based on a transaction relationship graph, according to embodiments of this specification. It is understood that this method can be executed by any device, equipment, platform, or cluster of devices with computing and processing capabilities. See also... Figure 4 In this embodiment, the transaction relationship graph includes nodes representing transaction objects and directed edges representing transactions between these nodes. The method includes multi-round graph iterative calculation, wherein...
[0059] The first iteration includes at least step S401: in the transaction relationship graph, determine several starting nodes, wherein the starting nodes do not contain incoming edges; perform target processing on the outgoing edges of any starting node. The target processing includes passing the transaction information on the edge along the edge to the pointing node, i.e., corresponding to the aforementioned edge calculation.
[0060] Any iteration beyond the first round includes at least the following steps: Step S403: Determine the node pointed to by the first directed edge that underwent target processing in the previous iteration as the target node. The target processing includes transmitting transaction information on the edge to the pointed node along the edge. Step S405: Perform first outgoing edge processing on several first outgoing edges on the target node that have not yet undergone target processing. The first outgoing edge processing includes determining at least one outgoing edge such that the sum of its transaction amounts corresponds to the first transaction amount of the first directed edge, and performing target processing on the at least one outgoing edge. The at least one outgoing edge includes at least one of the several first outgoing edges, and / or a sub-edge obtained by splitting the target outgoing edge among the several first outgoing edges. The remaining outgoing edges, excluding the sub-edges, generated by splitting the target outgoing edge remain in a state where no target processing has been performed.
[0061] The specific execution method of each of the above steps will be described in detail below with reference to the accompanying drawings.
[0062] First, a brief explanation of the atomization process used multiple times in the workflow will be given.
[0063] Target processing: Propagate the transaction information along the edge to the pointing node. Transaction information refers to business information related to the transaction, including but not limited to transaction amount, transaction time, and transaction scenario. Let's illustrate target processing with an example: A transaction occurs between node A and node B, initiated by node A and received by node B. A directed edge exists between the two nodes.<A,B> This indicates that for this transaction, the target processing of the directed edge is performed, indicating that the edge...<A,B> The corresponding fund transaction information is transmitted to the target node B. In some embodiments, the target processing further includes recording the source of the transaction information. For example, when the edge...<A,B> When processing the target, record the funding source node A. In this way, after the transaction relationship graph is processed, a complete list of funding transaction initiators can be obtained.
[0064] First Outgoing Edge Processing: Determine at least one outgoing edge such that the sum of its transaction amounts corresponds to the transaction amount of the target incoming edge, and perform target processing on this at least one outgoing edge. For ease of understanding, assume node B is the target node. In short, the first outgoing edge processing is: for node B, based on the transaction amount, perform target processing on the outgoing edges that match the target incoming edge. In one example, if the transaction amount corresponding to one outgoing edge of node B equals the transaction amount of the target incoming edge, then target processing can be performed on that outgoing edge. In another example, if the sum of the transaction amounts corresponding to multiple outgoing edges of node B equals the transaction amount of the target incoming edge, then target processing needs to be performed on each of these multiple outgoing edges separately. In practical applications, there are various situations regarding the determination of outgoing edge matching, requiring different matching strategies to be formulated according to the specific scenario. These will be elaborated in detail below and will not be discussed further here.
[0065] Then, to Figure 4 The following is a framework introduction to the method flow. In transaction tracking based on transaction relationship graphs, all processed directed edges are recorded by traversing the transaction relationship graph, thereby extracting fund flow tracking information. The traversal of the transaction relationship graph includes multiple rounds of graph iterative calculation. The first iteration serves as the starting step, searching for directed edges in the transaction relationship graph that have no upstream fund dependencies and calculating them to initiate the traversal of the transaction relationship graph. In subsequent iterations, excluding the first iteration, the calculation steps can be repeatedly executed until all directed edges in the transaction relationship graph have been calculated, or until a cutoff condition is met.
[0066] Next, for Figure 4 The provided methods and procedures are explained in detail.
[0067] For the first iteration, in step S401, several starting nodes are determined in the transaction relationship graph, and the starting nodes do not contain incoming edges; target processing is performed on the outgoing edges of any starting node.
[0068] As the initiating node for fund transactions in transaction tracking, the starting node must ensure that the fund transactions it issues do not depend on any upstream funds. Therefore, a node without any incoming edges (i.e., incoming fund transactions) can be identified as the starting node. Figure 5 Several examples of starting node determination are provided. Referring to example 1 in the figure, node A has two outgoing edges, neither of which has been processed by the target, and it has no incoming edges. That is to say, the two fund transactions corresponding to the two outgoing edges of node A do not have any upstream fund dependencies. Therefore, node A can be determined as the starting node, and the target processing is performed on both outgoing edges of node A to complete the first round of iteration.
[0069] After the first iteration, several directed edges that have undergone target processing are generated. The nodes pointed to by these directed edges can serve as the processing targets for the next iteration. Based on the rules of the first outgoing edge processing, the fund transaction information is continuously passed to the next pointing node along the directed edges, starting the subsequent multiple rounds of iterative processing until the transaction tracking task is completed. Next, the implementation method in the specification will be described using any iteration other than the first iteration as an example.
[0070] Step S403: The node pointed to by the first directed edge that was processed in the previous iteration is determined as the target node.
[0071] In a single iteration, the first step is to determine the target node to be processed in this iteration. This target node should be the node pointed to by the directed edge that was processed in the previous iteration. For example, in the previous iteration, the edge...<A,B> Target processing was performed; in this iteration, the edges...<A,B> The first directed edge points to node B, which can be determined as the target node.
[0072] Next, in step S405, the first outgoing edges that have not yet been processed on the target node are processed.
[0073] The first outgoing edge processing involved in this step has been described previously and will not be repeated here. Based on the technical concept introduced earlier, it is clear that the selection of at least one outgoing edge from the plurality of first outgoing edges in the first outgoing edge processing is closely related to the computational efficiency of graph traversal. To improve computational efficiency, it is necessary to select as many outgoing edges as possible that meet the matching conditions and process them as early as possible, passing transaction information to the target node in early iteration rounds, thereby alleviating the computational inefficiency caused by long dependencies in related technologies.
[0074] According to the embodiments in this specification, Figure 6A The diagram illustrates the determination of at least one outgoing edge in different scenarios during the first outgoing edge processing. The following sections will elaborate on each scenario with reference to the accompanying drawings.
[0075] In one example, such as Figure 6A As shown in the first scenario, in the current iteration, the edge<A,B> In the previous iteration, target processing was performed. This edge is the first directed edge, corresponding to a first transaction amount of ¥50, and its pointing node B is the target node. Outgoing edges from node B<B,C> Without target processing, the corresponding transaction amount is ¥50, which is equal to the first transaction amount. Therefore, the at least one outgoing edge can be identified as an edge.<B,C> Then, target processing is performed on that side.
[0076] In another example, such as Figure 6A As shown in scenario 2, unlike scenario 1, in the current iteration, the outgoing edges of target node B...<B,C> The corresponding transaction amount is ¥30, which is less than the first transaction amount. However, since node B only has this one outgoing edge, from the perspective of fund matching in fund transactions, it belongs to the case where the outgoing transaction partially matches the incoming transaction, and the upstream fund dependence condition has been met. Therefore, the aforementioned at least one outgoing edge can be identified as an edge.<B,C> Then, target processing is performed on that side.
[0077] In another example, such as Figure 6A As shown in scenario 3, unlike scenario 1, in the current iteration, the outgoing edges of target node B...<B,C> The corresponding transaction amount is ¥80, which is greater than the first transaction amount. Clearly, the edge...<B,C> The upstream funding dependency was not met, preventing the target processing. However, in order to process funding transactions as early as possible and reduce long-term dependencies, the edge in this scenario...<B,C> The process involves splitting the edges. Corresponding to this example, in a specific implementation, the plurality of first outgoing edges are single outgoing edges; determining at least one outgoing edge includes: if the second transaction amount corresponding to the single outgoing edge is greater than the first transaction amount, then the single outgoing edge is taken as the target outgoing edge, and it is split into sub-edges and remaining outgoing edges. The transaction amount of the sub-edges is the first transaction amount, and the transaction amount corresponding to the remaining outgoing edges is the difference between the second transaction amount and the first transaction amount.
[0078] In other words, the edge<B,C> The edge splits into a sub-edge containing a transaction amount of ¥50 (equal to the first transaction amount) and a remaining outgoing edge containing a transaction amount of ¥30 (equal to the difference between the second and first transaction amounts). The upstream funding dependency condition of the sub-edge has been satisfied. Thus, the at least one outgoing edge can be identified as the sub-edge.<B,C,¥50> Perform target processing on this edge, and remove the remaining outgoing edges.<B,C,¥30> Maintain the state before target processing. By performing edge splitting operations, the global long dependency of directed edges in graph traversal is decomposed into local dependencies, and sub-edges that already satisfy upstream funding dependencies are processed in advance, thereby reducing waiting time and improving graph computation efficiency.
[0079] The examples above illustrate scenarios where the target node has exactly one outgoing edge that has not been processed by the target. In practical applications, a transaction object typically involves multiple inbound and outbound transactions. Examples of such scenarios will be provided below.
[0080] Figure 6B The diagram illustrates how, in the first outgoing edge processing, at least one outgoing edge is determined by combining several first outgoing edges. The following sections will elaborate on various scenarios with reference to the accompanying drawings. It should be noted that, for the sake of brevity, several examples use two or three outgoing edges to illustrate the scenarios, but this does not imply a limitation of the processing method to any particular application scenario. In practical applications, this processing method is also suitable for scenarios where the target node has more outgoing edges.
[0081] In one example, such as Figure 6B As shown in the first scenario, in the current iteration, the edge<A,B> In the previous iteration, target processing was performed. This edge is the first directed edge, corresponding to a first transaction amount of ¥50, and its pointing node B is the target node. Outgoing edges from node B<B,C,¥20> ,<B,C,¥30> Without target processing, the sum of the transaction amounts of the two outgoing edges equals the first transaction amount; therefore, the at least one outgoing edge can be identified as an edge.<B,C,¥20> and edge<B,C,¥30> Target processing is performed on each of the two edges separately.
[0082] In another example, such as Figure 6B As shown in scenario 2, unlike scenario 1, in the current iteration, the outgoing edges of target node B that have not been processed by the target are...<B,C,¥20> ,<B,C,¥10> The sum of the transaction amounts of the two outgoing edges is less than the first transaction amount. Since node B has no other outgoing edges that have not been processed by the target, from the perspective of fund matching in fund transactions, the outgoing transaction partially matches the incoming transaction, and the upstream fund dependence condition has been met. Therefore, the at least one outgoing edge can be identified as an edge.<B,C,¥20> and edge<B,C,¥10> Target processing is performed on each of the two edges separately.
[0083] In another example, such as Figure 6BAs shown in scenario 3, unlike scenario 1, in the current iteration, the outgoing edges of target node B that have not been processed by the target are...<B,C,¥20> ,<B,C,¥70> Obviously, the side<A,B> The initial transaction amount is insufficient to fully satisfy the upstream funding dependency of the outgoing edges on the target node B. To process funding transactions as early as possible and reduce long-term dependencies, the outgoing edges on the target node B that have not yet been processed can be split and combined to correspond to the initial transaction amount. In this example, according to a specific implementation, the plurality of initial outgoing edges are multiple initial outgoing edges; determining at least one outgoing edge includes: determining a plurality of selected outgoing edges and the target outgoing edge from the plurality of initial outgoing edges, and splitting the target outgoing edge into sub-edges and remaining outgoing edges, wherein the sum of the transaction amounts of the plurality of selected outgoing edges is the third transaction amount, the transaction amount of the sub-edges is the fourth transaction amount, the sum of the third transaction amount and the fourth transaction amount is the first transaction amount, and the transaction amount corresponding to the remaining outgoing edge is the difference between the original transaction amount of the target outgoing edge and the fourth transaction amount.
[0084] In other words, first set the edges<B,C,¥20> If the transaction is included in at least one outgoing edge, then the portion of the first transaction amount that needs to be matched is ¥30. Then, the edge...<B,C,¥70> The process splits into a sub-edge containing a transaction amount of ¥30 and a remaining outgoing edge containing a transaction amount of ¥40. The upstream funding dependency condition of the sub-edge has been met, and it can be assigned to at least one outgoing edge. Therefore, the sub-edge assigned to at least one outgoing edge...<B,C,¥20> and<B,C,¥30> Perform target processing and remove the remaining outgoing edges.<B,C,¥40> The state of not having performed target processing is maintained. In this way, by performing a split operation on the edge and combining it with other outgoing edges to correspond to the first transaction amount of the first directed edge, the global long dependency of directed edges in graph traversal is decomposed into local dependencies, and the sub-edges that have satisfied the upstream funding dependency and other outgoing edges are processed in advance, thereby reducing waiting time and improving graph computation efficiency.
[0085] Furthermore, it should be understood that when there are multiple outgoing edges among the first outgoing edges of the target node that have not yet undergone target processing, which can correspond to the first directed edge, the lack of a specific directed edge matching order will cause the at least one outgoing edge determination method listed in the above examples to lack idempotency. Therefore, in some embodiments, a matching order rule applied in the determination process of the at least one outgoing edge is also provided. Figure 6C The accompanying diagram illustrates the matching order rules. The following section will introduce the rules based on the attached diagram and examples.
[0086] In one example, based on a first sorting, at least one outgoing edge is determined from the plurality of first outgoing edges; the first sorting is based on the transaction time corresponding to each first outgoing edge. Figure 6CAs shown in the first scenario, the first directed edge<A,B> The corresponding first transaction amount is ¥50. In the first outgoing edge of target node B, the edge...<B,C> With edge<B,D> All can correspond to the first transaction amount. If sorted in ascending order by transaction time, the edges...<B,C> If an edge is identified as at least one outgoing edge, it undergoes target processing. If sorted in reverse chronological order by transaction time, the edges...<B,D> If it is identified as at least one outgoing edge, target processing is performed.
[0087] In another example, based on a second sorting, at least one outgoing edge is determined from the plurality of first outgoing edges; the second sorting is based on the transaction amount corresponding to each first outgoing edge. Figure 6C As shown in the second scenario, the first directed edge<A,B> The corresponding first transaction amount is ¥50. In the first outgoing edge of target node B, the edge...<B,C> ,side<B,D> With edge<B,E> All can correspond to the first transaction amount. If sorted in ascending order by transaction amount, the edges...<B,E> ,side<B,C> and the edge<B,D> Split sub-edges<B,D,¥20> If an edge is identified as at least one outgoing edge, target processing is performed on it.<B,D> The remaining outgoing edges after splitting<B,D,¥10> Then it remains in the state of not having undergone target processing. If sorted in descending order by transaction amount, the edges...<B,D> With edge<B,C> If an edge is identified as at least one outgoing edge, target processing is performed on it.<B,E> Remain in a state where no target processing has been performed.
[0088] In another example, based on a first matching degree, at least one outgoing edge is determined from the plurality of first outgoing edges; the first matching degree is used to indicate how close the transaction amount corresponding to the selected outgoing edge is to the first transaction amount. Figure 6C As shown in the third scene, the first directed edge<A,B> The corresponding first transaction amount is ¥50. In the first outgoing edge of target node B, the edge...<B,C> With edge<B,D> All of these can correspond to the amount of the first transaction. (Side)<B,C> The corresponding transaction amount differs from the first transaction amount by ¥20.<B,D> The corresponding transaction amount differs from the first transaction amount by ¥5, compared to the edge<B,C> It is closer to the amount of the first transaction. If sorted in ascending order of similarity, then the edges...<B,C> and the edge<B,D> Split sub-edges<B,D,¥20> If an edge is identified as at least one outgoing edge, target processing is performed on it.<B,D> The remaining outgoing edges after splitting<B,D,¥25> Then the edges remain in the state where no target processing has been performed. If they are sorted in reverse order of proximity, then...<B,D> and the edge<B,C> Split sub-edges<B,C,¥5> If an edge is identified as at least one outgoing edge, target processing is performed on it.<B,C> The remaining outgoing edges after splitting<B,C,¥25> Then it remains in the state of not having performed target processing.
[0089] The above examples illustrate how to determine at least one outgoing edge under various rules. It should be noted that the above rules can be used in combination or interchangeably to handle more complex transaction relationship graphs.
[0090] The examples provided above illustrate how to determine at least one outgoing edge corresponding to the first directed edge in graph iterative computation. Based on the description of the process for determining at least one outgoing edge in the embodiments, it can be understood that these outgoing edges are determined from all first outgoing edges of the target node that have not undergone target processing. When the target node has multiple outgoing edges that have not undergone target processing, which outgoing edges can be determined as first outgoing edges will affect the determination result of the at least one outgoing edge. Therefore, in some embodiments, the process for determining the first outgoing edge is also given. An example will be given below to illustrate the process for determining the first outgoing edge.
[0091] In one example, the transaction time of the fund transaction represented by the outgoing edge should be later than the transaction time of the upstream transaction it depends on. Therefore, we can consider selecting outgoing edges from the target node that satisfy the increasing transaction time sequence based on transaction time, as the first outgoing edge. That is, the first outgoing edge satisfies the first condition, which includes: the first transaction time corresponding to the first outgoing edge is later than the second transaction time corresponding to the first directed edge. Figure 6D As shown, the second transaction time corresponding to the first directed edge is D+2. Among the outgoing edges of the target node B, the outgoing edges that satisfy the increasing transaction time order are:<B,C,¥20> and<B,C,¥70> Therefore, the several first outgoing edges that have not yet undergone target processing include edges<B,C,¥20> and edge<B,C,¥70> .
[0092] Furthermore, in a specific implementation of the above example, the first condition further includes: the time difference between the first transaction time and the second transaction time is less than a first time threshold. The first time threshold can be the maximum time difference set according to the characteristics of the business scenarios supported by the payment platform. For example, for financial transactions, the fund clearing cycle in the payment system can be two calendar days; that is, inflow and outflow transactions with a time difference within two calendar days can be considered related. Corresponding to this example, let's look at... Figure 6C In the first scenario, only the edges that can be identified as the first outgoing edges that have not yet undergone target processing are considered.<B,C,¥20> .
[0093] After providing a detailed explanation of graph iteration calculations beyond the first round and the handling of the first outgoing edge, let's return to... Figure 5Furthermore, we will introduce a few special scenarios for determining the starting node. As the graph iterative calculation progresses, some nodes in the transaction relationship graph will be generated that can be considered as meeting the criteria for a starting node. The fund transactions represented by certain outgoing edges of these nodes do not have any upstream funding dependencies. Therefore, these nodes can be considered as starting nodes, and their outgoing edges that do not have upstream funding dependencies can be directly processed to initiate transaction tracking.
[0094] In one scenario, after processing the first outgoing edge, a first judgment is made on the target node. If it has no incoming edges that have not yet undergone target processing, and there is a second outgoing edge that has not yet undergone target processing, then the second outgoing edge is directly processed for target processing. For example... Figure 5 As shown in the second scenario, in the current iteration, the outgoing edges of target node A...<A,B> The target processing has been completed; one outgoing edge remains to be processed.<A,C> Since all incoming edges of node A have undergone target processing, it can be inferred that there are no more edges in the transaction graph.<A,C> Upstream funding transactions. In the current iteration round, node A can be considered as the starting node, and outgoing edges of node A that do not depend on upstream funding...<A,C> Proceed directly with target processing.
[0095] In another scenario, if the target node has a third outgoing edge, and the transaction time corresponding to this third outgoing edge is earlier than all incoming edges on the target node that have not yet undergone target processing, then the target processing is directly performed on the third outgoing edge. Figure 5 As shown in scenario 3, unlike scenario 2, there is still an incoming edge on the target node A that has not yet been processed. However, the transaction time of this incoming edge, D+3, is later than the remaining outgoing edges on node A that have not yet been processed.<A,C> Based on transaction timing rules, an incoming edge that occurs later than a transaction that is credited will not become an edge.<A,C> The upstream funding dependency is significant. In other words, although target node A has incoming edges that haven't yet undergone target processing in this scenario, the transaction times of all incoming edges that haven't undergone target processing are later than the transaction times of outgoing edges on node A that haven't undergone target processing. Therefore, it can be inferred that there are no upstream funding transactions in the transaction graph that correspond to this outgoing edge. In the current iteration, node A can be considered the starting node, and all outgoing edges on node A that meet the above conditions and haven't yet undergone target processing can be directly processed to achieve the target.
[0096] It is important to understand that the above steps S403-S405 can be executed repeatedly. By performing multiple rounds of graph iteration calculations, the transaction relationship graph can be traversed, fund transaction tracking records can be generated, the fund transaction chain can be tracked, and analysis references can be provided for downstream tasks.
[0097] Next, let's take Figure 2Taking the transaction relationship diagram shown as an example, applying the graph iteration calculation method introduced above to trace transactions based on the transaction relationship diagram in the attached figure will produce the overstep shown in Table 2 below.
[0098] Table 2 Example of Transaction Relationship Diagram Calculation
[0099]
[0100] As can be seen, by applying the graph iterative calculation method provided in the embodiments of this specification, the full graph calculation of the transaction relationship graph can be completed after 5 iterations. Node S and node O have no outgoing edges (i.e., fund expenditure transactions), and therefore serve as the terminal node, receiving a total of ¥950. The directed edges calculated during the graph calculation process completely record the transaction chain of these funds. While ensuring the correctness of the calculation results, the number of iterative calculation rounds for traversing the transaction relationship graph is reduced from 7 rounds to 5 rounds, making more efficient use of computing resources and reducing the time consumption of full graph calculation.
[0101] The foregoing description, based on one or more embodiments, details a method for transaction tracking based on a transaction relationship graph. Using the method provided in the embodiments of this specification, upstream and downstream funds can be matched in real-time during the traversal and calculation of the transaction relationship graph j. Based on the matching results, fund transactions can be dynamically split when necessary. This effectively solves the problem of long-term fund dependencies during the traversal and calculation of the transaction relationship graph, improving the efficiency of transaction relationship graph calculation.
[0102] In this specification, the terms "first" in phrases such as "first outgoing edge" and "first transaction amount," as well as the corresponding terms "second" and "third" (if any) in the text, are used merely for the convenience of distinction and description and do not have any limiting meaning.
[0103] The foregoing description describes specific embodiments of this specification; other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than those shown in the embodiments, and the desired result may still be achieved. Furthermore, the processes depicted in the drawings do not necessarily need to follow the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0104] Figure 7 This is a schematic diagram of a device for transaction tracking based on a transaction relationship graph, according to an embodiment of this specification. The device 700 is deployed in a computing device, which can be implemented using any device, equipment, platform, device cluster, etc., with computing and processing capabilities. This system embodiment is similar to... Figure 4The method embodiment shown corresponds to this. The transaction relationship graph contains nodes representing transaction objects and directed edges representing transactions between nodes. The device 700 is used to perform any iteration in a multi-round graph iteration calculation, excluding the first round. The device 700 includes:
[0105] The determination module 701 is configured to determine the node pointed to by the first directed edge in the previous iteration as the target node. The target processing includes transmitting the transaction information on the edge to the pointed node along the edge.
[0106] The processing module 702 is configured to perform first outgoing edge processing on a plurality of first outgoing edges on the target node that have not yet undergone the target processing. The first outgoing edge processing includes determining at least one outgoing edge such that the sum of its transaction amounts corresponds to the first transaction amount of the first directed edge, and performing target processing on the at least one outgoing edge. The at least one outgoing edge includes at least one of the plurality of first outgoing edges, and / or a sub-edge obtained by splitting the target outgoing edge among the plurality of first outgoing edges. The remaining outgoing edges other than the sub-edges generated by splitting the target outgoing edge remain in a state of not undergoing target processing.
[0107] According to another embodiment, this specification also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the foregoing combinations. Figure 4 The steps of the method are described.
[0108] According to yet another embodiment, this specification also provides a computing device including a memory and a processor, characterized in that the memory stores executable code, and when the processor executes the executable code, it implements the foregoing combination. Figure 4 The steps of the method are described.
[0109] Those skilled in the art will recognize that the functions described in the embodiments of the present invention in one or more of the above examples can be implemented using hardware, software, firmware, or any combination thereof. When implemented in software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium.
[0110] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, or improvements made based on the technical solutions of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for transaction tracking based on a transaction relationship graph, wherein the transaction relationship graph contains nodes representing transaction objects and directed edges between the representative nodes, the method comprising multi-round graph iteration calculation, wherein any iteration other than the first round includes: The node pointed to by the first directed edge in the previous iteration is determined as the target node. The target processing includes transmitting the transaction information on the edge to the pointed node along the edge. For the several first outgoing edges on the target node that have not yet undergone the target processing, first outgoing edge processing is performed. The first outgoing edge processing includes determining at least one outgoing edge such that the sum of its transaction amount corresponds to the first transaction amount of the first directed edge, and performing target processing on the at least one outgoing edge; wherein the at least one outgoing edge includes at least one of the several first outgoing edges, and / or a sub-edge obtained by splitting the target outgoing edge among the several first outgoing edges; wherein the remaining outgoing edges generated by splitting the target outgoing edge, excluding the sub-edge, remain in a state where no target processing has been performed.
2. The method according to claim 1, wherein, The arbitrary round iteration also includes: After the first outgoing edge processing, the target node is first judged. If it does not have an incoming edge that has not yet been processed, and there is a second outgoing edge that has not yet been processed, then the target processing is directly performed on the second outgoing edge.
3. The method according to claim 1, wherein, The arbitrary round iteration also includes: If the target node has a third outgoing edge, and the transaction time corresponding to the third outgoing edge is earlier than all incoming edges on the target node that have not yet undergone target processing, then the target processing is performed directly on the third outgoing edge.
4. The method according to claim 1, wherein, The first iteration includes: In the transaction relationship graph, several starting nodes are determined, and the starting nodes do not contain incoming edges; Perform the target processing on the outgoing edges of any starting node.
5. The method according to claim 1, wherein, The target processing also includes recording the source of the transaction information.
6. The method according to claim 1, wherein, The first outgoing edge satisfies the first condition, which includes: the first transaction time corresponding to the first outgoing edge is later than the second transaction time corresponding to the first directed edge.
7. The method according to claim 6, wherein, The first condition also includes: the time difference between the first transaction time and the second transaction time is less than the first time threshold.
8. The method according to claim 1, wherein, The plurality of first outgoing edges are single outgoing edges; determining at least one outgoing edge includes: If the second transaction amount corresponding to the single outgoing edge is greater than the first transaction amount, then the single outgoing edge is taken as the target outgoing edge and split into a sub-edge and a remaining outgoing edge. The transaction amount of the sub-edge is the first transaction amount, and the transaction amount corresponding to the remaining outgoing edge is the difference between the second transaction amount and the first transaction amount.
9. The method according to claim 1, wherein, The plurality of first outgoing edges constitutes multiple first outgoing edges; determining at least one outgoing edge includes: Several selected outgoing edges and the target outgoing edge are determined from the plurality of first outgoing edges. The target outgoing edge is split into sub-edges and remaining outgoing edges. The sum of the transaction amounts of the several selected outgoing edges is the third transaction amount, the transaction amount of the sub-edge is the fourth transaction amount, the sum of the third transaction amount and the fourth transaction amount is the first transaction amount, and the transaction amount corresponding to the remaining outgoing edge is the difference between the original transaction amount of the target outgoing edge and the fourth transaction amount.
10. The method according to claim 1, wherein, Determining at least one outgoing edge includes: Based on the first sorting, at least one outgoing edge is determined from the plurality of first outgoing edges; the first sorting is based on the transaction time corresponding to each first outgoing edge.
11. The method according to claim 1, wherein, Determining at least one outgoing edge includes: Based on the second sorting, at least one outgoing edge is determined from the plurality of first outgoing edges; the second sorting is based on the transaction amount corresponding to each first outgoing edge.
12. An apparatus for transaction tracking based on a transaction relationship graph, wherein the transaction relationship graph contains nodes representing transaction objects and directed edges representing transactions between the nodes, the apparatus being used to perform any round of iteration (excluding the first round) in a multi-round graph iteration computation, the apparatus comprising: The determination module is configured to determine the node pointed to by the first directed edge in the previous iteration as the target node. The target processing includes passing the transaction information on the edge to the pointed node along the edge. The processing module is configured to perform first outgoing edge processing on a plurality of first outgoing edges on the target node that have not yet undergone the target processing. The first outgoing edge processing includes determining at least one outgoing edge such that the sum of its transaction amounts corresponds to the first transaction amount of the first directed edge, and performing target processing on the at least one outgoing edge. The at least one outgoing edge includes at least one of the plurality of first outgoing edges, and / or a sub-edge obtained by splitting the target outgoing edge among the plurality of first outgoing edges. The remaining outgoing edges other than the sub-edges generated by splitting the target outgoing edge remain in a state of not undergoing target processing.
13. A computer program product comprising a computer program / instructions that, when executed by a processor, implement the steps of the method according to any one of claims 1-11.
14. A computing device, comprising a memory and a processor, characterized in that, The memory stores executable code, and when the processor executes the executable code, it implements the method of any one of claims 1-11.
Citation Information
Patent Citations
Graph structure model based false transaction identification method and device
CN108921566A
Data processing method and system
CN113434737A