Block chain smart contract defect detection method based on big data

By building a smart contract detection model and using multi-scale feature extraction and defect classification technology, the shortcomings in the existing smart contract defect detection system in terms of universality, accuracy and efficiency are solved, and more efficient and accurate smart contract defect detection is achieved, adapting to the rapid development of smart contract technology.

CN120180448APending Publication Date: 2025-06-20CHONGQING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510319734.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-18
Publication Date
2025-06-20

AI Technical Summary

Technical Problem

The existing smart contract defect detection systems have shortcomings in generality, defect identification accuracy and efficiency, and are difficult to deal with complex and changeable smart contract security threats, and lack the ability to learn and iterative updates, making it difficult to adapt to the rapid development of smart contract technology.

Method used

A blockchain smart contract defect detection method based on big data is proposed. By building a smart contract detection model, the model includes data splitting layer, coding layer, feature extraction layer and defect classification layer, and uses multi-scale feature extraction and defect classification technology to achieve efficient defect detection of smart contracts.

Benefits of technology

This method can obtain contract text information more comprehensively and extract text information with multiple features, significantly improving the accuracy and efficiency of smart contract defect detection, enhancing the generalization and performance capabilities of the model, and helping to reduce risks in the development and application of smart contracts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120180448A_ABST
    Figure CN120180448A_ABST
Patent Text Reader

Abstract

The invention relates to the field of deep learning and natural language processing, in particular to a block chain smart contract defect detection method based on big data, comprising: constructing a smart contract detection model, the model comprising a data splitting layer, a coding layer, a feature extraction layer and a defect classification layer, the data splitting layer representing each contract as a matrix, the coding layer codes the expression matrix of the contract, the feature extraction layer extracts multi-scale features from the coding matrix, and the defect classification layer judges whether the contract has defects or not according to the multi-scale features. According to the method, the problem of intelligent contract defect detection can be automatically solved, multiple features are fused, and the method can efficiently, automatically and accurately detect the defects of the intelligent contract at low cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of deep learning and natural language processing, and in particular to a blockchain smart contract defect detection method based on big data. Background Art

[0002] In recent years, with the rapid development of blockchain technology, smart contracts, as the core component of decentralized applications, have become increasingly important. Smart contracts can automatically execute preset logic without the intervention of a third party, greatly improving the transparency and efficiency of transactions, and becoming a key driving force for digital transformation in many fields such as finance and supply chain management. However, with the widespread application of smart contracts, their security issues are becoming increasingly severe. Once smart contracts have defects or are maliciously exploited, they may lead to serious consequences such as financial losses and data leaks, seriously affecting the healthy development of the blockchain ecosystem.

[0003] Traditional smart contract auditing methods mainly rely on manual code review, which is not only time-consuming and laborious, but also limited by the experience and skill level of auditors, making it difficult to fully and accurately identify all potential defects. In order to improve the efficiency of smart contract security testing, the industry has begun to explore smart contract defect detection methods based on automation technology. These methods use machine learning, formal verification and other technologies to perform static analysis or dynamic simulation of smart contract codes, aiming to automatically discover potential vulnerabilities and defects.

[0004] However, the smart contract defect detection systems currently on the market still face many challenges: on the one hand, some systems can only analyze specific types of smart contracts or specific programming languages, and lack versatility; on the other hand, some systems still need to improve the accuracy and efficiency of defect identification, and it is difficult to cope with complex and changing smart contract security threats. In addition, most systems lack the ability to self-learn and iterate, and it is difficult to adapt to the rapid development of smart contract technology. Therefore, the development of a smart contract defect detection method that can integrate multiple features and has a high level of automation and intelligence has become a key issue that needs to be urgently solved in the field of blockchain security. Summary of the invention

[0005] In view of this, the present invention proposes a blockchain smart contract defect detection method based on big data, including constructing a smart contract detection model, which includes a data splitting layer, a coding layer, a feature extraction layer and a defect classification layer. The data splitting layer represents each contract as a matrix, the coding layer encodes the representation matrix of the contract, the feature extraction layer extracts multi-scale features from the coding matrix, and the defect classification layer determines whether the contract has defects based on the multi-scale features.

[0006] Further, the process of representing each contract as a matrix includes: preprocessing the contract text, then representing each word in the contract through one-hot encoding, and then determining the position of the one-hot encoding of the word in the encoding matrix through positional encoding.

