Transaction address classification method, device, terminal device and storage medium

By constructing a directed graph of transaction records and generating structural similarity data of nodes, combined with features such as transaction command type, token type, and time density, a graph neural network model is trained to solve the problem of low transaction address classification accuracy in existing technologies and achieve higher classification accuracy.

CN116226731BActive Publication Date: 2025-09-16GUANGZHOU UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211682766.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-27
Publication Date
2025-09-16
Estimated Expiration
2042-12-27

AI Technical Summary

Technical Problem

The existing transaction address classification methods are not very accurate, especially when generating feature value embedding, the parameter selection and processing are not optimized enough, and the multi-hop neighbor information is not considered, resulting in insufficient accuracy of address classification.

Method used

A graph neural network model is used to construct a directed graph of transaction records to generate node structural similarity data, in-degree and out-degree, transaction amount and other features. Combined with the transaction command type, token type and time density, a feature matrix is ​​constructed, and the graph neural network model is trained to improve the model's learning and recognition capabilities.

Benefits of technology

The accuracy of transaction address classification has been improved, which can better identify the structural similarity characteristics of different address nodes and enhance the learning accuracy of the transaction address classification model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116226731B_ABST
    Figure CN116226731B_ABST
Patent Text Reader

Abstract

The present invention discloses a transaction address classification method, apparatus, terminal device, and storage medium. The method comprises: obtaining a first transaction record data set of a transaction address to be classified and constructing a first transaction record directed graph; generating first structural similarity data of nodes, first in-degree and out-degree of nodes, and first transaction amounts of nodes based on the first transaction record directed graph, and then generating an embedding matrix of the first transaction record directed graph; constructing a first feature matrix based on the first transaction record data set; inputting the embedding matrix and first feature matrix of the first transaction record directed graph into a preset transaction address classification model, so that the transaction address classification model classifies the transaction address to be classified and generates a transaction address classification result. The present invention solves the problem that the existing transaction address classification method has low accuracy when performing address classification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of electronics and information, and in particular to a method, apparatus, terminal device, and storage medium for classifying transaction addresses. Background Art

[0002] The wallet address in the blockchain is one of the most crucial pieces of information in the transaction process. Any user can freely generate countless addresses. As long as they hold the private key, they can freely construct and initiate blockchain transactions. While this process can be accessed through public blockchain data, it only reveals transactions between addresses, preventing further information from being revealed. This is the anonymity of the blockchain.

[0003] Address tagging is a technology developed to address this problem to some extent. Simply put, an address tag is a collection of all the attributes of an address. This tagging can reduce the anonymity of the blockchain and improve the identification of transaction features. Many blockchain products on the market rely on the accurate classification of address tags. For example, if an address is labeled as a malicious address, it can provide users with a reference to guide their transaction behavior and minimize risks. Among current address classification methods, the most accurate ones use graph embedding and graph neural network models for address identification. However, this method's parameter selection and processing when generating feature embeddings could be improved. Furthermore, while it considers the address's neighboring nodes, it does not account for multi-hop neighbors, meaning it does not incorporate information aggregation from nodes. This results in low address classification accuracy. Therefore, a transaction address classification method that overcomes these shortcomings is urgently needed to improve the accuracy of transaction address classification. Summary of the Invention

[0004] The present invention provides a transaction address classification method, apparatus, terminal device and storage medium to solve the problem that the existing transaction address classification method has low accuracy when performing address classification.

[0005] In order to solve the above technical problems, an embodiment of the present invention provides a method for classifying transaction addresses, comprising the following steps:

[0006] Obtain a first transaction record data set of a transaction address to be classified, and construct a first transaction record directed graph using address information in the first transaction record data set as nodes and transaction record information as directed edges;

[0007] Generate first structural similarity data of nodes, first in-degree and out-degree of nodes, and first transaction amount of nodes according to the first transaction record directed graph;

[0008] Generate an embedding matrix of a first transaction record directed graph according to the first structural similarity data of the node, the first in-degree and out-degree of the node, and the first transaction amount of the node;

[0009] Obtaining a first command type of the transaction, a first token type of the transaction, and a first funds flow address of the node according to the first transaction record dataset, calculating a first time density of the transaction, and then constructing a first feature matrix according to the first command type of the transaction, the first token type of the transaction, the first funds flow address of the node, and the first time density of the transaction;

