Abnormal cross-chain transaction detection method and system based on graph random neural network

By adopting a graph-based random neural network detection method in the blockchain cross-chain network, using semi-supervised learning and consistency regularization strategies, the problem of abnormal transaction detection in the cross-chain network is solved, and the accuracy and reliability of the detection are improved.

WO2025055147A1PCT designated stage expired Publication Date: 2025-03-20HANGZHOU YUNXIANG NETWORK TECH

Patent Information

Application Number
PCT/CN2023/136090
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-09-13
Filing Date
2023-12-04
Publication Date
2025-03-20

AI Technical Summary

Technical Problem

In blockchain cross-chain networks, it is difficult for the existing technology to effectively detect abnormal transactions, and there are problems such as excessive smoothness, poor robustness and prone to overfitting scarce label information.

Method used

A cross-chain anomaly transaction detection method based on graph random neural network is adopted, and a graph random neural network pre-training model is constructed through semi-supervised learning graph data enhancement and consistency regularization strategies, including random propagation of graph data enhancement, two-layer perceptron classification and collaborative training to detect abnormal transactions in cross-chain networks.

Benefits of technology

It improves the accuracy and reliability of cross-chain abnormal transaction detection, avoids excessive smoothing, and enhances the robustness and generalization capabilities of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023136090_20032025_PF_FP_ABST
    Figure CN2023136090_20032025_PF_FP_ABST
Patent Text Reader

Abstract

The present disclosure relates to the field of artificial intelligence, specifically to abnormal cross-chain detection, and more specifically to an abnormal cross-chain transaction detection method based on a graph random neural network. Cross-chain zones and cross-chain routes are constructed, an adjacency matrix and a feature matrix are constructed on the basis of transaction information and feature information in the zones and in the routes. The adjacency matrix and the feature matrix are input into a graph random neural network pre-training model. First, new feature representations of nodes in a cross-chain network are learned through random propagation for graph data augmentation, and the random propagation process is executed for S times to obtain S augmented feature matrices. Then, the augmented feature matrices are input into a two-layer perceptron to obtain predicted outputs of the nodes. Finally, a final output is obtained through collaborative training to detect an abnormal transaction in the cross-chain network. According to the method, excessive smoothing can be better avoided by using linear feature propagation and consistency regularization, and higher robustness and a stronger generalization ability are achieved, so that the accuracy and reliability of abnormal transaction detection by the model are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Cross-chain abnormal transaction detection method and system based on graph random neural network Technical Field

[0001] The present invention belongs to the fields of blockchain technology and artificial intelligence, and specifically relates to a cross-chain abnormal transaction detection method and system based on graph random neural network. Background Art

[0002] With the development of blockchain technology, the number of blockchains suitable for different application scenarios continues to increase globally. However, due to the mutual independence of blockchains, effective data communication, value transfer, and other operations cannot be carried out between them. Cross-chain technology is a key technical means to achieve interoperability and improve scalability. However, achieving interoperability between blockchains inevitably raises transaction security issues. Therefore, anomaly detection in cross-chain networks has become a pressing issue.

[0003] Graph neural networks (GNNs) have emerged as a powerful and effective approach for anomaly detection. The key concept behind GNNs is to learn new node representations through a deterministic feature propagation process. However, this approach suffers from oversmoothing, poor robustness, and the tendency to overfit scarce label information. Therefore, this paper, in conjunction with GNNs, proposes a GNN-based method and system for detecting cross-chain anomaly transactions. This method can reliably and effectively address the problem of detecting anomaly transactions in cross-chain networks.

[0004] Summary of the Invention

[0005] Based on the above background and the problems existing in the prior art, the present invention adopts the following technical solutions: First, a method for detecting cross-chain abnormal transactions based on a graph random neural network is provided. This method can detect abnormal transactions in cross-chain networks by using graph data enhancement and consistency regularization strategies based on semi-supervised learning, and obtain classification results for abnormal and normal transactions. The steps include:

[0006] Step 1: Build cross-chain partitions of the cross-chain network and configure cross-chain routing between every two cross-chain partitions;

