Transaction matchmaking smart contract credible analysis method based on quantitative low-rank adaptive fine tuning

By quantifying the low-rank adaptation fine-tuning method, high-quality data sets are generated and large language models are optimized, the problems of low code coverage and poor scalability of transaction matching smart contract vulnerability analysis are solved, efficient and accurate vulnerability detection and logical error understanding are achieved, and the security and reliability of the contract are improved.

CN120493264APending Publication Date: 2025-08-15BEIJING INST OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510616675.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-14
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

The existing automated transaction matching smart contract vulnerability analysis methods have problems such as low code coverage, poor scalability and high computing requirements for large language models, making it difficult to effectively detect and understand complex logical errors.

Method used

Using a method based on quantitative low-rank adaptation fine-tuning, high-quality data sets are generated through data cleaning and knowledge distillation, pre-trained large language models are fine-tuned, and the model is optimized to improve the accuracy and efficiency of its vulnerability analysis in transaction matching smart contracts.

Benefits of technology

It realizes efficient and accurate vulnerability detection of transaction matching smart contracts, can understand complex logical errors, improves the security and reliability of the contract, and has certain scalability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120493264A_ABST
    Figure CN120493264A_ABST
Patent Text Reader

Abstract

The invention provides a transaction matchmaking smart contract credible analysis method based on quantitative low-rank adaptive fine tuning. The method comprises the following steps: performing knowledge distillation on a transaction matchmaking smart contract code library and transaction matchmaking smart contract audit information to generate a preprocessed data set; performing data cleaning on the preprocessed data set to obtain a data set after data cleaning; performing fine tuning on a pre-trained large language model by using a quantized low-rank adaptation method and using the data set after data cleaning to obtain a trained model; optimizing the trained model to obtain a trained model; and performing vulnerability analysis on the transaction matching smart contract by using the trained model. According to the method, the pre-trained large language model is finely adjusted by using the quantitative low-rank adaptation method, so that the finely-adjusted model not only can be excellent in the aspect of detecting specific vulnerabilities, but also can be used for understanding complex logic errors. The capabilities improve the overall security and reliability of the transaction matchmaking smart contract.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of blockchain technology, and in particular to a trustworthy analysis method for transaction matching smart contracts based on quantitative low-rank adaptive fine-tuning. Background Art

[0002] In recent years, with the rapid development of blockchain technology, the application of smart contracts in decentralized systems has become increasingly widespread. As self-executing program protocols, transaction matching smart contracts can automatically execute contract terms under preset conditions, reducing reliance on intermediaries and enabling highly automated and trusted transactions. Due to their unique advantages, transaction matching smart contracts have been widely used in many fields, particularly in decentralized finance, where they have become a major driving force in the development of blockchain technology. However, code vulnerabilities and logical errors in transaction matching smart contracts pose serious security risks. Several high-profile attacks in recent years have exposed the vulnerabilities of transaction matching smart contracts. If maliciously exploited, these vulnerabilities can result in significant financial losses and invalidate contract functionality.

[0003] Smart contract auditing is a comprehensive inspection process that aims to carefully analyze the contract code, identify security vulnerabilities, coding issues and inefficiencies, and propose corresponding improvement measures to improve the security and operational efficiency of the contract. This process is particularly important to the overall functionality and integrity of blockchain applications because once a smart contract is deployed, its code cannot be changed, which is almost equivalent to legal provisions. Any errors or vulnerabilities in the code are extremely expensive to fix after going online, often accompanied by huge costs and delays, and usually require redevelopment and release of new versions. In the field of decentralized finance, auditors will conduct in-depth analysis of the protocol's code base, looking for potential errors and inefficiencies to ensure the security and defense capabilities of smart contracts. Due to the immutable nature of blockchain technology, any defects in the code may result in irreversible loss of user funds

[0004] However, manual audits are time-consuming and labor-intensive, and often fail to cover a wide range of vulnerability types in transaction-matching smart contracts. To address this, the research community has incorporated traditional program vulnerability analysis techniques, such as static analysis techniques like symbolic execution, intermediate representation, and formal verification, as well as dynamic analysis techniques like fuzz testing. By establishing rules for the logic of smart contract vulnerabilities, they are developing automated smart contract vulnerability analysis tools. Furthermore, large language models, including BERT, T5, and GPT, have demonstrated potential in extracting key features for vulnerability detection and providing accurate predictions, opening up a new direction for automated vulnerability analysis in smart contracts. Some researchers have already applied large language models to automatically audit smart contracts.

