A smart contract risk detection method and system based on deep learning big model

Deep learning model to detect contract node abnormal information and correlation of smart contracts, and vulnerability repairs are combined with adversarial training data, which solves the problem of node risk association in smart contract risk detection, and improves risk prediction accuracy and model defense capabilities.

CN118941294BActive Publication Date: 2024-12-13BEIJING WANGZHI TIANYUAN BIG DATA TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411421801.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-12
Publication Date
2024-12-13
Estimated Expiration
2044-10-12

AI Technical Summary

Technical Problem

There are code vulnerabilities and logical errors in the financial payment verification process of smart contracts, resulting in potential economic losses, and the existing technology is difficult to effectively detect the risk association between contract nodes, affecting the accuracy of risk prediction.

Method used

Using a large model based on deep learning, collect payment records and extract payment exception information of contract nodes, determine contract vulnerability characteristics, and evaluate stable correlation based on node association model, and combine vulnerability repairs to achieve risk of smart contracts. Test.

Benefits of technology

It improves the accuracy of smart contract risk prediction, and through vulnerability level detection and repair, it provides effective parameters for risk management and decision-making, enhancing the accuracy and defense capabilities of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118941294B_ABST
    Figure CN118941294B_ABST
Patent Text Reader

Abstract

The present application provides a smart contract risk detection method and system based on a deep learning large model, which determines the contract vulnerability characteristics of the corresponding contract node in the financial payment verification through each payment anomaly information; performs vulnerability assessment on the target payment contract according to the stable correlation between each contract node in the target payment contract and all contract vulnerability characteristics, and obtains the vulnerability level of the target payment contract; determines the adversarial perturbation amount in adversarial training through adversarial training data and historical payment data, and determines the vulnerability repair information of the target payment contract according to the adversarial perturbation amount and each contract vulnerability characteristic; repairs the vulnerability level based on the vulnerability repair information, obtains the vulnerability level of the target payment contract after repair, and completes the vulnerability risk detection of the target payment contract. Based on the above scheme, risk association detection of each contract node in the smart contract risk can be realized, thereby improving the prediction accuracy of the smart contract risk.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of financial payment technology, and more specifically, to a smart contract risk detection method and system based on a deep learning big model. Background Art

[0002] With the rapid development of the financial industry, smart contracts, as one of its core applications, have been widely used in many fields such as financial payment verification, supply chain management, and the Internet of Things. Smart contracts are automated programs deployed on financial platforms that can automatically execute predefined operations when specific conditions are met. Smart contracts not only improve the transparency and efficiency of transactions, but also reduce manual intervention and intermediary costs. However, the widespread application of smart contracts has also brought new security challenges. Once a smart contract is deployed on a financial platform, it cannot be changed. Any code vulnerabilities or logical errors may lead to serious economic losses.

[0003] Contract risk detection aims to ensure the security and reliability of the target payment contract when executing financial payment verification. Through static analysis and dynamic analysis, potential vulnerabilities in the contract code are detected, such as reentrancy attacks, integer overflows, improper permission management, etc., and adversarial training strategies are introduced into smart contract risk detection. By simulating various potential attack methods, a more defensive detection model can be trained. At the same time, the execution process of smart contracts usually involves interactions between multiple contract nodes, and the relationship between contract nodes can also provide rich contextual information. By analyzing the correlation between contract nodes, potential risk points can be further discovered, thereby improving the accuracy of risk prediction. Therefore, how to realize risk correlation detection of each contract node in smart contract risks, thereby improving the prediction accuracy of contract risks, is a difficult problem faced by the industry. Summary of the invention

[0004] The present application provides a smart contract risk detection method and system based on a deep learning large model, which can combine adversarial training strategies and the relationship between contract nodes to realize risk association detection of each contract node in the smart contract risk, thereby improving the prediction accuracy of smart contract risks.

[0005] In the first aspect, the present application provides a smart contract risk detection method based on a deep learning big model, comprising:

[0006] Collect payment records of the target payment contract to obtain historical payment data;

[0007] Extracting payment exception information of each contract node in the target payment contract from the historical payment data, and then determining the contract vulnerability characteristics of the corresponding contract node in financial payment verification through each payment exception information;

[0008] The node association model based on deep learning determines the stable association between each contract node in the target payment contract, and conducts vulnerability assessment on the target payment contract through each stable association and all contract vulnerability characteristics to obtain the vulnerability level of the target payment contract;

[0009] Acquire adversarial training data of the target payment contract during vulnerability risk detection, determine the adversarial perturbation amount of the target payment contract in adversarial training through the adversarial training data and the historical payment data, and determine the vulnerability repair information of the target payment contract according to the adversarial perturbation amount and the contract vulnerability characteristics of each contract node;

[0010] The vulnerability level is repaired based on the vulnerability repair information to obtain the vulnerability level of the target payment contract after repair, thereby completing the vulnerability risk detection of the target payment contract.

[0011] In some embodiments, extracting payment exception information of each contract node in the target payment contract from the historical payment data specifically includes:

[0012] For each contract node in the target payment contract, obtain all abnormal flags of the contract node;

[0013] Extracting the payment record data segment of the contract node from each payment record in the historical payment data;