[0007] Step 2: Based on cross-chain partitioning and cross-chain routing, collect transaction data of users in the cross-chain network and construct the transaction data into a graph. The nodes in the graph represent transactions in the blockchain. Any node represents a transaction in the cross-chain network. The nodes also contain node feature information. The edges in the graph represent the flow of funds between transactions. The relationship between the nodes in the graph is stored in an adjacency matrix, and the feature information of the nodes is stored in a feature matrix.

[0008] Step 3: Based on the feature matrix, label the nodes in the graph and obtain the original label of each node;

[0009] Step 4: Build a graph random neural network pre-training model, including random propagation of graph data enhancement, two-layer perceptron classification and collaborative training. Input the adjacency matrix and feature matrix as training data into the graph random neural network pre-training model for training to obtain a graph random neural network model.

[0010] Step 5: Convert the blockchain transaction data to be tested into graph data and input it into the graph random neural network model. Output the predicted probability of each node in the graph and use the preset threshold to determine whether the node is an abnormal node. If the predicted probability of the node is higher than the preset threshold, the node is an abnormal node, otherwise it is a normal node. The abnormal node represents an abnormal transaction in the cross-chain network.

[0011] As an implementable method, the construction of partitions of the cross-chain network includes the following steps:

[0012] The blockchains in the cross-chain network are classified according to transaction types to obtain cross-chain partitions. Among them, the blockchains including settlement, repayment, and lending are divided into payment partitions; the blockchains including evidence storage and evidence collection are divided into evidence storage partitions; and the blockchains including message transmission and information transmission are divided into communication partitions.

[0013] A cross-chain route is configured between every two cross-chain partitions to realize information transmission. The cross-chain route includes a routing information management module, a communication processor and a distributor. The routing information management module is used to store dynamic routing tables, and the communication processor and distributor are used to parse communication data packets between blockchains and between nodes.

[0014] As an implementable method, the construction of the adjacency matrix and feature matrix of the graph based on cross-chain partitioning and cross-chain routing includes the following steps:

[0015] Collect transaction data from users in the cross-chain network, where transaction data includes at least the flow of funds between transactions, the number of cross-chain transactions initiated within a preset period, the number of transaction objects, the total transaction amount, the number of cross-chain transaction timeouts and defaults, the number of penalties or reports, and the number of key input errors;

[0016] The transaction data is constructed as a graph, and the adjacency matrix is ​​constructed using the capital flow between transactions. The feature matrix is ​​constructed using the other six types of data. The cross-chain network transaction data is constructed as a partition subgraph within the cross-chain partition, and the partition subgraph is stored using the partition adjacency matrix and the partition feature matrix. The data is constructed as a routing subgraph within the cross-chain routing, and the routing subgraph is stored using the routing adjacency matrix and the routing feature matrix.

[0017] As an implementable method, labeling nodes in the graph based on the feature matrix to obtain the original label of each node includes the following steps:

[0018] Thresholds are set for the number of cross-chain transactions initiated within a preset period, the number of transaction objects, and the total transaction amount. If the characteristic value corresponding to a node exceeds various preset thresholds, the node is marked as an abnormal node and the label value is 1.

[0019] Set thresholds for the number of cross-chain transaction timeouts and defaults, the number of penalties or reports, and the number of key input errors within a preset period. If the characteristic value corresponding to a node exceeds the set threshold, it is considered an abnormal node and is marked with a label value of 2;

[0020] If the node is not marked as 1 or 2, it is a normal node and is marked with a label value of 0.

[0021] As an implementation method, the graph random neural network model includes the following steps to enable each node to aggregate only information from a subset of its multi-hop neighbors by completely ignoring the characteristics of certain nodes, thereby reducing the node's dependence on specific neighbors, thereby helping to improve the robustness of the model:

[0022] Multiply the eigenvector of each node by the binary mask obtained by randomly sampling the eigenvector to obtain the perturbation feature matrix;

[0023] The enhanced feature matrix is ​​obtained by iteratively calculating the product of the mean value matrix of the power series of the symmetric normalized adjacency matrix from order 0 to order K and the perturbation feature matrix;

[0024] After the above two steps are performed S times, S enhanced feature matrices are generated, and the S enhanced feature matrices are input into the two-layer perceptron to obtain S node prediction output vectors;