[0005] Although these models have been adopted by most researchers, existing methods for analyzing vulnerabilities in automated trading smart contracts have the following shortcomings:

[0006] Low code coverage: Symbolic execution and formal verification techniques face the problem of state explosion when processing programs with many alternative branches, resulting in low code coverage and difficulty in discovering deeper vulnerabilities.

[0007] Poor scalability: In the specific field of smart contract vulnerability detection for transaction matching, the detection logic for different types of vulnerabilities varies greatly. When writing automated analysis tools, different detectors need to be designed for different vulnerabilities, making it difficult to expand to new types of vulnerabilities.

[0008] Large language models have poor performance for specific downstream tasks: Although large language models are powerful and can perform multi-tasking, they are often too large for domain-specific tasks such as transaction matching and smart contract auditing. The computational requirements of using large language models far exceed the capabilities of most users. In addition, large language models contain redundant data, which will reduce performance in certain domain-specific tasks.

[0009] In summary, it is necessary to propose an automated transaction matching smart contract vulnerability analysis method that is both highly scalable and efficient, can cover the current typical transaction matching smart contract vulnerability types, and can achieve a balance between detection accuracy and efficiency. Summary of the Invention

[0010] In order to overcome the shortcomings of the existing technology, the purpose of the present invention is to provide a trustworthy analysis method for transaction matching smart contracts based on quantitative low-rank adaptive fine-tuning.

[0011] To achieve the above object, the present invention provides the following solutions:

[0012] A trustworthy analysis method for transaction matching smart contracts based on quantitative low-rank adaptive fine-tuning includes:

[0013] Step 1: Collect transaction matching smart contract code base and transaction matching smart contract audit information from different sources;

[0014] Step 2: Perform knowledge distillation on the transaction matching smart contract code base and transaction matching smart contract audit information to generate a preprocessed dataset;

[0015] Step 3: Clean the preprocessed data set to obtain a cleaned data set;

[0016] Step 4: Using the quantized low-rank adaptation method to fine-tune the pre-trained large language model using the data cleaned dataset to obtain a trained model;

[0017] Step 5: Optimize the trained model to obtain a trained model;

[0018] Step 6: Use the trained model to perform vulnerability analysis on the transaction matching smart contract.

[0019] Preferably, the step 2: performing knowledge distillation on the transaction matching smart contract code base and the transaction matching smart contract audit information to generate a preprocessed data set includes:

[0020] Step 2.1: Crawl the open-source transaction matching smart contract code base on the Internet and select the large language model fine-tuning data that meets the preset conditions;

[0021] Step 2.2: Collect transaction matching smart contract audit information and organize it into three parts: vulnerability type, Solidity smart contract source code, and audit report to form the first structured data set;

[0022] Step 2.3: Use the knowledge distillation method to generate the second structured data through the large language model based on the fine-tuning data of the large language model;

[0023] Step 2.4: Merge the first structured data set and the second structured data set to obtain a preprocessed data set.

[0024] Preferably, step 2.3: using a knowledge distillation method to generate second structured data using the large language model based on the fine-tuning data of the large language model, includes:

[0025] Step 2.3.1: Set up the existing large language model as a three-part proxy, including a distillation agent, a development agent, and a security agent;

[0026] Step 2.3.2: Use the distillation agent to process the large language model fine-tuning data and set vulnerability labels for the data of vulnerability types;

[0027] Step 2.3.3: Use the development agent to process the large language model fine-tuning data to generate transaction matching smart contract code containing preset vulnerabilities to increase the number of negative samples in the training set;

[0028] Step 2.3.4: Use the security agent to process the large language model fine-tuning data to generate the repaired secure transaction matching smart contract code, which is used as the positive sample of the training set.

[0029] Preferably, the step 3: performing data cleaning on the preprocessed data set to obtain a data cleaned data set includes:

[0030] Step 3.1: Obtain the transaction matching smart contract source code from the preprocessed dataset;

[0031] Step 3.2: Use the MD5 algorithm to calculate the file fingerprint of the transaction matching smart contract source code, and deduplicate the file fingerprint to obtain a deduplicated dataset;

[0032] Step 3.3: Align the number of positive and negative samples of the deduplicated dataset to obtain the cleaned dataset.

[0033] Preferably, the step 4: using the quantized low-rank adaptation method to fine-tune the pre-trained large language model using the data set after data cleaning to obtain a trained model includes:

[0034] Step 4.1: Select Llama3-8b, Gemma-7B, CodeGemma-7B, or Mistral-7B as the pre-trained large language model;

[0035] Step 4.2: Input the cleaned dataset into the pre-trained large language model;

[0036] Step 4.3: Use the quantized low-rank adaptation method to supervise the fine-tuning of the pre-trained large language model to obtain the trained model.

[0037] Preferably, the step 5: optimizing the trained model to obtain a trained model includes:

[0038] Step 5.1: Calculate the recall, precision, and F1 score of the trained model.

[0039] Step 5.2: When the recall, precision, and F1 score of the trained model are not within the preset range, re-use the quantized low-rank adaptation method to perform supervised fine-tuning on the pre-trained large language model.

[0040] The present invention also provides a transaction matching smart contract trust analysis system based on quantitative low-rank adaptive fine-tuning, including:

[0041] The data collection module is used to collect transaction matching smart contract code base and transaction matching smart contract audit information from different sources;

[0042] The data processing module is used to perform knowledge distillation on the transaction matching smart contract code base and transaction matching smart contract audit information to generate a preprocessed data set;

[0043] A data cleaning module is used to clean the preprocessed data set to obtain a cleaned data set;

[0044] A fine-tuning module, configured to use a quantized low-rank adaptation method to fine-tune the pre-trained large language model using the data set after data cleaning to obtain a trained model;

[0045] A training module, configured to optimize the trained model to obtain a trained model;

[0046] The data analysis module is used to use the trained model to perform vulnerability analysis on the transaction matching smart contract.

[0047] The present invention also provides an electronic device, comprising a bus, a transceiver, a memory, a processor, and a computer program stored on the memory and runnable on the processor, wherein the transceiver, the memory, and the processor are connected via the bus, and is characterized in that when the computer program is executed by the processor, the steps in the above-mentioned method for trusted analysis of transaction matching smart contracts based on quantitative low-rank adaptive fine-tuning are implemented.

[0048] The present invention also provides a computer-readable storage medium having a computer program stored thereon, characterized in that when the computer program is executed by a processor, the steps in the above-mentioned transaction matching smart contract trust analysis method based on quantitative low-rank adaptive fine-tuning are implemented.

[0049] The beneficial effect of the trust analysis method for transaction matching smart contracts based on quantitative low-rank adaptive fine-tuning provided by this invention is that, compared with existing technologies, by using quantitative low-rank adaptive methods to fine-tune a pre-trained large language model, the fine-tuned model not only excels in detecting specific vulnerabilities but also can understand complex logical errors. These capabilities improve the overall security and reliability of transaction matching smart contracts. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0051] Figure 1 This is a flow chart of the trust analysis method for transaction matching smart contracts based on quantitative low-rank adaptive fine-tuning provided by the present invention;

[0052] Figure 2 Schematic diagram of the trust analysis method for transaction matching smart contracts based on quantitative low-rank adaptive fine-tuning provided by the present invention. DETAILED DESCRIPTION

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

[0054] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0055] The terms "first," "second," "third," and "fourth," etc., in the specification, claims, and drawings of this application are used to distinguish between different items, not to describe a particular order. Furthermore, the terms "including," "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a statement that a sequence of steps, a process, or a method is included is not limited to the listed steps but may optionally include steps not listed, or may optionally include other steps inherent to the process, method, product, or apparatus.

[0056] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0057] See also Figure 1-2 , a trustworthy analysis method for transaction matching smart contracts based on quantitative low-rank adaptive fine-tuning, including:

[0058] Step 1: Collect transaction matching smart contract code base and transaction matching smart contract audit information from different sources;

[0059] Dataset collection is crucial for a model's ability to understand and discover vulnerabilities in transaction-matching smart contract code. This step requires ensuring sufficient available information is collected to facilitate subsequent processing and refinement into high-quality training data.

[0060] Step 2: Perform knowledge distillation on the transaction matching smart contract code base and transaction matching smart contract audit information to generate a preprocessed dataset;

[0061] Specifically, step 2 includes:

[0062] Step 2.1: Crawl the open source transaction matching smart contract code base on the Internet and filter out the large language model fine-tuning data that meets the preset conditions; in this invention, manual preliminary screening of high-quality data D that can be used for large language model fine-tuning can be used. i .

[0063] Step 2.2: Collect transaction matching smart contract audit information and organize it into three parts: vulnerability type, Solidity smart contract source code, and audit report to form the first structured dataset D s ;

