Smart contract enhanced data aggregation method based on large language model and block chain collaboration

By constructing the C-LLM framework and the Sentence-BERT model, the semantic understanding and data consistency issues of blockchain smart contracts are solved, enabling secure data interaction and efficient data aggregation with LLMs, thereby improving the intelligence capabilities and data accuracy of smart contracts.

CN121350091APending Publication Date: 2026-01-16浪潮智慧城市科技有限公司
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202511351140.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-22
Publication Date
2026-01-16

AI Technical Summary

Technical Problem

Blockchain smart contracts lack semantic understanding and dynamic reasoning capabilities, making it impossible to interact seamlessly with high-performance AI models. Furthermore, the consistency of text data is difficult to handle, leading to data silos and malicious node attacks.

Method used

A general framework, C-LLM, is constructed, which combines Sentence-BERT semantic similarity analysis and truth discovery methods. It achieves secure data interaction between blockchain and LLMs through a four-layer architecture and uses a semantically enhanced data aggregation method to handle inconsistencies and malicious node attacks.

Benefits of technology

It achieves universal collaboration between blockchain and LLMs, improves the semantic understanding and reasoning capabilities of smart contracts, effectively resists malicious node attacks, improves data accuracy by 17.74%, supports multiple LLM models and scenarios, and reduces API call costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121350091A_ABST
    Figure CN121350091A_ABST
Patent Text Reader

Abstract

The invention discloses an intelligent contract enhanced data aggregation method based on large-scale language model and block chain cooperation, and relates to a block chain technology, large-scale language model application and data aggregation. Comprising the following steps: step 1, constructing a universal collaborative framework C-LLM which adopts a four-layer architecture of a user contract layer, an oracle contract layer, an oracle network layer and an LLMs layer, and performing secure data circulation between a block chain and the LLMs by utilizing hierarchical interaction; and step 2, in combination with a Sension-BERT semantic similarity analysis and truth discovery method, defining a semantic enhanced data aggregation method, and processing inconsistency of LLM generated texts and malicious node attacks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention discloses a data aggregation method based on smart contracts enhanced by collaboration between large language models and blockchain, involving blockchain technology, large language model applications, and data aggregation. Background Technology

[0002] Blockchain smart contracts, by automating the execution of preset rules, have been widely used in decentralized finance, supply chain traceability, energy management, and other fields, but they also have significant limitations:

[0003] (1) Insufficient intelligence: It can only execute fixed logic and lacks semantic understanding, dynamic reasoning and other capabilities, making it unable to cope with complex scenarios such as legal document analysis and dynamic risk assessment.

[0004] (2) Technical barriers: Blockchain is limited by computing / storage resources, making it difficult to directly integrate high-performance AI models such as LLMs, and data silos prevent seamless interaction between the two;

[0005] (3) Data consistency problem: The LLM generation results have inherent randomness. Existing oracle numerical aggregation methods such as majority voting and median cannot process text data, leading to difficulties in consensus.

[0006] While there have been attempts to connect blockchains and LLMs via oracles in existing technologies, the issues of semantic consistency of text data and malicious node attacks have not been resolved, which limits the intelligent upgrade of smart contracts and is not conducive to data aggregation. Summary of the Invention

[0007] This invention addresses the problems of existing technologies by providing a data aggregation method for smart contracts that enhances collaboration between large-scale language models and blockchain. It constructs a general framework (C-LLM) to achieve secure data interaction between blockchain and LLMs, breaking down data silos. It also designs an aggregation method (SenteTruth) suitable for LLM text data, solving the problems of data inconsistency and malicious node attacks, improving the semantic understanding and reasoning capabilities of smart contracts, and expanding their application in complex and dynamic scenarios.

[0008] The specific solution proposed in this invention is as follows:

[0009] This invention provides a data aggregation method based on smart contracts enhanced by collaboration between a large language model and blockchain, comprising:

[0010] Step 1: Construct a general collaborative framework C-LLM. The general collaborative framework C-LLM adopts a four-layer architecture of user contract layer, oracle contract layer, oracle network layer and LLMs layer, and uses layer-by-layer interaction to achieve secure data flow between blockchain and LLMs.

