A multi-agent blockchain optimization system and method based on a large language model

Through a multi-agent blockchain optimization system based on a large language model, the blockchain parameters are dynamically adjusted, and the performance problems of the blockchain system when processing large-scale data are solved, efficient transaction processing and reduced operation and maintenance costs are achieved. Improve user trust.

CN118657266BActive Publication Date: 2024-12-06QINGDAO UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411154297.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-22
Publication Date
2024-12-06
Estimated Expiration
2044-08-22

AI Technical Summary

Technical Problem

Existing blockchain systems are prone to transaction accumulation, throughput drop and response time prolonged when processing large-scale data. The traditional way of manually adjusting blockchain parameters is subjective and complex, making it difficult to adapt to dynamically changing networks. environment.

Method used

Adopt a multi-agent blockchain optimization system based on large language models, including physical layer, storage layer, tool layer and optimization layer, analyze, optimize and make decisions through multi-agent systems, and integrate agents and data analysis agents using knowledge. and perform tuning agents, dynamically adjust blockchain parameters, and combine Hyperledger Fabric and Hyperledger Caliper tools to achieve automated and personalized parameter configuration.

Benefits of technology

It effectively avoids transaction accumulation, improves transaction throughput and reduces transaction delay, reduces operation and maintenance costs, improves optimization efficiency and decision-making transparency, and enhances user trust.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118657266B_ABST
    Figure CN118657266B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of blockchain technology, and discloses a multi-agent blockchain optimization system and method based on a large language model. The system includes a physical layer, a storage layer, a tool layer and an optimization layer; the physical layer includes a data acquisition subsystem and a data processing subsystem; the storage layer is the core part of the system's data storage, management and transmission, and is responsible for storing the data collected and processed by the physical layer securely and transparently on the blockchain, and ensuring that the data remains consistent and cannot be tampered with during the flow of the entire system; the tool layer provides support for the optimization layer, and the optimization layer performs analysis, optimization and decision-making through a multi-agent system. The system and method disclosed in the present invention adopt a multi-agent system based on a large language model, and through the synergy between autonomous agents and real-time interaction with the environment, it can accurately adjust and optimize blockchain network parameters, thereby improving the transaction throughput of the blockchain and reducing transaction delays.
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 multi-agent blockchain optimization system and method based on a large language model. Background Art

[0002] In systems involving multiple participants and complex processes, such as supply chain management, logistics tracking, and asset management, it is crucial to ensure transparency and effective supervision of the entire process. However, traditional management methods often rely on centralized databases and manual records, which are vulnerable to data tampering, information loss, and human errors. In addition, since data is usually scattered across different systems, it becomes difficult to integrate and trace information, resulting in insufficient transparency of the entire process and the inability to verify the authenticity and consistency of data in real time. The above problems have seriously affected the credibility and traceability of the system, causing all parties to question the transparency and fairness of the system's operation.

[0003] Blockchain technology, due to its decentralized and tamper-proof characteristics, has been gradually applied to these fields to improve process transparency and management efficiency. However, in actual applications, blockchain networks face large-scale data storage and processing requirements, which may lead to transaction accumulation, thereby reducing transaction throughput and extending response time, affecting the overall performance of the system. In addition, the traditional manual adjustment of blockchain parameters is subjective and difficult to continuously adapt to the dynamically changing network environment.

[0004] Although reinforcement learning technology, as an emerging automatic parameter adjustment scheme, can optimize blockchain performance to a certain extent, it still faces many challenges in practical applications. First, the optimization process of reinforcement learning usually requires a large amount of training data and multiple experiments. This high resource consumption may lead to inefficient optimization process and difficulty in responding to real-time changing network environments. Secondly, the setting complexity of reinforcement learning is relatively high. This complexity increases the difficulty of deployment and maintenance, and places high requirements on the technical team, thereby increasing the operation and maintenance costs of the system. Finally, the decision-making process of reinforcement learning often lacks transparency. Since reinforcement learning algorithms usually involve complex mathematical models and nonlinear decision-making processes when adjusting blockchain parameters, this may make the system's behavior and decision logic difficult for users to understand and explain, and then doubt the rationality and security of the decision, affecting users' trust in the system. Summary of the invention

[0005] In order to solve the above technical problems, the present invention provides a multi-agent blockchain optimization system and method based on a large language model to solve the problems of transaction accumulation, throughput reduction and prolonged response time faced by existing blockchain systems when processing large-scale data.

[0006] To achieve the above object, the technical solution of the present invention is as follows:

[0007] A multi-agent blockchain optimization system based on a large language model, including a physical layer, a storage layer, a tool layer, and an optimization layer;

[0008] The physical layer includes a data acquisition subsystem and a data processing subsystem; the data acquisition subsystem includes a sensor network and an Internet of Things device, which are installed on key physical nodes and are responsible for collecting data from the physical environment in real time; the data processing subsystem includes an edge server and an edge gateway, which are responsible for preliminary processing and transmission of the collected data;

[0009] The storage layer is the core part of the system's data storage, management and transmission. It is responsible for storing the data collected and processed by the physical layer securely and transparently on the blockchain, and ensuring that the data remains consistent and cannot be tampered with during the flow of the entire system. This layer is based on the Hyperledger Fabric blockchain platform and builds a flexible and secure network topology, including sorting nodes, peer nodes, organizations and channels.

[0010] The tool layer provides support for the optimization layer, including blockchain status monitoring tools, blockchain performance testing tools, blockchain deployment tools, and blockchain configuration modification tools, to ensure that the intelligent agent can interact with the environment efficiently;

[0011] The optimization layer performs analysis, optimization and decision-making through a multi-agent system and is the core of the system agent operation; the multi-agent system includes a knowledge integration agent, a data analysis agent and an execution tuning agent; in addition, the optimization layer relies on localized data and background information and a tool calling module to ensure that the system can achieve continuous adaptive optimization in a complex and dynamic environment.

[0012] In the above scheme, the ordering node is responsible for sorting transactions from different data sources and packaging these transactions into blocks to ensure that transactions are processed in order and maintain data consistency; the generated blocks will be packaged and confirmed on the ordering node and then passed to the peer node;

