A hydrological deep learning modeling system and method based on a large model multi-agent

CN122947820APending Publication Date: 2026-10-20TSINGHUA UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611152328.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-31
Publication Date
2026-10-20

AI Technical Summary

Technical Problem

[0011]本发明的目的是为克服现有水文深度学习建模过程中任务理解、数据处理、模型选择、程序编写、模型训练及结果评价依赖人工完成,且建模环节衔接复杂、工具接口不统一、程序执行稳定性不足以及特殊建模任务难以自动适配等问题,提出一种基于大模型多智能体的水文深度学习建模系统及方法

Benefits of technology

[0125]1)本发明通过任务分析智能体、数据预处理智能体、模型构建智能体和结果呈现智能体的职责分工及结构化成果交接,降低单一大模型执行长流程建模任务时发生状态丢失和职责混淆的可能性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
  • Figure SMS_1
    Figure SMS_1
Patent Text Reader

Abstract

This invention proposes a hydrological deep learning modeling system and method based on a large model and multiple agents. The system includes a task analysis agent, a data preprocessing agent, a model building agent, and a result presentation agent connected sequentially. It also includes a global modeling module, a comprehensive tool module, a shared workspace module, a standardized modeling workflow module, and a runtime feedback and recovery module. The comprehensive tool module and the shared workspace module are connected to each agent and the global modeling module, respectively. The model building agent is also connected to the standardized modeling workflow module, and the shared workspace module is also connected to the runtime feedback and recovery module. This invention enables automatic collaboration and structured connection of the hydrological deep learning modeling process, reduces manual programming and repetitive debugging workload, and improves the execution stability, scalability, traceability, and reproducibility of the modeling process. It can be applied to the simulation and prediction of runoff, water level, flow rate, and other hydrological elements.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the fields of hydrological information processing, artificial intelligence and deep learning automatic modeling technology. In particular, it relates to a hydrological deep learning modeling system and method based on a large model and multiple agents. It is applicable to the time series simulation and prediction of rainfall runoff, water level, flow, inflow, evapotranspiration and other continuous hydrological elements. It can be used for modeling a single watershed or station, batch processing of multiple modeling objects, and joint modeling of multiple modeling objects sharing model parameters. Background Technology

[0002] In hydrological simulation, forecasting, and water conservancy project operation and management, deep learning models have been increasingly applied to tasks such as rainfall-runoff simulation, river level prediction, reservoir inflow forecasting, and hydropower station operation status analysis. Compared to traditional statistical models, deep learning models can extract nonlinear features and long-term dependencies from multivariate hydrological and meteorological time series. However, their complete modeling process typically involves multiple stages, including task definition, data cleaning, feature processing, sample construction, model selection, program writing, parameter configuration, model training, performance evaluation, and result presentation, requiring a high level of expertise in hydrology and computer programming skills.

[0003] Current deep learning modeling in hydrology typically relies on manual modeling processes performed by technical personnel. Modelers need to select an appropriate model architecture based on the data structure and prediction objectives, and design data loading methods, input / output tensor formats, loss functions, and training strategies for different models. When dealing with a large number of data files, complex variable types, or the need to repeatedly perform multiple modeling tasks, the manual modeling process suffers from the following main problems:

[0004] 1) The modeling process has a high technical threshold: Hydrological deep learning modeling involves understanding hydrological tasks, data processing, neural network design and program debugging. It is difficult for non-professional developers to complete the complete modeling process independently.

[0005] 2) Complex coupling between modeling stages: Different deep learning models have different requirements for data loading format, input tensor dimension, output structure and training method. Inconsistent interfaces or dimension mismatches can easily occur between data processing program, model program and training program.

[0006] 3) Large workload of repetitive program development: For different watersheds, stations or hydrological elements, modelers usually need to repeatedly write or modify data processing, model training, index calculation and visualization programs, resulting in low modeling efficiency and the program quality is easily affected by personal experience.

[0007] 4) The modeling process lacks a unified tool collaboration mechanism: functions such as data cleaning, file operation, code execution, model training, indicator calculation and graphic drawing in existing modeling procedures are usually scattered in different scripts or software environments, and there is a lack of unified parameter descriptions, calling interfaces and execution feedback formats, making it difficult to realize automatic scheduling and collaborative operation between tools.

[0008] 5) Intermediate states and operation feedback are difficult to transmit continuously: complex hydrological modeling tasks usually require multiple rounds of data processing, code modification and model training, and existing methods lack a unified management mechanism for task states, data states, code states, model states and operation feedback. When an abnormality occurs at a certain stage, it is often necessary to manually check the logs and re-execute a large range of processes, and it is difficult to continue processing from the specific stage where the abnormality occurs.

[0009] With the development of large language model technology, the use of large language models for task understanding, program generation and tool invocation provides a new technical path for the automatic modeling of hydrological deep learning. Large language models can generate data processing programs or model codes according to natural language descriptions, and can perform corresponding operations through external tools. However, there are still obvious deficiencies in directly relying on a single large language model to complete end-to-end modeling.

[0010] The existing automated modeling methods based on large language models still have the problem of insufficient execution stability. Due to the certain randomness of the results generated by large language models, problems such as missing parameters, path errors, inconsistent tensor dimensions and mismatched training logic are prone to occur in a long modeling process; when a single agent undertakes multiple responsibilities such as task understanding, data processing, model design, program execution and result evaluation at the same time, problems such as context loss, stage goal confusion and repeated tool invocation are also prone to occur. Although the existing multi-agent methods alleviate the above problems through role division, they mostly rely on natural language to transmit information, and lack a unified organization and structured handover mechanism for data processing results, model configurations, program codes, training logs and evaluation indicators. At the same time, existing methods usually adopt fixed processes or general code templates, fail to jointly match the data loading method, model input and output structure and training strategy, and lack standardized descriptions of component interfaces, tensor dimensions and dependencies. In addition, the records of program execution trajectories, exception information and model intermediate states are incomplete, and there is a lack of a mechanism for checkpoint saving and recovery by modeling stages, which makes it difficult to accurately locate and only correct the corresponding links after an exception occurs, which is not conducive to the reproduction and continuous optimization of the modeling process. Contents of the Invention

[0011] The purpose of this invention is to overcome the problems in existing hydrological deep learning modeling processes, such as reliance on manual completion for task understanding, data processing, model selection, program writing, model training, and result evaluation. These problems include complex modeling process connections, inconsistent tool interfaces, insufficient program execution stability, and difficulty in automatically adapting to special modeling tasks. This invention proposes a hydrological deep learning modeling system and method based on a large model and multiple agents. This invention can automatically parse hydrological deep learning modeling tasks, assemble programs, execute tools, train models, evaluate results, and provide feedback corrections, thereby improving the automation, execution stability, scalability, and traceability of the hydrological deep learning modeling process.

[0012] This invention proposes a hydrological deep learning modeling system based on a large model and multiple agents, comprising a task analysis agent, a data preprocessing agent, a model building agent, and a result presentation agent connected sequentially. The agents are built based on a large language model. The system further includes a global modeling module, a comprehensive tool module, a shared workspace module, a standardized modeling workflow module, and a runtime feedback and recovery module. The comprehensive tool module and the shared workspace module are respectively connected to each agent and the global modeling module. The model building agent is also connected to the standardized modeling workflow module, and the shared workspace module is also connected to the runtime feedback and recovery module.

[0013] The shared workspace module is used to store and manage various types of data in the hydrological modeling process, including: task reports, hydrological data, data processing results, program code, model configuration, model parameters, operation logs, anomaly information, evaluation results, and status checkpoints.

[0014] The task analysis agent is used to parse the hydrological deep learning modeling task from the user prompt words in the data read from the shared workspace module, generate a structured task analysis report and store it in the shared workspace; the task analysis agent is also used to call the global modeling module when the modeling task meets the global modeling triggering conditions;

[0015] The data preprocessing agent is used to call the integrated tool module to complete data inspection, cleaning, time alignment, sample construction and dataset partitioning based on the structured task analysis report and related hydrological data read from the shared workspace, generate model-ready data and data processing report and store them in the shared workspace.

[0016] The standardized modeling workflow module is used to store data loading, data preprocessing, model and training components, as well as the input and output interfaces, tensor dimension constraints, applicable conditions, parameter fields and combination rules of each component, providing support for component selection and automatic assembly of the modeling program.

[0017] The model building agent is used to select and assemble components that are compatible with the modeling task from the standardized modeling workflow module based on the structured task analysis report, model ready data and data processing report read from the shared workspace, and generate a data loading program, a model definition program, a training program and a model configuration file and store them in the shared workspace.

[0018] The result presentation agent is used to read the executable modeling program and model configuration file from the shared workspace, complete model training, verification, testing, evaluation index calculation and result visualization, and generate the trained model, prediction results, evaluation results and modeling report and store them in the shared workspace.

[0019] The integrated tool module is used to provide various tools in the modeling process to each agent and the global modeling module, and to return the structured execution results, running logs, exception information and execution status to the corresponding agent or module. Then, the agent or module writes the received data into the shared workspace module.

[0020] The global modeling module, implemented as a task skill, takes over the modeling process after task analysis when the global modeling trigger conditions are met. It reads the structured task analysis report, task status, dynamic data of multiple modeling objects, and corresponding object attribute data from the shared workspace module, and sends a structured tool call request to the integrated tool module to complete multi-object data association, joint sample construction, data processing, shared parameter model training, and object-specific evaluation. It receives the structured execution results, runtime logs, exception information, and execution status returned by the integrated tool module, and adjusts subsequent operations based on the execution results. Finally, it writes the generated joint training samples, modeling program, model configuration, shared parameter model, object-specific prediction results, evaluation results, runtime logs, exception information, and status checkpoints into the shared workspace module.

[0021] The operation feedback and recovery module is used to read the operation logs, exception information, evaluation results and status checkpoints stored in the shared workspace module to determine the execution status of the current modeling stage; when an exception is detected, the corresponding modeling stage is located, and the corresponding agent or the global modeling module is controlled to re-execute based on the most recent valid status checkpoint.

[0022] In one specific embodiment of the present invention, it further includes:

[0023] The shared workspace module includes a system-level shared resource area and a task-level workspace;

[0024] The system-level shared resource area is used to store raw hydrological data, as well as the programs, components, configurations and execution rules corresponding to the integrated tool module, the standardized modeling workflow module and the global modeling module. Each intelligent agent only has read or call permissions.