[0007] Further, the representation matrix of the contract is:

[0008] X = WPM + [θ1, θ2,..., θ K

[0009] where X is the representation matrix of a contract, N is the dimension of the row vector of the contract representation matrix; WPM is the matrix of word positions in the contract text representing N dimensions; θ k represents the vector representation of the k-th word in the contract, k ∈ {1, 2,..., K}, the vector representation dimension of each word is N, and the k-th dimension value of the k-th word is 1 and other dimension values are 0.

[0010] Further, the loc-th row in the matrix WPM represents the position information of the loc-th word, and the value of the j-th column in each row is the relationship between the loc-th word and the j-th word. When j ≥ loc, its value is 0; when j < loc and loc is even, its value is expressed as:

[0011]

[0012] When j < loc and loc is odd, the corresponding element in the position matrix is expressed as:

[0013]

[0014] where α represents the weighting coefficient; l k represents the position of the loc-th word in the sentence; d k represents the dimension of WPM; 2i represents the even dimension and 2i ≤ d k , 2i + 1 represents the odd dimension and 2i + 1 ≤ d k ; Softmax represents the normalization function.

[0015] Further, the process of the encoding layer encoding the representation matrix of the contract includes:

[0016] Using three cascaded fully connected layers to process the matrix representation of the contract, and then mapping the outputs of the fully connected layers respectively to obtain the corresponding search matrix, basis matrix, and evaluation matrix;

[0017] Introduce a lower triangular matrix Hide matrix, use this matrix to occlude the search matrix and basis matrix and then multiply with the evaluation matrix to obtain an intermediate matrix, and use this intermediate matrix to update the evaluation matrix; ​

[0018] Normalize the search matrix, basis matrix, and evaluation matrix, and use the normalized values to update the search matrix and basis matrix;

[0019] Output the updated search matrix, basis matrix, and evaluation matrix as the encoding matrix.

[0020] Furthermore, the process of separately mapping the features output by the cascaded fully connected layers to obtain the corresponding search matrix, basis matrix, and evaluation matrix includes:

[0021] S i =(XR S +X T R S T ) 2 ,B i =(XR B +X T R B T ) 2 ,V i =(XR V +X T R V T ) 2

[0022] where S i represents the search matrix of the i-th contract; X is the feature output by the cascaded fully connected layers; R S is the learning matrix of the search matrix; B i represents the basis matrix of the i-th contract; R B is the learning matrix of the basis matrix; V i represents the evaluation matrix of the i-th contract; R V is the learning matrix of the evaluation matrix.

[0023] Furthermore, the process of updating the evaluation matrix includes:

[0024] V i ′=(Z i R V +Z i T R V T ) 2

[0025]

[0026] where V i ′ is the updated evaluation matrix; Z i is an intermediate matrix; Hide is a lower triangular matrix; denotes the bitwise multiplication operation, |·| denotes the modulus operation of the matrix, and d k denotes Z i the dimension of the matrix.

[0027] Furthermore, the process of normalizing the search matrix, the basis matrix, and the evaluation matrix includes:

[0028]

[0029] where score i denotes the encoding matrix of the i-th contract; V i denotes the evaluation matrix of the i-th contract; m c denotes the data volume of the contract text, ln(·) denotes the natural logarithm function; W 0 is a learnable matrix parameter.

[0030] Furthermore, the process of updating the search matrix and the basis matrix using the normalized values includes:

[0031] S i ′ = (score i R S + score T R S T ) 2

[0032] B i ′ = (score i R B + score i T R B T ) 2

[0033] where S i ′ denotes the updated search matrix; B i ′ denotes the updated basis matrix.

[0034] Furthermore, the process of the feature extraction layer extracting multi-scale features from the encoding matrix includes:

[0035] Introduce non-linearity to the encoding matrix through the Relu activation function;

[0036] Then concatenate the encoding matrices of all contracts in the smart contract together to obtain a 7×21 matrix, and use a convolutional layer with 16 convolutional kernels of 3×1 and a stride of 1 to perform convolutional operations on the matrix, and the result outputs a 5×21×6 matrix;

[0037] Next, perform max pooling operation using a pooling window of size 2 and stride 2 to obtain a feature matrix of 3×11×16;

[0038] Then, use a 1×1 convolutional layer to perform convolution to reduce the number of channels, and output a feature matrix of 3×11×21;

[0039] Next, flatten the multi-dimensional matrix, input the obtained one-dimensional feature matrix into the fully connected layer, and output 21 neurons through the fully connected layer;

[0040] Finally, reshape the 21 neurons to output a feature matrix of 7×3, and use this matrix as the multi-scale feature.

[0041] Compared with the prior art, the present invention has the following beneficial effects:

[0042] 1. The present invention obtains more comprehensive contract text information. That is, the present invention constructs a representation matrix between words and phrases in the contract text, constructs a word and phrase matrix from the word and phrase information, retains the original contract text content information, and constructs a word position matrix of the mutual relationship between words and phrases in the contract text by means of the extraction of the stem content in the text, the word segmentation processing of the text, and the position prompt of punctuation marks, so as to obtain more comprehensive contract text information;

[0043] 2. The present invention also extracts text information with multiple features. That is, the present invention splits the representation matrix of the contract text into a search matrix, a basis matrix, and an evaluation matrix. The search matrix among them can capture the mutual relationship between each word and phrase from multiple angles. The basis matrix grasps the relevance and importance between words and phrases with the help of the search matrix. The evaluation matrix provides the information that the model finally focuses on after determining which tokens are the most relevant. In this way, the model can more comprehensively master the multi-feature information of the text, improving the generalization ability and performance ability of the model;

[0044] 3. The present invention more accurately completes the investigation and detection in the field of smart contract security. That is, the present invention can more efficiently complete the detection of smart contract defects, which can help reduce the risks in the development and application processes of smart contracts and help developers promote the rapid development of the blockchain industry. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 is the training flow chart of the smart contract defect detection model in the present invention;

[0046] Figure 2 is the structural schematic diagram of the smart contract defect detection model in the present invention. DETAILED DESCRIPTION OF THE INVENTION

[0047] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0048] The present invention proposes a method for detecting defects in blockchain smart contracts based on big data, including constructing a smart contract detection model, which includes a data splitting layer, an encoding layer, a feature extraction layer, and a defect classification layer. The data splitting layer represents each contract as a matrix, the encoding layer encodes the representation matrix of the contract, the feature extraction layer extracts multi-scale features from the encoded matrix, and the defect classification layer determines whether the contract has defects based on the multi-scale features.