[0013] The peer nodes are the core storage and computing units of the storage layer. They not only store the blocks generated by the sorting nodes, but are also responsible for adding these blocks to the distributed ledger of the blockchain. Each peer node stores a complete copy of the blockchain and ensures that the ledger contents on all nodes remain consistent through a consensus mechanism, thereby ensuring the security, integrity and traceability of the data.

[0014] The organizations represent different participants in the blockchain network. Each organization can have multiple peer nodes. These organizations participate in the blockchain network through their own peer nodes and realize private data exchange through channels to ensure the security and privacy of sensitive data.

[0015] The channel serves as a communication path in the blockchain network, allowing multiple organizations to maintain data isolation in the same network while conducting secure and efficient transaction processing.

[0016] In the above scheme, the blockchain status monitoring tool is the Prometheus tool. In the tool layer, Prometheus is responsible for real-time monitoring of the operating status of the blockchain network, collecting and analyzing the performance indicators of each node in the network;

[0017] The blockchain performance testing tool is Hyperledger Caliper, which is a performance benchmarking tool used to evaluate and compare the performance of blockchain platforms. It simulates real application scenarios through a series of preset workloads and generates detailed performance reports to help the system identify performance bottlenecks and provide reliable data support for optimization decisions.

[0018] The blockchain deployment tool is used to quickly build, deploy and manage blockchain networks, automating the entire process from network initialization, node configuration to smart contract deployment, simplifying the construction and management process of the blockchain system;

[0019] The blockchain configuration modification tool dynamically adjusts the configuration parameters of the blockchain network through script calls to achieve automatic parameter tuning. The tool supports parameter modification during the iteration process to ensure that the network configuration can respond to environmental changes and system optimization requirements at any time.

[0020] In the above scheme, the localized data and background information are important foundations for supporting agent decision-making and optimization, including blockchain optimization goals, blockchain parameters and their functional introduction, expert knowledge and historical optimization data, and blockchain network information;

[0021] The blockchain optimization goal clarifies the decision-making direction of the system in different scenarios, so that it can be adjusted around specific performance indicators during the optimization process;

[0022] The blockchain parameters and their functions described above record various configuration parameters and their functions in the blockchain network. This information helps the agent to accurately identify and adjust key parameters during the optimization process, thereby improving the overall performance of the system.

[0023] The expert knowledge and historical optimization data bring together the advice and historical optimization records of domain experts. By analyzing these historical data and expert knowledge, the intelligent agent can select the best parameter configuration, thereby providing a reliable reference for the current optimization task.

[0024] The blockchain network information covers the system's current network topology, node configuration, transaction sending rate and transaction type information. This network information helps the intelligent agent better understand and adapt to the current network status and make optimization decisions accordingly.

[0025] In the above scheme, the knowledge integration agent is used to integrate and screen existing expert knowledge and historical optimization data. By reading and analyzing local historical log information or database, it organizes and stores expert advice and previous optimization results, screens out the most effective parameter configuration, and forms an expert knowledge base, thereby providing knowledge reference for parameter optimization of the blockchain system.

[0026] In the above scheme, the data analysis agent is used to collect blockchain system data in real time, analyze the current network status, generate optimization suggestions, and interact with other agents to promote the automatic adjustment of system parameters.

[0027] In the above scheme, the responsibility of the execution tuning agent is to receive optimization suggestions from the data analysis agent, convert these suggestions into specific parameter adjustment operations, and verify the results of these adjustments through reconfiguration of the blockchain network and Caliper performance testing; after the test is completed, the execution tuning agent also needs to conduct a comprehensive analysis of the experimental results, evaluate the adjustment effect, and encapsulate the parameter adjustment information, test results and evaluation feedback as output for subsequent parameter adjustment iterations.

[0028] In the above scheme, the tool calling module is the key mechanism for the multi-agent system to interact with the external environment. By calling the blockchain status monitoring tool, blockchain configuration modification tool, blockchain deployment tool and blockchain performance testing tool, the agent can perform necessary tasks and realize the automatic management and optimization of the system.

[0029] A multi-agent blockchain optimization method based on a large language model, using the multi-agent blockchain optimization system based on a large language model, comprises the following steps:

[0030] S1. Deploy the initial configuration of the blockchain operating environment and related tools on the server;

[0031] S2. The knowledge integration agent reads historical optimization data and expert knowledge from the local log or database, organizes them into a preliminary expert knowledge base, and selects the best knowledge expert base; and encapsulates the selected knowledge expert base configuration into a message object and puts it into the message queue for use by the data analysis agent;

[0032] S3. The data analysis agent receives the performance and parameter data from the initial blockchain network, and obtains the best expert knowledge base from the message object output by the knowledge integration agent stored in the message queue; obtains the tuning results and analysis from the message object output by the execution tuning agent stored in the message queue. If it is the first time to call the agent, the benchmark test results of the blockchain network are obtained;

[0033] S4, the data analysis agent integrates the information collected in step S3, evaluates the performance bottleneck of the current blockchain, analyzes the optimization space of the current configuration, and generates parameter modification suggestions or stop iteration instructions, and encapsulates the parameter modification suggestions into a message object and outputs them to the message queue;

[0034] S5. The execution tuning agent obtains the parameter modification suggestions of the data analysis agent from the message queue, and modifies the relevant parameters of the blockchain network according to the parameter modification suggestions; redeploys the Fabric network and uses the Caliper tool to perform performance testing; finally, generates evaluation feedback based on the parameter adjustment information and test results, and encapsulates the above content and outputs it to the message queue for use by the data analysis agent;

[0035] S6. Repeat steps S4-S5 and continue optimizing until the data analysis agent stops iterating.

[0036] In the above scheme, in S1, deploying the initially configured blockchain operating environment and related tools on the server includes the following steps:

[0037] Step 1: Configure the Hyperledger Fabric network using default parameters, including creating channels, joining nodes, and deploying smart contracts;