[0025] The task-level workspace is created after receiving a modeling task. It is used to store task-related data and components copied from the system-level shared resource area, as well as task reports, processed data, program code, model configuration, model parameters, running logs, exception information, evaluation results, and status checkpoints generated during the modeling process. Each agent can read, create, modify, and write files in the task-level workspace through the integrated tool module.

[0026] In one specific embodiment of the present invention, it further includes:

[0027] The system-level shared resource area is equipped with a metadata registry, which records the data object identifier, file path, variable fields, time range, data version, access permissions, and task status of each file in the system-level shared resource area and the task-level workspace. This enables each agent to locate the required resources based on the metadata and write the processing results into the task-level workspace corresponding to the current task.

[0028] This invention also proposes a hydrological deep learning modeling method based on the above system, comprising:

[0029] 1) Initialize the hydrological deep learning modeling task;

[0030] The system receives modeling requirements input by the user, creates a task-level workspace, loads task-related hydrological data, metadata, and callable resources, and initializes the task status.

[0031] 2) The task analysis agent parses the modeling task and determines the execution path;

[0032] The task analysis agent generates a structured task analysis report by combining user prompts and data metadata, and determines whether to execute the default multi-agent collaborative modeling path or the global modeling path; if the default multi-agent collaborative modeling path is executed, proceed to step 3); if the global modeling path is executed, proceed to step 6).

[0033] 3) Under the default multi-agent collaborative modeling path, the data preprocessing agent completes data inspection, cleaning, time alignment, sample construction and dataset partitioning based on the structured task analysis report, and generates model-ready data and data processing report;

[0034] 4) The model building agent selects and assembles mutually compatible data loading components, model components, and training components from the standardized modeling workflow module based on the structured task analysis report and model ready data, and generates an executable modeling program and model configuration file.

[0035] 5) Results Presentation: The intelligent agent executes the modeling program, completes model training, validation, testing, evaluation metric calculation, and result visualization, and generates the trained model, prediction results, evaluation results, and modeling report, then proceeds to step 7).

[0036] 6) Under the global modeling path, the global modeling module completes the modeling task; among which, the global modeling module performs multi-object data association, joint sample construction, shared parameter model training, and object-specific evaluation, and then proceeds to step 7).

[0037] 7) Summarize and output modeling results;

[0038] After the corresponding modeling path meets the preset completion conditions, the system summarizes and packages the executable modeling program, the trained model, the prediction results, the evaluation results, the visualization results, and the modeling process record from the task-level workspace.

[0039] In a specific embodiment of the present invention, the initialization of the hydrological deep learning modeling task specifically includes:

[0040] 1) The system receives the natural language modeling requirements, hydrological data descriptions and related task parameters submitted by the user, generates a unique task identifier for the current modeling task, and creates a task-level workspace corresponding to the task identifier in the shared workspace module.

[0041] After the task-level workspace is created, the system initializes the task status record, registering the task identifier, creation time, current execution stage, task completion status, and file storage location, providing a unified operating space for subsequent intelligent agents and the global modeling module to read previous results, write stage results, and recover abnormal tasks;

[0042] 2) Set up a metadata registry in the system-level shared resource area of ​​the shared workspace module; in the metadata registry, each data object corresponds to one metadata record;

[0043] For the j-th data object, its metadata is represented as follows:

[0044]

[0045] In the formula, id j p represents the data object identifier. j Indicates the data path, b j X represents the identifier of the modeling object. jY represents the set of candidate input variables. j Let Δt represent the set of candidate target variables. j Indicates time resolution, Ω j V indicates a time range. j Indicates the data version;

[0046] 3) Initialize the task-level workspace state;

[0047] Among them, the task-level workspace stores intermediate data and modeling results generated during the execution of multi-agent processes;

[0048] The shared workspace state corresponding to the i-th modeling iteration is represented as:

[0049]

[0050] In the formula, T i D represents the task description and task constraint status. i C represents hydrological data and its processing status. i M indicates the status of program code and configuration files. i Indicates the model definition or model parameter state, R i Indicates the status of program execution, model evaluation, and anomaly feedback;

[0051] When each agent executes its task for this phase, it first reads the preceding state from the task-level workspace; after execution, it immediately writes the new results of this phase back to the task-level workspace; the update process of the shared state is represented as follows:

[0052]

[0053] In the formula, F k This represents the state update process of the k-th agent, O. i This represents the structured result generated after the agent invokes a tool or executes a program.

[0054] In one specific embodiment of the present invention, the task analysis agent parses the modeling task and determines the execution path, specifically including:

[0055] 1) The task analysis agent receives the natural language task U input by the user, reads the metadata set Γ, and combines it with the task analysis hints and constraints P. T Generate a structured task analysis report; wherein the task analysis prompts constraint P T The system prompts, pre-configured in the task analysis agent, are loaded when the task analysis agent is instantiated or started. These prompts define the task analysis agent's role and responsibilities, task parsing rules, structured output format, information integrity check rules, and execution path determination rules. The structured task analysis report is represented as follows:

[0056]

[0057] The structured task analysis report includes: task type, including hydrological simulation or hydrological prediction; type and number of modeling objects; dynamic input variables, static attribute variables, and target variables; input window length, target length, and input-output time relationship; data partitioning method and data transformation requirements; candidate model requirements, training requirements, and evaluation indicators; whether each modeling object is trained with an independent model; whether each modeling object shares model parameters; and whether there is object attribute data that can be matched with dynamic data.

[0058] 2) Determine the temporal relationship of the hydrological samples;

[0059] For a hydrological time series containing d input variables, assuming the historical input window length is L, the input tensor representation for time t is:

[0060]

[0061] In the formula, X t x represents the input tensor corresponding to time t; τ This represents the input variable vector corresponding to time τ, where the input variable vector contains d dynamic input variables corresponding to that time; x t−L+1 x represents the vector of input variables at the start of the input window. t This represents the vector of input variables at the end of the input window; L represents the number of time steps contained in the input window, and d represents the number of input variables contained in each time step.

[0062] Let the initial offset of the target be δ, and the length of the target sequence be H, then the corresponding target representation is:

[0063]

[0064] In the formula, Y t The representation is related to the input tensor X. t The corresponding target sequence; y τ This represents the value of the target variable corresponding to time τ;

[0065] When δ=0, and X t When non-target hydro-meteorological variables containing time t are included, a current hydrological simulation task is constructed; when δ≥1, a future hydrological prediction task is constructed; the task analysis agent writes L, H, δ, input fields and target fields into the task analysis report, so that the data preprocessing agent can construct samples according to unified rules;

[0066] 3) The task analysis agent performs matching on candidate data objects in the metadata registry based on the structured task analysis report;

[0067] Candidate data objects are represented as:

[0068]

[0069] In the formula, Match(T,Γ) j The ) indicates the degree of matching between the task report and the j-th data object in terms of modeling object, input fields, target fields, time scale, and data organization.

[0070] If multiple data objects satisfy the task constraints, retain all data objects that meet the conditions, and create a data object set according to the modeling object identifier:

[0071]

[0072] In the formula, τ D This indicates the preset data matching threshold;

[0073] When the data object collection contains only one modeling object, perform single-object local modeling;

[0074] When the data object collection contains multiple modeling objects and each object is trained with an independent model, perform batch local modeling.

[0075] When multiple modeling objects require sharing the same set of model parameters and meet the global modeling skill conditions, the global modeling path is entered; where, for the s-th task skill component, its triggering state is represented as:

[0076]

[0077] In the formula, c s,j (T,D) represents the j-th trigger condition of the s-th task skill component, where T represents the structured task analysis report, D represents the currently registered data status, and m s Indicates the number of triggering conditions;

[0078] When G s When G = 0, continue executing the default multi-agent cooperative path; when G s When =1, the execution results of the task analysis agent are retained, while the data preprocessing agent, model building agent, and result presentation agent are paused. The corresponding Skill inherits the task state and data state. After the Skill completes its execution, the generated data, program, model, and evaluation results are rewritten to the shared workspace.

[0079] In one specific embodiment of the present invention, the generated model-ready data and data processing report specifically include:

[0080] The data preprocessing agent reads the corresponding hydrological data based on the structured task analysis report and performs the following tasks in sequence:

[0081] a) Check if the time field can be parsed correctly and the data can be arranged in chronological order;

[0082] b) Identify duplicate time records and retain or merge them according to preset rules;

[0083] c) Calculate the missing rate for each field and process the missing data using deletion, interpolation, statistical imputation, or other preset methods;

[0084] d) Detect outliers based on variable range, statistical distribution, or engineering constraints;

[0085] e) Standardize the field names, units, and time resolution of different data files;

[0086] f) Divide the training set, validation set, and test set according to the task requirements;

[0087] g) Construct the model input and target samples according to L, H, and δ;

[0088] For input data requiring scaling, the transformation parameters are determined using the training set:

[0089]

[0090] In the formula, Φ() represents the standardization, normalization, logarithmic transformation, or robust scaling transformation function, and η train This represents the transformation parameters determined solely from the training data;

[0091] After completing the data processing, the data preprocessing agent outputs model-ready data and a data processing report.

[0092] In one specific embodiment of the present invention, the generation of the executable modeling program and model configuration file specifically includes:

[0093] 1) Select standardized modeling workflow components;

[0094] The standardized modeling workflow module includes a set of data loading components, a set of data preprocessing components, a set of model components, and a set of training components; the metadata corresponding to the j-th component is represented as follows:

[0095]

[0096] In the formula, id j Indicates component identifier, type j Indicates the component type, I j and O j These represent the input interface and the output interface, respectively.j H represents a configurable parameter. j Represents tensor dimension constraints, R j Representing dependencies and composition rules;

[0097] The model building agent first filters candidate data loading components based on task type and data format; then it filters candidate model components based on input sequence dimension, output target format, and task requirements; finally, it selects training components that are suitable for the candidate models.

[0098] If adjacent component c j and c j+1 satisfy:

[0099]

[0100]

[0101] Then it is determined that the adjacent components can be connected; wherein, TypeOut(c j ) indicates component c j The data type of the output data, TypeIn(c j+1 ) indicates component c j+1 Required input data type; ShapeOut(c j ) indicates component c j Output the dimensional structure of the tensor, ShapeIn(c j+1 ) indicates component c j+1 The required input tensor dimension structure; the symbol ~ indicates that the tensor dimension can be directly passed or can be adapted through preset transformation rules;