[0010] The embedding matrix and the first feature matrix of the first transaction record directed graph are input into a preset transaction address classification model, so that the transaction address classification model classifies the transaction address to be classified and generates a transaction address classification result.

[0011] As a preferred solution, the generation of the preset transaction address classification model includes:

[0012] Obtain a second transaction record dataset of transaction addresses with known classifications, and construct a second transaction record directed graph using address information in the second transaction record dataset as nodes and transaction record information as directed edges;

[0013] Generate second structural similarity data of the node, second in-degree and out-degree of the node, and second transaction amount of the node according to the second transaction record directed graph;

[0014] Generate an embedding matrix of a second transaction record directed graph according to the second structural similarity data of the node, the second in-degree and out-degree of the node, and the second transaction amount of the node;

[0015] Obtaining a second command type of the transaction, a second token type of the transaction, and a second funds flow address of the node according to the second transaction record dataset, calculating a second time density of the transaction, and then constructing a second feature matrix according to the second command type of the transaction, the second token type of the transaction, the second funds flow address of the node, and the second time density of the transaction;

[0016] A graph neural network model is trained with the embedding matrix and the second feature matrix of the second transaction record directed graph as input and the transaction address classification result as output, and the transaction address classification model is generated after the training is completed.

[0017] As a preferred solution, when training the graph neural network model, each convolutional layer of the graph neural network model is calculated according to the following formula, and the calculation results of each convolutional layer are nonlinearly transformed through a nonlinear activation function to obtain the output of the corresponding convolutional layer:

[0018]

[0019] Among them, σ() is a nonlinear activation function, T is the command type set of the transaction, t is the element of the command type set of the transaction, E is the token type set of the transaction, e is the element of the token type set of the transaction, F is the node's capital flow address set, f is the element of the node's capital flow address set, is the time density matrix of the transaction, D tef is the degree matrix, the diagonal elements of which are the total degrees of a certain type of transactions of the corresponding node, A tef is an adjacency matrix, each element of which is the number of transaction records of a certain type between nodes in the directed graph of transaction records. (l) is the output matrix of the l-th layer neural network, where the input of the first layer graph neural network is the embedding matrix of the second transaction record data graph, is the weight matrix of the l-th layer graph neural network, is the offset matrix of the l-th layer graph neural network.

[0020] As a preferred solution, when training the graph neural network model, the cross entropy method is used to calculate the recognition bias of the graph neural network model, and the parameters of the weight matrix of the l-th layer graph neural network and the offset matrix of the l-th layer graph neural network are updated based on the recognition bias of the graph neural network model.

[0021] As a preferred solution, the step of generating first structural similarity data of nodes based on the directed graph of the first transaction record includes:

[0022] The struc2vec method is used to aggregate neighbor node information according to the first transaction record directed graph to generate first structural similarity data of the nodes.

[0023] As a preferred solution, the calculating the first time density of transactions based on the first transaction record dataset includes:

[0024] A first block height of the transaction is obtained according to the first transaction record data set, and a variance of the first block height of the transaction is used as a first time density of the transaction.

[0025] Based on the above embodiment, another embodiment of the present invention provides a transaction address classification device, the device comprising: a first transaction record directed graph construction module, an embedding matrix eigenvalue generation module, an embedding matrix generation module for the first transaction record directed graph, a first eigenmatrix construction module, and a transaction address classification module;

[0026] The first transaction record directed graph construction module is configured to obtain a first transaction record dataset of a transaction address to be classified, construct a first transaction record directed graph using the address information in the first transaction record dataset as nodes and the transaction record information as directed edges, and transmit the constructed first transaction record directed graph to the embedding matrix eigenvalue generation module;

[0027] The embedding matrix eigenvalue generation module is used to generate the first structural similarity data of the node, the first out-degree and in-degree of the node, and the first transaction amount of the node according to the first transaction record directed graph, and transmit the generated first structural similarity data of the node, the first out-degree and in-degree of the node, and the first transaction amount of the node to the embedding matrix generation module of the first transaction record directed graph;

[0028] The embedding matrix generating module of the first transaction record directed graph is configured to generate an embedding matrix of the first transaction record directed graph based on the first structural similarity data of the node, the first in-degree and out-degree of the node, and the first transaction amount of the node, and transmit the generated embedding matrix of the first transaction record directed graph to the transaction address classification module;