[0038] Step 2: Configure and start the Prometheus server instance to verify whether the node status information can be successfully collected;

[0039] Step 3: Install and configure the Hyperledger Caliper performance testing tool, configure Caliper’s test script, define the test’s sending rate and transaction volume parameters, verify that Caliper can successfully run preliminary tests, and record baseline performance data.

[0040] Through the above technical solution, the multi-agent blockchain optimization system and method based on a large language model provided by the present invention has the following beneficial effects:

[0041] This paper proposes a multi-agent architecture system based on a large language model, which can provide personalized blockchain network parameter configuration according to the different transaction volumes, transaction sending rates, and network scale characteristics of the blockchain. This dynamic optimization method not only effectively avoids transaction accumulation when processing large-scale data, but also significantly improves transaction throughput and reduces transaction latency, overcoming the subjectivity and limitations of traditional manual parameter adjustment methods.

[0042] In addition, the present invention makes the optimization process more intelligent and automated through the synergy between intelligent agents and real-time interaction with the environment. This design not only reduces the operation and maintenance costs of the system in a dynamic network environment, but also greatly reduces the number of high-resource consumption experiments required by traditional reinforcement learning methods, thereby improving the optimization efficiency. More importantly, the system improves the transparency of the decision-making process, and users can clearly understand the behavior of the system and the logic behind it, which enhances the user's trust in the system and the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.

[0044] Figure 1 A schematic diagram of a multi-agent blockchain optimization system based on a large language model disclosed in an embodiment of the present invention.

[0045] Figure 2 Schematic diagram of the optimization layer multi-agent system architecture.

[0046] Figure 3 Schematic diagram of the collaboration mechanism of a multi-agent system.

[0047] Figure 4 Flowchart of the collaboration mechanism of a multi-agent system.

[0048] Figure 5 Flowchart of a multi-agent blockchain optimization method based on a large language model. DETAILED DESCRIPTION

[0049] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0050] The present invention provides a multi-agent blockchain optimization system based on a large language model, such as Figure 1 As shown, it includes the physical layer, storage layer, tool layer and optimization layer.

[0051] 1. Physical layer

[0052] The physical layer includes the data acquisition subsystem and the data processing subsystem; the data acquisition subsystem includes sensor networks and IoT devices, which are installed on key physical nodes and are responsible for collecting data from the physical environment in real time; the data processing subsystem includes edge servers and edge gateways, which are responsible for preliminary processing and transmission of the collected data.

[0053] 2. Storage Layer

[0054] The storage layer is the core part of the system's data storage, management and transmission. It is responsible for storing the data collected and processed by the physical layer securely and transparently on the blockchain, and ensuring that the data remains consistent and cannot be tampered with during the flow of the entire system. This layer is based on the Hyperledger Fabric blockchain platform and builds a flexible and secure network topology, which includes sorting nodes, peer nodes, organizations and channels.

[0055] The sorting node is responsible for sorting transactions from different data sources and packaging them into blocks to ensure that transactions are processed in order and maintain data consistency. The generated blocks will be packaged and confirmed on the sorting node and then passed to the peer node.

[0056] Peer nodes are the core storage and computing units of the storage layer. They not only store the blocks generated by the sorting nodes, but are also responsible for adding these blocks to the distributed ledger of the blockchain. Each peer node stores a complete copy of the blockchain and ensures that the ledger contents on all nodes remain consistent through a consensus mechanism, thereby ensuring the security, integrity and traceability of the data.

[0057] Organizations represent different participants in the blockchain network. Each organization can have multiple peer nodes. These organizations participate in the blockchain network through their own peer nodes and realize private data exchange through channels to ensure the security and privacy of sensitive data.

[0058] Channels serve as communication paths in a blockchain network, allowing multiple organizations to maintain data isolation in the same network while conducting secure and efficient transaction processing.

[0059] The blockchain data structure in the storage layer consists of multiple interconnected blocks. Each block contains confirmed transaction data and is linked to the previous block through cryptography to form a chain structure. This structure not only ensures the immutability of the data, but also provides a complete transaction history, supporting the transparency and traceability of the system; the newly generated block will be added to the blockchain after verification. As time goes by, the chain continues to extend, recording all operations and changes in the system.

[0060] 3. Tool layer

[0061] The tool layer provides support for the optimization layer, including blockchain status monitoring tools, blockchain performance testing tools, blockchain deployment tools, and blockchain configuration modification tools to ensure that the intelligent agent can interact with the environment efficiently.

[0062] The blockchain status monitoring tool is the Prometheus tool. Prometheus is an open source performance detection and alarm tool widely used in distributed systems and containerized applications. In the tool layer, Prometheus is responsible for real-time monitoring of the operation status of the blockchain network, collecting and analyzing the performance indicators of each node in the network; specifically, after configuring and starting the Prometheus instance on the Prometheus server, the instance will periodically call the Exporter program to periodically obtain the latest status information from the blockchain node. This status information mainly includes the CPU and memory usage of the node.

[0063] The blockchain performance testing tool is Hyperledger Caliper. Hyperledger Caliper is a performance benchmarking tool used to evaluate and compare the performance of blockchain platforms. It simulates real application scenarios through a series of preset workloads and generates detailed performance reports to help the system identify performance bottlenecks and provide reliable data support for optimization decisions. Specifically, Caliper first defines the test scenario through a configuration file, including the test transaction type, transaction volume, number of concurrent users, and sending rate parameters. Subsequently, Caliper will run these tests, collect and analyze relevant data, and finally generate performance reports. These reports provide reliable feedback information for the system's optimization layer, enabling the intelligent agent to adjust and optimize according to actual performance, thereby continuously improving the efficiency and stability of the blockchain network.

[0064] The blockchain deployment tool is used to quickly build, deploy and manage blockchain networks. It automates the entire process from network initialization, node configuration to smart contract deployment, simplifying the construction and management process of the blockchain system.

[0065] The blockchain configuration modification tool dynamically adjusts the configuration parameters of the blockchain network through script calls to achieve automatic parameter tuning. The tool supports parameter modification during the iteration process to ensure that the network configuration can respond to environmental changes and system optimization needs at any time.