[0102] When the data loading component outputs a 3D tensor while the model component requires a 2D tensor, if the preset adaptation rules allow flattening or pooling operations, adaptation code is generated; if no suitable adaptation rules exist, the current component combination is excluded and a new combination is selected.

[0103] 2) Complete component assembly and parameter instantiation;

[0104] The model building agent connects the selected data loading component, data preprocessing component, model component, and training component in the order of data flow to form a candidate workflow. Based on the structured task analysis report, the model building agent writes the data path, input fields, target fields, window length, output length, model dimensions, number of training epochs, batch size, optimizer, and evaluation metrics into the corresponding components. After completing parameter instantiation, it generates an executable modeling program including a data loading file, model definition file, training file, and configuration file.

[0105] After the program is generated, the model building agent calls the code analysis tool to perform the following checks: a) Check if the program dependencies are complete; b) Check if the data path and output path exist; c) Check if the function parameter names and configuration fields are consistent; d) Check if the output dimension of the data loader is consistent with the input dimension of the model; e) Check if the output dimension of the model is consistent with the input dimension of the loss function; f) Check if the correct data partitions are called during the training, validation and testing phases.

[0106] If the check passes, the program and configuration files will be written to the shared workspace; if the check fails, the component parameters will be modified or adaptation code will be generated based on the error message.

[0107] In one specific embodiment of the present invention, the global modeling module completes the modeling task, specifically including:

[0108] The global modeling module is triggered when all of the following conditions are met simultaneously: a) the user explicitly requests that multiple modeling objects share model parameters; b) dynamic hydrological data of multiple modeling objects are detected; c) object attribute data that can be associated with dynamic hydrological data through modeling object identifiers are detected.

[0109] The global modeling module establishes the association between dynamic data and object attribute data according to the modeling object identifier, and constructs joint training samples:

[0110]

[0111] In the formula, X b,t Let z represent the dynamic input sequence of the b-th object. b Represents an object property, y b,t 'b' represents the target data, and 'b' represents the modeling object identifier; multiple objects are jointly trained on a shared parameter model.

[0112] The training objective of the shared model is represented as:

[0113]

[0114] In the formula, N represents the number of joint training samples, b i Let y represent the modeling object to which the i-th joint training sample belongs. i Let w represent the corresponding target data, ℓ() represent the basic error function, and w bi This represents the training adjustment coefficient for the corresponding object.

[0115] In one specific embodiment of the present invention, it further includes:

[0116] During the execution of the method, the runtime feedback and recovery module continuously reads the execution status, runtime logs, exception information, and status checkpoints in the task-level workspace; diagnostic feedback includes program output, exception stack, training loss, validation metrics, test metrics, and warning information;

[0117] The i-th state checkpoint is represented as:

[0118]

[0119] In the formula, D i Indicates the data status corresponding to the checkpoint, C i Indicates the program and configuration status, Θ i R represents the state of model parameters. i Indicates the running feedback status, ν i Indicates the checkpoint version identifier;

[0120] When data field errors, tensor dimension errors, program execution errors, model training anomalies, or missing evaluation files are detected, the source of the anomaly is located based on the anomaly stack, tool status, and current execution stage.

[0121] If the anomaly occurs during the model training phase, but the model-ready data and modeling program are valid, then read the most recent valid checkpoint before model training and re-execute only the model training and evaluation phases.

[0122] If the anomaly is caused by a data dimension or sample time alignment error, restore the valid state before data preprocessing and re-execute data preprocessing and its subsequent stages;

[0123] When the executable program completes its operation normally, the model file, prediction results, and evaluation results have been generated, and the logs and metrics can be parsed normally, the task is deemed to have met the completion conditions, and the executable modeling program, the trained model, prediction results, evaluation results, visualization results, and modeling process records are output.

[0124] The features and beneficial effects of this invention are as follows:

[0125] 1) This invention reduces the possibility of state loss and responsibility confusion when a single large model performs a long-process modeling task by dividing the responsibilities and structured result handover of task analysis agent, data preprocessing agent, model building agent and result presentation agent.

[0126] 2) This invention continuously saves tasks, data, program configurations, models, and operational feedback status through a shared workspace module, enabling each agent to read previous results, call corresponding tools, and write the results of this stage, thereby improving the continuity and traceability of the modeling process.

[0127] 3) This invention describes the interfaces and dependencies between data loading, data preprocessing, model and training components through a standardized modeling workflow module, thereby enabling the linked selection, compatibility verification and automatic assembly of modeling components and reducing the risk of inconsistent program interfaces.

[0128] 4) This invention connects to the hydrological deep learning integrated tool module through a standardized tool call interface, thereby separating the large language model task inference from the deterministic execution of external tools and improving the standardization of tool calls and program execution.

[0129] 5) This invention, through joint tracking of execution trajectory, diagnostic feedback and status checkpoints, can locate the stage to which the anomaly belongs and continue execution from the most recent valid state, reducing redundant calculations caused by local anomalies.

[0130] 6) This invention uses multi-agent collaborative modeling as the default path and takes over special modeling tasks that meet preset conditions through the task Skill component, thereby improving the system's adaptability and scalability to different hydrological deep learning modeling scenarios. Attached Figure Description

[0131] Figure 1 This is a structural diagram of a hydrological deep learning modeling system based on a large model and multiple agents, according to an embodiment of the present invention.

[0132] Figure 2 This is a flowchart illustrating the overall process of a hydrological deep learning modeling method based on the system in a specific embodiment of the present invention. Detailed Implementation

[0133] This invention proposes a hydrological deep learning modeling system and method based on a large model and multiple agents, which is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0134] This invention proposes a hydrological deep learning modeling system based on a large-scale multi-agent model, the structure of which is as follows: Figure 1 As shown, the system includes a task analysis agent, a data preprocessing agent, a model building agent, and a result presentation agent connected in sequence. The system also includes a global modeling module, a comprehensive tool module, a shared workspace module, a standardized modeling workflow module, and a runtime feedback and recovery module. The comprehensive tool module and the shared workspace module are respectively connected to each agent and the global modeling module. The model building agent is also connected to the standardized modeling workflow module, and the shared workspace module is also connected to the runtime feedback and recovery module.

[0135] In this embodiment, as Figure 1As shown, the task analysis agent, data preprocessing agent, model building agent, and result presentation agent form the default modeling process in sequence. However, the agents do not directly pass modeling files to each other. Instead, the previous agent writes the phase results into the shared workspace module through the integrated tool module, and the next agent reads them from the shared workspace module through the integrated tool module. Specifically, the task analysis agent reads data metadata and task status from the shared workspace module and writes the generated structured task analysis report into the shared workspace module; the data preprocessing agent reads the structured task analysis report and related hydrological data from the shared workspace module and writes the generated model-ready data and data processing report into the shared workspace module; the model building agent reads the structured task analysis report, model-ready data, and data processing report from the shared workspace module, and simultaneously obtains candidate components and their component metadata from the standardized modeling workflow module, writing the generated data loading program, model definition program, training program, and model configuration file into the shared workspace module; the result presentation agent reads the executable modeling program and model configuration file from the shared workspace module and writes the generated model file, prediction results, evaluation results, visualization results, and modeling report into the shared workspace module. Each agent sends a structured tool call request to the integrated tool module and receives the execution results, running logs, exception information, and execution status returned by the integrated tool module. When the task analysis agent determines that the global modeling trigger condition is met, it sends a trigger command to the global modeling module. The global modeling module reads the structured task analysis report, task status, and multi-object modeling data from the shared workspace module, calls the comprehensive tool module to complete the corresponding operations, and writes the generated data, program, model, evaluation results, and runtime feedback into the shared workspace module. The runtime feedback and recovery module reads the runtime log, exception information, evaluation results, and status checkpoints from the shared workspace module, and writes the generated exception location results and recovery execution instructions into the shared workspace module. The corresponding agent or the global modeling module then reads these instructions and re-executes the corresponding modeling stage.

[0136] Specifically, the functions of each part of the system are as follows:

[0137] The shared workspace module is used to uniformly store and manage various types of data in the hydrological modeling process, including: task reports, hydrological data, data processing results, program code, model configuration, model parameters, operation logs, anomaly information, evaluation results, and status checkpoints. This module is a shared storage space for state transfer and result handover between various agents and other modules.

[0138] The task analysis agent is used to parse the hydrological deep learning modeling task from the user prompt words in the data read from the shared workspace module, generate a structured task analysis report and store it in the shared workspace; the task analysis agent is also used to call the global modeling module when the modeling task meets the global modeling trigger conditions.

[0139] The data preprocessing agent is used to call the integrated tool module to complete data inspection, cleaning, time alignment, sample construction and dataset partitioning based on the structured task analysis report and related hydrological data read from the shared workspace, and to generate model-ready data and data processing report and store them in the shared workspace.

[0140] The standardized modeling workflow module is used to store data loading, data preprocessing, model and training components, as well as the input and output interfaces, tensor dimension constraints, applicable conditions, parameter fields and combination rules of each component, providing support for component selection and automatic assembly in the modeling program.

[0141] The model building agent is used to select and assemble components that are compatible with the modeling task from the standardized modeling workflow module based on the model-ready data and data processing reports read from the shared workspace, and to generate a data loader, a model definition program, a training program and a model configuration file and store them in the shared workspace.

[0142] The result presentation agent is used to read executable modeling programs and model configuration files from the shared workspace, complete model training, validation, testing, evaluation index calculation and result visualization, and generate trained models, prediction results, evaluation results and modeling reports and store them in the shared workspace.

[0143] The integrated tool module is used to provide each agent and the global modeling module with tools for file reading and writing, data processing, code analysis, program execution, model training, indicator calculation and result display, and to return structured execution results, running logs, exception information and execution status to the corresponding agent or module. Then, the agent or module writes the received data into the shared workspace module.

[0144] The global modeling module is used to take over the modeling process after task analysis when the global modeling trigger conditions are met; it reads the structured task analysis report, task status, dynamic data of multiple modeling objects and corresponding object attribute data from the shared workspace module, and sends a structured tool call request to the integrated tool module to complete multi-object data association, joint sample construction, data processing, shared parameter model training and object-specific evaluation; it receives the structured execution results, operation logs, exception information and execution status returned by the integrated tool module, and adjusts subsequent operations according to the execution results; it writes the generated joint training samples, modeling program, model configuration, shared parameter model, object-specific prediction results, evaluation results, operation logs, exception information and status checkpoints into the shared workspace module.