[0064] Step 2.3: Use knowledge distillation to fine-tune the data D with a large language model i Based on the large language model, the second structured data D is generated s ;

[0065] In step 2.3, include:

[0066] Step 2.3.1: Set up the existing large language model as a three-part agent, including a distillation agent, a development agent, and a security agent. Data generation is achieved by the interaction of these three agents.

[0067] Step 2.3.2: Use the distillation agent to process the large language model fine-tuning data and assign vulnerability labels to the vulnerable data to improve the understandability of the source code of the vulnerable transaction matching smart contract.

[0068] Extract Prompt-Response data pairs that have teaching value for the student model (the large model to be fine-tuned) from the original data, that is, smart contracts with vulnerability labels. Suppose the output of the teacher model is:

[0069] p T (y i |x)

[0070] The student model output is:

[0071] p S (y i |x)

[0072] The goal is to minimize the KL divergence:

[0073]

[0074] Among them, x represents the input prompt, y represents the i-th possible output token, and p T represents the output probability distribution of the teacher model, p S Represents the output probability distribution of the student model. In this way, the student model can learn the "knowledge" of the teacher model, thus completing the distillation agent process.

[0075] Step 2.3.3: Use the development agent to process the large language model fine-tuning data to generate transaction matching smart contract code containing preset vulnerabilities to increase the number of negative samples in the training set;

[0076] Step 2.3.4: Use the security agent to process the large language model fine-tuning data to generate the repaired secure transaction matching smart contract code, which is used as the positive sample of the training set.

[0077] Step 2.4: Merge the first structured data set and the second structured data set to obtain a preprocessed data set.

[0078] Step 3: Clean the preprocessed data set to obtain a cleaned data set;

[0079] In step 3, include:

[0080] Step 3.1: Obtain the transaction matching smart contract source code from the preprocessed dataset;

[0081] Step 3.2: Use the MD5 algorithm to calculate the file fingerprint of the transaction matching smart contract source code, and deduplicate the file fingerprint to obtain a deduplicated dataset;

[0082] Step 3.3: Align the number of positive and negative samples in the deduplicated dataset, i.e., reduce the number of secure transaction matching smart contract data to be consistent with the number of vulnerable transaction matching smart contract data, and obtain the cleaned dataset.

[0083] Step 4: Using the quantized low-rank adaptation method to fine-tune the pre-trained large language model using the data cleaned dataset to obtain a trained model;

[0084] Furthermore, step 4 includes:

[0085] Step 4.1: Select Llama3-8b, Gemma-7B, CodeGemma-7B, or Mistral-7B as the pre-trained large language model;

[0086] Step 4.2: Randomly select 80% of the data from the cleaned dataset to form the training set and input it into the pre-trained large language model;

[0087] Step 4.3: Use the quantized low-rank adaptation method to supervise the fine-tuning of the pre-trained large language model to obtain the trained model.

[0088] In practical applications, this invention can reduce the memory usage of model parameters through quantized low-rank adaptation techniques, enabling efficient fine-tuning. After iterating until the loss function converges, a model with improved capabilities for the downstream task of analyzing vulnerabilities in automated trading smart contracts is obtained.

[0089] Step 5: Optimize the trained model to obtain a trained model;

[0090] In step 5, the trained model is optimized to obtain a trained model, including:

[0091] Step 5.1: Use the benchmark dataset to evaluate the accuracy of the trained model in identifying vulnerabilities in the trade matching smart contract. Obtain the number of true positives, false positives, true negatives, and false negatives, and then calculate the recall rate, precision rate, and F1 score.

[0092] Step 5.2: Use the validation dataset to test the model’s performance in real-world scenarios, including its ability to detect complex logic vulnerabilities and subtle security flaws.

[0093] Step 5.3: Based on the above testing process, analyze the accuracy and robustness of the model in identifying vulnerabilities in transaction matching smart contracts and obtain detailed evaluation results E;

[0094] Step 5.4: Iteratively analyze the evaluation results E, identify the strengths and weaknesses of the model, and continuously optimize the model and update the dataset to achieve the effect of continuous learning of the large language model.

[0095] Specifically, step 5.4 includes the following steps:

[0096] Use a dynamic weight strategy to balance label prediction loss and reason prediction loss; update the dataset based on feedback to ensure that the model adapts to the latest vulnerability information; iteratively analyze the evaluation results and adjust the model parameters.