[0014] Filter out all abnormal identification data segments of the contract node from all payment record data segments through various abnormal identifications;

[0015] The payment exception information of the contract node is determined based on all the abnormal identification data segments, and then the payment exception information of each contract node in the target payment contract is obtained.

[0016] In some embodiments, determining the contract vulnerability characteristics of the corresponding contract node in financial payment verification through each payment exception information specifically includes:

[0017] For each contract node in the target payment contract, obtain the payment exception information and each exception identifier of the contract node;

[0018] Determining the identification frequency of each abnormal identification through all abnormal identification data segments in the payment abnormality information;

[0019] The contract vulnerability characteristics of the contract node in the financial payment verification are determined according to all the identification frequencies, and then the contract vulnerability characteristics of each contract node in the target payment contract in the financial payment verification are obtained.

[0020] In some embodiments, the vulnerability level of the target payment contract is obtained by performing vulnerability assessment on the target payment contract through various stable associations and all contract vulnerability features, and specifically includes:

[0021] Get the node risk coefficient of each contract node in the target payment contract;

[0022] Conduct risk assessment on each contract node in the target payment contract through the risk coefficient of each node and the corresponding stable correlation, and obtain the risk value associated with all nodes;

[0023] Determine the risk volatility entropy of the target payment contract based on all node-associated risk values;

[0024] Determine the vulnerability assessment value when using the target payment contract for financial payment verification through all contract vulnerability characteristics;

[0025] The vulnerability level of the target payment contract is determined according to the risk fluctuation entropy and the vulnerability assessment value.

[0026] In some embodiments, determining the vulnerability assessment value when using the target payment contract for financial payment verification through all contract vulnerability features specifically includes:

[0027] For each contract node in the target payment contract, obtain the node risk coefficient of the contract node;

[0028] Standardize the contract vulnerability features of the contract node to obtain the risk feature quantity of the contract node;

[0029] Determine the risk value of the contract node by using the risk characteristic quantity and the node risk coefficient, and then obtain the risk value of each contract node in the target payment contract;

[0030] Determine the vulnerability assessment value when using the target payment contract for financial payment verification based on all risk values.

[0031] In some embodiments, the vulnerability level is repaired based on the vulnerability repair information to obtain the vulnerability level of the target payment contract after repair, and the vulnerability risk detection of the target payment contract specifically includes:

[0032] Determine the contract vulnerability value of the target payment contract according to the vulnerability level and the vulnerability repair information;

[0033] The contract vulnerability value is compared with the preset risk level range to obtain the vulnerability level of the target payment contract, and the vulnerability level detection of the target payment contract is completed.

[0034] In some embodiments, the target payment contract is a blockchain-based digital currency smart contract.

[0035] In the second aspect, the present application provides a smart contract risk detection system based on a deep learning big model, including:

[0036] The collection module is used to collect payment records of the target payment contract and obtain historical payment data;

[0037] A processing module, used to extract payment exception information of each contract node in the target payment contract from the historical payment data, and then determine the contract vulnerability characteristics of the corresponding contract node in financial payment verification through each payment exception information;

[0038] The processing module is also used to determine the stable association between each contract node in the target payment contract based on the deep learning node association model, and perform vulnerability assessment on the target payment contract through each stable association and all contract vulnerability features to obtain the vulnerability level of the target payment contract;

[0039] The processing module is also used to obtain adversarial training data of the target payment contract during vulnerability risk detection, determine the adversarial perturbation amount of the target payment contract in the adversarial training through the adversarial training data and the historical payment data, and determine the vulnerability repair information of the target payment contract according to the adversarial perturbation amount and the contract vulnerability characteristics of each contract node;

[0040] The execution module is used to repair the vulnerability level based on the vulnerability repair information, obtain the vulnerability level of the target payment contract after repair, and complete the vulnerability risk detection of the target payment contract.

[0041] In a third aspect, the present application provides a computer device, comprising a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program from the memory, so that the computer device executes the above-mentioned smart contract risk detection method based on a deep learning large model.

[0042] In a fourth aspect, the present application provides a computer-readable storage medium, which stores instructions or codes. When the instructions or codes are run on a computer, the computer implements the above-mentioned smart contract risk detection method based on a deep learning large model when executing.

[0043] The technical solution provided by the embodiments disclosed in this application has the following beneficial effects:

[0044] The present application provides a smart contract risk detection method and system based on a deep learning large model, which collects payment records of a target payment contract to obtain historical payment data; extracts payment exception information of each contract node in the target payment contract from the historical payment data, and then determines the contract vulnerability characteristics of the corresponding contract node in financial payment verification through each payment exception information; determines the stable correlation between each contract node in the target payment contract based on a deep learning node association model, performs vulnerability assessment on the target payment contract through each stable correlation and all contract vulnerability characteristics, and obtains the vulnerability level of the target payment contract; obtains adversarial training data of the target payment contract during vulnerability risk detection, determines the adversarial perturbation amount of the target payment contract in adversarial training through the adversarial training data and the historical payment data, and determines the vulnerability repair information of the target payment contract based on the adversarial perturbation amount and the contract vulnerability characteristics of each contract node; repairs the vulnerability level based on the vulnerability repair information, obtains the vulnerability level of the repaired target payment contract, and completes the vulnerability risk detection of the target payment contract.