[0145] The operation feedback and recovery module is used to read the operation logs, exception information, evaluation results and status checkpoints stored in the shared workspace module to determine the execution status of the current modeling stage; when an exception is detected, the corresponding modeling stage is located, and the corresponding agent or global modeling module is controlled to re-execute based on the most recent valid status checkpoint.

[0146] Furthermore, the implementation methods of each part of the system described in this embodiment are as follows:

[0147] The shared workspace module is implemented using a combination of hierarchical file storage and metadata-driven management. It includes a system-level shared resource area and a task-level workspace, rather than setting up separate databases for various content such as task reports, hydrological data, program code, model files, and operational feedback. In this embodiment, the system-level shared resource area stores raw hydrological data, as well as the programs, components, configurations, and execution rules corresponding to the integrated tool module, standardized modeling workflow module, and global modeling module. Each agent only has read or call permissions and cannot directly modify the content. The task-level workspace is created after receiving a modeling task and stores task-related data and components copied from the system-level shared resource area, as well as task reports, processed data, program code, model configurations, model parameters, operational logs, exception information, evaluation results, and status checkpoints generated during the modeling process. Each agent reads, creates, modifies, and writes files in the task-level workspace through the integrated tool module. Furthermore, a metadata registry is set up in the system-level shared resource area to establish the correspondence between logical data objects and actual files in the system-level shared resource area or task-level workspace. The metadata registry records the data object identifier, file path, variable fields, time range, data version, access permissions, and task status of each file in the system-level shared resource area and task-level workspace. For system-preset data resources, corresponding metadata records are generated during system initialization or resource storage. For data uploaded by users during the modeling process, the data is stored in the current task-level workspace, and the shared workspace management program extracts file information through the integrated tool module, adding or updating the corresponding task-level data records in the metadata registry. Each agent queries the metadata registry through the integrated tool module to locate the required resources, but does not directly modify the underlying content of the metadata registry.

[0148] The task analysis agent, data preprocessing agent, model building agent, and result presentation agent are all built based on a large language model. The large language model used in this embodiment should possess natural language understanding, code generation, structured result output, and external tool invocation capabilities. Each agent can use the same large language model or different large language models, and their responsibilities are formed by configuring different role prompts, task objectives, input / output formats, and tool invocation permissions. In one specific embodiment of this invention, each agent uses the DeepSeek-v4-Pro large language model and invokes it through the model service interface. The task analysis agent receives modeling requirements and hydrological data descriptions submitted by the user interface or task interface, and reads the metadata registry in the system-level shared resource area and the task status in the current task-level workspace through the integrated tool module. Its output is a structured task analysis report. The structured task analysis report is written to the task-level workspace and read by subsequent agents, rather than being directly sent by the task analysis agent to the next agent. The data preprocessing agent reads the structured task analysis report and a copy of the raw hydrological data loaded into the task-level workspace, and calls the integrated tool module to complete the data processing. The output of the data preprocessing agent includes model-ready data, data field descriptions, sample dimension descriptions, data partitioning results, and a data quality report, all of which are written to the task-level workspace. The model building agent reads the structured task analysis report, model-ready data, and data processing report from the task-level workspace, and calls the standardized modeling workflow components in the system-level shared resource area in read-only mode. The output of the model building agent includes the data loading program, model definition program, training program, and model configuration file, and writes these files to the task-level workspace. The results presentation agent reads the executable modeling program and model configuration file from the task-level workspace, and calls the integrated tool module to perform model training, validation, testing, evaluation index calculation, and results visualization. The output of the results presentation agent includes the trained model, prediction results, evaluation indicators, visualization results, and execution records, and writes these results to the task-level workspace. In this embodiment, each agent forms a boundary of responsibility by defining the input source, output storage location and tool access permissions. The phase results generated by the previous agent are all passed to the next agent through the task-level workspace to avoid different agents repeatedly executing the same phase task.

[0149] The integrated tool module consists of multiple callable tool service programs. Each tool is pre-configured with a tool name, function description, input parameter format, and output result format. The agent generates a structured tool call request based on the current task. The integrated tool module performs parameter verification and tool execution, and returns the execution result, running log, exception information, and execution status to the calling agent.

[0150] The standardized modeling workflow module consists of a software component library and component metadata. The software component library stores components for data loading, data preprocessing, models, and training. The component metadata describes the applicable conditions, input / output interfaces, parameter fields, tensor dimensions, and combination relationships of each component, for use in the selection and assembly of agents for model building.

[0151] The global modeling module is implemented as a task skill, consisting of preset triggering conditions, dedicated execution constraints, a dedicated standardized modeling workflow, and corresponding tool configurations. This module is invoked when the task analysis agent determines that the global modeling conditions are met; its specific execution process will be explained in subsequent method steps.

[0152] The operation feedback and recovery module consists of an operation status detection program and a process control program. It is used to read the execution status, operation log, abnormal information and status checkpoints in the shared workspace, and control the corresponding intelligent agent or global modeling module to re-execute the corresponding stage when an abnormality is detected. The specific recovery process will be explained in the subsequent method steps.

[0153] Furthermore, this embodiment also proposes a hydrological deep learning modeling method based on the above system, the overall process of which is as follows: Figure 2 As shown, it includes the following steps:

[0154] 1) Initialize the hydrological deep learning modeling task.

[0155] The system receives modeling requirements from the user, creates a task-level workspace, loads task-related hydrological data, metadata, and available resources, and initializes the task status.

[0156] 2) The task analysis agent parses and models the task and determines the execution path.

[0157] In this embodiment, the task analysis agent generates a structured task analysis report by combining user prompts and data element information, and determines whether to execute the default multi-agent collaborative modeling path or the global modeling path; wherein, if the default multi-agent collaborative modeling path is executed, then proceed to step 3); if the global modeling path is executed, then proceed to step 6).

[0158] 3) Under the default multi-agent collaborative modeling path, the data preprocessing agent completes data inspection, cleaning, time alignment, sample construction and dataset partitioning based on the structured task analysis report, and generates model-ready data and data processing report.

[0159] 4) The model building agent selects and assembles compatible data loading components, model components and training components from the standardized modeling workflow module based on the structured task analysis report and model ready data, and generates an executable modeling program and model configuration file.

[0160] 5) Results Presentation: The intelligent agent executes the modeling program, completes model training, validation, testing, evaluation index calculation, and result visualization, and generates the trained model, prediction results, evaluation results, and modeling report, then proceeds to step 7).

[0161] 6) Under the global modeling path, the global modeling module completes the modeling task; among which, the global modeling module performs multi-object data association, joint sample construction, shared parameter model training and object-specific evaluation, and then proceeds to step 7).

[0162] 7) Summarize and output the modeling results.

[0163] After the corresponding modeling path meets the preset completion conditions, the system summarizes and packages the executable modeling program, the trained model, the prediction results, the evaluation results, the visualization results, and the modeling process record from the task-level workspace.

[0164] During the execution of the above steps, each agent or global modeling module completes file operations, data processing, program execution, model training, and index calculation through the integrated tool module, and writes intermediate results, running logs, exception information, and status checkpoints into the task-level workspace; when an exception is detected, the running feedback and recovery module controls the corresponding steps to be re-executed.

[0165] Furthermore, the hydrological deep learning modeling method described in this embodiment will be further explained in detail below.

[0166] The specific steps of step 1) are as follows:

[0167] 1-1) Receive modeling tasks and create task-level workspaces.

[0168] In this embodiment, the system receives the natural language modeling requirements, hydrological data descriptions and related task parameters submitted by the user, generates a unique task identifier for the current modeling task, and creates a task-level workspace corresponding to the task identifier in the shared workspace module.

[0169] The task-level workspace is an independent read-write directory for this modeling task, used to store structured task analysis reports, task-related data copies, data processing results, program code, model configurations, model parameters, runtime logs, exception information, evaluation results, and status checkpoints generated during subsequent modeling processes. After the task-level workspace is created, the system initializes the task status record, registering the task identifier, creation time, current execution stage, task completion status, and file storage location, providing a unified runtime space for subsequent agents and the global modeling module to read preceding results, write stage results, and recover from abnormal tasks.

[0170] 1-2) Read the metadata registry and load the task-related resources.

[0171] A metadata registry is set up in the system-level shared resource area of ​​the shared workspace module to describe the logical structure of hydrological data. Its function is to establish a mapping relationship between data objects and physical files, enabling agents to identify the data's storage location, variable meaning, temporal characteristics, modeling object ownership, and version status, and accordingly locate and load data resources matching the current modeling task. Each data object corresponds to one metadata record, which includes at least:

[0172] Object identifier, file path, modeling object identifier, dynamic variable field, static attribute field, candidate target variable, time field, time range, time resolution, number of data files, file organization method, missing data, and data version.

[0173] For the j-th data object, its metadata is represented as follows:

[0174]

[0175] In the formula, id j p represents the data object identifier. j Indicates the data path, b j X represents the identifier of the modeling object. j Y represents the set of candidate input variables. j Let Δt represent the set of candidate target variables. j Indicates time resolution, Ω j V indicates a time range. j This indicates the data version. The metadata registry enables the task analysis agent to identify data objects corresponding to the modeling task without relying on fixed file names.

[0176] 1-3) Initialize the task-level workspace state.

[0177] The task-level workspace stores intermediate data and modeling results generated during multi-agent execution. Task descriptions, hydrological data, program code, model files, and runtime feedback do not need to be set up as separate databases; instead, they can be uniformly stored in the form of files, directories, and structured state records according to task identifiers and modeling stages. The following states represent logical classifications of the task-level workspace content, and are not limited to a database implementation. The shared workspace state corresponding to the i-th modeling iteration is represented as follows:

[0178]

[0179] In the formula, T i D represents the task description and task constraint status. iC represents hydrological data and its processing status. i Indicates the status of program code and configuration files, M i Indicates the model definition or model parameter state, R i It indicates the status of program execution, model evaluation, and anomaly feedback.

[0180] When each agent executes its task for this phase, it first reads the preceding state from the task-level workspace; upon completion, it immediately writes the new results for this phase back to the task-level workspace. The shared state update process is represented as follows:

[0181]

[0182] In the formula, F k This represents the state update process of the k-th agent, O. i This represents the structured results generated after the agent invokes a tool or executes a program. For example, after the data preprocessing agent completes data processing, it writes the model-ready data into D. i Write the data processing script into C. i And write the data quality check results into R. i This allows the model to build an intelligent agent that can continue reading.

[0183] The specific steps of step 2) are as follows:

[0184] 2-1) Generate a structured task analysis report.

