Search

CN-122027260-A - Cross-chain risk detection method, device and equipment

CN122027260ACN 122027260 ACN122027260 ACN 122027260ACN-122027260-A

Abstract

The embodiment of the specification provides a cross-chain risk detection method, device and equipment, wherein the method comprises the steps of receiving a risk detection request for target transaction, responding to the risk detection request, obtaining source chain transaction data corresponding to the target transaction and target chain transaction data, wherein the source chain transaction data and the target chain transaction data are transaction data generated on different blockchain networks, constructing target heterogeneous graph data based on the source chain transaction data and the target chain transaction data, obtaining meta paths screened based on historical transaction data, screening target meta paths from the meta paths according to the occurrence frequency of the meta paths in the historical transaction data of different risk types, and detecting whether the target transaction has risks or not based on the target meta paths and the target heterogeneous graph data.

Inventors

  • LU SHUNFENG
  • SONG BOWEN
  • CHEN JUN

Assignees

  • 支付宝(杭州)数字服务技术有限公司

Dates

Publication Date
20260512
Application Date
20260130

Claims (10)

  1. 1. A cross-chain risk detection method, comprising: receiving a risk detection request for a target transaction; Responding to the risk detection request, acquiring source chain transaction data corresponding to the target transaction and target chain transaction data, wherein the source chain transaction data and the target chain transaction data are transaction data generated on different blockchain networks; constructing target heterogeneous graph data based on the source chain transaction data and the target chain transaction data; acquiring element paths screened based on historical transaction data, and screening target element paths from the element paths according to occurrence frequencies of the element paths in the historical transaction data of different risk types; And detecting whether the target transaction is at risk or not based on the target meta-path and the target iso-composition data.
  2. 2. The method of claim 1, the detecting whether the target transaction is at risk based on the target meta-path and the target iso-composition data, comprising: Determining a transaction risk type corresponding to the target transaction based on the target element path and the target heterograph data by utilizing a pre-trained detection model, wherein the detection model is a model constructed based on a preset attention mechanism, and the transaction risk type comprises a source chain risk, a target chain risk, a forwarding node risk and no risk; based on the transaction risk type, a determination is made as to whether the target transaction is at risk.
  3. 3. The method of claim 1, wherein determining the transaction risk type corresponding to the target transaction based on the target meta-path and the target iso-composition data using a pre-trained detection model comprises: determining a first characteristic of a node in the target heterograph data based on the attention weights of the node in the target meta-path by using a first detection network of the pre-trained detection model, and determining a second characteristic of the node based on the attention weights between the target meta-paths by using a second detection network of the pre-trained detection model; And determining a transaction risk type corresponding to the target transaction based on the first characteristic and the second characteristic of the node.
  4. 4. The method of claim 1, further comprising, prior to said obtaining a meta path screened based on historical transaction data: Constructing historical heterogeneous map data based on the historical transaction data; And carrying out path extraction processing on the historical heterogeneous graph data based on node types contained in the historical heterogeneous graph data and a preset path length threshold value to obtain the meta path, wherein the node types comprise user nodes, routing nodes, log nodes, forwarding nodes, other account nodes and token contract nodes.
  5. 5. The method of claim 1, the risk types including risk transactions, and normal transactions, the screening target meta-paths from the meta-paths based on frequency of occurrence of the meta-paths in historical transaction data of different risk types, comprising: Acquiring a first occurrence frequency of the meta-path in the historical transaction data of the risk transaction type and a second occurrence frequency of the meta-path in the historical transaction data of the normal transaction type; and screening a target element path from the element paths based on the difference value between the first occurrence frequency and the second occurrence frequency.
  6. 6. The method of claim 1, the constructing target heterogeneous map data based on the source chain transaction data and the target chain transaction data, comprising: Performing feature extraction and feature alignment processing on the source chain transaction data and the target chain transaction data to obtain a first feature corresponding to the source chain transaction data and a second feature corresponding to the target chain transaction data; constructing a forwarding node between a source chain and a target chain based on a transmission data stream of the target transaction in an under-chain repeater; The target iso-composition data is constructed based on the first feature, the second feature, and the forwarding node.
  7. 7. The method of claim 1, the constructing the target heterogeneous map data based on the first feature, the second feature, and the forwarding node, comprising: The data relationship among the source chain transaction data and the target chain transaction data is standardized to obtain a processed data relationship, namely a function call relationship, a contract creation relationship, a contract destruction relationship and a contract exception handling relationship; and constructing the target heterograph data based on the first feature, the second feature, the forwarding node and the processed data relationship.
  8. 8. The method of claim 1, the source chain transaction data and/or the target chain transaction data comprising basic transaction information, transaction execution steps, contract invocation information, state change information, log and event data, resource usage information, and transaction execution anomaly information.
  9. 9. A cross-chain risk detection device, comprising: the request receiving module is used for receiving a risk detection request aiming at a target transaction; The data acquisition module is used for responding to the risk detection request and acquiring source chain transaction data and target chain transaction data corresponding to the target transaction, wherein the source chain transaction data and the target chain transaction data are transaction data generated on different blockchain networks; the diagram construction module is used for constructing target heterogeneous diagram data based on the source chain transaction data and the target chain transaction data; The path acquisition module is used for acquiring element paths screened based on historical transaction data and screening target element paths from the element paths according to the occurrence frequency of the element paths in the historical transaction data of different risk types; And the risk detection module is used for detecting whether the target transaction has risk or not based on the target meta-path and the target iso-composition data.
  10. 10. A cross-chain risk detection device, the cross-chain risk detection device comprising: Processor, and A memory arranged to store computer executable instructions that, when executed, cause the processor to: receiving a risk detection request for a target transaction; Responding to the risk detection request, acquiring source chain transaction data corresponding to the target transaction and target chain transaction data, wherein the source chain transaction data and the target chain transaction data are transaction data generated on different blockchain networks; constructing target heterogeneous graph data based on the source chain transaction data and the target chain transaction data; acquiring element paths screened based on historical transaction data, and screening target element paths from the element paths according to occurrence frequencies of the element paths in the historical transaction data of different risk types; And detecting whether the target transaction is at risk or not based on the target meta-path and the target iso-composition data.