[0045] It can be seen that in this application, the vulnerability level of the target payment contract is detected based on the vulnerability level and vulnerability repair information; wherein, determining the contract vulnerability characteristics can provide effective parameters for subsequent risk prediction and decision-making, so that the adversarial training model can be optimized for specific risk characteristics, improve the accuracy and robustness of the model, and determine the stable correlation through the contract vulnerability characteristics and the node association model, and then obtain the vulnerability assessment value, which is a key step in combining node association detection with the adversarial training strategy. The vulnerability assessment value reflects the overall risk of the contract in a specific transaction scenario, and the stable correlation evaluates the stability of the relationship between nodes. By combining the vulnerability assessment value and the vulnerability assessment value, it can be more accurate. Accurately assess the overall risk level of the contract, quantify the risk through vulnerability levels, and provide specific improvement targets for adversarial training; then, through adversarial training data, various potential attacks and abnormal behaviors can be simulated to train the model to identify and respond to these threats, and the risk characteristics in historical payment data can be combined to determine the amount of adversarial disturbance of each contract node risk, so that different types of contract risks can be targeted for correction, thereby improving the defense capability and accuracy of the model; in summary, based on the above scheme, the adversarial training strategy and the relationship between contract nodes can be combined to realize the risk association detection of each contract node in the smart contract risk, thereby improving the prediction accuracy of smart contract risks. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0047] Figure 1 is an exemplary flow chart of a smart contract risk detection method based on a deep learning big model according to some embodiments of the present application;

[0048] Figure 2 It is a schematic diagram of the smart contract trust authentication response mechanism shown in some embodiments of the present application;

[0049] Figure 3 is a schematic diagram of a process for determining the counter-disturbance amount according to some embodiments of the present application;

[0050] Figure 4 It is a schematic diagram of exemplary hardware and / or software of a smart contract risk detection system based on a deep learning big model according to some embodiments of the present application;

[0051] Figure 5 It is a structural diagram of a computer device for implementing a smart contract risk detection method based on a deep learning big model as shown in some embodiments of the present application. DETAILED DESCRIPTION

[0052] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0053] The embodiment of the present application provides a smart contract risk detection method and system based on a deep learning large model, the core of which is to determine the contract vulnerability characteristics of the corresponding contract node in the financial payment verification through each payment anomaly information; perform vulnerability assessment on the target payment contract according to the stable correlation between each contract node in the target payment contract and all contract vulnerability characteristics, and obtain the vulnerability level of the target payment contract; determine the adversarial perturbation amount in adversarial training through adversarial training data and historical payment data, and determine the vulnerability repair information of the target payment contract according to the adversarial perturbation amount and each contract vulnerability characteristic; perform vulnerability repair on the vulnerability level based on the vulnerability repair information, obtain the vulnerability level of the target payment contract after repair, and complete the vulnerability risk detection of the target payment contract. Based on the above scheme, risk association detection of each contract node in smart contract risk can be realized, thereby improving the prediction accuracy of smart contract risk.

[0054] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods. Figure 1 , which is an exemplary flow chart of a smart contract risk detection method based on a deep learning big model according to some embodiments of the present application. The smart contract risk detection method based on a deep learning big model mainly includes the following steps:

[0055] In step 101, the payment records of the target payment contract are collected to obtain historical payment data.

[0056] It should be noted that in the present application, the target payment contract is a digital currency smart contract based on blockchain. In the present application, risk detection is performed on a smart contract. In actual use, other smart contracts can use the method in this solution to perform risk detection. The contract nodes in the target payment contract include payment identification, intermediate agent, verification node, settlement node and refund node. When using the target payment contract for financial payment, the contract nodes in the target payment contract are executed one by one in order to complete the payment.

[0057] In specific implementation, payment records of financial payments made using the target payment contract within a preset time period (the default is the time period from now to the past month) are collected, and the collection of all payment records can be used as historical payment data, where the payment record contains the node execution process, payment delay, payment exception identification and payment result identification. The payment exception identification includes payment amount exception, payment frequency exception and payment delay exception. The node execution process is a process record of payment in the order of each contract node in the target payment contract during financial payment. The node execution process in the target payment contract consists of multiple payment record data segments, and one payment record data segment identifies the node execution process record of a contract node.

[0058] In some embodiments, reference Figure 2 ,This figure is a schematic diagram of the smart contract trust authentication response mechanism. When a user signs a smart contract, the relevant information will be connected to the blockchain data in the form of program code. This process requires initial verification. Only after the verification is passed will the information be officially recorded in the blockchain. During the trust authentication process, the system authenticates the blockchain data through preset trigger conditions and response rules to ensure the validity and security of the contract. Figure 2 The designed response mechanism is demonstrated to automatically execute contracts through clear conditions and rules, which improves transparency and credibility in the transaction process while reducing human intervention.

[0059] In step 102, payment exception information of each contract node in the target payment contract is extracted from the historical payment data, and then the contract vulnerability characteristics of the corresponding contract node in financial payment verification are determined through each payment exception information.

[0060] In some embodiments, extracting payment exception information of each contract node in the target payment contract from the historical payment data can be achieved by using the following steps:

[0061] For each contract node in the target payment contract, obtain all abnormal flags of the contract node;