[0066] 4. Optimization layer

[0067] The optimization layer performs analysis, optimization, and decision-making through a multi-agent system, and is the core of the system agent operation; Figure 2As shown, the multi-agent system includes knowledge integration agents, data analysis agents and execution tuning agents; in addition, the optimization layer relies on localized data and background information and tool calling modules to ensure that the system can achieve continuous adaptive optimization in a complex and dynamic environment.

[0068] (1) Knowledge Integration Agent

[0069] The knowledge integration agent is used to integrate and filter existing expert knowledge and historical optimization data. By reading and analyzing local historical log information or databases, it organizes and stores expert advice and previous optimization results, filters out the most effective parameter configuration, and forms an expert knowledge base, thereby providing knowledge reference for parameter optimization of the blockchain system.

[0070] The expert knowledge base is encapsulated into a message object as the output of the knowledge integration agent and saved in the message queue of the system environment; the message object is defined as the memory object of each agent. Before the agent performs an action, it will first observe whether there is a message object of the agent it is concerned about in the message queue. If so, it will obtain the message object as "memory" and guide the future behavior of the agent to achieve higher-level reasoning. After the agent performs an action, it will convert the response obtained from the execution into a message object and put it into the message queue to achieve interaction with other agents; the message queue is obtained by simply encapsulating the asynchronous Queue, mainly providing non-blocking enqueue and dequeue methods. Each agent exchanges information with other agents in the environment through this object; the agent you are concerned about is defined by the watch field in the agent object, and the agent action observed by the current agent is represented by a string, which is used to filter the message object before the agent performs an action.

[0071] (2) Data Analysis Agent

[0072] The data analysis agent is used to collect blockchain system data in real time, analyze the current network status, generate optimization suggestions, and interact with other agents to promote the automatic adjustment of system parameters.

[0073] The blockchain system data that needs to be collected includes: blockchain parameters and their function introduction, blockchain network information, blockchain optimization goals, blockchain specific parameters, status information, existing expert knowledge, and tuning results and analysis.

[0074] The blockchain parameters and their functions include the name of the blockchain parameter to be adjusted, the parameter function description and the parameter range requirements;

[0075] Blockchain network information refers to the network size and transaction load of the initial configuration blockchain deployed on the server; the transaction load includes the number of transactions and the sending rate;

[0076] The blockchain optimization goal is defined as maximizing blockchain network throughput and minimizing transaction latency;

[0077] The blockchain specific parameters are defined as the default parameters of the blockchain when it is first called, and are defined as the blockchain parameters modified by the tuning agent in the previous round when it is subsequently called. The parameters can be obtained from the output of the tuning agent;

[0078] Status information is blockchain node status information collected using the Prometheus monitoring tool, including CPU usage and memory usage;

[0079] Expert knowledge can be obtained from the output message objects of the knowledge integration agent;

[0080] The tuning results and analysis are obtained from the output of the tuning agent. The tuning results mainly include the tuning action information and the test results of the Caliper tool. The result analysis is a comprehensive evaluation and analysis of the tuning suggestions made by the data analysis agent and the effects of the tuning suggestions implemented by the tuning agent.

[0081] It should be noted that the present invention mainly optimizes the parameters of the Hyperledger Fabric framework. Hyperledger Fabric is an enterprise-level permissioned blockchain framework established under the Linux Foundation, which provides a flexible and modular architecture for building and running distributed ledger applications; Hyperledger Caliper is a performance benchmarking tool used to evaluate and compare the performance of blockchain platforms. It can simulate real application scenarios through a series of preset workloads and generate detailed performance reports.

[0082] (3) Execution Tuning Agent

[0083] The responsibility of the execution tuning agent is to receive optimization suggestions from the data analysis agent, convert these suggestions into specific parameter adjustment operations, and verify the results of these adjustments through reconfiguration of the blockchain network and Caliper performance testing. After the test is completed, the execution tuning agent also needs to conduct a comprehensive analysis of the experimental results, evaluate the adjustment effect, and encapsulate the parameter adjustment information, test results and evaluation feedback as output for subsequent parameter adjustment iterations.

[0084] In the technical solution of the present invention, the multi-agent architecture is built based on a large language model, and its core is the collaborative work of multiple autonomous agents; each agent has independent decision-making capabilities, and through the powerful language understanding and generation capabilities of the large language model, it can perform complex reasoning, decision-making and execution tasks; the collaborative work of multiple autonomous agents relies on message queues for information exchange and task coordination, so that each agent can cooperate efficiently in the same system; Figure 3 As shown in the figure: the message queue is the core component of information exchange in a multi-agent system. It is responsible for storing and transmitting the message objects generated by each agent. When performing a task, each agent will obtain relevant messages from the message queue according to its own needs as the basis for decision-making and behavior; the message queue mainly includes two operations. The queue entry operation (Push) will store the generated message object in the message queue after the agent completes an action. This process is non-blocking, ensuring that multiple agents can push messages to the queue at the same time; the queue exit operation (Pop) will extract the message object from the message queue before the agent performs a new action. This extraction operation is also non-blocking. The agent can filter out the required message objects according to its own needs and use them as a reference for subsequent actions; the output of each agent is It is encapsulated into a message object, which records the output content of the agent in a structured manner, making it easy for other agents to read and understand. The message object consists of a message content and a trigger event field. The message content field is the core part of the message object, which is used to structuredly store the actual information content of the interaction between agents. The trigger event field is used to record the event that triggers the generation of the current message object, and is used to cooperate with the watch field of the agent to ensure that the agent efficiently filters out information that is valuable to its current action and avoids irrelevant information interfering with its decision-making process. The self-demand refers to the ability of the agent to define the agent action observed by the current agent in the form of a string through the watch field, which is used to filter the message objects before the agent performs the action and select the message objects required by itself.

[0085] like Figure 4 As shown in the figure, each agent in the multi-agent system achieves efficient task processing and decision optimization through the following collaborative process. This process is applicable to all agents in the system, including knowledge integration agents, data analysis agents, and execution tuning agents:

[0086] Step 1: Agent information reading: At the beginning of each execution cycle, the agent reads the existing message objects from the message queue and filters out the messages it is interested in. The messages of interest are usually defined by the agent's watch field to ensure that the agent only extracts information that is useful for its current task.

[0087] Step 2: Information integration and reasoning: After obtaining the required message objects, the agent integrates this information as "memory" and performs high-level reasoning in combination with the current task goals. Through the powerful reasoning ability of the large language model, the agent can learn from past execution results and generate more targeted decisions and action plans.

[0088] Step 3: Collaborative execution of actions: After completing information integration and reasoning, each agent will perform specific tasks according to the generated action plan; after execution, the agent pushes the newly generated message object to the message queue to provide information support for the subsequent tasks of other agents;

[0089] Step 4: Iterative optimization and feedback: Agents continuously exchange information and feedback results through message queues to achieve a dynamic and iterative optimization process; the next agent may further integrate and analyze information based on the feedback from the previous agent to continuously improve the system's task performance.

[0090] (4) Localized data and background information

[0091] Localized data and background information are important foundations for supporting intelligent agent decision-making and optimization, including blockchain optimization goals, blockchain parameters and their functional introduction, expert knowledge and historical optimization data, and blockchain network information.

[0092] The blockchain optimization goal clarifies the decision direction of the system in different scenarios, so that it can be adjusted around specific performance indicators during the optimization process, such as maximizing blockchain network throughput and minimizing transaction latency;

[0093] The introduction to blockchain parameters and their functions records various configuration parameters and their functions in the blockchain network. This information helps the agent accurately identify and adjust key parameters during the optimization process, thereby improving the overall performance of the system.

[0094] Expert knowledge and historical optimization data collect the suggestions and historical optimization records of domain experts. By analyzing these historical data and expert knowledge, the intelligent agent can select the best parameter configuration, thus providing a reliable reference for the current optimization task.

[0095] Blockchain network information covers the system’s current network topology, node configuration, transaction sending rate, and transaction type information. This network information helps intelligent agents better understand and adapt to the current network status and make optimization decisions accordingly.

[0096] By integrating this localized data and background knowledge, the intelligent agent can obtain the necessary context and reference when performing complex tasks, better understand the relationships and patterns in complex environments, and thus make more accurate optimization decisions.

[0097] (5) Tool call module

[0098] The tool calling module is the key mechanism for the interaction between the multi-agent system and the external environment. By calling the blockchain status monitoring tool, blockchain configuration modification tool, blockchain deployment tool and blockchain performance testing tool, the agent can perform necessary tasks and realize the automatic management and optimization of the system.

[0099] Specifically, the agent can call the Prometheus tool to collect real-time status information of blockchain nodes, use the configuration modification tool to dynamically adjust the parameters of the blockchain network, redeploy the network through the Fabric toolset, and use Hyperledger Caliper for performance testing; the agent interacts with these tools through defined interfaces, coordinates to complete complex optimization tasks, and feeds the results back to the system to form a closed loop, so that the system can be continuously optimized and maintained in the best state.

[0100] The present invention provides a multi-agent blockchain optimization method based on a large language model, the purpose of which is to use a multi-agent framework based on a large language model to perform personalized adjustments to the parameters in the blockchain network. Specifically, this adjustment is customized according to the specific transaction volume, transaction sending rate and network scale of the blockchain network to solve the subjectivity problem of blockchain parameter setting. This dynamic optimization method not only effectively avoids transaction accumulation when processing large-scale data, but also significantly improves transaction throughput and reduces transaction latency. In addition, through the synergy between agents and real-time interaction with the environment, the optimization process is made more intelligent and automated, overcoming the disadvantages of traditional reinforcement learning that requires high resource consumption and number of experiments, and improving optimization efficiency; improving the transparency of the decision-making process, so that users can clearly understand the behavior of the system and the logic behind it, and enhance users' trust in the system and usage experience.

[0101] like Figure 2 and Figure 5 As shown, the method comprises the following steps:

[0102] S1. Deploy the initial configuration of the blockchain operating environment and related tools on the server.

[0103] Specifically, deploying the initial configuration of the blockchain operating environment includes the following steps:

[0104] Step 1: Configure the Hyperledger Fabric network using default parameters, including creating channels, joining nodes, and deploying smart contracts: First, use the default blockchain parameters to configure the Fabric network and specify the network topology, including defining Orderer nodes, Peer nodes, CA nodes, organizations, and channels; then use Fabric's cryptogen tool to generate the network's certificate and key files for encrypted communication between nodes; then use Fabric's configtxgen tool to generate the genesis block and channel configuration files; create a channel and upload the channel configuration file to the Orderer node; then each Peer node is added to the created channel; finally, deploy the smart contract and complete the configuration of the blockchain network with default parameter configuration;

[0105] Step 2: Configure and start the Prometheus server instance to verify whether the node status information can be successfully collected; first, configure the Prometheus configuration file to specify the URL and port of the blockchain node to be monitored; start the Prometheus instance, Prometheus will periodically obtain status information from the blockchain node and store it in the time series database;

[0106] Step 3: Install and configure the Hyperledger Caliper performance testing tool: First, install the Caliper adapter to ensure that it is compatible with the currently deployed Hyperledger Fabric network; write the Caliper test file to define the test scenario, including the transaction type, transaction volume, number of concurrent users, and sending rate parameters; set the Caliper network configuration file to specify the topology, node address, and smart contract path information of the currently deployed blockchain network; define Caliper's test indicators, including transaction throughput, transaction latency, and transaction success rate; run preliminary performance tests to simulate the performance of the blockchain network under the default configuration, generate a performance report, and record the transaction throughput and latency baseline performance data for comparison and analysis in the subsequent blockchain optimization process.

[0107] S2. The knowledge integration agent integrates and filters expert knowledge.