[0185] The task analysis agent receives the natural language task U input by the user, reads the metadata set Γ, and combines it with preset task analysis prompts and constraints P. T This generates a structured task analysis report. The task analysis prompts constraint P. T System prompts pre-configured in the task analysis agent are loaded when the agent is instantiated or started. These prompts define the agent's role and responsibilities, task parsing rules, structured output format, information integrity check rules, and execution path determination rules. Each agent has only read access to the configuration file and may not directly modify it during task execution. The structured task analysis report is represented as follows:

[0186]

[0187] The structured task analysis report shall include at least the following: task type, including hydrological simulation or hydrological prediction; type and number of modeling objects; dynamic input variables, static attribute variables, and target variables; input window length, target length, and input-output time relationship; data partitioning method and data transformation requirements; candidate model requirements, training requirements, and evaluation indicators; whether each modeling object is trained with an independent model; whether each modeling object shares model parameters; and whether there is object attribute data that can be matched with dynamic data.

[0188] The task analysis agent also checks the completeness of the input information. When necessary information such as target variables, time fields, or modeling object identifiers is missing, the missing information is written into the task status, and supplementary information requirements are output; when the information is complete, a structured task analysis report is generated that can be directly parsed by subsequent agents.

[0189] 2-2) Determine the temporal relationship of the hydrological samples.

[0190] In this embodiment, for a hydrological time series containing d input variables, assuming the historical input window length is L, the input tensor corresponding to time t is represented as:

[0191]

[0192] In the formula, X t x represents the input tensor corresponding to time t; τ τ represents the input variable vector corresponding to time τ, and the input variable vector contains d dynamic input variables corresponding to that time; L represents the number of time steps contained in the input window;

[0193] Let the initial offset of the target be δ, and the length of the target sequence be H, then the corresponding target representation is:

[0194]

[0195] In the formula, Y t The representation is related to the input tensor X. t The corresponding target sequence; y τ y represents the value of the target variable corresponding to time τ; t+δ y represents the initial target value of the target sequence. t+δ+H−1 δ represents the end target value of the target sequence; δ represents the time offset between the end time of the input window and the start time of the target sequence; and H represents the number of time steps contained in the target sequence.

[0196] When δ=0, and X tWhen non-target hydro-meteorological variables include time t, a current hydrological simulation task is constructed; when δ≥1, a future hydrological prediction task is constructed. The task analysis agent writes L, H, δ, input fields, and target fields into the task analysis report, enabling the data preprocessing agent to construct samples according to unified rules and avoid time misalignment between the input sequence and the target sequence.

[0197] 2-3) Matching tasks with data objects.

[0198] In this embodiment, the task analysis agent performs matching on candidate data objects in the metadata registry based on the structured task analysis report. Candidate data objects can be represented as:

[0199]

[0200] In the formula, Match(T,Γ) j The value represents the degree of matching between the task report and the j-th data object in terms of modeling object, input fields, target fields, time scale, and data organization.

[0201] If multiple data objects satisfy the task constraints, retain all data objects that meet the conditions, and create a data object set according to the modeling object identifier:

[0202]

[0203] In the formula, τ D This indicates the preset data matching threshold.

[0204] When the data object set contains only one modeling object, single-object local modeling is performed; when the data object set contains multiple objects and each object is trained with an independent model, batch local modeling is performed; when multiple objects require sharing the same set of model parameters and meet the global modeling skill conditions, the global modeling path is entered. That is, for the s-th task skill component, its triggering state is represented as:

[0205]

[0206] In the formula, c s,j (T,D) represents the j-th trigger condition of the s-th task skill component, where T represents the structured task analysis report, D represents the currently registered data status, and m s This indicates the number of triggering conditions.

[0207] When G s When G = 0, continue executing the default multi-agent cooperative path; when G sWhen =1, the execution results of the task analysis agent are retained, while the data preprocessing agent, model building agent, and result presentation agent are paused. The corresponding Skill inherits the task state and data state. After the Skill completes execution, the generated data, program, model, and evaluation results are rewritten to the shared workspace, ensuring that subsequent feedback checks and result output are still completed through a unified shared state.

[0208] Step 3) specifically includes:

[0209] The data preprocessing agent reads the corresponding hydrological data based on the structured task analysis report and performs the following tasks in sequence:

[0210] a) Check if the time field can be parsed correctly and the data can be arranged in chronological order;

[0211] b) Identify duplicate time records and retain or merge them according to preset rules;

[0212] c) Calculate the missing rate for each field and process the missing data using deletion, interpolation, statistical imputation, or other preset methods;

[0213] d) Detect outliers based on variable range, statistical distribution, or engineering constraints;

[0214] e) Standardize the field names, units, and time resolution of different data files;

[0215] f) Divide the training set, validation set, and test set according to the task requirements;

[0216] g) Construct the model input and target samples according to L, H and δ.

[0217] For input data requiring scaling, the scaling parameters are determined using only the training set:

[0218]

[0219] In the formula, Φ() represents the standardization, normalization, logarithmic transformation, or robust scaling transformation function, and η train This represents the transformation parameters determined solely from the training data. The validation set, test set, and subsequent inference data all use η obtained from the training set. train Transformation parameters must not be recalculated using the validation or test sets. After data processing is complete, the data preprocessing agent outputs model-ready data and a data processing report. The data processing report should at least record the number of original samples, the number of valid samples, the missing data handling method, the anomaly handling method, the data partition boundaries, the input tensor dimension, and the target tensor dimension.

[0220] The specific steps of step 4) are as follows:

[0221] 4-1) Select standardized modeling workflow components.

[0222] The standardized modeling workflow module includes a set of data loading components, a set of data preprocessing components, a set of model components, and a set of training components. The metadata for the j-th component is represented as follows:

[0223]

[0224] In the formula, id j Indicates component identifier, type j Indicates the component type, I j and O j These represent the input interface and the output interface, respectively. j H represents a configurable parameter. j Represents tensor dimension constraints, R j It represents dependencies and composition rules.

[0225] The model building agent first filters candidate data loading components based on task type and data format; then it filters candidate model components based on input sequence dimension, output target format, and task requirements; finally, it selects training components that are suitable for the candidate models. If adjacent components c j and c j+1 satisfy:

[0226]

[0227]

[0228] Then it is determined that the adjacent components can be connected. Wherein, TypeOut(c j ) indicates component c j The data type of the output data, TypeIn(c j+1 ) indicates component c j+1 The required input data type; the first expression indicates that the output data type of the preceding component is consistent with the input data type of the following component. ShapeOut(c j ) indicates component c j Output the dimensional structure of the tensor, ShapeIn(c j+1 ) indicates component c j+1 The required input tensor dimension structure; the second equation indicates that the output tensor dimension of the preceding component is compatible with the input tensor dimension of the following component. The symbol ~ indicates that the tensor dimension satisfies direct transfer or can be adapted through preset transformation rules.

[0229] When the data loading component outputs a 3D tensor while the model component requires a 2D tensor, if the preset adaptation rules allow flattening or pooling operations, adaptation code is generated; otherwise, if no suitable adaptation rules exist, the current component combination is excluded and a new combination is selected.

[0230] 4-2) Complete component assembly and parameter instantiation.

[0231] In this embodiment, the model building agent connects the selected data loading component, data preprocessing component, model component, and training component in the order of data flow to form a candidate workflow. Based on the structured task analysis report, the model building agent writes parameters such as data path, input fields, target fields, window length, output length, model dimensions, number of training epochs, batch size, optimizer, and evaluation metrics into the corresponding components. After parameter instantiation, an executable modeling program is generated, including a data loading file, model definition file, training file, and configuration file.

[0232] After the program is generated, the model building agent calls the code analysis tool to perform the following checks: a) Check if the program dependencies are complete; b) Check if the data path and output path exist; c) Check if the function parameter names and configuration fields are consistent; d) Check if the output dimension of the data loader is consistent with the input dimension of the model; e) Check if the output dimension of the model is consistent with the input dimension of the loss function; f) Check if the correct data partition is called during the training, validation and testing phases.

[0233] If the check passes, the program and configuration files are written to the shared workspace; if the check fails, the component parameters are modified or adaptation code is generated based on the error message.

[0234] Step 5) specifically includes:

[0235] The results show that the agent calls the program running tool to execute the modeling program and continuously reads the training output.

[0236] A typical hydrological deep learning model is represented as follows:

[0237]

[0238] In the formula, X t Let z represent the dynamic input sequence, θ represent the object attribute data, and Y represent the model parameters. t This represents the model output.

[0239] During training, the system calculates the loss and updates the model parameters based on the training data, and saves model checkpoints based on the validation results. After testing, the system uses an index calculation tool to calculate hydrological evaluation indicators and generates predicted sequences, measured sequences, error statistics, and an evaluation report. For batch local modeling tasks, the system builds models based on the modeling object identifiers.

[0240]

[0241] In the formula, θ b X represents the model parameters obtained by independently training the b-th modeling object. b,t Let z represent the dynamic input sequence of the b-th object. b This represents object attributes. Model parameters are not shared between different objects; model files, prediction results, and evaluation metrics are stored separately.

[0242] Step 6) specifically includes:

[0243] In this embodiment, the global modeling module (implemented as a task skill) is triggered only when the following conditions are met simultaneously: a) the user explicitly requests that multiple modeling objects share model parameters; b) dynamic hydrological data of multiple modeling objects are detected; c) object attribute data that can be associated with dynamic hydrological data through modeling object identifiers are detected.

[0244] The global modeling module establishes the association between dynamic data and object attribute data according to the modeling object identifier, and constructs joint training samples:

[0245]

[0246] In the formula, X b,t Let z represent the dynamic input sequence of the b-th object. b Represents an object property, y b,t 'b' represents the target data, and 'b' represents the identifier of the modeling object. Multiple objects are trained together to share a single parameter model.

[0247] To reduce training bias caused by differences in the scale of target variables among different objects, a training adjustment coefficient can be set based on the scale statistics of the target data during the training period for each object. The general form of the training objective for a shared model is expressed as:

[0248]

[0249] In the formula, N represents the number of joint training samples, b i Let y represent the modeling object to which the i-th joint training sample belongs. i Let w represent the corresponding target data, ℓ() represent the basic error function, and w bi This represents the training adjustment coefficient for the corresponding object. After the model training is completed, the evaluation index for each object is calculated based on the object identifier, and object-by-object evaluation results and overall statistical results are generated.

[0250] In this embodiment, during the execution of steps 2) to 6) above, each agent or global modeling module calls the integrated tool module through the standardized tool call interface.

