Intelligent agent construction method and device
By using a low-code configuration interface and agent factory, combined with federated learning and knowledge distillation techniques, the problems of high development threshold, data silos, and high deployment costs of medical agents are solved, enabling rapid construction and efficient deployment of medical agents, and improving the generalization ability and robustness of the model.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-10
- Publication Date
- 2026-03-10
AI Technical Summary
The development of existing medical intelligent agents is difficult and time-consuming, suffers from serious data silos, has poor model generalization ability, and is costly and inefficient to deploy, making it difficult to meet the diverse and rapidly changing needs of medical scenarios.
Employing a low-code configuration interface and an agent factory, lightweight medical agents are constructed through federated learning and knowledge distillation techniques. An improved particle swarm optimization algorithm and weighted aggregation strategy are used to achieve collaborative utilization and efficient deployment of data from multiple institutions.
It lowers the technical threshold, shortens the development cycle, protects patient privacy and data security, improves the generalization ability and robustness of the model, reduces hardware costs, and enables the efficient deployment of intelligent agents on medical nodes with limited computing power.
Smart Images

Figure CN121638306A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, and in particular to an agent construction method and device. BACKGROUND
[0002] With the rapid development of artificial intelligence (AI) technology, agents are increasingly widely used in the medical and health field, such as intelligent pre-consultation, medical image assisted diagnosis, and personalized chronic disease management. These applications can effectively improve medical service efficiency, optimize medical resource allocation, and reduce the burden on medical staff.
[0003] However, the existing construction method of medical agents faces many challenges: 1) High development threshold and long cycle: Traditional agent development requires close collaboration between professional AI algorithm engineers, software developers, and domain experts, involving complex model training, system integration, and deployment. The technical threshold is high, the development cycle is long, and it is difficult to meet the diverse and rapidly changing needs of the medical field.
[0004] 2) Data island problem: Medical data is highly sensitive and private, and is scattered in different medical institutions, forming a "data island". Traditional centralized training methods require data to be collected together, which poses a huge risk of data security and privacy leakage, and is strictly limited by regulations.
[0005] 3) Poor model generalization ability: Agents trained on single medical institution data often have "overfitting" problems and are difficult to adapt to data distribution differences in other medical institutions, resulting in poor model generalization ability and high promotion costs.
[0006] 4) High deployment cost and low efficiency: High-performance agent models usually have a large number of parameters and require high computing resources. Many medical nodes (such as community hospitals and primary clinics) have limited hardware facilities and are difficult to support the deployment and real-time inference of large models, causing the "large model, small scene" contradiction.
[0007] Therefore, how to provide a medical agent construction method that can reduce the development threshold, protect data privacy, improve model generalization ability, and achieve efficient deployment is a technical problem that needs to be solved at present. SUMMARY
[0008] The present application provides an agent construction method and device, which solves the problems of high development threshold, long cycle, data island problem, poor model generalization ability, high deployment cost, and low efficiency in the prior art.
[0009] In a first aspect, an agent construction method is provided, the method comprising: receive an agent construction request input by a user using a preset low-code configuration interface; the agent construction request includes a role, a responsibility, and a knowledge base association of a medical agent to be constructed; match and combine at least one basic capability model from a preset agent factory based on the agent construction request to form an initial agent; federated training and knowledge distillation are performed on the initial agent to obtain a medical agent, and the medical agent is deployed to a corresponding medical node.
[0010] The technical scheme provided by the embodiments of the present application at least brings the following beneficial effects: Through the low-code configuration interface and the agent factory, the complex agent development process is converted into modular dragging, selecting, and configuring, so that non-professional developers can also quickly construct customized medical agents, greatly reducing the technical threshold and shortening the development cycle; using the federated learning framework, the original data of each medical node does not need to be exported from the local, and only the model update amount is uploaded to the central server for aggregation, realizing the collaborative use of multi-institutional data on the premise of protecting patient privacy and data security, and effectively breaking the data silos; through multi-node federated learning, the agent can learn knowledge from different medical institutions and different data distributions, significantly improving the generalization ability and robustness; at the same time, the improved particle swarm optimization algorithm and the weighted aggregation strategy are introduced to further optimize the local training effect and the global agent quality; through the knowledge distillation technology, the knowledge of a large but excellent global agent (teacher model) is migrated to a lightweight student model, so that it can be efficiently deployed and run on medical nodes with limited computing power, reducing the application threshold and hardware cost.
[0011] In an optional implementation, based on the agent construction request, at least one basic capability model is matched and combined from a preset agent factory to form an initial agent, including: determining the core content required by the medical agent to be constructed based on the role and responsibility of the agent construction request; the core content includes a question and answer mode, a task mode, and a planning mode; According to the core content, at least one basic capability model is matched from the preset agent factory, and a cooperative calling strategy between the basic capability models is configured; configure the knowledge base for the basic capability model based on the knowledge base association of the agent construction request; According to the cooperative calling strategy, at least one basic capability model configured with a knowledge base is combined to form an initial agent.
[0012] In an optional implementation, federated training and knowledge distillation are performed on the initial agent to obtain a medical agent, and the medical agent is deployed to a corresponding medical node, including: At the central server corresponding to the low-code configuration interface, at least one medical node involved in the agent construction request is extracted, and a federated learning network including the central server and a plurality of medical nodes is constructed; Based on the federated learning network, federated learning is performed on the initial agent, and a global agent is constructed at the central server; Based on the federated learning network, knowledge distillation is performed on the global agent, a lightweight medical agent is constructed at the central server, and the lightweight medical agent is deployed to the corresponding medical node.
[0013] In an optional implementation, at the central server corresponding to the low-code configuration interface, at least one medical node involved in the agent construction request is extracted, and a federated learning network including the central server and a plurality of medical nodes is constructed, comprising: At the central server corresponding to the low-code configuration interface, at least one medical node involved in the agent construction request is extracted; If the agent construction request only involves one medical node, at least one other medical node similar to the current medical node scenario is matched; A unique identity and an encryption key are assigned to each medical node participating in federated learning, and a secure communication channel is established; Through the secure communication channel, the central server is connected with all medical nodes participating in federated learning, and a federated learning network is constructed.
[0014] In an optional implementation, if the agent construction request only involves one medical node, at least one other medical node similar to the current medical node scenario is matched, comprising: If the agent construction request only involves one medical node, the metadata of the current medical node is collected, and a scenario portrait vector of the current medical node is constructed according to the metadata; According to the agent construction request, a candidate node pool of medical nodes is obtained by screening in the meta-database preset in the central server; The similarity between the scenario portrait vector of the current medical node and the preset scenario portrait vector of the candidate nodes in the candidate node pool is obtained, and at least one candidate node with a similarity higher than a similarity threshold is extracted; A federated learning participation invitation request is sent to the matched candidate node, and a request response returned by the candidate node is received; If the request response received by the central server is received, the candidate node is taken as another medical node, otherwise, the candidate node matching is continued, another candidate node with a similarity higher than the similarity threshold is extracted, and the previous step is returned.
[0015] In an optional implementation, based on the federated learning network, the initial agent is subjected to federated learning, and a global agent is constructed at the central server, including: The initial agent is deployed to all medical nodes of the federated learning network, and a corresponding knowledge base is configured for the initial agent based on the knowledge base association requested by the agent; In the medical nodes with local medical data, an improved particle swarm optimization algorithm is introduced to quickly train the initial agent, and the corresponding model update and evaluation index are extracted; According to the identity and encryption key of each medical node, the model update and evaluation index are encrypted and uploaded to the central server of the federated learning network through a secure communication channel; In the central server, the model updates of all medical nodes are securely aggregated according to the evaluation index to generate a federated learning agent, and the federated learning agent is distributed to all medical nodes for the next round of federated learning; Until the global optimization model converges or the number of federated learning reaches the threshold, the current federated learning agent is taken as the global agent in the central server.
[0016] In an optional implementation, in the medical nodes with local medical data, an improved particle swarm optimization algorithm is introduced to quickly train the initial agent, and the corresponding model update and evaluation index are extracted, including: The optimization objective of the optimization training is determined, the fitness function is set, the core hyperparameters to be optimized are defined, and the core hyperparameters are encoded as the positions of the particles of the improved particle swarm optimization algorithm; The initial particle swarm is generated by using a chaotic sequence for initialization; Based on the local medical data, the fitness function of each initial particle in the initial particle swarm is obtained using the fitness function, and the particle with the optimal fitness is taken as the global optimal solution; The Levy flight mechanism and the convergence factor are introduced to update the positions of the initial particle swarm to obtain an updated particle swarm; Based on the local medical data, the fitness function of each updated particle in the updated particle swarm is obtained using the fitness function, and the particle with the optimal fitness is updated as the global optimal solution; The particle swarm updating step is repeated until the number of optimization training iterations reaches the threshold or the global optimal solution does not improve significantly for a certain number of consecutive iterations, and the current global optimal solution is output; The position of the current global optimal solution is decoded to obtain the optimal core hyperparameters, and the configuration parameters of the initial agent are optimized according to the optimal core hyperparameters to obtain a local agent; Extract the model update quantity corresponding to the local agent and the evaluation index; the evaluation index includes sample size, accuracy, time delay and cost.
[0017] In an optional implementation, in the central server, the model update quantities of all medical nodes are securely aggregated according to the evaluation index, a federated learning agent is generated, and the federated learning agent is distributed to all medical nodes for the next round of federated learning, including: In the central server, a secure aggregation weight of the model update quantity of each medical node is generated according to the evaluation index; The model update quantities of all medical nodes are securely aggregated according to the secure aggregation weight of the model update quantity of each medical node, to obtain a secure aggregation model parameter; The initial agent is adjusted according to the secure aggregation model parameter, a federated learning agent is generated, and the federated learning agent is distributed to all medical nodes for the next round of federated learning.
[0018] In an optional implementation, based on the federated learning network, the global agent is knowledge distilled, a lightweight medical agent is constructed in the central server, and the medical agent is deployed to the corresponding medical node, including: The global agent is solidified as a teacher model, a lightweight student model is designed for the teacher model according to the computing power limit of the medical node of the federated learning network; Based on the knowledge base association of the agent construction request, the teacher model and the student model are configured with corresponding knowledge bases; In the central server of the federated learning network, the teacher model and the student model are synchronously trained according to a general training data set, and the trained student model is used as a lightweight medical agent; According to the identity of each medical node and the encryption key, the lightweight medical agent is sent to the medical node involved in the agent construction request through a secure communication channel.
[0019] In a second aspect, the embodiments of the present application provide an agent construction device for implementing the agent construction method, and the device includes: A request receiving unit is configured to receive an agent construction request input by a user using a preset low-code configuration interface; An agent construction unit is configured to match and combine at least one basic capability model from a preset agent factory based on the agent construction request to form an initial agent; An agent training unit is configured to perform federated training and knowledge distillation on the initial agent to obtain a medical agent, and deploy the medical agent to a corresponding medical node.
[0020] The third aspect of the embodiment of the present application provides an electronic device, and the electronic device comprises: at least one processor; and a memory connected with the at least one processor in communication; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to the first aspect of the embodiment of the present application.
[0021] The fourth aspect of the embodiment of the present application provides a computer readable storage medium, and the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method according to the first aspect of the embodiment of the present application. BRIEF DESCRIPTION OF DRAWINGS
[0022] Figure 1 The electronic device structure diagram of a hardware running environment related to the embodiment of the present application is shown in the figure. Figure 2 The step flow chart of the agent construction method provided by the embodiment of the present application is shown in the figure. Figure 3 The functional unit schematic diagram of the agent construction device provided by the embodiment of the present application is shown in the figure. DETAILED DESCRIPTION
[0023] In order to make the above objectives, characteristics and advantages of the present application more apparent, comprehensible and easy to understand, the present application will be further described in detail below with reference to the drawings and specific embodiments. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0024] The scheme of the present application will be further described below with reference to the drawings.
[0025] Reference Figure 1 , Figure 1 The electronic device structure diagram of a hardware running environment related to the embodiment of the present application is shown in the figure.
[0026] As Figure 1As shown, the electronic device can include a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to realize the connection and communication between the components. The user interface 1003 can include a display, an input unit such as a keyboard, and can also include a standard wired interface, a wireless interface. The network interface 1004 can optionally include a standard wired interface, a wireless interface (such as a wireless fidelity (WIreless-FIdelity, WI-FI) interface). The memory 1005 can be a high-speed random access memory (RAM) memory, or a stable non-volatile memory (Non-Volatile Memory, NVM) such as a disk memory. The memory 1005 can also be a storage device independent of the aforementioned processor 1001.
[0027] Those skilled in the art can understand that Figure 1 The structure shown in the figure does not constitute a limitation on the electronic device, and can include more or fewer components than the figure, or combine certain components, or different component arrangements.
[0028] As Figure 1 As shown, the memory 1005 as a storage medium can include an operating system, a data storage module, a network communication module, a user interface module, and an electronic program of the agent construction device.
[0029] In Figure 1 In the electronic device shown, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the electronic device of the present application can be arranged in the electronic device, and the electronic device calls the electronic program of the agent construction device stored in the memory 1005 through the processor 1001, and executes the agent construction method provided by the embodiment of the present application.
[0030] Referring to Figure 2 , the embodiment of the present application provides an agent construction method, which comprises: S201: using a preset low-code configuration interface, receiving an agent construction request input by a user; the agent construction request includes a role, a responsibility, and a knowledge base association of a medical agent to be constructed; S202: based on the agent construction request, matching and combining at least one basic capability model from a preset agent factory to form an initial agent; S203: Perform federated training and knowledge distillation on the initial intelligent agent to obtain a medical intelligent agent, and deploy it to the corresponding medical node.
[0031] The technical solution provided in this application has at least the following beneficial effects: Through a low-code configuration interface and agent factory, the complex agent development process is transformed into modular drag-and-drop, selection, and configuration, enabling non-professional developers to quickly build customized medical agents, greatly reducing the technical threshold and shortening the development cycle. Employing a federated learning framework, the raw data from each medical node does not need to leave its local machine; only model updates are uploaded to a central server for aggregation. This achieves collaborative utilization of multi-institutional data while protecting patient privacy and data security, effectively breaking down data silos. Through multi-node federated learning, agents can learn knowledge from different medical institutions and data distributions, significantly improving generalization ability and robustness. Simultaneously, the introduction of improved particle swarm optimization algorithms and weighted aggregation strategies further optimizes local training effects and global agent quality. Knowledge distillation technology transfers the knowledge of the large but high-performance global agent (teacher model) to a lightweight student model, enabling efficient deployment and operation on medical nodes with limited computing power, reducing application barriers and hardware costs.
[0032] In one alternative implementation, based on an agent construction request, at least one basic capability model is matched and combined from a pre-defined agent factory to form an initial agent, including: S2021: Based on the roles and responsibilities of the agent construction request, determine the core content required for the medical agent to be constructed; the core content includes question-answering mode, task mode, and planning mode; In this embodiment, the role definition defines the identity and core functional scope of the intelligent agent; it determines the "persona" of the intelligent agent, that is, what role it plays in the medical ecosystem, which users (doctors, nurses, patients, administrators) it interacts with, and in what scenarios it works; Implementation: In a low-code configuration interface, this typically manifests as a dropdown menu, tabs, or a role card library; users select one or more predefined roles from it; for example, AI general practitioner pre-consultation nurse, AI imaging diagnostic physician, AI pathology analyst, etc. Responsibilities are a detailed breakdown of the specific tasks of the selected role; they define the specific operations that the agent needs to perform and the goals it needs to achieve; a role can be associated with one or more responsibilities. Implementation: After a role is selected, the interface will dynamically load the available responsibility modules for that role, usually presented as a checkbox list, draggable blocks, or flowchart; for example, dialogue and interaction: multi-turn dialogue management, voice interaction, text generation, emotion recognition; Analysis and reasoning: Symptom analysis, medical image interpretation, laboratory report analysis, and review of medication rationality; Decision-making and recommendation categories: preliminary disease diagnosis, triage recommendations, treatment plan suggestions, and health risk warnings; Execution and Recording: Automatically generate medical records, fill out electronic forms, send follow-up notices, and schedule appointments; Knowledge base associations provide factual basis and professional knowledge for the execution of the agent's responsibilities; they define what the agent "knows" and are the foundation for the agent to make professional and accurate judgments; without a knowledge base, the agent is just an empty shell. Implementation: The interface provides a knowledge base management area, allowing users to: Choose from the preset knowledge base: The platform has a large number of verified and standardized knowledge bases pre-built; Upload to private knowledge base: Hospitals can upload their own internal, anonymized knowledge files; Connect to dynamic data sources: You can configure real-time data interfaces to connect to the hospital's information system, electronic medical record system, laboratory information system, and other systems. For example, a medical knowledge graph contains the relationships between diseases, symptoms, drugs, and tests. Clinical practice guidelines: such as national or industry-issued guidelines for the diagnosis and treatment of various diseases; Drug knowledge base: includes drug instructions, contraindications, adverse reactions, etc. For example, the role is "AI General Practice Pre-Consultation Nurse," whose responsibilities include: multi-round dialogue management, symptom analysis, laboratory report interpretation, and triage recommendation; Determine the core elements required to build the medical intelligent agent: Question-and-answer mode: Multi-turn dialogue management; Interpretation: This intelligent agent needs to be able to communicate back and forth with humans in natural language; it needs to understand questions, manage the context of the conversation, and generate logical and appropriate responses. Technical implications: This refers to a dialogue engine, the core of which is the dialogue management capability of a large language model; Task mode: Symptom analysis, laboratory report interpretation; Interpretation: These responsibilities are clearly defined tasks with specific input and output goals; for example, inputting a patient description (text) and outputting a structured list of symptoms; inputting a report image and outputting key indicator values. These are "one-off," goal-driven operations. Technical implications: This refers to a series of specialized and efficient "task-oriented models", such as text classification models, named entity recognition models, and optical character recognition (OCR) models. Planning model: Triage recommendation; Interpretation: Triage is not a simple task. It requires integrating information from multiple sources (symptoms in the conversation, analyzed report indicators, and the patient's historical information), and then reasoning based on complex rules and knowledge to make an optimal decision (which department to recommend). It is a multi-step, logically sequential planning process. Technical implications: This points to a decision engine, the core of which may be a knowledge graph reasoning engine or a rule-based complex decision tree; Through step S2021, a technical blueprint was obtained: to build this intelligent agent, a question-and-answer mode dialogue engine, several task mode dedicated models, and a planning mode decision engine are needed. S2022: Based on the core content, match at least one basic capability model from the preset intelligent agent factory, and configure the collaborative invocation strategy between the basic capability models; In the pre-designed intelligent agent factory, the basic capability model is the core "building block" for constructing any medical intelligent agent; it is a pre-trained model with specific AI capabilities that can be flexibly called, combined, and configured by the intelligent agent factory to complete complex medical tasks. These models can be systematically divided into several core categories, each containing multiple specific models, collectively forming a basic capability model library, including: Language and interaction models are the core of how intelligent agents communicate, understand, and generate text with humans (patients, medical staff); Large-scale language models: Function: This is the "brain" of the intelligent agent, responsible for complex language understanding, logical reasoning, content generation, and multi-turn dialogue management; Technical examples: Models based on architectures such as Generative Pre-trained Transformer (GPT), Meta AI's Large Language Model Meta AI (Llama), and Chat General Language Model (ChatGLM), and have been fine-tuned using massive amounts of medical literature, medical records, and guidelines; Speech recognition model: Function: Converts doctors' dictation and patients' voice-based questions and answers into text in real time; Technical Example: Automatic Speech Recognition (ASR) models based on architectures such as Convolution-augmented Transformer (Conformer) and Transformer, with specific optimizations for medical terms (drug names, disease names, examination items); Text-to-speech models: Function: To read text information aloud in a natural and fluent voice. Technical example: Text-to-speech (TTS) models based on architectures such as Tacotron and FastSpeech, providing a variety of voice timbres (such as a gentle nurse's voice and a calm doctor's voice). Visual perception model, which is the ability of intelligent agents to "understand" medical images and videos; Medical image classification and detection models: Function: Identify and classify lesions and abnormalities in medical images.
[0033] Technical example: Convolutional Neural Network (CNN) models based on architectures such as ResNet, EfficientNet, and Vision Transformer (ViT) are trained for different modalities (X-ray, CT, MRI, pathological slides).
[0034] Medical image segmentation model: Function: To perform pixel-level precise delineation of organs and lesions in images and generate outlines; Technical examples: Models based on architectures such as U-Net, U-Net++, and nnU-Net; Video understanding model: Function: Analyzes actions, events, and anomalies in video streams; Technical examples: Models based on architectures such as 3D-CNN and Video Transformer; Reasoning and decision-making models are the core of intelligent agents for making logical judgments, assessing risks, and formulating plans. Knowledge graph reasoning engine: Function: Performs logical reasoning and correlation analysis based on a vast medical knowledge graph (containing relationships between diseases, symptoms, drugs, and examinations); Technical examples: based on graph neural networks, path ranking algorithms, etc.; Causal inference model: Function: Beyond correlation, it explores causal relationships between variables. For example, determining whether a particular treatment was a "cause" of a patient's recovery; Technical examples: based on structural causal models, Do-calculus, etc.; Reinforcement learning models: Function: To learn optimal decision-making strategies through interaction with the environment (simulated or real) to maximize long-term returns; Technical examples: based on algorithms such as Q-Learning, Proximal Policy Optimization (PPO), and Soft Actor-Critic (SAC); Data analysis and prediction models are the ability of intelligent agents to discover patterns and make predictions from massive amounts of data; Time series forecasting models: Function: Predicts indicators that change over time; Technical examples: Models based on Autoregressive Integrated Moving Average (ARIMA), Long Short-Term Memory (LSTM), Transformer, etc. Survival analysis model: Function: Predicts the probability and time of survival of a patient in the event of a certain event (such as death or relapse); Technical examples: based on Cox proportional hazards model, DeepSurv, etc.; In this embodiment, the user-inputted "roles" and "responsibilities," which are biased towards business descriptions, are translated into "core content patterns" at the technical implementation level that the central server can understand; this is a key transformation from "requirements" to "technical specifications." Collaborative Invocation Strategy: Based on the technical blueprint determined in step S2021, select specific "building blocks" (basic capability models) from the "shelves" of the intelligent agent factory, and design how these building blocks are assembled together; Model matching: Question-answering mode: Match a large language model finely tuned to medical dialogue data from the model library, such as Med-ChatGLM-6B (Large Language Model, LLM). Task Mode: Symptom analysis: Match a medical text named entity recognition model, such as Medical - Bidirectional Encoder Representations from Transformers (BERT) - Named Entity Recognition (NER). Test report analysis: Matching an OCR model + a table information extraction model; Planning pattern: Match a medical knowledge graph reasoning engine, such as Medical-KG-Reasoner; Configure the collaborative invocation strategy: This is the process of defining a "workflow" or "orchestration logic"; For example, the pre-consultation process (user input): / / 1. Question-and-answer mode dominates the dialogue. Dialogue response = LLM_Dialogue(user input) / / 2. Task Mode for Background Analysis IF "User Input" contains symptom description: Symptom List = NER_Model(User Input) Add the symptom list to "Patient Profile" IF "User Input" contains report image: Report Text = OCR_Model(User Input) Indicator List = Extraction_Model(Report Text) Add the indicator list to "Patient Profile" / / 3. Decision-making in planning mode IF "Patient Profile" information is sufficient: Recommended Department = KG_Reasoner(Patient Profile) Returns to LLM_Dialogue.generate(Recommended Department) ELSE: Return to the dialog response / / Continue guidance; S2023: Based on the intelligent agent, construct the knowledge base association for the request and configure the corresponding knowledge base for the basic capability model; By defining the roles, responsibilities, and knowledge base in a progressive manner, a vague need for "I want an AI" is precisely transformed into a complete engineering blueprint that can be understood and executed by the intelligent agent factory, containing identity, tasks, and knowledge. This blueprint serves as the direct input and basis for subsequent automated operations such as model matching, combination, federated learning, and knowledge distillation. In this embodiment, the newly selected and arranged "model skeleton" is infused with a "soul"—that is, professional knowledge; a model without a knowledge base is just a general algorithm, while a model with a knowledge base becomes a "medical expert". For example, configure Med-ChatGLM-6B as follows: Knowledge base: "Standard consultation process template", "Introduction to departments and experts of XX Hospital"; Configuration method: Through retrieval-enhanced generation technology, the content of these knowledge bases is vectorized and stored in a vector database; before the LLM generates an answer, relevant knowledge fragments are retrieved and input into the LLM as part of the prompts to ensure the accuracy and compliance of its answer; Configuration for Medical-BERT-NER (NER model): Knowledge base: "Standard Medical Terminology Dictionary", "Common Symptom Synonyms Database"; Configuration method: Use these dictionaries as the labeling system and entity dictionary of the NER model to improve the accuracy of the model in recognizing technical terms and synonyms; Configure Medical-KG-Reasoner (inference engine): Knowledge base: "National Guidelines for the Diagnosis and Treatment of Common Diseases at the Grassroots Level", "Disease-Symptom-Department Mapping Knowledge Graph"; Configuration method: These knowledge graphs are directly loaded into the inference engine as the factual basis for its path search and logical reasoning; S2024: Based on the collaborative invocation strategy, combine at least one basic capability model configured with a knowledge base to form an initial intelligent agent; In this embodiment, instantiation and integration: Instantiate all models in the computing environment: Load the model files of Med-ChatGLM-6B, Medical-BERT-NER, OCR_Model, and Medical-KG-Reasoner into memory; Load all associated knowledge bases: vector database, terminology dictionary, diagnostic knowledge graph, etc.; Compile the defined "cooperative invocation strategy" into an executable workflow script (such as Python code); Encapsulation and exposure of interfaces: The entire workflow script, all model instances, and knowledge base are encapsulated into a unified service; Provide a standard API interface (such as a RESTful API) for this service, for example, / api / triage; When an external system (such as a hospital's app or self-service machine) calls this API and passes in user input, the entire pre-consultation process will be executed automatically. Formation of the initial intelligent agent: At this point, an initial intelligent agent of "AI general practitioner pre-consultation nurse" with complete functions, but which has not yet undergone large-scale real data optimization, has been built. It can be deployed to a test environment for preliminary functional verification and is ready to enter the next stage of federated learning, knowledge distillation and swarm intelligence optimization process, so as to become smarter and more efficient.
[0035] In one optional implementation, the initial agent undergoes federated training and knowledge distillation to obtain a medical agent, which is then deployed to the corresponding medical nodes, including: S2031: On the central server corresponding to the low-code configuration interface, extract at least one medical node involved in the agent construction request, and construct a federated learning network including the central server and several medical nodes. In this embodiment, a secure and reliable collaborative network is established without disclosing the original data of any party, laying the foundation for subsequent collaborative optimization. S2032: Based on a federated learning network, federated learning is performed on the initial agent to build a global agent on the central server; S2033: Based on federated learning networks, knowledge distillation is performed on global intelligent agents, lightweight medical intelligent agents are built on a central server, and the lightweight medical intelligent agents are deployed to the corresponding medical nodes.
[0036] In one alternative implementation, at a central server corresponding to the low-code configuration interface, at least one medical node involved in the agent construction request is extracted, and a federated learning network including the central server and several medical nodes is constructed, including: S20311: Extract at least one medical node involved in the agent construction request from the central server corresponding to the low-code configuration interface; S20312: If the agent construction request involves only one medical node, then match at least one other medical node that is similar to the current medical node scenario; In this embodiment, for example, the request may explicitly specify "deployment at Hospital A". If there is only one (e.g., only Hospital A), in order to start federated learning, the node matching procedure will be automatically started. Although Hospital A has a large amount of data, it only covers a single type of disease. In order to make the model more powerful, it is necessary to find "external assistance". S20313: Assign a unique identity and encryption key to each medical node participating in federated learning, and establish a secure communication channel; In this embodiment, an end-to-end encrypted communication environment is established for all confirmed participating medical nodes (A, B, C) and the central server; Identity authentication: The central server acts as the certificate authority, issuing a unique X.509 client certificate to each node; Communication encryption: All communication between medical nodes and the server uses the TLS 1.3 protocol to ensure the confidentiality and integrity of data transmission; before transmission, model updates are signed with the node's private key, and the server verifies the signature with its public key to ensure the source is trustworthy; S20314: Connect the central server with all medical nodes participating in federated learning through a secure communication channel to build a federated learning network; In this embodiment, after completing the above steps, a federated learning network consisting of one central server and three medical nodes (A, B, and C) is formally constructed and ready to begin training.
[0037] In one alternative implementation, if the agent construction request involves only one medical node, then at least one other medical node similar to the current medical node scenario is matched, including: S203121: If the agent construction request only involves one medical node, collect the metadata of the current medical node, and construct the scene profile vector of the current medical node based on the metadata. In this embodiment, metadata of Hospital A is collected, such as hospital level (tertiary-level), main departments (respiratory department, cardiology department), equipment model, region, annual outpatient volume, etc., to form a multi-dimensional "scene profile vector". S203122: Based on the agent construction request, the candidate node pool for medical nodes is obtained by filtering in the metadata database preset by the central server. S203123: Obtain the similarity between the scene profile vector of the current medical node and the preset scene profile vector of the candidate nodes in the candidate node pool, and extract at least one candidate node whose similarity is higher than the similarity threshold. In this embodiment, a similarity threshold (e.g., 0.85) is set; it is assumed that the similarity between Hospital B (also a tertiary hospital with a strong respiratory department and using similar CT equipment) and Hospital C (a large community hospital with a wide range of diseases, but different equipment) is higher than the threshold. S203124: Send a federated learning participation invitation request to the matched candidate nodes and receive the request response returned by the candidate nodes; In this embodiment, the invitation will specify the task objectives (such as "improving the lung nodule diagnostic model"), data requirements (only local CT images are required), and privacy protection measures (federated learning, differential privacy). S203125: If the central server receives a "received" response to the request, then the candidate node is used as another medical node; otherwise, continue matching candidate nodes, extract other candidate nodes with similarity higher than the similarity threshold, and return to the previous step.
[0038] In one alternative implementation, based on a federated learning network, the initial agent undergoes federated learning, and a global agent is constructed on a central server, including: S20321: Deploy the initial agent to all medical nodes of the federated learning network, build the knowledge base association for the request based on the agent, and configure the corresponding knowledge base for the initial agent; In this embodiment, the role is "AI general practitioner pre-consultation nurse". The central server packages the trainable part of the initial intelligent agent (including LLM, NER model, etc.) and training scripts and distributes them to all medical nodes (Hospitals A, B, and C) in the federated network through a secure channel. Knowledge base configuration: General Knowledge Base: The central server distributes the "National Guidelines for the Diagnosis and Treatment of Common Diseases at the Primary Level" and the "Standard Symptom Dictionary" to all three hospitals; Private knowledge base: Hospital A's node loads its private "Pediatric Common Diseases and Nursing Knowledge Base"; Hospital B's node loads its private "Adult Specialty Disease Knowledge Base"; Hospital C's node loads its private "knowledge base for the management of chronic diseases such as hypertension and diabetes"; Results: All three hospitals had the same initial model "skeleton", but were "fed" with their respective domain expertise, which prepared them for localized training; S20322: In medical nodes with local medical data, an improved particle swarm optimization algorithm is introduced to quickly train the initial agent locally and extract the corresponding model update amount and evaluation index. In this embodiment, a small number of rapid localized training sessions are used. For example, in each localized training cycle, the initial agent is optimized 10-20 times using an improved particle swarm optimization algorithm. An optimization trigger mechanism can also be set up. If, during the federated learning process, the federated learning agent in this federated learning session does not achieve the expected improvement in evaluation metrics compared to the previous federated learning session, then the improved particle swarm optimization algorithm will be triggered to optimize the initial agent 10-20 times. S20323: Based on the identity and encryption key of each medical node, the model update and evaluation metrics are encrypted and uploaded to the central server of the federated learning network through a secure communication channel. In this embodiment, the medical node of Hospital A uses its private key to sign {model update amount, evaluation index}, and then uploads it to the central server through a TLS secure channel; the medical nodes of Hospitals B and C perform the same operation. S20324: In the central server, based on the evaluation metrics, the model update volume of all medical nodes is securely aggregated to generate a federated learning agent, and the federated learning agent is distributed to all medical nodes for the next round of federated learning. In this embodiment, the central server uses the public keys of A, B, and C to verify the integrity and origin of the data packets. This aggregated model update includes not only the pediatric knowledge of Hospital A, but also the comprehensive diagnosis and treatment capabilities of Hospital B and the big data statistical patterns of Hospital C. S20325: Until the global optimization model converges or the number of federated learning iterations reaches the federated learning iteration threshold, the current federated learning agent is used as the global agent in the central server. In this embodiment, the agent continuously "adjusts" its performance on the data distribution of medical nodes in hospitals A, B, and C, resulting in continuous performance improvement. The central server monitors the performance of the global agent on the global validation set in each round. Assuming that after the 25th round, the agent's overall F1 score (accuracy) stabilizes at 0.96, and the improvement is less than 0.1% for 5 consecutive rounds, it is considered to have converged. Training stops, and the central server solidifies the "federated learning agent" of the 25th round into the final "global agent".
[0039] In one alternative implementation, an improved particle swarm optimization algorithm is introduced into the medical node possessing local medical data to rapidly train the initial agent locally, and the corresponding model update amount and evaluation metrics are extracted, including: S203221: Clearly define the optimization objective of the training, set the fitness function, define the core hyperparameters to be optimized, and encode the core hyperparameters as the positions of particles in the improved particle swarm optimization algorithm; The formula is:
[0040] In the formula, Fitness values of candidate local agents constructed for the core hyperparameters corresponding to the particles; Accuracy is the percentage of samples in the validation set that are correctly predicted out of the total number of samples in the validation set. The latency for a single inference attempt by the agent; The time delay reference value used for normalization (e.g., 100ms); The costs incurred for training or inference; This serves as a cost benchmark for normalization. The fitness weights sum to 1; The core hyperparameters are the most critical hyperparameters in the initial intelligent agent. In this embodiment, they include the learning rate of the large language model (LLM), the learning rate of the named entity recognition (NER) model, the maximum number of rounds allowed by the dialogue engine, and the temperature of the LLM-generated text, which controls creativity and stability. S203222: Initialize using the Tent chaotic sequence to generate the initial particle swarm; The formula is:
[0041] In the formula, The first in the particle swarm i One particle; For the first i One chaotic variable; These are the upper and lower bounds of the search space; i For particle indication;
[0042] In the formula, For the first i+ One chaotic variable; compared with random initialization, chaotic initialization can ensure that the population is evenly distributed in the solution space, thus enhancing diversity. S203223: Based on local medical data, using a fitness function, obtain the fitness function of each initial particle in the initial particle swarm, and take the particle with the best fitness as the global optimal solution; S203224: Introducing the Levy flight mechanism and convergence factor, the initial particle swarm is updated to obtain an updated particle swarm. The formula is:
[0043] In the formula, Number of iterations t+ 1 of i The search direction for an updated particle; Inertia weights improved for convergence factors; Number of iterations t The globally optimal particle; Number of iterations t The i An updated particle; For individual learning factors and social learning factors, both are random numbers between [0,1]. for Levy Distributed random numbers; b for Levy Step length, and b ∈[1,2]; t This represents the current iteration number; A random number uniformly distributed between [0, 1]. Number of iterations t The i The updated particle's own optimal position found so far;
[0044] In the formula, Number of iterations t+ 1 of i An updated particle;
[0045] In the formula, These represent the maximum and minimum values of the inertia weight; This is the threshold for the number of iterations; , To adjust the parameters; It is the hyperbolic tangent function; S203225: Based on local medical data, use the fitness function to obtain the fitness function of each updated particle in the updated particle swarm, and update the particle with the best fitness as the global optimal solution. S203226: Repeat the particle swarm optimization update steps until the number of optimization training iterations reaches the iteration threshold or the global optimal solution has not improved significantly for several consecutive iterations, and output the current global optimal solution; S203227: Decode the position of the current global optimal solution to obtain the optimal core hyperparameters, and optimize the configuration parameters of the initial agent based on the optimal core hyperparameters to obtain the local agent; S203228: Extract the model update quantity and evaluation metrics corresponding to the local intelligent agent; the evaluation metrics include sample size, accuracy, latency, and cost; In this embodiment, the difference between the local agent weight and the initial agent weight is calculated to obtain the model update amount; A comprehensive evaluation of the local agent is performed on the validation set of each medical node, resulting in a set of detailed metrics: For example, sample size: 30,000, accuracy: 0.92, latency: 95ms, cost: (quantifiable as the number of GPU hours required for training) 2.5 GPU-hours, used for subsequent server-aggregated weight calculation.
[0046] In one optional implementation, the model updates from all medical nodes are securely aggregated on the central server based on evaluation metrics to generate a federated learning agent. This agent is then distributed to all medical nodes for the next round of federated learning, including: S203241: In the central server, a safe aggregate weight for the model update amount of each medical node is generated based on the evaluation indicators. The formula is:
[0047] In the formula, For the first j Security aggregation weights for medical nodes; For the first j The sample size contribution index of medical nodes; For the first j Accuracy metrics for medical nodes; For the first j The efficiency score is obtained by combining the latency and cost of medical nodes; j In this embodiment, the total number of medical nodes is the indicator quantity for medical nodes. N It is 3;
[0048] In the formula, This represents the sample size for the 1st, 2nd, and 3rd medical nodes; For the first j Sample size at medical nodes;
[0049] In the formula, The accuracy rate for the 1st, 2nd, and 3rd medical nodes; For the first j Accuracy of medical nodes;
[0050] In the formula, The time delay for the 1st, 2nd, and 3rd medical nodes; Efficiency scores for medical nodes 1, 2, and 3; For the first j Latency of medical nodes; For the first j Efficiency score of medical nodes; S203242: Based on the safe aggregation weight of the model update amount of each medical node, the model update amount of all medical nodes is safely aggregated to obtain the safe aggregated model parameters.
[0051] In the formula, These are the model parameters after safe aggregation; These are the original model parameters for the initial intelligent agent; This refers to the amount of model updates after safe aggregation. For the first jThe number of model updates for medical nodes; N Total number of medical nodes; For the first j Security aggregation weights for medical nodes; S203243: Based on the model parameters after secure aggregation, adjust the initial agent to generate a federated learning agent, and distribute the federated learning agent to all medical nodes for the next round of federated learning.
[0052] In one alternative implementation, based on a federated learning network, knowledge distillation is performed on the global agent, a lightweight medical agent is built on a central server, and the medical agent is deployed to the corresponding medical nodes, including: S20331: Solidify the global intelligent agent into a teacher model, and design a lightweight student model for the teacher model based on the computing power limitations of the medical nodes in the federated learning network; S20332: Based on the intelligent agent, construct the knowledge base association request and configure the corresponding knowledge base for the teacher model and student model; S20333: In the central server of the federated learning network, the teacher model and the student model are trained synchronously based on a common training dataset, and the trained student model is used as a lightweight medical intelligent agent. The formula is:
[0053] In the formula, The composite loss value for synchronous training of the teacher model and the student model; Output the cross-entropy between the student model and the true label; The KL divergence between student soft labels and teacher soft labels; This is the loss coefficient; The temperature parameter is greater than 1, used to balance the gradients of the two losses, and a higher value is used initially. Gradually decrease as training progresses Up to 1; S20334: Based on the identity and encryption key of each medical node, send the lightweight medical agent to the medical nodes involved in the agent construction request through a secure communication channel.
[0054] This invention also provides an intelligent agent construction device, referring to... Figure 3 The diagram shows a functional unit diagram of an intelligent agent construction device 300 according to the present invention, which may include the following units: The request receiving unit 301 is used to receive a user-inputted agent construction request using a preset low-code configuration interface; The agent construction unit 302 is used to match and combine at least one basic capability model from a preset agent factory based on the agent construction request to form an initial agent; The agent training unit 303 is used to perform federated training and knowledge distillation on the initial agent to obtain a medical agent, and then deploy it to the corresponding medical node.
[0055] Based on the same inventive concept, another embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus. Memory, used to store computer programs; The processor, when executing a program stored in memory, implements the intelligent agent construction method of the present invention.
[0056] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EI) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of representation, only one thick line is used in the diagram, but this does not indicate that there is only one bus or one type of bus. The communication interface is used for communication between the aforementioned terminal and other devices. The memory can include Random Access Memory (RAM), or non-volatile memory, such as at least one disk storage device. Optionally, the memory can also be at least one storage device located remotely from the aforementioned processor.
[0057] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0058] Furthermore, to achieve the above objectives, embodiments of the present invention also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the intelligent agent construction method of the embodiments of the present invention.
[0059] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, embodiments of the present invention can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of the present invention can take the form of computer program products implemented on one or more computer-usable hardware devices (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0060] The embodiments of the present invention are described with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (apparatus), and computer program products according to embodiments of the invention. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0061] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0062] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0063] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. "And / or" indicates that either one or both can be chosen. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes the element.
[0064] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. An agent construction method characterized by comprising: The method comprises: using a preset low-code configuration interface, receiving an agent construction request input by a user; the agent construction request comprises a role, a responsibility and a knowledge base association of a medical agent to be constructed; based on the agent construction request, matching and combining at least one basic capability model from a preset agent factory to form an initial agent; federated training and knowledge distillation are performed on the initial agent to obtain a medical agent, and the medical agent is deployed to a corresponding medical node.
2. The method of claim 1, wherein, Based on the agent construction request, at least one basic capability model is matched and combined from a preset agent factory to form an initial agent, comprising: based on the role and responsibility of the agent construction request, determining the core content required by the medical agent to be constructed; the core content comprises a question and answer mode, a task mode and a planning mode; According to the core content, at least one basic capability model is matched from the preset agent factory, and the cooperative calling strategy between the basic capability models is configured; Based on the knowledge base association of the agent construction request, configure the knowledge base for the basic capability model; According to the cooperative calling strategy, at least one basic capability model configured with a knowledge base is combined to form an initial agent.
3. The method of claim 2, wherein the agent is constructed by, Federated training and knowledge distillation are performed on the initial agent to obtain a medical agent, and the medical agent is deployed to a corresponding medical node, comprising: In the central server corresponding to the low-code configuration interface, extract at least one medical node involved in the agent construction request, and construct a federated learning network comprising the central server and a plurality of medical nodes; Based on the federated learning network, the initial agent is subjected to federated learning, and a global agent is constructed on the central server; Based on the federated learning network, the global agent is subjected to knowledge distillation, a lightweight medical agent is constructed on the central server, and the lightweight medical agent is deployed to the corresponding medical node.
4. The method of claim 3, wherein the agent is a protein. In the central server corresponding to the low-code configuration interface, extract at least one medical node involved in the agent construction request, and construct a federated learning network comprising the central server and a plurality of medical nodes, comprising: In the central server corresponding to the low-code configuration interface, extract at least one medical node involved in the agent construction request; If the agent construction request only involves one medical node, at least one other medical node similar to the current medical node scenario is matched; Assign a unique identity and encryption key to each medical node participating in federated learning to establish a secure communication channel; Through the secure communication channel, connect the central server with all medical nodes participating in federated learning to construct a federated learning network.
5. The method of claim 4, wherein the agent is constructed by, If the agent construction request only involves one medical node, at least one other medical node similar to the current medical node scenario is matched, comprising: If the agent construction request only involves one medical node, collect the metadata of the current medical node, and construct the scenario portrait vector of the current medical node according to the metadata; According to the agent construction request, screening is performed in the meta database preset in the central server to obtain a candidate node pool of the medical node; Obtaining the similarity between the current scene portrait vector of the medical node and the preset scene portrait vector of the candidate node in the candidate node pool, and extracting at least one candidate node with a similarity higher than a similarity threshold; Sending a federated learning participation invitation request to the matched candidate node and receiving a request response returned by the candidate node; If the request response received by the central server is received, the candidate node is regarded as another medical node, otherwise, the candidate node matching is continued, other candidate nodes with a similarity higher than the similarity threshold are extracted, and the previous step is returned.
6. The method of claim 5, wherein the agent is constructed by, Based on the federated learning network, the initial agent is subjected to federated learning, and a global agent is constructed in the central server, including: Deploying the initial agent to all medical nodes of the federated learning network, constructing a knowledge base association based on the agent, and configuring corresponding knowledge bases for the initial agent; In the medical nodes with local medical data, an improved particle swarm optimization algorithm is introduced to quickly train the initial agent, and the corresponding model update and evaluation index are extracted; According to the identity and encryption key of each medical node, the model update and evaluation index are encrypted and uploaded to the central server of the federated learning network through a secure communication channel; In the central server, the model updates of all medical nodes are securely aggregated according to the evaluation index to generate a federated learning agent, which is then distributed to all medical nodes for the next round of federated learning. Until the global optimization model converges or the number of federated learning reaches a threshold, the current federated learning agent is regarded as a global agent in the central server.
7. The method of claim 6, wherein the agent is constructed by, In the medical nodes with local medical data, an improved particle swarm optimization algorithm is introduced to quickly train the initial agent, and the corresponding model update and evaluation index are extracted, including: Defining the optimization target of the optimization training, setting the fitness function, defining the core hyperparameters to be optimized, and encoding the core hyperparameters into the position of the particle of the improved particle swarm optimization algorithm; Using a chaotic sequence for initialization to generate an initial particle swarm; Based on the local medical data, the fitness function is used to obtain the fitness function of each initial particle in the initial particle swarm, and the particle with the optimal fitness is taken as the global optimal solution; Levy flight mechanism and convergence factor are introduced to update the position of the initial particle swarm to obtain an updated particle swarm; Based on the local medical data, the fitness function is used to obtain the fitness function of each updated particle in the updated particle swarm, and the particle with the optimal fitness is updated to the global optimal solution; Repeat the particle swarm update step until the optimization training iteration number reaches an iteration number threshold or the global optimal solution does not improve significantly for a certain number of consecutive iterations, and output the current global optimal solution; Decode the position of the current global optimal solution to obtain the optimal core hyperparameters, and optimize the configuration parameters of the initial agent according to the optimal core hyperparameters to obtain a local agent; Extracting the model update and evaluation index of the local agent; the evaluation index includes sample size, accuracy, time delay and cost.
8. The method of claim 7, wherein the agent is constructed by, In the central server, the model update amount of all medical nodes is securely aggregated according to the evaluation index, a federated learning agent is generated, and the federated learning agent is distributed to all medical nodes for the next round of federated learning, including: In the central server, the secure aggregation weight of the model update amount of each medical node is generated according to the evaluation index; According to the secure aggregation weight of the model update amount of each medical node, the model update amount of all medical nodes is securely aggregated to obtain the secure aggregation model parameters; According to the secure aggregation model parameters, the initial agent is adjusted to generate a federated learning agent, and the federated learning agent is distributed to all medical nodes for the next round of federated learning.
9. The method of claim 8, wherein the agent is constructed by, Based on the federated learning network, the global agent is knowledge distilled, a lightweight medical agent is constructed in the central server, and the medical agent is deployed to the corresponding medical node, including: The global agent is solidified as a teacher model, and a lightweight student model is designed for the teacher model according to the computing power limit of the medical node of the federated learning network; Based on the knowledge base association of the agent construction request, the teacher model and the student model are configured with corresponding knowledge bases; In the central server of the federated learning network, the teacher model and the student model are trained synchronously according to the general training data set, and the trained student model is used as a lightweight medical agent; According to the identity and encryption key of each medical node, the lightweight medical agent is sent to the medical node involved in the agent construction request through a secure communication channel.
10. An agent construction device for implementing the agent construction method according to any one of claims 1 to 9, characterized by The device comprises: A request receiving unit configured to receive an agent construction request input by a user using a preset low-code configuration interface; An agent construction unit configured to match and combine at least one basic capability model from a preset agent factory to form an initial agent based on the agent construction request; An agent training unit configured to perform federated training and knowledge distillation on the initial agent to obtain a medical agent and deploy the medical agent to a corresponding medical node.