[0108] In this step, the knowledge integration agent will read and process the historical optimization data and expert knowledge in the local log or database, where the expert knowledge includes previous manual adjustment suggestions, optimization solutions for specific scenarios, and theoretical analysis by domain experts; organize and clean the collected historical data and expert knowledge, identify and delete duplicate records or invalid data, and standardize the data into a unified format for easy processing by the agent; input the organized and cleaned historical optimization data and expert knowledge into the knowledge integration agent, which will perform preliminary analysis and processing on the data according to predefined rules and logic to establish the basic structure of the knowledge base; then screen out the best parameter configuration and optimization strategy, and store the key information in a structured manner in the message object; finally, store the encapsulated message object in the system's message queue for subsequent calls and processing.

[0109] S3. The data analysis agent receives performance and parameter data from the initial blockchain network.

[0110] In this step, the data analysis agent will collect and process the initial performance data and parameter information of the blockchain network through a series of operations. This data will be used for subsequent analysis to generate optimization suggestions. Specifically, the initial data collection and parameter preprocessing process of the data analysis agent includes the following steps:

[0111] Step 1: Predefined blockchain parameters and their functional introduction: List all adjustable blockchain parameters, which may include but are not limited to the following: AbsoluteMaxBytes, defines the absolute maximum number of bytes for each block in the blockchain network. Regardless of the number of transactions or batch time settings, when the accumulated transaction data reaches this byte limit, the Orderer service will immediately generate a block and submit it to the blockchain; BatchTimeout, sets the timeout for transaction batching (in seconds). Within this time frame, if the Orderer does not receive a sufficient number of transactions to fill a block, it will generate a block according to this timeout value and submit it; MaxMessageCount, defines the maximum number of transactions that can be accommodated in each block. When the number of transactions reaches this limit, regardless of other conditions, the Orderer will immediately generate and submit the block; PreferredMaxBytes, specifies the ideal maximum number of bytes for the Orderer service when generating a block. This parameter is only a reference value, not a hard limit. If this number of bytes is reached or exceeded, the Orderer will try to generate a block, but if the transaction still does not reach AbsoluteMaxBytes, it will not force the generation of a block. In addition to the functional description of each parameter, the adjustable range of the parameter and its impact on network performance should also be included. Finally, the predefined blockchain parameter information is loaded into the internal knowledge base of the data analysis agent, allowing the agent to understand the meaning and relationship between these parameters for use in subsequent analysis and optimization suggestion generation;

[0112] Step 2: Collect blockchain node status information from Prometheus; the data analysis agent calls the Prometheus tool and calls its API to obtain real-time blockchain network status information. The collected status information includes but is not limited to the following: CPU usage, which reflects the usage of node processing power; memory usage, which monitors the memory consumption of the node;

[0113] Step 3: Define the blockchain optimization goal, which requires maximizing the blockchain network throughput and minimizing the transaction delay. Maximizing the blockchain network throughput and minimizing the transaction delay are used as the benchmarks for the data analysis agent to generate optimization suggestions.

[0114] Step 4: Collect information about the blockchain network that will be involved in parameter adjustment, including network size and transaction load; collect topological information about the currently deployed blockchain network, including node types and their number, and number of channels; obtain transaction load information about the current network, including transaction volume and transaction sending rate;

[0115] Step 5: Define the specific parameter values ​​of the blockchain. If it is the first time to call the agent, define them as the default parameters of the blockchain, otherwise get the adjusted values ​​from the output message object of the execution tuning agent; if this is the first time to call the data analysis agent, use the default parameter values ​​of the blockchain system as the initial benchmark for analysis, and extract these default values ​​from the configuration file or initial deployment settings of the blockchain network; if the data analysis agent has been called multiple times, get the last optimized parameter values ​​from the output message object of the execution tuning agent as the basic parameters for the current analysis; these parameters will be used as input in subsequent analysis to help the agent understand the effect of previous adjustments and further optimize;

[0116] Step 6: Obtain the expert knowledge base from the output message object of the knowledge integration agent in the message queue; the knowledge base contains the best practice reference configurations screened by the knowledge integration agent and the parameter configuration suggestions provided by experts based on the optimization strategy; integrate the acquired expert knowledge into the analysis process, and use this knowledge to identify the optimization space of the current blockchain network and find potential improvement points;

[0117] Step 7: Obtain the tuning results and analysis from the output message object of the tuning agent in the message queue. If it is the first time to call the agent, obtain the benchmark results of the blockchain network. The data analysis agent accesses the message queue before executing the action, extracts the latest output message object of the tuning agent, obtains the specific adjusted blockchain parameters and the adjusted network performance indicators (throughput and latency), and analyzes and evaluates the tuning agent, and stores the parsed data in the internal data structure for use in subsequent optimization analysis and decision-making processes. If it is the first time to call the agent, obtain the benchmark results of the blockchain network and use them as input in subsequent analysis to generate initial optimization recommendations.

[0118] S4. The data analysis agent integrates the information and generates parameter modification suggestions or stop iteration instructions.

[0119] In this step, the data analysis agent will integrate the various information collected, evaluate the current performance bottleneck of the blockchain network, generate parameter modification suggestions or decide whether to stop iteration. Finally, the generated suggestions will be encapsulated as message objects and stored in the message queue or the iteration will be stopped, and the final optimization parameters and results will be output. Specifically, the process of the data analysis agent integrating information and generating parameter modification suggestions or stopping iteration instructions includes the following steps:

[0120] Step 1: Integrate the information collected in step S3 and submit it to the data analysis agent to evaluate the performance bottleneck of the current blockchain and analyze the optimization space of the current configuration; the information collected in S3, such as blockchain node status information, optimization goals, expert knowledge base, tuning results and analysis, are submitted to the data analysis agent to build a performance profile of the current blockchain network; through analysis, the agent identifies the performance bottlenecks of the current blockchain network, determines the main causes of these bottlenecks, and associates them with specific blockchain parameters and configuration settings;