[0097] Step 6: Use the trained model to perform vulnerability analysis on the transaction matching smart contract.

[0098] Compared with the prior art, the method of the present invention has the following advantages:

[0099] 1. Automated Framework: This paper proposes a single-task learning framework for auditing smart contracts in trade matching. This framework integrates four phases: data preparation, training, evaluation, and continuous learning. This allows researchers and practitioners to focus on improving model accuracy and performance.

[0100] 2. Dataset Generation: This paper provides a method for generating high-quality datasets specifically for auditing trade matching smart contracts. This method extracts the essence of the data through hinting techniques. This ensures that the dataset covers a wide range of vulnerability types and is representative of many real-world scenarios.

[0101] 3. Adaptive Learning: This paper introduces a novel adaptive training framework that improves data and models through iterative feedback during each training round. This approach addresses the challenge of incorporating new knowledge without introducing noise, thus avoiding performance degradation. By continuously updating the model with high-quality data and maintaining its core capabilities, the model remains robust and accurate over time.

[0102] 4. Vulnerability Detection: Through effective fine-tuning, the fine-tuned model not only excels at detecting specific vulnerabilities, but also understands complex logical errors and subtle security vulnerabilities. These capabilities improve the overall security and reliability of transaction matching smart contracts.

[0103] 5. Model Scalability: Although primarily designed for auditing smart contracts for trading, the framework's inherent flexibility allows it to be extended to other areas that require similar large language model solutions. The framework's versatility allows it to address code.

[0104] The present invention also provides a transaction matching smart contract trust analysis system based on quantitative low-rank adaptive fine-tuning, including:

[0105] The data collection module is used to collect transaction matching smart contract code base and transaction matching smart contract audit information from different sources;

[0106] The data processing module is used to perform knowledge distillation on the transaction matching smart contract code base and transaction matching smart contract audit information to generate a preprocessed data set;

[0107] A data cleaning module is used to clean the preprocessed data set to obtain a cleaned data set;

[0108] A fine-tuning module, configured to use a quantized low-rank adaptation method to fine-tune the pre-trained large language model using the data set after data cleaning to obtain a trained model;

[0109] A training module, configured to optimize the trained model to obtain a trained model;

[0110] The data analysis module is used to use the trained model to perform vulnerability analysis on the transaction matching smart contract.

[0111] The present invention also provides an electronic device comprising a bus, a transceiver, a memory, a processor, and a computer program stored in the memory and executable on the processor. The transceiver, the memory, and the processor are connected via the bus, and when the computer program is executed by the processor, the steps of the above-mentioned method for trustworthy analysis of transaction matching smart contracts based on quantitative low-rank adaptive fine-tuning are implemented. Compared with the prior art, the beneficial effects of the electronic device provided by the present invention are the same as those of the method for trustworthy analysis of transaction matching smart contracts based on quantitative low-rank adaptive fine-tuning described in the above-mentioned technical solution, and are not further elaborated here.

[0112] The present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the aforementioned method for trustworthy analysis of transaction-matching smart contracts based on quantitative low-rank adaptive fine-tuning. Compared to the prior art, the beneficial effects of the computer-readable storage medium provided by the present invention are the same as those of the method for trustworthy analysis of transaction-matching smart contracts based on quantitative low-rank adaptive fine-tuning described in the aforementioned technical solution, and are not further elaborated here.

[0113] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Reference can be made to the description of the similarities between the various embodiments. For the methods disclosed in the embodiments, since they correspond to the devices disclosed in the embodiments, the description is relatively simple, and the relevant details can be referred to the description of the devices.

[0114] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The above examples are only intended to help understand the method and core concept of the present invention. At the same time, those skilled in the art will find that the specific implementation methods and application scopes may vary based on the concept of the present invention. In summary, the contents of this specification should not be construed as limiting the present invention.

Claims

1. A trustworthy analysis method for transaction matching smart contracts based on quantitative low-rank adaptive fine-tuning, characterized by: include: Step 1: Collect transaction matching smart contract code base and transaction matching smart contract audit information from different sources; Step 2: Perform knowledge distillation on the transaction matching smart contract code base and transaction matching smart contract audit information to generate a preprocessed dataset; Step 3: Clean the preprocessed data set to obtain a cleaned data set; Step 4: Using the quantized low-rank adaptation method to fine-tune the pre-trained large language model using the data cleaned dataset to obtain a trained model; Step 5: Optimize the trained model to obtain a trained model; Step 6: Use the trained model to perform vulnerability analysis on the transaction matching smart contract.