[0251] The integrated tools module includes a core hydrological modeling toolset and a system control and cognitive support toolset.

[0252] The core hydrological modeling toolset is used for data cleaning, data partitioning, scaling, model training, model validation, index calculation, experimental recording, and results visualization. The system control and cognitive support toolset is used for file operations, code analysis, program execution, system resource monitoring, numerical calculation, and auxiliary information acquisition.

[0253] Each tool is registered using its tool name, function description, input parameter pattern, and output result pattern. The structured tool invocation request generated by the agent or task skill component is represented as follows:

[0254]

[0255] In the formula, I t Indicates tool identifier, P t Represents the parameter name and the set of parameter values, Λ t E represents the data type corresponding to each parameter. t This indicates the expected output type. The tool server checks required fields, parameter types, parameter ranges, data paths, and access permissions based on predefined parameter patterns. The corresponding tool is executed only after validation; if validation fails, an error field and error reason are returned.

[0256] The tool execution feedback is expressed as follows:

[0257]

[0258] In the formula, Y t L represents the data or numerical results generated by the tool. t Indicates the runtime log, X t Z represents the exception type and exception stack trace. t Indicates the tool's execution status.

[0259] After reading the execution feedback, the agent determines the next operation according to the following rules: when Z... t When Z indicates success and the result meets the requirements, proceed to the next step; when Z t When the parameter is incorrect, according to X t Modify the calling parameters and call again; when the tool's returned results are not suitable for the current task, select other candidate tools; when the exception originates from previous data, code, or configuration, return to the corresponding modeling stage for reprocessing. This forms a closed loop of "task reasoning - tool call - execution feedback - strategy correction".

[0260] Furthermore, during the execution of the above steps, the runtime feedback and recovery module continuously reads the execution status, runtime logs, exception information, and status checkpoints from the task-level workspace. Diagnostic feedback includes program output, exception stack trace, training loss, validation metrics, test metrics, and warning messages. The i-th status checkpoint is represented as:

[0261]

[0262] In the formula, D i Indicates the data status corresponding to the checkpoint, C i Indicates the program and configuration status, Θ i R represents the state of model parameters. i Indicates the running feedback status, ν i This indicates the checkpoint version identifier.

[0263] In this embodiment, checkpoints are established at key stages such as data preprocessing completion, modeling program generation, model training completion, and evaluation result generation.

[0264] When the system detects errors in data fields, tensor dimensions, program execution, model training, or evaluation files, it locates the source of the error based on the error stack, tool status, and current execution stage.

[0265] If the anomaly occurs during the model training phase, but the model-ready data and modeling procedures are valid, then the most recent valid checkpoint before model training is read, and only the model training and evaluation phases are re-executed.

[0266] If the anomaly is caused by a data dimension or sample time alignment error, restore the data to its valid state before preprocessing and re-execute the data preprocessing and subsequent stages.

[0267] When the executable program completes its operation normally, the model file, prediction results, and evaluation results have been generated, and the logs and metrics can be parsed normally, the task is deemed to have met the completion conditions, and the executable modeling program, the trained model, prediction results, evaluation results, visualization results, and modeling process records are output.

[0268] In this embodiment, the modeling object is not limited to a watershed, but can also be a hydrological station, reservoir, hydropower station, river section, or hydrological zone; the target variable is not limited to runoff, but can also be water level, flow rate, inflow, evapotranspiration, soil moisture content, or other continuous hydrological variables; the deep learning model used is not limited to a single model type, and can be selected from the standardized modeling workflow library according to the task requirements, such as recurrent neural networks, convolutional neural networks, attention networks, state-space networks, or other time series models.

[0269] The execution order of the above steps can be adjusted according to task dependencies. Technical features from different steps can be combined without causing technical conflicts. Subsequent embodiments may further provide specific data, model selection, training configuration, and hydrological evaluation results.

[0270] The technical solutions of the system and its modeling method described in this embodiment will be clearly and completely described below with reference to specific embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of the present invention.

[0271] It should be noted that, unless otherwise specified, the embodiments and features of this invention can be combined with each other.

[0272] Example 1: Batch local rainfall-runoff modeling based on the CAMELS dataset.

[0273] This embodiment uses 531 contiguous watersheds in the CAMELS dataset to verify the execution capability and hydrological simulation effect of the system described in this embodiment in a large-scale batch local modeling scenario.

[0274] 1) Data preparation.

[0275] This embodiment uses 531 watersheds with complete meteorological forcing, runoff observation and watershed static attributes.

[0276] The dynamic input data uses daily-scale meteorological forcing data, including precipitation, maximum temperature, minimum temperature, and other meteorological variables required for precipitation-runoff simulation. The target variable is daily-scale runoff, expressed as runoff depth per unit area.

[0277] This embodiment defines the task as a rainfall-runoff simulation task, that is, using meteorological forcing data up to the simulation date to simulate the runoff of that day, without using historical observed runoff as model input. Therefore, for the b-th watershed, the local simulation model is expressed as:

[0278]

[0279] Where, θ b This represents the independent model parameters obtained solely from the data of the b-th watershed.

[0280] The data is divided into the following time periods: internal training period from October 1, 1999 to September 30, 2006; internal validation period from October 1, 2006 to September 30, 2008; and independent testing period from October 1, 1989 to September 30, 1999. The independent testing period did not participate in the calculation of data transformation parameters, model parameter selection, or training process; it was only used for final performance evaluation.

[0281] 2) Task input and path selection.

[0282] The user inputs a batch local modeling requirement into the system, requesting the creation of rainfall-runoff simulation models for 531 watersheds, with each watershed model having independent parameters. The task analysis agent reads 531 dynamic data files and corresponding metadata, identifies that the current task involves multiple modeling objects, but does not require different watersheds to share model parameters. Therefore, the task is classified as a batch local modeling task, a batch local modeling identifier is generated, and the default multi-agent collaborative path is continued.

[0283] 3) Data preprocessing.

[0284] The data preprocessing agent reads dynamic meteorological data and runoff observation data one by one according to the watershed identifier, checks the continuity of dates, field integrity and variable type, and generates training set, validation set and test set according to the above time range.

[0285] For each watershed, the data preprocessing agent uses only the training data of that watershed to calculate the transformation parameters of the input variables, and applies the same parameters to the validation and test sets of the corresponding watershed.

[0286] In this embodiment, static watershed attributes are used for watershed identification, data registration, and task management. Since each local model corresponds to only one watershed, the model mainly learns the rainfall-runoff response relationship of the watershed based on dynamic meteorological forcing.

[0287] After processing is complete, the data preprocessing agent generates independent model-ready data files and data processing reports for each watershed and writes them to the shared workspace.

[0288] 4) Model selection and automatic assembly.

[0289] The model building agent reads the task report and data features of each watershed, and matches candidate model components from the standardized modeling workflow module.

[0290] In this embodiment, the system autonomously selects LSTM model components and synchronously matches time-series data loading and training components that are compatible with the LSTM input format, forming 531 sets of parameter-independent executable modeling programs.

[0291] The model building agent performs compatibility checks on the output tensor of the data loading component and the input tensor of the LSTM model, and writes the input window length, the number of dynamic variables, model parameters and training parameters into the configuration file.

[0292] The model structure, training configuration, and program version are all saved separately according to the watershed identifier.

[0293] 5) Model training and evaluation.

[0294] The results show that the agent starts model training according to the watershed identifier. Each watershed LSTM model updates its parameters using only the training samples from the corresponding watershed and saves the model based on its performance on the corresponding validation set.

[0295] During the testing phase, the Nash efficiency coefficient is calculated using data from the independent testing period. The calculation expression is as follows:

[0296]

[0297] Among them, Q b,t Let q represent the measured runoff in the b-th watershed at time t. b,t Indicates simulated runoff, This represents the mean measured runoff during the test period, and nb represents the number of samples during the test period.

[0298] After the system completed independent training and testing for 531 watersheds, the NSE of each watershed was sorted in ascending order and the median was calculated.

[0299] 6) Implementation results.

[0300] In this embodiment, the system automatically completes task parsing, data processing, LSTM model selection, program assembly, model training, watershed-by-watershed testing, and index summarization. The median NSE for the testing period of 531 watersheds was 0.59. This result demonstrates that the system described in this embodiment can perform batch precipitation-runoff simulations with independent parameters on multiple modeling objects without requiring manual writing and configuration of 531 sets of modeling programs, and outputs parsable model files, watershed-level evaluation results, and overall statistical results, verifying the feasibility of the default multi-agent collaborative path in large-scale batch local modeling tasks.

[0301] Example 2: Global Rainfall-Runoff Modeling Based on the CAMELS Dataset

[0302] This embodiment uses the same 531 watersheds as in Embodiment 1 to verify the execution capability and hydrological simulation effect of the system described in this embodiment in a global modeling scenario with shared parameters among multiple objects.

[0303] 1) Task input and global modeling Skill trigger.

[0304] In this embodiment, the user explicitly proposed using 531 watersheds to jointly train a shared parameter rainfall-runoff model.

[0305] The task analysis agent reads the data registration information in the shared workspace and confirms:

[0306] First, the user explicitly stated the requirement for global modeling;

[0307] Second, there are dynamic meteorological and runoff data files corresponding to 531 watersheds respectively;

[0308] Third, there exists static watershed attribute data that can be matched with dynamic data according to watershed identifiers.

[0309] When the above conditions are met simultaneously, the task analysis agent writes the global modeling module trigger identifier into the structured task analysis report.

[0310] The system retains the task analysis agent and its analysis report, suspends the calling of the data preprocessing agent, model building agent and result presentation agent in the default path, and the global modeling module loads the dedicated process constraint information and the global modeling version standardized modeling workflow module to take over the subsequent modeling process.

[0311] 2) Organization of dynamic data and static attributes.

[0312] In this embodiment, the dynamic input uses the same daily-scale meteorological forcing data as in Embodiment 1, and the target variable is daily-scale runoff.

[0313] In addition, this embodiment introduces 27 watershed static attributes, which include five categories of information: topographic features, climate index, soil properties, vegetation cover, and geological features.

[0314] The global modeling module establishes the correlation between dynamic time series and static attributes based on watershed identifiers. For the b-th watershed, a dynamic input x is generated. b,t static attribute vector z b Target data Q b,t The training samples consist of a watershed identifier b and a joint training sample. The data partitioning uses the same time range as in Example 1.

[0315] 3) Global data transformation.