[0049] The specific implementation process of a method for detecting defects in blockchain smart contracts based on big data according to the present invention is as Figure 1 , including:

[0050] Input the contract data into the data splitting layer, and output the representation matrix of each contract;

[0051] Input the representation matrix into three consecutive fully connected layers, and output the query matrix, key matrix, and value matrix representations corresponding to each matrix;

[0052] Input the query matrix, key matrix, and value matrix into the Layer Normal layer for calculation and normalization, and output the encoded matrix;

[0053] Input the encoded matrix into the extraction network to extract multi-scale features, and output the feature matrix corresponding to each encoded matrix;

[0054] The feature matrices are concatenated and input into the softmax layer for normalization operation to obtain the probability of each contract having defects, and it is judged whether there are defects according to the probability.

[0055] This embodiment gives a process for obtaining the representation matrix corresponding to a contract, such as Figure 2 , specifically including the following steps:

[0056] S11. Preprocess the contract text, and the preprocessing means include word segmentation, removing irrelevant punctuation marks, stemming, and other preprocessing methods that those skilled in the art can think of.

[0057] As an alternative implementation, perform text tokenization on the contract text to split the text into a sequence of words with semantic rationality. Specifically, it is component-based tokenization, which divides the text according to a predetermined rule. The rule can be a dictionary and a regular expression, and the text is divided into specific words such as nouns, adjectives, and verbs.

[0058] As an alternative implementation, perform processing to remove irrelevant punctuation marks from the contract text, including deleting unnecessary punctuation marks such as full stops, commas, question marks, exclamation marks, etc., to reduce the interference of punctuation on the text. However, some punctuation marks may have an important impact on the meaning or structure of the text. Therefore, in actual operations, it is necessary to make a trade-off according to the specific task requirements.