[0029] The first feature matrix construction module is configured to obtain, based on the first transaction record dataset, a first command type of the transaction, a first token type of the transaction, and a first funds flow address of the node, and calculate a first time density of the transaction; then, construct a first feature matrix based on the first command type of the transaction, the first token type of the transaction, the first funds flow address of the node, and the first time density of the transaction; and transmit the constructed first feature matrix to the transaction address classification module;

[0030] The transaction address classification module is used to input the embedding matrix and the first feature matrix of the first transaction record directed graph into a preset transaction address classification model, so that the transaction address classification model classifies the transaction addresses to be classified and generates a transaction address classification result.

[0031] Based on the above embodiments, another embodiment of the present invention provides a terminal device for classifying transaction addresses, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, the transaction address classification method described in the above embodiment of the invention is implemented.

[0032] Based on the above embodiments, another embodiment of the present invention provides a storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the transaction address classification method described in the above embodiment of the invention.

[0033] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0034] Compared to the prior art, the present invention adds new features such as the transaction command type, transaction token type, and node capital flow address to the model when training the graph neural network model. Based on these features, a more refined graph neural network model convolution operation is performed, and the time density of the transaction is integrated into the convolution operation. These improvements can enhance the model's learning ability and better complete the task of classifying transaction nodes. The summary of transaction nodes and transaction characteristics can better represent the relevant information of transaction addresses, enhance the accuracy of transaction address classification model learning based on the characteristics of different types of addresses, and improve the accuracy of transaction address classification model in transaction address classification. Furthermore, structural similarity data of nodes is generated based on the directed graph of transaction records. The structural similarity data of nodes aggregates information about the node's adjacent neighbors and multi-hop neighbors, expanding the dimension and content of the embedding matrix, thereby improving the model's recognition ability, better identifying the structural similarity characteristics of nodes with different addresses, and further improving the accuracy of transaction address classification. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 This is a flow chart of a method for classifying transaction addresses provided by one embodiment of the present invention;

[0036] Figure 2 Schematic diagram of the structure of the convolutional layer of the graph neural network model of the present invention;

[0037] Figure 3 This is a schematic structural diagram of a transaction address classification device provided by one embodiment of the present invention;

[0038] Figure 4 It is a structural diagram of a terminal device for classifying transaction addresses provided by one embodiment of the present invention. DETAILED DESCRIPTION

[0039] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0040] Example 1

[0041] Please refer to Figure 1 , is a flow chart of a method for classifying transaction addresses provided by an embodiment of the present invention, the method comprising the following steps:

[0042] S1. Obtain a first transaction record dataset of a transaction address to be classified, and construct a first transaction record directed graph using address information in the first transaction record dataset as nodes and transaction record information as directed edges;

[0043] First, an address dataset of transaction addresses to be classified is obtained. Each element in this address dataset is stored in the form of transaction records, which is also known as the first transaction record dataset. The main table items of each transaction record in the first transaction record dataset include: the transaction initiating node, the transaction receiving node, the transaction amount, the transaction initiating node label, the transaction receiving node label, the transaction command type, and the transaction token type. Then, based on the first transaction record dataset, a first transaction record directed graph is constructed, using the address information in the first transaction record dataset as nodes and the transaction record information as directed edges. The first transaction record dataset is abstracted into the first transaction record directed graph with a graph structure.

[0044] S2. Generate first structural similarity data of nodes, first in-degree and out-degree of nodes, and first transaction amount of nodes according to the first transaction record directed graph;

[0045] Preferably, generating the first structural similarity data of the node according to the first transaction record directed graph includes: using the struc2vec method to aggregate neighbor node information according to the first transaction record directed graph to generate the first structural similarity data of the node.

[0046] The present invention uses the struc2vec method to represent the structural similarity of address nodes. The first transaction record directed graph of the transaction address to be classified aggregates neighboring nodes to generate the first structural similarity data of the node. That is, the captured information is aggregated using the struc2vec method to calculate the similarity of the graph structure at different hops from the node, thereby obtaining a data representation of the similarity of each address node. This method learns the structure of the first transaction record directed graph surrounding the address node, obtains the structural features of the address node, and completes the identification of the similarity of the graph structure surrounding the address node. The structural similarity data of the nodes is then used to express the graph structural similarity between the nodes.

[0047] S3. Generate an embedding matrix of the first transaction record directed graph based on the first structural similarity data of the node, the first in-degree and out-degree of the node, and the first transaction amount of the node;