[0025] The graph random neural network pre-training model is trained collaboratively by supervision loss and consistency regularization loss, where the supervision loss is calculated by performing cross-entropy loss on the node prediction output and the original label, and the consistency regularization loss is obtained by minimizing the squared L2 distance between the prediction outputs of two nodes, that is, minimizing the squared L2 distance between the prediction output vectors of S nodes.

[0026] In the second aspect, a cross-chain abnormal transaction detection system based on graph random neural network is provided, which is characterized by including a cross-chain partitioning module, a preprocessing module, a model training module and a classification judgment module:

[0027] The cross-chain partition module is used to build cross-chain partitions of the cross-chain network and configure cross-chain routing between every two cross-chain partitions;

[0028] The preprocessing module is used to construct the transaction data of users in the cross-chain network into a graph, store the node relationships in the graph using an adjacency matrix, store the feature information of the nodes using a feature matrix, and annotate the labels of each node;

[0029] The model training module includes random propagation of graph data enhancement, two-layer perceptron classification and collaborative training. The adjacency matrix and feature matrix are input into the model training module as training data for training to obtain a graph random neural network model.

[0030] The classification judgment module is used to convert the blockchain transaction data to be tested into graph data and input it into the graph random neural network model, output the predicted probability of each node in the graph, and determine whether the node is an abnormal node based on a preset threshold.

[0031] In a third aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following method is implemented:

[0032] Build cross-chain partitions of the cross-chain network and configure cross-chain routing between every two cross-chain partitions;

[0033] Based on cross-chain partitioning and cross-chain routing, the transaction data of users in the cross-chain network is collected and constructed into a graph. The nodes in the graph represent transactions in the blockchain and also contain their feature information. The edges in the graph represent the flow of funds between transactions. The relationship between the nodes in the graph is stored in an adjacency matrix, and the feature information of the nodes is stored in a feature matrix.

[0034] Based on the feature matrix, label the nodes in the graph and obtain the original label of each node;

[0035] Construct a graph random neural network pre-training model, including random propagation for graph data enhancement, two-layer perceptron classification, and collaborative training. Input the adjacency matrix and feature matrix as training data into the graph random neural network pre-training model for training to obtain a graph random neural network model.

[0036] The blockchain transaction data to be tested is converted into graph data and input into the graph random neural network model. The predicted probability of each node in the graph is output, and a preset threshold is used to determine whether the node is an abnormal node. If the predicted probability of the node is higher than the preset threshold, the node is an abnormal node, otherwise it is a normal node. The abnormal node represents an abnormal transaction in the cross-chain network.

[0037] In a fourth aspect, a cross-chain abnormal transaction detection device based on a graph random neural network is provided, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein when the processor executes the computer program, the following method is implemented:

[0038] Build cross-chain partitions of the cross-chain network and configure cross-chain routing between every two cross-chain partitions;

[0039] Based on cross-chain partitioning and cross-chain routing, the transaction data of users in the cross-chain network is collected and constructed into a graph. The nodes in the graph represent transactions in the blockchain and also contain their feature information. The edges in the graph represent the flow of funds between transactions. The relationship between the nodes in the graph is stored in an adjacency matrix, and the feature information of the nodes is stored in a feature matrix.

[0040] Based on the feature matrix, label the nodes in the graph and obtain the original label of each node;

[0041] Construct a graph random neural network pre-training model, including random propagation for graph data enhancement, two-layer perceptron classification, and collaborative training. Input the adjacency matrix and feature matrix as training data into the graph random neural network model for training to obtain the graph random neural network model.

[0042] The blockchain transaction data to be tested is converted into graph data and input into the graph random neural network model. The predicted probability of each node in the graph is output, and a preset threshold is used to determine whether the node is an abnormal node. If the predicted probability of the node is higher than the threshold, the node is an abnormal node, otherwise it is a normal node. The abnormal node represents an abnormal transaction in the cross-chain network.

[0043] The present invention has at least the following beneficial effects:

[0044] (1) A cross-chain abnormal transaction detection method based on graph random neural network is proposed, which provides a new idea for the security issue of cross-chain transactions, effectively captures abnormal transactions in cross-chain, and improves the accuracy and reliability of cross-chain abnormal transaction detection.