[0062] Extracting the payment record data segment of the contract node from each payment record in the historical payment data;

[0063] Filter out all abnormal identification data segments of the contract node from all payment record data segments through various abnormal identifications;

[0064] The payment exception information of the contract node is determined based on all the abnormal identification data segments, and then the payment exception information of each contract node in the target payment contract is obtained.

[0065] It should be noted that in the present application, the payment exception information is a set of records of payment anomalies in the financial payment process of all contract nodes; the exception identification data segment is a data segment of each contract node in the financial payment process with an exception identification; the payment record data segment is a data segment of each contract node in the financial payment process; the exception identification includes payment amount exception, payment frequency exception and payment delay exception, and each exception identification corresponds one-to-one to the payment exception identification in the payment record.

[0066] In the specific implementation, first, for each contract node in the target payment contract, all exception identifiers of the contract node can be obtained in the contract rules of the target payment contract; secondly, during the node execution process of each payment record of the historical payment data, the payment record data segment of the corresponding contract node is obtained to obtain all payment record data segments of the contract node; then, the payment record data segment with the payment exception identifier can be used as the payment risk data segment, and the exception identifier corresponding to the payment exception identifier of the payment risk data segment in the contract node can be used as the data segment identifier of the payment risk data segment, and the payment risk data segment after each data segment identifier can be used as the exception identifier data segment; finally, the collection of all exception identifier data segments can be used as the payment exception information of the contract node. The payment exception information of each contract node in the target payment contract can be obtained in the above manner.

[0067] In some embodiments, determining the contract vulnerability characteristics of the corresponding contract node in financial payment verification through each payment exception information can be implemented by the following steps:

[0068] For each contract node in the target payment contract, obtain the payment exception information and each exception identifier of the contract node;

[0069] Determining the identification frequency of each abnormal identification through all abnormal identification data segments in the payment abnormality information;

[0070] The contract vulnerability characteristics of the contract node in the financial payment verification are determined according to all the identification frequencies, and then the contract vulnerability characteristics of each contract node in the target payment contract in the financial payment verification are obtained.

[0071] It should be noted that in the present application, the contract vulnerability feature is a feature that reflects the risk level of each type of anomaly of the contract node in the financial payment verification; in specific implementation, first, for each contract node in the target payment contract, the payment anomaly information and each anomaly identifier of the contract node are obtained; then, an anomaly identifier is selected as the selected anomaly identifier, and the ratio of the number of anomaly identifier data segments with the selected anomaly identifier in the payment anomaly information to the total number of anomaly identifier data segments in the payment anomaly information can be counted as the identification frequency of the selected anomaly identifier, and the identification frequency of the remaining anomaly identifiers can be obtained by repeating the above steps. The identification frequency represents the frequency of occurrence of the anomaly identifier in the payment anomaly information. By calculating the identification frequency, the probability of occurrence of each anomaly identifier can be quantified, and high-frequency anomaly identifiers can be identified; finally, the set of all identification frequencies can be used as the contract vulnerability feature of the contract node in the financial payment verification. The contract vulnerability feature of each contract node in the target payment contract in the financial payment verification can be obtained in the above manner. Determining the contract vulnerability feature can comprehensively assess the risk level of each contract node, which is convenient for subsequent risk management and decision-making.

[0072] In step 103, the node association model based on deep learning is used to determine the stable associations between the various contract nodes in the target payment contract, and the vulnerability level of the target payment contract is obtained by performing a vulnerability assessment on the target payment contract through various stable associations and all contract vulnerability features.

[0073] In some embodiments, determining the stable association between each contract node in the target payment contract based on the deep learning node association model can be implemented by the following steps:

[0074] For each contract node in the target payment contract, the node association degree between the contract node and other contract nodes in the target payment contract is determined through a deep learning node association model;

[0075] The stable correlation of the contract nodes in the target payment contract is determined according to the correlation of all nodes, and then the stable correlation between the contract nodes in the target payment contract is obtained.

[0076] It should be noted that stable association is a measure of the stability of the association relationship between a contract node and other contract nodes. The higher the stable association, the more stable the interactive relationship between the nodes. In specific implementation, first, for each contract node in the target payment contract, a deep learning pre-trained node association model is initialized, and the contract node is used as the first associated node of the node association model. The remaining contract nodes in the target payment contract are used as the second associated nodes of the node association model in turn. The association evaluation result of the node association model can be used as the node association between the contract node and the remaining contract nodes in the target payment contract; then, the standard deviation of all node associations can be used as the stable association of the contract nodes in the target payment contract. The stable association between the contract nodes in the target payment contract can be obtained in the above manner. By determining the stable association, the stability of the relationship between the contract nodes can be quantitatively evaluated, potential unstable nodes can be identified, and data support can be provided for contract risk detection.

[0077] In some embodiments, the vulnerability assessment of the target payment contract is performed through each stable association and all contract vulnerability features, and the vulnerability level of the target payment contract is obtained by the following steps:

[0078] Get the node risk coefficient of each contract node in the target payment contract;

[0079] Conduct risk assessment on each contract node in the target payment contract through the risk coefficient of each node and the corresponding stable correlation, and obtain the risk value associated with all nodes;