[0121] Step 2: Generate new parameter modification suggestions based on the analysis results, define the specific parameters that need to be adjusted and their adjustment directions, or output stop iteration instructions, terminate the optimization process, and output the final optimization parameters and results; Based on the performance bottleneck analysis, the data analysis agent generates new parameter modification suggestions, such as the parameters that need to be adjusted, the adjustment direction and amplitude, and gives the expected effect; If the analysis shows that the current parameters have reached the optimization goal or there is limited room for further optimization, the agent will generate a stop iteration instruction, generate the final optimization parameter set and performance indicators, and summarize the results and key findings of the entire optimization process as the final output;

[0122] It should be noted that parameter modification suggestions should follow the following rules: first, the adjustment range should be limited. The single adjustment range should not be too large to avoid affecting the stability of the blockchain network. In addition, gradual optimization should be carried out and a progressive optimization strategy should be adopted to avoid adjusting a large number of parameters each time.

[0123] Step 3: Encapsulate the parameter adjustment suggestions into a message object and output it to the message queue; if new parameter modification suggestions are generated, the agent encapsulates these suggestions into message objects and stores them in the system's message queue so that the tuning agent can use them in the next operation; if a stop iteration instruction is generated, the data analysis agent terminates the optimization iteration process.

[0124] S5. Execute the tuning agent, receive parameter modification suggestions, and perform parameter adjustments and performance tests.

[0125] In this step, the execution tuning agent will adjust the configuration of the blockchain network according to the parameter modification suggestions generated by the data analysis agent, and verify the adjustment effect through performance testing. Finally, the execution tuning agent will generate evaluation feedback and encapsulate the results as message objects for the data analysis agent to use in the next round of optimization; specifically, the execution tuning agent receives parameter modification suggestions and performs parameter adjustment and performance testing, which includes the following steps:

[0126] Step 1: Obtain the parameter modification suggestions of the data analysis agent from the message queue and submit them to the execution tuning agent; the execution tuning agent extracts the latest parameter modification suggestion message object generated by the data analysis agent from the system's message queue, and then the execution tuning agent parses the parameter adjustment suggestions obtained from the message object to understand the specific blockchain parameters that need to be adjusted and their corresponding target configurations;

[0127] Step 2: Modify the relevant parameters of the blockchain network according to the parameter modification suggestions; first, according to the suggestions of the data analysis agent, the execution tuning agent refines the preliminary parameter adjustment suggestions into specific parameter values, determines the new specific values ​​for each parameter that needs to be adjusted and its parameter range requirements, and considers the mutual impact with other parameters; after determining the parameter values, evaluate the feasibility of these adjustments in the current blockchain network to ensure that they will not cause potential system instability or resource conflicts; according to the determined specific parameter configuration, the execution tuning agent actually adjusts the blockchain network, modifies the parameter configuration file of the blockchain network and reconfigures the network to ensure that the new blockchain parameters take effect;

[0128] Step 3: Redeploy the Fabric network and use the Hyperledger Caliper tool to perform performance testing; after adjusting the parameters and reconfiguring the network, execute the tuning agent to redeploy the Hyperledger Fabric network; after the network deployment is completed, execute the tuning agent to use the Hyperledger Caliper tool to perform performance testing on the adjusted network; simulate actual application scenarios and execute predefined test cases covering different transaction types and load conditions in the current application scenarios to evaluate the performance of the new network configuration parameters in actual applications; record the test results and collect key performance indicators such as transaction throughput and transaction latency;

[0129] Step 4: The execution tuning agent generates evaluation feedback based on the parameter adjustment information and test results, and encapsulates the above content and outputs it to the message queue for use by the data analysis agent; the execution tuning agent conducts a comprehensive analysis based on the performance test results of the Caliper tool, evaluates the actual effect of the parameter adjustment, and compares the test results with the previous benchmark data to determine whether they meet the expected results, and identify whether there are new performance bottlenecks and optimization space after the adjustment; the analysis results, parameter adjustment information and performance test data are encapsulated into a message object, which should contain the adjusted parameter settings, performance test results and comparisons, and evaluation conclusions; the generated message object is stored in the system's message queue for use by the data analysis agent in the next round of optimization.

[0130] S6. Repeat steps S4-S5 and continue optimizing until the data analysis agent stops iterating.

[0131] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A multi-agent blockchain optimization system based on a large language model, characterized in that: Includes physical layer, storage layer, tool layer and optimization layer; The physical layer includes a data acquisition subsystem and a data processing subsystem; the data acquisition subsystem includes a sensor network and an Internet of Things device, which are installed on key physical nodes and are responsible for collecting data from the physical environment in real time; the data processing subsystem includes an edge server and an edge gateway, which are responsible for preliminary processing and transmission of the collected data; The storage layer is the core part of the system's data storage, management and transmission. It is responsible for storing the data collected and processed by the physical layer securely and transparently on the blockchain, and ensuring that the data remains consistent and cannot be tampered with during the flow of the entire system. This layer is based on the Hyperledger Fabric blockchain platform and builds a flexible and secure network topology, including sorting nodes, peer nodes, organizations and channels. The tool layer provides support for the optimization layer, including blockchain status monitoring tools, blockchain performance testing tools, blockchain deployment tools, and blockchain configuration modification tools, to ensure that the intelligent agent can interact with the environment efficiently; The optimization layer performs analysis, optimization and decision-making through a multi-agent system and is the core of the system agent operation; the multi-agent system includes a knowledge integration agent, a data analysis agent and an execution tuning agent; in addition, the optimization layer relies on localized data and background information and tool call modules to ensure that the system can achieve continuous adaptive optimization in a complex and dynamic environment; The sorting node is responsible for sorting transactions from different data sources and packaging these transactions into blocks to ensure that transactions are processed in order and maintain data consistency; the generated blocks will be packaged and confirmed on the sorting node and then passed to the peer node; The peer nodes are the core storage and computing units of the storage layer. They not only store the blocks generated by the sorting nodes, but are also responsible for adding these blocks to the distributed ledger of the blockchain. Each peer node stores a complete copy of the blockchain and ensures that the ledger contents on all nodes remain consistent through a consensus mechanism, thereby ensuring the security, integrity and traceability of the data. The organizations represent different participants in the blockchain network. Each organization has multiple peer nodes. These organizations participate in the blockchain network through their own peer nodes and realize private data exchange through channels to ensure the security and privacy of sensitive data. The channel acts as a communication path in the blockchain network, allowing multiple organizations to maintain data isolation in the same network while performing secure and efficient transaction processing; The localized data and background information are important foundations for supporting agent decision-making and optimization, including blockchain optimization goals, blockchain parameters and their functional introduction, expert knowledge and historical optimization data, and blockchain network information; The blockchain optimization goal clarifies the decision-making direction of the system in different scenarios, so that it can be adjusted around specific performance indicators during the optimization process; The blockchain parameters and their functions described above record various configuration parameters and their functions in the blockchain network. This information helps the agent to accurately identify and adjust key parameters during the optimization process, thereby improving the overall performance of the system. The expert knowledge and historical optimization data bring together the suggestions and historical optimization records of experts in the field. The intelligent agent selects the best parameter configuration by analyzing these historical data and expert knowledge, thereby providing a reliable reference for the current optimization task; The blockchain network information covers the system's current network topology, node configuration, transaction sending rate and transaction type information. This network information helps the intelligent agent better understand and adapt to the current network status and make optimization decisions accordingly.