[0011] Step 2: Combining Sentence-BERT semantic similarity analysis and truth discovery methods, define a semantically enhanced data aggregation method to handle inconsistencies in LLM-generated text and malicious node attacks:

[0012] Perform semantic similarity analysis:

[0013] The Sentence-BERT model is used to convert the text data of each node into fixed-length embedding vectors. Cosine similarity between vectors is calculated to obtain a semantic association score for each node's text data. This score measures the overall semantic similarity of a node's result with all other node results. A higher semantic association score indicates stronger semantic consistency and greater reliability between the corresponding node result and the majority of node results, thus helping to identify anomalous data.

[0014] Truth discovery and credibility update: Truth aggregation is performed by combining node credibility and semantic association score, and credibility is dynamically adjusted based on the semantic similarity between node data and aggregation results to suppress malicious nodes.

[0015] Furthermore, in step 1 of the data aggregation method enhanced by smart contracts based on large-scale language models and blockchain collaboration, smart contracts are deployed on the blockchain based on the user contract layer:

[0016] Task definition: Encapsulate task information using the Solidity struct Task. Task information includes a unique task identifier, requester address, natural language question, target LLM model, timestamp, and task status.

[0017] Provides an API: The `requestLLMAnalysis` function is provided through this API to send a request to the oracle contract and pay gas fees.

[0018] Result reception: The business logic is triggered after the aggregation result is received and verified using the callback function onLLMResult.

[0019] Furthermore, in step 1 of the data aggregation method enhanced by smart contracts based on large-scale language models and blockchain collaboration, an oracle contract layer serves as an intermediary contract:

[0020] An event broadcasting mechanism is established: upon receiving a task request, the TaskRequested event is triggered and broadcast to the oracle nodes via the blockchain log.

[0021] Node management: Maintain the nodeWhitelist mapping table to record node addresses and staking deposits; implement node admission through the registerNode() function; and punish malicious nodes through the slashNode() function.

[0022] Upload the results to the blockchain: After verifying the integrity of the signature of the node consensus result, call the callback function of the user contract to return the data.

[0023] Furthermore, in step 1 of the data aggregation method based on smart contracts enhanced by large-scale language models and blockchain collaboration, a distributed network is formed based on independent nodes at the oracle node layer:

[0024] Perform event listening: Listen for oracle contract events using Web3.js, parse task parameters, and verify signatures.

[0025] Perform an LLM call: Call the corresponding API based on the modelType parameter.

[0026] Data encryption: Perform SHA-256 hash calculation on the LLM return result, broadcast the hash value first, and then broadcast the original data after a period of time.

[0027] Perform local aggregation: After each node collects all the data, it runs the SenteTruth algorithm to calculate candidate results.

[0028] Furthermore, in step 1 of the data aggregation method based on smart contracts enhanced by collaboration between large language models and blockchain, a multi-model compatible middleware is deployed based on the LLM adaptation layer, wherein a unified interface encapsulation is performed: the API differences of different LLMs are shielded, and a general function getLLMResponse is provided.

[0029] Cache results for identical questions with a similarity greater than 95 for a preset time to reduce API call costs;

[0030] Failover: When the primary model times out, the system automatically switches to the backup model.

[0031] This invention provides a data aggregation device based on smart contracts enhanced by collaboration between a large language model and blockchain, comprising a general collaborative framework C-LLM management module and a data aggregation processing module.

[0032] The general collaboration framework C-LLM management module constructs the general collaboration framework C-LLM. The general collaboration framework C-LLM adopts a four-layer architecture of user contract layer, oracle contract layer, oracle network layer and LLMs layer, and uses hierarchical interaction to achieve secure data circulation between blockchain and LLMs.

[0033] The data aggregation and processing module combines Sentence-BERT semantic similarity analysis with truth discovery methods to define a semantically enhanced data aggregation method, addressing inconsistencies in LLM-generated text and malicious node attacks.

[0034] Perform semantic similarity analysis:

[0035] The Sentence-BERT model is used to convert the text data of each node into fixed-length embedding vectors. Cosine similarity between vectors is calculated to obtain a semantic association score for each node's text data. This score measures the overall semantic similarity of a node's result with all other node results. A higher semantic association score indicates stronger semantic consistency and greater reliability between the corresponding node result and the majority of node results, thus helping to identify anomalous data.

[0036] Truth discovery and credibility update: Truth aggregation is performed by combining node credibility and semantic association score, and credibility is dynamically adjusted based on the semantic similarity between node data and aggregation results to suppress malicious nodes.

[0037] Furthermore, the general collaborative framework C-LLM management module of the data aggregation device based on large-scale language models and blockchain collaboration enhances smart contracts and deploys smart contracts on the blockchain based on the user contract layer:

[0038] Task definition: Encapsulate task information using the Solidity struct Task. Task information includes a unique task identifier, requester address, natural language question, target LLM model, timestamp, and task status.

[0039] Provides an API: The `requestLLMAnalysis` function is provided through this API to send a request to the oracle contract and pay gas fees.

[0040] Result reception: The business logic is triggered after the aggregation result is received and verified using the callback function onLLMResult.

[0041] Furthermore, the general collaborative framework C-LLM management module of the data aggregation device based on smart contracts enhanced by large-scale language models and blockchain collaboration is based on the oracle contract layer, serving as an intermediary contract:

[0042] An event broadcasting mechanism is established: upon receiving a task request, the TaskRequested event is triggered and broadcast to the oracle nodes via the blockchain log.

[0043] Node management: Maintain the nodeWhitelist mapping table to record node addresses and staking deposits; implement node admission through the registerNode() function; and punish malicious nodes through the slashNode() function.

[0044] Upload the results to the blockchain: After verifying the integrity of the signature of the node consensus result, call the callback function of the user contract to return the data.

[0045] Furthermore, the general collaborative framework C-LLM management module of the data aggregation device based on smart contracts enhanced by large-scale language models and blockchain collaboration is based on a distributed network composed of independent nodes at the oracle node layer:

[0046] Perform event listening: Listen for oracle contract events using Web3.js, parse task parameters, and verify signatures.

[0047] Perform an LLM call: Call the corresponding API based on the modelType parameter.

[0048] Data encryption: Perform SHA-256 hash calculation on the LLM return result, broadcast the hash value first, and then broadcast the original data after a period of time.

[0049] Perform local aggregation: After each node collects all the data, it runs the SenteTruth algorithm to calculate candidate results.

[0050] Furthermore, the general collaborative framework C-LLM management module of the data aggregation device based on smart contracts enhanced by large-scale language models and blockchain collaboration deploys multi-model compatible middleware based on the LLM adaptation layer, wherein a unified interface encapsulation is performed: the API differences of different LLMs are shielded and a general function getLLMResponse is provided.

[0051] Cache results for identical questions with a similarity greater than 95 for a preset time to reduce API call costs;

[0052] Failover: When the primary model times out, the system automatically switches to the backup model.

[0053] The advantages of this invention are:

[0054] (1) Breaking through technical barriers: The C-LLM framework is the first to realize the generalized collaboration between blockchain and LLMs, breaking down data silos and enabling smart contracts to directly call the semantic understanding and reasoning capabilities of LLMs;

[0055] (2) High reliability: In a scenario with 40% malicious nodes, the data accuracy of the method of this invention is improved by an average of 17.74% compared with the baseline such as SBERT similarity and majority voting, and effectively resists attacks such as random response and model replacement;

[0056] (3) Strong versatility: It supports a variety of LLM models such as ChatGPT, Gemini and other scenarios. Experiments have shown that it performs well on the BASE, MIX and PRO datasets.

[0057] (4) High practical deployment value: Based on Ethereum, the core interface gas cost is controllable, such as deployment of about 790,000 Gas and calls of about 270,000 Gas, and is compatible with the existing blockchain ecosystem. Attached Figure Description

[0058] Figure 1 This is a schematic diagram of the application process of the C-LLM framework of this invention.

[0059] Figure 2 This is a flowchart illustrating the application of the method of this invention. Detailed Implementation

[0060] The present invention will be further described below with reference to the accompanying drawings and specific embodiments, so that those skilled in the art can better understand and implement the present invention. However, the embodiments described are not intended to limit the present invention.

[0061] Example 1

[0062] This invention provides a data aggregation method based on smart contracts enhanced by collaboration between a large language model and blockchain, comprising:

[0063] Step 1: Construct a general collaborative framework C-LLM. The general collaborative framework C-LLM adopts a four-layer architecture of user contract layer, oracle contract layer, oracle network layer and LLMs layer, and uses layer-by-layer interaction to achieve secure data flow between blockchain and LLMs.

[0064] This involves deploying smart contracts on the blockchain based on the user contract layer:

[0065] Task definition: Encapsulate task information using the Solidity struct Task. Task information includes a unique task identifier, requester address, natural language question, target LLM model, timestamp, and task status, as shown below:

[0066]

[0067]

[0068] Provides an API: The API provides the function `requestLLMAnalysis(string memorytaskId, string memory question, string memory modelType)` to send a request to the oracle contract and pay gas fees.

[0069] Receive results: The business logic is triggered after receiving and verifying the aggregation result using the callback function onLLMResult(string memory taskId, string memoryresult).

[0070] Based on the oracle contract layer, as an intermediary contract:

[0071] An event broadcasting mechanism is established: Upon receiving a task request, the TaskRequested(string taskId, address requester) event is triggered and broadcast to the oracle node via the blockchain log.

[0072] Node management: Maintain the nodeWhitelist mapping table to record node addresses and staking deposits; implement node admission through the registerNode() function; and punish malicious nodes through the slashNode() function.

[0073] Upload the results to the blockchain: After verifying the integrity of the signature of the node consensus result, call the callback function of the user contract to return the data.

[0074] A distributed network is composed of independent nodes based on an oracle node layer:

[0075] Perform event listening: Listen for oracle contract events using Web3.js, parse task parameters, and verify signatures.

[0076] To make an LLM call: Call the corresponding API, such as OpenAI's chat / completions interface, based on the modelType parameter. Example request format:

[0077] {

[0078] "model":"gpt-4o-mini",

[0079] "messages":[{"role":"user","content":"Determine whether the insurance claim meets the terms and conditions"}],

[0080] "temperature": 0.1

[0081] }

[0082] Data encryption is performed: the LLM return result is hashed using SHA-256, the hash value (taskId, nodeId, hash) is broadcast first, and the original data is broadcast after a period of time.

[0083] Perform local aggregation: After each node collects all the data, it runs the SenteTruth algorithm to calculate candidate results.

[0084] Deploy middleware that is compatible with multiple models based on the LLM adaptation layer, which encapsulates a unified interface: shielding the API differences between different LLMs and providing a general function getLLMResponse(question, model);

[0085] For results of identical questions with a similarity greater than 95, a preset time of 5 minutes is provided to reduce API call costs.

[0086] Failover: When the primary model response times out (e.g., >3 seconds), automatically switch to the backup model (e.g., switch to Gemini when ChatGPT fails).

[0087] The interaction flow can be referenced as follows:

[0088] (1) Task initiation: The user contract calls the requestLLMAnalysis function, passes in the task parameters and pays 0.01 ETH as a service fee;

[0089] (2) Event triggering: The oracle contract generates a task event, and the node monitors the event through the light client and starts the processing flow;

[0090] (3) Node selection: The oracle contract selects 5 nodes from the whitelist to participate in this task through a random number algorithm, reducing redundant calculations;

[0091] (4) Data Acquisition: Select a node and call the specified LLM interface to obtain the text result and generate a digital signature;

[0092] (5) Two-stage broadcast: Nodes first submit the result hash, and then broadcast the original data after all nodes have submitted, to prevent data plagiarism.

[0093] (6) Distributed aggregation: Each node executes the SenteTruth algorithm locally to obtain the aggregation result and sign it;

[0094] (7) Consensus verification: An improved PBFT algorithm is used to reach a consensus when more than 3 / 5 of the nodes have the same result;

[0095] (8) Result return: The oracle contract writes the consensus result to the blockchain and calls the user contract callback function;

[0096] (9) Fee settlement: The oracle contract distributes service fees to participating nodes, such as according to the contribution ratio, with the correct node receiving 80%.

[0097] Step 2: Combining Sentence-BERT semantic similarity analysis and truth discovery methods, define a semantically enhanced data aggregation method to handle inconsistencies in LLM-generated text and malicious node attacks:

[0098] Perform semantic similarity analysis:

[0099] Using the Sentence-BERT model, the text data of each node can be represented as D. iThe original text result obtained by the i-th oracle node from the LLM interface is converted into a fixed-length embedding vector, which can be represented as v. i The fixed-length embedding vector obtained by the Sentence-BERT model is the LLM text result obtained from the i-th node.

[0100] Calculate the cosine similarity between vectors to obtain the semantic association score of the text data for each node. The formula is:

[0101]

[0102] This is used to measure the overall semantic similarity between a node's result and all other node results. A higher semantic association score indicates stronger semantic consistency and greater reliability between the node's result and the majority of node results, thus helping to identify anomalous data. Where v... j The LLM text result obtained from the j-th node is...

[0103] The embedded vector after transformation by the Sentence-BERT model, and v i Same dimension, used with v i Semantic similarity comparison is performed, and the value of j ranges from the oracle node numbers of all oracle nodes participating in data interaction.

[0104] Truth discovery and credibility update: combining node credibility C i Truth aggregation with semantic association score, C i The formula reflecting historical performance is:

[0105]

[0106] The credibility is dynamically adjusted based on the semantic similarity between node data and aggregation results to suppress malicious nodes. The credibility of the i-th oracle node is:

[0107]

[0108] The numerator in the fraction The sum of the credibility of all nodes, denominator The sum of the products of the credibility of all nodes and their semantic association scores is represented by the fraction, which serves as a normalization factor to adjust the credibility of different nodes to maintain consistency when considering semantic association. This indicates that the credibility of each node depends not only on its own credibility but also on its semantic association score, and is influenced by the overall credibility and the sum of semantic association scores.

[0109] Example 2

[0110] This invention provides a data aggregation device based on smart contracts enhanced by collaboration between a large language model and blockchain, comprising a general collaborative framework C-LLM management module and a data aggregation processing module.

[0111] The general collaboration framework C-LLM management module constructs the general collaboration framework C-LLM. The general collaboration framework C-LLM adopts a four-layer architecture of user contract layer, oracle contract layer, oracle network layer and LLMs layer, and uses hierarchical interaction to achieve secure data circulation between blockchain and LLMs.

[0112] The data aggregation and processing module combines Sentence-BERT semantic similarity analysis with truth discovery methods to define a semantically enhanced data aggregation method, addressing inconsistencies in LLM-generated text and malicious node attacks.

[0113] Perform semantic similarity analysis:

[0114] The Sentence-BERT model is used to convert the text data of each node into fixed-length embedding vectors. Cosine similarity between vectors is calculated to obtain a semantic association score for each node's text data. This score measures the overall semantic similarity of a node's result with all other node results. A higher semantic association score indicates stronger semantic consistency and greater reliability between the corresponding node result and the majority of node results, thus helping to identify anomalous data.

[0115] Truth discovery and credibility update: Truth aggregation is performed by combining node credibility and semantic association score, and credibility is dynamically adjusted based on the semantic similarity between node data and aggregation results to suppress malicious nodes.

[0116] The information interaction and execution process between the modules in the above-mentioned device are based on the same concept as the method embodiment of the present invention, and the specific details can be found in the description in the method embodiment of the present invention, and will not be repeated here.

[0117] Similarly, the advantages of the device of the present invention are:

[0118] (1) Breaking through technical barriers: The C-LLM framework is the first to realize the generalized collaboration between blockchain and LLMs, breaking down data silos and enabling smart contracts to directly call the semantic understanding and reasoning capabilities of LLMs;

[0119] (2) High reliability: In a scenario with 40% malicious nodes, the data accuracy of the method of this invention is improved by an average of 17.74% compared with the baseline such as SBERT similarity and majority voting, and effectively resists attacks such as random response and model replacement;

[0120] (3) Strong versatility: It supports a variety of LLM models such as ChatGPT, Gemini and other scenarios. Experiments have shown that it performs well on the BASE, MIX and PRO datasets.

[0121] (4) High practical deployment value: Based on Ethereum, the core interface gas cost is controllable, such as deployment of about 790,000 Gas and calls of about 270,000 Gas, and is compatible with the existing blockchain ecosystem.

[0122] It should be noted that not all steps and modules in the above processes and device structures are mandatory; some steps or modules can be omitted as needed. The execution order of each step is not fixed and can be adjusted as required. The system structure described in the above embodiments can be a physical structure or a logical structure. That is, some modules may be implemented by the same physical entity, or some modules may be implemented by multiple physical entities, or they may be jointly implemented by certain components in multiple independent devices.

[0123] The above-described embodiments are merely preferred embodiments provided to fully illustrate the present invention, and the scope of protection of the present invention is not limited thereto. Equivalent substitutions or modifications made by those skilled in the art based on the present invention are all within the scope of protection of the present invention. The scope of protection of the present invention is defined by the claims.

Claims

1. A data aggregation method based on a large language model and a blockchain collaborative intelligent contract enhancement, characterized by Comprise: Step 1: Construct a general collaborative framework C-LLM that adopts a four-layer architecture of user contract layer, oracle contract layer, oracle network layer, and LLMs layer, and uses hierarchical interaction to realize safe data flow between blockchain and LLMs; Step 2: Combine Sentence-BERT semantic similarity analysis and truth discovery method to define a semantic-enhanced data aggregation method to deal with the inconsistency of LLM-generated text and malicious node attacks: Perform semantic similarity analysis: Use the Sentence-BERT model to convert each node text data into a fixed-length embedding vector, calculate the cosine similarity between the vectors, and obtain the semantic correlation score of each node text data, which is used to measure the overall semantic similarity of the results of a node with all other node results. The higher the semantic correlation score, the stronger the semantic consistency of the score corresponding to the node result with the majority of node results, and the more credible, thereby identifying abnormal data, Perform truth discovery and credibility update: Combine node credibility and semantic correlation score for truth aggregation, and dynamically adjust the credibility according to the semantic similarity between node data and aggregated results to suppress malicious nodes.

2. The data aggregation method based on a large language model and enhanced by a smart contract according to claim 1, characterized in that In step 1, based on the user contract layer, deploy a smart contract on the blockchain: Define tasks: encapsulate task information through the Solidity structure Task, including task unique identifier, requestor address, natural language question, target LLM model, timestamp, and task status, Provide an interface: provide the requestLLMAnalysis function through the interface to initiate a request to the oracle contract and pay the Gas fee, Receive results: use the callback function onLLMResult to receive and verify the aggregated results and trigger the business logic.

3. The data aggregation method of claim 1, wherein in step 1, based on the oracle contract layer, an intermediary contract is created: Create an event broadcast mechanism: after receiving a task request, trigger the TaskRequested event and broadcast it to the oracle nodes through the blockchain log, Perform node management: maintain the nodeWhitelist mapping table to record node addresses and deposit, implement node admission through the registerNode() function, and punish malicious nodes through the slashNode() function, Chain the results: after verifying the signature integrity of the node consensus results, call the callback function of the user contract to return the data.

4. The data aggregation method of claim 1, wherein in step 1, the independent nodes form a distributed network based on the oracle node layer: Listen to events: listen to oracle contract events through Web3.js, analyze task parameters, and verify signatures, Call LLM: call the corresponding API according to the modelType parameter, Data encryption: perform SHA-256 hash calculation on the LLM return results, first broadcast the hash value, and then broadcast the original data after a period of time, Local aggregation: After each node collects all data, run SenteTruth algorithm to calculate the candidate result.

5. The data aggregation method based on a large language model and enhanced by a smart contract according to claim 1, characterized in that In step 1, deploy a multi-model compatible middleware based on LLM adaptation layer, which encapsulates the unified interface: shield the API differences of different LLMs, and provide a getLLMResponse general function; Cache the results of similar problems with a similarity of > 95 for a preset time to reduce API call cost; Failover: When the main model response times out, automatically switch to the backup model.

6. A data aggregation device enhanced by a smart contract based on a large language model and a blockchain, characterized by It includes a general collaborative framework C-LLM management module and a data aggregation processing module, The general collaborative framework C-LLM management module builds a general collaborative framework C-LLM, which adopts a four-layer architecture of user contract layer, oracle contract layer, oracle network layer, and LLMs layer, and uses hierarchical interaction for safe data flow between blockchain and LLMs; The data aggregation processing module combines Sentence-BERT semantic similarity analysis and truth discovery methods to define a semantic-enhanced data aggregation method to handle the inconsistency of LLM-generated text and malicious node attacks: Semantic similarity analysis: Use the Sentence-BERT model to convert each node's text data into a fixed-length embedding vector, calculate the cosine similarity between vectors, and obtain the semantic correlation score of each node's text data, which is used to measure the overall semantic similarity of a node's result with all other node results. The higher the semantic correlation score, the stronger the semantic consistency of the score corresponding to the node result with the majority of node results, and the more reliable it is, thus identifying abnormal data, Truth discovery and credibility update: Combine node credibility and semantic correlation score for truth aggregation, and dynamically adjust credibility based on the semantic similarity between node data and aggregated results to suppress malicious nodes.

7. The data aggregation device enhanced by smart contract based on large language model and blockchain cooperation according to claim 6, characterized in that The general collaborative framework C-LLM management module is based on the user contract layer and deploys smart contracts on the blockchain: Task definition: encapsulate task information through the Solidity structure Task, including task unique identifier, requester address, natural language question, target LLM model, timestamp, and task status, Provide an interface: provide the requestLLMAnalysis function through the interface, make a request to the oracle contract and pay the Gas fee, Receive results: use the callback function onLLMResult to receive and verify aggregated results and trigger business logic. 8.The data aggregation device based on a large language model and enhanced by a smart contract according to claim 6, wherein The general collaborative framework C-LLM management module is based on the oracle contract layer and serves as an intermediary contract: Create an event broadcast mechanism: after receiving a task request, trigger the TaskRequested event and broadcast it to the oracle node through the blockchain log, Node management: maintain the nodeWhitelist mapping table to record node addresses and deposit, implement node admission through the registerNode() function, and punish malicious nodes through the slashNode() function, Chain the results: after verifying the signature integrity of the node consensus result, call the callback function of the user contract to return the data. 9.The data aggregation device based on a large language model and enhanced by a smart contract according to claim 6, characterized in that The general collaborative framework C-LLM management module is based on the independent node group of the oracle node layer to constitute a distributed network: Event monitoring: Monitor oracle contract events through Web3.js, parse task parameters and verify signatures, LLM calling: Call the corresponding API according to the modelType parameter, Data encryption: Perform SHA-256 hash calculation on the LLM return result, first broadcast the hash value, and then broadcast the original data after a period of time, Local aggregation: After each node collects all the data, run the SenteTruth algorithm to calculate the candidate results.

10. The data aggregation device enhanced by smart contract based on large language model and blockchain according to claim 6, characterized in that The general collaborative framework C-LLM management module is based on the LLM adaptation layer to deploy middleware compatible with multiple models, which performs unified interface encapsulation: shields the API differences of different LLMs, and provides a getLLMResponse general function; Cache the results of similar problems with a similarity of > 95 for a preset time to reduce API calling costs; Failover: When the main model response times out, automatically switch to the backup model.

Citation Information

Patent Citations

  • On-chain and off-chain data sharing scheme based on distributed oracle machine and homomorphic encryption

    CN112016105A

  • Intelligent contract vulnerability detection optimization method and device, equipment, medium and product

    CN118171286A

  • Distributed oracle authentication system based on reputation score

    CN120128341A

  • User service utilization

    WO2023040498A1