[0048] After constructing the first transaction record directed graph, the present invention needs to embed the graph structure. The so-called embedding is to map the graph structure to a data structure that is convenient for the graph neural network model to perform calculations. For example, in the machine learning of image recognition, the image naturally has the element of pixels, so it can be directly regarded as a matrix. The nodes and edges in the graph structure do not have absolute positional expressions. Therefore, we need to preprocess the first transaction record directed graph and map the graph information to data structures such as vectors or matrices. This forms a data type that is convenient for the graph neural network model to operate, so that the graph neural network model can learn the features in the first transaction record directed graph. The present invention combines the structural similarity data of the nodes generated above with the in-degree and out-degree of the nodes and the transaction amount of the nodes to form the embedding matrix of the first transaction record directed graph, and maps the graph information to the data structure of the matrix.

[0049] S4. Obtaining, based on the first transaction record dataset, a first command type of the transaction, a first token type of the transaction, and a first funds flow address of the node, and calculating a first time density of the transaction; and then constructing a first feature matrix based on the first command type of the transaction, the first token type of the transaction, the first funds flow address of the node, and the first time density of the transaction;

[0050] Preferably, calculating the first time density of the transaction based on the first transaction record data set includes: obtaining the first block height of the transaction based on the first transaction record data set, and using the variance of the first block height of the transaction as the first time density of the transaction.

[0051] In terms of the first feature matrix, the present invention has expanded the three categories of transaction command type (including call, create, reward, represented by T), transaction token type (including eth, ERC20, ERC720, represented by E), and node capital flow address (exchange, mixed currency product, Dex, etc., represented by F) based on the first transaction record data set. These categories also each contain three sub-categories. Based on this division method, the present invention performs 27 category refinements in the calculation of the first feature matrix below. In the calculation of each category, the new feature of the first time density of the transaction (obtained by calculating the variance of the first block height of the transaction record) is used as a constituent element of the first feature matrix, thereby achieving more refined learning of the directed graph features of the first transaction record.

[0052] S5. Input the embedding matrix and the first feature matrix of the first transaction record directed graph into a preset transaction address classification model, so that the transaction address classification model classifies the transaction addresses to be classified and generates a transaction address classification result.

[0053] Preferably, the generation of the preset transaction address classification model includes: obtaining a second transaction record data set of a transaction address of known classification, using the address information in the second transaction record data set as nodes and the transaction record information as directed edges to construct a second transaction record directed graph; generating the second structural similarity data of the node, the second out-degree and in-degree of the node, and the second transaction amount of the node according to the second transaction record directed graph; generating an embedding matrix of the second transaction record directed graph according to the second structural similarity data of the node, the second out-degree and in-degree of the node, and the second transaction amount of the node; obtaining the second command type of the transaction, the second token type of the transaction, and the second funds flow address of the node according to the second transaction record data set, and calculating the second time density of the transaction, and then constructing a second feature matrix according to the second command type of the transaction, the second token type of the transaction, the second funds flow address of the node, and the second time density of the transaction; using the embedding matrix and the second feature matrix of the second transaction record directed graph as input and the transaction address classification result as output to train a graph neural network model, and generating the transaction address classification model after the training is completed.

[0054] It should be noted that the transaction address classification method described in the present invention is applicable to multiple trading platforms such as blockchain, including but not limited to blockchain, Binance, Huobi, and other trading platforms, and transaction addresses can be classified for each of these trading platforms. To better illustrate the transaction address classification method of the present invention, the following detailed description of the above transaction address classification method is provided using the Ethereum address classification method as an example.

[0055] Because the graph neural network model of the present invention uses a semi-supervised learning approach, the present invention first obtains Ethereum addresses of known classification from an address library as a training set and a validation set. The dataset is stored as an entry in the form of transaction records. Specifically, a second transaction record dataset of Ethereum addresses of known classification is obtained. This second transaction record dataset is then divided into subsets based on the known classification of address nodes and applied to the model, for example, 80% for training, 10% for validation, and 10% for prediction. The second transaction record dataset of the present invention is obtained by downloading it from an Ethereum browser, utilizing a second transaction record dataset of pre-labeled public addresses. Of course, other methods can also be used, including but not limited to manually labeling the raw transaction record dataset after obtaining it through a crawler. The obtained second transaction record dataset is then abstracted into a second directed graph of transaction records with a graph structure. This allows the construction of an embedding matrix and a second feature matrix for the second transaction record data graph, which form the input of the graph neural network model. The graph neural network model is then trained using the Ethereum address classification results as output, ultimately completing the address classification task and completing model training to generate the Ethereum address classification model.