[0080] Determine the risk volatility entropy of the target payment contract based on all node-associated risk values;

[0081] Determine the vulnerability assessment value when using the target payment contract for financial payment verification through all contract vulnerability characteristics;

[0082] The vulnerability level of the target payment contract is determined according to the risk fluctuation entropy and the vulnerability assessment value.

[0083] It should be noted that the vulnerability level is an indicator to measure the overall vulnerability risk level of the target payment contract in the payment process; in specific implementation, first, obtain the node risk coefficient of each contract node in the target payment contract; secondly, for each contract node in the target payment contract, obtain the node risk coefficient and stability correlation of the contract node, and the product of the node risk coefficient and the stability correlation can be used as the node correlation risk value to initialize a risk assessment model, and the target payment contract is used as the risk assessment target of the risk assessment model, the node risk coefficient is used as the risk assessment parameter of the risk assessment model, and the stability correlation is used as the assessment adjustment parameter of the risk assessment model. The assessment result of the risk assessment model can be used as the node correlation value of the contract node. The associated risk value of each contract node in the target payment contract can be obtained by the above method. The calculation of the node associated risk value can accurately reflect the risk level of each node in the payment contract, and provide detailed data for the overall risk assessment; then, the information entropy algorithm is used to calculate the information entropy of the associated risk value of each node, and the mean of all information entropies can be used as the risk fluctuation entropy of the target payment contract. The risk fluctuation entropy is an indicator for measuring the risk volatility of the target payment contract; finally, the product of the risk fluctuation entropy and the vulnerability assessment value can be used as the vulnerability level of the target payment contract. By determining the vulnerability level, the overall vulnerability risk of the target payment contract in the payment process can be comprehensively assessed, providing a basis for vulnerability risk detection of the target payment contract.

[0084] In the above embodiment, determining the vulnerability assessment value when using the target payment contract for financial payment verification through all contract vulnerability features can be achieved by using the following steps:

[0085] For each contract node in the target payment contract, obtain the node risk coefficient of the contract node;

[0086] Standardize the contract vulnerability features of the contract node to obtain the risk feature quantity of the contract node;

[0087] Determine the risk value of the contract node by using the risk characteristic quantity and the node risk coefficient, and then obtain the risk value of each contract node in the target payment contract;

[0088] Determine the vulnerability assessment value when using the target payment contract for financial payment verification based on all risk values.

[0089] It should be noted that in this application, the vulnerability assessment value is an indicator to measure the overall vulnerability risk level when using the target payment contract for financial payment verification; the node risk coefficient is a numerical value to measure the risk importance of each contract node in the entire payment contract; the risk characteristic quantity is the quantitative value of the contract vulnerability characteristic of the contract node; the risk value is a quantitative value to measure the risk importance of each contract node in the entire payment contract.

[0090] In specific implementation, first, for each contract node in the target payment contract, the execution ratio of the contract node can be obtained in the contract rules of the target payment contract as the node risk coefficient. The execution ratio is a quantitative value of the degree of influence of each contract node on the normal execution of the target payment contract. Clarifying the node risk coefficient can quantify the contribution of each contract node in the execution of the target payment contract, and provide a basis for the subsequent risk value calculation; secondly, a standardization algorithm (for example: normalization algorithm) can be used to standardize the mean of all identification frequencies of the contract vulnerability characteristics of the contract node, and the standardized value can be used as the risk feature quantity of the contract node. The scale difference between different risk characteristics can be eliminated through feature standardization, making the subsequent calculation more accurate and fair; then, the product of the risk feature quantity and the node risk coefficient can be used as the risk value of the contract node. The risk value of each contract node in the target payment contract can be obtained by the above method. Determining the risk value of the contract node can quantify the contribution of each node to the overall risk; finally, the sum of all risk values ​​can be used as the vulnerability assessment value when using the target payment contract for financial payment verification. Determining the vulnerability assessment value can assess the overall risk level when using the target payment contract for financial payment verification, which helps to improve the accuracy of subsequent vulnerability assessment and risk detection.

[0091] It should be noted that the node association model is a model used to evaluate the correlation between a contract node and other contract nodes. The node association model can be trained based on historical data, transaction patterns or other relevant factors. Calculating the node association through a deep learning node association model can systematically evaluate the interaction intensity between contract nodes, quantify the relationship between nodes, and provide a basis for subsequent stable association calculations.

[0092] In step 104, the adversarial training data of the target payment contract during vulnerability risk detection is obtained, the adversarial perturbation amount of the target payment contract in the adversarial training is determined through the adversarial training data and the historical payment data, and the vulnerability repair information of the target payment contract is determined according to the adversarial perturbation amount and the contract vulnerability characteristics of each contract node.

[0093] It should be noted that in the present application, the adversarial training data is a data set consisting of multiple adversarial training records. The adversarial training record refers to the process record of data training for each contract node in the target payment contract through simulated attacks, fault injection, etc. In specific implementation, the adversarial training record of the target payment contract within a preset time period (the default is one week) is obtained in the training system of the target payment contract, and the collection of all adversarial training records can be used as adversarial training data.