[0059] As an alternative implementation, perform stemming processing on the contract text, including deleting the suffixes of words and converting different inflected forms of words (such as tenses, persons, singular and plural, etc.) into the same stem form.

[0060] S12. According to the semantic relationship between words in the text, convert the processed text into a representation matrix X. The representation matrix in the text is determined by the word matrix and the word position matrix, and the word matrix in it is represented by one-hot encoding.

[0061] As an alternative implementation, obtain the representation matrix of the contract through the vector representation of each word and its position encoding. The representation matrix of the contract is:

[0062] X = WPM + [θ1, θ2,..., θ K

[0063] where X is the representation matrix of a contract, N is the dimension of the row vector of the contract representation matrix; WPM is the word position matrix representing the N-dimensional contract text, and this matrix is an N×N-dimensional matrix; θ k represents the vector representation of the kth word in the contract, k ∈ {1, 2,..., K}, the vector representation dimension of each word is N, and the kth dimension value of the kth word vector is 1, and the values of other dimensions are 0. In this embodiment, N is the dimension of a contract matrix, generally set to N = 2100. In the process of actual operation, there are cases where the contract has less than 2100 words. At this time, meaningless characters can be used for filling, such as using -1 for filling. Or there are also cases where the number of contract words exceeds 2100. At this time, the contract is divided into two or more vector representations by truncation, and only need to ensure that the representation matrices of each contract have the same size.

[0064] ​As a preferred embodiment, in the matrix WPM of this embodiment, the loc-th row represents the position information of the loc-th word, and the value of the j-th column in each row is the relationship between the loc-th word and the j-th word. When j ≥ loc, the value is 0; when j < loc and loc is even, the value is expressed as:

[0065]

[0066] When j < loc and loc is odd, the corresponding element of this element in the position matrix is expressed as:

[0067]

[0068] where α represents the weighting coefficient; l k represents the position in the sentence where the loc-th word or phrase is located; d k represents the dimension of the WPM; 2i represents an even dimension and 2i ≤ d k , 2i + 1 represents an odd dimension and 2i + 1 ≤ d k ; Softmax represents the normalization function.

[0069] As an alternative embodiment, the process of the encoding layer encoding the representation matrix of the contract includes:

[0070] S21. Process the matrix representation of the contract using three cascaded fully connected layers, and then map the outputs of the fully connected layers respectively to obtain the corresponding search matrix, basis matrix, and evaluation matrix, which specifically include the following steps:

[0071] S i =(XR S +X T R S T ) 2 , B i =(XR B +X T R B T ) 2 , V i =(XR V +X T R V T ) 2

[0072] where S i represents the search matrix of the i-th contract; X is the feature output by the cascaded fully connected layers; R S is the learning matrix of the search matrix; B i represents the basis matrix of the i-th contract; R B is the learning matrix of the basis matrix; Vi Represents the evaluation matrix of the i-th contract; R V Is the learning matrix of the evaluation matrix;

[0073] S22. Introduce a lower triangular matrix Hide matrix. After using this matrix to occlude the search matrix and the basis matrix and then multiplying with the evaluation matrix to obtain an intermediate matrix, use this intermediate matrix to update the evaluation matrix, including the following process:

[0074] V i ′ = (Z i R V + Z i T R V T ) 2

[0075]

[0076] Among them, V i ′ is the updated evaluation matrix; Z i Is an intermediate matrix; Hide is a lower triangular matrix; Represents the bitwise multiplication operation, |·| represents the modulus operation of the matrix, d k Represents the dimension of the Z i matrix;

[0077] S23. Normalize the search matrix, the basis matrix and the evaluation matrix, specifically including: Dot multiply the transpose of each group of search matrix S i and the basis matrix B i to obtain an output matrix, which is the correlation and importance strength between multiple words in each contract representation matrix. Divide the output matrix by To prevent the inner product of different matrices from being too large and facilitate subsequent processing. Normalize the result through the Softmax layer, and finally multiply the result with the evaluation matrix V i for output. This process can be expressed as:

[0078]

[0079] Among them, score i Represents the encoding matrix of the i-th contract; B i T Represents the transpose of the basis matrix B i ; m c Represents the data volume of the contract text, ln(·) represents the natural logarithm function; W 0 Is a learnable matrix parameter;

[0080] Update the search matrix and the basis matrix using the normalized values, specifically including:

[0081] S i ′ = (score i R S + score T R S T ) 2

[0082] B i ′ = (score i R B + score i T R B T ) 2

[0083] Among them, S i ′ represents the updated search matrix; B i ′ represents the updated basis matrix;

[0084] S24. Output the updated search matrix, basis matrix, and evaluation matrix as the encoding matrix.

[0085] As an alternative implementation, the feature extraction layer extracts multi-scale features from the encoding matrix. This embodiment provides a specific process for the feature extraction layer to extract features, as Figure 2 , specifically including the following steps:

[0086] Take the encoding matrix, that is, the updated search matrix S i ′, the updated basis matrix B i ′, and the updated evaluation matrix V i ′, and introduce non-linearity through the Relu activation function;

[0087] Then concatenate the encoding matrices of all contracts in the smart contract together to obtain a 7×21 matrix, and use a convolutional layer with 16 convolutional kernels of 3×1 and a stride of 1 to perform convolution operations on the matrix, and the result outputs a 5×21×6 matrix;

[0088] Next, use a pooling window of size 2 and a stride of 2 to perform max pooling operations to obtain a 3×11×16 feature matrix;

[0089] Then use a 1×1 convolutional layer to perform convolution to reduce the number of channels and output a 3×11×21 feature matrix;

[0090] Next, flatten the multi-dimensional matrix, input the obtained one-dimensional feature matrix into the fully connected layer, and output 21 neurons through the fully connected layer;

[0091] Finally, 21 neurons are reshaped to output a 7×3 feature matrix, which is used as the multi-scale feature F. i .

[0092] In the present invention, a defect classification layer is used to determine whether there is a defect in the contract according to the multi-scale feature. In this embodiment, the defect classification layer uses a Softmax layer to perform a normalization operation to obtain the probability of whether there is a defect, and a threshold is set (for example Figure 2 in, when the output probability is greater than 0.5, it is determined that the contract has a defect, when it is less than 0.5, it is determined that the contract has no defect, and when it is equal to 0.5, it can be set to require re-judgment). If the probability is greater than the set threshold, it is determined that the contract has a defect, otherwise the contract has no defect. The calculation formula for the probability that a contract has a defect is:

[0093]

[0094] where P n represents the probability that the nth contract has a defect, concat represents the concatenation function, and F n represents the multi-scale feature of the i-th contract vector, n = 1, 2, 3,..., N; |·| represents the modulus operation of the matrix; That is, the concatenated matrix is a matrix with p rows and columns, and the multi-scale feature F i has p rows and m columns i .

[0095] Although the embodiments of the present invention have been shown and described, those of ordinary skill in the art can understand that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present invention. The scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A blockchain smart contract defect detection method based on big data, characterized in that: Build an intelligent contract detection model, which includes a data splitting layer, an encoding layer, a feature extraction layer, and a defect classification layer. The data splitting layer represents each contract as a matrix. The encoding layer encodes the representation matrix of the contract. The feature extraction layer extracts multi-scale features from the encoded matrix. The defect classification layer determines whether the contract has defects based on the multi-scale features.

2. According to a big data-based blockchain smart contract defect detection method according to claim 1, it is characterized in that: The process of representing each contract as a matrix includes: preprocessing the contract text, then representing each word in the contract through one-hot encoding, and then determining the position of the one-hot encoding of the word in the encoding matrix through positional encoding.

3. A method for detecting defects in blockchain smart contracts based on big data according to claim 1 or 2, characterized in that: The representation matrix of the contract is: X=WPM+[θ1,θ2,...,θ K ] Where X is a contract representation matrix, N is the dimension of the row vector of the contract representation matrix; WPM is the word position matrix in the contract text representing N dimensions; θ k The vector representation of the k-th word in the contract, k∈{1,2,…,K}, the vector representation dimension of each word is N, the k-th dimension value of the k-th word is 1, and the other dimension values ​​are 0.

4. According to a big data-based blockchain smart contract defect detection method according to claim 3, it is characterized in that: In the matrix WPM, the loc-th row represents the position information of the loc-th word. The value of the j-th column in each row is the relationship between the loc-th word and the j-th word. When j≥loc, its value is 0; when j<loc and loc is even, its value is expressed as: When j<loc and loc is odd, the corresponding element in the position matrix is expressed as: Among them, α represents the weighting coefficient; l k Indicates the position of the loc-th word in the sentence; d k represents the dimension of WPM; 2i represents an even dimension and 2i≤d k , 2i+1 indicates an odd dimension and 2i+1≤d k ; Softmax represents the normalization function.

5. According to a big data-based blockchain smart contract defect detection method according to claim 1, it is characterized in that: The process of the encoding layer encoding the representation matrix of the contract includes: Using three cascaded fully connected layers to process the matrix representation of the contract, and then mapping the outputs of the fully connected layers respectively to obtain the corresponding search matrix, basis matrix, and evaluation matrix; Introduce a lower triangular matrix Hide matrix, use this matrix to occlude the search matrix and the basis matrix, and then multiply them with the evaluation matrix to obtain an intermediate matrix, and use this intermediate matrix to update the evaluation matrix; Normalize the search matrix, basis matrix, and evaluation matrix, and use the normalized values to update the search matrix and the basis matrix; Take the updated search matrix, basis matrix, and evaluation matrix as the output of the encoding matrix.

6. According to a big data-based blockchain smart contract defect detection method according to claim 5, it is characterized in that: The process of mapping the features output by the cascaded fully connected layers respectively to obtain the corresponding search matrix, basis matrix, and evaluation matrix includes: S i =(XR S +X T R S T ) 2 ,B i =(XR B +X T R B T ) 2 ,V i =(XR V +X T R V T ) 2 Among them, S i represents the search matrix of the i-th contract; X is the feature output of the cascaded fully connected layer, X T represents the transpose of matrix X; R S is the learning matrix of the search matrix; B i represents the basis matrix of the ith contract; R B is the learning matrix of the basis matrix; V i represents the evaluation matrix of the i-th contract; R V is the learning matrix for the evaluation matrix.

7. A method for detecting defects in blockchain smart contracts based on big data according to claim 5 or 6, characterized in that: The process of updating the evaluation matrix includes: V i ′=(Z i R V +Z i T R V T ) 2 Among them, V i ′ is the updated evaluation matrix; R V is the learning matrix of the evaluation matrix; Z i is an intermediate matrix; Hide is a lower triangular matrix; represents bitwise multiplication operation, |·| represents the matrix modulus operation, d k Represents Z i The dimensions of the matrix.

8. A method for detecting defects in blockchain smart contracts based on big data according to claim 5 or 6, characterized in that: The process of normalizing the search matrix, basis matrix, and evaluation matrix includes: Among them, score i represents the encoding matrix of the i-th contract; S i represents the search matrix of the i-th contract; B i represents the basis matrix of the ith contract, B i T Denotes the basis matrix B i The transpose of V i represents the evaluation matrix of the i-th contract; m c represents the data volume of the contract text, ln(·) represents the natural logarithm function; W 0 is the learnable matrix parameter.

9. The method for detecting defects in blockchain smart contracts based on big data according to claim 8 is characterized in that: The process of using the normalized values to update the search matrix and the basis matrix includes: S i ′=(score i R S +score T R S T ) 2 B i ′=(score i R B +score i T R B T ) 2 Among them, S i ′ represents the updated search matrix; R S is the learning matrix of the search matrix; B i ′ represents the updated basis matrix; R B is the learning matrix of the basis matrix.

10. The method for detecting defects in blockchain smart contracts based on big data according to claim 4 is characterized in that: The process of the feature extraction layer extracting multi-scale features from the encoding matrix includes: Introduce non-linearity to the encoding matrix through the Relu activation function; Then splice the encoding matrices of all contracts in the intelligent contract together to obtain a 7×21 matrix, and use a convolutional layer with 16 convolutional kernels of size 3×1 and a stride of 1 to perform convolution operations on the matrix, and the result outputs a 5×21×6 matrix; Then use a max pooling operation with a pooling window of size 2 and a stride of 2 to obtain a 3×11×16 feature matrix; Then use a 1×1 convolutional layer to perform convolution to reduce the number of channels, and output a 3×11×21 feature matrix; Then flatten the multi-dimensional matrix, input the obtained one-dimensional feature matrix into the fully connected layer, and output 21 neurons through the fully connected layer; Finally, reshape the 21 neurons to output a 7×3 feature matrix, and take this matrix as the multi-scale feature.