CN117892112B - Data analysis method based on block chain - Google Patents

Data analysis method based on block chain Download PDF

Info

Publication number
CN117892112B
CN117892112B CN202410282702.7A CN202410282702A CN117892112B CN 117892112 B CN117892112 B CN 117892112B CN 202410282702 A CN202410282702 A CN 202410282702A CN 117892112 B CN117892112 B CN 117892112B
Authority
CN
China
Prior art keywords
transaction
data analysis
account
loss function
blockchain
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202410282702.7A
Other languages
Chinese (zh)
Other versions
CN117892112A (en
Inventor
宋轩
彭金全
林贵旭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Southwest University of Science and Technology
Original Assignee
Southwest University of Science and Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Southwest University of Science and Technology filed Critical Southwest University of Science and Technology
Priority to CN202410282702.7A priority Critical patent/CN117892112B/en
Publication of CN117892112A publication Critical patent/CN117892112A/en
Application granted granted Critical
Publication of CN117892112B publication Critical patent/CN117892112B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention provides a data analysis method based on a block chain, wherein the method comprises the following steps: obtaining a graph network of a target blockchain; acquiring an account view according to the graph network; acquiring a transaction view according to a graph network; according to the account view and the transaction view, carrying out feature representation fusion; determining a pre-training blockchain data analysis model according to a fusion result of feature representation fusion; fine tuning obtains a blockchain data analysis model and analyzes downstream tasks. According to the blockchain-based data analysis method, the graph network of the target blockchain is obtained, the fusion result is obtained according to the account view and transaction view fusion characteristic representation in the graph network, and the learning effect of the account feature is better; and training a pre-trained blockchain data analysis model based on the fusion result, finely adjusting to obtain the blockchain data analysis model, and analyzing a downstream task, thereby improving the applicability of an analysis scene.

Description

Data analysis method based on block chain
Technical Field
The invention relates to the technical field of electric digital data processing, in particular to a data analysis method based on a block chain.
Background
The blockchain technology is widely applied to the fields of finance, the Internet of things, intelligent manufacturing and the like due to the characteristics of decentralization, transparency, tamper resistance and the like. The blockchain account book generates a large amount of data while the blockchain technology rapidly develops, and a user can better use and manage the blockchain platform by analyzing various data generated in the blockchain, and meanwhile, researchers can be helped to analyze the development and evolution of the blockchain.
One type of blockchain data analysis study uses machine learning methods to analyze blockchain data. Since machine learning methods generally require that a dataset possess rich feature information and tag information, the mapping rule of features and tags is learned through analysis of the feature information. However, in the blockchain network, the number of the participating nodes is large, the number of labels of the nodes is very rare, and the blockchain data cannot be processed well by the method. In addition, machine learning methods cannot learn interactions between nodes in a blockchain.
The other type is that data analysis is carried out by a deep learning method, the graph neural network is a tool for processing graph data well, and the blockchain data can be modeled into a graph, so that the method can better process the blockchain data analysis task. However, the existing research is to directly aggregate transaction data to account nodes and then directly learn account features in the blockchain by using the neural network, so that the information of accounts and transactions in the blockchain is not well processed, and the effect is poor. In addition, most of these methods are directed to a single blockchain data analysis scenario and cannot be used universally.
In view of the foregoing, there is a need for a blockchain-based data analysis method that addresses at least the above-described deficiencies.
Disclosure of Invention
The invention aims to provide a blockchain-based data analysis method, which comprises the steps of obtaining a graph network of a target blockchain to be subjected to data analysis, respectively obtaining an account view and a transaction view according to the graph network, carrying out feature representation fusion on account features and transaction features according to the account view and the transaction view, obtaining a fusion result, extracting node interaction relations, and improving the learning effect of the account features; training a pre-trained blockchain data analysis model based on the fusion result, performing model fine adjustment according to task requirements of downstream tasks to obtain the blockchain data analysis model, and analyzing the downstream tasks according to the blockchain data analysis model, so that the applicability of analysis scenes is improved.
The data analysis method based on the block chain provided by the embodiment of the invention comprises the following steps:
Obtaining a graph network of a target blockchain, wherein the graph network is as follows: based on a graph structure constructed by the target blockchain, the graph structure comprises nodes and edges between the nodes, wherein the nodes represent account attributes, and the edges represent transaction attributes;
according to the graph network, acquiring an account view, wherein the account view is as follows: features and information about the account extracted from the graph network;
according to the graph network, acquiring a transaction view, wherein the transaction view is as follows: features and information about the transaction extracted from the graph network;
According to the account view and the transaction view, carrying out feature representation fusion;
Determining a pre-training blockchain data analysis model according to a fusion result of feature representation fusion, wherein the fusion result is as follows: the feature represents a fused account representation vector;
And performing fine adjustment on the pre-trained blockchain data analysis model based on the target fine adjustment method to obtain the blockchain data analysis model, and performing downstream task analysis based on the blockchain data analysis model.
Preferably, according to the graph network, obtaining the account view includes:
Based on a preset statistical method, determining account characteristics according to a graph network, wherein the statistical method comprises the following steps: counting transaction frequency, total expenditure amount, average expenditure amount, total transaction number, total expenditure amount and average expenditure amount of the node;
Acquiring characteristic representation learning tasks of graph nodes in a graph network;
performing feature representation learning of the account features according to the feature representation learning task to obtain account feature representations;
the account feature representation is mapped to a target feature space based on the target multi-layer perceptron.
Preferably, according to the graph network, obtaining the transaction view includes:
determining transaction characteristics according to the graph network;
determining a transaction characteristic representation based on the graph attention mechanism;
Mapping the transaction characteristic representation to a target characteristic space based on the target multi-layer perceptron;
Wherein determining a transaction characteristic representation based on the graph attention mechanism comprises:
Obtaining a transfer matrix, wherein the transfer matrix specifically comprises:
Wherein, For transfer matrix,/>Representing the/>, in a blockchain networkTransaction time of individual transactions,/>Representing the/>, in a blockchain networkTransaction time of individual transactions,/>Represents the/>Personal transaction and/>The distance of the individual transactions;
Acquiring an edge attribute matrix;
Based on the graph attention mechanism, determining a transaction characteristic representation according to the transfer matrix and the edge attribute matrix, wherein the transaction characteristic representation specifically comprises:
Wherein, For trade character representation,/>Is an edge attribute matrix,/>As a GAT network function.
Preferably, the feature representation fusion is performed according to the account view and the transaction view, including:
aggregating transaction characteristic representations related to accounts according to an aggregation formula to obtain transaction set weighted aggregation characteristic representations;
Fusing the account feature representation and the transaction set weighting aggregation feature representation related to the account, wherein the fusion formula is as follows:
Wherein, First/>Fusion result of individual graph nodes,/>Is a multi-layer perceptron,/>For/>Account characterization of individual graph nodes,/>For/>Transaction set weighted aggregate feature representation of individual graph nodes,/>For stitching the two vectors.
Preferably, the aggregation formula comprises:
Wherein, For trade/>Is a weighted aggregate feature representation of the associated transaction set,/>For trade/>Importance coefficient of/>For trade/>Is characterized by the transaction/>To and account/>Associated transaction/>Set of (I)/>To/>, tradeSequencing sequence number obtained by sequencing in order of occurrence time from big to small,/>For trade/>Amount,/>Is a decay coefficient of temporal importance,/>Is a balance coefficient.
Preferably, determining the pre-trained blockchain data analysis model according to the fusion result of the feature representation fusion includes:
based on the transaction network consistency task, determining a first loss function, wherein the first loss function is as follows:
Wherein, For the first loss function,/>Average aggregate result for account feature representation,/>A mean value aggregation result expressed for the transaction characteristics;
based on the transaction prediction tasks between accounts, determining a second loss function, the second loss function being:
Wherein, As a second loss function,/>Is the total number of graph nodes,/>For the transaction number matrix,/>For a predicted transaction number matrix,/>For transaction amount matrix,/>A matrix of predicted transaction amounts;
calculating a total loss function according to the first loss function and the second loss function, wherein the total loss function is as follows:
Wherein, As a total loss function,/>A super parameter in the range of 0 to 1;
and determining a pre-training blockchain data analysis model according to the total loss function.
Preferably, the method for fine tuning the pre-trained blockchain data analysis model based on the target fine tuning method, obtaining the blockchain data analysis model, and performing analysis of downstream tasks based on the blockchain data analysis model includes:
Acquiring a fine tuning loss function in a fine tuning process of a pre-training blockchain data analysis model;
when the fine tuning loss function is minimum, taking the corresponding pre-trained blockchain data analysis model as a blockchain data analysis model;
And based on the analysis requirement of the downstream task, analyzing the downstream task according to the blockchain data analysis model.
Preferably, the obtaining a fine tuning loss function in the fine tuning process of the pre-training blockchain data analysis model includes:
Fixing parameters of the pre-training blockchain data analysis model and training a first regression model to obtain a first preselected fine tuning loss function of the pre-training blockchain data analysis model;
Fixing parameters before feature fusion in the pre-training blockchain data analysis model, and using a fusion result of the feature fusion to train a second regression model to obtain a second pre-selected fine tuning loss function of the pre-training blockchain data analysis model, wherein the second pre-selected fine tuning loss function of the pre-training blockchain data analysis model is as follows:
Wherein, For a second pre-selected fine tuning loss function of the pre-trained blockchain data analysis model,/>For processing models of downstream tasks,/>Is the true value of the node,/>A loss function for a downstream task;
characterizing the downstream task to obtain task characteristics;
According to the task characteristics, determining information similarity, wherein the information similarity comprises: account information similarity and transaction information similarity;
If the information similarity is greater than or equal to a preset information similarity threshold, taking the first preselected fine tuning loss function as a fine tuning loss function;
And if the information similarity is smaller than the information similarity threshold, taking the second preselected fine tuning loss function as the fine tuning loss function.
Preferably, when the fine tuning loss function is minimum, the corresponding pre-trained blockchain data analysis model is used as the blockchain data analysis model, including:
When the fine tuning loss function is minimum and the fine tuning loss function is a second preselected fine tuning loss function, judging whether the minimum value of the fine tuning loss function is smaller than a preset minimum value threshold value or not;
if yes, taking the pre-trained blockchain data analysis model corresponding to the minimum fine tuning loss function as a blockchain data analysis model;
If not, determining a reforming feature fusion strategy according to the analysis requirement of the downstream task;
determining reforming feature fusion parameters according to a reforming feature fusion strategy;
And fusing the reforming characteristics with parameters to determine a block chain data analysis model.
The data analysis system based on the block chain provided by the embodiment of the invention comprises:
A graph network acquisition subsystem for acquiring a graph network of the target blockchain;
The account view acquisition subsystem is used for acquiring an account view according to the graph network;
the transaction view acquisition subsystem is used for acquiring a transaction view according to the graph network;
the feature representation fusion subsystem is used for carrying out feature representation fusion according to the account view and the transaction view;
The model determining subsystem is used for determining a pre-training blockchain data analysis model according to the fusion result of the feature representation fusion;
and the fine tuning subsystem is used for fine tuning the pre-trained blockchain data analysis model based on the target fine tuning method, obtaining the blockchain data analysis model and analyzing the downstream task based on the blockchain data analysis model.
The beneficial effects of the invention are as follows:
According to the method, a graph network of a target blockchain to be subjected to data analysis is obtained, an account view and a transaction view are obtained respectively according to the graph network, and feature representation fusion is carried out on account features and transaction features according to the account view and the transaction view, so that fusion results are obtained, and the learning effect of the account features is improved while the node interaction relationship is extracted; training a pre-trained blockchain data analysis model based on the fusion result, performing model fine adjustment according to task requirements of downstream tasks to obtain the blockchain data analysis model, and analyzing the downstream tasks according to the blockchain data analysis model, so that the applicability of analysis scenes is improved.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the application. The objects and other advantages of the application may be realized and obtained by means of the instrumentalities particularly pointed out in the specification.
The technical scheme of the invention is further described in detail through the drawings and the embodiments.
Drawings
The accompanying drawings are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate the invention and together with the embodiments of the invention, serve to explain the invention. In the drawings:
FIG. 1 is a schematic diagram of a block chain based data analysis method according to an embodiment of the present invention;
FIG. 2 is a block diagram of a pre-trained blockchain data analysis model in an embodiment of the invention;
FIG. 3 is a schematic diagram of a target fine tuning method according to an embodiment of the invention;
FIG. 4 is a schematic diagram of another exemplary method for fine tuning a target according to the present invention;
FIG. 5 is a schematic diagram of a blockchain-based data analysis system in accordance with an embodiment of the present invention.
Detailed Description
The preferred embodiments of the present invention will be described below with reference to the accompanying drawings, it being understood that the preferred embodiments described herein are for illustration and explanation of the present invention only, and are not intended to limit the present invention.
The embodiment of the invention provides a data analysis method based on a block chain, which is shown in fig. 1 and comprises the following steps:
Step 1: obtaining a graph network of a target blockchain; wherein, the graph network is: the graph structure constructed based on the target blockchain comprises nodes and edges between the nodes, wherein the nodes represent account attributes, and the edges represent transaction attributes;
Step 2: acquiring an account view according to the graph network; wherein, the account view is: features and information about the account extracted from the graph network;
step 3: acquiring a transaction view according to a graph network; wherein, the transaction view is: features and information about the transaction extracted from the graph network;
step 4: according to the account view and the transaction view, carrying out feature representation fusion; wherein, the characteristic representation fuses as: fusing the feature expression vectors learned in the step 2 and the step 3;
Step 5: determining a pre-training blockchain data analysis model according to a fusion result of feature representation fusion; wherein, the fusion result is: a new account representation vector in which the representation vectors are fused; the pre-trained blockchain data analysis model is: an intelligent model for analysis of blockchain data trained from the results of feature representation fusion, a frame diagram of the pre-trained blockchain data analysis model is shown in fig. 2;
Step 6: and performing fine adjustment on the pre-trained blockchain data analysis model based on the target fine adjustment method to obtain the blockchain data analysis model, and performing downstream task analysis based on the blockchain data analysis model. The target fine tuning method comprises the following steps: performing fine tuning on the pre-training blockchain data analysis model according to task requirements of downstream tasks; the downstream tasks are: and (5) an application task of the data analysis result.
The working principle and the beneficial effects of the technical scheme are as follows:
According to the method, a graph network of a target blockchain to be subjected to data analysis is obtained, an account view and a transaction view are obtained respectively according to the graph network, and feature representation fusion is carried out on account features and transaction features according to the account view and the transaction view, so that fusion results are obtained, and the learning effect of the account features is improved while the node interaction relationship is extracted; training a pre-trained blockchain data analysis model based on the fusion result, performing model fine adjustment according to task requirements of downstream tasks to obtain the blockchain data analysis model, and analyzing the downstream tasks according to the blockchain data analysis model, so that the applicability of analysis scenes is improved.
In one embodiment, step 2: according to the graph network, obtaining an account view comprises:
Based on a preset statistical method, determining account characteristics according to a graph network, wherein the statistical method comprises the following steps: counting transaction frequency, total expenditure amount, average expenditure amount, total transaction number, total expenditure amount, average expenditure amount and the like of the nodes, wherein the counting mode of other account characteristics is similar; wherein, account characteristics are: characterization of account information, such as: transaction frequency is once per day;
acquiring characteristic representation learning tasks of graph nodes in a graph network; wherein, the characteristic represents the learning task as: what features are needed to represent the study;
Performing feature representation learning of the account features according to the feature representation learning task to obtain account feature representations; wherein, account characteristics are expressed as: an account feature representation vector;
the account feature representation is mapped to a target feature space based on the target multi-layer perceptron. Wherein, the target multilayer perceptron is: a deep learning model for learning nonlinear relationships and complex feature mappings; the target feature space is: while projecting feature space of the account feature representation and the transaction feature representation.
The working principle and the beneficial effects of the technical scheme are as follows:
the present application introduces a variety of statistical methods, including: counting transaction frequency, total amount of expenditure, average amount of expenditure, total number of transactions, total number of expenditure transactions, total amount of expenditure and average amount of expenditure of the node. The features of the acquisition graph nodes represent learning tasks. And performing feature representation learning of the account features according to the feature representation learning task to obtain the account feature representation. And a target multi-layer perceptron is introduced to map the account feature representation to a target feature space, so that the richness of the account feature representation is improved.
In one embodiment, step 3: according to the graph network, obtaining a transaction view includes:
determining transaction characteristics according to the graph network; wherein, the transaction characteristics are: characterization of transaction information, such as: transaction time, transaction amount, transaction type, etc.;
determining a transaction characteristic representation based on the graph attention mechanism;
Mapping the transaction characteristic representation to a target characteristic space based on the target multi-layer perceptron;
Wherein determining a transaction characteristic representation based on the graph attention mechanism comprises:
Obtaining a transfer matrix, wherein the transfer matrix specifically comprises:
Wherein, For transfer matrix,/>Representing the/>, in a blockchain networkTransaction time of individual transactions,/>Representing the/>, in a blockchain networkTransaction time of individual transactions,/>Represents the/>Personal transaction and/>The distance of the individual transactions;
acquiring an edge attribute matrix; the edge attribute matrix is as follows: in the graph network, describing attribute matrixes of transaction edges;
Based on the graph attention mechanism, determining a transaction characteristic representation according to the transfer matrix and the edge attribute matrix, wherein the transaction characteristic representation specifically comprises:
Wherein, For trade character representation,/>Is an edge attribute matrix,/>As a GAT network function.
The working principle and the beneficial effects of the technical scheme are as follows:
The application determines the basic characteristics of the transaction according to the graph network. The characteristic representation of the transaction is then determined from the transfer matrix and the edge attribute matrix based on the graph attention mechanism. By applying the graph attention network function, importance and associations between transactions can be captured, resulting in a richer and useful representation of transaction characteristics. These feature representations can be used for subsequent analysis and modeling tasks to reveal the pattern of transactions and to conduct analysis of downstream tasks.
In one embodiment, step 4: and carrying out feature representation fusion according to the account view and the transaction view, wherein the feature representation fusion comprises the following steps:
aggregating transaction characteristic representations related to accounts according to an aggregation formula to obtain transaction set weighted aggregation characteristic representations;
Fusing the account feature representation and the transaction set weighting aggregation feature representation related to the account, wherein the fusion formula is as follows:
Wherein, First/>Fusion result of individual graph nodes,/>Is a multi-layer perceptron,/>For/>Account characterization of individual graph nodes,/>For/>Transaction set weighted aggregate feature representation of individual graph nodes,/>For stitching the two vectors.
The working principle and the beneficial effects of the technical scheme are as follows:
According to the method, the transaction characteristic representations related to the accounts are aggregated, the obtained transaction set weighted aggregation characteristic representations are fused with the account characteristic representations, the problem of improper fusion caused by inconsistent dimensions of characteristic representation matrixes of the accounts and the transactions is avoided, and the characteristic fusion process is more reasonable.
In one embodiment, the aggregation formula includes:
Wherein, For trade/>Is a weighted aggregate feature representation of the associated transaction set,/>For trade/>Importance coefficient of/>For trade/>Is characterized by the transaction/>To and account/>Associated transaction/>Set of (I)/>To/>, tradeSequencing sequence number obtained by sequencing in order of occurrence time from big to small,/>For trade/>Amount,/>Is a decay coefficient of temporal importance,/>Is a balance coefficient.
The working principle and the beneficial effects of the technical scheme are as follows:
according to the application, the importance coefficient of the transaction is determined according to the elements such as the amount of money, the transaction time and the like, the importance coefficient and the transaction characteristic representation are fused to obtain the weighting aggregation characteristic representation of the associated transaction set, and the transaction characteristic representation is more accurate.
In one embodiment, step 5: determining a pre-training blockchain data analysis model according to a fusion result of feature representation fusion, wherein the method comprises the following steps:
based on the transaction network consistency task, determining a first loss function, wherein the first loss function is as follows:
Wherein, For the first loss function,/>Average aggregate result for account feature representation,/>A mean value aggregation result expressed for the transaction characteristics; wherein, the transaction network consistency task is: judging the consistency degree of the blockchain network characteristics learned by the account view and the transaction view; the first loss function measures a correspondence between the account feature representation and the transaction feature representation;
based on the transaction prediction tasks between accounts, determining a second loss function, the second loss function being:
Wherein, As a second loss function,/>Is the total number of graph nodes,/>For the transaction number matrix,/>Representing account/>And account/>Number of transactions between,/>For a predicted transaction number matrix,/>For/>Fusion result of individual graph nodes,/>For/>Fusion result of individual graph nodes,/>Multi-layer perceptron set for predicting transaction times,/>For transaction amount matrix,/>Representing account/>And account/>Total amount of transactions between/>For a predicted transaction amount matrix,/>,/>A multi-layer perceptron set for predicting transaction amount; the transaction prediction tasks are as follows: predicting the number of transactions and the transaction amount between accounts;
calculating a total loss function according to the first loss function and the second loss function, wherein the total loss function is as follows:
Wherein, As a total loss function,/>Super parameters in the range of 0 to 1 are manually set according to different scenes during model initialization;
and determining a pre-training blockchain data analysis model according to the total loss function.
The working principle and the beneficial effects of the technical scheme are as follows:
Because the original blockchain networks of the account view and the transaction view are the same network, the blockchain network features learned from the account view and the transaction view are similar, so that a first loss function is introduced, and the similarity between the average value aggregation result represented by the account features and the average value aggregation result represented by the transaction features is calculated by the first loss function, so that the method is more reasonable; in addition, a second loss function is introduced, the second loss function measures the difference between the transaction prediction result and the actual result, and two pre-training tasks are used for training a deep learning model for learning the characteristic representation of the account in the blockchain network, so that the method can be used for processing different downstream tasks, and the analysis comprehensiveness of the pre-training blockchain data analysis model is improved.
In one embodiment, step 6: performing fine tuning on the pre-trained blockchain data analysis model based on the target fine tuning method to obtain a blockchain data analysis model, and performing analysis of downstream tasks based on the blockchain data analysis model, including:
acquiring a fine tuning loss function in a fine tuning process of a pre-training blockchain data analysis model; wherein the fine tuning loss function is: FIG. 2 is a schematic diagram of a target fine tuning method, and FIG. 3 is a schematic diagram of another target fine tuning method;
when the fine tuning loss function is minimum, taking the corresponding pre-trained blockchain data analysis model as a blockchain data analysis model;
And based on the analysis requirement of the downstream task, analyzing the downstream task according to the blockchain data analysis model.
The working principle and the beneficial effects of the technical scheme are as follows:
The application determines the blockchain data analysis model with the minimum fine tuning loss function in the fine tuning process of the pre-trained blockchain data analysis model, and analyzes the downstream task according to the blockchain data analysis model based on the analysis requirement of the downstream task, so that the analysis is more accurate.
In one embodiment, obtaining a fine-tuning loss function in a fine-tuning process of a pre-trained blockchain data analysis model includes:
Fixing parameters of the pre-training blockchain data analysis model and training a first regression model to obtain a first preselected fine tuning loss function of the pre-training blockchain data analysis model; wherein the first regression model is: in the fine tuning process, using the account feature representation of the pre-trained model as input, a regression model is trained to predict the true value of the node, and the first regression model may be any model suitable for the task, such as: linear regression, decision tree regression, etc.; the first preselected fine tuning loss function is: when the first regression model is used for fine tuning, a loss function between a prediction result and a true value of the node is calculated;
Fixing parameters before feature fusion in the pre-training blockchain data analysis model, and using a fusion result of the feature fusion to train a second regression model to obtain a second pre-selected fine tuning loss function of the pre-training blockchain data analysis model, wherein the second pre-selected fine tuning loss function of the pre-training blockchain data analysis model is as follows:
Wherein, For a second pre-selected fine tuning loss function of the pre-trained blockchain data analysis model,/>For processing models of downstream tasks,/>Is the true value of the node,/>A loss function for a downstream task; wherein the second regression model is: in the fine tuning process, using the result of feature fusion as input, training a regression model to predict the true value of the node; the second preselected fine tuning loss function is: when the second regression model is used for fine tuning, a loss function between the calculated prediction result and the true value of the node is calculated;
Characterizing the downstream task to obtain task characteristics; wherein the downstream task is characterized as: the downstream task is subjected to the process of feature extraction and representation, and relevant features of the task can be obtained through the characterization of the downstream task and used for determining a follow-up fine tuning strategy; the task is characterized in that: task type, task objective and task data;
according to the task characteristics, determining information similarity, wherein the information similarity comprises: account information similarity and transaction information similarity; wherein, account information similarity is: determining task account characteristics according to the task characteristics, and calculating the similarity degree of the task account characteristics and the account characteristics of the target block chain; the transaction information similarity is: the degree of similarity of the task transaction characteristics and the transaction characteristics of the target blockchain; the information similarity is the sum of the account information similarity and the transaction information similarity;
If the information similarity is greater than or equal to a preset information similarity threshold, taking the first preselected fine tuning loss function as a fine tuning loss function; the preset information similarity threshold is preset manually;
And if the information similarity is smaller than the information similarity threshold, taking the second preselected fine tuning loss function as the fine tuning loss function.
The working principle and the beneficial effects of the technical scheme are as follows:
The application introduces two regression models to perform fine tuning of the pre-trained blockchain data analysis model. First, training a first regression model using the account feature representation of the pre-training model as input; second, a second regression model is trained using the results of feature fusion of the pre-training model as input. And according to the downstream tasks, determining a fine tuning loss function to perform fine tuning of a subsequent pre-trained blockchain data analysis model, improving the capability of knowing different downstream tasks, and having more applicability. Because the account and transaction information required by different downstream tasks may be the same or different, task features are introduced, information similarity is determined, and for the downstream tasks with the information similarity greater than or equal to a preset information similarity threshold, the first pre-selected fine tuning loss function is used as the fine tuning loss function, otherwise, the feature representation fusion module needs to be fine-tuned again, the second pre-selected fine tuning loss function is used as the fine tuning loss function, and a proper fine tuning strategy is flexibly selected according to the similarity of the task features, so that the performance of the model on different tasks is improved.
In one embodiment, when the fine-tuning loss function is minimal, the corresponding pre-trained blockchain data analysis model is taken as a blockchain data analysis model, comprising:
when the fine tuning loss function is minimum and the fine tuning loss function is a second preselected fine tuning loss function, judging whether the minimum value of the fine tuning loss function is smaller than a preset minimum value threshold value or not; wherein the preset minimum threshold value is preset manually;
if yes, taking the pre-trained blockchain data analysis model corresponding to the minimum fine tuning loss function as a blockchain data analysis model;
If not, determining a reforming feature fusion strategy according to the analysis requirement of the downstream task; wherein, reforming characteristic fusion strategy is: determining a feature fusion method, parameters or strategies again according to the feature requirements and analysis requirements of the downstream tasks;
Determining reforming feature fusion parameters according to a reforming feature fusion strategy; wherein, reforming characteristic fusion parameters are: weights, parameters or other relevant configurations in the feature fusion method;
And fusing the reforming characteristics with parameters to determine a block chain data analysis model.
The working principle and the beneficial effects of the technical scheme are as follows:
According to the application, whether the model meets the requirement of the model performance is determined by comparing the minimum value and the minimum value threshold value of the fine tuning loss function, if not, a reforming feature fusion strategy is determined according to the analysis requirement of the downstream task, and the feature fusion strategy and parameters are flexibly adjusted according to the performance of the fine tuning loss function and the requirement of the downstream task, so that the model performance and adaptability are improved.
An embodiment of the present invention provides a blockchain-based data analysis system, as shown in fig. 5, including:
a graph network acquisition subsystem 1 for acquiring a graph network of a target blockchain;
an account view acquisition subsystem 2 for acquiring an account view according to the graph network;
A transaction view acquisition subsystem 3 for acquiring a transaction view according to the graph network;
The feature representation fusion subsystem 4 is used for carrying out feature representation fusion according to the account view and the transaction view;
the model determination subsystem 5 is used for determining a pre-training blockchain data analysis model according to the fusion result of the feature representation fusion;
And the fine tuning subsystem 6 is used for fine tuning the pre-trained blockchain data analysis model based on the target fine tuning method, obtaining the blockchain data analysis model and analyzing the downstream task based on the blockchain data analysis model.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present invention without departing from the spirit or scope of the invention. Thus, it is intended that the present invention also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.

Claims (7)

1. A method of blockchain-based data analysis, comprising:
Obtaining a graph network of a target blockchain, wherein the graph network is as follows: based on a graph structure constructed by the target blockchain, the graph structure comprises nodes and edges between the nodes, wherein the nodes represent account attributes, and the edges represent transaction attributes;
according to the graph network, acquiring an account view, wherein the account view is as follows: features and information about the account extracted from the graph network;
according to the graph network, acquiring a transaction view, wherein the transaction view is as follows: features and information about the transaction extracted from the graph network;
According to the account view and the transaction view, carrying out feature representation fusion;
Determining a pre-training blockchain data analysis model according to a fusion result of feature representation fusion, wherein the fusion result is as follows: the feature represents a fused account representation vector;
Performing fine adjustment on the pre-trained blockchain data analysis model based on a target fine adjustment method to obtain a blockchain data analysis model, and performing downstream task analysis based on the blockchain data analysis model;
according to the graph network, obtaining a transaction view includes:
determining transaction characteristics according to the graph network;
determining a transaction characteristic representation based on the graph attention mechanism;
Mapping the transaction characteristic representation to a target characteristic space based on the target multi-layer perceptron;
Wherein determining a transaction characteristic representation based on the graph attention mechanism comprises:
Obtaining a transfer matrix, wherein the transfer matrix specifically comprises:
Wherein, For transfer matrix,/>Representing the/>, in a blockchain networkTransaction time of individual transactions,/>Representing the/>, in a blockchain networkTransaction time of individual transactions,/>Represents the/>Personal transaction and/>The distance of the individual transactions;
Acquiring an edge attribute matrix;
Based on the graph attention mechanism, determining a transaction characteristic representation according to the transfer matrix and the edge attribute matrix, wherein the transaction characteristic representation specifically comprises:
Wherein, For trade character representation,/>Is an edge attribute matrix,/>Is a GAT network function;
And carrying out feature representation fusion according to the account view and the transaction view, wherein the feature representation fusion comprises the following steps:
aggregating transaction characteristic representations related to accounts according to an aggregation formula to obtain transaction set weighted aggregation characteristic representations;
Fusing the account feature representation and the transaction set weighting aggregation feature representation related to the account, wherein the fusion formula is as follows:
Wherein, First/>Fusion result of individual graph nodes,/>Is a multi-layer perceptron,/>For/>Account characterization of individual graph nodes,/>For/>Transaction set weighted aggregate feature representation of individual graph nodes,/>For stitching the two vectors;
An aggregation formula comprising:
Wherein, For trade/>Is a weighted aggregate feature representation of the associated transaction set,/>For trade/>Importance coefficient of/>For trade/>Is characterized by the transaction/>To and account/>Associated transaction/>Set of (I)/>To/>, tradeSequencing sequence number obtained by sequencing in order of occurrence time from big to small,/>For trade/>Amount,/>Is a decay coefficient of temporal importance,/>Is a balance coefficient.
2. The blockchain-based data analysis method of claim 1, wherein obtaining an account view from a graph network includes:
Based on a preset statistical method, determining account characteristics according to a graph network, wherein the statistical method comprises the following steps: counting transaction frequency, total expenditure amount, average expenditure amount, total transaction number, total expenditure amount and average expenditure amount of the node;
Acquiring characteristic representation learning tasks of graph nodes in a graph network;
performing feature representation learning of the account features according to the feature representation learning task to obtain account feature representations;
the account feature representation is mapped to a target feature space based on the target multi-layer perceptron.
3. The blockchain-based data analysis method of claim 1, wherein determining the pre-trained blockchain data analysis model based on the fusion result of the feature representation fusion comprises:
based on the transaction network consistency task, determining a first loss function, wherein the first loss function is as follows:
Wherein, For the first loss function,/>Average aggregate result for account feature representation,/>A mean value aggregation result expressed for the transaction characteristics;
based on the transaction prediction tasks between accounts, determining a second loss function, the second loss function being:
Wherein, As a second loss function,/>Is the total number of graph nodes,/>For the transaction number matrix,/>For a predicted transaction number matrix,/>For transaction amount matrix,/>A matrix of predicted transaction amounts;
calculating a total loss function according to the first loss function and the second loss function, wherein the total loss function is as follows:
Wherein, As a total loss function,/>A super parameter in the range of 0 to 1;
and determining a pre-training blockchain data analysis model according to the total loss function.
4. The blockchain-based data analysis method of claim 1, wherein the performing fine-tuning of the pre-trained blockchain data analysis model based on the target fine-tuning method, obtaining the blockchain data analysis model, and performing downstream task analysis based on the blockchain data analysis model, comprises:
Acquiring a fine tuning loss function in a fine tuning process of a pre-training blockchain data analysis model;
when the fine tuning loss function is minimum, taking the corresponding pre-trained blockchain data analysis model as a blockchain data analysis model;
And based on the analysis requirement of the downstream task, analyzing the downstream task according to the blockchain data analysis model.
5. The blockchain-based data analysis method of claim 4, wherein obtaining a pre-trained blockchain data analysis model for fine tuning loss function in the fine tuning process includes:
Fixing parameters of the pre-training blockchain data analysis model and training a first regression model to obtain a first preselected fine tuning loss function of the pre-training blockchain data analysis model;
Fixing parameters before feature fusion in the pre-training blockchain data analysis model, and using a fusion result of the feature fusion to train a second regression model to obtain a second pre-selected fine tuning loss function of the pre-training blockchain data analysis model, wherein the second pre-selected fine tuning loss function of the pre-training blockchain data analysis model is as follows:
Wherein, For a second pre-selected fine tuning loss function of the pre-trained blockchain data analysis model,/>For processing models of downstream tasks,/>Is the true value of the node,/>A loss function for a downstream task;
characterizing the downstream task to obtain task characteristics;
According to the task characteristics, determining information similarity, wherein the information similarity comprises: account information similarity and transaction information similarity;
If the information similarity is greater than or equal to a preset information similarity threshold, taking the first preselected fine tuning loss function as a fine tuning loss function;
And if the information similarity is smaller than the information similarity threshold, taking the second preselected fine tuning loss function as the fine tuning loss function.
6. The blockchain-based data analysis method of claim 4, wherein when the fine-tuning loss function is minimal, taking the corresponding pre-trained blockchain data analysis model as the blockchain data analysis model includes:
When the fine tuning loss function is minimum and the fine tuning loss function is a second preselected fine tuning loss function, judging whether the minimum value of the fine tuning loss function is smaller than a preset minimum value threshold value or not;
if yes, taking the pre-trained blockchain data analysis model corresponding to the minimum fine tuning loss function as a blockchain data analysis model;
If not, determining a reforming feature fusion strategy according to the analysis requirement of the downstream task;
determining reforming feature fusion parameters according to a reforming feature fusion strategy;
And fusing the reforming characteristics with parameters to determine a block chain data analysis model.
7. A blockchain-based data analysis system, comprising:
A graph network acquisition subsystem for acquiring a graph network of the target blockchain;
The account view acquisition subsystem is used for acquiring an account view according to the graph network;
the transaction view acquisition subsystem is used for acquiring a transaction view according to the graph network;
the feature representation fusion subsystem is used for carrying out feature representation fusion according to the account view and the transaction view;
The model determining subsystem is used for determining a pre-training blockchain data analysis model according to the fusion result of the feature representation fusion;
The fine tuning subsystem is used for fine tuning the pre-trained blockchain data analysis model based on a target fine tuning method, obtaining a blockchain data analysis model and analyzing a downstream task based on the blockchain data analysis model;
a transaction view acquisition subsystem for acquiring a transaction view from a graph network, comprising:
determining transaction characteristics according to the graph network;
determining a transaction characteristic representation based on the graph attention mechanism;
Mapping the transaction characteristic representation to a target characteristic space based on the target multi-layer perceptron;
Wherein determining a transaction characteristic representation based on the graph attention mechanism comprises:
Obtaining a transfer matrix, wherein the transfer matrix specifically comprises:
Wherein, For transfer matrix,/>Representing the/>, in a blockchain networkTransaction time of individual transactions,/>Representing the/>, in a blockchain networkTransaction time of individual transactions,/>Represents the/>Personal transaction and/>The distance of the individual transactions;
Acquiring an edge attribute matrix;
Based on the graph attention mechanism, determining a transaction characteristic representation according to the transfer matrix and the edge attribute matrix, wherein the transaction characteristic representation specifically comprises:
Wherein, For trade character representation,/>Is an edge attribute matrix,/>Is a GAT network function;
the feature representation fusion subsystem is used for carrying out feature representation fusion according to the account view and the transaction view, and comprises the following steps:
aggregating transaction characteristic representations related to accounts according to an aggregation formula to obtain transaction set weighted aggregation characteristic representations;
Fusing the account feature representation and the transaction set weighting aggregation feature representation related to the account, wherein the fusion formula is as follows:
Wherein, First/>Fusion result of individual graph nodes,/>Is a multi-layer perceptron,/>For/>Account characterization of individual graph nodes,/>For/>Transaction set weighted aggregate feature representation of individual graph nodes,/>For stitching the two vectors;
An aggregation formula comprising:
Wherein, For trade/>Is a weighted aggregate feature representation of the associated transaction set,/>For trade/>Importance coefficient of/>For trade/>Is characterized by the transaction/>To and account/>Associated transaction/>Set of (I)/>To/>, tradeSequencing sequence number obtained by sequencing in order of occurrence time from big to small,/>For trade/>Amount,/>Is a decay coefficient of temporal importance,/>Is a balance coefficient.
CN202410282702.7A 2024-03-13 2024-03-13 Data analysis method based on block chain Active CN117892112B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410282702.7A CN117892112B (en) 2024-03-13 2024-03-13 Data analysis method based on block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410282702.7A CN117892112B (en) 2024-03-13 2024-03-13 Data analysis method based on block chain

Publications (2)

Publication Number Publication Date
CN117892112A CN117892112A (en) 2024-04-16
CN117892112B true CN117892112B (en) 2024-06-07

Family

ID=90641352

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410282702.7A Active CN117892112B (en) 2024-03-13 2024-03-13 Data analysis method based on block chain

Country Status (1)

Country Link
CN (1) CN117892112B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114782159A (en) * 2021-12-28 2022-07-22 杭州趣链科技有限公司 Illegal financial activity detection method, system, electronic device and medium
CN116361734A (en) * 2023-03-02 2023-06-30 南方科技大学 Data-driven blockchain anomaly detection method and terminal
CN117314424A (en) * 2023-09-18 2023-12-29 纬创软件(武汉)有限公司 Block chain transaction system and method for big financial data

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111131328B (en) * 2020-01-09 2021-02-26 周钰 Safe financial settlement method and system for block chain

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114782159A (en) * 2021-12-28 2022-07-22 杭州趣链科技有限公司 Illegal financial activity detection method, system, electronic device and medium
CN116361734A (en) * 2023-03-02 2023-06-30 南方科技大学 Data-driven blockchain anomaly detection method and terminal
CN117314424A (en) * 2023-09-18 2023-12-29 纬创软件(武汉)有限公司 Block chain transaction system and method for big financial data

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
空间数据智能:概念、技术与挑战;宋轩 等;计算机研究与发展;20221231;第59卷(第2期);第255-263页 *
空间数据智能技术发展及应用分析;宋轩 等;中国科学基金;20231231;第37卷(第6期);第1039-1046页 *

Also Published As

Publication number Publication date
CN117892112A (en) 2024-04-16

Similar Documents

Publication Publication Date Title
CN109409677A (en) Enterprise Credit Risk Evaluation method, apparatus, equipment and storage medium
CN110188198A (en) A kind of anti-fraud method and device of knowledge based map
CN111444951B (en) Sample recognition model generation method, device, computer equipment and storage medium
CN112785005B (en) Multi-objective task assistant decision-making method and device, computer equipment and medium
CN113011646A (en) Data processing method and device and readable storage medium
CN109726918A (en) The personal credit for fighting network and semi-supervised learning based on production determines method
CN108228684A (en) Training method, device, electronic equipment and the computer storage media of Clustering Model
CN110634060A (en) User credit risk assessment method, system, device and storage medium
CN112231592A (en) Network community discovery method, device, equipment and storage medium based on graph
CN106095939A (en) The acquisition methods of account authority and device
CN112966189A (en) Fund product recommendation system
CN113240506A (en) Financial wind-controlled cold start modeling method based on unsupervised field self-adaptation
CN111061948A (en) User label recommendation method and device, computer equipment and storage medium
CN111583024A (en) Credit evaluation method, device, storage medium and server
CN109146667B (en) Method for constructing external interface comprehensive application model based on quantitative statistics
CN115705706A (en) Video processing method, video processing device, computer equipment and storage medium
CN117892112B (en) Data analysis method based on block chain
Cao et al. No-reference image quality assessment by using convolutional neural networks via object detection
CN112215441A (en) Prediction model training method and system
CN110472653A (en) A kind of semantic segmentation method based on maximization region mutual information
CN112118486A (en) Content item delivery method and device, computer equipment and storage medium
CN117094817B (en) Credit risk control intelligent prediction method and system
CN115860574B (en) Method and device for analyzing using effect of charging equipment
CN109086730A (en) A kind of Handwritten Digit Recognition method, apparatus, equipment and readable storage medium storing program for executing
CN117058498B (en) Training method of segmentation map evaluation model, and segmentation map evaluation method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant