Method, device, storage medium and electronic device for cross-chain transaction tracking
By constructing transaction charts and utilizing ranking algorithms, the problem of complexity of cross-chain transaction tracking is solved, efficient and accurate monitoring and analysis of cross-chain transactions is achieved, and the security and transparency of transactions are ensured.
Patent Information
- Application Number
- CN202411067644.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-05
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2044-08-05
AI Technical Summary
The tracking of cross-chain transactions is complex, and it is difficult for existing technology to quickly and accurately monitor and analyze in massive data, resulting in difficult to ensure transaction transparency and security.
By constructing a transaction graph, calculating edge weights based on transaction amount and time, using the ranking algorithm to rank node weights, analyzing the transaction graph layer by layer, realizing all-round tracking and analysis of cross-chain transactions, ensuring the security and transparency of transactions .
It improves the efficiency and accuracy of cross-chain transaction tracking, and can conduct comprehensive analysis and monitoring of cross-chain asset transactions given a suspicious account address to ensure the security and transparency of transactions.
Smart Images

Figure CN118586908B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to computer technology, and in particular to a method, device, storage medium and electronic device for cross-chain transaction tracking. Background Art
[0002] Since its birth, blockchain technology has rapidly become a key technology in many fields such as finance, supply chain management, and digital identity verification due to its decentralization, immutability, and high transparency. However, with the development of blockchain technology, the problem of information and assets being unable to communicate between different blockchains has gradually emerged, forming the so-called "blockchain island". In order to solve this problem, cross-chain bridge technology came into being, which realizes the transfer of assets and information by connecting different blockchain networks. The emergence of cross-chain bridges solves the problem of interoperability of multiple blockchain platforms. It can not only promote the synergy between different blockchain ecosystems, but also provide users with more flexibility and choices.
[0003] In recent years, cross-chain transactions have gradually become a new means of asset transfer, which has the characteristics of strong concealment and difficult technical tracing. The need to track cross-chain transactions has become increasingly important to ensure the transparency of transactions, prevent fraud, and protect the security of user assets.
[0004] Cross-chain technology is essentially a technology that safely and reliably transfers data (or messages) on chain A to chain B and produces the expected effect on chain B. The most common cross-chain transfer is the transfer of asset tokens.
[0005] In traditional blockchain transactions, transaction tracking mainly relies on public blockchain transaction data to verify and monitor transactions, but how to quickly track transactions in massive amounts of data remains a difficult problem. For cross-chain transactions, since multiple different blockchain networks are involved, the complexity of tracking is greatly increased. How to formulate a cross-chain transaction tracking plan, conduct comprehensive monitoring and analysis of cross-chain transactions, and ensure the transparency and security of transactions still needs to be studied urgently. Summary of the invention
[0006] The purpose of the embodiments of this specification is to provide a method, device, storage medium and electronic device for cross-chain transaction tracking.
[0007] The embodiments of this specification provide a method for tracking cross-chain transactions. By constructing a transaction graph, three types of transaction edges, namely ordinary transfer transactions, token exchange transactions and cross-chain transfers, are comprehensively considered, and the weight of the edge is calculated in combination with the transaction amount and the time when the transaction occurs. This more accurately reflects the time characteristics and amount relationship of money laundering and asset transfer on the chain, ensuring accurate modeling and analysis of complex transaction networks. A ranking algorithm is also used to rank the node weights of nodes in the transaction network. Through a recursive method, transactions are parsed layer by layer, and the transaction graph is expanded to ensure all-round tracking and analysis of key transactions, effectively improving the efficiency and accuracy of tracking. By graph modeling cross-chain transactions, transaction weights are measured during the cross-chain tracking process, corresponding cross-chain transactions are marked, and cross-chain transactions are tracked. Given a suspicious account address, the cross-chain asset transaction transfer of the address can be tracked, and cross-chain transactions can be comprehensively analyzed and monitored, effectively ensuring the security of cross-chain transactions. The method includes:
[0008] According to the first historical transaction information corresponding to the initial account address, a transaction graph corresponding to the initial account address is constructed, wherein the transaction graph includes multiple nodes and multiple edges between the multiple nodes, each node corresponds to an account address in multiple account addresses, the multiple account addresses include the initial account address, the edge between two nodes corresponds to the transaction information between the two account addresses respectively corresponding to the two nodes, and the transaction types corresponding to the transaction information include cross-chain transactions, ordinary transfer transactions and token exchange transactions;
[0009] For each node, determine the edge weight corresponding to the edge between the node and the adjacent node according to the transaction amount and transaction time corresponding to the transaction between the account address corresponding to the adjacent node connected to the node and the account address corresponding to the node, use the initial node weight of the node as the current node weight of the node, calculate the updated node weight of the node according to the current node weight of the node, the current node weight of the adjacent node and the edge weight, use the updated node weight as the current node weight of the node and continue to iterate and calculate the updated node weight of the node until the node weight change value of the node is less than or equal to the first preset threshold value, and stop iterating, wherein the initial node weight of the node corresponding to the initial account address is greater than the initial node weights of other nodes;
[0010] The node with the largest corresponding node weight in the transaction graph is selected as the target node, and the second historical transaction information of the target account address corresponding to the target node after the transaction between the target account address and the initial account address is obtained. The transaction subgraph corresponding to the target node is constructed according to the second historical transaction information, and the node with the largest corresponding node weight in the transaction subgraph is selected as the new target node, and so on, until the sum of the node weights of all nodes in the latest transaction subgraph currently constructed is greater than or equal to the second preset threshold. According to the transaction graph and at least one constructed transaction subgraph, a cross-chain transaction tracking graph corresponding to the initial account address is obtained.
[0011] Furthermore, each edge in the transaction graph is a weighted time-series multi-relation directed edge, and the direction of each edge points from the node corresponding to the sending address of the transaction information corresponding to the edge to the node corresponding to the receiving address of the transaction information. The weight information of each edge is used to represent the total transaction amount of the transaction information corresponding to the edge, and the timing information of each edge is used to represent the transaction occurrence time of the transaction information corresponding to the edge.
[0012] Furthermore, constructing a transaction graph corresponding to the initial account address according to the first historical transaction information corresponding to the initial account address includes:
[0013] Determine multiple account addresses according to the first historical transaction information corresponding to the initial account address, and construct a node corresponding to each account address in the transaction graph corresponding to the initial account address, wherein the multiple account addresses include the initial account address;
[0014] For two nodes in the transaction graph, if it is determined according to the first historical transaction information that there is transaction information between two account addresses respectively corresponding to the two nodes, an edge between the two nodes is constructed in the transaction graph according to the transaction information.
[0015] Further, constructing an edge between the two nodes in the transaction graph according to the transaction information includes:
[0016] Determine the transaction type corresponding to the transaction information according to the transaction information and the cross-chain contract database;
[0017] An edge connection relationship between the two nodes is determined according to the transaction type, and an edge between the two nodes is constructed in the transaction graph according to the edge connection relationship and the transaction information.
[0018] Furthermore, the method further comprises:
[0019] Build full nodes of multiple blockchains, synchronize the blocks in each blockchain to the latest blocks, obtain the blockchain identification information corresponding to each blockchain and the address information of at least one cross-chain bridge smart contract between the multiple blockchains, and build the cross-chain contract database.
[0020] Furthermore, determining the transaction type corresponding to the transaction information according to the transaction information and the cross-chain contract database includes:
[0021] If it is determined according to the transaction information that the corresponding transaction process involves a cross-chain bridge smart contract in the cross-chain contract database, it is determined that the transaction type corresponding to the transaction information is a cross-chain transfer;
[0022] If it is determined according to the transaction information that there are transactions with the same hash between the account addresses corresponding to the two nodes, it is determined that the transaction type corresponding to the transaction information is a token exchange transaction;
[0023] Otherwise, it is determined that the transaction type corresponding to the transaction information is a common transfer transaction.
[0024] Furthermore, determining the edge connection relationship between the two nodes according to the transaction type includes:
[0025] If the transaction type is a cross-chain transfer, obtain the log event information about the transaction information from the blockchain where the account addresses corresponding to the two nodes are located, and parse the log event information. If the event corresponding to the log event information is that the account address is sent to the cross-chain bridge smart contract, parse the target chain identification information and the target chain receiver address from the log event information; if the event corresponding to the log event information is that the cross-chain bridge smart contract is sent to the account address, parse the source chain identification information and the source chain sender address from the log event information; determine the edge connection relationship between the two nodes according to the target chain receiver address, the target chain identification information, the source chain sender address and the source chain identification information.
[0026] Further, determining the edge weight corresponding to the edge between the node and the adjacent node according to the transaction amount and transaction occurrence time corresponding to the transaction between the account address corresponding to the adjacent node connected to the node and the account address corresponding to the node includes:
[0027] For an adjacent node connected to the node, if the account address corresponding to the node is the initiator of a transaction between the account address corresponding to the adjacent node and the account address corresponding to the node, the edge weight corresponding to the edge between the node and the adjacent node is determined according to the transaction amount corresponding to the transaction and the time when the transaction occurred.
[0028] Furthermore, determining the edge weight corresponding to the edge between the node and the adjacent node according to the transaction amount corresponding to the transaction and the transaction occurrence time includes:
[0029] The edge weight corresponding to the edge between the node and the adjacent node is determined according to the transaction amount, transaction occurrence time, benchmark transaction start time and time decay coefficient corresponding to the transaction.
[0030] Further, the calculating the updated node weight of the node according to the current node weight of the node, the current node weights of the adjacent nodes and the edge weights includes:
[0031] The updated node weight of the node is calculated according to the current node weight of the node, the current node weight of each adjacent node pointing to the node, and the edge weight corresponding to the edge between the node and the adjacent node.
[0032] Further, the calculating the updated node weight of the node according to the current node weight of the node, the current node weight of each adjacent node pointing to the node, and the edge weight corresponding to the edge between the node and the adjacent node includes:
[0033] The updated node weight of the node is calculated based on the current node weight of the node, the current node weight of each adjacent node pointing to the node, the edge weight corresponding to the edge between the node and the adjacent node, the out-degree of the adjacent node and the damping factor.
[0034] Furthermore, the obtaining of second historical transaction information of a target account address corresponding to the target node after a transaction between the target account address and the initial account address includes:
[0035] If the target account address corresponding to the target node and the initial account address belong to the same blockchain, obtain the second historical transaction information of the target account address after the transaction between the target account address and the initial account address from the blockchain; if the target account address and the initial account address belong to two different blockchains, record the corresponding cross-chain transaction time, and obtain the second historical transaction information of the target account address after the cross-chain transaction time from the blockchain to which the target account address belongs.
[0036] Furthermore, the method further comprises:
[0037] Obtain target chain identification information based on the edge between the node corresponding to the initial account address and the target node;
[0038] According to the target chain identification information, the blockchain to which the target account address belongs is determined in the cross-chain contract database.
[0039] The embodiment of this specification also provides a device for cross-chain transaction tracking, including:
[0040] A transaction graph construction module, configured to construct a transaction graph corresponding to the initial account address according to the first historical transaction information corresponding to the initial account address, wherein the transaction graph includes a plurality of nodes and a plurality of edges between the plurality of nodes, each node corresponds to an account address among a plurality of account addresses, the plurality of account addresses include the initial account address, an edge between two nodes corresponds to transaction information between two account addresses respectively corresponding to the two nodes, and the transaction types corresponding to the transaction information include cross-chain transactions, ordinary transfer transactions, and token exchange transactions;
[0041] A node weight calculation module, for each of the nodes, according to the transaction amount and transaction time corresponding to the transaction between the account address corresponding to the adjacent node connected to the node and the account address corresponding to the node, determine the edge weight corresponding to the edge between the node and the adjacent node, use the initial node weight of the node as the current node weight of the node, calculate the updated node weight of the node according to the current node weight of the node, the current node weight of the adjacent node and the edge weight, use the updated node weight as the current node weight of the node and continue to iterate and calculate the updated node weight of the node until the node weight change value of the node is less than or equal to the first preset threshold value, and stop iterating, wherein the initial node weight of the node corresponding to the initial account address is greater than the initial node weights of other nodes;
[0042] A tracking graph construction module is used to select the node with the largest node weight corresponding to the transaction graph as the target node, obtain the second historical transaction information of the target account address corresponding to the target node after the transaction between the target account address and the initial account address, construct a transaction subgraph corresponding to the target node according to the second historical transaction information, select the node with the largest node weight corresponding to the transaction subgraph as the new target node, and so on, until the sum of the node weights of all nodes in the latest transaction subgraph currently constructed is greater than or equal to the second preset threshold, and obtain the cross-chain transaction tracking graph corresponding to the initial account address according to the transaction graph and at least one constructed transaction subgraph.
[0043] The embodiments of the present specification also provide a computer program product, wherein the computer program product stores at least one instruction, and the at least one instruction is suitable for being loaded by a processor and executing the above method steps.
[0044] The embodiments of the present specification also provide a storage medium, wherein the storage medium stores a computer program, and the computer program is suitable for being loaded by a processor and executing the steps of the above method.
[0045] An embodiment of the present specification also provides an electronic device, comprising: a processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the steps of the above method.
[0046] In the embodiments of this specification, by constructing a transaction graph, three types of transaction edges, namely ordinary transfer transactions, token exchange transactions, and cross-chain transfers, are comprehensively considered, and the weights of the edges are calculated in combination with the transaction amount and the time when the transaction occurs, which more accurately reflects the time characteristics and amount relationship of money laundering and asset transfers on the chain, ensuring the accurate modeling and analysis of complex transaction networks. A ranking algorithm is also used to rank the node weights of nodes in the transaction network. Through a recursive method, transactions are parsed layer by layer, and the transaction graph is expanded to ensure all-round tracking and analysis of key transactions, effectively improving the efficiency and accuracy of tracking. By graph modeling cross-chain transactions, transaction weights are measured during the cross-chain tracking process, corresponding cross-chain transactions are marked, and cross-chain transactions are tracked. Given a suspicious account address, the cross-chain asset transaction transfer of the address can be tracked, and cross-chain transactions can be comprehensively analyzed and monitored, effectively ensuring the security of cross-chain transactions. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 A flowchart of a method for cross-chain transaction tracking provided in an embodiment of this specification;
[0048] Figure 2 A flowchart of a method for cross-chain transaction tracking provided in an embodiment of this specification;
[0049] Figure 3 A flowchart of a method for cross-chain transaction tracking provided as an example in an embodiment of this specification;
[0050] Figure 4 A schematic diagram of the structure of a device for cross-chain transaction tracking provided in an embodiment of this specification;
[0051] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of this specification. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solutions and advantages of this specification more clear, the technical solutions of this specification will be clearly and completely described below in combination with the specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of them. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this specification.
[0053] See also Figure 1 , is a flow chart of a method for cross-chain transaction tracking provided in an embodiment of this specification. In an embodiment of this specification, the method for cross-chain transaction tracking is applied to a device for cross-chain transaction tracking (hereinafter referred to as "cross-chain transaction tracking device") or an electronic device equipped with a cross-chain transaction tracking device. Figure 1 The process shown is described in detail, and the method for cross-chain transaction tracking may specifically include the following steps:
[0054] S102, constructing a transaction graph corresponding to the initial account address according to the first historical transaction information corresponding to the initial account address, wherein the transaction graph includes multiple nodes and multiple edges between the multiple nodes, each node corresponds to an account address among multiple account addresses, the multiple account addresses include the initial account address, the edge between two nodes corresponds to transaction information between two account addresses corresponding to the two nodes respectively, and the transaction types corresponding to the transaction information include cross-chain transactions, ordinary transfer transactions and token exchange transactions.
[0055] In some embodiments, the initial account address refers to the address of a specified account on a specified blockchain. The initial account address is a suspicious account address pre-set by the user, that is, the initial account address is the address that needs to be tracked for cross-chain asset transaction transfers. In some embodiments, the blockchain browser is used to obtain the first historical transaction information corresponding to at least one transaction in which the initial account address participates. The first historical transaction information includes the transaction information of all transactions in which the initial account address is the transaction initiator and the transaction information of all transactions in which the initial account address is the transaction recipient. The transaction information of a transaction includes but is not limited to any content related to the transaction. This example embodiment does not specifically limit the specific content of the transaction information. It should be noted that those skilled in the art should understand that transaction information of any content can be included in the protection scope of this specification, and this specification does not limit this.
[0056] In some embodiments, a transaction graph corresponding to the initial account address is constructed based on the first historical transaction information. The transaction graph includes multiple nodes, each node is an account address, and an account address refers to the address of an account located on a blockchain. Every two nodes in the transaction graph may be connected by an edge. If two nodes are connected by an edge, the edge is the transaction information corresponding to the transaction between the two account addresses corresponding to the two nodes. In some embodiments, the transaction types corresponding to the transaction between the two account addresses include cross-chain transactions, ordinary transfer transactions, and token exchange transactions. Cross-chain transactions refer to the conversion of tokens on one blockchain to tokens on another blockchain. Ordinary transfer transactions refer to the transfer of tokens between two account addresses on the same blockchain. Token exchange transactions involve two transactions corresponding to the two account addresses at the same time, and the hashes of the two transactions are the same.
[0057] S104, for each of the nodes, determine the edge weight corresponding to the edge between the node and the adjacent node according to the transaction amount and transaction time corresponding to the transaction between the account address corresponding to the adjacent node connected to the node and the account address corresponding to the node, use the initial node weight of the node as the current node weight of the node, calculate the updated node weight of the node according to the current node weight of the node, the current node weight of the adjacent node and the edge weight, use the updated node weight as the current node weight of the node and continue to iterate and calculate the updated node weight of the node until the node weight change value of the node is less than or equal to the first preset threshold value, wherein the initial node weight of the node corresponding to the initial account address is greater than the initial node weights of other nodes.
[0058] In some embodiments, for each node in the transaction graph, the transaction information between the two account addresses can be obtained based on the edge between the account address corresponding to a certain adjacent node connected to the node and the account address corresponding to the node (the adjacent node corresponding to each node means that the node and the adjacent node are directly connected in the transaction graph, there is an edge between the node and the adjacent node in the transaction graph, the two endpoints of the edge are the node and the adjacent node, and the edge does not pass through any other nodes), and the edge weight corresponding to the edge between the node and the adjacent node is calculated according to the transaction amount and the transaction time in the transaction information. For example, the edge weight is proportional to the transaction amount and inversely proportional to the time interval between the transaction time and the transaction time of the previous transaction. The larger the transaction amount, the heavier the edge weight. The larger the weight, the smaller the transaction amount, the smaller the edge weight, the smaller the time interval, the larger the edge weight, the larger the time interval, the smaller the edge weight, wherein the previous transaction may refer to a target transaction whose corresponding transaction time among all transactions is before the transaction time of this transaction and the transaction time of the target transaction is the smallest from the transaction time of this transaction, and all transactions may refer to all transactions in the transaction graph, or all transactions may also be all transactions involving the node and / or the adjacent nodes in the transaction graph. It should be noted that the above calculation method is only an example, and those skilled in the art should understand that any method for calculating the edge weight in the transaction graph based on the transaction amount and the transaction time may be included in the protection scope of this specification, and this specification does not limit this.
[0059] In some embodiments, if the transaction between the node and the adjacent node is a cross-chain transaction, and the cross-chain transaction involves different token prices, the transaction amount can be measured on the same scale using a generally equivalent currency or digital token, which can solve the problem of comparability of transaction amounts between different tokens and improve the accuracy and consistency of cross-chain transaction data analysis.
[0060] In some embodiments, an initial node weight is assigned to each node in the transaction graph, the node corresponding to the initial account address is assigned a higher initial node weight, and other nodes are assigned a lower initial node weight. The initial node weight of each node can be set by the user, or the initial node weight is randomly assigned to each node, as long as the initial node weight of the node corresponding to the initial account address is greater than the initial node weights of other nodes.
[0061] In some embodiments, for each node, the initial node weight of the node is used as the current node weight of the node. Based on the ranking algorithm, the updated node weight of the node is calculated according to the current node weight of the node, the current node weights of the adjacent nodes connected to the node, and the edge weights corresponding to the edges between the node and the adjacent nodes. Then, the updated node weight is used as the current node weight of the node and the updated node weight of the node is calculated iteratively, and so on, until the node weight change value of the node is less than or equal to a first preset threshold value, and then the iteration is stopped to ensure the convergence of the results, wherein the node weight change value of the node refers to the change value of the updated node weight of the node compared to the node weight before the update. For example, the change value can be the difference or ratio between the updated node weight and the node weight before the update, or it can also be the difference or ratio between the node weight before the update and the node weight after the update. This example embodiment does not make any special limitation on this. In some embodiments, the ranking algorithm used in this example embodiment is used to rank the node weight of each node in the transaction graph. The ranking algorithm includes but is not limited to any ranking algorithm in the prior art, such as a personalized page ranking (Personalized PageRank) algorithm. It should be noted that the above-mentioned personalized page ranking algorithm is only an example. Those skilled in the art should understand that any algorithm used for ranking can be included in the scope of protection of this specification, and this specification does not limit this.
[0062] S106, select the node with the largest corresponding node weight in the transaction graph as the target node, obtain the second historical transaction information of the target account address corresponding to the target node after the transaction between the target account address and the initial account address, construct the transaction subgraph corresponding to the target node according to the second historical transaction information, select the node with the largest corresponding node weight in the transaction subgraph as the new target node, and so on, until the sum of the node weights of all nodes in the latest transaction subgraph currently constructed is greater than or equal to the second preset threshold, and obtain the cross-chain transaction tracking graph corresponding to the initial account address according to the transaction graph and at least one constructed transaction subgraph.
[0063] In some embodiments, a node with the largest corresponding node weight in the transaction graph is selected as the target node, and a blockchain browser is used to obtain second historical transaction information of a target account address corresponding to the target node after a transaction between the target account address and the initial account address, that is, second historical transaction information corresponding to at least one transaction whose corresponding transaction occurrence time among all transactions in which the target account address participates is after the transaction occurrence time corresponding to the transaction between the target account address and the initial account address is obtained, and a transaction subgraph corresponding to the target node is constructed according to the second historical transaction information. The method of constructing the transaction subgraph corresponding to the target node is the same or similar to the method of constructing the transaction graph corresponding to the initial account address according to the first historical transaction information corresponding to the initial account address as described above, and will not be repeated here.
[0064] In some embodiments, the node with the largest corresponding node weight in the transaction subgraph is selected as the new target node. The method of selecting the new target node is the same or similar to the aforementioned method of calculating the edge weights in the transaction graph corresponding to the initial account address, iteratively calculating the node weights in the transaction graph, and selecting the node with the largest corresponding node weight in the transaction graph as the target node. It will not be repeated again. That is, the edge weights corresponding to the edges in the transaction subgraph are first calculated, and then the node weights corresponding to the nodes in the transaction subgraph are calculated, and then the node with the largest corresponding node weight in the transaction subgraph is selected as the new target node, and then a new transaction subgraph corresponding to the new target node is constructed, and so on, until the sum of the node weights of all nodes in the latest transaction subgraph currently constructed is greater than or equal to the second preset threshold, and the construction of the transaction subgraph is stopped.
[0065] In some embodiments, based on the transaction graph corresponding to the initial account address and at least one constructed transaction subgraph, a cross-chain transaction tracking graph corresponding to the initial account address is obtained, wherein the cross-chain transaction tracking graph can be a set consisting of the transaction graph and the at least one transaction subgraph, or, the transaction graph and the at least one transaction subgraph can be spliced together to form a complete graph, and the graph is used as the cross-chain transaction tracking graph corresponding to the initial account address.
[0066] In the embodiments of this specification, by constructing a transaction graph, three types of transaction edges, namely ordinary transfer transactions, token exchange transactions, and cross-chain transfers, are comprehensively considered, and the weights of the edges are calculated in combination with the transaction amount and the time when the transaction occurs, which more accurately reflects the time characteristics and amount relationship of money laundering and asset transfers on the chain, ensuring the accurate modeling and analysis of complex transaction networks. A ranking algorithm is also used to rank the node weights of nodes in the transaction network. Through a recursive method, transactions are parsed layer by layer, and the transaction graph is expanded to ensure all-round tracking and analysis of key transactions, effectively improving the efficiency and accuracy of tracking. By graph modeling cross-chain transactions, transaction weights are measured during the cross-chain tracking process, corresponding cross-chain transactions are marked, and cross-chain transactions are tracked. Given a suspicious account address, the cross-chain asset transaction transfer of the address can be tracked, and cross-chain transactions can be comprehensively analyzed and monitored, effectively ensuring the security of cross-chain transactions.
[0067] In some embodiments, each edge in the transaction graph is a weighted time-series multi-relation directed edge, and the direction of each edge points from the node corresponding to the sending address of the transaction information corresponding to the edge to the node corresponding to the receiving address of the transaction information. The weight information of each edge is used to represent the total transaction amount of the transaction information corresponding to the edge, and the timing information of each edge is used to represent the transaction occurrence time of the transaction information corresponding to the edge. In some embodiments, each edge in the transaction graph is a weighted time-series multi-relation directed edge, the direction of the edge between two nodes is from the node corresponding to the sending address of the transaction information corresponding to the edge to the node corresponding to the receiving address of the transaction information, the direction of the edge between two nodes is from the node corresponding to the transaction initiator of the transaction corresponding to the edge (that is, the transaction between the two account addresses corresponding to the two nodes at both ends of the edge) to the node corresponding to the transaction receiver of the transaction, the weight information of the edge is used to characterize the total transaction amount of the transaction corresponding to the edge, the larger the total transaction amount, the greater the weight of the edge, and the timing information of the edge is used to characterize the transaction occurrence time of the transaction corresponding to the edge (usually, fund transfer transactions by illegal means such as on-chain money laundering and asset transfer follow a certain time sequence, and the transaction time interval of fund transfer is small).
[0068] Figure 2 A flow chart of a method for cross-chain transaction tracking provided in an embodiment of this specification specifically includes the following steps:
[0069] S202, determining multiple account addresses according to the first historical transaction information corresponding to the initial account address, and constructing a node corresponding to each account address in the transaction graph corresponding to the initial account address, wherein the multiple account addresses include the initial account address;
[0070] In some embodiments, based on the first historical transaction information corresponding to the initial account address, multiple account addresses including the initial account address are determined, and for each account address in the multiple account addresses, a node corresponding to the account address is constructed in the transaction graph corresponding to the initial account address.
[0071] S204: For two nodes in the transaction graph, if it is determined according to the first historical transaction information that there is transaction information between two account addresses respectively corresponding to the two nodes, an edge between the two nodes is constructed in the transaction graph according to the transaction information.
[0072] In some embodiments, for two nodes in a transaction graph, if it is determined based on the first historical transaction information that there is a transaction between two account addresses corresponding to the two nodes (the transaction type corresponding to the transaction may be any one of a cross-chain transaction, a general transfer transaction, and a token exchange transaction), then based on the transaction information corresponding to the transaction, an edge between the two nodes is constructed in the transaction graph, that is, the two nodes are connected by constructing an edge, and the two nodes are respectively the two endpoints of the edge.
[0073] S206, for each node, according to the transaction amount and transaction time corresponding to the transaction between the account address corresponding to the adjacent node connected to the node and the account address corresponding to the node, determine the edge weight corresponding to the edge between the node and the adjacent node, use the initial node weight of the node as the current node weight of the node, calculate the updated node weight of the node according to the current node weight of the node, the current node weight of the adjacent node and the edge weight, use the updated node weight as the current node weight of the node and continue to iterate and calculate the updated node weight of the node until the node weight change value of the node is less than or equal to the first preset threshold value, and stop iterating, wherein the initial node weight of the node corresponding to the initial account address is greater than the initial node weights of other nodes. Step S206 is the same or similar to the aforementioned step S104, and will not be repeated here.
[0074] S208, select the node with the largest node weight in the transaction graph as the target node, obtain the second historical transaction information of the target account address corresponding to the target node after the transaction between the target account address and the initial account address, construct the transaction subgraph corresponding to the target node according to the second historical transaction information, select the node with the largest node weight in the transaction subgraph as the new target node, and so on, until the sum of the node weights of all nodes in the latest transaction subgraph currently constructed is greater than or equal to the second preset threshold, and obtain the cross-chain transaction tracking graph corresponding to the initial account address according to the transaction graph and at least one transaction subgraph that has been constructed. Step S208 is the same or similar to the aforementioned step S106, and will not be repeated here.
[0075] In some embodiments, constructing the edge between the two nodes in the transaction graph based on the transaction information includes: determining the transaction type corresponding to the transaction information based on the transaction information and a cross-chain contract database; determining the edge connection relationship between the two nodes based on the transaction type, and constructing the edge between the two nodes in the transaction graph based on the edge connection relationship and the transaction information. In some embodiments, according to the transaction information corresponding to the transaction between the two account addresses corresponding to the two nodes and the cross-chain contract database, the transaction type corresponding to the transaction information is determined. The transaction type may be any one of a cross-chain transaction, a general transfer transaction and a token exchange transaction. The cross-chain contract database includes blockchain identification information (for example, blockchain ID) of multiple blockchains and address information of multiple cross-chain bridge smart contracts. The cross-chain contract database also includes a mapping relationship between the blockchain identification information and the address information of the cross-chain bridge smart contract. Each cross-chain bridge smart contract is used to connect two different blockchains so that tokens can be seamlessly transferred between the two blockchains. The cross-chain bridge smart contract includes a first smart contract on the starting chain and a second smart contract on the target chain. The first smart contract and the second smart contract are connected through an off-chain agent. The cross-chain bridge locks or destroys the token by executing the first smart contract on the starting chain, and then the first smart contract issues a corresponding lock or destruction event, which is captured by the agent, and unlocks or casts the token by executing the second smart contract on the target chain to realize the transfer of tokens from the starting chain to the target chain. In some embodiments, for a transaction between two nodes, a match can be made in a cross-chain contract database based on the transaction information corresponding to the transaction to determine whether the transaction type corresponding to the transaction information is a cross-chain transaction. If not, the transaction type corresponding to the transaction information can be further determined based on the transaction information to determine whether it is an ordinary transfer transaction or a token exchange transaction. In some embodiments, the edge connection relationship between the two nodes is determined based on the transaction type corresponding to the transaction between the two nodes. The relationship types corresponding to the edge connection relationship include ordinary transfer transaction relationships, cross-chain transfer relationships, and token exchange transaction relationships. Based on the edge connection relationship and the transaction information corresponding to the transaction, an edge between the two nodes is constructed in the transaction graph, that is, the two nodes are connected by constructing an edge, and the two nodes are the two endpoints of the edge.
[0076] In some embodiments, the method further includes: building full nodes of multiple blockchains, synchronizing blocks in each blockchain to the latest block, obtaining blockchain identification information corresponding to each blockchain and address information of at least one cross-chain bridge smart contract between the multiple blockchains, and constructing the cross-chain contract database. In some embodiments, assuming that multiple blockchains are involved in the cross-chain tracking of the initial account address, a full node of each blockchain is built, and blocks in the blockchain network are synchronized to the latest block. For at least one cross-chain bridge between the multiple blockchains, each cross-chain bridge is used to connect two different blockchains. The cross-chain bridge has multiple cross-chain protocol implementations, such as Anyswap, Swiftswap, Polynetwork, etc. These cross-chain protocols will deploy smart contracts of the protocol on the blockchain, and use blockchain identification information (e.g., blockchain ID) to identify the corresponding blockchain, obtain blockchain identification information of different cross-chain protocols on different blockchains and address information of cross-chain bridge smart contracts, that is, obtain blockchain identification information corresponding to each blockchain and address information of at least one cross-chain bridge smart contract between the multiple blockchains, save the corresponding data to construct a cross-chain contract database, wherein the cross-chain contract database will also include a mapping relationship between blockchain identification information and address information of cross-chain bridge smart contracts.
[0077] In some embodiments, the transaction type corresponding to the transaction information is determined according to the transaction information and the cross-chain contract database, including: if it is determined according to the transaction information that the corresponding transaction process involves a cross-chain bridge smart contract in the cross-chain contract database, the transaction type corresponding to the transaction information is determined to be a cross-chain transfer; if it is determined according to the transaction information that there is a transaction with the same hash between the account addresses corresponding to the two nodes, the transaction type corresponding to the transaction information is determined to be a token exchange transaction; otherwise, the transaction type corresponding to the transaction information is determined to be an ordinary transfer transaction. In some embodiments, for a transaction between two account addresses corresponding to two nodes, if it is determined according to the transaction information corresponding to the transaction that the transaction process involves a cross-chain bridge smart contract in the cross-chain contract database, the transaction type corresponding to the transaction can be determined to be a cross-chain transfer; if it is determined according to the transaction information corresponding to the transaction that there is a transaction with the same hash between the two account addresses, the transaction type corresponding to the transaction can be determined to be a token exchange transaction; otherwise, the transaction type corresponding to the transaction can be determined to be an ordinary transfer transaction.
[0078] In some embodiments, determining the edge connection relationship between the two nodes according to the transaction type includes: if the transaction type is a cross-chain transfer, obtaining log event information about the transaction information from the blockchain where the account addresses corresponding to the two nodes are located, parsing the log event information, if the event corresponding to the log event information is the account address sent to the cross-chain bridge smart contract, then the corresponding transaction is the source chain transaction in the cross-chain transaction, and parsing the target chain identification information and the target chain recipient address from the log event information; if the event corresponding to the log event information is the cross-chain bridge smart contract sent to the account address, then the corresponding transaction is the target chain transaction in the cross-chain transaction, and parsing the source chain identification information and the source chain sender address from the log event information; according to the target chain recipient address, the target chain identification information, the source chain sender address and the source chain identification information, the edge connection relationship between the two nodes is determined. In some embodiments, if the transaction type corresponding to the transaction between the two account addresses corresponding to the two nodes is a cross-chain transfer, the cross-chain transaction is parsed, and for each of the two nodes, the log event information of the transaction is obtained from the blockchain to which the node belongs through the node (initiating a cross-chain transaction on the blockchain will trigger the execution of a specific function in the cross-chain bridge smart contract. This function execution will be recorded as an event in the blockchain, and the event will include the user's address information and transfer information in the source chain and the target chain), and the log event information of the transaction is parsed using the interface definition specification. If the event corresponding to the log event information is sent by the account address to the cross-chain bridge smart contract, it is determined that the event corresponds to the source chain transaction in the cross-chain transaction, and the interface definition specification is used to parse the target chain receiver address and target chain identification information of the cross-chain transaction from the log event information. If the event corresponding to the log event information is sent by the cross-chain bridge smart contract to the account address, it is determined that the event corresponds to the target chain transaction in the cross-chain transaction, and the interface definition specification is used to parse the source chain sender address and source chain identification information of the cross-chain transaction from the log event information. In some embodiments, according to the target link recipient address, target chain identification information, source chain sender address and source chain identification information, it is determined that the relationship type corresponding to the edge connection relationship between the two nodes is a cross-chain transfer relationship, and the relationship information corresponding to the edge connection relationship includes the target link recipient address, target chain identification information, source chain sender address and source chain identification information. Here, the embodiment of this specification uses the interface definition specification to parse the log event information in the cross-chain transaction by building a cross-chain contract database, identifying the cross-chain transaction information on the source chain and the target chain.
[0079] In some embodiments, determining the edge weight corresponding to the edge between the node and the adjacent node based on the transaction amount corresponding to the transaction between the account address corresponding to the adjacent node connected to the node and the account address corresponding to the node and the transaction occurrence time includes: for the adjacent node connected to the node, if the account address corresponding to the node is the initiator of the transaction in the transaction between the account address corresponding to the adjacent node and the account address corresponding to the node, determining the edge weight corresponding to the edge between the node and the adjacent node based on the transaction amount corresponding to the transaction and the transaction occurrence time. In some embodiments, for each node in the transaction graph and the adjacent node connected to the node, if the account address corresponding to the node is the transaction initiator of the transaction between the account address and the adjacent node, the edge weight corresponding to the edge between the node and the adjacent node (the direction of the edge is from the node to the adjacent node) is calculated according to the transaction amount and transaction occurrence time in the transaction information corresponding to the transaction (the transaction initiator of the transaction is the account address corresponding to the node, and the transaction recipient of the node is the account address corresponding to the adjacent node). If the account address corresponding to the node is the transaction recipient of the transaction between the account address and the adjacent node, the direction of the edge between the node and the adjacent node is from the adjacent node to the node, and the edge weight corresponding to the edge between the adjacent node and the node (the direction of the edge is from the adjacent node to the node) can be calculated according to the transaction amount and transaction occurrence time in the transaction information corresponding to the transaction between the adjacent node and the node (the transaction initiator of the transaction is the account address corresponding to the adjacent node, and the transaction recipient of the node is the account address corresponding to the node).
[0080] In some embodiments, the edge weight corresponding to the edge between the node and the adjacent node is determined based on the transaction amount corresponding to the transaction and the transaction occurrence time, including: determining the edge weight corresponding to the edge between the node and the adjacent node based on the transaction amount corresponding to the transaction, the transaction occurrence time, the benchmark transaction start time and the time decay coefficient. In some embodiments, for the edge between the node and each of its corresponding adjacent nodes, if the account address corresponding to the node is the transaction initiator of the transaction between the account address and the account address corresponding to the adjacent node, that is, if the direction of the edge is from the node to the adjacent node, the edge weight corresponding to the edge between the node and the adjacent node can be calculated according to the transaction amount corresponding to the transaction, the transaction occurrence time, the benchmark transaction start time and the preset time decay coefficient, wherein the benchmark transaction start time refers to the transaction occurrence time of the first transaction in the transaction chain corresponding to the transaction, for example, account address A->account address B->account address C->account address D, account address A first trades a specified number of tokens to account address B, account address B then trades the token to account address C, and account address C then trades the token to account address D. For node C, the transaction chain corresponding to the transaction between the account addresses corresponding to node C and node D is account address A->account address B->account address C->account address D, and the benchmark transaction start time corresponding to the transaction initiated by node C with node D is the transaction occurrence time of the first transaction in the transaction chain (i.e., account address A->account address B). In some embodiments, the edge weight corresponding to the edge from node i to node j is The calculation formula is as follows:
[0081]
[0082] in, is the transaction amount corresponding to the transaction on this side, The transaction time of the transaction. is the base transaction start time of the transaction. is the preset time decay coefficient.
[0083] In some embodiments, the updated node weight of the node is calculated based on the current node weight of the node, the current node weight of the adjacent node, and the edge weight, including: calculating the updated node weight of the node based on the current node weight of the node, the current node weight of each adjacent node pointing to the node, and the edge weight corresponding to the edge between the node and the adjacent node. In some embodiments, for each node, based on the ranking algorithm, the updated node weight of the node is calculated based on the current node weight of the node, the current node weight of each adjacent node pointing to the node, and the edge weight corresponding to the edge between the node and the adjacent node (there is an edge between each adjacent node pointing to the node and the node, and the direction of the edge is from the adjacent node to the node), and then the updated node weight is used as the current node weight of the node and the updated node weight of the node is continued to be iteratively calculated, and so on, until the node weight change value of the node is less than or equal to the first preset threshold value, and the iteration is stopped. The specific calculation method is as described above and will not be repeated here.
[0084] In some embodiments, the updated node weight of the node is calculated according to the current node weight of the node, the current node weight of each adjacent node pointing to the node, and the edge weight corresponding to the edge between the node and the adjacent node, including: calculating the updated node weight of the node according to the current node weight of the node, the current node weight of each adjacent node pointing to the node, the edge weight corresponding to the edge between the node and the adjacent node, the out-degree of the adjacent node and the damping factor. In some embodiments, for each node, based on the ranking algorithm, the updated node weight of the node is calculated according to the current node weight of the node, the current node weight of each adjacent node pointing to the node, the edge weight corresponding to the edge between the node and the adjacent node, the out-degree of the adjacent node (the out-degree of a node refers to the number of edges from the node to other nodes) and the preset damping factor, and then the updated node weight is used as the current node weight of the node and the updated node weight of the node is continued to be iteratively calculated, and so on, until the node weight change value of the node is less than or equal to the first preset threshold value and the iteration is stopped. In some embodiments, the calculation formula of the updated node weight of node A is as follows:
[0085]
[0086] in, is the preset damping factor, Represents the updated node weight of node A, Represents the current node weight before node A is updated, represents a set of nodes pointing to node A (that is, there is an edge between each node in the node set and node A), Representation Node The out-degree, Representative Node The current node weight before updating, For Node The edge weight corresponding to the edge pointing to node A.
[0087] In some embodiments, the obtaining of the second historical transaction information of the target account address corresponding to the target node after the transaction between the target account address and the initial account address includes: if the target account address corresponding to the target node and the initial account address belong to the same blockchain, obtaining the second historical transaction information of the target account address after the transaction between the target account address and the initial account address from the blockchain; if the target account address and the initial account address belong to two different blockchains, recording the corresponding cross-chain transaction time, and obtaining the second historical transaction information of the target account address after the cross-chain transaction time from the blockchain to which the target account address belongs. In some embodiments, it is determined whether the target account address corresponding to the target node and the initial account address belong to the same blockchain. If they belong to the same blockchain, that is, the target account address and the initial account address are account addresses on the same blockchain, and the blockchain browser is used to obtain from the blockchain second historical transaction information corresponding to one or more transactions in which the target account address participated after the transaction occurrence time corresponding to the transaction between the target account address and the initial account address. If they belong to two different blockchains, the transaction between the target account address and the initial account address is a cross-chain transaction, that is, the target account address is an account address on another blockchain, and the transaction occurrence time corresponding to the transaction is recorded as the corresponding cross-chain transaction time, and the blockchain browser is used to obtain from the blockchain to which the target account address belongs second historical transaction information corresponding to one or more transactions in which the target account address participated after the transaction time of the chain.
[0088] In some embodiments, the method further includes: obtaining target chain identification information based on the edge between the node corresponding to the initial account address and the target node; and determining the blockchain to which the target account address belongs in the cross-chain contract database according to the target chain identification information. In some embodiments, based on the edge between the target node and the node corresponding to the initial account address in the transaction graph, the target chain identification information of the corresponding cross-chain transaction can be obtained, and then the target chain identification information is matched in the cross-chain contract database, and the blockchain corresponding to the target chain identification information can be determined, and the blockchain is used as the blockchain to which the target account address belongs, wherein the cross-chain contract database has been described in detail above and will not be repeated here.
[0089] Figure 3 A flowchart of a method for cross-chain transaction tracking provided as an example in an embodiment of this specification.
[0090] like Figure 3 As shown, a cross-chain contract database is first constructed. The cross-chain contract database includes blockchain identification information of multiple blockchains (for example, blockchain ID), address information of multiple cross-chain bridge smart contracts, and a mapping relationship between blockchain identification information and address information of cross-chain bridge smart contracts. The initial account address given by the user is used as the current account address, and the historical transaction information involved in the current account address is analyzed. The transaction types include cross-chain transactions, ordinary transfer transactions, and token exchange transactions. The transaction amount and transaction time are considered in the analysis. Based on the ranking algorithm, the node weights of the nodes in the transaction graph are analyzed, and the account address corresponding to the node with the highest node weight in the transaction graph is updated to the current account address, and so on, until the cross-chain transaction tracking subgraph corresponding to the initial account address is expanded.
[0091] Figure 4 The schematic diagram of the structure of a device for cross-chain transaction tracking provided in an embodiment of this specification, the device for cross-chain transaction tracking (hereinafter referred to as "cross-chain transaction tracking device 1") can be implemented as all or part of an electronic device through software, hardware or a combination of both. According to some embodiments, the cross-chain transaction tracking device 1 includes a transaction graph construction module 11, a node weight calculation module 12 and a tracking graph construction module 13.
[0092] A transaction graph construction module 11 is used to construct a transaction graph corresponding to the initial account address according to the first historical transaction information corresponding to the initial account address, wherein the transaction graph includes multiple nodes and multiple edges between the multiple nodes, each node corresponds to an account address in multiple account addresses, the multiple account addresses include the initial account address, the edge between two nodes corresponds to the transaction information between the two account addresses corresponding to the two nodes respectively, and the transaction types corresponding to the transaction information include cross-chain transactions, ordinary transfer transactions and token exchange transactions;
[0093] The node weight calculation module 12 is used to determine, for each of the nodes, the edge weight corresponding to the edge between the node and the adjacent node according to the transaction amount and transaction occurrence time corresponding to the transaction between the account address corresponding to the adjacent node connected to the node and the account address corresponding to the node, use the initial node weight of the node as the current node weight of the node, calculate the updated node weight of the node according to the current node weight of the node, the current node weight of the adjacent node and the edge weight, use the updated node weight as the current node weight of the node and continue to iterate and calculate the updated node weight of the node until the node weight change value of the node is less than or equal to the first preset threshold value, and stop iterating, wherein the initial node weight of the node corresponding to the initial account address is greater than the initial node weights of other nodes;
[0094] The tracking graph construction module 13 is used to take the node with the largest node weight corresponding to the transaction graph as the target node, obtain the second historical transaction information of the target account address corresponding to the target node after the transaction between the target account address and the initial account address, construct the transaction subgraph corresponding to the target node according to the second historical transaction information, select the node with the largest node weight corresponding to the transaction subgraph as the new target node, and so on, until the sum of the node weights of all nodes in the latest transaction subgraph currently constructed is greater than or equal to the second preset threshold, and obtain the cross-chain transaction tracking graph corresponding to the initial account address according to the transaction graph and at least one constructed transaction subgraph.
[0095] In some embodiments, each edge in the transaction graph is a weighted time-series multi-relation directed edge, and the direction of each edge points from the node corresponding to the sending address of the transaction information corresponding to the edge to the node corresponding to the receiving address of the transaction information. The weight information of each edge is used to represent the total transaction amount of the transaction information corresponding to the edge, and the timing information of each edge is used to represent the transaction occurrence time of the transaction information corresponding to the edge.
[0096] In some embodiments, constructing a transaction graph corresponding to the initial account address according to the first historical transaction information corresponding to the initial account address includes:
[0097] Determine multiple account addresses according to the first historical transaction information corresponding to the initial account address, and construct a node corresponding to each account address in the transaction graph corresponding to the initial account address, wherein the multiple account addresses include the initial account address;
[0098] For two nodes in the transaction graph, if it is determined according to the first historical transaction information that there is transaction information between two account addresses respectively corresponding to the two nodes, an edge between the two nodes is constructed in the transaction graph according to the transaction information.
[0099] In some embodiments, constructing an edge between the two nodes in the transaction graph according to the transaction information includes:
[0100] Determine the transaction type corresponding to the transaction information according to the transaction information and the cross-chain contract database;
[0101] An edge connection relationship between the two nodes is determined according to the transaction type, and an edge between the two nodes is constructed in the transaction graph according to the edge connection relationship and the transaction information.
[0102] In some embodiments, the cross-chain transaction tracking device 1 is also used for:
[0103] Build full nodes of multiple blockchains, synchronize the blocks in each blockchain to the latest blocks, obtain the blockchain identification information corresponding to each blockchain and the address information of at least one cross-chain bridge smart contract between the multiple blockchains, and build the cross-chain contract database.
[0104] In some embodiments, determining the transaction type corresponding to the transaction information according to the transaction information and the cross-chain contract database includes:
[0105] If it is determined according to the transaction information that the corresponding transaction process involves a cross-chain bridge smart contract in the cross-chain contract database, it is determined that the transaction type corresponding to the transaction information is a cross-chain transfer;
[0106] If it is determined according to the transaction information that there are transactions with the same hash between the account addresses corresponding to the two nodes, it is determined that the transaction type corresponding to the transaction information is a token exchange transaction;
[0107] Otherwise, it is determined that the transaction type corresponding to the transaction information is a common transfer transaction.
[0108] In some embodiments, determining the edge connection relationship between the two nodes according to the transaction type includes:
[0109] If the transaction type is a cross-chain transfer, obtain the log event information about the transaction information from the blockchain where the account addresses corresponding to the two nodes are located, and parse the log event information. If the event corresponding to the log event information is that the account address is sent to the cross-chain bridge smart contract, parse the target chain identification information and the target chain receiver address from the log event information; if the event corresponding to the log event information is that the cross-chain bridge smart contract is sent to the account address, parse the source chain identification information and the source chain sender address from the log event information; determine the edge connection relationship between the two nodes according to the target chain receiver address, the target chain identification information, the source chain sender address and the source chain identification information.
[0110] In some embodiments, determining the edge weight corresponding to the edge between the node and the adjacent node according to the transaction amount and transaction occurrence time corresponding to the transaction between the account address corresponding to the adjacent node connected to the node and the account address corresponding to the node includes:
[0111] For an adjacent node connected to the node, if the account address corresponding to the node is the initiator of a transaction between the account address corresponding to the adjacent node and the account address corresponding to the node, the edge weight corresponding to the edge between the node and the adjacent node is determined according to the transaction amount corresponding to the transaction and the time when the transaction occurred.
[0112] In some embodiments, determining the edge weight corresponding to the edge between the node and the adjacent node according to the transaction amount and the transaction occurrence time corresponding to the transaction includes:
[0113] The edge weight corresponding to the edge between the node and the adjacent node is determined according to the transaction amount, transaction occurrence time, benchmark transaction start time and time decay coefficient corresponding to the transaction.
[0114] In some embodiments, the step of calculating the updated node weight of the node according to the current node weight of the node, the current node weights of the adjacent nodes, and the edge weights includes:
[0115] The updated node weight of the node is calculated according to the current node weight of the node, the current node weight of each adjacent node pointing to the node, and the edge weight corresponding to the edge between the node and the adjacent node.
[0116] In some embodiments, calculating the updated node weight of the node according to the current node weight of the node, the current node weight of each adjacent node pointing to the node, and the edge weight corresponding to the edge between the node and the adjacent node includes:
[0117] The updated node weight of the node is calculated based on the current node weight of the node, the current node weight of each adjacent node pointing to the node, the edge weight corresponding to the edge between the node and the adjacent node, the out-degree of the adjacent node and the damping factor.
[0118] In some embodiments, the obtaining of second historical transaction information of a target account address corresponding to the target node after a transaction between the target account address and the initial account address includes:
[0119] If the target account address corresponding to the target node and the initial account address belong to the same blockchain, obtain the second historical transaction information of the target account address after the transaction between the target account address and the initial account address from the blockchain; if the target account address and the initial account address belong to two different blockchains, record the corresponding cross-chain transaction time, and obtain the second historical transaction information of the target account address after the cross-chain transaction time from the blockchain to which the target account address belongs.
[0120] In some embodiments, the cross-chain transaction tracking device 1 is also used for:
[0121] Obtain target chain identification information based on the edge between the node corresponding to the initial account address and the target node;
[0122] According to the target chain identification information, the blockchain to which the target account address belongs is determined in the cross-chain contract database.
[0123] The above device embodiments correspond to the method embodiments. For specific descriptions, please refer to the description of the method embodiments, which will not be repeated here. The device embodiments are obtained based on the corresponding method embodiments and have the same technical effects as the corresponding method embodiments. For specific descriptions, please refer to the corresponding method embodiments.
[0124] The embodiment of the present specification also provides a computer storage medium, which can store multiple instructions, and the instructions are suitable for being loaded by a processor to execute the method of the embodiment of the present specification.
[0125] The embodiments of the present specification also provide a computer program product, which stores at least one instruction, and the at least one instruction is loaded by the processor to execute the method of the embodiments of the present specification.
[0126] The embodiments of this specification also provide Figure 5 The structural diagram of the electronic device shown in FIG. Figure 5At the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and may also include hardware required for other services. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to implement the above-mentioned voice activity detection method.
[0127] Of course, in addition to software implementation, this specification does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the executor of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0128] In the 1990s, it was very clear whether the improvement of a technology was hardware improvement (for example, improvement of the circuit structure of diodes, transistors, switches, etc.) or software improvement (improvement of the method flow). However, with the development of technology, many improvements of the method flow today can be regarded as direct improvements of the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be implemented with hardware entity modules. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask chip manufacturers to design and make dedicated integrated circuit chips. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one kind of HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0129] The controller may be implemented in any suitable manner, for example, the controller may take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (e.g., software or firmware) executable by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, and the memory controller may also be implemented as part of the control logic of the memory. It is also known to those skilled in the art that, in addition to implementing the controller in a purely computer-readable program code manner, the controller may be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, such a controller may be considered as a hardware component, and the devices for implementing various functions included therein may also be considered as structures within the hardware component. Or even, the devices for implementing various functions may be considered as both software modules for implementing the method and structures within the hardware component.
[0130] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0131] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0132] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0133] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0134] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0135] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0136] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0137] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0138] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0139] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0140] It should be understood by those skilled in the art that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0141] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0142] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0143] The above description is only an embodiment of the present specification and is not intended to limit the present specification. For those skilled in the art, the present specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification shall be included in the scope of the claims of the present specification.
Claims
1. A method for cross-chain transaction tracking, comprising: According to the first historical transaction information corresponding to the initial account address, a transaction graph corresponding to the initial account address is constructed, wherein the transaction graph includes multiple nodes and multiple edges between the multiple nodes, each node corresponds to an account address in multiple account addresses, the multiple account addresses include the initial account address, the edge between two nodes corresponds to the transaction information between the two account addresses respectively corresponding to the two nodes, and the transaction types corresponding to the transaction information include cross-chain transactions, ordinary transfer transactions and token exchange transactions; For each node, determine the edge weight corresponding to the edge between the node and the adjacent node according to the transaction amount and transaction time corresponding to the transaction between the account address corresponding to the adjacent node connected to the node and the account address corresponding to the node, use the initial node weight of the node as the current node weight of the node, calculate the updated node weight of the node according to the current node weight of the node, the current node weight of the adjacent node and the edge weight, use the updated node weight as the current node weight of the node and continue to iterate and calculate the updated node weight of the node until the node weight change value of the node is less than or equal to the first preset threshold value, and stop iterating, wherein the initial node weight of the node corresponding to the initial account address is greater than the initial node weights of other nodes; The node with the largest corresponding node weight in the transaction graph is selected as the target node, and the second historical transaction information of the target account address corresponding to the target node after the transaction between the target account address and the initial account address is obtained. The transaction subgraph corresponding to the target node is constructed according to the second historical transaction information, and the node with the largest corresponding node weight in the transaction subgraph is selected as the new target node, and so on, until the sum of the node weights of all nodes in the latest transaction subgraph currently constructed is greater than or equal to the second preset threshold. According to the transaction graph and at least one constructed transaction subgraph, a cross-chain transaction tracking graph corresponding to the initial account address is obtained.
2. According to the method of claim 1, each edge in the transaction graph is a weighted time-series multi-relation directed edge, and the direction of each edge points from the node corresponding to the sending address of the transaction information corresponding to the edge to the node corresponding to the receiving address of the transaction information. The weight information of each edge is used to represent the total transaction amount of the transaction information corresponding to the edge, and the timing information of each edge is used to represent the transaction occurrence time of the transaction information corresponding to the edge.
3. According to the method of claim 1, constructing a transaction graph corresponding to the initial account address according to the first historical transaction information corresponding to the initial account address comprises: Determine multiple account addresses according to the first historical transaction information corresponding to the initial account address, and construct a node corresponding to each account address in the transaction graph corresponding to the initial account address, wherein the multiple account addresses include the initial account address; For two nodes in the transaction graph, if it is determined according to the first historical transaction information that there is transaction information between two account addresses respectively corresponding to the two nodes, an edge between the two nodes is constructed in the transaction graph according to the transaction information.
4. The method according to claim 3, wherein constructing an edge between the two nodes in the transaction graph according to the transaction information comprises: Determine the transaction type corresponding to the transaction information according to the transaction information and the cross-chain contract database; An edge connection relationship between the two nodes is determined according to the transaction type, and an edge between the two nodes is constructed in the transaction graph according to the edge connection relationship and the transaction information.
5. The method according to claim 4, further comprising: Build full nodes of multiple blockchains, synchronize the blocks in each blockchain to the latest blocks, obtain the blockchain identification information corresponding to each blockchain and the address information of at least one cross-chain bridge smart contract between the multiple blockchains, and build the cross-chain contract database.
6. The method according to claim 4 or 5, wherein determining the transaction type corresponding to the transaction information based on the transaction information and the cross-chain contract database comprises: If it is determined according to the transaction information that the corresponding transaction process involves a cross-chain bridge smart contract in the cross-chain contract database, it is determined that the transaction type corresponding to the transaction information is a cross-chain transfer; If it is determined according to the transaction information that there are transactions with the same hash between the account addresses corresponding to the two nodes, it is determined that the transaction type corresponding to the transaction information is a token exchange transaction; Otherwise, it is determined that the transaction type corresponding to the transaction information is a common transfer transaction.
7. The method according to claim 6, wherein determining the edge connection relationship between the two nodes according to the transaction type comprises: If the transaction type is a cross-chain transfer, obtain the log event information about the transaction information from the blockchain where the account addresses corresponding to the two nodes are located, and parse the log event information. If the event corresponding to the log event information is that the account address is sent to the cross-chain bridge smart contract, parse the target chain identification information and the target chain receiver address from the log event information; if the event corresponding to the log event information is that the cross-chain bridge smart contract is sent to the account address, parse the source chain identification information and the source chain sender address from the log event information; determine the edge connection relationship between the two nodes according to the target chain receiver address, the target chain identification information, the source chain sender address and the source chain identification information.
8. The method according to claim 1, wherein determining the edge weight corresponding to the edge between the node and the adjacent node according to the transaction amount and transaction occurrence time corresponding to the transaction between the account address corresponding to the adjacent node connected to the node and the account address corresponding to the node comprises: For an adjacent node connected to the node, if the account address corresponding to the node is the initiator of a transaction between the account address corresponding to the adjacent node and the account address corresponding to the node, the edge weight corresponding to the edge between the node and the adjacent node is determined according to the transaction amount corresponding to the transaction and the time when the transaction occurred.
9. The method according to claim 8, wherein determining the edge weight corresponding to the edge between the node and the adjacent node according to the transaction amount and the transaction occurrence time corresponding to the transaction comprises: The edge weight corresponding to the edge between the node and the adjacent node is determined according to the transaction amount, transaction occurrence time, benchmark transaction start time and time decay coefficient corresponding to the transaction.
10. The method according to any one of claims 1 to 5, wherein the updated node weight of the node is calculated according to the current node weight of the node, the current node weights of the adjacent nodes, and the edge weights, comprising: The updated node weight of the node is calculated according to the current node weight of the node, the current node weight of each adjacent node pointing to the node, and the edge weight corresponding to the edge between the node and the adjacent node.
11. The method according to claim 10, wherein the step of calculating the updated node weight of the node according to the current node weight of the node, the current node weight of each adjacent node pointing to the node, and the edge weight corresponding to the edge between the node and the adjacent node comprises: The updated node weight of the node is calculated based on the current node weight of the node, the current node weight of each adjacent node pointing to the node, the edge weight corresponding to the edge between the node and the adjacent node, the out-degree of the adjacent node and the damping factor.
12. The method according to claim 1, wherein obtaining the second historical transaction information of the target account address corresponding to the target node after the transaction between the target account address and the initial account address comprises: If the target account address corresponding to the target node and the initial account address belong to the same blockchain, obtain the second historical transaction information of the target account address after the transaction between the target account address and the initial account address from the blockchain; if the target account address and the initial account address belong to two different blockchains, record the corresponding cross-chain transaction time, and obtain the second historical transaction information of the target account address after the cross-chain transaction time from the blockchain to which the target account address belongs.
13. The method according to claim 12, further comprising: Obtain target chain identification information based on the edge between the node corresponding to the initial account address and the target node; According to the target chain identification information, the blockchain to which the target account address belongs is determined in the cross-chain contract database.
14. A device for cross-chain transaction tracking, comprising: A transaction graph construction module, configured to construct a transaction graph corresponding to the initial account address according to the first historical transaction information corresponding to the initial account address, wherein the transaction graph includes a plurality of nodes and a plurality of edges between the plurality of nodes, each node corresponds to an account address among a plurality of account addresses, the plurality of account addresses include the initial account address, an edge between two nodes corresponds to transaction information between two account addresses respectively corresponding to the two nodes, and the transaction types corresponding to the transaction information include cross-chain transactions, ordinary transfer transactions, and token exchange transactions; A node weight calculation module, for each of the nodes, according to the transaction amount and transaction time corresponding to the transaction between the account address corresponding to the adjacent node connected to the node and the account address corresponding to the node, determine the edge weight corresponding to the edge between the node and the adjacent node, use the initial node weight of the node as the current node weight of the node, calculate the updated node weight of the node according to the current node weight of the node, the current node weight of the adjacent node and the edge weight, use the updated node weight as the current node weight of the node and continue to iterate and calculate the updated node weight of the node until the node weight change value of the node is less than or equal to the first preset threshold value, and stop iterating, wherein the initial node weight of the node corresponding to the initial account address is greater than the initial node weights of other nodes; A tracking graph construction module is used to select the node with the largest node weight corresponding to the transaction graph as the target node, obtain the second historical transaction information of the target account address corresponding to the target node after the transaction between the target account address and the initial account address, construct a transaction subgraph corresponding to the target node according to the second historical transaction information, select the node with the largest node weight corresponding to the transaction subgraph as the new target node, and so on, until the sum of the node weights of all nodes in the latest transaction subgraph currently constructed is greater than or equal to the second preset threshold, and obtain the cross-chain transaction tracking graph corresponding to the initial account address according to the transaction graph and at least one constructed transaction subgraph.
15. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 13 are implemented.
16. An electronic device, characterized in that: include: A processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the steps of the method as claimed in any one of claims 1 to 13.
17. A computer program product having at least one instruction stored thereon, characterized in that: When the at least one instruction is executed by the processor, the steps of the method described in any one of claims 1 to 13 are implemented.