[0045] (2) A cross-chain abnormal transaction detection method based on graph random neural network is proposed, which can better avoid over-smoothing through linear feature propagation and consistency regularization, and is more robust and has stronger generalization ability.

[0046] Other advantages, objectives and features of the present invention will be reflected in part from the following description and will be understood by those skilled in the art through study and practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] FIG1 is a schematic diagram of cross-chain partitioning and cross-chain routing constructed in the present invention.

[0048] Figure 2 is a schematic diagram of the steps of the cross-chain abnormal transaction detection method based on graph random neural network of the present invention.

[0049] Figure 3 is a flow chart of the cross-chain abnormal transaction detection method based on graph random neural network of the present invention. DETAILED DESCRIPTION

[0050] To clearly illustrate the present invention and make the objectives, technical solutions, and advantages of the embodiments of the present invention more apparent, the following provides a clear and complete description of the technical solutions in the embodiments of the present invention, with reference to the accompanying drawings, so that those skilled in the art can implement the invention accordingly. The following drawings and specific embodiments will further illustrate the technology of the present invention.

[0051] This invention proposes a method for detecting cross-chain abnormal transactions based on a graph random neural network. The schematic diagram of the invention is shown in Figure 1. The specific steps are as follows:

[0052] (1) Construct cross-chain partitions for the cross-chain network and configure cross-chain routing between each two partitions, as shown in Figure 2. Cross-chain partitions are classified into payment partitions, evidence storage partitions, and communication partitions according to the blockchain transaction type. Payment partitions mainly include settlement, repayment, and lending. Evidence storage partitions mainly include evidence storage and evidence collection. Communication partitions mainly include message delivery and message transmission. Then, cross-chain routing for information transmission is configured between cross-chain partitions. The cross-chain routing includes an information management module, a communication processor, and a distributor. The information management module is used to store dynamic routing tables, and the communication processor and distributor are used to parse communication data packets between blockchains and between users.

[0053] (2) Based on cross-chain partitions and cross-chain routing, the transaction data of users in the cross-chain network are collected, the transaction data are constructed into a graph, and the adjacency matrix and feature matrix of the graph are constructed, wherein the transaction data at least includes the capital flow between transactions, the number of cross-chain transactions initiated within a preset period, the number of transaction objects, the total transaction amount, the number of cross-chain transaction timeouts and defaults, the number of penalties or reports, and the number of key input errors. The capital flow between transactions is used to construct the adjacency matrix, and the remaining six types of data are used to construct the feature matrix; the cross-chain network transaction data is constructed into a partition subgraph within the cross-chain partition, and the partition subgraph is stored using the partition adjacency matrix and the partition feature matrix. The data is constructed into a routing subgraph within the cross-chain routing, and the routing subgraph is stored using the routing adjacency matrix and the routing feature matrix. Combining the above two adjacency matrices and feature matrices, the transaction data in the cross-chain network is stored using the adjacency matrix A and the feature matrix X in the graph.

[0054] (3) Label the nodes in the graph by presetting thresholds for the eigenvalues ​​of the feature matrix to obtain the original label of each node. The specific implementation steps are as follows:

[0055] The thresholds for the number of cross-chain transactions initiated within 30 minutes, the number of transaction objects, and the total transaction amount are set to 10, 10, and 100,000 respectively. If the feature value corresponding to a node exceeds the set threshold, it indicates that the node may be an abnormal node and is marked with a label value of 1.

[0056] The thresholds for the number of cross-chain transaction timeouts and defaults, the number of penalties or reports, and the number of key input errors within 30 minutes are set to 3, 3, and 5 respectively. If the feature value corresponding to a node exceeds the set threshold, it is considered an abnormal node and is marked with a label value of 2.

[0057] If the node is not marked as 1 or 2, it means it is a normal node and is marked with a label value of 0. The original label of each node is obtained through the above node marking labels.