[0316] In this embodiment, the global modeling module merges training samples from multiple watersheds to form global training data, and uses only the global training data to fit the transformation parameters of non-target input features.

[0317] Both the validation and test sets reuse the parameters determined during training and do not participate in parameter fitting.

[0318] The target runoff retains its original physical dimensions and is not standardized according to the watershed target value. The system calculates the scale statistics of the target data during the training period for each watershed and saves the mapping relationship between the watershed identifier and the scale statistics, which is only used for scale balancing of subsequent training losses. This data processing method is consistent with the implementation in the final normalization program.

[0319] 4) Model selection and automated assembly

[0320] The global modeling module selects the multi-basin data loading component, static attribute fusion component, shared model component, scale balance loss component, and watershed evaluation component from the standardized modeling workflow module through the shared workspace module.

[0321] In this embodiment, the system autonomously selects LSTM as the shared parameter model. For the b-th watershed, the model is represented as:

[0322]

[0323] All watersheds share the same set of model parameters θ.

[0324] To mitigate the impact of differences in target magnitude and fluctuation levels across different watersheds on the overall training loss, this embodiment constructs a scale-balanced loss based on the standard deviation of the target data during the training period for each watershed. One specific implementation is as follows:

[0325]

[0326] Where N represents the number of joint training samples, b i σ represents the watershed to which the i-th sample belongs. bi ε represents the standard deviation of the target data during the training period of the corresponding watershed, and ε represents the stability constant to prevent the denominator from being zero.

[0327] Training samples from different watersheds participate in the parameter updates of the same LSTM model. During model training, shared model parameters are saved based on the performance on the validation set, and training logs, model configurations, and model checkpoints are written to the shared workspace.

[0328] 5) Basin-by-basin testing and results summary.

[0329] In this embodiment, after completing the training of the shared model, the global modeling module performs tests on 531 watersheds separately during the independent testing period. The system groups the prediction results according to the watershed identifier, calculates the NSE for each watershed, and generates a watershed-by-watershed evaluation file. Subsequently, the NSEs of the 531 watersheds are aggregated and the median is calculated.

[0330] 6) Implementation results.

[0331] In this embodiment, the task analysis agent triggers the global modeling module based on the task analysis report. The global modeling module automatically completes multi-basin data association, static attribute fusion, joint sample construction, LSTM shared model selection, scale-balanced training, watershed-by-watershed testing, and result summarization. The median NSE for the independent testing period of 531 watersheds is 0.73. Compared with Embodiment 1, global modeling uses multiple watersheds to jointly train a shared parameter model and utilizes static attributes to describe the differences in topography, climate, soil, vegetation, and geology between different watersheds. This enables the model to learn the shared rainfall-runoff response patterns across watersheds while maintaining the ability to distinguish watershed heterogeneity.

[0332] The above implementation results show that the system described in this embodiment can not only perform large-scale batch local modeling through the default multi-agent collaborative path, but also automatically switch to the multi-object shared parameter modeling process through the global modeling skill when the preset trigger conditions are met, thereby verifying the automatic adaptation capability and technical feasibility of the system described in this embodiment under different hydrological modeling modes.

[0333] Other implementation methods

[0334] In other implementations, the hydrological modeling object is not limited to a watershed, but can also be a hydrological station, reservoir, hydropower station, river section, or hydrological zone; the target variable is not limited to runoff, but can also be water level, flow rate, inflow, evapotranspiration, soil moisture content, or other continuous hydrological variables. The model used is not limited to LSTM; other recurrent neural networks, convolutional neural networks, attention networks, state-space models, or other deep learning models suitable for hydrological time series can be selected from a standardized modeling workflow library, depending on the data structure, sample size, and modeling requirements.

[0335] The data transformation methods, training losses, and evaluation metrics used in batch local modeling and global modeling are not limited to the above embodiments. Any approach employing the multi-agent collaboration, shared workspace, standardized modeling workflow assembly, standardized tool invocation, task skill takeover, and feedback correction mechanisms described in this invention falls within the scope of this invention's technical concept.

[0336] In the description of this specification, the terms "an embodiment," "specific embodiment," "example," or "specific example," etc., refer to specific features, structures, or methods described in connection with that embodiment that are included in at least one embodiment of the present invention. The technical features in the above embodiments can be combined with each other without contradicting each other. The terms "first," "second," etc., used in this specification are for distinguishing descriptions only and should not be construed as indicating relative importance; "multiple" refers to two or more, unless otherwise expressly defined.

Claims

1. A hydrological deep learning modeling system based on a large-scale multi-agent model, characterized in that, The system comprises a task analysis agent, a data preprocessing agent, a model building agent, and a result presentation agent connected in sequence, all of which are built based on a large language model. The system also includes a global modeling module, a comprehensive tool module, a shared workspace module, a standardized modeling workflow module, and a runtime feedback and recovery module. The comprehensive tool module and the shared workspace module are respectively connected to each agent and the global modeling module. The model building agent is also connected to the standardized modeling workflow module, and the shared workspace module is also connected to the runtime feedback and recovery module. The shared workspace module is used to store and manage various types of data in the hydrological modeling process, including: task reports, hydrological data, data processing results, program code, model configuration, model parameters, operation logs, anomaly information, evaluation results, and status checkpoints. The task analysis agent is used to parse the hydrological deep learning modeling task from the user prompt words in the data read from the shared workspace module, generate a structured task analysis report and store it in the shared workspace; the task analysis agent is also used to call the global modeling module when the modeling task meets the global modeling triggering conditions; The data preprocessing agent is used to call the integrated tool module to complete data inspection, cleaning, time alignment, sample construction and dataset partitioning based on the structured task analysis report and related hydrological data read from the shared workspace, generate model-ready data and data processing report and store them in the shared workspace. The standardized modeling workflow module is used to store data loading, data preprocessing, model and training components, as well as the input and output interfaces, tensor dimension constraints, applicable conditions, parameter fields and combination rules of each component, providing support for component selection and automatic assembly of the modeling program. The model building agent is used to select and assemble components that are compatible with the modeling task from the standardized modeling workflow module based on the structured task analysis report, model ready data and data processing report read from the shared workspace, and generate a data loading program, a model definition program, a training program and a model configuration file and store them in the shared workspace. The result presentation agent is used to read the executable modeling program and model configuration file from the shared workspace, complete model training, verification, testing, evaluation index calculation and result visualization, and generate the trained model, prediction results, evaluation results and modeling report and store them in the shared workspace. The integrated tool module is used to provide various tools in the modeling process to each agent and the global modeling module, and to return the structured execution results, running logs, exception information and execution status to the corresponding agent or module. Then, the agent or module writes the received data into the shared workspace module. The global modeling module, implemented as a task skill, takes over the modeling process after task analysis when the global modeling trigger conditions are met. It reads the structured task analysis report, task status, dynamic data of multiple modeling objects, and corresponding object attribute data from the shared workspace module, and sends a structured tool call request to the integrated tool module to complete multi-object data association, joint sample construction, data processing, shared parameter model training, and object-specific evaluation. It receives the structured execution results, runtime logs, exception information, and execution status returned by the integrated tool module, and adjusts subsequent operations based on the execution results. Finally, it writes the generated joint training samples, modeling program, model configuration, shared parameter model, object-specific prediction results, evaluation results, runtime logs, exception information, and status checkpoints into the shared workspace module. The operation feedback and recovery module is used to read the operation logs, exception information, evaluation results and status checkpoints stored in the shared workspace module to determine the execution status of the current modeling stage; when an exception is detected, the corresponding modeling stage is located, and the corresponding agent or the global modeling module is controlled to re-execute based on the most recent valid status checkpoint.

2. The system according to claim 1, characterized in that, Also includes: The shared workspace module includes a system-level shared resource area and a task-level workspace; The system-level shared resource area is used to store raw hydrological data, as well as the programs, components, configurations and execution rules corresponding to the integrated tool module, the standardized modeling workflow module and the global modeling module. Each intelligent agent only has read or call permissions. The task-level workspace is created after receiving a modeling task and is used to store task-related data and components copied from the system-level shared resource area, as well as task reports, processed data, program code, model configuration, model parameters, running logs, exception information, evaluation results and status checkpoints generated during the modeling process. Each intelligent agent reads, creates, modifies, and writes files in the task-level workspace through the integrated tool module.

3. The system according to claim 2, characterized in that, Also includes: The system-level shared resource area is equipped with a metadata registry, which records the data object identifier, file path, variable fields, time range, data version, access permissions, and task status of each file in the system-level shared resource area and the task-level workspace. This enables each agent to locate the required resources based on the metadata and write the processing results into the task-level workspace corresponding to the current task.

4. A hydrological deep learning modeling method based on the system described in any one of claims 2 and 3, characterized in that, include: 1) Initialize the hydrological deep learning modeling task; The system receives modeling requirements input by the user, creates a task-level workspace, loads task-related hydrological data, metadata, and callable resources, and initializes the task status. 2) The task analysis agent parses the modeling task and determines the execution path; The task analysis agent generates a structured task analysis report by combining user prompts and data metadata, and determines whether to execute the default multi-agent collaborative modeling path or the global modeling path; if the default multi-agent collaborative modeling path is executed, proceed to step 3); if the global modeling path is executed, proceed to step 6). 3) Under the default multi-agent collaborative modeling path, the data preprocessing agent completes data inspection, cleaning, time alignment, sample construction and dataset partitioning based on the structured task analysis report, and generates model-ready data and data processing report; 4) The model building agent selects and assembles mutually compatible data loading components, model components, and training components from the standardized modeling workflow module based on the structured task analysis report and model ready data, and generates an executable modeling program and model configuration file. 5) Results Presentation: The intelligent agent executes the modeling program, completes model training, validation, testing, evaluation metric calculation, and result visualization, and generates the trained model, prediction results, evaluation results, and modeling report, then proceeds to step 7). 6) Under the global modeling path, the global modeling module completes the modeling task; among which, the global modeling module performs multi-object data association, joint sample construction, shared parameter model training, and object-specific evaluation, and then proceeds to step 7). 7) Summarize and output modeling results; After the corresponding modeling path meets the preset completion conditions, the system summarizes and packages the executable modeling program, the trained model, the prediction results, the evaluation results, the visualization results, and the modeling process record from the task-level workspace.