[0094] In some embodiments, the adversarial perturbation amount of the target payment contract is determined by using the adversarial training data and the historical payment data, referring to Figure 3 As described above, the figure is a schematic diagram of a process for determining the counter-disturbance amount in some embodiments of the present application. In this embodiment, determining the counter-disturbance amount can be implemented by the following steps:

[0095] In step 1041, for each contract node in the target payment contract, the adversarial training information of the contract node is screened in the adversarial training data;

[0096] In step 1042, historical payment information of the contract node is obtained from the historical payment data;

[0097] In step 1043, the adversarial training information and the historical payment information are adversarially compared to obtain the adversarial disturbance amount of the contract node risk, and then obtain the adversarial disturbance amount of the target payment contract.

[0098] It should be noted that in the present application, the adversarial disturbance amount is a quantitative value of disturbance information intentionally added to improve the training effect of the adversarial training model. The higher the adversarial disturbance amount, the better the adversarial strategy effect of the contract node. In specific implementation, first, for each contract node in the target payment contract, the node adversarial training record of the contract node can be intercepted in the adversarial training data, and the set of all node adversarial training records can be used as the adversarial training information of the contract node; then, the historical payment information of the contract node is obtained in the historical payment data; finally, the difference value between the adversarial training information and the historical payment information is compared using a data comparison algorithm, and the difference value can be used as the adversarial disturbance amount of the contract node risk. In specific implementation, the data comparison algorithm can be, for example, an absolute value difference algorithm or a Euclidean distance algorithm, which is not specifically limited here. The adversarial disturbance amount of the target payment contract can be obtained by the above method. Determining the adversarial disturbance amount can evaluate the relationship between the abnormal behavior observed in the adversarial training and historical payment data of each contract node, thereby quantifying the adversarial ability of each contract node, thereby improving the overall security and reliability of the target payment contract.

[0099] In some embodiments, determining the vulnerability repair information of the target payment contract according to the counter-disturbance amount of each contract node risk and the contract vulnerability characteristics of each contract node can be implemented by the following steps:

[0100] For each contract node in the target payment contract, obtain the adversarial perturbation amount and contract vulnerability characteristics of the contract node risk;

[0101] Determine the initial risk value of the contract node in the target payment contract before adversarial training through the contract vulnerability characteristics;

[0102] Using the adversarial perturbation amount to perform adversarial simulation on the contract nodes in the target payment contract, and obtaining an adversarial risk value after adversarial training;

[0103] The vulnerability repair information of the target payment contract is determined by the counter-risk value and the initial risk value.

[0104] It should be noted that the vulnerability repair information is a quantitative value used to correct the overall vulnerability risk level of the target payment contract. In specific implementation, first, for each contract node in the target payment contract, the adversarial perturbation amount of the contract node risk and the contract vulnerability characteristics are obtained. Secondly, the standard deviation of all identification frequencies in the contract vulnerability characteristics can be used as the initial risk value of the contract node in the target payment contract before adversarial training. The initial risk value represents the risk level of each contract node before the adversarial training begins. Determining the initial risk value can provide a comparative benchmark for the risk value after adversarial training, thereby more accurately evaluating the effect of adversarial training. Then, a neural network-based adversarial simulation is initialized. A tool is used to select an adversarial strategy with the same adversarial perturbation as the adversarial perturbation in the adversarial simulation tool for adversarial simulation. The result of the adversarial simulation is used as the adversarial risk value after adversarial training. The adversarial risk value is the risk level obtained by simulating and testing each contract node based on the adversarial perturbation after adversarial training. The adversarial simulation and risk value calculation can evaluate the performance of each node under the actual adversarial strategy, thereby quantifying the effect of adversarial training. Finally, the difference between the adversarial risk value and the initial risk value can be used as the vulnerability repair information of the target payment contract. Determining the vulnerability repair information can quantify the impact of adversarial training on contract risk and provide a basis for risk detection of the target payment contract.

[0105] In step 105, the vulnerability level is repaired based on the vulnerability repair information to obtain the vulnerability level of the target payment contract after repair, thereby completing the vulnerability risk detection of the target payment contract.

[0106] In some embodiments, the vulnerability level is repaired based on the vulnerability repair information to obtain the vulnerability level of the target payment contract after repair. The vulnerability risk detection of the target payment contract can be completed by the following steps:

[0107] Determine the contract vulnerability value of the target payment contract according to the vulnerability level and the vulnerability repair information;

[0108] The contract vulnerability value is compared with the preset risk level range to obtain the vulnerability level of the target payment contract, and the vulnerability level detection of the target payment contract is completed.

[0109] In specific implementation, first, the sum of the vulnerability level and the vulnerability repair information can be used as the contract vulnerability value of the target payment contract; then, the risk level interval can be preset based on historical experience to determine the risk level interval in which the contract vulnerability value lies, and the risk level corresponding to the risk level interval can be used as the vulnerability level of the target payment contract.