Description

Cross-chain risk detection method, device and equipment Technical Field The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, and a device for detecting a cross-chain risk. Background With the continuous development of blockchain technology, various independent blockchain networks are continuously emerging, and blockchain transactions are gradually accelerated from a single-chain expansion mode to multi-chain parallel development, and cross-chain transactions are receiving more and more attention as a key mechanism for promoting the interoperation between different blockchain networks. Because the cross-chain transaction involves asset and data transfer between different blockchain platforms, malicious attack means involved in the cross-chain transaction presents stronger complexity and concealment, and a more reliable cross-chain transaction risk detection scheme needs to be provided for guaranteeing user privacy and data security so as to improve the accuracy of cross-chain transaction risk detection. Disclosure of Invention It is an aim of embodiments of the present description to provide a more reliable cross-chain transaction risk detection scheme to improve the accuracy of cross-chain transaction risk detection. In order to achieve the above technical solution, the embodiments of the present specification are implemented as follows: The method for detecting the cross-chain risk comprises the steps of receiving a risk detection request for target transaction, responding to the risk detection request, obtaining source chain transaction data corresponding to the target transaction and target chain transaction data which are generated on different blockchain networks, constructing target heterogeneous graph data based on the source chain transaction data and the target chain transaction data, obtaining meta paths screened based on historical transaction data, screening out target meta paths from the meta paths according to occurrence frequencies of the meta paths in the historical transaction data of different risk types, and detecting whether the target transaction has risk or not based on the target meta paths and the target heterogeneous graph data. The device comprises a request receiving module, a data acquisition module, a graph construction module, a path acquisition module and a risk detection module, wherein the request receiving module is used for receiving a risk detection request for target transaction, the data acquisition module is used for responding to the risk detection request and acquiring source chain transaction data corresponding to the target transaction and target chain transaction data which are transaction data generated on different blockchain networks, the graph construction module is used for constructing target heterogeneous graph data based on the source chain transaction data and the target chain transaction data, the path acquisition module is used for acquiring meta paths screened based on historical transaction data and screening target meta paths from the meta paths according to occurrence frequencies of the meta paths in the historical transaction data of different risk types, and the risk detection module is used for detecting whether the target transaction has risks or not based on the target meta paths and the target heterogeneous graph data. The cross-chain risk detection device comprises a processor and a memory, wherein the memory is arranged to store computer executable instructions, the executable instructions when executed enable the processor to receive a risk detection request for target transaction, acquire source chain transaction data corresponding to the target transaction and target chain transaction data which are transaction data generated on different blockchain networks in response to the risk detection request, construct target heterogeneous graph data based on the source chain transaction data and the target chain transaction data, acquire a meta-path screened based on historical transaction data, screen the meta-path according to the occurrence frequency of the meta-path in the historical transaction data of different risk types, and detect whether the target transaction exists or not based on the target meta-path and the target heterogeneous graph data. The embodiment of the specification also provides a storage medium for storing computer executable instructions, wherein the executable instructions when executed by a processor realize the following processes of receiving a risk detection request for target transaction, responding to the risk detection request, acquiring source chain transaction data corresponding to the target transaction and target chain transaction data, wherein the source chain transaction data and the target chain transaction data are transaction data generated on different blockchain networks, constructing target heterogeneous graph data based on the source cha