[0056] Preferably, when training the graph neural network model, each convolutional layer of the graph neural network model is calculated according to the following formula, and the calculation results of each convolutional layer are nonlinearly transformed through a nonlinear activation function to obtain the output of the corresponding convolutional layer:

[0057]

[0058] Among them, σ() is a nonlinear activation function, T is the command type set of the transaction, t is the element of the command type set of the transaction, E is the token type set of the transaction, e is the element of the token type set of the transaction, F is the node's capital flow address set, f is the element of the node's capital flow address set, is the time density matrix of the transaction, D tef is the degree matrix, the diagonal elements of which are the total degrees of a certain type of transactions of the corresponding node, A tef is an adjacency matrix, each element of which is the number of transaction records of a certain type between nodes in the directed graph of transaction records. (l) is the output matrix of the l-th layer neural network, where the input of the first layer graph neural network is the embedding matrix of the second transaction record data graph, is the weight matrix of the l-th layer graph neural network, is the offset matrix of the l-th layer graph neural network.

[0059] The graph neural network model of the present invention adopts a hierarchical structure. Therefore, during the model training process of the present invention, the calculation of each layer of the graph neural network model can be regarded as the operation of an equation. We divide all transactions into 27 categories for calculation. The following takes the calculation process of one category as an example to illustrate the specific model training process of the graph neural network model. In the graph neural network model of the present invention, there are five matrices that we need to calculate: one is the time density matrix of transactions, represented by Td, which contains the numerical representation of the time density of historical transactions belonging to a certain category of each address node; the second is the degree matrix, represented by D, which is a diagonal matrix. The diagonal elements of the degree matrix are the total degrees of a certain type of transactions of the corresponding node (including the out-degree and in-degree of the node), and the values ​​of other elements are all 0. After generating the degree matrix, the reciprocal operation is performed on each element, which ensures that a normalized effect is achieved after the multiplication of the degree matrix and the adjacency matrix. The matrix after taking the reciprocal can be expressed as D^(-1); the third is the adjacency matrix, represented by A, and each element of the adjacency matrix is ​​the number of a certain type of transaction records between nodes in the above-mentioned transaction record directed graph; the fourth is the output matrix of the l-th layer neural network, and the input of the l-th layer neural network is the embedding matrix of the second transaction record data graph, represented by H^(l); the fifth is the weight matrix of the l-th layer neural network, represented by W^(l); and the sixth is the offset matrix, represented by B. The calculation of each convolutional layer of the graph neural network model is as follows:

[0060]

[0061] It should be noted that the time density matrix of the transaction is a point-by-point multiplication operation with the matrix that follows it. Regarding point-by-point multiplication, assuming that both A and B are n*n matrices, and the result matrix of point-by-point multiplication is E, then E ij =A ij *B ij , where "*" represents point-by-point multiplication. In summary, the operations within the convolutional layer can be viewed as multiplying the acquired transaction's time density matrix, feature matrix, adjacency matrix, and weight matrix W, and then adding the offset. The computational results of each convolutional layer of the graph neural network model are transformed nonlinearly using the ReLU method via a nonlinear activation function, and the result of the nonlinear transformation is used as the output of the corresponding convolutional layer. The computational results of all convolutional layers of the graph neural network model are nonlinearly transformed and output to obtain the Ethereum address classification results, completing a model training cycle.