[0110] In this application, vulnerability level detection is performed on the target payment contract based on vulnerability level and vulnerability repair information; wherein, determining the contract vulnerability characteristics can provide effective parameters for subsequent risk prediction and decision-making, so that the adversarial training model can be optimized for specific risk characteristics, improve the accuracy and robustness of the model, and determine the stable correlation through the contract vulnerability characteristics and the node association model, and then obtain the vulnerability assessment value, which is a key step in combining node association detection with adversarial training strategy. The vulnerability assessment value reflects the overall risk of the contract in a specific transaction scenario, while the stable correlation evaluates the stability of the relationship between nodes. By combining the vulnerability assessment value and the vulnerability assessment value, it can be more accurately Assess the overall risk level of the contract and quantify the risk through vulnerability levels to provide specific improvement targets for adversarial training; then, through adversarial training data, various potential attacks and abnormal behaviors can be simulated to train the model to identify and respond to these threats. Combined with the risk characteristics in historical payment data, the amount of adversarial disturbance of each contract node risk can be determined, and targeted corrections can be made to different types of contract risks to improve the defense capabilities and accuracy of the model; in summary, based on the above scheme, the adversarial training strategy and the relationship between contract nodes can be combined to realize risk association detection of each contract node in the smart contract risk, thereby improving the prediction accuracy of smart contract risks.

[0111] In addition, in another aspect of the present application, in some embodiments, the present application provides a smart contract risk detection system based on a deep learning big model, referring to Figure 4 , which is a schematic diagram of exemplary hardware and / or software of a smart contract risk detection system based on a deep learning big model according to some embodiments of the present application, including: a collection module 201, a processing module 202 and an execution module 203, which are described as follows:

[0112] Collection module 201, in this application, collection module 201 is mainly used to collect payment records of the target payment contract, and then obtain historical payment data;

[0113] Processing module 202, in this application, processing module 202 is used to extract payment exception information of each contract node in the target payment contract from the historical payment data, and then determine the contract vulnerability characteristics of the corresponding contract node in financial payment verification through each payment exception information;

[0114] It should be noted that the processing module 202 is also used to determine the stable association between each contract node in the target payment contract based on the node association model of deep learning, and to perform vulnerability assessment on the target payment contract through each stable association and all contract vulnerability features to obtain the vulnerability level of the target payment contract;

[0115] In addition, the processing module 202 is also used to obtain adversarial training data of the target payment contract during vulnerability risk detection, determine the adversarial perturbation amount of the target payment contract in the adversarial training through the adversarial training data and the historical payment data, and determine the vulnerability repair information of the target payment contract according to the adversarial perturbation amount and the contract vulnerability characteristics of each contract node;

[0116] Execution module 203, in this application, execution module 203 is mainly used to repair the vulnerability level based on the vulnerability repair information, obtain the vulnerability level of the target payment contract after repair, and complete the vulnerability risk detection of the target payment contract.

[0117] The above describes in detail the examples of the smart contract risk detection method and system based on the deep learning large model provided by the embodiments of the present application. It can be understood that the corresponding device includes hardware structures and / or software modules corresponding to the execution of each function in order to realize the above functions. It should be easily appreciated by those skilled in the art that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present application.

[0118] In some embodiments, the present application also provides a computer device, comprising a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program from the memory, so that the computer device executes the above-mentioned smart contract risk detection method based on the deep learning large model.

[0119] In some embodiments, reference Figure 5, the dotted line in the figure indicates that the unit or module is optional. The figure is a schematic diagram of the structure of a computer device for implementing a smart contract risk detection method based on a deep learning big model according to an embodiment of the present application. The smart contract risk detection method based on a deep learning big model described in the above embodiment can be Figure 5 The computer device shown in the figure is implemented, and the computer device includes at least one processor 301, a memory 302 and at least one communication unit 305. The computer device can be a terminal device, a server or a chip.

[0120] The processor 301 may be a general-purpose processor or a special-purpose processor. For example, the processor 301 may be a central processing unit (CPU), which may be used to control the computer device, execute software programs, and process data of the software programs. The computer device may also include a communication unit 305 to implement signal input (reception) and output (transmission).

[0121] For example, the computer device may be a chip, the communication unit 305 may be an input and / or output circuit of the chip, or the communication unit 305 may be a communication interface of the chip, and the chip may be a component of a terminal device, a network device, or other devices.

[0122] For another example, the computer device may be a terminal device or a server, and the communication unit 305 may be a transceiver of the terminal device or the server, or the communication unit 305 may be a transceiver circuit of the terminal device or the server.

[0123] The computer device may include one or more memories 302, on which a program 304 is stored. The program 304 can be executed by the processor 301 to generate instructions 303, so that the processor 301 performs the method described in the above method embodiment according to the instructions 303. Optionally, data (such as a target audit model) can also be stored in the memory 302. Optionally, the processor 301 can also read the data stored in the memory 302, and the data can be stored at the same storage address as the program 304, or the data can be stored at a different storage address from the program 304.

[0124] The processor 301 and the memory 302 may be provided separately or integrated together, for example, integrated on a system on chip (SOC) of the terminal device.

[0125] It should be understood that each step of the above method embodiment can be completed by a hardware-based logic circuit or software-based instructions in the processor 301. The processor 301 can be a CPU, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, such as discrete gates, transistor logic devices, or discrete hardware components.

[0126] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0127] For example, in some embodiments, the present application also provides a computer-readable storage medium, which stores instructions or codes. When the instructions or codes are run on a computer, the computer implements the above-mentioned smart contract risk detection method based on the deep learning big model when executing.

[0128] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.