[0058] (4) Constructing a graph random neural network model. The present invention constructs a semi-supervised node classification graph random neural network model, as shown in FIG3 . The model includes random propagation for graph data enhancement, two-layer perceptron classification, and collaborative training. There are two steps in random propagation for graph data enhancement. In order to take into account the structural effect, the entire feature vector of some nodes is deleted instead of deleting a single feature element, so that each node can aggregate only information from its (multi-hop) neighbor subset by completely ignoring the features of certain nodes, thus reducing its dependence on specific neighbors, thereby helping to improve the robustness of the model. The specific process is: first, for each node v i Randomly sample binary mask ∈ i ~Bernoulli(1-δ). Secondly, the perturbation feature matrix is ​​obtained by multiplying the feature vector of each node with the mask corresponding to the feature vector Right now where X i represents the i-th row vector of X. Finally, the factor Zoom To ensure that the expectation of the perturbation feature matrix is ​​equal to the expectation of X.

[0059] The sampling process is only performed during training. During testing, Set to the original feature matrix X. In the second step of random propagation, mixed order propagation is adopted, that is, in yes The average value of the power series from order 0 to order K, is the symmetric normalized adjacency matrix, and D is the degree matrix of A. This propagation rule enables the model to include more local information, which is different from directly using Compared to , the risk of over-smoothing is reduced. Note that computing dense matrices The computational efficiency is low, so in the implementation, the sparse matrix is ​​calculated and summed iteratively. and Calculate the product of For an unnormalized adjacency matrix, the problem of vanishing gradients is particularly obvious because there are some very large and very small elements in the matrix, which leads to numerical instability in gradient calculation. By symmetrically normalizing the adjacency matrix, these two problems can be effectively solved, making the influence of each node in the model more balanced, while reducing the problem of vanishing gradients, thereby improving the performance of the model.

[0060] After performing S random propagations, S augmented feature matrices are generated. Each augmented feature matrix is input into a two-layer perceptron to obtain the corresponding output: where denotes the predicted probability on, and Θ is the model parameter. In graph-based semi-supervised learning, the goal is usually to smooth the label information on the graph through regularization, that is, its loss function is a combination of the supervised loss on the labeled nodes and the graph regularization loss. For m labeled nodes among n nodes, the supervised objective of the graph node classification task in each iteration is defined as the average cross-entropy loss of S augmentations:

[0061] In the semi-supervised setting, the prediction consistency between the S augmentations of the unlabeled data is optimized. Considering the simple case of S = 2, the squared L2 distance between the two outputs is minimized, that is To extend this idea to the case of multiple augmentations, first calculate the label distribution center by taking the average of all distributions, that is Then use the sharpening trick to "guess" the labels according to the average distribution. Specifically, the guessed probability of the i-th node for the j-th class is calculated as follows:

[0062] where 0 < T ≤ 1 serves as a value to control the sharpness of the classification distribution.

[0063] When T → 0, the sharpened label distribution will approach the one-hot distribution, minimizing and The distance between is:

[0064] Therefore, by setting T to a small value, the model can be forced to output low-entropy predictions.

[0065] The final loss is: where λ is a hyperparameter used to control the balance between the two losses.

[0066] In summary, the cross-chain abnormal transaction detection method based on graph random neural network provided by the present invention provides a technical support for cross-chain abnormal node detection. The present invention constructs cross-chain partitions and cross-chain routes, converts cross-chain transaction data into graph representation, and constructs an adjacency matrix and a feature matrix based on the transaction information and feature information within the partition and the route. The adjacency matrix and the feature matrix are input into the graph random neural network pre-training model. First, the new feature representation of the nodes in the cross-chain network is learned through random propagation enhanced by graph data. S random propagation processes are performed to obtain S enhanced feature matrices, and then the enhanced feature matrices are input into a two-layer perceptron to obtain the predicted output of the node. Finally, the final output is obtained through collaborative training, thereby detecting abnormal transactions in the cross-chain network. This method uses linear feature propagation and consistency regularization to better avoid over-smoothing, is more robust and has stronger generalization ability, thereby improving the accuracy and reliability of the model's abnormal node detection.

[0067] Example 2:

[0068] A cross-chain abnormal transaction detection system based on graph random neural network is characterized by including a cross-chain partitioning module, a preprocessing module, a model training module and a classification judgment module:

[0069] The cross-chain partition module is used to build cross-chain partitions of the cross-chain network and configure cross-chain routing between every two cross-chain partitions;

[0070] The preprocessing module is used to construct the transaction data of users in the cross-chain network into a graph, store the node relationships in the graph using an adjacency matrix, store the feature information of the nodes using a feature matrix, and annotate the labels of each node;