[0062] To better illustrate the model training process of the present invention, a GCN network with two convolutional layers is used as an example for model training. Figure 2, which is a structural diagram of the convolutional layer of the graph neural network model of the present invention. The initial state of each convolutional layer of the graph neural network model contains: first, an adjacency matrix, in which the element value is the number of directed edges between a pair of nodes in the directed graph of transaction records; second, an embedding matrix of the transaction record data graph, in which each column is an embedding vector of a node, and the embedding vector covers the out-degree and in-degree of the node, the transaction amount weight of the out-degree and in-degree, and the structural similarity data of the node generated by the struc2vec method (the aggregation threshold of the node information is set, which is reflected in the manually designed number of hops, such as three hops or five hops); third, a time density matrix of transactions, in which each element of the time density matrix of transactions is the variance of a certain type of transaction calculated by the block height of the transaction. The classification of the time density matrix of transactions adopts a combination of the following three transaction characteristics: first, the different message types of a certain node, that is, the command type of the transaction (a total of three categories: call, create, and reward); second, the token characteristics, that is, the type of token traded (this model selects Ethereum, ERC20, and ERC720); third, the transaction flow, that is, the node's fund flow address (this model selects exchanges, mixing addresses, and Dex). Therefore, this model needs to perform 27 independent matrix multiplications in each layer of operation. If there are 100 address nodes to be classified, the design of the 6 matrices that need to be calculated can be as follows: In the first layer of the graph neural network, the dimension of the Td matrix is ​​100*100, and each element is the time density of the transaction under the corresponding category; the D matrix and the A matrix also have a dimension of 100*100. First, take the reciprocal of each item of D, then perform matrix multiplication with the A matrix, and then multiply it point by point with Td; the H matrix of the first layer is the embedding matrix of the initial transaction record directed graph, which is a 100*5 matrix; W can be set to a 5*20 matrix, and then a 100*20 matrix will be generated after the calculation is completed. This is also the dimension of the B matrix to be set. The initial values ​​of W and B are randomly generated. After constructing the equation and performing the calculation, the ReLU method is used for nonlinear transformation to generate the input matrix of the second layer. The matrices that need to be set in the second layer include W and B. Because the calculation is a 4-classification problem, the dimension of W is designed to be 20*4 and B is 100*4. This completes one model training.

[0063] Preferably, when training the graph neural network model, the cross entropy method is used to calculate the recognition bias of the graph neural network model, and the parameters of the weight matrix of the l-th layer graph neural network and the offset matrix of the l-th layer graph neural network are updated according to the recognition bias of the graph neural network model.

[0064] When training the graph neural network model, the cross-entropy method is used to calculate the loss, that is, the deviation of the model in recognition. Then, the Adam optimizer is used to update the parameters of the weight matrix and offset matrix of the l-th layer graph neural network to improve the classification and recognition accuracy of the model. The model completes learning during multiple rounds of training and finally generates the Ethereum address classification model.

[0065] As can be seen from the above, the present invention provides a method for classifying transaction addresses. When training a graph neural network model, this method adds new features such as the transaction command type, the transaction token type, and the node's capital flow address to the model, and integrates the feature of the transaction time density in the convolution operation, thereby improving the learning ability of the model; it also generates structural similarity data of the nodes based on the directed graph of transaction records, wherein the structural similarity data of the nodes aggregates the information of the node's adjacent neighbors and multi-hop neighbors, further improving the recognition ability of the model and improving the accuracy of the model in classifying transaction addresses.

[0066] Example 2

[0067] Please refer to Figure 3 , is a schematic diagram of the structure of a transaction address classification device provided by an embodiment of the present invention, the device comprising: a first transaction record directed graph construction module, an embedding matrix eigenvalue generation module, an embedding matrix generation module for the first transaction record directed graph, a first eigenmatrix construction module, and a transaction address classification module;

[0068] The first transaction record directed graph construction module is configured to obtain a first transaction record dataset of a transaction address to be classified, construct a first transaction record directed graph using the address information in the first transaction record dataset as nodes and the transaction record information as directed edges, and transmit the constructed first transaction record directed graph to the embedding matrix eigenvalue generation module;

[0069] The embedding matrix eigenvalue generation module is used to generate the first structural similarity data of the node, the first out-degree and in-degree of the node, and the first transaction amount of the node according to the first transaction record directed graph, and transmit the generated first structural similarity data of the node, the first out-degree and in-degree of the node, and the first transaction amount of the node to the embedding matrix generation module of the first transaction record directed graph;

[0070] The embedding matrix generating module of the first transaction record directed graph is configured to generate an embedding matrix of the first transaction record directed graph based on the first structural similarity data of the node, the first in-degree and out-degree of the node, and the first transaction amount of the node, and transmit the generated embedding matrix of the first transaction record directed graph to the transaction address classification module;

[0071] The first feature matrix construction module is configured to obtain, based on the first transaction record dataset, a first command type of the transaction, a first token type of the transaction, and a first funds flow address of the node, and calculate a first time density of the transaction; then, construct a first feature matrix based on the first command type of the transaction, the first token type of the transaction, the first funds flow address of the node, and the first time density of the transaction; and transmit the constructed first feature matrix to the transaction address classification module;

[0072] The transaction address classification module is used to input the embedding matrix and the first feature matrix of the first transaction record directed graph into a preset transaction address classification model, so that the transaction address classification model classifies the transaction addresses to be classified and generates a transaction address classification result.

[0073] Example 3