[0129] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A smart contract risk detection method based on deep learning big model, It is characterized in that The steps include: Collect payment records of the target payment contract to obtain historical payment data; Extracting payment exception information of each contract node in the target payment contract from the historical payment data, and then determining the contract vulnerability characteristics of the corresponding contract node in financial payment verification through each payment exception information; The node association model based on deep learning determines the stable association between each contract node in the target payment contract, and conducts vulnerability assessment on the target payment contract through each stable association and all contract vulnerability characteristics to obtain the vulnerability level of the target payment contract; Acquire adversarial training data of the target payment contract during vulnerability risk detection, determine the adversarial perturbation amount of the target payment contract in adversarial training through the adversarial training data and the historical payment data, and determine the vulnerability repair information of the target payment contract according to the adversarial perturbation amount and the contract vulnerability characteristics of each contract node; The vulnerability level is repaired based on the vulnerability repair information to obtain the vulnerability level of the target payment contract after repair, thereby completing the vulnerability risk detection of the target payment contract.

2. The method according to claim 1, It is characterized in that Extracting payment exception information of each contract node in the target payment contract from the historical payment data specifically includes: For each contract node in the target payment contract, obtain all abnormal flags of the contract node; Extracting the payment record data segment of the contract node from each payment record in the historical payment data; Filter out all abnormal identification data segments of the contract node from all payment record data segments through various abnormal identifications; The payment exception information of the contract node is determined based on all the abnormal identification data segments, and then the payment exception information of each contract node in the target payment contract is obtained.

3. The method according to claim 1, It is characterized in that The contract vulnerability characteristics of the corresponding contract node in financial payment verification determined by each payment exception information include: For each contract node in the target payment contract, obtain the payment exception information and each exception identifier of the contract node; Determining the identification frequency of each abnormal identification through all abnormal identification data segments in the payment abnormality information; The contract vulnerability characteristics of the contract node in the financial payment verification are determined according to all the identification frequencies, and then the contract vulnerability characteristics of each contract node in the target payment contract in the financial payment verification are obtained.

4. The method according to claim 1, It is characterized in that Through each stable association and all contract vulnerability characteristics, the target payment contract is evaluated for vulnerability, and the vulnerability level of the target payment contract is obtained, including: Get the node risk coefficient of each contract node in the target payment contract; Conduct risk assessment on each contract node in the target payment contract through the risk coefficient of each node and the corresponding stable correlation, and obtain the risk value associated with all nodes; Determine the risk volatility entropy of the target payment contract based on all node-associated risk values; Determine the vulnerability assessment value when using the target payment contract for financial payment verification through all contract vulnerability characteristics; The vulnerability level of the target payment contract is determined according to the risk fluctuation entropy and the vulnerability assessment value.

5. The method according to claim 4, It is characterized in that The vulnerability assessment values ​​when using the target payment contract for financial payment verification are determined through all contract vulnerability characteristics, including: For each contract node in the target payment contract, obtain the node risk coefficient of the contract node; Standardize the contract vulnerability features of the contract node to obtain the risk feature quantity of the contract node; Determine the risk value of the contract node by using the risk characteristic quantity and the node risk coefficient, and then obtain the risk value of each contract node in the target payment contract; Determine the vulnerability assessment value when using the target payment contract for financial payment verification based on all risk values.

6. The method according to claim 1, It is characterized in that The vulnerability level is repaired based on the vulnerability repair information, and the vulnerability level of the target payment contract after repair is obtained specifically includes: Determine the contract vulnerability value of the target payment contract according to the vulnerability level and the vulnerability repair information; The contract vulnerability value is compared with the preset risk level range to obtain the vulnerability level of the target payment contract, and the vulnerability level detection of the target payment contract is completed.

7. The method according to claim 1, It is characterized in that The payment contract is a digital currency smart contract based on blockchain.

8. A smart contract risk detection system based on deep learning big model, It is characterized in that include: The collection module is used to collect payment records of the target payment contract and obtain historical payment data; A processing module, used to extract payment exception information of each contract node in the target payment contract from the historical payment data, and then determine the contract vulnerability characteristics of the corresponding contract node in financial payment verification through each payment exception information; The processing module is also used to determine the stable association between each contract node in the target payment contract based on the deep learning node association model, and perform vulnerability assessment on the target payment contract through each stable association and all contract vulnerability features to obtain the vulnerability level of the target payment contract; The processing module is also used to obtain adversarial training data of the target payment contract during vulnerability risk detection, determine the adversarial perturbation amount of the target payment contract in the adversarial training through the adversarial training data and the historical payment data, and determine the vulnerability repair information of the target payment contract according to the adversarial perturbation amount and the contract vulnerability characteristics of each contract node; The execution module is used to repair the vulnerability level based on the vulnerability repair information, obtain the vulnerability level of the target payment contract after repair, and complete the vulnerability risk detection of the target payment contract.

9. A computer device, It is characterized in that The computer device includes a memory and a processor, the memory is used to store a computer program, and the processor is used to call and run the computer program from the memory, so that the computer device executes the smart contract risk detection method based on a deep learning large model as described in any one of claims 1 to 7.

10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores instructions or codes, and when the instructions or codes are executed on a computer, the computer implements the smart contract risk detection method based on a deep learning large model as described in any one of claims 1 to 7.