2. A multi-agent blockchain optimization system based on a large language model according to claim 1, characterized in that: The blockchain status monitoring tool is the Prometheus tool. In the tool layer, Prometheus is responsible for real-time monitoring of the operating status of the blockchain network, collecting and analyzing the performance indicators of each node in the network; The blockchain performance testing tool is Hyperledger Caliper, which is a performance benchmarking tool used to evaluate and compare the performance of blockchain platforms. It simulates real application scenarios through a series of preset workloads and generates detailed performance reports to help the system identify performance bottlenecks and provide reliable data support for optimization decisions. The blockchain deployment tool is used to quickly build, deploy and manage blockchain networks, automating the entire process from network initialization, node configuration to smart contract deployment, simplifying the construction and management process of the blockchain system; The blockchain configuration modification tool dynamically adjusts the configuration parameters of the blockchain network through script calls to achieve automatic parameter tuning. The tool supports parameter modification during the iteration process to ensure that the network configuration can respond to environmental changes and system optimization requirements at any time.

3. A multi-agent blockchain optimization system based on a large language model according to claim 1, characterized in that: The knowledge integration agent is used to integrate and screen existing expert knowledge and historical optimization data. By reading and analyzing local historical log information or databases, it organizes and stores expert advice and previous optimization results, screens out the most effective parameter configuration, and forms an expert knowledge base, thereby providing knowledge reference for parameter optimization of the blockchain system.

4. A multi-agent blockchain optimization system based on a large language model according to claim 1, characterized in that: The data analysis agent is used to collect blockchain system data in real time, analyze the current network status, generate optimization suggestions, and interact with other agents to promote the automatic adjustment of system parameters.

5. According to claim 1, a multi-agent blockchain optimization system based on a large language model is characterized in that: The responsibilities of the execution tuning agent are to receive optimization suggestions from the data analysis agent, convert these suggestions into specific parameter adjustment operations, and verify the results of these adjustments through reconfiguration of the blockchain network and Caliper performance testing. After the test is completed, the execution tuning agent also needs to conduct a comprehensive analysis of the experimental results, evaluate the adjustment effect, and encapsulate the parameter adjustment information, test results and evaluation feedback as output for subsequent parameter adjustment iterations.

6. A multi-agent blockchain optimization system based on a large language model according to claim 1, characterized in that: The tool calling module is a key mechanism for the multi-agent system to interact with the external environment. By calling the blockchain status monitoring tool, blockchain configuration modification tool, blockchain deployment tool and blockchain performance testing tool, the agent can perform necessary tasks and realize automatic management and optimization of the system.

7. A multi-agent blockchain optimization method based on a large language model, using the multi-agent blockchain optimization system based on a large language model as claimed in claim 1, characterized in that: The steps include: S1. Deploy the initial configuration of the blockchain operating environment and related tools on the server; S2, the knowledge integration agent reads historical optimization data and expert knowledge from the local log or database, organizes them into a preliminary expert knowledge base, and selects the expert knowledge base with the best effect; The filtered expert knowledge base configuration is encapsulated into a message object and placed in the message queue for use by the data analysis agent; S3. The data analysis agent receives the performance and parameter data from the initial blockchain network, and obtains the best expert knowledge base from the message object output by the knowledge integration agent stored in the message queue; obtains the tuning results and analysis from the message object output by the execution tuning agent stored in the message queue. If it is the first time to call the agent, the benchmark test results of the blockchain network are obtained; S4, the data analysis agent integrates the information collected in step S3, evaluates the performance bottleneck of the current blockchain, analyzes the optimization space of the current configuration, and generates parameter modification suggestions or stop iteration instructions, and encapsulates the parameter modification suggestions into a message object and outputs them to the message queue; S5. The execution tuning agent obtains the parameter modification suggestions of the data analysis agent from the message queue, and modifies the relevant parameters of the blockchain network according to the parameter modification suggestions; redeploys the Fabric network and uses the Caliper tool to perform performance testing; finally, generates evaluation feedback based on the parameter adjustment information and test results, and encapsulates the above content and outputs it to the message queue for use by the data analysis agent; S6. Repeat steps S4-S5 and continue optimizing until the data analysis agent stops iterating.

8. A multi-agent blockchain optimization method based on a large language model according to claim 7, characterized in that: In S1, deploying the blockchain operating environment and related tools with initial configuration on the server includes the following steps: Step 1: Configure the Hyperledger Fabric network using default parameters, including creating channels, joining nodes, and deploying smart contracts; Step 2: Configure and start the Prometheus server instance to verify whether the node status information can be successfully collected; Step 3: Install and configure the Hyperledger Caliper performance testing tool, configure Caliper’s test script, define the test’s sending rate and transaction volume parameters, verify that Caliper can successfully run preliminary tests, and record baseline performance data.