[0071] The model training module includes random propagation for graph data enhancement, two-layer perceptron classification, and collaborative training. The adjacency matrix and feature matrix are input into the model training module as training data for training to obtain a graph random neural network model.

[0072] The classification judgment module is used to convert the blockchain transaction data to be tested into graph data and input it into the graph random neural network model, output the predicted probability of each node in the graph, and determine whether the node is an abnormal node based on a preset threshold.

[0073] Various changes and modifications can be made without departing from the spirit and scope of the present invention, and all equivalent technical solutions also fall within the scope of the present invention.

[0074] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referenced to each other.

[0075] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, apparatus, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0076] The present invention is described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device produce a device for implementing the functions specified in one or more processes in the flowcharts and / or one or more blocks in the block diagrams.

[0077] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0078] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce computer-implemented processing, so that the instructions executed on the computer or other programmable terminal device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0079] It should be noted that:

[0080] References in this specification to "one embodiment" or "an embodiment" mean that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the present invention. Therefore, appearances of the phrases "one embodiment" or "an embodiment" in various places throughout this specification do not necessarily refer to the same embodiment.

[0081] The above description of the embodiments is intended to facilitate understanding and application of the present invention by those skilled in the art. It will be apparent that those skilled in the art can readily make various modifications to the above embodiments and apply the general principles described herein to other embodiments without requiring inventive effort. Therefore, the present invention is not limited to the above embodiments, and improvements and modifications made by those skilled in the art based on the disclosure of the present invention should fall within the scope of protection of the present invention.

Claims

1. A cross-chain abnormal transaction detection method based on graph random neural network, characterized in that: The steps include: Build cross-chain partitions of the cross-chain network and configure cross-chain routing between every two cross-chain partitions; Based on cross-chain partitioning and cross-chain routing, the transaction data of users in the cross-chain network is collected and constructed into a graph. The nodes in the graph represent transactions in the blockchain. Any node represents a transaction in the cross-chain network. The node also contains the node's feature information. The edge in the graph represents the flow of funds between transactions. The relationship between the nodes in the graph is stored in an adjacency matrix, and the feature information of the nodes is stored in a feature matrix. Based on the feature matrix, label the nodes in the graph and obtain the original label of each node; Construct a graph random neural network pre-training model, including random propagation of graph data enhancement, two-layer perceptron classification and collaborative training, input the adjacency matrix and feature matrix as training data into the graph random neural network pre-training model for training, and obtain a graph random neural network model; The blockchain transaction data to be tested is converted into graph data and input into the graph random neural network model. The predicted probability of each node in the graph is output, and the preset threshold is used to determine whether the node is an abnormal node. If the predicted probability of the node is higher than the preset threshold, the node is an abnormal node, otherwise it is a normal node. The abnormal node represents an abnormal transaction in the cross-chain network.

2. The cross-chain abnormal transaction detection method based on graph random neural network according to claim 1 is characterized in that: The construction of cross-chain partitions of the cross-chain network and configuration of cross-chain routing between every two cross-chain partitions includes the following steps: The blockchains in the cross-chain network are classified according to the transaction type to obtain cross-chain partitions. Among them, the blockchains including settlement, repayment, and lending are divided into payment partitions; the blockchains including evidence storage and evidence collection are divided into storage partitions. Certificate partitioning; dividing the blockchain including message passing and information transmission into communication partitions; A cross-chain route is configured between cross-chain partitions to realize information transmission. The cross-chain route includes a routing information management module, a communication processor and a distributor. The routing information management module is used to store dynamic routing tables; the communication processor and the distributor are used to parse communication data packets between blockchains and between nodes.