2. The transaction matching smart contract trust analysis method based on quantitative low-rank adaptive fine-tuning according to claim 1 is characterized in that: Step 2: performing knowledge distillation on the transaction matching smart contract code base and the transaction matching smart contract audit information to generate a preprocessed data set, including: Step 2.1: Crawl the open-source transaction matching smart contract code base on the Internet and select the large language model fine-tuning data that meets the preset conditions; Step 2.2: Collect transaction matching smart contract audit information and organize it into three parts: vulnerability type, Solidity smart contract source code, and audit report to form the first structured data set; Step 2.3: Use the knowledge distillation method to generate the second structured data through the large language model based on the fine-tuning data of the large language model; Step 2.4: Merge the first structured data set and the second structured data set to obtain a preprocessed data set.

3. The transaction matching smart contract trust analysis method based on quantitative low-rank adaptive fine-tuning according to claim 2 is characterized in that: Step 2.3: Using the knowledge distillation method, based on the fine-tuning data of the large language model, to generate second structured data through the large language model, includes: Step 2.3.1: Set up the existing large language model as a three-part proxy, including a distillation agent, a development agent, and a security agent; Step 2.3.2: Use the distillation agent to process the large language model fine-tuning data and set vulnerability labels for the data of vulnerability types; Step 2.3.3: Use the development agent to process the large language model fine-tuning data to generate transaction matching smart contract code containing preset vulnerabilities to increase the number of negative samples in the training set; Step 2.3.4: Use the security agent to process the large language model fine-tuning data to generate the repaired secure transaction matching smart contract code, which is used as the positive sample of the training set.

4. The transaction matching smart contract trust analysis method based on quantitative low-rank adaptive fine-tuning according to claim 3 is characterized in that: Step 3: performing data cleaning on the preprocessed data set to obtain a cleaned data set, including: Step 3.1: Obtain the transaction matching smart contract source code from the preprocessed dataset; Step 3.2: Use the MD5 algorithm to calculate the file fingerprint of the transaction matching smart contract source code, and deduplicate the file fingerprint to obtain a deduplicated dataset; Step 3.3: Align the number of positive and negative samples of the deduplicated dataset to obtain the cleaned dataset.

5. The transaction matching smart contract trust analysis method based on quantitative low-rank adaptive fine-tuning according to claim 4 is characterized in that: Step 4: using the data cleaned dataset to fine-tune the pre-trained large language model using a quantized low-rank adaptation method to obtain a trained model, including: Step 4.1: Select Llama3-8b, Gemma-7B, CodeGemma-7B, or Mistral-7B as the pre-trained large language model; Step 4.2: Input the cleaned dataset into the pre-trained large language model; Step 4.3: Use the quantized low-rank adaptation method to supervise the fine-tuning of the pre-trained large language model to obtain the trained model.

6. The transaction matching smart contract trust analysis method based on quantitative low-rank adaptive fine-tuning according to claim 5 is characterized in that: The step 5: optimizing the trained model to obtain a trained model, including: Step 5.1: Calculate the recall, precision, and F1 score of the trained model. Step 5.2: When the recall, precision, and F1 score of the trained model are not within the preset range, re-use the quantized low-rank adaptation method to perform supervised fine-tuning on the pre-trained large language model.

7. A trustworthy analysis system for transaction matching smart contracts based on quantitative low-rank adaptive fine-tuning, characterized by: include: The data collection module is used to collect transaction matching smart contract code base and transaction matching smart contract audit information from different sources; The data processing module is used to perform knowledge distillation on the transaction matching smart contract code base and transaction matching smart contract audit information to generate a preprocessed data set; A data cleaning module is used to clean the preprocessed data set to obtain a cleaned data set; A fine-tuning module, configured to use a quantized low-rank adaptation method to fine-tune the pre-trained large language model using the data set after data cleaning to obtain a trained model; A training module, configured to optimize the trained model to obtain a trained model; The data analysis module is used to use the trained model to perform vulnerability analysis on the transaction matching smart contract.

8. An electronic device comprising a bus, a transceiver, a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the transceiver, the memory, and the processor are connected via the bus, wherein: When the computer program is executed by the processor, the steps of the transaction matching smart contract trust analysis method based on quantitative low-rank adaptive fine-tuning according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the transaction matching smart contract trust analysis method based on quantitative low-rank adaptive fine-tuning according to any one of claims 1 to 6 are implemented.