5. The method according to claim 4, characterized in that, The initialization of the hydrological deep learning modeling task specifically includes: 1) The system receives the natural language modeling requirements, hydrological data descriptions and related task parameters submitted by the user, generates a unique task identifier for the current modeling task, and creates a task-level workspace corresponding to the task identifier in the shared workspace module. After the task-level workspace is created, the system initializes the task status record, registering the task identifier, creation time, current execution stage, task completion status, and file storage location, providing a unified operating space for subsequent intelligent agents and the global modeling module to read previous results, write stage results, and recover abnormal tasks; 2) Set up a metadata registry in the system-level shared resource area of ​​the shared workspace module; in the metadata registry, each data object corresponds to one metadata record; For the j-th data object, its metadata is represented as follows: In the formula, id j p represents the data object identifier. j Indicates the data path, b j X represents the identifier of the modeling object. j Y represents the set of candidate input variables. j Let Δt represent the set of candidate target variables. j Indicates time resolution, Ω j V indicates a time range. j Indicates the data version; 3) Initialize the task-level workspace state; Among them, the task-level workspace stores intermediate data and modeling results generated during the execution of multi-agent processes; The shared workspace state corresponding to the i-th modeling iteration is represented as: In the formula, T i D represents the task description and task constraint status. i C represents hydrological data and its processing status. i Indicates the status of program code and configuration files, M i Indicates the model definition or model parameter state, R i Indicates the status of program execution, model evaluation, and anomaly feedback; When each agent executes its task for this phase, it first reads the preceding state from the task-level workspace; after execution, it immediately writes the new results of this phase back to the task-level workspace; the update process of the shared state is represented as follows: In the formula, F k This represents the state update process of the k-th agent, O. i This represents the structured result generated after the agent invokes a tool or executes a program.

6. The method according to claim 5, characterized in that, The task analysis agent parses the modeling task and determines the execution path, specifically including: 1) The task analysis agent receives the natural language task U input by the user, reads the metadata set Γ, and combines it with the task analysis hints and constraints P. T Generate a structured task analysis report; wherein the task analysis prompts constraint P T The system prompts, pre-configured in the task analysis agent, are loaded when the task analysis agent is instantiated or started. These prompts define the task analysis agent's role and responsibilities, task parsing rules, structured output format, information integrity check rules, and execution path determination rules. The structured task analysis report is represented as follows: The structured task analysis report includes: task type, including hydrological simulation or hydrological prediction; type and number of modeling objects; dynamic input variables, static attribute variables, and target variables; input window length, target length, and input-output time relationship; data partitioning method and data transformation requirements; candidate model requirements, training requirements, and evaluation indicators; whether each modeling object is trained with an independent model; whether each modeling object shares model parameters; and whether there is object attribute data that can be matched with dynamic data. 2) Determine the temporal relationship of the hydrological samples; For a hydrological time series containing d input variables, assuming the historical input window length is L, the input tensor representation for time t is: In the formula, X t x represents the input tensor corresponding to time t; τ This represents the input variable vector corresponding to time τ, where the input variable vector contains d dynamic input variables corresponding to that time; x t−L+1 x represents the input variable vector at the start of the input window. t This represents the vector of input variables at the end of the input window; L represents the number of time steps contained in the input window, and d represents the number of input variables contained in each time step. Let the initial offset of the target be δ, and the length of the target sequence be H, then the corresponding target representation is: In the formula, Y t The representation is related to the input tensor X. t The corresponding target sequence; y τ This represents the value of the target variable corresponding to time τ; When δ=0, and X t When non-target hydro-meteorological variables containing time t are included, a current hydrological simulation task is constructed; when δ≥1, a future hydrological prediction task is constructed; the task analysis agent writes L, H, δ, input fields and target fields into the task analysis report, so that the data preprocessing agent can construct samples according to unified rules; 3) The task analysis agent performs matching on candidate data objects in the metadata registry based on the structured task analysis report; Candidate data objects are represented as: In the formula, Match(T,Γ) j The ) indicates the degree of matching between the task report and the j-th data object in terms of modeling object, input fields, target fields, time scale, and data organization. If multiple data objects satisfy the task constraints, retain all data objects that meet the conditions, and create a data object set according to the modeling object identifier: In the formula, τ D This indicates the preset data matching threshold; When the data object collection contains only one modeling object, perform single-object local modeling; When the data object collection contains multiple modeling objects and each object is trained with an independent model, perform batch local modeling. When multiple modeling objects require sharing the same set of model parameters and meet the global modeling skill conditions, the global modeling path is entered; where, for the s-th task skill component, its triggering state is represented as: In the formula, c s,j (T,D) represents the j-th trigger condition of the s-th task skill component, where T represents the structured task analysis report, D represents the currently registered data status, and m s Indicates the number of triggering conditions; When G s When G = 0, continue executing the default multi-agent cooperative path; when G s When =1, the execution results of the task analysis agent are retained, while the data preprocessing agent, model building agent, and result presentation agent are paused. The corresponding Skill inherits the task state and data state. After the Skill completes its execution, the generated data, program, model, and evaluation results are rewritten to the shared workspace.

7. The method according to claim 6, characterized in that, The generated model-ready data and data processing report specifically include: The data preprocessing agent reads the corresponding hydrological data based on the structured task analysis report and performs the following tasks in sequence: a) Check if the time field can be parsed correctly and the data can be arranged in chronological order; b) Identify duplicate time records and retain or merge them according to preset rules; c) Calculate the missing rate for each field and process the missing data using deletion, interpolation, statistical imputation, or other preset methods; d) Detect outliers based on variable range, statistical distribution, or engineering constraints; e) Standardize the field names, units, and time resolution of different data files; f) Divide the training set, validation set, and test set according to the task requirements; g) Construct the model input and target samples according to L, H, and δ; For input data requiring scaling, the transformation parameters are determined using the training set: In the formula, Φ() represents the standardization, normalization, logarithmic transformation, or robust scaling transformation function, and η train This represents the transformation parameters determined solely from the training data; After completing the data processing, the data preprocessing agent outputs model-ready data and a data processing report.

8. The method according to claim 7, characterized in that, The generation of the executable modeling program and model configuration file specifically includes: 1) Select standardized modeling workflow components; The standardized modeling workflow module includes a set of data loading components, a set of data preprocessing components, a set of model components, and a set of training components; the metadata corresponding to the j-th component is represented as follows: In the formula, id j Indicates component identifier, type j Indicates the component type, I j and O j These represent the input interface and the output interface, respectively. j H represents a configurable parameter. j Represents tensor dimension constraints, R j Representing dependencies and composition rules; The model building agent first filters candidate data loading components based on task type and data format; then it filters candidate model components based on input sequence dimension, output target format, and task requirements; finally, it selects training components that are suitable for the candidate models. If adjacent component c j and c j+1 satisfy: Then it is determined that the adjacent components can be connected; wherein, TypeOut(c j ) indicates component c j The data type of the output data, TypeIn(c j+1 ) indicates component c j+1 Required input data type; ShapeOut(c j ) indicates component c j Output the dimensional structure of the tensor, ShapeIn(c j+1 ) indicates component c j+1 The required input tensor dimension structure; the symbol ~ indicates that the tensor dimension can be directly passed or can be adapted through preset transformation rules; When the data loading component outputs a 3D tensor while the model component requires a 2D tensor, if the preset adaptation rules allow flattening or pooling operations, adaptation code is generated; if no suitable adaptation rules exist, the current component combination is excluded and a new combination is selected. 2) Complete component assembly and parameter instantiation; The model building agent connects the selected data loading component, data preprocessing component, model component, and training component in the order of data flow to form a candidate workflow. Based on the structured task analysis report, the model building agent writes the data path, input fields, target fields, window length, output length, model dimensions, number of training epochs, batch size, optimizer, and evaluation metrics into the corresponding components. After completing parameter instantiation, it generates an executable modeling program including a data loading file, model definition file, training file, and configuration file. After the program is generated, the model building agent calls the code analysis tool to perform the following checks: a) Check if the program dependencies are complete; b) Check if the data path and output path exist; c) Check if the function parameter names and configuration fields are consistent; d) Check if the output dimension of the data loader is consistent with the input dimension of the model; e) Check if the output dimension of the model is consistent with the input dimension of the loss function; f) Check if the correct data partitions are called during the training, validation and testing phases. If the check passes, the program and configuration files will be written to the shared workspace; if the check fails, the component parameters will be modified or adaptation code will be generated based on the error message.

9. The method according to claim 8, characterized in that, The global modeling module completes the modeling task, specifically including: The global modeling module is triggered when all of the following conditions are met simultaneously: a) the user explicitly requests that multiple modeling objects share model parameters; b) dynamic hydrological data of multiple modeling objects are detected; c) object attribute data that can be associated with dynamic hydrological data through modeling object identifiers are detected. The global modeling module establishes the association between dynamic data and object attribute data according to the modeling object identifier, and constructs joint training samples: In the formula, X b,t Let z represent the dynamic input sequence of the b-th object. b Represents an object property, y b,t 'b' represents the target data, and 'b' represents the modeling object identifier; multiple objects are jointly trained on a shared parameter model. The training objective of the shared model is represented as: In the formula, N represents the number of joint training samples, b i Let y represent the modeling object to which the i-th joint training sample belongs. i Let w represent the corresponding target data, ℓ() represent the basic error function, and w bi This represents the training adjustment coefficient for the corresponding object.

10. The method according to claim 9, characterized in that, Also includes: During the execution of the method, the runtime feedback and recovery module continuously reads the execution status, runtime logs, exception information, and status checkpoints in the task-level workspace; diagnostic feedback includes program output, exception stack, training loss, validation metrics, test metrics, and warning information; The i-th state checkpoint is represented as: In the formula, D i Indicates the data status corresponding to the checkpoint, C i Indicates the program and configuration status, Θ i R represents the state of model parameters. i Indicates the running feedback status, ν i Indicates the checkpoint version identifier; When data field errors, tensor dimension errors, program execution errors, model training anomalies, or missing evaluation files are detected, the source of the anomaly is located based on the anomaly stack, tool status, and current execution stage. If the anomaly occurs during the model training phase, but the model-ready data and modeling program are valid, then read the most recent valid checkpoint before model training and re-execute only the model training and evaluation phases. If the anomaly is caused by a data dimension or sample time alignment error, restore the valid state before data preprocessing and re-execute data preprocessing and its subsequent stages; When the executable program completes its operation normally, the model file, prediction results, and evaluation results have been generated, and the logs and metrics can be parsed normally, the task is deemed to have met the completion conditions, and the executable modeling program, the trained model, prediction results, evaluation results, visualization results, and modeling process records are output.