3. The cross-chain abnormal transaction detection method based on graph random neural network according to claim 1 is characterized in that: The construction of the adjacency matrix and feature matrix of the graph based on cross-chain partitioning and cross-chain routing includes the following steps: Collect transaction data of nodes in the cross-chain network, where the transaction data at least includes the flow of funds between transactions, the number of cross-chain transactions initiated within a preset period, the number of transaction objects, the total transaction amount, the number of cross-chain transaction timeouts and defaults, the number of penalties or reports, and the number of key input errors; The transaction data is constructed as a graph, and the adjacency matrix is ​​constructed using the capital flow between transactions. The number of cross-chain transactions initiated within a preset period, the number of transaction objects, the total transaction amount, the number of cross-chain transaction timeouts and defaults, the number of penalties or reports, and the number of key input errors are used to construct a feature matrix. In the cross-chain partition, the cross-chain network transaction data is constructed as a partition subgraph, and the partition subgraph is stored using a partition adjacency matrix and a partition feature matrix. In the cross-chain routing, the data is constructed as a routing subgraph, and the routing subgraph is stored using a routing adjacency matrix and a routing feature matrix.

4. The cross-chain abnormal transaction detection method based on graph random neural network according to claim 3 is characterized in that: The process of labeling nodes in the graph based on the feature matrix and obtaining the original label of each node includes the following steps: Thresholds are set for the number of cross-chain transactions initiated within a preset period, the number of transaction objects, and the total transaction amount. If the feature value corresponding to a node exceeds various preset thresholds, the node is considered an abnormal node and is marked with a label value of 1. Set thresholds for the number of cross-chain transaction timeouts and defaults, the number of penalties or reports, and the number of key input errors within a certain period of time. If the feature value corresponding to a node exceeds the set threshold, it means that it must be an abnormal node and is marked with a label value of 2. If the node is not marked as 1 or 2, it means it is a normal node and is marked with a label value of 0. The original label of each node is obtained through the above node marking labels.

5. The cross-chain abnormal transaction detection method based on graph random neural network according to claim 1 is characterized in that: The random propagation of graph data enhancement includes: Based on the feature matrix, a binary mask is randomly sampled for each node, and the feature vector of each node is multiplied by the mask corresponding to the feature vector to obtain the perturbed feature matrix; The enhanced feature matrix is ​​obtained by iteratively calculating the product of the mean value matrix of the power series of the symmetric normalized adjacency matrix from order 0 to order K and the perturbation feature matrix.

6. The cross-chain abnormal transaction detection method based on graph random neural network according to claim 5 is characterized in that: The method also includes the following steps: after the random propagation of graph data enhancement is performed S times, S enhanced feature matrices are generated, and the enhanced feature matrices are input into the two-layer perceptron to obtain the node prediction output.

7. The cross-chain abnormal transaction detection method based on graph random neural network according to claim 6 is characterized in that: The collaborative training comprises the following steps: Calculate the cross entropy loss between the node prediction output and the original label to obtain the supervision loss; The random propagation of graph data enhancement is performed S times, S node prediction outputs are obtained through a two-layer perceptron, and the consistency regularization loss is obtained by minimizing the square distance between two node prediction outputs; The graph random neural network pre-training model is trained jointly by supervision loss and consistency regularization loss to obtain a graph random neural network model.

8. A cross-chain abnormal transaction detection system based on graph random neural network, characterized in that: Including cross-chain partition module, preprocessing module, model training module and classification judgment module: The cross-chain partition module is used to build cross-chain partitions of the cross-chain network and configure cross-chain routing between every two cross-chain partitions; The preprocessing module is used to construct the transaction data of users in the cross-chain network into a graph, the adjacency matrix stores the node relationships in the graph, the feature matrix stores the features of the nodes, and labels each node; The model training module includes random propagation of graph data enhancement, two-layer perceptron classification and collaborative training, and inputs the adjacency matrix and the feature matrix as training data into the model training module for training to obtain a graph random neural network model; The classification judgment module is used to convert the blockchain transaction data to be tested into graph data and input it into the graph random neural network model, output the predicted probability of each node in the graph, and judge whether the node is an abnormal node through a preset threshold.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

10. A cross-chain abnormal transaction detection device based on a graph random neural network, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Deep neural network-based cross-chain transaction anomaly detection and early warning method and system

    CN112288566A

  • Method for detecting and supervising abnormal transaction nodes in block chain

    CN113723954A

  • Block chain abnormal node identification method based on dynamic graph convolutional neural network

    CN114240659A

  • Block chain transaction behavior-oriented anomaly detection method

    CN114862588A

  • Data-driven block chain anomaly detection method and terminal

    CN116361734A

Cited By

  • Reentry attack detection system and method based on time sequence transaction aggregation graph network

    CN120956495A