[0074] Please refer to Figure 4 , which is a structural diagram of a terminal device for classifying transaction addresses provided in an embodiment of the present invention. The terminal device includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, the transaction address classification method described in the above-mentioned embodiment of the invention is implemented.

[0075] Example 4

[0076] Accordingly, an embodiment of the present invention provides a storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the transaction address classification method described in the above embodiment of the invention.

[0077] In summary, the present invention provides a classification device, terminal device and storage medium for transaction addresses. When training the graph neural network model, new features such as the transaction command type, the transaction token type, the node's capital flow address and the transaction time density are added to the model. The structural similarity data of the nodes is also generated based on the directed graph of transaction records. The structural similarity data of the nodes aggregates the information of the node's adjacent neighbors and multi-hop neighbors, thereby improving the learning and recognition capabilities of the model and improving the accuracy of the model's transaction address classification.

[0078] It should be noted that the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed across multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment. In addition, in the drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines. A person of ordinary skill in the art can understand and implement the present invention without inventive effort.

[0079] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0080] The terminal device may be a computing device such as a desktop computer, a notebook computer, a PDA, a cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.

[0081] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the terminal device, connecting various parts of the entire terminal device using various interfaces and lines.

[0082] The memory can be used to store the computer program, and the processor realizes various functions of the terminal device by running or executing the computer program stored in the memory and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function, etc.; the data storage area can store data created based on the use of the mobile phone, etc. In addition, the memory can include a high-speed random access memory and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage device.

[0083] The storage medium is a computer-readable storage medium, and the computer program is stored in the computer-readable storage medium. When the computer program is executed by the processor, it can implement the steps of the above-mentioned various method embodiments. The computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device that can carry the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0084] The specific embodiments described above further illustrate the objectives, technical solutions, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included within the scope of protection of the present invention for those skilled in the art.

Claims

1. A method for classifying transaction addresses, characterized in that: The steps include: Obtain a first transaction record data set of a transaction address to be classified, and construct a first transaction record directed graph using address information in the first transaction record data set as nodes and transaction record information as directed edges; Adopting the struc2vec method, aggregating neighbor node information according to the first transaction record directed graph, and generating first structural similarity data of the node, first in-degree and out-degree of the node, and first transaction amount of the node; Generate an embedding matrix of a first transaction record directed graph according to the first structural similarity data of the node, the first in-degree and out-degree of the node, and the first transaction amount of the node; Obtaining a first command type of the transaction, a first token type of the transaction, and a first funds flow address of the node according to the first transaction record dataset, calculating a first time density of the transaction, and then constructing a first feature matrix according to the first command type of the transaction, the first token type of the transaction, the first funds flow address of the node, and the first time density of the transaction; Inputting the embedding matrix and the first feature matrix of the first transaction record directed graph into a preset transaction address classification model, so that the transaction address classification model classifies the transaction address to be classified and generates a transaction address classification result; Wherein, the transaction address classification model is a graph neural network model; When training the graph neural network model, each convolutional layer of the graph neural network model is calculated according to the following formula, and the calculation results of each convolutional layer are nonlinearly transformed through a nonlinear activation function to obtain the output of the corresponding convolutional layer: ; Among them, σ() is a nonlinear activation function, T is the command type set of the transaction, t is the element of the command type set of the transaction, E is the token type set of the transaction, e is the element of the token type set of the transaction, F is the node's capital flow address set, f is the element of the node's capital flow address set, is the time density matrix of the transaction, is a degree matrix, the diagonal elements of which are the total degrees of a certain type of transactions of the corresponding node. is an adjacency matrix, each element of which is the number of transaction records of a certain type between nodes in the directed graph of transaction records. is the output matrix of the l-th layer neural network, where the input of the first layer graph neural network is the embedding matrix of the second transaction record dataset with known transaction address classification, is the weight matrix of the l-th layer graph neural network, is the offset matrix of the l-th layer graph neural network.

2. The method for classifying transaction addresses according to claim 1, wherein: The generation of the preset transaction address classification model includes: Obtain a second transaction record dataset of transaction addresses with known classifications, and construct a second transaction record directed graph using address information in the second transaction record dataset as nodes and transaction record information as directed edges; Generate second structural similarity data of the node, second in-degree and out-degree of the node, and second transaction amount of the node according to the second transaction record directed graph; Generate an embedding matrix of a second transaction record directed graph according to the second structural similarity data of the node, the second in-degree and out-degree of the node, and the second transaction amount of the node; Obtaining a second command type of the transaction, a second token type of the transaction, and a second funds flow address of the node according to the second transaction record dataset, calculating a second time density of the transaction, and then constructing a second feature matrix according to the second command type of the transaction, the second token type of the transaction, the second funds flow address of the node, and the second time density of the transaction; A graph neural network model is trained with the embedding matrix and the second feature matrix of the second transaction record directed graph as input and the transaction address classification result as output, and the transaction address classification model is generated after the training is completed.

3. The method for classifying transaction addresses according to claim 2, wherein: When training the graph neural network model, the cross entropy method is used to calculate the recognition bias of the graph neural network model, and the parameters of the weight matrix of the l-th layer graph neural network and the offset matrix of the l-th layer graph neural network are updated according to the recognition bias of the graph neural network model.

4. The method for classifying transaction addresses according to claim 1, wherein: Calculating a first time density of transactions based on the first transaction record dataset includes: A first block height of the transaction is obtained according to the first transaction record data set, and a variance of the first block height of the transaction is used as a first time density of the transaction.

5. A device for classifying transaction addresses, characterized in that: include: A first transaction record directed graph construction module, an embedding matrix eigenvalue generation module, an embedding matrix generation module for the first transaction record directed graph, a first eigenmatrix construction module, and a transaction address classification module; The first transaction record directed graph construction module is configured to obtain a first transaction record dataset of a transaction address to be classified, construct a first transaction record directed graph using the address information in the first transaction record dataset as nodes and the transaction record information as directed edges, and transmit the constructed first transaction record directed graph to the embedding matrix eigenvalue generation module; The embedding matrix eigenvalue generation module is used to use the struc2vec method to aggregate neighbor node information according to the first transaction record directed graph, generate first structural similarity data of the node, first out-degree and in-degree of the node, and first transaction amount of the node, and transmit the generated first structural similarity data of the node, first out-degree and in-degree of the node, and first transaction amount of the node to the embedding matrix generation module of the first transaction record directed graph; The embedding matrix generating module of the first transaction record directed graph is configured to generate an embedding matrix of the first transaction record directed graph based on the first structural similarity data of the node, the first in-degree and out-degree of the node, and the first transaction amount of the node, and transmit the generated embedding matrix of the first transaction record directed graph to the transaction address classification module; The first feature matrix construction module is configured to obtain, based on the first transaction record dataset, a first command type of the transaction, a first token type of the transaction, and a first funds flow address of the node, and calculate a first time density of the transaction; then, construct a first feature matrix based on the first command type of the transaction, the first token type of the transaction, the first funds flow address of the node, and the first time density of the transaction; and transmit the constructed first feature matrix to the transaction address classification module; The transaction address classification module is configured to input the embedding matrix and the first feature matrix of the first transaction record directed graph into a preset transaction address classification model, so that the transaction address classification model classifies the transaction addresses to be classified and generates a transaction address classification result; Wherein, the transaction address classification model is a graph neural network model; When training the graph neural network model, each convolutional layer of the graph neural network model is calculated according to the following formula, and the calculation results of each convolutional layer are nonlinearly transformed through a nonlinear activation function to obtain the output of the corresponding convolutional layer: ; Among them, σ() is a nonlinear activation function, T is the command type set of the transaction, t is the element of the command type set of the transaction, E is the token type set of the transaction, e is the element of the token type set of the transaction, F is the node's capital flow address set, f is the element of the node's capital flow address set, is the time density matrix of the transaction, is a degree matrix, the diagonal elements of which are the total degrees of a certain type of transactions of the corresponding node. is an adjacency matrix, each element of which is the number of transaction records of a certain type between nodes in the directed graph of transaction records. is the output matrix of the l-th layer neural network, where the input of the first layer graph neural network is the embedding matrix of the second transaction record dataset with known transaction address classification, is the weight matrix of the l-th layer graph neural network, is the offset matrix of the l-th layer graph neural network.

6. A terminal device for classifying transaction addresses, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the method for classifying transaction addresses according to any one of claims 1 to 4 is implemented.

7. A storage medium, characterized in that: The storage medium includes a stored computer program, wherein when the computer program is running, the device where the storage medium is located is controlled to execute the transaction address classification method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Neural network system and method for analyzing relational network diagram

    CN110009093A

  • Entity address determination method and device, equipment and storage medium

    CN111901450A